[U-Boot] [PATCH] spi: cadence_qspi: remap iomem registers instead of just mapping

Ramon Fried ramon.fried at linux.intel.com
Wed Dec 19 15:14:19 UTC 2018


Some architectures(MIPS) requires real mapping of IOMEM,
other just define it as identity mapping. fix it.

Signed-off-by: Ramon Fried <ramon.fried at linux.intel.com>
---
 drivers/spi/cadence_qspi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index 11fce9c..3ae1526 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -284,8 +284,10 @@ static int cadence_spi_ofdata_to_platdata(struct udevice *bus)
 	int node = dev_of_offset(bus);
 	int subnode;
 
-	plat->regbase = (void *)devfdt_get_addr_index(bus, 0);
-	plat->ahbbase = (void *)devfdt_get_addr_index(bus, 1);
+	plat->regbase = (void *)dev_remap_addr_index(bus, 0);
+	plat->ahbbase = (void *)dev_remap_addr_index(bus, 1);
+	if (!plat->regbase || !plat->ahbbase)
+		return -EFAULT;
 	plat->is_decoded_cs = fdtdec_get_bool(blob, node, "cdns,is-decoded-cs");
 	plat->fifo_depth = fdtdec_get_uint(blob, node, "cdns,fifo-depth", 128);
 	plat->fifo_width = fdtdec_get_uint(blob, node, "cdns,fifo-width", 4);
-- 
2.7.4



More information about the U-Boot mailing list