Hi, this is the reference source for the lasat platforms. I have cleaned up the original code to give a patch which applies against todays tree and produces a running kernel on both platforms. The patch adds (v)r5000 cache support, the general stuff required to add a new platform and some small patches in various places to fix bugs and add, for example, mtd support for the flash in these machines. The files not patched (not existing in the oss CVS) are in lasat.tar.gz. This includes arch/mips/lasat and include/asm-mips/lasat - one file to support r5000 cache support and one for the memory mapped flash modules to give mtd support. In addition there are two drivers for the rtc and display in the two machines which have interface include files in include/linux. I know I was encouraged to split up this stuff but I could spend weeks or months doing that and not have something which would satisfy the authorities - This is my first attempt. Perhaps, Florian, you can look at it and give me some advice as to how I should structure any splitting-up to get this accepted. If anyone has a masquerade (or safepipe) box then you will also need the information on http://debian.murphy.dk to get this stuff uploaded on your box. Any problems, send me a mail. regards /Brian
? arch/mips/defconfig-lasat100 ? arch/mips/defconfig-lasat200 ? arch/mips/lasat ? arch/mips/patch ? arch/mips/mm/c-r5000.c ? drivers/mtd/maps/lasat.c ? include/asm-mips/lasat ? include/linux/ds1603.h ? include/linux/picvue.h Index: arch/mips/Makefile =================================================================== RCS file: /cvs/linux/arch/mips/Makefile,v retrieving revision 1.78.2.2 diff -u -r1.78.2.2 Makefile --- arch/mips/Makefile 2002/02/15 21:05:47 1.78.2.2 +++ arch/mips/Makefile 2002/05/30 10:33:14 @@ -77,6 +77,9 @@ ifdef CONFIG_CPU_R5000 GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap endif +ifdef CONFIG_CPU_VR5000 +GCCFLAGS += -mcpu=vr5000 -mips2 -Wa,--trap +endif ifdef CONFIG_CPU_R5432 GCCFLAGS += -mcpu=r5000 -mips2 -Wa,--trap endif @@ -288,7 +291,14 @@ LOADADDR += 0x80100000 endif +ifdef CONFIG_LASAT +LIBS += arch/mips/lasat/lasatkern.o +SUBDIRS += arch/mips/lasat +LOADADDR += 0x80000000 +endif + # +# # Au1000 eval board # ifdef CONFIG_MIPS_PB1000 @@ -379,6 +389,11 @@ endif MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot + +ifdef CONFIG_LASAT +rom.bin: vmlinux + $(MAKE) -C arch/$(ARCH)/lasat/image $@ +endif vmlinux.ecoff: vmlinux @$(MAKEBOOT) $@ Index: arch/mips/config.in =================================================================== RCS file: /cvs/linux/arch/mips/config.in,v retrieving revision 1.154.2.19 diff -u -r1.154.2.19 config.in --- arch/mips/config.in 2002/05/29 14:30:49 1.154.2.19 +++ arch/mips/config.in 2002/05/30 10:33:14 @@ -43,6 +43,22 @@ fi dep_bool 'Support for Galileo EV96100 Evaluation board (EXPERIMENTAL)' CONFIG_MIPS_EV96100 $CONFIG_EXPERIMENTAL bool 'Support for Globespan IVR board' CONFIG_MIPS_IVR +bool 'Support for LASAT Networks platforms' CONFIG_LASAT +if [ "$CONFIG_LASAT" = "y" ]; then + bool ' Support for LASAT Networks 100 series' CONFIG_LASAT_100 + bool ' Support for LASAT Networks 200 series' CONFIG_LASAT_200 + tristate ' DS1603 rtc support' CONFIG_DS1603 + tristate ' PICVUE LCD display driver' CONFIG_PICVUE + dep_tristate ' PICVUE LCD display driver /proc interface' CONFIG_PICVUE_PROC $CONFIG_PICVUE + if [ "$CONFIG_LASAT_100" = "y" ]; then + define_bool CONFIG_PCI y + define_bool CONFIG_NONCOHERENT_IO y + fi + if [ "$CONFIG_LASAT_200" = "y" ]; then + define_bool CONFIG_PCI y + define_bool CONFIG_NONCOHERENT_IO y + fi +fi bool 'Support for Hewlett Packard LaserJet board' CONFIG_HP_LASERJET bool 'Support for ITE 8172G board' CONFIG_MIPS_ITE8172 if [ "$CONFIG_MIPS_ITE8172" = "y" ]; then @@ -324,6 +340,7 @@ R4x00 CONFIG_CPU_R4X00 \ R49XX CONFIG_CPU_TX49XX \ R5000 CONFIG_CPU_R5000 \ + VR5000 CONFIG_CPU_VR5000 \ R5432 CONFIG_CPU_R5432 \ RM7000 CONFIG_CPU_RM7000 \ R52xx CONFIG_CPU_NEVADA \ @@ -355,6 +372,7 @@ if [ "$CONFIG_CPU_R4X00" = "y" -o \ "$CONFIG_CPU_R5000" = "y" -o \ + "$CONFIG_CPU_VR5000" = "y" -o \ "$CONFIG_CPU_RM7000" = "y" -o \ "$CONFIG_CPU_R10000" = "y" -o \ "$CONFIG_CPU_SB1" = "y" -o \ Index: arch/mips/kernel/Makefile =================================================================== RCS file: /cvs/linux/arch/mips/kernel/Makefile,v retrieving revision 1.51.2.1 diff -u -r1.51.2.1 Makefile --- arch/mips/kernel/Makefile 2002/01/24 23:14:24 1.51.2.1 +++ arch/mips/kernel/Makefile 2002/05/30 10:33:15 @@ -32,6 +32,7 @@ obj-$(CONFIG_CPU_R4300) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_R4X00) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_R5000) += r4k_fpu.o r4k_switch.o +obj-$(CONFIG_CPU_VR5000) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_R5432) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_RM7000) += r4k_fpu.o r4k_switch.o obj-$(CONFIG_CPU_NEVADA) += r4k_fpu.o r4k_switch.o Index: arch/mips/kernel/setup.c =================================================================== RCS file: /cvs/linux/arch/mips/kernel/setup.c,v retrieving revision 1.96.2.17 diff -u -r1.96.2.17 setup.c --- arch/mips/kernel/setup.c 2002/05/28 05:38:37 1.96.2.17 +++ arch/mips/kernel/setup.c 2002/05/30 10:33:16 @@ -137,7 +137,7 @@ printk(" available.\n"); break; case CPU_R4200: -/* case CPU_R4300: */ + case CPU_R4300: case CPU_R4600: case CPU_R4640: case CPU_R4650: @@ -762,6 +762,11 @@ case MACH_GROUP_PHILIPS: nino_setup(); break; +#endif +#ifdef CONFIG_LASAT + case MACH_GROUP_LASAT: + platform_setup(); + break; #endif #ifdef CONFIG_MIPS_PB1000 case MACH_GROUP_ALCHEMY: Index: arch/mips/mm/Makefile =================================================================== RCS file: /cvs/linux/arch/mips/mm/Makefile,v retrieving revision 1.27 diff -u -r1.27 Makefile --- arch/mips/mm/Makefile 2001/11/26 13:38:14 1.27 +++ arch/mips/mm/Makefile 2002/05/30 10:33:16 @@ -24,6 +24,7 @@ obj-$(CONFIG_CPU_R4X00) += pg-r4k.o c-r4k.o tlb-r4k.o tlbex-r4k.o obj-$(CONFIG_CPU_VR41XX) += pg-r4k.o c-r4k.o tlb-r4k.o tlbex-r4k.o obj-$(CONFIG_CPU_R5000) += pg-r4k.o c-r4k.o tlb-r4k.o tlbex-r4k.o +obj-$(CONFIG_CPU_VR5000) += pg-r4k.o c-r5000.o tlb-r4k.o tlbex-r4k.o obj-$(CONFIG_CPU_NEVADA) += pg-r4k.o c-r4k.o tlb-r4k.o tlbex-r4k.o obj-$(CONFIG_CPU_R5432) += pg-r5432.o c-r5432.o tlb-r4k.o tlbex-r4k.o obj-$(CONFIG_CPU_RM7000) += pg-rm7k.o c-rm7k.o tlb-r4k.o tlbex-r4k.o Index: arch/mips/mm/loadmmu.c =================================================================== RCS file: /cvs/linux/arch/mips/mm/loadmmu.c,v retrieving revision 1.45 diff -u -r1.45 loadmmu.c --- arch/mips/mm/loadmmu.c 2001/11/29 04:47:24 1.45 +++ arch/mips/mm/loadmmu.c 2002/05/30 10:33:17 @@ -52,6 +52,7 @@ extern void ld_mmu_r23000(void); extern void ld_mmu_r4xx0(void); +extern void ld_mmu_r5000(void); extern void ld_mmu_tx39(void); extern void ld_mmu_tx49(void); extern void ld_mmu_r5432(void); @@ -72,6 +73,10 @@ defined(CONFIG_CPU_R4300) || defined(CONFIG_CPU_R5000) || \ defined(CONFIG_CPU_NEVADA) ld_mmu_r4xx0(); + r4k_tlb_init(); +#endif +#if defined(CONFIG_CPU_VR5000) + ld_mmu_r5000(); r4k_tlb_init(); #endif #if defined(CONFIG_CPU_RM7000) Index: drivers/mtd/maps/Config.in =================================================================== RCS file: /cvs/linux/drivers/mtd/maps/Config.in,v retrieving revision 1.3.2.2 diff -u -r1.3.2.2 Config.in --- drivers/mtd/maps/Config.in 2002/02/15 21:05:48 1.3.2.2 +++ drivers/mtd/maps/Config.in 2002/05/30 10:33:21 @@ -50,6 +50,7 @@ int ' Bus width in octets' CONFIG_MTD_CSTM_MIPS_IXX_BUSWIDTH 2 fi dep_tristate ' Momenco Ocelot boot flash device' CONFIG_MTD_OCELOT $CONFIG_MOMENCO_OCELOT + dep_tristate ' LASAT flash device' CONFIG_MTD_LASAT $CONFIG_MTD_CFI $CONFIG_LASAT fi if [ "$CONFIG_SH" = "y" ]; then Index: drivers/mtd/maps/Makefile =================================================================== RCS file: /cvs/linux/drivers/mtd/maps/Makefile,v retrieving revision 1.2.2.2 diff -u -r1.2.2.2 Makefile --- drivers/mtd/maps/Makefile 2002/02/15 21:05:48 1.2.2.2 +++ drivers/mtd/maps/Makefile 2002/05/30 10:33:21 @@ -31,5 +31,6 @@ obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o +obj-$(CONFIG_MTD_LASAT) += lasat.o include $(TOPDIR)/Rules.make Index: drivers/net/pcnet32.c =================================================================== RCS file: /cvs/linux/drivers/net/pcnet32.c,v retrieving revision 1.33.2.1 diff -u -r1.33.2.1 pcnet32.c --- drivers/net/pcnet32.c 2002/02/26 05:59:35 1.33.2.1 +++ drivers/net/pcnet32.c 2002/05/30 10:33:23 @@ -656,7 +656,7 @@ #if defined(__i386__) printk(KERN_WARNING "%s: Probably a Compaq, using the PROM address of", dev->name); memcpy(dev->dev_addr, promaddr, 6); -#elif defined(__powerpc__) +#else if (!is_valid_ether_addr(dev->dev_addr) && is_valid_ether_addr(promaddr)) { printk("\n" KERN_WARNING "%s: using PROM address:", @@ -765,8 +765,12 @@ if (irq_line) { dev->irq = irq_line; } - + +#ifdef CONFIG_LASAT + if (dev->irq >= 0) +#else if (dev->irq >= 2) +#endif printk(" assigned IRQ %d.\n", dev->irq); else { unsigned long irq_mask = probe_irq_on(); @@ -821,7 +825,10 @@ u16 val; int i; - if (dev->irq == 0 || + if ( +#ifndef CONFIG_LASAT + dev->irq == 0 || +#endif request_irq(dev->irq, &pcnet32_interrupt, lp->shared_irq ? SA_SHIRQ : 0, lp->name, (void *)dev)) { return -EAGAIN; @@ -1343,6 +1350,10 @@ if (!rx_in_place) { skb_reserve(skb,2); /* 16 byte align */ skb_put(skb,pkt_len); /* Make room */ + pci_dma_sync_single(lp->pci_dev, + lp->rx_skbuff[entry]->tail, + pkt_len, + PCI_DMA_FROMDEVICE); eth_copy_and_sum(skb, (unsigned char *)(lp->rx_skbuff[entry]->tail), pkt_len,0); @@ -1664,7 +1675,7 @@ } return -EOPNOTSUPP; } - + static struct pci_driver pcnet32_driver = { name: DRV_NAME, probe: pcnet32_probe_pci, Index: drivers/pci/pci.c =================================================================== RCS file: /cvs/linux/drivers/pci/pci.c,v retrieving revision 1.48 diff -u -r1.48 pci.c --- drivers/pci/pci.c 2001/12/02 11:34:45 1.48 +++ drivers/pci/pci.c 2002/05/30 10:33:25 @@ -38,6 +38,8 @@ LIST_HEAD(pci_root_buses); LIST_HEAD(pci_devices); +static int pci_reverse = 0; + /** * pci_find_slot - locate PCI device from a given PCI slot * @bus: number of PCI bus on which desired PCI device resides @@ -1327,8 +1329,13 @@ * Link the device to both the global PCI device chain and * the per-bus list of devices. */ - list_add_tail(&dev->global_list, &pci_devices); - list_add_tail(&dev->bus_list, &bus->devices); + if (!pci_reverse) { + list_add_tail(&dev->global_list, &pci_devices); + list_add_tail(&dev->bus_list, &bus->devices); + } else { + list_add(&dev->global_list, &pci_devices); + list_add(&dev->bus_list, &bus->devices); + } /* Fix up broken headers */ pci_fixup_device(PCI_FIXUP_HEADER, dev); @@ -1952,7 +1959,10 @@ *k++ = 0; if (*str && (str = pcibios_setup(str)) && *str) { /* PCI layer options should be handled here */ - printk(KERN_ERR "PCI: Unknown option `%s'\n", str); + if (!strcmp(str, "reverse")) + pci_reverse = 1; + else + printk(KERN_ERR "PCI: Unknown option `%s'\n", str); } str = k; } Index: include/asm-mips/bootinfo.h =================================================================== RCS file: /cvs/linux/include/asm-mips/bootinfo.h,v retrieving revision 1.43.2.8 diff -u -r1.43.2.8 bootinfo.h --- include/asm-mips/bootinfo.h 2002/02/15 21:05:49 1.43.2.8 +++ include/asm-mips/bootinfo.h 2002/05/30 10:33:31 @@ -35,6 +35,7 @@ #define MACH_GROUP_ALCHEMY 18 /* Alchemy Semi Eval Boards*/ #define MACH_GROUP_NEC_VR41XX 19 /* NEC Vr41xx based boards/gadgets */ #define MACH_GROUP_HP_LJ 20 /* Hewlett Packard LaserJet */ +#define MACH_GROUP_LASAT 21 /* * Valid machtype values for group unknown (low order halfword of mips_machtype) @@ -151,6 +152,12 @@ #define MACH_TOPAS 1 #define MACH_JMR 2 #define MACH_TOSHIBA_JMR3927 3 /* JMR-TX3927 CPU/IO board */ + +/* + * Valid machtype for group LASAT + */ +#define MACH_LASAT_100 0 /* Masquerade II/SP100/SP50/SP25 */ +#define MACH_LASAT_200 1 /* Masquerade PRO/SP200 */ /* * Valid machtype for group Alchemy Index: include/asm-mips/cacheops.h =================================================================== RCS file: /cvs/linux/include/asm-mips/cacheops.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 cacheops.h --- include/asm-mips/cacheops.h 1997/06/01 03:17:12 1.1.1.1 +++ include/asm-mips/cacheops.h 2002/05/30 10:33:31 @@ -35,6 +35,7 @@ #define Hit_Writeback_Inv_D 0x15 /* 0x16 is unused */ #define Hit_Writeback_Inv_SD 0x17 +#define Page_Invalidate 0x17 #define Hit_Writeback_I 0x18 #define Hit_Writeback_D 0x19 /* 0x1a is unused */ Index: include/asm-mips/cpu.h =================================================================== RCS file: /cvs/linux/include/asm-mips/cpu.h,v retrieving revision 1.24.2.6 diff -u -r1.24.2.6 cpu.h --- include/asm-mips/cpu.h 2002/05/13 18:54:25 1.24.2.6 +++ include/asm-mips/cpu.h 2002/05/30 10:33:32 @@ -53,6 +53,7 @@ #define PRID_IMP_R4640 0x2200 #define PRID_IMP_R4650 0x2200 /* Same as R4640 */ #define PRID_IMP_R5000 0x2300 +#define PRID_IMP_VR5000 0x2300 #define PRID_IMP_TX49 0x2d00 #define PRID_IMP_SONIC 0x2400 #define PRID_IMP_MAGIC 0x2500 @@ -127,7 +128,7 @@ CPU_R5000A, CPU_R4640, CPU_NEVADA, CPU_RM7000, CPU_R5432, CPU_4KC, CPU_5KC, CPU_R4310, CPU_SB1, CPU_TX3912, CPU_TX3922, CPU_TX3927, CPU_AU1000, CPU_4KEC, CPU_4KSC, CPU_VR41XX, CPU_R5500, CPU_TX49XX, - CPU_TX39XX, CPU_AU1500, CPU_20KC, CPU_LAST + CPU_TX39XX, CPU_AU1500, CPU_20KC, CPU_VR5000, CPU_LAST }; #endif Index: include/asm-mips/r4kcache.h =================================================================== RCS file: /cvs/linux/include/asm-mips/r4kcache.h,v retrieving revision 1.8 diff -u -r1.8 r4kcache.h --- include/asm-mips/r4kcache.h 2001/10/31 02:31:23 1.8 +++ include/asm-mips/r4kcache.h 2002/05/30 10:33:35 @@ -76,6 +76,19 @@ "i" (Hit_Writeback_Inv_D)); } +extern inline void flush_dcache_line_wb(unsigned long addr) +{ + __asm__ __volatile__( + ".set noreorder\n\t" + ".set mips3\n\t" + "cache %1, (%0)\n\t" + ".set mips0\n\t" + ".set reorder" + : + : "r" (addr), + "i" (Hit_Writeback_D)); +} + static inline void invalidate_dcache_line(unsigned long addr) { __asm__ __volatile__( @@ -606,6 +619,40 @@ static inline void blast_scache128_page_indexed(unsigned long page) { cache128_unroll32(page,Index_Writeback_Inv_SD); +} + + +#define cache_unroll(base,op) \ + __asm__ __volatile__(" \ + .set noreorder; \ + .set mips3; \ + cache %1, (%0); \ + .set mips0; \ + .set reorder" \ + : \ + : "r" (base), \ + "i" (op)); + +extern inline void blast_r5000_scache(void) +{ + unsigned long start = KSEG0; + unsigned long end = KSEG0 + scache_size; + + while(start < end) { + cache_unroll(start,Page_Invalidate); + start += 128*sc_lsize; + } +} + +extern inline void blast_r5000_scache_page_indexed(unsigned long page) +{ + unsigned long start = page; + unsigned long end = page + PAGE_SIZE; + + while(start < end) { + cache_unroll(start,Page_Invalidate); + start += 128*sc_lsize; + } } #endif /* !(_MIPS_R4KCACHE_H) */ Index: include/asm-mips/serial.h =================================================================== RCS file: /cvs/linux/include/asm-mips/serial.h,v retrieving revision 1.23.2.2 diff -u -r1.23.2.2 serial.h --- include/asm-mips/serial.h 2002/01/07 03:33:54 1.23.2.2 +++ include/asm-mips/serial.h 2002/05/30 10:33:35 @@ -144,6 +144,18 @@ #define IVR_SERIAL_PORT_DEFNS #endif +#ifdef CONFIG_LASAT +#include <asm/lasat/lasatint.h> +#define LASAT_SERIAL_PORT_DEFNS \ + { baud_base: LASAT_BASE_BAUD, irq: LASATINT_UART, \ + flags: STD_COM_FLAGS, \ + port: LASAT_UART_REGS_BASE, /* Only for display */ \ + iomem_base: (u8 *)KSEG1ADDR(LASAT_UART_REGS_BASE), \ + iomem_reg_shift: LASAT_UART_REGS_SHIFT, io_type: SERIAL_IO_MEM } +#else +#define LASAT_SERIAL_PORT_DEFNS +#endif + #ifdef CONFIG_AU1000_UART #include <asm/au1000.h> #define AU1000_SERIAL_PORT_DEFNS \ @@ -286,6 +298,7 @@ COBALT_SERIAL_PORT_DEFNS \ EV96100_SERIAL_PORT_DEFNS \ JAZZ_SERIAL_PORT_DEFNS \ + LASAT_SERIAL_PORT_DEFNS \ STD_SERIAL_PORT_DEFNS \ EXTRA_SERIAL_PORT_DEFNS \ HUB6_SERIAL_PORT_DFNS \
Attachment:
lasat.tar.gz
Description: application/gzip