summaryrefslogtreecommitdiff
path: root/cpu/mc9328/serial.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-06-19 21:19:10 +0000
committerwdenk <wdenk>2004-06-19 21:19:10 +0000
commit49822e23a09e2f529e6774ad61f23e43ab208cbc (patch)
treed6cbe0c141f10778b944fddbfc473a91d4bea7c0 /cpu/mc9328/serial.c
parent46a414dc12c7809ac3c3e82b6198a1f435d7489f (diff)
downloadu-boot-imx-49822e23a09e2f529e6774ad61f23e43ab208cbc.zip
u-boot-imx-49822e23a09e2f529e6774ad61f23e43ab208cbc.tar.gz
u-boot-imx-49822e23a09e2f529e6774ad61f23e43ab208cbc.tar.bz2
Patch by Josef Wagner, 04 Jun 2004:
- DDR Ram support for PM520 (MPC5200) - support for different flash types (PM520) - USB / IDE / CF-Card / DiskOnChip support for PM520 - 8 bit boot rom support for PM520/CE520 - Add auto SDRAM module detection for MicroSys CPC45 board (MPC8245) - I2C and RTC support for CPC45 - support of new flash type (28F160C3T) for CPC45
Diffstat (limited to 'cpu/mc9328/serial.c')
-rw-r--r--cpu/mc9328/serial.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/cpu/mc9328/serial.c b/cpu/mc9328/serial.c
index 45b6f8a..8dcfb80 100644
--- a/cpu/mc9328/serial.c
+++ b/cpu/mc9328/serial.c
@@ -1,6 +1,6 @@
/*
- * cpu/mc9328/serial.c
- *
+ * cpu/mc9328/serial.c
+ *
* (c) Copyright 2004
* Techware Information Technology, Inc.
* http://www.techware.com.tw/
@@ -23,11 +23,10 @@
* MA 02111-1307 USA
*/
-
#include <common.h>
#include <mc9328.h>
-#if defined(CONFIG_UART1)
+#if defined(CONFIG_UART1)
/* GPIO PORT B */
#define reg_GIUS MX1_GIUS_C
@@ -35,7 +34,6 @@
#define GPIO_MASK 0xFFFFE1FF
#define UART_BASE 0x00206000
-
#elif defined (CONFIG_UART2)
/* GPIO PORT C */
@@ -44,7 +42,7 @@
#define GPIO_MASK 0x0FFFFFFF
#define UART_BASE 0x207000
-#endif
+#endif
#define reg_URXD (*((volatile u32 *)(UART_BASE+0x00)))
#define reg_UTXD (*((volatile u32 *)(UART_BASE+0x40)))
@@ -64,16 +62,13 @@
#define TXFE_MASK 0x4000 /* Tx buffer empty */
#define RDR_MASK 0x0001 /* receive data ready */
-
void serial_setbrg (void) {
-/* config I/O pins for UART */
-
+ /* config I/O pins for UART */
reg_GIUS &= GPIO_MASK;
reg_GPR &= GPIO_MASK;
-/* config UART */
-
+ /* config UART */
reg_UCR1 = 5;
reg_UCR2 = 0x4027;
reg_UCR4 = 1;
@@ -84,22 +79,18 @@ void serial_setbrg (void) {
reg_UBRC = 8;
}
-
-
/*
* Initialise the serial port with the given baudrate. The settings
* are always 8 data bits, no parity, 1 stop bit, no start bits.
*
*/
-
+
int serial_init (void) {
serial_setbrg ();
return (0);
}
-
-
/*
* Read a single byte from the serial port. Returns 1 on success, 0
* otherwise. When the function is succesfull, the character read is
@@ -112,7 +103,6 @@ int serial_getc (void) {
return (u8)reg_URXD;
}
-
/*
* Output a single byte to the serial port.
*/
@@ -129,7 +119,6 @@ void serial_putc (const char c) {
}
-
/*
* Test whether a character is in the RX buffer
*/
@@ -137,10 +126,8 @@ int serial_tstc (void) {
return reg_USR2 & RDR_MASK;
}
-
void serial_puts (const char *s) {
while (*s) {
serial_putc (*s++);
}
}
-