This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc / syslib / ibm44x_common.c
index 4029c43..76d18d3 100644 (file)
@@ -3,8 +3,8 @@
  *
  * PPC44x system library
  *
- * Matt Porter <mporter@kernel.crashing.org>
- * Copyright 2002-2004 MontaVista Software Inc.
+ * Matt Porter <mporter@mvista.com>
+ * Copyright 2002-2003 MontaVista Software Inc.
  *
  * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
  * Copyright (c) 2003, 2004 Zultys Technologies
  *
  */
 #include <linux/config.h>
-#include <linux/time.h>
 #include <linux/types.h>
 #include <linux/serial.h>
 
+#include <asm/param.h>
 #include <asm/ibm44x.h>
 #include <asm/mmu.h>
 #include <asm/machdep.h>
 #include <asm/time.h>
 #include <asm/ppc4xx_pic.h>
-#include <asm/param.h>
-
-#include <syslib/gen550.h>
 
 phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
 {
@@ -152,6 +149,44 @@ static void __init ibm44x_init_irq(void)
                irq_desc[i].handler = ppc4xx_pic;
 }
 
+#ifdef CONFIG_SERIAL_TEXT_DEBUG
+#include <linux/serialP.h>
+#include <linux/serial_reg.h>
+#include <asm/serial.h>
+
+static struct serial_state rs_table[RS_TABLE_SIZE] = {
+       SERIAL_PORT_DFNS        /* Defined in <asm/serial.h> */
+};
+
+static void ibm44x_progress(char *s, unsigned short hex)
+{
+       volatile char c;
+       volatile unsigned long com_port;
+       u16 shift;
+
+       com_port = (unsigned long)rs_table[0].iomem_base;
+       shift = rs_table[0].iomem_reg_shift;
+
+       while ((c = *s++) != 0) {
+               while ((*((volatile unsigned char *)com_port +
+                               (UART_LSR << shift)) & UART_LSR_THRE) == 0)
+                       ;
+               *(volatile unsigned char *)com_port = c;
+
+       }
+
+       /* Send LF/CR to pretty up output */
+       while ((*((volatile unsigned char *)com_port +
+               (UART_LSR << shift)) & UART_LSR_THRE) == 0)
+               ;
+       *(volatile unsigned char *)com_port = '\r';
+       while ((*((volatile unsigned char *)com_port +
+               (UART_LSR << shift)) & UART_LSR_THRE) == 0)
+               ;
+       *(volatile unsigned char *)com_port = '\n';
+}
+#endif /* CONFIG_SERIAL_TEXT_DEBUG */
+
 void __init ibm44x_platform_init(void)
 {
        ppc_md.init_IRQ = ibm44x_init_irq;
@@ -161,22 +196,7 @@ void __init ibm44x_platform_init(void)
        ppc_md.halt = ibm44x_halt;
 
 #ifdef CONFIG_SERIAL_TEXT_DEBUG
-       ppc_md.progress = gen550_progress;
+       ppc_md.progress = ibm44x_progress;
 #endif /* CONFIG_SERIAL_TEXT_DEBUG */
-#ifdef CONFIG_KGDB
-       ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
-#endif
-
-       /*
-        * The Abatron BDI JTAG debugger does not tolerate others
-        * mucking with the debug registers.
-        */
-#if !defined(CONFIG_BDI_SWITCH)
-       /* Enable internal debug mode */
-        mtspr(SPRN_DBCR0, (DBCR0_IDM));
-
-       /* Clear any residual debug events */
-       mtspr(SPRN_DBSR, 0xffffffff);
-#endif
 }