]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi, mpc8xx: Take parameter RAM relocation into account
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 3 May 2023 07:05:33 +0000 (09:05 +0200)
committerChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 5 May 2023 05:26:53 +0000 (07:26 +0200)
Instead of inhibiting parameter RAM relocation, take it into account.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
drivers/spi/mpc8xx_spi.c

index 734b0751a901bffb7e5c406e115accf7699c269e..5c8d760935141214fb73aed988c2ca86fcf940bf 100644 (file)
@@ -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.