]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch '3.10-fixes' into mips-for-linux-next
authorRalf Baechle <ralf@linux-mips.org>
Tue, 2 Jul 2013 15:19:04 +0000 (17:19 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 12 Jul 2013 16:11:43 +0000 (18:11 +0200)
This that should have been fixed but weren't, way to much, intrusive
and late.

45 files changed:
arch/mips/Kconfig
arch/mips/ath79/mach-ap136.c
arch/mips/bcm63xx/Kconfig
arch/mips/cavium-octeon/Makefile
arch/mips/cavium-octeon/setup.c
arch/mips/fw/cfe/cfe_api.c
arch/mips/include/asm/fw/cfe/cfe_api.h
arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
arch/mips/include/asm/mach-cavium-octeon/spaces.h [new file with mode: 0644]
arch/mips/include/asm/mach-ip27/kernel-entry-init.h
arch/mips/include/asm/mips-boards/generic.h
arch/mips/include/asm/mmu_context.h
arch/mips/include/asm/xtalk/xtalk.h
arch/mips/include/uapi/asm/fcntl.h
arch/mips/include/uapi/asm/inst.h
arch/mips/include/uapi/asm/msgbuf.h
arch/mips/include/uapi/asm/resource.h
arch/mips/include/uapi/asm/siginfo.h
arch/mips/include/uapi/asm/swab.h
arch/mips/kernel/ftrace.c
arch/mips/kernel/head.S
arch/mips/kernel/idle.c
arch/mips/kernel/rtlx.c
arch/mips/kernel/traps.c
arch/mips/kernel/watch.c
arch/mips/loongson/common/cs5536/cs5536_isa.c
arch/mips/mm/cerr-sb1.c
arch/mips/mm/tlbex.c
arch/mips/mti-malta/malta-reset.c
arch/mips/mti-sead3/sead3-reset.c
arch/mips/pci/pci-ip27.c
arch/mips/sgi-ip27/Makefile
arch/mips/sgi-ip27/ip27-irq-pci.c [new file with mode: 0644]
arch/mips/sgi-ip27/ip27-irq.c
arch/mips/sibyte/Kconfig
arch/mips/sibyte/Platform
arch/mips/sibyte/common/Makefile
arch/mips/sibyte/common/bus_watcher.c [moved from arch/mips/sibyte/sb1250/bus_watcher.c with 94% similarity]
arch/mips/sibyte/common/sb_tbprof.c
arch/mips/sibyte/sb1250/Makefile
arch/mips/sni/pcimt.c
arch/mips/sni/pcit.c
drivers/rapidio/switches/idt_gen2.c
drivers/watchdog/sb_wdog.c
lib/Kconfig.debug

index 1e7a40e00bc012dba94d0a820b15a3810e3a1258..5589699aa832be8d021535d391367e81485613c0 100644 (file)
@@ -420,7 +420,6 @@ config POWERTV
        select CSRC_POWERTV
        select DMA_NONCOHERENT
        select HW_HAS_PCI
-       select SYS_HAS_EARLY_PRINTK
        select SYS_HAS_CPU_MIPS32_R2
        select SYS_SUPPORTS_32BIT_KERNEL
        select SYS_SUPPORTS_BIG_ENDIAN
index 479dd4b1d0d2d21443f25fc9805ca3365c4f7f63..07eac58c3641bc9be9b8262100189c4f4b94ae50 100644 (file)
@@ -132,7 +132,7 @@ static void __init ap136_pci_init(u8 *eeprom)
        ath79_register_pci();
 }
 #else
-static inline void ap136_pci_init(void) {}
+static inline void ap136_pci_init(u8 *eeprom) {}
 #endif /* CONFIG_PCI */
 
 static void __init ap136_setup(void)
index afe52d4ed3b9f3f85ad6618f9b1be29b5b59e28a..b78306ce56c73b5dc3cf4d083bdb3185b2ed52e7 100644 (file)
@@ -12,14 +12,9 @@ config BCM63XX_CPU_6328
 config BCM63XX_CPU_6338
        bool "support 6338 CPU"
        select HW_HAS_PCI
-       select USB_ARCH_HAS_OHCI
-       select USB_OHCI_BIG_ENDIAN_DESC
-       select USB_OHCI_BIG_ENDIAN_MMIO
 
 config BCM63XX_CPU_6345
        bool "support 6345 CPU"
-       select USB_OHCI_BIG_ENDIAN_DESC
-       select USB_OHCI_BIG_ENDIAN_MMIO
 
 config BCM63XX_CPU_6348
        bool "support 6348 CPU"
index b703583779fb0856194df2a9d5892a0cc8aaf1e8..4e952043c922177590a01540af71304ae51dc120 100644 (file)
@@ -13,10 +13,11 @@ CFLAGS_octeon-platform.o = -I$(src)/../../../scripts/dtc/libfdt
 CFLAGS_setup.o = -I$(src)/../../../scripts/dtc/libfdt
 
 obj-y := cpu.o setup.o octeon-platform.o octeon-irq.o csrc-octeon.o
-obj-y += dma-octeon.o flash_setup.o
+obj-y += dma-octeon.o
 obj-y += octeon-memcpy.o
 obj-y += executive/
 
+obj-$(CONFIG_MTD)                    += flash_setup.o
 obj-$(CONFIG_SMP)                    += smp.o
 obj-$(CONFIG_OCTEON_ILM)             += oct_ilm.o
 
index 0acc8ef869072555cf3dd8a13ef8ba5aa9fb64a5..48b08eb9d9e4bd29dc97f5ec97c3f763852ff4aa 100644 (file)
@@ -7,6 +7,7 @@
  * Copyright (C) 2008, 2009 Wind River Systems
  *   written by Ralf Baechle <ralf@linux-mips.org>
  */
+#include <linux/compiler.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/console.h>
@@ -694,7 +695,7 @@ void __init prom_init(void)
        if (cvmx_read_csr(CVMX_L2D_FUS3) & (3ull << 34)) {
                pr_info("Skipping L2 locking due to reduced L2 cache size\n");
        } else {
-               uint32_t ebase = read_c0_ebase() & 0x3ffff000;
+               uint32_t __maybe_unused ebase = read_c0_ebase() & 0x3ffff000;
 #ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB
                /* TLB refill */
                cvmx_l2c_lock_mem_region(ebase, 0x100);
@@ -978,7 +979,7 @@ void __init plat_mem_setup(void)
        cvmx_bootmem_unlock();
        /* Add the memory region for the kernel. */
        kernel_start = (unsigned long) _text;
-       kernel_size = ALIGN(_end - _text, 0x100000);
+       kernel_size = _end - _text;
 
        /* Adjust for physical offset. */
        kernel_start &= ~0xffffffff80000000ULL;
index d06dc5a6b8d398ec5e4f6947277af6f589d06376..cf84f01931c53e550b46ec1dec8729f8ae39c780 100644 (file)
@@ -406,12 +406,12 @@ int cfe_setenv(char *name, char *val)
        return xiocb.xiocb_status;
 }
 
-int cfe_write(int handle, unsigned char *buffer, int length)
+int cfe_write(int handle, const char *buffer, int length)
 {
        return cfe_writeblk(handle, 0, buffer, length);
 }
 
-int cfe_writeblk(int handle, s64 offset, unsigned char *buffer, int length)
+int cfe_writeblk(int handle, s64 offset, const char *buffer, int length)
 {
        struct cfe_xiocb xiocb;
 
index 17347551a1b2afd930340f0ea99b973d230594b5..a0ea69e91e2eb78f12ac1c8e4f5e2028697f965d 100644 (file)
@@ -115,8 +115,8 @@ int cfe_read(int handle, unsigned char *buffer, int length);
 int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
                int length);
 int cfe_setenv(char *name, char *val);
