diff mbox series

[08/10] spi, mpc8xx: Take parameter RAM relocation into account

Message ID cc192912c77404693303fb1b921f009de3bf0b84.1683190404.git.christophe.leroy@csgroup.eu
State Superseded
Delegated to: Tom Rini
Headers show
Series Misc fixes + 8xx CPM relocation | expand

Commit Message

Christophe Leroy May 4, 2023, 8:56 a.m. UTC
Instead of inhibiting parameter RAM relocation, take it into account.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 drivers/spi/mpc8xx_spi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/mpc8xx_spi.c b/drivers/spi/mpc8xx_spi.c
index 734b0751a9..5c8d760935 100644
--- a/drivers/spi/mpc8xx_spi.c
+++ b/drivers/spi/mpc8xx_spi.c
@@ -52,10 +52,12 @@  static int mpc8xx_spi_probe(struct udevice *dev)
 	immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
 	cpm8xx_t __iomem *cp = &immr->im_cpm;
 	spi_t __iomem *spi = (spi_t __iomem *)&cp->cp_dpmem[PROFF_SPI];
+	u16 spi_rpbase;
 	cbd_t __iomem *tbdf, *rbdf;
 
-	/* Disable relocation */
-	out_be16(&spi->spi_rpbase, 0x1d80);
+	spi_rpbase = in_be16(&spi->spi_rpbase);
+	if (spi_rpbase)
+		spi = (spi_t __iomem *)&cp->cp_dpmem[spi_rpbase];
 
 /* 1 */
 	/* Initialize the parameter ram.