diff options
| author | Tom Rini <[email protected]> | 2023-05-07 09:44:27 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-05-07 09:44:27 -0400 |
| commit | 1917a1a8a8bad28170cd464e5ea61ff0d738310b (patch) | |
| tree | 2dab7a37f9e7274e7ecdc7cc6f3e6fd19e90c54b /drivers | |
| parent | ae0772f333a7e76c4fb3771a77117b2f740d7c93 (diff) | |
| parent | 0ec8ebef87d78529d1b4f3e7beaced0b9fbea629 (diff) | |
Merge branch 'for-2023.07-2' of https://source.denx.de/u-boot/custodians/u-boot-mpc8xx
This pull request adds misc fixes for cssi boards and activates
CPM relocation in order to enable the use of SCC4 in
QMC (QUICC Multi-Channel) mode.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/serial/serial_mpc8xx.c | 24 | ||||
| -rw-r--r-- | drivers/spi/mpc8xx_spi.c | 8 |
2 files changed, 17 insertions, 15 deletions
diff --git a/drivers/serial/serial_mpc8xx.c b/drivers/serial/serial_mpc8xx.c index b8d6a81b650..d82760c7f10 100644 --- a/drivers/serial/serial_mpc8xx.c +++ b/drivers/serial/serial_mpc8xx.c @@ -83,15 +83,18 @@ static int serial_mpc8xx_probe(struct udevice *dev) immap_t __iomem *im = (immap_t __iomem *)CONFIG_SYS_IMMR; smc_t __iomem *sp; smc_uart_t __iomem *up; + u16 smc_rpbase; cpm8xx_t __iomem *cp = &(im->im_cpm); struct serialbuffer __iomem *rtx; /* initialize pointers to SMC */ sp = cp->cp_smc + SMC_INDEX; - up = (smc_uart_t __iomem *)&cp->cp_dparam[PROFF_SMC]; - /* Disable relocation */ - out_be16(&up->smc_rpbase, 0); + up = (smc_uart_t __iomem *)&cp->cp_dpmem[PROFF_SMC]; + + smc_rpbase = in_be16(&up->smc_rpbase); + if (smc_rpbase) + up = (smc_uart_t __iomem *)&cp->cp_dpmem[smc_rpbase]; /* Disable transmitter/receiver. */ clrbits_be16(&sp->smc_smcmr, SMCMR_REN | SMCMR_TEN); @@ -154,15 +157,12 @@ static int serial_mpc8xx_probe(struct udevice *dev) out_be16(&up->smc_maxidl, CONFIG_SYS_MAXIDLE); out_be32(&rtx->rxindex, 0); - /* Initialize Tx/Rx parameters. */ - while (in_be16(&cp->cp_cpcr) & CPM_CR_FLG) /* wait if cp is busy */ - ; - - out_be16(&cp->cp_cpcr, - mk_cr_cmd(CPM_CR_CH_SMC, CPM_CR_INIT_TRX) | CPM_CR_FLG); - - while (in_be16(&cp->cp_cpcr) & CPM_CR_FLG) /* wait if cp is busy */ - ; + out_be32(&up->smc_rstate, 0); + out_be32(&up->smc_tstate, 0); + out_be16(&up->smc_rbptr, CPM_SERIAL_BASE); + out_be16(&up->smc_tbptr, CPM_SERIAL_BASE + sizeof(cbd_t)); + out_be16(&up->smc_brkcr, 1); + out_be16(&up->smc_brkec, 0); /* Enable transmitter/receiver. */ setbits_be16(&sp->smc_smcmr, SMCMR_REN | SMCMR_TEN); diff --git a/drivers/spi/mpc8xx_spi.c b/drivers/spi/mpc8xx_spi.c index d84d7aea888..5c8d7609351 100644 --- a/drivers/spi/mpc8xx_spi.c +++ b/drivers/spi/mpc8xx_spi.c @@ -51,11 +51,13 @@ 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]; + 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. |