-int cfe_write(int handle, unsigned char *buffer, int length);
-int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
+int cfe_write(int handle, const char *buffer, int length);
+int cfe_writeblk(int handle, int64_t offset, const char *buffer,
                 int length);
 
 #endif                         /* CFE_API_H */
index be8fb4240cece35c234b14f43cd65a26b16a0988..47fb247f9663b501796a7c255b32525c225cffed 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H
 #define __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H
 
+#include <linux/bug.h>
+
 struct device;
 
 extern void octeon_pci_dma_init(void);
@@ -21,18 +23,21 @@ static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
        size_t size)
 {
        BUG();
+       return 0;
 }
 
 static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
        struct page *page)
 {
        BUG();
+       return 0;
 }
 
 static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
        dma_addr_t dma_addr)
 {
        BUG();
+       return 0;
 }
 
 static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
@@ -44,6 +49,7 @@ static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
 static inline int plat_dma_supported(struct device *dev, u64 mask)
 {
        BUG();
+       return 0;
 }
 
 static inline void plat_extra_sync_for_device(struct device *dev)
@@ -60,6 +66,7 @@ static inline int plat_dma_mapping_error(struct device *dev,
                                         dma_addr_t dma_addr)
 {
        BUG();
+       return 0;
 }
 
 dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
diff --git a/arch/mips/include/asm/mach-cavium-octeon/spaces.h b/arch/mips/include/asm/mach-cavium-octeon/spaces.h
new file mode 100644 (file)
index 0000000..daa91ac
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2012 Cavium, Inc.
+ */
+#ifndef _ASM_MACH_CAVIUM_OCTEON_SPACES_H
+#define _ASM_MACH_CAVIUM_OCTEON_SPACES_H
+
+#include <linux/const.h>
+
+#ifdef CONFIG_64BIT
+/* They are all the same and some OCTEON II cores cannot handle 0xa8.. */
+#define CAC_BASE               _AC(0x8000000000000000, UL)
+#define UNCAC_BASE             _AC(0x8000000000000000, UL)
+#define IO_BASE                        _AC(0x8000000000000000, UL)
+
+
+#endif /* CONFIG_64BIT */
+
+#include <asm/mach-generic/spaces.h>
+
+#endif /* _ASM_MACH_CAVIUM_OCTEON_SPACES_H */
index a323efb720dc01018792f76ab88f0ff093043658..b087cb83da3a51fb88af8db48e51f4feb85918b1 100644 (file)
        dsrl    \res, NSRI_NODEID_SHFT
        .endm
 
+/*
+ * TLB bits
+ */
+#define PAGE_GLOBAL            (1 << 6)
+#define PAGE_VALID             (1 << 7)
+#define PAGE_DIRTY             (1 << 8)
+#define CACHE_CACHABLE_COW     (5 << 9)
+
+       /*
+        * inputs are the text nasid in t1, data nasid in t2.
+        */
+       .macro MAPPED_KERNEL_SETUP_TLB
+#ifdef CONFIG_MAPPED_KERNEL
+       /*
+        * This needs to read the nasid - assume 0 for now.
+        * Drop in 0xffffffffc0000000 in tlbhi, 0+VG in tlblo_0,
+        * 0+DVG in tlblo_1.
+        */
+       dli     t0, 0xffffffffc0000000
+       dmtc0   t0, CP0_ENTRYHI
+       li      t0, 0x1c000             # Offset of text into node memory
+       dsll    t1, NASID_SHFT          # Shift text nasid into place
+       dsll    t2, NASID_SHFT          # Same for data nasid
+       or      t1, t1, t0              # Physical load address of kernel text
+       or      t2, t2, t0              # Physical load address of kernel data
+       dsrl    t1, 12                  # 4K pfn
+       dsrl    t2, 12                  # 4K pfn
+       dsll    t1, 6                   # Get pfn into place
+       dsll    t2, 6                   # Get pfn into place
+       li      t0, ((PAGE_GLOBAL | PAGE_VALID | CACHE_CACHABLE_COW) >> 6)
+       or      t0, t0, t1
+       mtc0    t0, CP0_ENTRYLO0        # physaddr, VG, cach exlwr
+       li      t0, ((PAGE_GLOBAL | PAGE_VALID |  PAGE_DIRTY | CACHE_CACHABLE_COW) >> 6)
+       or      t0, t0, t2
+       mtc0    t0, CP0_ENTRYLO1        # physaddr, DVG, cach exlwr
+       li      t0, 0x1ffe000           # MAPPED_KERN_TLBMASK, TLBPGMASK_16M
+       mtc0    t0, CP0_PAGEMASK
+       li      t0, 0                   # KMAP_INX
+       mtc0    t0, CP0_INDEX
+       li      t0, 1
+       mtc0    t0, CP0_WIRED
+       tlbwi
+#else
+       mtc0    zero, CP0_WIRED
+#endif
+       .endm
+
 /*
  * Intentionally empty macro, used in head.S. Override in
  * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
index bd9746fbe4af8a6b098df65c5f386cecec86f2e4..48616816bcbc9073b3184e83a6276dad687d6feb 100644 (file)
 #define ASCII_DISPLAY_WORD_BASE           0x1f000410
 #define ASCII_DISPLAY_POS_BASE    0x1f000418
 
-/*
- * Reset register.
- */
-#define SOFTRES_REG      0x1f000500
-#define GORESET                  0x42
-
 /*
  * Revision register.
  */
