Skip to contentSkip to conversation

DDB5xxx update and rockhopper II support

PATCH New Jun Sun 1 participant 1 message Jul 10, 2002

Subsystems (2)
lore
Share & tools
lore

Jun Sun

author
#0 lore raw

PATCH 1/1 DDB5xxx update and rockhopper II support

Ralf,

This patch is an update for DDB5xxx boards. It adds support to the latest rockhopper II baseboard. A couple of nice new features are added as well, such as automatical run-time board detection and bus frequency detection, etc.

Credits should go to Brad LeRonde and Alice Hennessy who did much of the work in this patch.

This patch does not apply to 2.5. I will create one or more new patches later for 2.5.

Jun

arch/mips/ddb5xxx/common/irq.c renamed from arch/mips/ddb5xxx/common/irq.c.orig +1 -0
diff -Nru linux/arch/mips/ddb5xxx/common/irq.c.orig linux/arch/mips/ddb5xxx/common/irq.c
@@ -13,6 +13,7 @@
  */
 #include <linux/config.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 
 void (*irq_setup)(void);
 
arch/mips/ddb5xxx/common/prom.c renamed from arch/mips/ddb5xxx/common/prom.c.orig +13 -0
diff -Nru linux/arch/mips/ddb5xxx/common/prom.c.orig linux/arch/mips/ddb5xxx/common/prom.c
@@ -33,9 +33,15 @@
 	case MACH_NEC_DDB5476:		return "NEC DDB Vrc-5476";
 	case MACH_NEC_DDB5477:		return "NEC DDB Vrc-5477";
 	case MACH_NEC_ROCKHOPPER:	return "NEC Rockhopper";
+	case MACH_NEC_ROCKHOPPERII:	return "NEC RockhopperII";
+	default:			return "Unknown DDB machine";
 	}
 }
 
+#if defined(CONFIG_DDB5477)
+void ddb5477_runtime_detection(void);
+#endif
+
 /* [[email protected]] PMON passes arguments in C main() style */
 void __init prom_init(int argc, const char **arg)
 {
@@ -92,6 +98,13 @@
            around just after that.
          */
 
+	/* We can only use the PCI bus to distinquish between
+	   the Rockhopper and RockhopperII backplanes and this must
+	   wait until ddb5477_board_init() in setup.c after the 5477
+	   is initialized.  So, until then handle
+	   both Rockhopper and RockhopperII backplanes as Rockhopper 1
+	 */
+
         test_offset = (char *)KSEG1ADDR(DEFAULT_LCS1_BASE + 0x800);
         saved_test_byte = *test_offset;
 
arch/mips/ddb5xxx/ddb5477/irq_5477.c renamed from arch/mips/ddb5xxx/ddb5477/irq_5477.c.orig +1 -9
diff -Nru linux/arch/mips/ddb5xxx/ddb5477/irq_5477.c.orig linux/arch/mips/ddb5xxx/ddb5477/irq_5477.c
@@ -18,6 +18,7 @@
  * This file exports one function:
  *	vrc5477_irq_init(u32 irq_base);
  */
+
 #include <linux/interrupt.h>
 #include <linux/types.h>
 #include <linux/ptrace.h>
@@ -115,15 +116,6 @@
 	vrc5477_irq_base = irq_base;
 }
 
