summaryrefslogtreecommitdiffstats
path: root/cpu
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-09-18 09:21:33 +0000
committerwdenk <wdenk>2003-09-18 09:21:33 +0000
commit5f535fe170e2cd90ee65922cbad1a5428d85a9e6 (patch)
treed0b1d5af2252f461fd3533c90e5aa215d6ac5b1d /cpu
parentb0639ca33214eedeb026ce45ad1871d477cdbfb8 (diff)
downloadblackbird-obmc-uboot-5f535fe170e2cd90ee65922cbad1a5428d85a9e6.tar.gz
blackbird-obmc-uboot-5f535fe170e2cd90ee65922cbad1a5428d85a9e6.zip
* Patches by Anders Larsen, 17 Sep 2003:
- fix spelling errors - set GD_FLG_DEVINIT flag only after device function pointers are valid - Allow CFG_ALT_MEMTEST on systems where address zero isn't writeable - enable 3.rd UART (ST-UART) on PXA(XScale) CPUs - trigger watchdog while waiting in serial driver
Diffstat (limited to 'cpu')
-rw-r--r--cpu/pxa/cpu.c2
-rw-r--r--cpu/pxa/serial.c42
2 files changed, 32 insertions, 12 deletions
diff --git a/cpu/pxa/cpu.c b/cpu/pxa/cpu.c
index cc9b3ff408..6b82f04f7d 100644
--- a/cpu/pxa/cpu.c
+++ b/cpu/pxa/cpu.c
@@ -83,7 +83,7 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern void reset_cpu (ulong addr);
- printf ("reseting ...\n");
+ printf ("resetting ...\n");
udelay (50000); /* wait 50 ms */
disable_interrupts ();
diff --git a/cpu/pxa/serial.c b/cpu/pxa/serial.c
index c9d5f70bc4..cedebfe496 100644
--- a/cpu/pxa/serial.c
+++ b/cpu/pxa/serial.c
@@ -29,6 +29,7 @@
*/
#include <common.h>
+#include <watchdog.h>
#include <asm/arch/pxa-regs.h>
void serial_setbrg (void)
@@ -38,7 +39,7 @@ void serial_setbrg (void)
unsigned int quot = 0;
if (gd->baudrate == 1200)
- quot = 192;
+ quot = 768;
else if (gd->baudrate == 9600)
quot = 96;
else if (gd->baudrate == 19200)
@@ -53,7 +54,6 @@ void serial_setbrg (void)
hang ();
#ifdef CONFIG_FFUART
-
CKEN |= CKEN6_FFUART;
FFIER = 0; /* Disable for now */
@@ -82,9 +82,21 @@ void serial_setbrg (void)
BTIER = IER_UUE; /* Enable BFUART */
#elif defined(CONFIG_STUART)
-#error "Bad: not implemented yet!"
+ CKEN |= CKEN5_STUART;
+
+ STIER = 0;
+ STFCR = 0;
+
+ /* set baud rate */
+ STLCR = LCR_DLAB;
+ STDLL = quot & 0xff;
+ STDLH = quot >> 8;
+ STLCR = LCR_WLS0 | LCR_WLS1;
+
+ STIER = IER_UUE; /* Enable STUART */
+
#else
-#error "Bad: you didn't configured serial ..."
+#error "Bad: you didn't configure serial ..."
#endif
}
@@ -109,13 +121,17 @@ void serial_putc (const char c)
{
#ifdef CONFIG_FFUART
/* wait for room in the tx FIFO on FFUART */
- while ((FFLSR & LSR_TEMT) == 0);
-
+ while ((FFLSR & LSR_TEMT) == 0)
+ WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
FFTHR = c;
#elif defined(CONFIG_BTUART)
- while ((BTLSR & LSR_TEMT ) == 0 );
+ while ((BTLSR & LSR_TEMT ) == 0 )
+ WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
BTTHR = c;
#elif defined(CONFIG_STUART)
+ while ((STLSR & LSR_TEMT ) == 0 )
+ WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
+ STTHR = c;
#endif
/* If \n, also do \r */
@@ -135,6 +151,7 @@ int serial_tstc (void)
#elif defined(CONFIG_BTUART)
return BTLSR & LSR_DR;
#elif defined(CONFIG_STUART)
+ return STLSR & LSR_DR;
#endif
}
@@ -146,14 +163,17 @@ int serial_tstc (void)
int serial_getc (void)
{
#ifdef CONFIG_FFUART
- while (!(FFLSR & LSR_DR));
-
+ while (!(FFLSR & LSR_DR))
+ WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
return (char) FFRBR & 0xff;
#elif defined(CONFIG_BTUART)
- while (!(BTLSR & LSR_DR));
-
+ while (!(BTLSR & LSR_DR))
+ WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
return (char) BTRBR & 0xff;
#elif defined(CONFIG_STUART)
+ while (!(STLSR & LSR_DR))
+ WATCHDOG_RESET (); /* Reset HW Watchdog, if needed */
+ return (char) STRBR & 0xff;
#endif
}
OpenPOWER on IntegriCloud