index 1fed8bdcf2a054205d1367acca226e7009aa1b39..3b29079b5424b4fe0f78588ab1b8821aef0a1237 100644 (file)
@@ -113,7 +113,7 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
        if (! ((asid += ASID_INC) & ASID_MASK) ) {
                if (cpu_has_vtag_icache)
                        flush_icache_all();
-#ifdef CONFIG_VIRTUALIZATION
+#ifdef CONFIG_KVM
                kvm_local_flush_tlb_all();      /* start new asid cycle */
 #else
                local_flush_tlb_all();  /* start new asid cycle */
index 680e7efebbaf6bd08246ade5a9dd14a8a6640a57..26d2ed1fa9176bc8c811673792d7f7d65a8106f7 100644 (file)
@@ -47,6 +47,15 @@ typedef struct xtalk_piomap_s *xtalk_piomap_t;
 #define XIO_PORT(x)    ((xwidgetnum_t)(((x)&XIO_PORT_BITS) >> XIO_PORT_SHIFT))
 #define XIO_PACK(p, o) ((((uint64_t)(p))<<XIO_PORT_SHIFT) | ((o)&XIO_ADDR_BITS))
 
+#ifdef CONFIG_PCI
+extern int bridge_probe(nasid_t nasid, int widget, int masterwid);
+#else
+static inline int bridge_probe(nasid_t nasid, int widget, int masterwid)
+{
+       return 0;
+}
+#endif
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_XTALK_XTALK_H */
index 314c79b76d2a7f704247f18018a2b38a407e9868..6ca432f00860e3bf1c128e0e9d7e3f25ab1e3656 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef _UAPI_ASM_FCNTL_H
 #define _UAPI_ASM_FCNTL_H
 
+#include <asm/sgidefs.h>
 
 #define O_APPEND       0x0008
 #define O_DSYNC                0x0010  /* used to be O_SYNC, see below */
@@ -55,7 +56,8 @@
  * contain all the same fields as struct flock.
  */
 
-#ifdef CONFIG_32BIT
+#if _MIPS_SIM != _MIPS_SIM_ABI64
+
 #include <linux/types.h>
 
 struct flock {
@@ -70,7 +72,7 @@ struct flock {
 
 #define HAVE_ARCH_STRUCT_FLOCK
 
-#endif /* CONFIG_32BIT */
+#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
 
 #include <asm-generic/fcntl.h>
 
index 0f4aec2ad1e6e1c9f7d8b7a1b54cf49ebb58c392..e5a676e3d3c04ce267dc6254652ff48520565823 100644 (file)
@@ -409,10 +409,11 @@ enum mm_32f_73_minor_op {
 enum mm_16c_minor_op {
        mm_lwm16_op = 0x04,
        mm_swm16_op = 0x05,
-       mm_jr16_op = 0x18,
-       mm_jrc_op = 0x1a,
-       mm_jalr16_op = 0x1c,
-       mm_jalrs16_op = 0x1e,
+       mm_jr16_op = 0x0c,
+       mm_jrc_op = 0x0d,
+       mm_jalr16_op = 0x0e,
+       mm_jalrs16_op = 0x0f,
+       mm_jraddiusp_op = 0x18,
 };
 
 /*
index 0d6c7f14de31ade52bbef1ba33506396bcf8eafb..df849e87d9aee9ffb9f6141e921e13e21f6059c8 100644 (file)
 
 struct msqid64_ds {
        struct ipc64_perm msg_perm;
-#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+#if !defined(__mips64) && defined(__MIPSEB__)
        unsigned long   __unused1;
 #endif
        __kernel_time_t msg_stime;      /* last msgsnd time */
-#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+#if !defined(__mips64) && defined(__MIPSEL__)
        unsigned long   __unused1;
 #endif
-#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+#if !defined(__mips64) && defined(__MIPSEB__)
        unsigned long   __unused2;
 #endif
        __kernel_time_t msg_rtime;      /* last msgrcv time */
-#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+#if !defined(__mips64) && defined(__MIPSEL__)
        unsigned long   __unused2;
 #endif
-#if defined(CONFIG_32BIT) && !defined(CONFIG_CPU_LITTLE_ENDIAN)
+#if !defined(__mips64) && defined(__MIPSEB__)
        unsigned long   __unused3;
 #endif
        __kernel_time_t msg_ctime;      /* last change time */
-#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_LITTLE_ENDIAN)
+#if !defined(__mips64) && defined(__MIPSEL__)
        unsigned long   __unused3;
 #endif
        unsigned long  msg_cbytes;      /* current number of bytes on queue */
index 87cb3085269ca49f1a3280865f43a37b6d5be74b..b26439d4ab0ba5e2a77ef337345fae830483cbc0 100644 (file)
@@ -26,7 +26,7 @@
  * but we keep the old value on MIPS32,
  * for compatibility:
  */
-#ifdef CONFIG_32BIT
+#ifndef __mips64
 # define RLIM_INFINITY         0x7fffffffUL
 #endif
 
index 6a8714193fb9b03ad5bdeb753642e1622247961d..b7a23064841f2171173dbaca04027381000e02d4 100644 (file)
@@ -25,10 +25,10 @@ struct siginfo;
 /*
  * Careful to keep union _sifields from shifting ...
  */
-#ifdef CONFIG_32BIT
+#if __SIZEOF_LONG__ == 4
 #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
 #endif
-#ifdef CONFIG_64BIT
+#if __SIZEOF_LONG__ == 8
 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
 #endif
 
index 97c2f81b4b43af66d766778ea2c17dcca6d8303b..ac9a8f9cd1fbfb53299e579661ce63d406cfee18 100644 (file)
@@ -13,7 +13,7 @@
 
 #define __SWAB_64_THRU_32__
 
-#ifdef CONFIG_CPU_MIPSR2
+#if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
 
 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
 {
@@ -39,10 +39,10 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 #define __arch_swab32 __arch_swab32
 
 /*
- * Having already checked for CONFIG_CPU_MIPSR2, enable the
- * optimized version for 64-bit kernel on r2 CPUs.
+ * Having already checked for MIPS R2, enable the optimized version for
+ * 64-bit kernel on r2 CPUs.
  */
-#ifdef CONFIG_64BIT
+#ifdef __mips64
 static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
 {
        __asm__(
@@ -54,6 +54,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
        return x;
 }
 #define __arch_swab64 __arch_swab64
-#endif /* CONFIG_64BIT */
-#endif /* CONFIG_CPU_MIPSR2 */
+#endif /* __mips64 */
+#endif /* MIPS R2 or newer  */
 #endif /* _ASM_SWAB_H */
index cf5509f13dd57bc832e1db50d65f88ccda6e81c7..dba90ec0dc385ffcad5cc09eda51031d4e9a0fcc 100644 (file)
 #define MCOUNT_OFFSET_INSNS 4
 #endif
 
+#ifdef CONFIG_DYNAMIC_FTRACE
+
 /* Arch override because MIPS doesn't need to run this from stop_machine() */
 void arch_ftrace_update_code(int command)
 {
        ftrace_modify_all_code(command);
 }
 
+#endif
+
 /*
  * Check if the address is in kernel space
  *
index c61cdaed2b1d998f2614be9f9a7451837f59ebaf..09991232442394d68964efd5ac1d978afa706b5b 100644 (file)
 
 #include <kernel-entry-init.h>
 
-       /*
-        * inputs are the text nasid in t1, data nasid in t2.
-        */
-       .macro MAPPED_KERNEL_SETUP_TLB
-#ifdef CONFIG_MAPPED_KERNEL
-       /*
-        * This needs to read the nasid - assume 0 for now.
-        * Drop in 0xffffffffc0000000 in tlbhi, 0+VG in tlblo_0,
-        * 0+DVG in tlblo_1.
-        */
-       dli     t0, 0xffffffffc0000000
-       dmtc0   t0, CP0_ENTRYHI
-       li      t0, 0x1c000             # Offset of text into node memory
-       dsll    t1, NASID_SHFT          # Shift text nasid into place
-       dsll    t2, NASID_SHFT          # Same for data nasid
-       or      t1, t1, t0              # Physical load address of kernel text
-       or      t2, t2, t0              # Physical load address of kernel data
-       dsrl    t1, 12                  # 4K pfn
-       dsrl    t2, 12                  # 4K pfn
-       dsll    t1, 6                   # Get pfn into place
-       dsll    t2, 6                   # Get pfn into place
-       li      t0, ((_PAGE_GLOBAL|_PAGE_VALID| _CACHE_CACHABLE_COW) >> 6)
-       or      t0, t0, t1
-       mtc0    t0, CP0_ENTRYLO0        # physaddr, VG, cach exlwr
-       li      t0, ((_PAGE_GLOBAL|_PAGE_VALID| _PAGE_DIRTY|_CACHE_CACHABLE_COW) >> 6)
-       or      t0, t0, t2
-       mtc0    t0, CP0_ENTRYLO1        # physaddr, DVG, cach exlwr
-       li      t0, 0x1ffe000           # MAPPED_KERN_TLBMASK, TLBPGMASK_16M
-       mtc0    t0, CP0_PAGEMASK
-       li      t0, 0                   # KMAP_INX
-       mtc0    t0, CP0_INDEX
-       li      t0, 1
-       mtc0    t0, CP0_WIRED
-       tlbwi
-#else
-       mtc0    zero, CP0_WIRED
-#endif
-       .endm
-
        /*
         * For the moment disable interrupts, mark the kernel mode and
         * set ST0_KX so that the CPU does not spit fire when using
index 3b09b888afa9a1df7a3ff7e09814c80855da74d4..0c655deeea4adff8fd575cd5d09b372cd3f820e5 100644 (file)
@@ -93,26 +93,27 @@ static void rm7k_wait_irqoff(void)
 }
 
 /*
- * The Au1xxx wait is available only if using 32khz counter or
- * external timer source, but specifically not CP0 Counter.
- * alchemy/common/time.c may override cpu_wait!
+ * Au1 'wait' is only useful when the 32kHz counter is used as timer,
+ * since coreclock (and the cp0 counter) stops upon executing it. Only an
+ * interrupt can wake it, so they must be enabled before entering idle modes.
  */
 static void au1k_wait(void)
 {
+       unsigned long c0status = read_c0_status() | 1;  /* irqs on */
+
        __asm__(
        "       .set    mips3                   \n"
        "       cache   0x14, 0(%0)             \n"
        "       cache   0x14, 32(%0)            \n"
        "       sync                            \n"
-       "       nop                             \n"
+       "       mtc0    %1, $12                 \n" /* wr c0status */
        "       wait                            \n"
        "       nop                             \n"
        "       nop                             \n"
        "       nop                             \n"
        "       nop                             \n"
        "       .set    mips0                   \n"
-       : : "r" (au1k_wait));
-       local_irq_enable();
+       : : "r" (au1k_wait), "r" (c0status));
 }
 
 static int __initdata nowait;
index 6fa198db89994cbe504dee1dadd51b25f9a38790..d763f11e35e2e9812a87c58e67f81759bb3dfd17 100644 (file)
@@ -437,7 +437,6 @@ static ssize_t file_write(struct file *file, const char __user * buffer,
                          size_t count, loff_t * ppos)
 {
        int minor = iminor(file_inode(file));
-       struct rtlx_channel *rt = &rtlx->channel[minor];
 
        /* any space left... */
        if (!rtlx_write_poll(minor)) {
index b0f3ad26063ea1dc381def2bdb8e6bf1c5855622..0903d70b2cfe7940a154b8f66e8ded3762b3035b 100644 (file)
@@ -1668,7 +1668,6 @@ void *set_vi_handler(int n, vi_handler_t addr)
 }
 
 extern void tlb_init(void);
-extern void flush_tlb_handlers(void);
 
 /*
  * Timer interrupt
@@ -2006,7 +2005,6 @@ void __init trap_init(void)
                set_handler(0x080, &except_vec3_generic, 0x80);
 
        local_flush_icache_range(ebase, ebase + 0x400);
-       flush_tlb_handlers();
 
        sort_extable(__start___dbe_table, __stop___dbe_table);
 
index 7726f6157d9e7b0aa48c8d7e7b051c86de9aea95..cbdc4de85bb43ddd95c66a102918e9fee785bb82 100644 (file)
@@ -111,6 +111,7 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)
         * disable the register.
         */
        write_c0_watchlo0(7);
+       back_to_back_c0_hazard();
        t = read_c0_watchlo0();
        write_c0_watchlo0(0);
        c->watch_reg_masks[0] = t & 7;
@@ -121,12 +122,14 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)
        c->watch_reg_use_cnt = 1;
        t = read_c0_watchhi0();
        write_c0_watchhi0(t | 0xff8);
+       back_to_back_c0_hazard();
        t = read_c0_watchhi0();
        c->watch_reg_masks[0] |= (t & 0xff8);
        if ((t & 0x80000000) == 0)
                return;
 
        write_c0_watchlo1(7);
+       back_to_back_c0_hazard();
        t = read_c0_watchlo1();
        write_c0_watchlo1(0);
        c->watch_reg_masks[1] = t & 7;
@@ -135,12 +138,14 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)
        c->watch_reg_use_cnt = 2;
        t = read_c0_watchhi1();
        write_c0_watchhi1(t | 0xff8);
+       back_to_back_c0_hazard();
        t = read_c0_watchhi1();
        c->watch_reg_masks[1] |= (t & 0xff8);
        if ((t & 0x80000000) == 0)
                return;
 
        write_c0_watchlo2(7);
+       back_to_back_c0_hazard();
        t = read_c0_watchlo2();
        write_c0_watchlo2(0);
        c->watch_reg_masks[2] = t & 7;
@@ -149,12 +154,14 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)
        c->watch_reg_use_cnt = 3;
        t = read_c0_watchhi2();
        write_c0_watchhi2(t | 0xff8);
+       back_to_back_c0_hazard();
        t = read_c0_watchhi2();
        c->watch_reg_masks[2] |= (t & 0xff8);
        if ((t & 0x80000000) == 0)
                return;
 
        write_c0_watchlo3(7);
+       back_to_back_c0_hazard();
        t = read_c0_watchlo3();
        write_c0_watchlo3(0);
        c->watch_reg_masks[3] = t & 7;
@@ -163,6 +170,7 @@ __cpuinit void mips_probe_watch_registers(struct cpuinfo_mips *c)
        c->watch_reg_use_cnt = 4;
        t = read_c0_watchhi3();
        write_c0_watchhi3(t | 0xff8);
+       back_to_back_c0_hazard();
        t = read_c0_watchhi3();
        c->watch_reg_masks[3] |= (t & 0xff8);
        if ((t & 0x80000000) == 0)
index a6eb2e853d94174f258fd063cd673d7678af6c5c..924be39e7733178309264a34b5419e460137d46a 100644 (file)
@@ -13,6 +13,7 @@
  * option) any later version.
  */
 
+#include <linux/pci.h>
 #include <cs5536/cs5536.h>
 #include <cs5536/cs5536_pci.h>
 
@@ -314,3 +315,16 @@ u32 pci_isa_read_reg(int reg)
 
        return conf_data;
 }
+
+/*
+ * The mfgpt timer interrupt is running early, so we must keep the south bridge
+ * mmio always enabled. Otherwise we may race with the PCI configuration which
+ * may temporarily disable it. When that happens and the timer interrupt fires,
+ * we are not able to clear it and the system will hang.
+ */
+static void cs5536_isa_mmio_always_on(struct pci_dev *dev)
+{
+       dev->mmio_always_on = 1;
+}
+DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA,
+       PCI_CLASS_BRIDGE_ISA, 8, cs5536_isa_mmio_always_on);
index 576add33bf5bf1ae19af08a9605959b89e62f123..ee5c1ff861ae2e4d4766666ee1867c44add0eda1 100644 (file)
@@ -182,11 +182,7 @@ asmlinkage void sb1_cache_error(void)
 
 #ifdef CONFIG_SIBYTE_BW_TRACE
        /* Freeze the trace buffer now */
