summaryrefslogtreecommitdiff
path: root/cpu/mpc8xx/serial.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2008-01-11 01:12:07 +0100
committerWolfgang Denk <wd@denx.de>2008-01-12 00:33:12 +0100
commitb423d055cc2e13c4ef1f0389c3fa2988d0eed818 (patch)
tree4acfb3e3909f170e826a89a0c2226b85e3f31e60 /cpu/mpc8xx/serial.c
parent381e4e639720d8d2efb8066c7c48ec9588cb28c7 (diff)
downloadu-boot-imx-b423d055cc2e13c4ef1f0389c3fa2988d0eed818.zip
u-boot-imx-b423d055cc2e13c4ef1f0389c3fa2988d0eed818.tar.gz
u-boot-imx-b423d055cc2e13c4ef1f0389c3fa2988d0eed818.tar.bz2
Enable SMC microcode relocation patch for SMC1.
Signed-off-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'cpu/mpc8xx/serial.c')
-rw-r--r--cpu/mpc8xx/serial.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpu/mpc8xx/serial.c b/cpu/mpc8xx/serial.c
index 68804cc..ad02299 100644
--- a/cpu/mpc8xx/serial.c
+++ b/cpu/mpc8xx/serial.c
@@ -124,6 +124,12 @@ static int smc_init (void)
sp = (smc_t *) &(cp->cp_smc[SMC_INDEX]);
up = (smc_uart_t *) &cp->cp_dparam[PROFF_SMC];
+#ifdef CFG_SMC_UCODE_PATCH
+ up = (smc_uart_t *) &cp->cp_dpmem[up->smc_rpbase];
+#else
+ /* Disable relocation */
+ up->smc_rpbase = 0;
+#endif
/* Disable transmitter/receiver.
*/
@@ -212,6 +218,12 @@ static int smc_init (void)
up->smc_tbase = dpaddr+sizeof(cbd_t);
up->smc_rfcr = SMC_EB;
up->smc_tfcr = SMC_EB;
+#if defined (CFG_SMC_UCODE_PATCH)
+ up->smc_rbptr = up->smc_rbase;
+ up->smc_tbptr = up->smc_tbase;
+ up->smc_rstate = 0;
+ up->smc_tstate = 0;
+#endif
#if defined(CONFIG_MBX)
board_serial_init();
@@ -288,6 +300,9 @@ smc_putc(const char c)
smc_putc ('\r');
up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC];
+#ifdef CFG_SMC_UCODE_PATCH
+ up = (smc_uart_t *) &cpmp->cp_dpmem[up->smc_rpbase];
+#endif
tbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_tbase];
@@ -326,6 +341,9 @@ smc_getc(void)
unsigned char c;
up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC];
+#ifdef CFG_SMC_UCODE_PATCH
+ up = (smc_uart_t *) &cpmp->cp_dpmem[up->smc_rpbase];
+#endif
rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];
@@ -351,6 +369,9 @@ smc_tstc(void)
volatile cpm8xx_t *cpmp = &(im->im_cpm);
up = (smc_uart_t *)&cpmp->cp_dparam[PROFF_SMC];
+#ifdef CFG_SMC_UCODE_PATCH
+ up = (smc_uart_t *) &cpmp->cp_dpmem[up->smc_rpbase];
+#endif
rbdf = (cbd_t *)&cpmp->cp_dpmem[up->smc_rbase];