diff -urpN linux-2.6.9-cvs/arch/mips/Kconfig linux-2.6.9-pdh/arch/mips/Kconfig --- linux-2.6.9-cvs/arch/mips/Kconfig 2004-10-20 07:17:10.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/Kconfig 2004-10-31 14:40:45.000000000 +0000 @@ -1306,7 +1306,7 @@ config CPU_ADVANCED config CPU_HAS_LLSC bool "ll/sc Instructions available" if CPU_ADVANCED - default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX + default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX && (!MIPS_COBALT || !MIPS64) help MIPS R4000 series and later provide the Load Linked (ll) and Store Conditional (sc) instructions. More information is @@ -1318,7 +1318,7 @@ config CPU_HAS_LLSC config CPU_HAS_LLDSCD bool "lld/scd Instructions available" if CPU_ADVANCED - default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX && !CPU_MIPS32 + default y if !CPU_ADVANCED && !CPU_R3000 && !CPU_VR41XX && !CPU_TX39XX && !CPU_MIPS32 && (!MIPS_COBALT || !MIPS64) help Say Y here if your CPU has the lld and scd instructions, the 64-bit equivalents of ll and sc. Say Y here for better performance, N if diff -urpN linux-2.6.9-cvs/arch/mips/Makefile linux-2.6.9-pdh/arch/mips/Makefile --- linux-2.6.9-cvs/arch/mips/Makefile 2004-10-20 01:04:02.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/Makefile 2004-10-31 14:40:45.000000000 +0000 @@ -329,6 +329,7 @@ load-$(CONFIG_BAGET_MIPS) += 0xffffffff8 # Cobalt Server # core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/ +cflags-$(CONFIG_MIPS_COBALT) += -Iinclude/asm-mips/cobalt load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000 # diff -urpN linux-2.6.9-cvs/arch/mips/cobalt/int-handler.S linux-2.6.9-pdh/arch/mips/cobalt/int-handler.S --- linux-2.6.9-cvs/arch/mips/cobalt/int-handler.S 2003-11-13 14:30:45.000000000 +0000 +++ linux-2.6.9-pdh/arch/mips/cobalt/int-handler.S 2004-10-31 14:40:45.000000000 +0000 @@ -18,8 +18,8 @@ SAVE_ALL CLI - la ra, ret_from_irq - move a1, sp + PTR_LA ra, ret_from_irq + move a0, sp j cobalt_irq END(cobalt_handle_int) diff -urpN linux-2.6.9-cvs/arch/mips/cobalt/irq.c linux-2.6.9-pdh/arch/mips/cobalt/irq.c --- linux-2.6.9-cvs/arch/mips/cobalt/irq.c 2004-08-20 10:19:01.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/cobalt/irq.c 2004-10-31 14:40:45.000000000 +0000 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -25,8 +26,8 @@ extern void cobalt_handle_int(void); * the CPU interrupt lines, and ones that come in on the via chip. The CPU * mappings are: * - * 16, - Software interrupt 0 (unused) IE_SW0 - * 17 - Software interrupt 1 (unused) IE_SW0 + * 16 - Software interrupt 0 (unused) IE_SW0 + * 17 - Software interrupt 1 (unused) IE_SW1 * 18 - Galileo chip (timer) IE_IRQ0 * 19 - Tulip 0 + NCR SCSI IE_IRQ1 * 20 - Tulip 1 IE_IRQ2 @@ -82,11 +83,15 @@ asmlinkage void cobalt_irq(struct pt_reg } if (pending & CAUSEF_IP7) { /* int 23 */ - do_IRQ(COBALT_QUBE_SLOT_IRQ, regs); + do_IRQ(23, regs); return; } } +static struct irqaction irq_via = { + no_action, 0, { { 0, } }, "cascade", NULL, NULL +}; + void __init arch_init_irq(void) { set_except_vector(0, cobalt_handle_int); @@ -99,4 +104,6 @@ void __init arch_init_irq(void) * (except IE4, we already masked those at VIA level) */ change_c0_status(ST0_IM, IE_IRQ4); + + setup_irq(COBALT_VIA_IRQ, &irq_via); } diff -urpN linux-2.6.9-cvs/arch/mips/cobalt/reset.c linux-2.6.9-pdh/arch/mips/cobalt/reset.c --- linux-2.6.9-cvs/arch/mips/cobalt/reset.c 2002-12-02 00:27:43.000000000 +0000 +++ linux-2.6.9-pdh/arch/mips/cobalt/reset.c 2004-10-31 15:38:02.000000000 +0000 @@ -16,48 +16,45 @@ #include #include #include +#include -void cobalt_machine_restart(char *command) +void cobalt_machine_halt(void) { - *(volatile char *)0xbc000000 = 0x0f; + int state, last, diff; + unsigned long mark; /* - * Ouch, we're still alive ... This time we take the silver bullet ... - * ... and find that we leave the hardware in a state in which the - * kernel in the flush locks up somewhen during of after the PCI - * detection stuff. + * turn off bar on Qube, flash power off LED on RaQ (0.5Hz) + * + * restart if ENTER and SELECT are pressed */ - set_c0_status(ST0_BEV | ST0_ERL); - change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED); - flush_cache_all(); - write_c0_wired(0); - __asm__ __volatile__( - "jr\t%0" - : - : "r" (0xbfc00000)); -} -extern int led_state; -#define kLED 0xBC000000 -#define LEDSet(x) (*(volatile unsigned char *) kLED) = (( unsigned char)x) + last = COBALT_KEY_PORT; -void cobalt_machine_halt(void) -{ - int mark; + for (state = 0;;) { + + state ^= COBALT_LED_POWER_OFF; + COBALT_LED_PORT = state; + + diff = COBALT_KEY_PORT ^ last; + last ^= diff; - /* Blink our cute? little LED (number 3)... */ - while (1) { - led_state = led_state | ( 1 << 3 ); - LEDSet(led_state); - mark = jiffies; - while (jiffies<(mark+HZ)); - led_state = led_state & ~( 1 << 3 ); - LEDSet(led_state); - mark = jiffies; - while (jiffies<(mark+HZ)); + if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT))) + COBALT_LED_PORT = COBALT_LED_RESET; + + for (mark = jiffies; jiffies - mark < HZ;) + ; } } +void cobalt_machine_restart(char *command) +{ + COBALT_LED_PORT = COBALT_LED_RESET; + + /* we should never get here */ + cobalt_machine_halt(); +} + /* * This triggers the luser mode device driver for the power switch ;-) */ diff -urpN linux-2.6.9-cvs/arch/mips/cobalt/setup.c linux-2.6.9-pdh/arch/mips/cobalt/setup.c --- linux-2.6.9-cvs/arch/mips/cobalt/setup.c 2004-08-26 21:18:00.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/cobalt/setup.c 2004-10-31 14:40:45.000000000 +0000 @@ -30,27 +30,25 @@ extern void cobalt_machine_power_off(voi int cobalt_board_id; -static char my_cmdline[CL_SIZE] = { - "console=ttyS0,115200 " -#ifdef CONFIG_IP_PNP - "ip=on " -#endif -#ifdef CONFIG_ROOT_NFS - "root=/dev/nfs " -#else - "root=/dev/hda1 " -#endif - }; - const char *get_system_type(void) { + switch (cobalt_board_id) { + case COBALT_BRD_ID_QUBE1: + return "Cobalt Qube"; + case COBALT_BRD_ID_RAQ1: + return "Cobalt RaQ"; + case COBALT_BRD_ID_QUBE2: + return "Cobalt Qube2"; + case COBALT_BRD_ID_RAQ2: + return "Cobalt RaQ2"; + } return "MIPS Cobalt"; } static void __init cobalt_timer_setup(struct irqaction *irq) { - /* Load timer value for 150 Hz */ - GALILEO_OUTL(500000, GT_TC0_OFS); + /* Load timer value for 1KHz */ + GALILEO_OUTL(50*1000*1000 / 1000, GT_TC0_OFS); /* Register our timer interrupt */ setup_irq(COBALT_TIMER_IRQ, irq); @@ -58,17 +56,17 @@ static void __init cobalt_timer_setup(st /* Enable timer ints */ GALILEO_OUTL((GALILEO_ENTC0 | GALILEO_SELTC0), GT_TC_CONTROL_OFS); /* Unmask timer int */ - GALILEO_OUTL(0x100, GT_INTRMASK_OFS); + GALILEO_OUTL(GALILEO_T0EXP, GT_INTRMASK_OFS); } extern struct pci_ops gt64111_pci_ops; static struct resource cobalt_mem_resource = { - "GT64111 PCI MEM", GT64111_IO_BASE, 0xffffffffUL, IORESOURCE_MEM + "GT64111 PCI MEM", GT64111_MEM_BASE, GT64111_MEM_END, IORESOURCE_MEM }; static struct resource cobalt_io_resource = { - "GT64111 IO MEM", 0x00001000UL, 0x0fffffffUL, IORESOURCE_IO + "GT64111 IO MEM", 0x00001000UL, GT64111_IO_END - GT64111_IO_BASE, IORESOURCE_IO }; static struct resource cobalt_io_resources[] = { @@ -86,10 +84,10 @@ static struct pci_controller cobalt_pci_ .mem_resource = &cobalt_mem_resource, .mem_offset = 0, .io_resource = &cobalt_io_resource, - .io_offset = 0x00001000UL - GT64111_IO_BASE + .io_offset = 0 - GT64111_IO_BASE }; -static void __init cobalt_setup(void) +static int __init cobalt_setup(void) { unsigned int devfn = PCI_DEVFN(COBALT_PCICONF_VIA, 0); int i; @@ -100,7 +98,10 @@ static void __init cobalt_setup(void) board_timer_setup = cobalt_timer_setup; - set_io_port_base(KSEG1ADDR(GT64111_IO_BASE)); + set_io_port_base(CKSEG1ADDR(GT64111_IO_BASE)); + + /* IO region should cover all Galileo IO */ + ioport_resource.end = 0x0fffffff; /* * This is a prom style console. We just poke at the @@ -120,27 +121,112 @@ static void __init cobalt_setup(void) cobalt_board_id >>= ((VIA_COBALT_BRD_ID_REG & 3) * 8); cobalt_board_id = VIA_COBALT_BRD_REG_to_ID(cobalt_board_id); + printk("Cobalt board ID: %d\n", cobalt_board_id); + #ifdef CONFIG_PCI register_pci_controller(&cobalt_pci_controller); #endif + + return 0; } early_initcall(cobalt_setup); +#ifdef CONFIG_BLK_DEV_INITRD + +static int __init initrd_setup(unsigned long memsz) +{ + extern unsigned long initrd_start, initrd_end; + extern char __rd_start, __rd_end; + + unsigned long start, size, phys; + char *ptr; + + if (!memcmp(arcs_cmdline, "initrd=", 7)) + ptr = arcs_cmdline; + else { + ptr = strstr(arcs_cmdline, " initrd="); + if (!ptr) + return 0; + ++ptr; + } + + size = simple_strtoul(ptr + 7, &ptr, 16); + if (*ptr != '@') + goto invalid; + + start = simple_strtoul(ptr + 1, &ptr, 16); + if (*ptr && *ptr != ' ') + goto invalid; + + phys = CPHYSADDR(start); + if (phys + size > memsz) { +invalid: + printk(KERN_WARNING "initrd: command line parameter invalid\n"); + return 0; + } + + if (!size) + return 0; + + /* an embedded ramdisk overrides us (arch/mips/kernel/setup.c) */ + + if (&__rd_start != &__rd_end) { + printk(KERN_WARNING "initrd: overridden by embedded ramdisk\n"); + return 0; + } + + initrd_start = start; + initrd_end = start + size; + + add_memory_region(0x0, phys, BOOT_MEM_RAM); + add_memory_region(phys, size, BOOT_MEM_RESERVED); + phys += size; + add_memory_region(phys, memsz - phys, BOOT_MEM_RAM); + + return 1; +} + +#endif /* CONFIG_BLK_DEV_INITRD */ + /* * Prom init. We read our one and only communication with the firmware. - * Grab the amount of installed memory + * Grab the amount of installed memory. + * Better boot loaders pass a command line too :-) */ void __init prom_init(void) { - int argc = fw_arg0; - - strcpy(arcs_cmdline, my_cmdline); + int narg, indx, posn, nchr; + unsigned long memsz; + char **argv; mips_machgroup = MACH_GROUP_COBALT; - add_memory_region(0x0, argc & 0x7fffffff, BOOT_MEM_RAM); + memsz = fw_arg0 & 0x7fff0000; + narg = fw_arg0 & 0xffff; + + if (narg) { + arcs_cmdline[0] = '\0'; + argv = (char **) fw_arg1; + posn = 0; + for (indx = 1; indx < narg; ++indx) { + nchr = strlen(argv[indx]); + if (posn + 1 + nchr + 1 > sizeof(arcs_cmdline)) + break; + if (posn) + arcs_cmdline[posn++] = ' '; + strcpy(arcs_cmdline + posn, argv[indx]); + posn += nchr; + } + } + +#ifdef CONFIG_BLK_DEV_INITRD + if (!initrd_setup(memsz)) +#endif + { + add_memory_region(0x0, memsz, BOOT_MEM_RAM); + } } unsigned long __init prom_free_prom_memory(void) diff -urpN linux-2.6.9-cvs/arch/mips/configs/cobalt_defconfig linux-2.6.9-pdh/arch/mips/configs/cobalt_defconfig --- linux-2.6.9-cvs/arch/mips/configs/cobalt_defconfig 2004-10-20 01:30:01.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/configs/cobalt_defconfig 2004-10-31 14:40:45.000000000 +0000 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.9 -# Wed Oct 20 02:27:33 2004 +# Fri Oct 29 11:00:26 2004 # CONFIG_MIPS=y # CONFIG_MIPS64 is not set @@ -21,7 +21,7 @@ CONFIG_BROKEN_ON_SMP=y CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y -# CONFIG_POSIX_MQUEUE is not set +CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set @@ -29,8 +29,7 @@ CONFIG_LOG_BUF_SHIFT=14 # CONFIG_HOTPLUG is not set # CONFIG_IKCONFIG is not set CONFIG_EMBEDDED=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_EXTRA_PASS is not set +# CONFIG_KALLSYMS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_NOOP=y @@ -165,8 +164,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set -CONFIG_BLK_DEV_LOOP=y -# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_LOOP is not set # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set @@ -188,15 +186,43 @@ CONFIG_BLK_DEV_IDEDISK=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_IDE_TASK_IOCTL is not set -CONFIG_IDE_TASKFILE_IO=y +# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y -# CONFIG_BLK_DEV_IDEPCI is not set +CONFIG_BLK_DEV_IDEPCI=y +CONFIG_IDEPCI_SHARE_IRQ=y +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_OPTI621 is not set +CONFIG_BLK_DEV_IDEDMA_PCI=y +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set +# CONFIG_IDEDMA_PCI_AUTO is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_HPT34X is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_TRM290 is not set +CONFIG_BLK_DEV_VIA82CXXX=y # CONFIG_IDE_ARM is not set -# CONFIG_BLK_DEV_IDEDMA is not set +CONFIG_BLK_DEV_IDEDMA=y +# CONFIG_IDEDMA_IVB is not set # CONFIG_IDEDMA_AUTO is not set # CONFIG_BLK_DEV_HD is not set @@ -311,7 +337,15 @@ CONFIG_NET_ETHERNET=y # # Tulip family network device support # -# CONFIG_NET_TULIP is not set +CONFIG_NET_TULIP=y +# CONFIG_DE2104X is not set +CONFIG_TULIP=y +# CONFIG_TULIP_MWI is not set +# CONFIG_TULIP_MMIO is not set +# CONFIG_TULIP_NAPI is not set +# CONFIG_DE4X5 is not set +# CONFIG_WINBOND_840 is not set +# CONFIG_DM9102 is not set # CONFIG_HP100 is not set # CONFIG_NET_PCI is not set @@ -368,47 +402,28 @@ CONFIG_NET_ETHERNET=y # # Input device support # -CONFIG_INPUT=y +# CONFIG_INPUT is not set # # Userland interfaces # -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -# CONFIG_INPUT_TSDEV is not set -# CONFIG_INPUT_EVDEV is not set -# CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y -CONFIG_SERIO=y +# CONFIG_SERIO is not set # CONFIG_SERIO_I8042 is not set -CONFIG_SERIO_SERPORT=y -# CONFIG_SERIO_CT82C710 is not set -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_RAW=y # # Input Device Drivers # -# CONFIG_INPUT_KEYBOARD is not set -# CONFIG_INPUT_MOUSE is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set # # Character devices # -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_HW_CONSOLE=y +# CONFIG_VT is not set # CONFIG_SERIAL_NONSTANDARD is not set # @@ -479,12 +494,6 @@ CONFIG_COBALT_LCD=y # # -# Console display driver support -# -# CONFIG_VGA_CONSOLE is not set -CONFIG_DUMMY_CONSOLE=y - -# # Sound # # CONFIG_SOUND is not set @@ -503,15 +512,11 @@ CONFIG_DUMMY_CONSOLE=y # File systems # CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y -CONFIG_EXT2_FS_SECURITY=y +# CONFIG_EXT2_FS_XATTR is not set # CONFIG_EXT3_FS is not set # CONFIG_JBD is not set -CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set -CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set @@ -541,7 +546,7 @@ CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y -# CONFIG_TMPFS is not set +CONFIG_TMPFS=y # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y @@ -565,16 +570,9 @@ CONFIG_RAMFS=y # # Network File Systems # -CONFIG_NFS_FS=y -# CONFIG_NFS_V3 is not set -# CONFIG_NFS_V4 is not set -# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFS_FS is not set # CONFIG_NFSD is not set -CONFIG_LOCKD=y # CONFIG_EXPORTFS is not set -CONFIG_SUNRPC=y -# CONFIG_RPCSEC_GSS_KRB5 is not set -# CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set @@ -596,8 +594,8 @@ CONFIG_MSDOS_PARTITION=y # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set -CONFIG_CROSSCOMPILE=y -CONFIG_CMDLINE="" +# CONFIG_CROSSCOMPILE is not set +CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/hda2" # # Security options @@ -613,5 +611,5 @@ CONFIG_CMDLINE="" # Library routines # # CONFIG_CRC_CCITT is not set -# CONFIG_CRC32 is not set +CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set diff -urpN linux-2.6.9-cvs/arch/mips/kernel/cpu-probe.c linux-2.6.9-pdh/arch/mips/kernel/cpu-probe.c --- linux-2.6.9-cvs/arch/mips/kernel/cpu-probe.c 2004-05-19 16:31:49.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/kernel/cpu-probe.c 2004-10-31 15:36:45.000000000 +0000 @@ -353,6 +353,17 @@ static inline void cpu_probe_legacy(stru c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | MIPS_CPU_DIVEC | MIPS_CPU_LLSC; c->tlbsize = 48; +#ifdef CONFIG_MIPS64 + /* + * ll(d) is broken on RM5231 for cached accesses to XKPHYS + * + * the load is always done uncached .. ugh! + */ + if ((c->processor_id & 0x00ff) == PRID_REV_RM5231) { + c->options &= ~MIPS_CPU_LLSC; + printk("RM5231: not using broken 'load linked'.\n"); + } +#endif break; case PRID_IMP_R6000: c->cputype = CPU_R6000; diff -urpN linux-2.6.9-cvs/arch/mips/kernel/i8259.c linux-2.6.9-pdh/arch/mips/kernel/i8259.c --- linux-2.6.9-cvs/arch/mips/kernel/i8259.c 2004-09-19 13:30:04.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/kernel/i8259.c 2004-10-31 14:40:45.000000000 +0000 @@ -295,7 +295,7 @@ void __init init_8259A(int auto_eoi) * IRQ2 is cascade interrupt to second interrupt controller */ static struct irqaction irq2 = { - no_action, 0, 0, "cascade", NULL, NULL + no_action, 0, { { 0, } }, "cascade", NULL, NULL }; static struct resource pic1_io_resource = { diff -urpN linux-2.6.9-cvs/arch/mips/kernel/setup.c linux-2.6.9-pdh/arch/mips/kernel/setup.c --- linux-2.6.9-cvs/arch/mips/kernel/setup.c 2004-06-28 22:04:12.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/kernel/setup.c 2004-10-31 14:40:45.000000000 +0000 @@ -359,8 +359,8 @@ static inline void bootmem_init(void) if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { printk("initrd extends beyond end of memory " - "(0x%0*Lx > 0x%0*Lx)\ndisabling initrd\n", - sizeof(long) * 2, CPHYSADDR(initrd_end), + "(0x%0*lx > 0x%0*lx)\ndisabling initrd\n", + sizeof(long) * 2, (unsigned long) CPHYSADDR(initrd_end), sizeof(long) * 2, PFN_PHYS(max_low_pfn)); initrd_start = initrd_end = 0; } diff -urpN linux-2.6.9-cvs/arch/mips/lib-32/dump_tlb.c linux-2.6.9-pdh/arch/mips/lib-32/dump_tlb.c --- linux-2.6.9-cvs/arch/mips/lib-32/dump_tlb.c 2004-02-11 15:05:41.000000000 +0000 +++ linux-2.6.9-pdh/arch/mips/lib-32/dump_tlb.c 2004-10-31 14:40:45.000000000 +0000 @@ -32,6 +32,7 @@ static inline const char *msk2str(unsign case PM_256M: return "256Mb"; #endif } + return "???"; } #define BARRIER() \ diff -urpN linux-2.6.9-cvs/arch/mips/pci/fixup-cobalt.c linux-2.6.9-pdh/arch/mips/pci/fixup-cobalt.c --- linux-2.6.9-cvs/arch/mips/pci/fixup-cobalt.c 2004-08-24 16:10:05.000000000 +0100 +++ linux-2.6.9-pdh/arch/mips/pci/fixup-cobalt.c 2004-10-31 14:40:45.000000000 +0000 @@ -47,6 +47,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_V static void qube_raq_galileo_fixup(struct pci_dev *dev) { unsigned short galileo_id; + int i; /* Fix PCI latency-timer and cache-line-size values in Galileo * host bridge. @@ -55,6 +56,13 @@ static void qube_raq_galileo_fixup(struc pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 7); /* + * The code described by the comment below has been removed + * as it causes bus mastering by the Ethernet controllers + * to break under any kind of network load. We always set + * the retry timeouts to their maximum. + * + * --x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x--x-- + * * On all machines prior to Q2, we had the STOP line disconnected * from Galileo to VIA on PCI. The new Galileo does not function * correctly unless we have it connected. @@ -64,19 +72,34 @@ static void qube_raq_galileo_fixup(struc */ pci_read_config_word(dev, PCI_REVISION_ID, &galileo_id); galileo_id &= 0xff; /* mask off class info */ + + printk("Galileo ID: %u\n", galileo_id); + +#if 0 if (galileo_id >= 0x10) { /* New Galileo, assumes PCI stop line to VIA is connected. */ GALILEO_OUTL(0x4020, GT_PCI0_TOR_OFS); - } else if (galileo_id == 0x1 || galileo_id == 0x2) { + } else if (galileo_id == 0x1 || galileo_id == 0x2) +#endif + { signed int timeo; /* XXX WE MUST DO THIS ELSE GALILEO LOCKS UP! -DaveM */ timeo = GALILEO_INL(GT_PCI0_TOR_OFS); /* Old Galileo, assumes PCI STOP line to VIA is disconnected. */ GALILEO_OUTL(0xffff, GT_PCI0_TOR_OFS); } + + /* + * hide Galileo from the kernel's PCI resource assignment. The BARs + * on Galileo will already have been set up by the boot loader to + * match the DRAM configuration so we don't want them being monkeyed + * around with. + */ + for (i = 0; i < DEVICE_COUNT_RESOURCE; ++i) + dev->resource[i].start = dev->resource[i].end = dev->resource[i].flags = 0; } -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_GALILEO, PCI_ANY_ID, +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, qube_raq_galileo_fixup); static char irq_tab_cobalt[] __initdata = { diff -urpN linux-2.6.9-cvs/drivers/char/lcd.h linux-2.6.9-pdh/drivers/char/lcd.h --- linux-2.6.9-cvs/drivers/char/lcd.h 2004-06-26 16:15:13.000000000 +0100 +++ linux-2.6.9-pdh/drivers/char/lcd.h 2004-10-31 14:40:45.000000000 +0000 @@ -22,7 +22,7 @@ static int timeout(volatile unsigned lon #define MAX_IDLE_TIME 120 struct lcd_display { - unsigned long buttons; + unsigned buttons; int size1; int size2; unsigned char line1[LCD_CHARS_PER_LINE]; diff -urpN linux-2.6.9-cvs/drivers/net/tulip/eeprom.c linux-2.6.9-pdh/drivers/net/tulip/eeprom.c --- linux-2.6.9-cvs/drivers/net/tulip/eeprom.c 2004-07-20 21:21:22.000000000 +0100 +++ linux-2.6.9-pdh/drivers/net/tulip/eeprom.c 2004-10-31 14:40:45.000000000 +0000 @@ -62,6 +62,22 @@ static struct eeprom_fixup eeprom_fixups */ { 0x1e00, 0x0000, 0x000b, 0x8f01, 0x0103, 0x0300, 0x0821, 0x000, 0x0001, 0x0000, 0x01e1 } }, + {"Cobalt Microserver", 0, 0x10, 0xE0, {0x1e00, /* 0 == controller #, 1e == offset */ + 0x0000, /* 0 == high offset, 0 == gap */ + 0x0800, /* Default Autoselect */ + 0x8001, /* 1 leaf, extended type, bogus len */ + 0x0003, /* Type 3 (MII), PHY #0 */ + 0x0400, /* 0 init instr, 4 reset instr */ + 0x0801, /* Set control mode, GP0 output */ + 0x0000, /* Drive GP0 Low (RST is active low) */ + 0x0800, /* control mode, GP0 input (undriven) */ + 0x0000, /* clear control mode */ + 0x7800, /* 100TX FDX + HDX, 10bT FDX + HDX */ + 0x01e0, /* Advertise all above */ + 0x5000, /* FDX all above */ + 0x1800, /* Set fast TTM in 100bt modes */ + 0x0000, /* PHY cannot be unplugged */ + }}, {NULL}}; diff -urpN linux-2.6.9-cvs/drivers/net/tulip/media.c linux-2.6.9-pdh/drivers/net/tulip/media.c --- linux-2.6.9-cvs/drivers/net/tulip/media.c 2004-04-12 21:23:33.000000000 +0100 +++ linux-2.6.9-pdh/drivers/net/tulip/media.c 2004-10-31 14:40:45.000000000 +0000 @@ -363,6 +363,9 @@ void tulip_select_media(struct net_devic } tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); + + udelay(1000); + return; } diff -urpN linux-2.6.9-cvs/drivers/net/tulip/tulip_core.c linux-2.6.9-pdh/drivers/net/tulip/tulip_core.c --- linux-2.6.9-cvs/drivers/net/tulip/tulip_core.c 2004-08-14 17:16:43.000000000 +0100 +++ linux-2.6.9-pdh/drivers/net/tulip/tulip_core.c 2004-10-31 14:40:45.000000000 +0000 @@ -1505,8 +1505,8 @@ static int __devinit tulip_init_one (str (PCI_SLOT(pdev->devfn) == 12))) { /* Cobalt MAC address in first EEPROM locations. */ sa_offset = 0; - /* No media table either */ - tp->flags &= ~HAS_MEDIA_TABLE; + /* Ensure our media table fixup get's applied */ + memcpy(ee_data + 16, ee_data, 8); } #endif #ifdef CONFIG_GSC @@ -1622,6 +1622,16 @@ static int __devinit tulip_init_one (str } } +#if defined(CONFIG_MIPS_COBALT) && defined(CONFIG_MIPS64) + /* + * something very bad is happening. without this + * cache flush the PHY can't be read. I've tried + * various ins & outs, delays etc but only a call + * to printk or this flush seems to fix it ... help! + */ + flush_cache_all(); +#endif + /* Find the connected MII xcvrs. Doing this in open() would allow detecting external xcvrs later, but takes much time. */ diff -urpN linux-2.6.9-cvs/include/asm-mips/addrspace.h linux-2.6.9-pdh/include/asm-mips/addrspace.h --- linux-2.6.9-cvs/include/asm-mips/addrspace.h 2004-09-25 11:47:04.000000000 +0100 +++ linux-2.6.9-pdh/include/asm-mips/addrspace.h 2004-10-31 14:40:45.000000000 +0000 @@ -120,7 +120,7 @@ #define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p)) #define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p)) #define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK) -#define PHYS_TO_XKPHYS(cm,a) (0x8000000000000000 | ((cm)<<59) | (a)) +#define PHYS_TO_XKPHYS(cm,a) (0x8000000000000000 | ((unsigned long)(cm)<<59) | (a)) #if defined (CONFIG_CPU_R4300) \ || defined (CONFIG_CPU_R4X00) \ diff -urpN linux-2.6.9-cvs/include/asm-mips/bitops.h linux-2.6.9-pdh/include/asm-mips/bitops.h --- linux-2.6.9-cvs/include/asm-mips/bitops.h 2004-10-12 02:45:51.000000000 +0100 +++ linux-2.6.9-pdh/include/asm-mips/bitops.h 2004-10-31 14:40:45.000000000 +0000 @@ -92,7 +92,7 @@ static inline void set_bit(unsigned long __bi_flags; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); __bi_local_irq_save(flags); *a |= mask; __bi_local_irq_restore(flags); @@ -152,7 +152,7 @@ static inline void clear_bit(unsigned lo __bi_flags; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); __bi_local_irq_save(flags); *a &= ~mask; __bi_local_irq_restore(flags); @@ -214,7 +214,7 @@ static inline void change_bit(unsigned l __bi_flags; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); __bi_local_irq_save(flags); *a ^= mask; __bi_local_irq_restore(flags); @@ -293,7 +293,7 @@ static inline int test_and_set_bit(unsig __bi_flags; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); __bi_local_irq_save(flags); retval = (mask & *a) != 0; *a |= mask; @@ -320,7 +320,7 @@ static inline int __test_and_set_bit(uns int retval; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); retval = (mask & *a) != 0; *a |= mask; @@ -385,7 +385,7 @@ static inline int test_and_clear_bit(uns __bi_flags; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); __bi_local_irq_save(flags); retval = (mask & *a) != 0; *a &= ~mask; @@ -474,7 +474,7 @@ static inline int test_and_change_bit(un __bi_flags; a += nr >> SZLONG_LOG; - mask = 1 << (nr & SZLONG_MASK); + mask = 1UL << (nr & SZLONG_MASK); __bi_local_irq_save(flags); retval = (mask & *a) != 0; *a ^= mask; diff -urpN linux-2.6.9-cvs/include/asm-mips/cobalt/cobalt.h linux-2.6.9-pdh/include/asm-mips/cobalt/cobalt.h --- linux-2.6.9-cvs/include/asm-mips/cobalt/cobalt.h 2003-11-13 16:56:16.000000000 +0000 +++ linux-2.6.9-pdh/include/asm-mips/cobalt/cobalt.h 2004-10-31 15:21:07.000000000 +0000 @@ -19,7 +19,10 @@ * 9 - PCI * 14 - IDE0 * 15 - IDE1 - * + */ +#define COBALT_QUBE_SLOT_IRQ 9 + +/* * CPU IRQs are 16 ... 23 */ #define COBALT_TIMER_IRQ 18 @@ -30,7 +33,6 @@ #define COBALT_SERIAL_IRQ 21 #define COBALT_SCSI_IRQ 21 #define COBALT_VIA_IRQ 22 /* Chained to VIA ISA bridge */ -#define COBALT_QUBE_SLOT_IRQ 23 /* * PCI configuration space manifest constants. These are wired into @@ -69,13 +71,16 @@ * Most of this really should go into a separate GT64111 header file. */ #define GT64111_IO_BASE 0x10000000UL +#define GT64111_IO_END 0x11ffffffUL +#define GT64111_MEM_BASE 0x12000000UL +#define GT64111_MEM_END 0x13ffffffUL #define GT64111_BASE 0x14000000UL -#define GALILEO_REG(ofs) (KSEG0 + GT64111_BASE + (unsigned long)(ofs)) +#define GALILEO_REG(ofs) CKSEG1ADDR(GT64111_BASE + (unsigned long)(ofs)) #define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port)) #define GALILEO_OUTL(val, port) \ do { \ - *(volatile unsigned int *) GALILEO_REG(port) = (port); \ + *(volatile unsigned int *) GALILEO_REG(port) = (val); \ } while (0) #define GALILEO_T0EXP 0x0100 @@ -86,5 +91,21 @@ do { \ GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \ (PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS) +#define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000)) +# define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */ +# define COBALT_LED_BAR_RIGHT (1 << 1) /* Qube */ +# define COBALT_LED_WEB (1 << 2) /* RaQ */ +# define COBALT_LED_POWER_OFF (1 << 3) /* RaQ */ +# define COBALT_LED_RESET 0x0f + +#define COBALT_KEY_PORT ((~*(volatile unsigned int *) CKSEG1ADDR(0x1d000000) >> 24) & COBALT_KEY_MASK) +# define COBALT_KEY_CLEAR (1 << 1) +# define COBALT_KEY_LEFT (1 << 2) +# define COBALT_KEY_UP (1 << 3) +# define COBALT_KEY_DOWN (1 << 4) +# define COBALT_KEY_RIGHT (1 << 5) +# define COBALT_KEY_ENTER (1 << 6) +# define COBALT_KEY_SELECT (1 << 7) +# define COBALT_KEY_MASK 0xfe #endif /* __ASM_COBALT_H */ diff -urpN linux-2.6.9-cvs/include/asm-mips/cobalt/ide.h linux-2.6.9-pdh/include/asm-mips/cobalt/ide.h --- linux-2.6.9-cvs/include/asm-mips/cobalt/ide.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-pdh/include/asm-mips/cobalt/ide.h 2004-10-31 14:40:45.000000000 +0000 @@ -0,0 +1,71 @@ + +/* + * PIO "in" transfers can cause D-cache lines to be allocated + * to the data being read. If the target is the page cache then + * the kernel can create a user space mapping of the same page + * without flushing it from the D-cache. This has large potential + * to create cache aliases. The Cobalts seem to trigger this + * problem easily. + * + * MIPs doesn't have a flush_dcache_range() so we roll + * our own. + * + * -- pdh + */ + +#define MAX_HWIFS 2 + +#include + +static inline void __flush_dcache(void) +{ + unsigned long dc_size, dc_line, addr, end; + + dc_size = current_cpu_data.dcache.ways << current_cpu_data.dcache.waybit; + dc_line = current_cpu_data.dcache.linesz; + + addr = CKSEG0; + end = addr + dc_size; + + for (; addr < end; addr += dc_line) + flush_dcache_line_indexed(addr); +} + +static inline void __flush_dcache_range(unsigned long start, unsigned long end) +{ + unsigned long dc_size, dc_line, addr; + + dc_size = current_cpu_data.dcache.ways << current_cpu_data.dcache.waybit; + dc_line = current_cpu_data.dcache.linesz; + + addr = start & ~(dc_line - 1); + end += dc_line - 1; + + if (end - addr < dc_size) + for (; addr < end; addr += dc_line) + flush_dcache_line(addr); + else + __flush_dcache(); +} + +static inline void __ide_insw(unsigned long port, void *addr, unsigned int count) +{ + __insw(port, addr, count); + + __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count * 2); +} + +static inline void __ide_insl(unsigned long port, void *addr, unsigned int count) +{ + __insl(port, addr, count); + + __flush_dcache_range((unsigned long) addr, (unsigned long) addr + count * 4); +} + +#undef insw +#undef insl + +#define insw(p,a,n) __ide_insw((p),(a),(n)) +#define insl(p,a,n) __ide_insl((p),(a),(n)) + +#include diff -urpN linux-2.6.9-cvs/include/asm-mips/cobalt/mach-gt64120.h linux-2.6.9-pdh/include/asm-mips/cobalt/mach-gt64120.h --- linux-2.6.9-cvs/include/asm-mips/cobalt/mach-gt64120.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.9-pdh/include/asm-mips/cobalt/mach-gt64120.h 2004-10-31 14:40:45.000000000 +0000 @@ -0,0 +1 @@ +/* there's something here ... in the dark */ diff -urpN linux-2.6.9-cvs/include/asm-mips/cpu.h linux-2.6.9-pdh/include/asm-mips/cpu.h --- linux-2.6.9-cvs/include/asm-mips/cpu.h 2004-01-19 18:23:16.000000000 +0000 +++ linux-2.6.9-pdh/include/asm-mips/cpu.h 2004-10-31 15:01:08.000000000 +0000 @@ -106,6 +106,7 @@ #define PRID_REV_VR4122 0x0070 #define PRID_REV_VR4181A 0x0070 /* Same as VR4122 */ #define PRID_REV_VR4130 0x0080 +#define PRID_REV_RM5231 0x00a0 /* * FPU implementation/revision register (CP1 control register 0). diff -urpN linux-2.6.9-cvs/include/asm-mips/pci.h linux-2.6.9-pdh/include/asm-mips/pci.h --- linux-2.6.9-cvs/include/asm-mips/pci.h 2004-08-26 21:31:11.000000000 +0100 +++ linux-2.6.9-pdh/include/asm-mips/pci.h 2004-10-31 14:40:45.000000000 +0000 @@ -11,6 +11,9 @@ #ifdef __KERNEL__ +extern void pcibios_resource_to_bus(struct pci_dev *dev, + struct pci_bus_region *region, struct resource *res); + /* * This file essentially defines the interface between board * specific PCI code and MIPS common PCI code. Should potentially put diff -urpN linux-2.6.9-cvs/init/do_mounts_initrd.c linux-2.6.9-pdh/init/do_mounts_initrd.c --- linux-2.6.9-cvs/init/do_mounts_initrd.c 2004-06-30 18:26:50.000000000 +0100 +++ linux-2.6.9-pdh/init/do_mounts_initrd.c 2004-10-31 14:40:45.000000000 +0000 @@ -1,4 +1,5 @@ #define __KERNEL_SYSCALLS__ +#include #include #include #include