-#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
-       csr_out32(M_BCM1480_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG));
-#else
        csr_out32(M_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG));
-#endif
        printk("Trace buffer frozen\n");
 #endif
 
index 357e0fd65e94288700b7969bbe1015a773f89454..9ab0f907a52c60b2efc61a59e7340aa1f1543d89 100644 (file)
@@ -1948,6 +1948,19 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                uasm_i_nop(&p);
 
                uasm_i_tlbr(&p);
+
+               switch (current_cpu_type()) {
+               default:
+                       if (cpu_has_mips_r2) {
+                               uasm_i_ehb(&p);
+
+               case CPU_CAVIUM_OCTEON:
+               case CPU_CAVIUM_OCTEON_PLUS:
+               case CPU_CAVIUM_OCTEON2:
+                               break;
+                       }
+               }
+
                /* Examine  entrylo 0 or 1 based on ptr. */
                if (use_bbit_insns()) {
                        uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8);
@@ -2002,6 +2015,19 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
                uasm_i_nop(&p);
 
                uasm_i_tlbr(&p);
+
+               switch (current_cpu_type()) {
+               default:
+                       if (cpu_has_mips_r2) {
+                               uasm_i_ehb(&p);
+
+               case CPU_CAVIUM_OCTEON:
+               case CPU_CAVIUM_OCTEON_PLUS:
+               case CPU_CAVIUM_OCTEON2:
+                               break;
+                       }
+               }
+
                /* Examine  entrylo 0 or 1 based on ptr. */
                if (use_bbit_insns()) {
                        uasm_i_bbit0(&p, wr.r2, ilog2(sizeof(pte_t)), 8);
@@ -2170,6 +2196,20 @@ static void __cpuinit build_r4000_tlb_modify_handler(void)
        dump_handler("r4000_tlb_modify", handle_tlbm, handle_tlbm_size);
 }
 
+static void __cpuinit flush_tlb_handlers(void)
+{
+       local_flush_icache_range((unsigned long)handle_tlbl,
+                          (unsigned long)handle_tlbl_end);
+       local_flush_icache_range((unsigned long)handle_tlbs,
+                          (unsigned long)handle_tlbs_end);
+       local_flush_icache_range((unsigned long)handle_tlbm,
+                          (unsigned long)handle_tlbm_end);
+#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
+       local_flush_icache_range((unsigned long)tlbmiss_handler_setup_pgd,
+                          (unsigned long)tlbmiss_handler_setup_pgd_end);
+#endif
+}
+
 void __cpuinit build_tlb_refill_handler(void)
 {
        /*
@@ -2202,6 +2242,7 @@ void __cpuinit build_tlb_refill_handler(void)
                        build_r3000_tlb_load_handler();
                        build_r3000_tlb_store_handler();
                        build_r3000_tlb_modify_handler();
+                       flush_tlb_handlers();
                        run_once++;
                }
 #else
@@ -2229,23 +2270,10 @@ void __cpuinit build_tlb_refill_handler(void)
                        build_r4000_tlb_modify_handler();
                        if (!cpu_has_local_ebase)
                                build_r4000_tlb_refill_handler();
+                       flush_tlb_handlers();
                        run_once++;
                }
                if (cpu_has_local_ebase)
                        build_r4000_tlb_refill_handler();
        }
 }
-
-void __cpuinit flush_tlb_handlers(void)
-{
-       local_flush_icache_range((unsigned long)handle_tlbl,
-                          (unsigned long)handle_tlbl_end);
-       local_flush_icache_range((unsigned long)handle_tlbs,
-                          (unsigned long)handle_tlbs_end);
-       local_flush_icache_range((unsigned long)handle_tlbm,
-                          (unsigned long)handle_tlbm_end);
-#ifdef CONFIG_MIPS_PGD_C0_CONTEXT
-       local_flush_icache_range((unsigned long)tlbmiss_handler_setup_pgd,
-                          (unsigned long)tlbmiss_handler_setup_pgd_end);
-#endif
-}
index 329420536241b5b70743d5ef7ce56c02a4087aa3..d627d4b2b47f4f456addef452e77c16513238bd7 100644 (file)
@@ -1,33 +1,18 @@
 /*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
  * Carsten Langgaard, carstenl@mips.com
  * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved.
- *
- * ########################################################################
- *
- *  This program is free software; you can distribute it and/or modify it
- *  under the terms of the GNU General Public License (Version 2) as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  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.,
- *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
- *
- * ########################################################################
- *
- * Reset the MIPS boards.
- *
  */
-#include <linux/init.h>
+#include <linux/io.h>
 #include <linux/pm.h>
 
-#include <asm/io.h>
 #include <asm/reboot.h>
-#include <asm/mips-boards/generic.h>
+
+#define SOFTRES_REG    0x1f000500
+#define GORESET                0x42
 
 static void mips_machine_restart(char *command)
 {
@@ -45,7 +30,6 @@ static void mips_machine_halt(void)
        __raw_writel(GORESET, softres_reg);
 }
 
-
 static int __init mips_reboot_setup(void)
 {
        _machine_restart = mips_machine_restart;
@@ -54,5 +38,4 @@ static int __init mips_reboot_setup(void)
 
        return 0;
 }
-
 arch_initcall(mips_reboot_setup);
index 20475c5e7b9ce383a2cf0e8ee53af773d387e7a5..e6fb24414a70e14249f8a669d6c66349bf0792be 100644 (file)
@@ -9,7 +9,9 @@
 #include <linux/pm.h>
 
 #include <asm/reboot.h>
-#include <asm/mips-boards/generic.h>
+
+#define SOFTRES_REG    0x1f000050
+#define GORESET                0x4d
 
 static void mips_machine_restart(char *command)
 {
@@ -35,5 +37,4 @@ static int __init mips_reboot_setup(void)
 
        return 0;
 }
-
 arch_initcall(mips_reboot_setup);
index 6eb65e44d9e4a36ef94e6967c22acb648dc7b3d0..7b2ac81e1f598fb2553edc1cd4c4659cd75882c3 100644 (file)
@@ -217,6 +217,7 @@ static void pci_fixup_ioc3(struct pci_dev *d)
        pci_disable_swapping(d);
 }
 
+#ifdef CONFIG_NUMA
 int pcibus_to_node(struct pci_bus *bus)
 {
        struct bridge_controller *bc = BRIDGE_CONTROLLER(bus);
@@ -224,6 +225,7 @@ int pcibus_to_node(struct pci_bus *bus)
        return bc->nasid;
 }
 EXPORT_SYMBOL(pcibus_to_node);
+#endif /* CONFIG_NUMA */
 
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3,
        pci_fixup_ioc3);
index 1f29e761d691e5f732f58e76708cd05c75ef0e85..da8f6816d346ea79e52d5c75d47d6264b2086265 100644 (file)
@@ -7,4 +7,5 @@ obj-y   := ip27-berr.o ip27-irq.o ip27-init.o ip27-klconfig.o ip27-klnuma.o \
           ip27-xtalk.o
 
 obj-$(CONFIG_EARLY_PRINTK)     += ip27-console.o
+obj-$(CONFIG_PCI)              += ip27-irq-pci.o
 obj-$(CONFIG_SMP)              += ip27-smp.o
diff --git a/arch/mips/sgi-ip27/ip27-irq-pci.c b/arch/mips/sgi-ip27/ip27-irq-pci.c
new file mode 100644 (file)
index 0000000..ec22ec5
--- /dev/null
@@ -0,0 +1,266 @@
+/*
+ * ip27-irq.c: Highlevel interrupt handling for IP27 architecture.
+ *
+ * Copyright (C) 1999, 2000 Ralf Baechle (ralf@gnu.org)
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 1999 - 2001 Kanoj Sarcar
+ */
+
+#undef DEBUG
+
+#include <linux/init.h>
+#include <linux/irq.h>
+#include <linux/errno.h>
+#include <linux/signal.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/timex.h>
+#include <linux/smp.h>
+#include <linux/random.h>
+#include <linux/kernel.h>
+#include <linux/kernel_stat.h>
+#include <linux/delay.h>
+#include <linux/bitops.h>
+
+#include <asm/bootinfo.h>
+#include <asm/io.h>
+#include <asm/mipsregs.h>
+
+#include <asm/processor.h>
+#include <asm/pci/bridge.h>
+#include <asm/sn/addrs.h>
+#include <asm/sn/agent.h>
+#include <asm/sn/arch.h>
+#include <asm/sn/hub.h>
+#include <asm/sn/intr.h>
+
+/*
+ * Linux has a controller-independent x86 interrupt architecture.
+ * every controller has a 'controller-template', that is used
+ * by the main code to do the right thing. Each driver-visible
+ * interrupt source is transparently wired to the appropriate
+ * controller. Thus drivers need not be aware of the
+ * interrupt-controller.
+ *
+ * Various interrupt controllers we handle: 8259 PIC, SMP IO-APIC,
+ * PIIX4's internal 8259 PIC and SGI's Visual Workstation Cobalt (IO-)APIC.
+ * (IO-APICs assumed to be messaging to Pentium local-APICs)
+ *
+ * the code is designed to be easily extended with new/different
+ * interrupt controllers, without having to do assembly magic.
+ */
+
+extern struct bridge_controller *irq_to_bridge[];
+extern int irq_to_slot[];
+
+/*
+ * use these macros to get the encoded nasid and widget id
+ * from the irq value
+ */
+#define IRQ_TO_BRIDGE(i)               irq_to_bridge[(i)]
+#define SLOT_FROM_PCI_IRQ(i)           irq_to_slot[i]
+
+static inline int alloc_level(int cpu, int irq)
+{
+       struct hub_data *hub = hub_data(cpu_to_node(cpu));
+       struct slice_data *si = cpu_data[cpu].data;
+       int level;
+
+       level = find_first_zero_bit(hub->irq_alloc_mask, LEVELS_PER_SLICE);
+       if (level >= LEVELS_PER_SLICE)
+               panic("Cpu %d flooded with devices", cpu);
+
+       __set_bit(level, hub->irq_alloc_mask);
+       si->level_to_irq[level] = irq;
+
+       return level;
+}
+
+static inline int find_level(cpuid_t *cpunum, int irq)
+{
+       int cpu, i;
+
+       for_each_online_cpu(cpu) {
+               struct slice_data *si = cpu_data[cpu].data;
+
+               for (i = BASE_PCI_IRQ; i < LEVELS_PER_SLICE; i++)
+                       if (si->level_to_irq[i] == irq) {
+                               *cpunum = cpu;
+
+                               return i;
+                       }
+       }
+
+       panic("Could not identify cpu/level for irq %d", irq);
+}
+
+static int intr_connect_level(int cpu, int bit)
+{
+       nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
+       struct slice_data *si = cpu_data[cpu].data;
+
+       set_bit(bit, si->irq_enable_mask);
+
+       if (!cputoslice(cpu)) {
+               REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]);
+               REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]);
+       } else {
+               REMOTE_HUB_S(nasid, PI_INT_MASK0_B, si->irq_enable_mask[0]);
+               REMOTE_HUB_S(nasid, PI_INT_MASK1_B, si->irq_enable_mask[1]);
+       }
+
+       return 0;
+}
+
+static int intr_disconnect_level(int cpu, int bit)
+{
+       nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
+       struct slice_data *si = cpu_data[cpu].data;
+
+       clear_bit(bit, si->irq_enable_mask);
+
+       if (!cputoslice(cpu)) {
+               REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]);
+               REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]);
+       } else {
+               REMOTE_HUB_S(nasid, PI_INT_MASK0_B, si->irq_enable_mask[0]);
+               REMOTE_HUB_S(nasid, PI_INT_MASK1_B, si->irq_enable_mask[1]);
+       }
+
+       return 0;
+}
+
+/* Startup one of the (PCI ...) IRQs routes over a bridge.  */
+static unsigned int startup_bridge_irq(struct irq_data *d)
+{
+       struct bridge_controller *bc;
+       bridgereg_t device;
+       bridge_t *bridge;
+       int pin, swlevel;
+       cpuid_t cpu;
+
+       pin = SLOT_FROM_PCI_IRQ(d->irq);
+       bc = IRQ_TO_BRIDGE(d->irq);
+       bridge = bc->base;
+
+       pr_debug("bridge_startup(): irq= 0x%x  pin=%d\n", d->irq, pin);
+       /*
+        * "map" irq to a swlevel greater than 6 since the first 6 bits
+        * of INT_PEND0 are taken
+        */
+       swlevel = find_level(&cpu, d->irq);
+       bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (bc->nasid << 8));
+       bridge->b_int_enable |= (1 << pin);
+       bridge->b_int_enable |= 0x7ffffe00;     /* more stuff in int_enable */
+
+       /*
+        * Enable sending of an interrupt clear packt to the hub on a high to
+        * low transition of the interrupt pin.
+        *
+        * IRIX sets additional bits in the address which are documented as
+        * reserved in the bridge docs.
+        */
+       bridge->b_int_mode |= (1UL << pin);
+
+       /*
+        * We assume the bridge to have a 1:1 mapping between devices
+        * (slots) and intr pins.
+        */
+       device = bridge->b_int_device;
+       device &= ~(7 << (pin*3));
+       device |= (pin << (pin*3));
+       bridge->b_int_device = device;
+
+       bridge->b_wid_tflush;
+
+       intr_connect_level(cpu, swlevel);
+
+       return 0;       /* Never anything pending.  */
+}
+
+/* Shutdown one of the (PCI ...) IRQs routes over a bridge.  */
+static void shutdown_bridge_irq(struct irq_data *d)
+{
+       struct bridge_controller *bc = IRQ_TO_BRIDGE(d->irq);
+       bridge_t *bridge = bc->base;
+       int pin, swlevel;
+       cpuid_t cpu;
+
+       pr_debug("bridge_shutdown: irq 0x%x\n", d->irq);
+       pin = SLOT_FROM_PCI_IRQ(d->irq);
+
+       /*
+        * map irq to a swlevel greater than 6 since the first 6 bits
+        * of INT_PEND0 are taken
+        */
+       swlevel = find_level(&cpu, d->irq);
+       intr_disconnect_level(cpu, swlevel);
+
+       bridge->b_int_enable &= ~(1 << pin);
+       bridge->b_wid_tflush;
+}
+
+static inline void enable_bridge_irq(struct irq_data *d)
+{
+       cpuid_t cpu;
+       int swlevel;
+
+       swlevel = find_level(&cpu, d->irq);     /* Criminal offence */
+       intr_connect_level(cpu, swlevel);
+}
+
+static inline void disable_bridge_irq(struct irq_data *d)
+{
+       cpuid_t cpu;
+       int swlevel;
+
+       swlevel = find_level(&cpu, d->irq);     /* Criminal offence */
+       intr_disconnect_level(cpu, swlevel);
+}
+
+static struct irq_chip bridge_irq_type = {
+       .name           = "bridge",
+       .irq_startup    = startup_bridge_irq,
+       .irq_shutdown   = shutdown_bridge_irq,
+       .irq_mask       = disable_bridge_irq,
+       .irq_unmask     = enable_bridge_irq,
+};
+
+void register_bridge_irq(unsigned int irq)
+{
+       irq_set_chip_and_handler(irq, &bridge_irq_type, handle_level_irq);
+}
+
+int request_bridge_irq(struct bridge_controller *bc)
+{
+       int irq = allocate_irqno();
+       int swlevel, cpu;
+       nasid_t nasid;
+
+       if (irq < 0)
+               return irq;
+
+       /*
+        * "map" irq to a swlevel greater than 6 since the first 6 bits
+        * of INT_PEND0 are taken
+        */
+       cpu = bc->irq_cpu;
+       swlevel = alloc_level(cpu, irq);
+       if (unlikely(swlevel < 0)) {
+               free_irqno(irq);
+
+               return -EAGAIN;
+       }
+
+       /* Make sure it's not already pending when we connect it. */
+       nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
+       REMOTE_HUB_CLR_INTR(nasid, swlevel);
+
+       intr_connect_level(cpu, swlevel);
+
+       register_bridge_irq(irq);
+
+       return irq;
+}
index 2315cfeb268790a1b02fbe86575fab7b526d222b..3fbaef97a1b8d31791e8999bd222e3e1b01c3701 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/mipsregs.h>
 
 #include <asm/processor.h>
-#include <asm/pci/bridge.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/agent.h>
 #include <asm/sn/arch.h>
 
 extern asmlinkage void ip27_irq(void);
 
