diff mbox series

[v2,11/17] powerpc: 8xx: Set SDMA configuration register correcly

Message ID ae8013855888d0a9c31fbc88a282378c52d5efe3.1713160866.git.christophe.leroy@csgroup.eu
State Accepted
Commit dcf7af5fd9af91674ace085663f8b69943a3c61d
Delegated to: Tom Rini
Headers show
Series Misc changes for CSSI boards | expand

Commit Message

Christophe Leroy April 15, 2024, 6:07 a.m. UTC
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 | 6 ++++++
 drivers/spi/mpc8xx_spi.c           | 4 ----
 2 files changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/arch/powerpc/cpu/mpc8xx/cpu_init.c b/arch/powerpc/cpu/mpc8xx/cpu_init.c
index aac4203a6e..d1abe8f00b 100644
--- a/arch/powerpc/cpu/mpc8xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc8xx/cpu_init.c
@@ -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:
 	 */
diff --git a/drivers/spi/mpc8xx_spi.c b/drivers/spi/mpc8xx_spi.c
index 2aa9c7d5df..0d142f12e9 100644
--- a/drivers/spi/mpc8xx_spi.c
+++ b/drivers/spi/mpc8xx_spi.c
@@ -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);