aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi/mpc8xx_spi.c
diff options
context:
space:
mode:
authorChristophe Leroy2023-05-03 09:05:33 +0200
committerChristophe Leroy2023-05-05 07:26:53 +0200
commit14e64c18019ea5361e260bec2a56620c4fe918a1 (patch)
treea1567bd082a02d3845f90c3bb869a46f1cfb309e /drivers/spi/mpc8xx_spi.c
parente7930e93cc6f8d442a86feeaa4c77332a875b02f (diff)
spi, mpc8xx: Take parameter RAM relocation into account
Instead of inhibiting parameter RAM relocation, take it into account. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Diffstat (limited to 'drivers/spi/mpc8xx_spi.c')
-rw-r--r--drivers/spi/mpc8xx_spi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/mpc8xx_spi.c b/drivers/spi/mpc8xx_spi.c
index 734b0751a90..5c8d7609351 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.