-extern struct bridge_controller *irq_to_bridge[];
-extern int irq_to_slot[];
-
-/*
- * use these macros to get the encoded nasid and widget id
- * from the irq value
- */
-#define IRQ_TO_BRIDGE(i)               irq_to_bridge[(i)]
-#define SLOT_FROM_PCI_IRQ(i)           irq_to_slot[i]
-
-static inline int alloc_level(int cpu, int irq)
-{
-       struct hub_data *hub = hub_data(cpu_to_node(cpu));
-       struct slice_data *si = cpu_data[cpu].data;
-       int level;
-
-       level = find_first_zero_bit(hub->irq_alloc_mask, LEVELS_PER_SLICE);
-       if (level >= LEVELS_PER_SLICE)
-               panic("Cpu %d flooded with devices", cpu);
-
-       __set_bit(level, hub->irq_alloc_mask);
-       si->level_to_irq[level] = irq;
-
-       return level;
-}
-
-static inline int find_level(cpuid_t *cpunum, int irq)
-{
-       int cpu, i;
-
-       for_each_online_cpu(cpu) {
-               struct slice_data *si = cpu_data[cpu].data;
-
-               for (i = BASE_PCI_IRQ; i < LEVELS_PER_SLICE; i++)
-                       if (si->level_to_irq[i] == irq) {
-                               *cpunum = cpu;
-
-                               return i;
-                       }
-       }
-
-       panic("Could not identify cpu/level for irq %d", irq);
-}
-
 /*
  * Find first bit set
  */
@@ -204,175 +159,6 @@ static void ip27_hub_error(void)
        panic("CPU %d got a hub error interrupt", smp_processor_id());
 }
 
-static int intr_connect_level(int cpu, int bit)
-{
-       nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
-       struct slice_data *si = cpu_data[cpu].data;
-
-       set_bit(bit, si->irq_enable_mask);
-
-       if (!cputoslice(cpu)) {
-               REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]);
-               REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]);
-       } else {
-               REMOTE_HUB_S(nasid, PI_INT_MASK0_B, si->irq_enable_mask[0]);
-               REMOTE_HUB_S(nasid, PI_INT_MASK1_B, si->irq_enable_mask[1]);
-       }
-
-       return 0;
-}
-
-static int intr_disconnect_level(int cpu, int bit)
-{
-       nasid_t nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
-       struct slice_data *si = cpu_data[cpu].data;
-
-       clear_bit(bit, si->irq_enable_mask);
-
-       if (!cputoslice(cpu)) {
-               REMOTE_HUB_S(nasid, PI_INT_MASK0_A, si->irq_enable_mask[0]);
-               REMOTE_HUB_S(nasid, PI_INT_MASK1_A, si->irq_enable_mask[1]);
-       } else {
-               REMOTE_HUB_S(nasid, PI_INT_MASK0_B, si->irq_enable_mask[0]);
-               REMOTE_HUB_S(nasid, PI_INT_MASK1_B, si->irq_enable_mask[1]);
-       }
-
-       return 0;
-}
-
-/* Startup one of the (PCI ...) IRQs routes over a bridge.  */
-static unsigned int startup_bridge_irq(struct irq_data *d)
-{
-       struct bridge_controller *bc;
-       bridgereg_t device;
-       bridge_t *bridge;
-       int pin, swlevel;
-       cpuid_t cpu;
-
-       pin = SLOT_FROM_PCI_IRQ(d->irq);
-       bc = IRQ_TO_BRIDGE(d->irq);
-       bridge = bc->base;
-
-       pr_debug("bridge_startup(): irq= 0x%x  pin=%d\n", d->irq, pin);
-       /*
-        * "map" irq to a swlevel greater than 6 since the first 6 bits
-        * of INT_PEND0 are taken
-        */
-       swlevel = find_level(&cpu, d->irq);
-       bridge->b_int_addr[pin].addr = (0x20000 | swlevel | (bc->nasid << 8));
-       bridge->b_int_enable |= (1 << pin);
-       bridge->b_int_enable |= 0x7ffffe00;     /* more stuff in int_enable */
-
-       /*
-        * Enable sending of an interrupt clear packt to the hub on a high to
-        * low transition of the interrupt pin.
-        *
-        * IRIX sets additional bits in the address which are documented as
-        * reserved in the bridge docs.
-        */
-       bridge->b_int_mode |= (1UL << pin);
-
-       /*
-        * We assume the bridge to have a 1:1 mapping between devices
-        * (slots) and intr pins.
-        */
-       device = bridge->b_int_device;
-       device &= ~(7 << (pin*3));
-       device |= (pin << (pin*3));
-       bridge->b_int_device = device;
-
-       bridge->b_wid_tflush;
-
-       intr_connect_level(cpu, swlevel);
-
-       return 0;       /* Never anything pending.  */
-}
-
-/* Shutdown one of the (PCI ...) IRQs routes over a bridge.  */
-static void shutdown_bridge_irq(struct irq_data *d)
-{
-       struct bridge_controller *bc = IRQ_TO_BRIDGE(d->irq);
-       bridge_t *bridge = bc->base;
-       int pin, swlevel;
-       cpuid_t cpu;
-
-       pr_debug("bridge_shutdown: irq 0x%x\n", d->irq);
-       pin = SLOT_FROM_PCI_IRQ(d->irq);
-
-       /*
-        * map irq to a swlevel greater than 6 since the first 6 bits
-        * of INT_PEND0 are taken
-        */
-       swlevel = find_level(&cpu, d->irq);
-       intr_disconnect_level(cpu, swlevel);
-
-       bridge->b_int_enable &= ~(1 << pin);
-       bridge->b_wid_tflush;
-}
-
-static inline void enable_bridge_irq(struct irq_data *d)
-{
-       cpuid_t cpu;
-       int swlevel;
-
-       swlevel = find_level(&cpu, d->irq);     /* Criminal offence */
-       intr_connect_level(cpu, swlevel);
-}
-
-static inline void disable_bridge_irq(struct irq_data *d)
-{
-       cpuid_t cpu;
-       int swlevel;
-
-       swlevel = find_level(&cpu, d->irq);     /* Criminal offence */
-       intr_disconnect_level(cpu, swlevel);
-}
-
-static struct irq_chip bridge_irq_type = {
-       .name           = "bridge",
-       .irq_startup    = startup_bridge_irq,
-       .irq_shutdown   = shutdown_bridge_irq,
-       .irq_mask       = disable_bridge_irq,
-       .irq_unmask     = enable_bridge_irq,
-};
-
-void register_bridge_irq(unsigned int irq)
-{
-       irq_set_chip_and_handler(irq, &bridge_irq_type, handle_level_irq);
-}
-
-int request_bridge_irq(struct bridge_controller *bc)
-{
-       int irq = allocate_irqno();
-       int swlevel, cpu;
-       nasid_t nasid;
-
-       if (irq < 0)
-               return irq;
-
-       /*
-        * "map" irq to a swlevel greater than 6 since the first 6 bits
-        * of INT_PEND0 are taken
-        */
-       cpu = bc->irq_cpu;
-       swlevel = alloc_level(cpu, irq);
-       if (unlikely(swlevel < 0)) {
-               free_irqno(irq);
-
-               return -EAGAIN;
-       }
-
-       /* Make sure it's not already pending when we connect it. */
-       nasid = COMPACT_TO_NASID_NODEID(cpu_to_node(cpu));
-       REMOTE_HUB_CLR_INTR(nasid, swlevel);
-
-       intr_connect_level(cpu, swlevel);
-
-       register_bridge_irq(irq);
-
-       return irq;
-}
-
 asmlinkage void plat_irq_dispatch(void)
 {
        unsigned long pending = read_c0_cause() & read_c0_status();
index 01cc1a749c73e62e0be4762ee9cd54cc8d9a3221..5fbd3605d24f50988d61731362ad1e43c720dba1 100644 (file)
@@ -147,7 +147,8 @@ config SIBYTE_CFE_CONSOLE
 
 config SIBYTE_BUS_WATCHER
        bool "Support for Bus Watcher statistics"
-       depends on SIBYTE_SB1xxx_SOC
+       depends on SIBYTE_SB1xxx_SOC && \
+               (SIBYTE_BCM112X || SIBYTE_SB1250)
        help
          Handle and keep statistics on the bus error interrupts (COR_ECC,
          BAD_ECC, IO_BUS).
index 6cb6dcf241f25b5f88a424bd0a2826aaf3775837..af117330ce1423084fa179af6f1343f95b33a0e4 100644 (file)
@@ -41,3 +41,4 @@ load-$(CONFIG_SIBYTE_RHONE)   := 0xffffffff80100000
 load-$(CONFIG_SIBYTE_SENTOSA)  := 0xffffffff80100000
 load-$(CONFIG_SIBYTE_SWARM)    := 0xffffffff80100000
 load-$(CONFIG_SIBYTE_BIGSUR)   := 0xffffffff80100000
+load-$(CONFIG_SIBYTE_LITTLESUR) := 0xffffffff80100000
index 36aa700cc40c6773954306ac6ba49e8f77f0019d..b3d6bf23a6620c5837f3ac9fcc2fb3d6357cfba3 100644 (file)
@@ -1,3 +1,4 @@
 obj-y := cfe.o
+obj-$(CONFIG_SIBYTE_BUS_WATCHER)       += bus_watcher.o
 obj-$(CONFIG_SIBYTE_CFE_CONSOLE)       += cfe_console.o
 obj-$(CONFIG_SIBYTE_TBPROF)            += sb_tbprof.o
similarity index 94%
rename from arch/mips/sibyte/sb1250/bus_watcher.c
rename to arch/mips/sibyte/common/bus_watcher.c
index 8871e3345bffa9b2a94a2574090ecbd1658bc6a5..5581844c9194bc85719554789b58f1121c711eca 100644 (file)
@@ -37,6 +37,9 @@
 #include <asm/sibyte/sb1250_regs.h>
 #include <asm/sibyte/sb1250_int.h>
 #include <asm/sibyte/sb1250_scd.h>
+#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
+#include <asm/sibyte/bcm1480_regs.h>
+#endif
 
 
 struct bw_stats_struct {
@@ -81,9 +84,15 @@ void check_bus_watcher(void)
 #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
        /* Destructive read, clears register and interrupt */
        status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS));
