mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: str@pengutronix.de, ske@pengutronix.de,
	Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/4] ARM: socfpga: populate HANDOFF_FPGA2SDR with Quartus value
Date: Wed, 31 Jan 2024 23:59:36 +0100	[thread overview]
Message-ID: <20240131225938.1746123-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240131225938.1746123-1-a.fatoum@pengutronix.de>

The Terasic DE10-Nano is the only upstream board that has a non-zero
value for CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST in the headers generated by
Quartus. Yet, barebox ignored this value, with the effect that either:

  - The Linux bridge driver reads a zero value from the handoff3 register
    and keeps all fpga2sdram ports in reset

  - The barebox bridge driver uses its hardcoded mask of 0x3fff, when
    the bridge is enabled, which is different than the Quartus value
    of 0x1FF.

Fix the first point by populating the handoff3 register, so an enabled
Linux driver can enable the correct ports. A fix for barebox configurations
with CONFIG_SOCFPGA_FPGA_BRIDGE=y follows in the follow-up commit.

Cc: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/mach/socfpga/cyclone5-sdram-config.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/mach/socfpga/cyclone5-sdram-config.h b/include/mach/socfpga/cyclone5-sdram-config.h
index 06f06ef5d78f..2abef7f31121 100644
--- a/include/mach/socfpga/cyclone5-sdram-config.h
+++ b/include/mach/socfpga/cyclone5-sdram-config.h
@@ -155,6 +155,9 @@ static inline void socfpga_sdram_mmr_init(void)
 		CONFIG_HPS_SDR_CTRLCFG_DRAMODT_WRITE << SDR_CTRLGRP_DRAMODT_WRITE_LSB;
 	sdram_write(SDR_CTRLGRP_DRAMODT_ADDRESS, val);
 
+	val = CONFIG_HPS_SDR_CTRLCFG_FPGAPORTRST;
+	writel(val, ISWGRP_HANDOFF_FPGA2SDR);
+
 	val = readl(CYCLONE5_SDR_ADDRESS + SDR_CTRLGRP_STATICCFG_ADDRESS);
 	val &= ~(SDR_CTRLGRP_STATICCFG_APPLYCFG_MASK);
 	val |= 1 << SDR_CTRLGRP_STATICCFG_APPLYCFG_LSB;
-- 
2.39.2




  parent reply	other threads:[~2024-01-31 23:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 22:59 [PATCH master 0/4] ARM: socfpga: add HANDOFF_FPGA2SDR handling Ahmad Fatoum
2024-01-31 22:59 ` [PATCH master 1/4] ARM: socfpga: complete definitions of handoff registers Ahmad Fatoum
2024-01-31 22:59 ` Ahmad Fatoum [this message]
2024-01-31 22:59 ` [PATCH master 3/4] fpga: socfpga-fpga2sdram-bridge: consult HANDOFF_FPGA2SDR register Ahmad Fatoum
2024-01-31 22:59 ` [PATCH master 4/4] fpga: socfpga-fpga2sdram-bridge: always populate " Ahmad Fatoum
2024-02-01 15:08 ` [PATCH master 0/4] ARM: socfpga: add HANDOFF_FPGA2SDR handling Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240131225938.1746123-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=gwenhael.goavec-merou@trabucayre.com \
    --cc=ske@pengutronix.de \
    --cc=str@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox