From: Christophe Leroy Date: Wed, 3 May 2023 08:31:19 +0000 (+0200) Subject: powerpc: mpc8xx: CPM parameter RAM can be anywhere X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=fdd243d81bcf5e7fdc8cc7b5060c0c6ed60c5c81;p=u-boot.git powerpc: mpc8xx: CPM parameter RAM can be anywhere With relocation, CPM parameter RAM can be anywhere in the dual port RAM, so don't split dual port RAM. Remove dparam and dparam16 members of struct comm_proc PROFF_XXX become offsets from the start of dual port RAM, then they are now consistant with the offsets in RPBASE registers. Signed-off-by: Christophe Leroy --- diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index 9b587fbbe8..56383cecde 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu.c +++ b/arch/powerpc/cpu/mpc8xx/cpu.c @@ -127,7 +127,7 @@ static int check_CPU(long clock, uint pvr, uint immr) return -1; k = (immr << 16) | - in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]); + in_be16((u16 __iomem *)&immap->im_cpm.cp_dpmem[PROFF_REVNUM]); /* * Some boards use sockets so different CPUs can be used. diff --git a/arch/powerpc/include/asm/cpm_8xx.h b/arch/powerpc/include/asm/cpm_8xx.h index 85903d2108..09c24efd91 100644 --- a/arch/powerpc/include/asm/cpm_8xx.h +++ b/arch/powerpc/include/asm/cpm_8xx.h @@ -92,15 +92,15 @@ typedef struct cpm_buf_desc { /* Parameter RAM offsets. */ -#define PROFF_SCC1 ((uint)0x0000) -#define PROFF_IIC ((uint)0x0080) -#define PROFF_REVNUM ((uint)0x00b0) -#define PROFF_SCC2 ((uint)0x0100) -#define PROFF_SPI ((uint)0x0180) -#define PROFF_SCC3 ((uint)0x0200) -#define PROFF_SMC1 ((uint)0x0280) -#define PROFF_SCC4 ((uint)0x0300) -#define PROFF_SMC2 ((uint)0x0380) +#define PROFF_SCC1 ((uint)0x1c00) +#define PROFF_IIC ((uint)0x1c80) +#define PROFF_REVNUM ((uint)0x1cb0) +#define PROFF_SCC2 ((uint)0x1d00) +#define PROFF_SPI ((uint)0x1d80) +#define PROFF_SCC3 ((uint)0x1e00) +#define PROFF_SMC1 ((uint)0x1e80) +#define PROFF_SCC4 ((uint)0x1f00) +#define PROFF_SMC2 ((uint)0x1f80) /* Define enough so I can at least use the serial port as a UART. */ diff --git a/arch/powerpc/include/asm/immap_8xx.h b/arch/powerpc/include/asm/immap_8xx.h index 3999a02b9c..cf1300f6e2 100644 --- a/arch/powerpc/include/asm/immap_8xx.h +++ b/arch/powerpc/include/asm/immap_8xx.h @@ -437,13 +437,7 @@ typedef struct comm_proc { * depending upon the devices used and options chosen. * Some processors don't have all of it populated. */ - u_char cp_dpmem[0x1C00]; /* BD / Data / ucode */ - - /* Parameter RAM */ - union { - u_char cp_dparam[0x400]; - u16 cp_dparam16[0x200]; - }; + u_char cp_dpmem[0x2000]; /* BD / Data / ucode / Param RAM */ } cpm8xx_t; /* Internal memory map. diff --git a/drivers/serial/serial_mpc8xx.c b/drivers/serial/serial_mpc8xx.c index b8d6a81b65..beffc34d11 100644 --- a/drivers/serial/serial_mpc8xx.c +++ b/drivers/serial/serial_mpc8xx.c @@ -89,7 +89,7 @@ static int serial_mpc8xx_probe(struct udevice *dev) /* initialize pointers to SMC */ sp = cp->cp_smc + SMC_INDEX; - up = (smc_uart_t __iomem *)&cp->cp_dparam[PROFF_SMC]; + up = (smc_uart_t __iomem *)&cp->cp_dpmem[PROFF_SMC]; /* Disable relocation */ out_be16(&up->smc_rpbase, 0); diff --git a/drivers/spi/mpc8xx_spi.c b/drivers/spi/mpc8xx_spi.c index d84d7aea88..734b0751a9 100644 --- a/drivers/spi/mpc8xx_spi.c +++ b/drivers/spi/mpc8xx_spi.c @@ -51,7 +51,7 @@ 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_dparam[PROFF_SPI]; + spi_t __iomem *spi = (spi_t __iomem *)&cp->cp_dpmem[PROFF_SPI]; cbd_t __iomem *tbdf, *rbdf; /* Disable relocation */