-#else
+#elif defined(CONFIG_SIBYTE_BCM112X) || defined(CONFIG_SIBYTE_SB1250)
        /* Use non-destructive register */
        status = csr_in32(IOADDR(A_SCD_BUS_ERR_STATUS_DEBUG));
+#elif defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
+       /* Use non-destructive register */
+       /* Same as 1250 except BUS_ERR_STATUS_DEBUG is in a different place. */
+       status = csr_in32(IOADDR(A_BCM1480_BUS_ERR_STATUS_DEBUG));
+#else
+#error bus watcher being built for unknown Sibyte SOC!
 #endif
        if (!(status & 0x7fffffff)) {
                printk("Using last values reaped by bus watcher driver\n");
@@ -175,9 +184,6 @@ static irqreturn_t sibyte_bw_int(int irq, void *data)
 #ifdef CONFIG_SIBYTE_BW_TRACE
        int i;
 #endif
-#ifndef CONFIG_PROC_FS
-       char bw_buf[1024];
-#endif
 
 #ifdef CONFIG_SIBYTE_BW_TRACE
        csr_out32(M_SCD_TRACE_CFG_FREEZE, IOADDR(A_SCD_TRACE_CFG));
index 2188b39a1251a9191409150a65b5650cda527655..059e28c8fd973f8e9e40ab23973e9a3fb71563cb 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/sched.h>
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
 #include <linux/errno.h>
index d3d969de407ba6be81175085a1577f566c94b088..cdc4c56c3e29238158cafa0e09422780e46af1ac 100644 (file)
@@ -1,4 +1,3 @@
 obj-y := setup.o irq.o time.o
 
 obj-$(CONFIG_SMP)                      += smp.o
-obj-$(CONFIG_SIBYTE_BUS_WATCHER)       += bus_watcher.o
index cec4b8ca143817c7c74c422dfa644166359bf420..12336c2a649c4c3eb9bc117e7fafddf4b3ad77b9 100644 (file)
@@ -185,6 +185,7 @@ static void __init sni_pcimt_resource_init(void)
 
 extern struct pci_ops sni_pcimt_ops;
 
+#ifdef CONFIG_PCI
 static struct pci_controller sni_controller = {
        .pci_ops        = &sni_pcimt_ops,
        .mem_resource   = &sni_mem_resource,
@@ -193,6 +194,7 @@ static struct pci_controller sni_controller = {
        .io_offset      = 0x00000000UL,
        .io_map_base    = SNI_PORT_BASE
 };
+#endif
 
 static void enable_pcimt_irq(struct irq_data *d)
 {
index 7cddd03d1fea794b5bbdd236761ccdc2e5b6b510..05bb51676e82e5649d3d37b0c1f0ab4735417219 100644 (file)
@@ -128,13 +128,6 @@ static struct resource pcit_io_resources[] = {
        }
 };
 
-static struct resource sni_mem_resource = {
-       .start  = 0x18000000UL,
-       .end    = 0x1fbfffffUL,
-       .name   = "PCIT PCI MEM",
-       .flags  = IORESOURCE_MEM
-};
-
 static void __init sni_pcit_resource_init(void)
 {
        int i;
@@ -147,6 +140,14 @@ static void __init sni_pcit_resource_init(void)
 
 extern struct pci_ops sni_pcit_ops;
 
+#ifdef CONFIG_PCI
+static struct resource sni_mem_resource = {
+       .start  = 0x18000000UL,
+       .end    = 0x1fbfffffUL,
+       .name   = "PCIT PCI MEM",
+       .flags  = IORESOURCE_MEM
+};
+
 static struct pci_controller sni_pcit_controller = {
        .pci_ops        = &sni_pcit_ops,
        .mem_resource   = &sni_mem_resource,
@@ -155,6 +156,7 @@ static struct pci_controller sni_pcit_controller = {
        .io_offset      = 0x00000000UL,
        .io_map_base    = SNI_PORT_BASE
 };
+#endif /* CONFIG_PCI */
 
 static void enable_pcit_irq(struct irq_data *d)
 {
index 809b7a3336baa40e654f296feeaa8ebb5067411e..5d3b0f014d350f580c1387c3dcd4af621ddc9282 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/rio_drv.h>
 #include <linux/rio_ids.h>
 #include <linux/delay.h>
+
+#include <asm/page.h>
 #include "../rio.h"
 
 #define LOCAL_RTE_CONF_DESTID_SEL      0x010070
index 25c7a3f9652d92781ea03468c369bf0ba746bbf5..ea5d84a1fdad71ad517eba174d5ef1a0fb8cffb0 100644 (file)
@@ -208,7 +208,7 @@ static long sbwdog_ioctl(struct file *file, unsigned int cmd,
                 * get the remaining count from the ... count register
                 * which is 1*8 before the config register
                 */
-               ret = put_user(__raw_readq(user_dog - 8) / 1000000, p);
+               ret = put_user((u32)__raw_readq(user_dog - 8) / 1000000, p);
                break;
        }
        return ret;
index 566cf2bc08eaac44813dd9a1d1ac0d816a072237..74fdc5cf4adc44cc755e2dab5018a61df288e078 100644 (file)
@@ -1272,7 +1272,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER
        depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
        depends on !X86_64
        select STACKTRACE
-       select FRAME_POINTER if !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND
+       select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND
        help
          Provide stacktrace filter for fault-injection capabilities