-
-int vrc5477_irq_to_irq(int irq)
-{
-	db_assert(irq >= 0);
-	db_assert(irq < NUM_5477_IRQ);
-
-	return irq + vrc5477_irq_base;
-}
-
 void ll_vrc5477_irq_route(int vrc5477_irq, int ip)
 {
 	u32 reg_value;
arch/mips/ddb5xxx/ddb5477/irq.c renamed from arch/mips/ddb5xxx/ddb5477/irq.c.orig +44 -4

89 lines not on this page · raw message

arch/mips/ddb5xxx/ddb5477/pci.c renamed from arch/mips/ddb5xxx/ddb5477/pci.c.orig +119 -50

235 lines not on this page · raw message

arch/mips/ddb5xxx/ddb5477/setup.c renamed from arch/mips/ddb5xxx/ddb5477/setup.c.orig +187 -23

301 lines not on this page · raw message

arch/mips/ddb5xxx/ddb5477/pci_ops.c renamed from arch/mips/ddb5xxx/ddb5477/pci_ops.c.orig +0 -111

114 lines not on this page · raw message

arch/mips/Makefile renamed from arch/mips/Makefile.orig +1 -1
diff -Nru linux/arch/mips/Makefile.orig linux/arch/mips/Makefile
@@ -294,7 +294,7 @@
 SUBDIRS		+= arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5477
 LIBS		+= arch/mips/ddb5xxx/common/ddb5xxx.o \
 		   arch/mips/ddb5xxx/ddb5477/ddb5477.o
-LOADADDR	:= 0x80080000
+LOADADDR	:= 0x80100000
 endif
 
 #
arch/mips/config.in renamed from arch/mips/config.in.orig +4 -0
diff -Nru linux/arch/mips/config.in.orig linux/arch/mips/config.in
@@ -55,6 +55,9 @@
 dep_bool 'Support for NEC DDB Vrc-5074 (EXPERIMENTAL)' CONFIG_DDB5074 $CONFIG_EXPERIMENTAL
 bool 'Support for NEC DDB Vrc-5476' CONFIG_DDB5476
 bool 'Support for NEC DDB Vrc-5477' CONFIG_DDB5477
+if [ "$CONFIG_DDB5477" = "y" ]; then
+      int '   bus frequency (in kHZ, 0 for auto-detect)' CONFIG_DDB5477_BUS_FREQUENCY 0
+fi
 bool 'Support for NEC Osprey board' CONFIG_NEC_OSPREY
 bool 'Support for Olivetti M700-10' CONFIG_OLIVETTI_M700
 dep_bool 'Support for Philips Nino (EXPERIMENTAL)' CONFIG_NINO $CONFIG_EXPERIMENTAL
@@ -251,6 +254,7 @@
    define_bool CONFIG_NONCOHERENT_IO y
    define_bool CONFIG_PCI_AUTO y
    define_bool CONFIG_DUMMY_KEYB y
+   define_bool CONFIG_I8259 y
 fi
 if [ "$CONFIG_NEC_OSPREY" = "y" ]; then
    define_bool CONFIG_VR4181 y
arch/mips/defconfig-ddb5477 renamed from arch/mips/defconfig-ddb5477.orig +3 -1
diff -Nru linux/arch/mips/defconfig-ddb5477.orig linux/arch/mips/defconfig-ddb5477
@@ -36,6 +36,7 @@
 # CONFIG_DDB5074 is not set
 # CONFIG_DDB5476 is not set
 CONFIG_DDB5477=y
+CONFIG_DDB5477_BUS_FREQUENCY=0
 # CONFIG_NEC_OSPREY is not set
 # CONFIG_OLIVETTI_M700 is not set
 # CONFIG_NINO is not set
@@ -54,6 +55,7 @@
 CONFIG_NONCOHERENT_IO=y
 CONFIG_PCI_AUTO=y
 CONFIG_DUMMY_KEYB=y
+CONFIG_I8259=y
 # CONFIG_MIPS_AU1000 is not set
 
 #
@@ -264,7 +266,7 @@
 # CONFIG_HP100 is not set
 # CONFIG_NET_ISA is not set
 CONFIG_NET_PCI=y
-# CONFIG_PCNET32 is not set
+CONFIG_PCNET32=y
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_APRICOT is not set
 # CONFIG_CS89x0 is not set
include/asm-mips/ddb5xxx/ddb5477.h renamed from include/asm-mips/ddb5xxx/ddb5477.h.orig +102 -0

123 lines not on this page · raw message

include/asm-mips/bootinfo.h renamed from include/asm-mips/bootinfo.h.orig +1 -0
diff -Nru linux/include/asm-mips/bootinfo.h.orig linux/include/asm-mips/bootinfo.h
@@ -100,6 +100,7 @@
 #define MACH_NEC_DDB5476         1      /* NEC DDB Vrc-5476 */
 #define MACH_NEC_DDB5477         2      /* NEC DDB Vrc-5477 */
 #define MACH_NEC_ROCKHOPPER      3      /* Rockhopper base board */
+#define MACH_NEC_ROCKHOPPERII    4      /* Rockhopper II base board */
 
 /*
  * Valid machtype for group BAGET
include/asm-mips/serial.h renamed from include/asm-mips/serial.h.orig +6 -5
diff -Nru linux/include/asm-mips/serial.h.orig linux/include/asm-mips/serial.h
@@ -268,12 +268,13 @@
 #endif
 
 #ifdef CONFIG_DDB5477
-#define DDB5477_SERIAL_PORT_DEFNS                                       \
-        { baud_base: BASE_BAUD, irq: 12, flags: STD_COM_FLAGS,          \
-          iomem_base: (u8*)0xbfa04200, iomem_reg_shift: 3,              \
+#include <asm/ddb5xxx/ddb5477.h>
+#define DDB5477_SERIAL_PORT_DEFNS                                             \
+        { baud_base: BASE_BAUD, irq: VRC5477_IRQ_UART0, flags: STD_COM_FLAGS, \
+          iomem_base: (u8*)0xbfa04200, iomem_reg_shift: 3,                    \
           io_type: SERIAL_IO_MEM},\
-        { baud_base: BASE_BAUD, irq: 28, flags: STD_COM_FLAGS,          \
-          iomem_base: (u8*)0xbfa04240, iomem_reg_shift: 3,              \
+        { baud_base: BASE_BAUD, irq: VRC5477_IRQ_UART1, flags: STD_COM_FLAGS, \
+          iomem_base: (u8*)0xbfa04240, iomem_reg_shift: 3,                    \
           io_type: SERIAL_IO_MEM},
 #else
 #define DDB5477_SERIAL_PORT_DEFNS
include/linux/pci_ids.h renamed from include/linux/pci_ids.h.orig +1 -0
diff -Nru linux/include/linux/pci_ids.h.orig linux/include/linux/pci_ids.h
@@ -811,6 +811,7 @@
 #define PCI_DEVICE_ID_AL_M1523		0x1523
 #define PCI_DEVICE_ID_AL_M1531		0x1531
 #define PCI_DEVICE_ID_AL_M1533		0x1533
+#define PCI_DEVICE_ID_AL_M1535 		0x1535
 #define PCI_DEVICE_ID_AL_M1541		0x1541
 #define PCI_DEVICE_ID_AL_M1621          0x1621
 #define PCI_DEVICE_ID_AL_M1631          0x1631