and now the real patch
Subsystems (3)
And of course I forgot to attach the code...
Have fun,
Peter.
arch/mips/Makefile renamed from linux/arch/mips/Makefile +2 -2
@@ -195,8 +195,8 @@ # NEC DDB Vrc-5074 # ifdef CONFIG_DDB5074 -SUBDIRS += arch/mips/ddb5074 -LIBS += arch/mips/ddb5074/ddb5074.a +SUBDIRS += arch/mips/ddb5xxx/common arch/mips/ddb5xxx/ddb5074 +LIBS += arch/mips/ddb5xxx/common/ddb5xxx.o arch/mips/ddb5xxx/ddb5074/ddb5074.o LOADADDR += 0x80080000 endif
arch/mips/config.in renamed from linux/arch/mips/config.in +4 -1
@@ -186,9 +186,12 @@ define_bool CONFIG_I8259 y define_bool CONFIG_ISA y define_bool CONFIG_NONCOHERENT_IO y + define_bool CONFIG_IRQ_CPU y define_bool CONFIG_PCI y + define_bool CONFIG_NEW_PCI y + define_bool CONFIG_PCI_AUTO y define_bool CONFIG_PC_KEYB y - define_bool CONFIG_OLD_TIME_C y + define_bool CONFIG_NEW_TIME_C y fi if [ "$CONFIG_DDB5476" = "y" ]; then define_bool CONFIG_ISA y
arch/mips/ddb5xxx/ddb5074/Makefile renamed from linux/arch/mips/ddb5xxx/ddb5074/Makefile +21 -0
@@ -0,0 +1,21 @@ +# +# Makefile for the NEC DDB Vrc-5074 specific kernel interface routines +# under Linux. +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... +# + +.S.s: + $(CPP) $(CFLAGS) $< -o $*.s +.S.o: + $(CC) $(CFLAGS) -c $< -o $*.o + +O_TARGET = ddb5074.o + +obj-y += setup.o irq.o int-handler.o pci.o pci_ops.o nile4_pic.o + +include $(TOPDIR)/Rules.make
arch/mips/ddb5xxx/ddb5074/int-handler.S renamed from linux/arch/mips/ddb5xxx/ddb5074/int-handler.S +120 -0
120 lines not on this page · raw message
arch/mips/ddb5xxx/ddb5074/irq.c renamed from linux/arch/mips/ddb5xxx/ddb5074/irq.c +165 -0
165 lines not on this page · raw message
arch/mips/ddb5xxx/ddb5074/nile4_pic.c renamed from linux/arch/mips/ddb5xxx/ddb5074/nile4_pic.c +288 -0
288 lines not on this page · raw message
arch/mips/ddb5xxx/ddb5074/pci.c renamed from linux/arch/mips/ddb5xxx/ddb5074/pci.c +129 -0
129 lines not on this page · raw message
arch/mips/ddb5xxx/ddb5074/pci_ops.c renamed from linux/arch/mips/ddb5xxx/ddb5074/pci_ops.c +342 -0
342 lines not on this page · raw message
arch/mips/ddb5xxx/ddb5074/setup.c renamed from linux/arch/mips/ddb5xxx/ddb5074/setup.c +258 -0
258 lines not on this page · raw message
arch/mips/kernel/i8259.c renamed from linux/arch/mips/kernel/i8259.c +4 -0
@@ -176,12 +176,16 @@ handle_real_irq:if (irq &8 ) { +#if 0 inb (0xA1 );/* DUMMY - (do we need this?) */ +#endif outb (cached_A1,0xA1 );outb (0x60 +(irq&7 ),0xA0 );/* 'Specific EOI' to slave */ outb (0x62 ,0x20 );/* 'Specific EOI' to master-IRQ2 */ }else { +#if 0 inb (0x21 );/* DUMMY - (do we need this?) */ +#endif outb (cached_21,0x21 );outb (0x60 +irq,0x20 );/* 'Specific EOI' to master */ }
drivers/char/serial.c renamed from linux/drivers/char/serial.c +2 -0
@@ -4393,6 +4393,7 @@ 8<<2, 2, pci_inteli960ni_fn, 0x10000}, {SPCI_FL_BASE0 |SPCI_FL_IRQRESOURCE ,/* pbn_sgi_ioc3 */ 1, 458333, 0, 0, 0, 0x20178 }, +#if 0 #ifdef CONFIG_DDB5074/* * NEC Vrc-5074 (Nile 4) builtin UART.
@@ -4400,6 +4401,7 @@ */ { SPCI_FL_BASE0, 1, 520833, /* pbn_nec_nile4 */ 64, 3, NULL, 0x300 }, +#endif #endif #if 0 /* PCI_DEVICE_ID_DCI_PCCOM8 ? */ /* pbn_dci_pccom8 */ { SPCI_FL_BASE3, 8, 115200, 8 },
drivers/net/tulip/interrupt.c renamed from linux/drivers/net/tulip/interrupt.c +3 -0
@@ -186,6 +186,9 @@ tp->rx_buffers[entry].skb->tail, pkt_len);#endif +#if defined(__mips__) +dma_cache_inv ((unsigned long )bus_to_virt (tp->rx_ring[entry].buffer1),pkt_len); +#endif }else {/* Pass up the skb already on the Rx ring. */ char *temp =skb_put (skb = tp->rx_buffers[entry].skb, pkt_len);
drivers/net/tulip/tulip_core.c renamed from linux/drivers/net/tulip/tulip_core.c +22 -1
@@ -94,7 +94,7 @@#elif defined(__arm__) || defined(__sh__)static int csr0 =0x01A00000 |0x4800 ;#elif defined(__mips__) -static int csr0 =0x00200000 |0x4000 ; +static int csr0 =0x4000 ;#else #warning Processor architecture undefined!static int csr0 =0x00A00000 |0x4800 ;
@@ -317,6 +317,11 @@ tp->tx_buffers[tp->cur_tx].skb =NULL ; tp->tx_buffers[tp->cur_tx].mapping = mapping; +#if defined(__mips__) +dma_cache_wback_inv ((unsigned long )tp->setup_frame, +sizeof (tp->setup_frame)); +#endif +/* Put the setup frame on the Tx list. */ tp->tx_ring[tp->cur_tx].length =cpu_to_le32 (0x08000000 |192 ); tp->tx_ring[tp->cur_tx].buffer1 =cpu_to_le32 (mapping);
@@ -620,6 +625,10 @@ PKT_BUF_SZ, PCI_DMA_FROMDEVICE); tp->rx_buffers[i].mapping = mapping; skb->dev = dev;/* Mark as being used by this device. */ +#if defined(__mips__) +/* Kick out any matching lines in the cache. */ +dma_cache_inv ((unsigned long )skb->tail,PKT_BUF_SZ ); +#endif tp->rx_ring[i].status =cpu_to_le32 (DescOwned);/* Owned by Tulip chip */ tp->rx_ring[i].buffer1 =cpu_to_le32 (mapping); }
@@ -672,6 +681,9 @@/* if we were using Transmit Automatic Polling, we would need a * wmb() here. */ tp->tx_ring[entry].status =cpu_to_le32 (DescOwned); +#if defined(__mips__) +dma_cache_wback_inv ((unsigned long )skb->data, skb->len); +#endif wmb (); tp->cur_tx++;
@@ -1517,6 +1529,15 @@/* No media table either */ tp->flags &= ~HAS_MEDIA_TABLE ; } +#endif +#ifdef CONFIG_DDB5074 +if ((pdev->bus->number ==0 ) && (PCI_SLOT (pdev->devfn) ==1 )) { +/* DDB5477 MAC address in first EEPROM locations. */ + sa_offset =0 ; +/* No media table either */ + tp->flags &= ~HAS_MEDIA_TABLE ; + } +#endif #ifdef CONFIG_MIPS_COBALT if ((pdev->bus->number == 0) &&
include/asm-mips/ddb5xxx/ddb5074.h renamed from linux/include/asm-mips/ddb5xxx/ddb5074.h +38 -0
@@ -0,0 +1,38 @@ +/* +* include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions +* +* Copyright (C) 2000 Geert Uytterhoeven <[email protected]> +* Sony Software Development Center Europe (SDCE), Brussels +*/ + +#ifndef _ASM_DDB5XXX_DDB5074_H +#define _ASM_DDB5XXX_DDB5074_H + +#include <asm/nile4.h> + +#define DDB_SDRAM_SIZE 0x04000000/* 64MB */ + +#define DDB_PCI_IO_BASE 0x06000000 +#define DDB_PCI_IO_SIZE 0x02000000/* 32 MB */ + +#define DDB_PCI_MEM_BASE 0x08000000 +#define DDB_PCI_MEM_SIZE 0x08000000/* 128 MB */ + +#define DDB_PCI_CONFIG_BASE DDB_PCI_MEM_BASE +#define DDB_PCI_CONFIG_SIZE DDB_PCI_MEM_SIZE + +#define NILE4_PCI_IO_BASE 0xa6000000 +#define NILE4_PCI_MEM_BASE 0xa8000000 +#define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE +#define DDB_PCI_IACK_BASE NILE4_PCI_IO_BASE + +#define NILE4_IRQ_BASE NUM_I8259_INTERRUPTS +#define CPU_IRQ_BASE (NUM_NILE4_INTERRUPTS + NILE4_IRQ_BASE) +#define CPU_NILE4_CASCADE 2 + +extern void ddb5074_led_hex (int hex); +extern void ddb5074_led_d2 (int on); +extern void ddb5074_led_d3 (int on); + +extern void nile4_irq_setup (u32 base); +#endif
include/asm-mips/ddb5xxx/ddb5xxx.h renamed from linux/include/asm-mips/ddb5xxx/ddb5xxx.h +2 -0
@@ -174,8 +174,10 @@static inline void ddb_sync (void ) { +#if 0 volatile u32 *p = (volatile u32 *)0xbfc00000 ; (void )(*p); +#endif }static inline void ddb_out32 (u32 offset,u32 val)
include/asm-mips/nile4.h renamed from linux/include/asm-mips/nile4.h +4 -0
@@ -9,6 +9,9 @@* NEC Vrc 5074 System Controller Data Sheet, June 1998 */ +#ifndef _ASM_NILE4_H +#define _ASM_NILE4_H +#define NILE4_BASE 0xbfa00000#define NILE4_SIZE 0x00200000/* 2 MB */
@@ -303,3 +306,4 @@extern u8 nile4_i8259_iack (void );extern void nile4_dump_irq_status (void );/* Debug */ +#endif