From: Ralf Baechle o Fix what got broken by 2.6.11-rc1 o Support for KGDB o Misc minor fixes Signed-off-by: Andrew Morton --- 25-akpm/arch/mips/Kconfig | 2 25-akpm/arch/mips/configs/ip27_defconfig | 54 ++++++++++- 25-akpm/arch/mips/sgi-ip27/Makefile | 1 25-akpm/arch/mips/sgi-ip27/ip27-dbgio.c | 60 +++++++++++++ 25-akpm/arch/mips/sgi-ip27/ip27-init.c | 13 +- 25-akpm/arch/mips/sgi-ip27/ip27-irq-glue.S | 2 25-akpm/arch/mips/sgi-ip27/ip27-klnuma.c | 6 - 25-akpm/arch/mips/sgi-ip27/ip27-memory.c | 4 25-akpm/arch/mips/sgi-ip27/ip27-nmi.c | 3 25-akpm/arch/mips/sgi-ip27/ip27-reset.c | 1 25-akpm/arch/mips/sgi-ip27/ip27-smp.c | 1 25-akpm/arch/mips/sgi-ip27/ip27-timer.c | 3 25-akpm/include/asm-mips/mach-ip27/cpu-feature-overrides.h | 1 25-akpm/include/asm-mips/sn/mapped_kernel.h | 14 ++- 25-akpm/include/asm-mips/sn/sn0/hubio.h | 2 25-akpm/include/asm-mips/sn/sn_private.h | 4 16 files changed, 144 insertions(+), 27 deletions(-) diff -puN arch/mips/configs/ip27_defconfig~mips-sgi-ip27-updates arch/mips/configs/ip27_defconfig --- 25/arch/mips/configs/ip27_defconfig~mips-sgi-ip27-updates 2005-01-29 11:25:56.116338328 -0800 +++ 25-akpm/arch/mips/configs/ip27_defconfig 2005-01-29 11:25:56.139334832 -0800 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc2 -# Sun Nov 21 14:12:00 2004 +# Linux kernel version: 2.6.11-rc2 +# Wed Jan 26 02:49:04 2005 # CONFIG_MIPS=y CONFIG_MIPS64=y @@ -91,12 +91,12 @@ CONFIG_NUMA=y # CONFIG_SIBYTE_SB1xxx_SOC is not set # CONFIG_SNI_RM200_PCI is not set CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_HAVE_DEC_LOCK=y CONFIG_ARC=y CONFIG_DMA_IP27=y # CONFIG_CPU_LITTLE_ENDIAN is not set CONFIG_MIPS_L1_CACHE_SHIFT=7 -# CONFIG_FB is not set CONFIG_ARC64=y CONFIG_BOOT_ELF64=y CONFIG_QL_ISP_A64=y @@ -145,6 +145,20 @@ CONFIG_PCI_NAMES=y CONFIG_MMU=y # +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# PCI Hotplug Support +# +# CONFIG_HOTPLUG_PCI is not set + +# # Executable file formats # CONFIG_BINFMT_ELF=y @@ -165,6 +179,7 @@ CONFIG_BINFMT_ELF32=y # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set # # Memory Technology Devices (MTD) @@ -188,11 +203,13 @@ 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_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_RAM is not set +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_INITRAMFS_SOURCE="" CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 @@ -205,6 +222,7 @@ CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -238,6 +256,7 @@ CONFIG_SCSI_LOGGING=y # CONFIG_SCSI_SPI_ATTRS=y # CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -266,14 +285,12 @@ CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_QLOGIC_ISP=y # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -509,6 +526,7 @@ CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_LIBPS2 is not set CONFIG_SERIO_RAW=m # @@ -562,7 +580,6 @@ CONFIG_SGI_IP27_RTC=y # # Ftape, the floppy tape device driver # -# CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_RAW_DRIVER is not set @@ -593,6 +610,8 @@ CONFIG_SGI_IP27_RTC=y # # Graphics support # +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -607,11 +626,25 @@ CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# # USB Gadget Support # # CONFIG_USB_GADGET is not set # +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# # File systems # CONFIG_EXT2_FS=y @@ -732,6 +765,11 @@ CONFIG_SGI_PARTITION=y # CONFIG_NLS is not set # +# Profiling support +# +# CONFIG_PROFILING is not set + +# # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set @@ -774,6 +812,10 @@ CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_TEST=m # +# Hardware crypto devices +# + +# # Library routines # # CONFIG_CRC_CCITT is not set diff -puN arch/mips/Kconfig~mips-sgi-ip27-updates arch/mips/Kconfig --- 25/arch/mips/Kconfig~mips-sgi-ip27-updates 2005-01-29 11:25:56.117338176 -0800 +++ 25-akpm/arch/mips/Kconfig 2005-01-29 11:25:56.147333616 -0800 @@ -431,6 +431,8 @@ config SGI_IP22 config SGI_IP27 bool "Support for SGI IP27 (Origin200/2000)" depends on MIPS64 + select ARC + select ARC64 select DMA_IP27 select HW_HAS_PCI select PCI_DOMAINS diff -puN /dev/null arch/mips/sgi-ip27/ip27-dbgio.c --- /dev/null 2003-09-15 06:40:47.000000000 -0700 +++ 25-akpm/arch/mips/sgi-ip27/ip27-dbgio.c 2005-01-29 11:25:56.140334680 -0800 @@ -0,0 +1,60 @@ +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Copyright 2004 Ralf Baechle + */ +#include +#include +#include +#include +#include + +#include +#include +#include + +#define IOC3_CLK (22000000 / 3) +#define IOC3_FLAGS (0) + +static inline struct ioc3_uartregs *console_uart(void) +{ + struct ioc3 *ioc3; + + ioc3 = (struct ioc3 *)KL_CONFIG_CH_CONS_INFO(get_nasid())->memory_base; + + return &ioc3->sregs.uarta; +} + +unsigned char getDebugChar(void) +{ + struct ioc3_uartregs *uart = console_uart(); + + while ((uart->iu_lsr & UART_LSR_DR) == 0); + return uart->iu_rbr; +} + +void putDebugChar(unsigned char c) +{ + struct ioc3_uartregs *uart = console_uart(); + + while ((uart->iu_lsr & UART_LSR_THRE) == 0); + uart->iu_thr = c; +} diff -puN arch/mips/sgi-ip27/ip27-init.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-init.c --- 25/arch/mips/sgi-ip27/ip27-init.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.119337872 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-init.c 2005-01-29 11:25:56.140334680 -0800 @@ -77,15 +77,14 @@ static void __init per_hub_init(cnodeid_ * copy over the caliased exception handlers. */ if (get_compact_nodeid() == cnode) { - extern char except_vec0, except_vec1_r4k; extern char except_vec2_generic, except_vec3_generic; + extern void build_tlb_refill_handler(void); - memcpy((void *)(KSEG0 + 0x100), &except_vec2_generic, 0x80); - memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x80); - memcpy((void *)KSEG0, &except_vec0, 0x80); - memcpy((void *)KSEG0 + 0x080, &except_vec1_r4k, 0x80); - memcpy((void *)(KSEG0 + 0x100), (void *) KSEG0, 0x80); - memcpy((void *)(KSEG0 + 0x180), &except_vec3_generic, 0x100); + memcpy((void *)(CKSEG0 + 0x100), &except_vec2_generic, 0x80); + memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x80); + build_tlb_refill_handler(); + memcpy((void *)(CKSEG0 + 0x100), (void *) CKSEG0, 0x80); + memcpy((void *)(CKSEG0 + 0x180), &except_vec3_generic, 0x100); __flush_cache_all(); } #endif diff -puN arch/mips/sgi-ip27/ip27-irq-glue.S~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-irq-glue.S --- 25/arch/mips/sgi-ip27/ip27-irq-glue.S~mips-sgi-ip27-updates 2005-01-29 11:25:56.120337720 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-irq-glue.S 2005-01-29 11:25:56.141334528 -0800 @@ -21,7 +21,7 @@ NESTED(ip27_irq, PT_SIZE, sp) mfc0 t0, CP0_STATUS and s0, t0 move a0, sp - la ra, ret_from_irq + PTR_LA ra, ret_from_irq /* First check for RT interrupt. */ andi t0, s0, CAUSEF_IP4 diff -puN arch/mips/sgi-ip27/ip27-klnuma.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-klnuma.c --- 25/arch/mips/sgi-ip27/ip27-klnuma.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.121337568 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-klnuma.c 2005-01-29 11:25:56.141334528 -0800 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include -extern char _end; static cpumask_t ktext_repmask; /* @@ -118,12 +118,12 @@ void __init replicate_kernel_text() */ pfn_t node_getfirstfree(cnodeid_t cnode) { - unsigned long loadbase = CKSEG0; + unsigned long loadbase = REP_BASE; nasid_t nasid = COMPACT_TO_NASID_NODEID(cnode); unsigned long offset; #ifdef CONFIG_MAPPED_KERNEL - loadbase = CKSSEG + 16777216; + loadbase += 16777216; #endif offset = PAGE_ALIGN((unsigned long)(&_end)) - loadbase; if ((cnode == 0) || (cpu_isset(cnode, ktext_repmask))) diff -puN arch/mips/sgi-ip27/ip27-memory.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-memory.c --- 25/arch/mips/sgi-ip27/ip27-memory.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.123337264 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-memory.c 2005-01-29 11:25:56.142334376 -0800 @@ -3,18 +3,20 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000 by Ralf Baechle + * Copyright (C) 2000, 05 by Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2000 by Silicon Graphics, Inc. * Copyright (C) 2004 by Christoph Hellwig * * On SGI IP27 the ARC memory configuration data is completly bogus but * alternate easier to use mechanisms are available. */ +#include #include #include #include #include #include +#include #include #include #include diff -puN arch/mips/sgi-ip27/ip27-nmi.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-nmi.c --- 25/arch/mips/sgi-ip27/ip27-nmi.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.124337112 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-nmi.c 2005-01-29 11:25:56.143334224 -0800 @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -21,7 +22,7 @@ typedef unsigned long machreg_t; -spinlock_t nmi_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(nmi_lock); /* * Lets see what else we need to do here. Set up sp, gp? diff -puN arch/mips/sgi-ip27/ip27-reset.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-reset.c --- 25/arch/mips/sgi-ip27/ip27-reset.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.125336960 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-reset.c 2005-01-29 11:25:56.143334224 -0800 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff -puN arch/mips/sgi-ip27/ip27-smp.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-smp.c --- 25/arch/mips/sgi-ip27/ip27-smp.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.127336656 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-smp.c 2005-01-29 11:25:56.143334224 -0800 @@ -8,6 +8,7 @@ */ #include #include +#include #include #include #include diff -puN arch/mips/sgi-ip27/ip27-timer.c~mips-sgi-ip27-updates arch/mips/sgi-ip27/ip27-timer.c --- 25/arch/mips/sgi-ip27/ip27-timer.c~mips-sgi-ip27-updates 2005-01-29 11:25:56.128336504 -0800 +++ 25-akpm/arch/mips/sgi-ip27/ip27-timer.c 2005-01-29 11:25:56.144334072 -0800 @@ -1,9 +1,8 @@ /* - * Copytight (C) 1999, 2000 Ralf Baechle (ralf@gnu.org) + * Copytight (C) 1999, 2000, 05 Ralf Baechle (ralf@linux-mips.org) * Copytight (C) 1999, 2000 Silicon Graphics, Inc. */ #include -#include #include #include #include diff -puN arch/mips/sgi-ip27/Makefile~mips-sgi-ip27-updates arch/mips/sgi-ip27/Makefile --- 25/arch/mips/sgi-ip27/Makefile~mips-sgi-ip27-updates 2005-01-29 11:25:56.129336352 -0800 +++ 25-akpm/arch/mips/sgi-ip27/Makefile 2005-01-29 11:25:56.144334072 -0800 @@ -6,6 +6,7 @@ obj-y := ip27-berr.o ip27-console.o ip27 ip27-klconfig.o ip27-klnuma.o ip27-memory.o ip27-nmi.o ip27-reset.o \ ip27-timer.o ip27-hubio.o ip27-xtalk.o +obj-$(CONFIG_KGDB) += ip27-dbgio.o obj-$(CONFIG_SMP) += ip27-smp.o EXTRA_AFLAGS := $(CFLAGS) diff -puN include/asm-mips/mach-ip27/cpu-feature-overrides.h~mips-sgi-ip27-updates include/asm-mips/mach-ip27/cpu-feature-overrides.h --- 25/include/asm-mips/mach-ip27/cpu-feature-overrides.h~mips-sgi-ip27-updates 2005-01-29 11:25:56.131336048 -0800 +++ 25-akpm/include/asm-mips/mach-ip27/cpu-feature-overrides.h 2005-01-29 11:25:56.148333464 -0800 @@ -25,6 +25,7 @@ #define cpu_has_vtag_icache 0 #define cpu_has_dc_aliases 0 #define cpu_has_ic_fills_f_dc 0 +#define cpu_icache_snoops_remote_store 1 #define cpu_has_nofpuex 0 #define cpu_has_64bits 1 diff -puN include/asm-mips/sn/mapped_kernel.h~mips-sgi-ip27-updates include/asm-mips/sn/mapped_kernel.h --- 25/include/asm-mips/sn/mapped_kernel.h~mips-sgi-ip27-updates 2005-01-29 11:25:56.132335896 -0800 +++ 25-akpm/include/asm-mips/sn/mapped_kernel.h 2005-01-29 11:25:56.145333920 -0800 @@ -23,10 +23,16 @@ #include #include +#ifdef CONFIG_BUILD_ELF64 +#define REP_BASE CAC_BASE +#else +#define REP_BASE CKSEG0 +#endif + #ifdef CONFIG_MAPPED_KERNEL -#define MAPPED_ADDR_RO_TO_PHYS(x) (x - CKSSEG) -#define MAPPED_ADDR_RW_TO_PHYS(x) (x - CKSSEG - 16777216) +#define MAPPED_ADDR_RO_TO_PHYS(x) (x - REP_BASE) +#define MAPPED_ADDR_RW_TO_PHYS(x) (x - REP_BASE - 16777216) #define MAPPED_KERN_RO_PHYSBASE(n) \ (PLAT_NODE_DATA(n)->kern_vars.kv_ro_baseaddr) @@ -42,8 +48,8 @@ #else /* CONFIG_MAPPED_KERNEL */ -#define MAPPED_KERN_RO_TO_PHYS(x) (x - CKSEG0) -#define MAPPED_KERN_RW_TO_PHYS(x) (x - CKSEG0) +#define MAPPED_KERN_RO_TO_PHYS(x) (x - REP_BASE) +#define MAPPED_KERN_RW_TO_PHYS(x) (x - REP_BASE) #endif /* CONFIG_MAPPED_KERNEL */ diff -puN include/asm-mips/sn/sn0/hubio.h~mips-sgi-ip27-updates include/asm-mips/sn/sn0/hubio.h --- 25/include/asm-mips/sn/sn0/hubio.h~mips-sgi-ip27-updates 2005-01-29 11:25:56.133335744 -0800 +++ 25-akpm/include/asm-mips/sn/sn0/hubio.h 2005-01-29 11:25:56.146333768 -0800 @@ -486,6 +486,7 @@ typedef union h1_icrba_u { #define ICRBN_A_CERR_SHFT 54 #define ICRBN_A_ERR_MASK 0x3ff +#if 0 /* Disabled, this causes namespace polution and break allmodconfig */ /* * Easy access macros. */ @@ -499,6 +500,7 @@ typedef union h1_icrba_u { #define a_addr icrba_fields_s.addr #define a_valid icrba_fields_s.valid #define a_iow icrba_fields_s.iow +#endif #endif /* !__ASSEMBLY__ */ diff -puN include/asm-mips/sn/sn_private.h~mips-sgi-ip27-updates include/asm-mips/sn/sn_private.h --- 25/include/asm-mips/sn/sn_private.h~mips-sgi-ip27-updates 2005-01-29 11:25:56.135335440 -0800 +++ 25-akpm/include/asm-mips/sn/sn_private.h 2005-01-29 11:25:56.146333768 -0800 @@ -12,8 +12,8 @@ extern void cpu_time_init(void); extern void per_cpu_init(void); extern void install_cpu_nmi_handler(int slice); extern void install_ipi(void); -extern void setup_replication_mask(); -extern void replicate_kernel_text(); +extern void setup_replication_mask(void); +extern void replicate_kernel_text(void); extern pfn_t node_getfirstfree(cnodeid_t); #endif /* __ASM_SN_SN_PRIVATE_H */ _