summaryrefslogtreecommitdiffstats
path: root/arch/mips/ddb5476/dbg_io.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-12 12:42:52 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-12 12:42:52 +0000
commit72e9f1955cbbe443053bf2445b4045bd3bb7f7c4 (patch)
tree073ac406ee8ad23ce4dd587cdadec7e3e35cc061 /arch/mips/ddb5476/dbg_io.c
parentc4a2a91dd053af588f69a4da0f9408da334869f7 (diff)
The Code Police: Reformat according to Linus' style. No functional
changes.
Diffstat (limited to 'arch/mips/ddb5476/dbg_io.c')
-rw-r--r--arch/mips/ddb5476/dbg_io.c86
1 files changed, 42 insertions, 44 deletions
diff --git a/arch/mips/ddb5476/dbg_io.c b/arch/mips/ddb5476/dbg_io.c
index 121850a62..aad938a88 100644
--- a/arch/mips/ddb5476/dbg_io.c
+++ b/arch/mips/ddb5476/dbg_io.c
@@ -7,8 +7,8 @@
/* we need uint32 uint8 */
/* #include "types.h" */
-typedef unsigned char uint8;
-typedef unsigned int uint32;
+typedef unsigned char uint8;
+typedef unsigned int uint32;
/* --- END OF CONFIG --- */
@@ -69,59 +69,57 @@ typedef unsigned int uint32;
void debugInit(uint32 baud, uint8 data, uint8 parity, uint8 stop)
{
- /* disable interrupts */
- UART16550_WRITE(OFS_INTR_ENABLE, 0);
-
- /* set up buad rate */
- {
- uint32 divisor;
-
- /* set DIAB bit */
- UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
-
- /* set divisor */
- divisor = MAX_BAUD / baud;
- UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
- UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00)>>8);
-
- /* clear DIAB bit */
- UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
- }
-
- /* set data format */
- UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
+ /* disable interrupts */
+ UART16550_WRITE(OFS_INTR_ENABLE, 0);
+
+ /* set up buad rate */
+ {
+ uint32 divisor;
+
+ /* set DIAB bit */
+ UART16550_WRITE(OFS_LINE_CONTROL, 0x80);
+
+ /* set divisor */
+ divisor = MAX_BAUD / baud;
+ UART16550_WRITE(OFS_DIVISOR_LSB, divisor & 0xff);
+ UART16550_WRITE(OFS_DIVISOR_MSB, (divisor & 0xff00) >> 8);
+
+ /* clear DIAB bit */
+ UART16550_WRITE(OFS_LINE_CONTROL, 0x0);
+ }
+
+ /* set data format */
+ UART16550_WRITE(OFS_DATA_FORMAT, data | parity | stop);
}
static int remoteDebugInitialized = 0;
uint8 getDebugChar(void)
{
- if (!remoteDebugInitialized) {
- remoteDebugInitialized = 1;
- debugInit(UART16550_BAUD_38400,
- UART16550_DATA_8BIT,
- UART16550_PARITY_NONE,
- UART16550_STOP_1BIT);
- }
-
- while((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
- return UART16550_READ(OFS_RCV_BUFFER);
+ if (!remoteDebugInitialized) {
+ remoteDebugInitialized = 1;
+ debugInit(UART16550_BAUD_38400,
+ UART16550_DATA_8BIT,
+ UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+ }
+
+ while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
+ return UART16550_READ(OFS_RCV_BUFFER);
}
int putDebugChar(uint8 byte)
{
- if (!remoteDebugInitialized) {
- remoteDebugInitialized = 1;
- debugInit(UART16550_BAUD_9600,
- UART16550_DATA_8BIT,
- UART16550_PARITY_NONE,
- UART16550_STOP_1BIT);
- }
-
- while ((UART16550_READ(OFS_LINE_STATUS) &0x20) == 0);
- UART16550_WRITE(OFS_SEND_BUFFER, byte);
- return 1;
+ if (!remoteDebugInitialized) {
+ remoteDebugInitialized = 1;
+ debugInit(UART16550_BAUD_9600,
+ UART16550_DATA_8BIT,
+ UART16550_PARITY_NONE, UART16550_STOP_1BIT);
+ }
+
+ while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0);
+ UART16550_WRITE(OFS_SEND_BUFFER, byte);
+ return 1;
}
#endif