summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2024-01-31 23:59:38 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-02-01 16:08:21 +0100
commitec3fa0f48cfcdc58bb13c2c3eed028d63b98131b (patch)
tree8557bb205c3181e1daf41645ca0ee3a56812d5d3
parent98121498922078f24d2e3117c0444a64958975bf (diff)
downloadbarebox-ec3fa0f48cfc.tar.gz
barebox-ec3fa0f48cfc.tar.xz
fpga: socfpga-fpga2sdram-bridge: always populate HANDOFF_FPGA2SDR register
The driver will take care to write the handoff register, when the bridge is first enabled or disabled. In the case that the driver merely probes the device and no explicit action is taken, the handoff value is never written. This is evident with a look at the console: barebox output: altera-fpga2sdram-bridge ffc25080.fpga-bridge@ffc25080.of: driver initialized with handoff 00003fff ^^^^ Linux output: altera_fpga2sdram_bridge ffc25080.fpga-bridge: driver initialized with handoff 00000000 ^^^^ The result of this that the Linux driver must be disabled, otherwise, it will just reset the same bridges that barebox had previously moved out of reset. Let's get rid of this discrepancy by moving the write to the handoff value into the probe function. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240131225938.1746123-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/fpga/socfpga-fpga2sdram-bridge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/fpga/socfpga-fpga2sdram-bridge.c b/drivers/fpga/socfpga-fpga2sdram-bridge.c
index 961a083ae5..7f72bd8a65 100644
--- a/drivers/fpga/socfpga-fpga2sdram-bridge.c
+++ b/drivers/fpga/socfpga-fpga2sdram-bridge.c
@@ -68,9 +68,6 @@ static inline int _alt_fpga2sdram_enable_set(struct alt_fpga2sdram_data *priv,
else
val = 0;
- /* The kernel driver expects this value in this register :-( */
- writel(priv->mask, SOCFPGA_SYSMGR_ADDR + SYSMGR_ISWGRP_HANDOFF3);
-
dev_dbg(priv->dev, "setting fpgaportrst to 0x%08x\n", val);
return writel(val, SOCFPGA_SDRCTL_ADDR + ALT_SDR_CTL_FPGAPORTRST_OFST);
@@ -110,6 +107,9 @@ static int alt_fpga_bridge_probe(struct device *dev)
if (!priv->mask) {
/* enable all ports if we don't know better */
priv->mask = ALT_SDR_CTL_FPGAPORTRST_PORTRSTN_MSK;
+ /* The kernel driver expects this value in this register :-( */
+ writel(priv->mask, SOCFPGA_SYSMGR_ADDR + SYSMGR_ISWGRP_HANDOFF3);
+
}
priv->dev = dev;