]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
powerpc: 8xx: Set SDMA configuration register correcly
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 12 Apr 2024 11:19:47 +0000 (13:19 +0200)
committerChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 18 Apr 2024 13:47:46 +0000 (15:47 +0200)
SDMA configuration register needs to be set up only once and doesn't
belong to drivers. Also, the value to be used is different on mpc885.

So do the init in cpu_init_f() with 0x40 for mpc885 and 0x1 for others.

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

index aac4203a6e48227e5ebc3d8d784cfbf3dfbf30d8..d1abe8f00bfed717e6734047c02e5af59b799c91 100644 (file)
@@ -92,6 +92,12 @@ void cpu_init_f(immap_t __iomem *immr)
                                CONFIG_SYS_PLPRCR);
 #endif
 
+       /* Set SDMA configuration register */
+       if (IS_ENABLED(CONFIG_MPC885))
+               out_be32(&immr->im_siu_conf.sc_sdcr, 0x0040);
+       else
+               out_be32(&immr->im_siu_conf.sc_sdcr, 0x0001);
+
        /*
         * Memory Controller:
         */
index 2aa9c7d5df921b5773e38843d27e5c387ca7f0ea..0d142f12e969bb10fd4730a5b918a988170c936a 100644 (file)
@@ -103,10 +103,6 @@ static int mpc8xx_spi_probe(struct udevice *dev)
        while (in_be16(&cp->cp_cpcr) & CPM_CR_FLG)
                ;
 
-/* 5 */
-       /* Set SDMA configuration register */
-       out_be32(&immr->im_siu_conf.sc_sdcr, 0x0001);
-
 /* 6 */
        /* Set to big endian. */
        out_8(&spi->spi_tfcr, SMC_EB);