Netlogic XLR/XLP fixes and updates.
cover Netlogic XLR/XLP fixes and updates.
Here are the updates to Netlogic code for the next kernel. The changes include fixes to the current code and new features.
* Fixes for the current code
XLR PCI irq fix, XLP TLB size fix, XLP smp boot sequence fixup, remove unused code in XLR PCI.
* New features
XLR platform USB code, XLR platform NAND/NOR flash support, XLR oprofile driver, XLP initial PCI support and XLP USB support.
Let me know if there are any comments or concerns.
Thanks,
JC.
Ganesan Ramalingam (3):
MIPS: Netlogic: Platform NAND/NOR flash support
MIPS: Netlogic: XLP PCIe controller support.
MIPS: Netlogic: USB support for XLP
Jayachandran C (7):
MIPS: Netlogic: Fix PCIX irq on XLR chips
MIPS: Netlogic: platform changes for XLS USB.
MIPS: Netlogic: Remove unused pcibios_fixups
MIPS: Netlogic: Update comments in smpboot.S
MIPS: Netlogic: SMP wakeup code update
MIPS: Netlogic: Fix TLB size of boot CPU.
MIPS: Netlogic: Remove NETLOGIC_ prefix
Madhusudan Bhat (1):
MIPS: Netlogic: Oprofile driver for XLR/XLS
arch/mips/Kconfig | 3 +- .../mips/include/asm/netlogic/xlp-hal/cpucontrol.h | 4 +- arch/mips/include/asm/netlogic/xlp-hal/iomap.h | 5 +- arch/mips/include/asm/netlogic/xlp-hal/pcibus.h | 76 ++++++ arch/mips/include/asm/netlogic/xlp-hal/pic.h | 4 + arch/mips/include/asm/netlogic/xlp-hal/usb.h | 64 +++++ arch/mips/include/asm/netlogic/xlp-hal/xlp.h | 14 +- arch/mips/include/asm/netlogic/xlr/bridge.h | 104 ++++++++ arch/mips/include/asm/netlogic/xlr/flash.h | 55 +++++ arch/mips/include/asm/netlogic/xlr/gpio.h | 59 +++--- arch/mips/netlogic/common/smpboot.S | 159 ++++++++----- arch/mips/netlogic/xlp/Makefile | 1 + arch/mips/netlogic/xlp/nlm_hal.c | 40 ++++ arch/mips/netlogic/xlp/platform.c | 2 +- arch/mips/netlogic/xlp/setup.c | 8 +- arch/mips/netlogic/xlp/usb-init.c | 125 ++++++++++ arch/mips/netlogic/xlr/Makefile | 2 +- arch/mips/netlogic/xlr/platform-flash.c | 220 +++++++++++++++++ arch/mips/netlogic/xlr/platform.c | 89 +++++++ arch/mips/netlogic/xlr/setup.c | 2 +- arch/mips/oprofile/Makefile | 1 + arch/mips/oprofile/common.c | 1 + arch/mips/oprofile/op_model_mipsxx.c | 29 +++ arch/mips/pci/Makefile | 1 + arch/mips/pci/pci-xlp.c | 247 ++++++++++++++++++++ arch/mips/pci/pci-xlr.c | 6 +- 26 files changed, 1222 insertions(+), 99 deletions(-) create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/pcibus.h create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/usb.h create mode 100644 arch/mips/include/asm/netlogic/xlr/bridge.h create mode 100644 arch/mips/include/asm/netlogic/xlr/flash.h create mode 100644 arch/mips/netlogic/xlp/usb-init.c create mode 100644 arch/mips/netlogic/xlr/platform-flash.c create mode 100644 arch/mips/pci/pci-xlp.c
Signature · 1 line
1.7.5.4
PATCH 1/11 MIPS: Netlogic: Fix PCIX irq on XLR chips
The correct irq is PIC_PCIX_IRQ
--- arch/mips/pci/pci-xlr.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/pci/pci-xlr.c +1 -1
@@ -327,7 +327,7 @@ static int __init pcibios_init(void) } }else {/* XLR PCI controller ACK */ -irq_set_handler_data (PIC_PCIE_XLSB0_LINK3_IRQ , xlr_pci_ack); +irq_set_handler_data (PIC_PCIX_IRQ , xlr_pci_ack); }return 0 ;
Signature · 1 line
1.7.5.4
PATCH 2/11 MIPS: Netlogic: platform changes for XLS USB.
In reply to Jayachandran CAdd USB initialization code, setup resources and add USB platform driver in mips/netlogic/xlr/platform.c.
Add USB support for XLR/XLS platform in Kconfig.
--- arch/mips/Kconfig | 2 + arch/mips/netlogic/xlr/platform.c | 89 +++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-)
arch/mips/Kconfig +2 -0
@@ -780,6 +780,8 @@ config NLM_XLR_BOARD select ZONE_DMA if 64BIT select SYNC_R4K select SYS_HAS_EARLY_PRINTK + select USB_ARCH_HAS_OHCI if USB_SUPPORT + select USB_ARCH_HAS_EHCI if USB_SUPPORT help Support for systems based on Netlogic XLR and XLS processors. Say Y here if you have a XLR or XLS based board.
arch/mips/netlogic/xlr/platform.c +89 -0
92 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 3/11 MIPS: Netlogic: Remove unused pcibios_fixups
In reply to Jayachandran CThis global is unneeded, and seems to be carried over from ancient code.
--- arch/mips/pci/pci-xlr.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
arch/mips/pci/pci-xlr.c +0 -4
@@ -334,7 +334,3 @@ static int __init pcibios_init(void) }arch_initcall (pcibios_init); - -struct pci_fixup pcibios_fixups[] = { - {0 } -};
Signature · 1 line
1.7.5.4
PATCH 4/11 MIPS: Netlogic: Update comments in smpboot.S
In reply to Jayachandran CNo change in logic, comments update and whitespace cleanup.
* A few comments in the file were in assembler style and the rest int C style, convert all of them to C style.
* Mark workarounds for Ax silicon with a macro XLP_AX_WORKAROUND
* Whitespace fixes - use tabs consistently
* rename __config_lsu macro to xlp_config_lsu
--- arch/mips/netlogic/common/smpboot.S | 112 +++++++++++++++++++---------------- 1 files changed, 61 insertions(+), 51 deletions(-)
arch/mips/netlogic/common/smpboot.S +61 -51
@@ -54,28 +54,36 @@ XLP_IO_SYS_OFFSET(node) + XLP_IO_PCI_HDRSZ + \ SYS_CPU_NONCOHERENT_MODE * 4 -.macro __config_lsu - li t0, LSU_DEFEATURE - mfcr t1, t0 +#define XLP_AX_WORKAROUND /* enable Ax silicon workarounds */ - lui t2, 0x4080 /* Enable Unaligned Access, L2HPE */ - or t1, t1, t2 - li t2, ~0xe /* S1RCM */ +/* Enable XLP features and workarounds in the LSU */ +.macro xlp_config_lsu + li t0, LSU_DEFEATURE + mfcr t1, t0 + + lui t2, 0x4080 /* Enable Unaligned Access, L2HPE */ + or t1, t1, t2 +#ifdef XLP_AX_WORKAROUND + li t2, ~0xe /* S1RCM */ and t1, t1, t2 +#endif mtcr t1, t0 - li t0, SCHED_DEFEATURE - lui t1, 0x0100 /* Experimental: Disable BRU accepting ALU ops */ - mtcr t1, t0 +#ifdef XLP_AX_WORKAROUND + li t0, SCHED_DEFEATURE + lui t1, 0x0100 /* Disable BRU accepting ALU ops */ + mtcr t1, t0 +#endif .endm /* - * The cores can come start when they are woken up. This is also the NMI - * entry, so check that first. + * This is the code that will be copied to the reset entry point for + * XLR and XLP. The XLP cores start here when they are woken up. This + * is also the NMI entry point. * - * The data corresponding to reset is stored at RESET_DATA_PHYS location, - * this will have the thread mask (used when core is woken up) and the - * current NMI handler in case we reached here for an NMI. + * The data corresponding to reset/NMI is stored at RESET_DATA_PHYS + * location, this will have the thread mask (used when core is woken up) + * and the current NMI handler in case we reached here for an NMI. * * When a core or thread is newly woken up, it loops in a 'wait'. When * the CPU really needs waking up, we send an NMI to it, with the NMI
@@ -89,12 +97,12 @@ FEXPORT(nlm_reset_entry) dmtc0 k0, $22, 6 dmtc0 k1, $22, 7 - mfc0 k0, CP0_STATUS - li k1, 0x80000 - and k1, k0, k1 - beqz k1, 1f /* go to real reset entry */ + mfc0 k0, CP0_STATUS + li k1, 0x80000 + and k1, k0, k1 + beqz k1, 1f /* go to real reset entry */ nop - li k1, CKSEG1ADDR(RESET_DATA_PHYS) /* NMI */ + li k1, CKSEG1ADDR(RESET_DATA_PHYS) /* NMI */ ld k0, BOOT_NMI_HANDLER(k1) jr k0 nop
@@ -114,21 +122,23 @@ FEXPORT(nlm_reset_entry) li t2, SYS_CPU_COHERENT_BASE(0) add t2, t2, t3 /* t2 <- SYS offset for node */ lw t1, 0(t2) - and t1, t1, t0 - sw t1, 0(t2) + and t1, t1, t0 + sw t1, 0(t2) /* read back to ensure complete */ - lw t1, 0(t2) + lw t1, 0(t2) sync /* Configure LSU on Non-0 Cores. */ - __config_lsu + xlp_config_lsu + /* FALL THROUGH */ /* * Wake up sibling threads from the initial thread in * a core. */ EXPORT(nlm_boot_siblings) + /* Enable hw threads by writing to MAP_THREADMODE of the core */ li t0, CKSEG1ADDR(RESET_DATA_PHYS) lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */ li t0, ((CPU_BLOCKID_MAP << 8) | MAP_THREADMODE)
@@ -139,24 +149,24 @@ EXPORT(nlm_boot_siblings) /* * The new hardware thread starts at the next instruction * For all the cases other than core 0 thread 0, we will - * jump to the secondary wait function. - */ + * jump to the secondary wait function. + */ mfc0 v0, CP0_EBASE, 1 andi v0, 0x7f /* v0 <- node/core */ -#if 1 - /* A0 errata - Write MMU_SETUP after changing thread mode register. */ + /* Init MMU in the first thread after changing THREAD_MODE + * register (Ax Errata?) + */ andi v1, v0, 0x3 /* v1 <- thread id */ bnez v1, 2f nop - li t0, MMU_SETUP - li t1, 0 - mtcr t1, t0 + li t0, MMU_SETUP + li t1, 0 + mtcr t1, t0 ehb -#endif -2: beqz v0, 4f +2: beqz v0, 4f /* boot cpu (cpuid == 0)? */ nop /* setup status reg */
@@ -183,9 +193,9 @@ EXPORT(nlm_boot_siblings) * For the boot CPU, we have to restore registers and * return */ -4: dmfc0 t0, $4, 2 /* restore SP from UserLocal */ +4: dmfc0 t0, $4, 2 /* restore SP from UserLocal */ li t1, 0xfadebeef - dmtc0 t1, $4, 2 /* restore SP from UserLocal */ + dmtc0 t1, $4, 2 /* restore SP from UserLocal */ PTR_SUBU sp, t0, PT_SIZE RESTORE_ALL jr ra
@@ -193,7 +203,7 @@ EXPORT(nlm_boot_siblings) EXPORT(nlm_reset_entry_end) FEXPORT(xlp_boot_core0_siblings) /* "Master" cpu starts from here */ - __config_lsu + xlp_config_lsu dmtc0 sp, $4, 2 /* SP saved in UserLocal */ SAVE_ALL sync
@@ -234,36 +244,36 @@ END(nlm_boot_secondary_cpus) */ __CPUINIT NESTED(nlm_rmiboot_preboot, 16, sp) - mfc0 t0, $15, 1 # read ebase - andi t0, 0x1f # t0 has the processor_id() - andi t2, t0, 0x3 # thread no - sll t0, 2 # offset in cpu array + mfc0 t0, $15, 1 /* read ebase */ + andi t0, 0x1f /* t0 has the processor_id() */ + andi t2, t0, 0x3 /* thread num */ + sll t0, 2 /* offset in cpu array */ - PTR_LA t1, nlm_cpu_ready # mark CPU ready + PTR_LA t1, nlm_cpu_ready /* mark CPU ready */ PTR_ADDU t1, t0 li t3, 1 sw t3, 0(t1) - bnez t2, 1f # skip thread programming - nop # for non zero hw threads + bnez t2, 1f /* skip thread programming */ + nop /* for thread id != 0 */ /* - * MMU setup only for first thread in core + * XLR MMU setup only for first thread in core */ li t0, 0x400 mfcr t1, t0 - li t2, 6 # XLR thread mode mask + li t2, 6 /* XLR thread mode mask */ nor t3, t2, zero - and t2, t1, t2 # t2 - current thread mode + and t2, t1, t2 /* t2 - current thread mode */ li v0, CKSEG1ADDR(RESET_DATA_PHYS) - lw v1, BOOT_THREAD_MODE(v0) # v1 - new thread mode + lw v1, BOOT_THREAD_MODE(v0) /* v1 - new thread mode */ sll v1, 1 - beq v1, t2, 1f # same as request value - nop # nothing to do */ + beq v1, t2, 1f /* same as request value */ + nop /* nothing to do */ - and t2, t1, t3 # mask out old thread mode - or t1, t2, v1 # put in new value - mtcr t1, t0 # update core control + and t2, t1, t3 /* mask out old thread mode */ + or t1, t2, v1 /* put in new value */ + mtcr t1, t0 /* update core control */ 1: wait j 1b
Signature · 1 line
1.7.5.4
PATCH 5/11 MIPS: Netlogic: SMP wakeup code update
In reply to Jayachandran CUpdate for core intialization code. Initialize status register after receiving NMI for CPU wakeup. Add the low level L1D flush code before enabling threads in core.
Also convert the ehb to _ehb so that it works under more GCC versions.
--- .../mips/include/asm/netlogic/xlp-hal/cpucontrol.h | 4 +- arch/mips/netlogic/common/smpboot.S | 47 +++++++++++++++++-- 2 files changed, 45 insertions(+), 6 deletions(-)
arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h +3 -1
@@ -47,7 +47,9 @@#define CPU_BLOCKID_MAP 10#define LSU_DEFEATURE 0x304 -#define LSU_CERRLOG_REGID 0x09 +#define LSU_DEBUG_ADDR 0x305 +#define LSU_DEBUG_DATA0 0x306 +#define LSU_CERRLOG_REGID 0x309#define SCHED_DEFEATURE 0x700/* Offsets of interest from the 'MAP' Block */
arch/mips/netlogic/common/smpboot.S +42 -5
76 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 6/11 MIPS: Netlogic: Fix TLB size of boot CPU.
In reply to Jayachandran CStarting other threads in the core will change the number of TLB entries of a CPU. Re-calculate current_cpu_data.tlbsize on the boot cpu after enabling and waking up other threads.
The secondary CPUs do not need this logic because the threads are enabled on the secondary cores at wakeup and before cpu_probe.
--- arch/mips/netlogic/xlp/setup.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/mips/netlogic/xlp/setup.c +7 -1
@@ -82,8 +82,10 @@ void __init prom_free_prom_memory(void)void xlp_mmu_init (void ) { +/* enable extended TLB and Large Fixed TLB */ write_c0_config6 (read_c0_config6 () |0x24 ); - current_cpu_data.tlbsize = ((read_c0_config6 () >>16 ) &0xffff ) +1 ; + +/* set page mask of Fixed TLB in config7 */ write_c0_config7 (PM_DEFAULT_MASK >> (13 + (ffz (PM_DEFAULT_MASK >>13 ) /2 ))); }
@@ -100,6 +102,10 @@ void __init prom_init(void) nlm_common_ebase =read_c0_ebase () & (~((1 <<12 ) -1 ));#ifdef CONFIG_SMP nlm_wakeup_secondary_cpus (0xffffffff ); + +/* update TLB size after waking up threads */ + current_cpu_data.tlbsize = ((read_c0_config6 () >>16 ) &0xffff ) +1 ; +register_smp_ops (&nlm_smp_ops);#endif }
Signature · 1 line
1.7.5.4
PATCH 7/11 MIPS: Netlogic: Remove NETLOGIC_ prefix
In reply to Jayachandran CRemove NETLOGIC_ prefix from gpio register definitions, this will bring it in-line with the other Netlogic headers.
Having NETLOGIC prefix here is misleading because these are XLR/XLS specific register definitions.
--- arch/mips/include/asm/netlogic/xlr/gpio.h | 59 +++++++++++++++-------------- arch/mips/netlogic/xlr/setup.c | 2 +- 2 files changed, 31 insertions(+), 30 deletions(-)
arch/mips/include/asm/netlogic/xlr/gpio.h +30 -29
@@ -35,39 +35,40 @@#ifndef _ASM_NLM_GPIO_H#define _ASM_NLM_GPIO_H -#define NETLOGIC_GPIO_INT_EN_REG 0 -#define NETLOGIC_GPIO_INPUT_INVERSION_REG 1 -#define NETLOGIC_GPIO_IO_DIR_REG 2 -#define NETLOGIC_GPIO_IO_DATA_WR_REG 3 -#define NETLOGIC_GPIO_IO_DATA_RD_REG 4 +#define GPIO_INT_EN_REG 0 +#define GPIO_INPUT_INVERSION_REG 1 +#define GPIO_IO_DIR_REG 2 +#define GPIO_IO_DATA_WR_REG 3 +#define GPIO_IO_DATA_RD_REG 4 -#define NETLOGIC_GPIO_SWRESET_REG 8 -#define NETLOGIC_GPIO_DRAM1_CNTRL_REG 9 -#define NETLOGIC_GPIO_DRAM1_RATIO_REG 10 -#define NETLOGIC_GPIO_DRAM1_RESET_REG 11 -#define NETLOGIC_GPIO_DRAM1_STATUS_REG 12 -#define NETLOGIC_GPIO_DRAM2_CNTRL_REG 13 -#define NETLOGIC_GPIO_DRAM2_RATIO_REG 14 -#define NETLOGIC_GPIO_DRAM2_RESET_REG 15 -#define NETLOGIC_GPIO_DRAM2_STATUS_REG 16 +#define GPIO_SWRESET_REG 8 +#define GPIO_DRAM1_CNTRL_REG 9 +#define GPIO_DRAM1_RATIO_REG 10 +#define GPIO_DRAM1_RESET_REG 11 +#define GPIO_DRAM1_STATUS_REG 12 +#define GPIO_DRAM2_CNTRL_REG 13 +#define GPIO_DRAM2_RATIO_REG 14 +#define GPIO_DRAM2_RESET_REG 15 +#define GPIO_DRAM2_STATUS_REG 16 -#define NETLOGIC_GPIO_PWRON_RESET_CFG_REG 21 -#define NETLOGIC_GPIO_BIST_ALL_GO_STATUS_REG 24 -#define NETLOGIC_GPIO_BIST_CPU_GO_STATUS_REG 25 -#define NETLOGIC_GPIO_BIST_DEV_GO_STATUS_REG 26 +#define GPIO_PWRON_RESET_CFG_REG 21 +#define GPIO_BIST_ALL_GO_STATUS_REG 24 +#define GPIO_BIST_CPU_GO_STATUS_REG 25 +#define GPIO_BIST_DEV_GO_STATUS_REG 26 -#define NETLOGIC_GPIO_FUSE_BANK_REG 35 -#define NETLOGIC_GPIO_CPU_RESET_REG 40 -#define NETLOGIC_GPIO_RNG_REG 43 +#define GPIO_FUSE_BANK_REG 35 +#define GPIO_CPU_RESET_REG 40 +#define GPIO_RNG_REG 43 -#define NETLOGIC_PWRON_RESET_PCMCIA_BOOT 17 -#define NETLOGIC_GPIO_LED_BITMAP 0x1700000 -#define NETLOGIC_GPIO_LED_0_SHIFT 20 -#define NETLOGIC_GPIO_LED_1_SHIFT 24 +#define PWRON_RESET_PCMCIA_BOOT 17 -#define NETLOGIC_GPIO_LED_OUTPUT_CODE_RESET 0x01 -#define NETLOGIC_GPIO_LED_OUTPUT_CODE_HARD_RESET 0x02 -#define NETLOGIC_GPIO_LED_OUTPUT_CODE_SOFT_RESET 0x03 -#define NETLOGIC_GPIO_LED_OUTPUT_CODE_MAIN 0x04 +#define GPIO_LED_BITMAP 0x1700000 +#define GPIO_LED_0_SHIFT 20 +#define GPIO_LED_1_SHIFT 24 + +#define GPIO_LED_OUTPUT_CODE_RESET 0x01 +#define GPIO_LED_OUTPUT_CODE_HARD_RESET 0x02 +#define GPIO_LED_OUTPUT_CODE_SOFT_RESET 0x03 +#define GPIO_LED_OUTPUT_CODE_MAIN 0x04#endif
arch/mips/netlogic/xlr/setup.c +1 -1
@@ -85,7 +85,7 @@ static void nlm_linux_exit(void) gpiobase =nlm_mmio_base (NETLOGIC_IO_GPIO_OFFSET );/* trigger a chip reset by writing 1 to GPIO_SWRESET_REG */ -nlm_write_reg (gpiobase,NETLOGIC_GPIO_SWRESET_REG ,1 ); +nlm_write_reg (gpiobase,GPIO_SWRESET_REG ,1 );for ( ; ; )cpu_wait (); }
Signature · 1 line
1.7.5.4
PATCH 8/11 MIPS: Netlogic: Platform NAND/NOR flash support
In reply to Jayachandran CFrom: Ganesan Ramalingam <[email protected]>
Changes to add support for the boot NOR flash on XLR boards and the boot NAND/NOR flash drivers on the XLS boards.
--- arch/mips/include/asm/netlogic/xlr/bridge.h | 104 +++++++++++++ arch/mips/include/asm/netlogic/xlr/flash.h | 55 +++++++ arch/mips/netlogic/xlr/Makefile | 2 +- arch/mips/netlogic/xlr/platform-flash.c | 220 +++++++++++++++++++++++++++ 4 files changed, 380 insertions(+), 1 deletions(-) create mode 100644 arch/mips/include/asm/netlogic/xlr/bridge.h create mode 100644 arch/mips/include/asm/netlogic/xlr/flash.h create mode 100644 arch/mips/netlogic/xlr/platform-flash.c
arch/mips/include/asm/netlogic/xlr/bridge.h new file +104 -0
@@ -0,0 +1,104 @@ +/* +* Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights +* reserved. +* +* This software is available to you under a choice of one of two +* licenses. You may choose to be licensed under the terms of the GNU +* General Public License (GPL) Version 2, available from the file +* COPYING in the main directory of this source tree, or the NetLogic +* license below: +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* +* THIS SOFTWARE IS PROVIDED BY NETLOGIC ``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 NETLOGIC OR CONTRIBUTORS 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. +*/ +#ifndef _ASM_NLM_BRIDGE_H_ +#define _ASM_NLM_BRIDGE_H_ + +#define BRIDGE_DRAM_0_BAR 0 +#define BRIDGE_DRAM_1_BAR 1 +#define BRIDGE_DRAM_2_BAR 2 +#define BRIDGE_DRAM_3_BAR 3 +#define BRIDGE_DRAM_4_BAR 4 +#define BRIDGE_DRAM_5_BAR 5 +#define BRIDGE_DRAM_6_BAR 6 +#define BRIDGE_DRAM_7_BAR 7 +#define BRIDGE_DRAM_CHN_0_MTR_0_BAR 8 +#define BRIDGE_DRAM_CHN_0_MTR_1_BAR 9 +#define BRIDGE_DRAM_CHN_0_MTR_2_BAR 10 +#define BRIDGE_DRAM_CHN_0_MTR_3_BAR 11 +#define BRIDGE_DRAM_CHN_0_MTR_4_BAR 12 +#define BRIDGE_DRAM_CHN_0_MTR_5_BAR 13 +#define BRIDGE_DRAM_CHN_0_MTR_6_BAR 14 +#define BRIDGE_DRAM_CHN_0_MTR_7_BAR 15 +#define BRIDGE_DRAM_CHN_1_MTR_0_BAR 16 +#define BRIDGE_DRAM_CHN_1_MTR_1_BAR 17 +#define BRIDGE_DRAM_CHN_1_MTR_2_BAR 18 +#define BRIDGE_DRAM_CHN_1_MTR_3_BAR 19 +#define BRIDGE_DRAM_CHN_1_MTR_4_BAR 20 +#define BRIDGE_DRAM_CHN_1_MTR_5_BAR 21 +#define BRIDGE_DRAM_CHN_1_MTR_6_BAR 22 +#define BRIDGE_DRAM_CHN_1_MTR_7_BAR 23 +#define BRIDGE_CFG_BAR 24 +#define BRIDGE_PHNX_IO_BAR 25 +#define BRIDGE_FLASH_BAR 26 +#define BRIDGE_SRAM_BAR 27 +#define BRIDGE_HTMEM_BAR 28 +#define BRIDGE_HTINT_BAR 29 +#define BRIDGE_HTPIC_BAR 30 +#define BRIDGE_HTSM_BAR 31 +#define BRIDGE_HTIO_BAR 32 +#define BRIDGE_HTCFG_BAR 33 +#define BRIDGE_PCIXCFG_BAR 34 +#define BRIDGE_PCIXMEM_BAR 35 +#define BRIDGE_PCIXIO_BAR 36 +#define BRIDGE_DEVICE_MASK 37 +#define BRIDGE_AERR_INTR_LOG1 38 +#define BRIDGE_AERR_INTR_LOG2 39 +#define BRIDGE_AERR_INTR_LOG3 40 +#define BRIDGE_AERR_DEV_STAT 41 +#define BRIDGE_AERR1_LOG1 42 +#define BRIDGE_AERR1_LOG2 43 +#define BRIDGE_AERR1_LOG3 44 +#define BRIDGE_AERR1_DEV_STAT 45 +#define BRIDGE_AERR_INTR_EN 46 +#define BRIDGE_AERR_UPG 47 +#define BRIDGE_AERR_CLEAR 48 +#define BRIDGE_AERR1_CLEAR 49 +#define BRIDGE_SBE_COUNTS 50 +#define BRIDGE_DBE_COUNTS 51 +#define BRIDGE_BITERR_INT_EN 52 + +#define BRIDGE_SYS2IO_CREDITS 53 +#define BRIDGE_EVNT_CNT_CTRL1 54 +#define BRIDGE_EVNT_COUNTER1 55 +#define BRIDGE_EVNT_CNT_CTRL2 56 +#define BRIDGE_EVNT_COUNTER2 57 +#define BRIDGE_RESERVED1 58 + +#define BRIDGE_DEFEATURE 59 +#define BRIDGE_SCRATCH0 60 +#define BRIDGE_SCRATCH1 61 +#define BRIDGE_SCRATCH2 62 +#define BRIDGE_SCRATCH3 63 + +#endif
arch/mips/include/asm/netlogic/xlr/flash.h new file +55 -0
55 lines not on this page · raw message
arch/mips/netlogic/xlr/Makefile +1 -1
@@ -1,2 +1,2 @@ -obj-y += setup.o platform.o +obj-y += setup.o platform.o platform-flash.o obj-$(CONFIG_SMP) += wakeup.o
arch/mips/netlogic/xlr/platform-flash.c new file +220 -0
220 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 9/11 MIPS: Netlogic: Oprofile driver for XLR/XLS
In reply to Jayachandran CFrom: Madhusudan Bhat <[email protected]>
Add support for XLR and XLS processors in MIPS Oprofile code. These processors are multi-threaded and have two counters per core. Each counter can track either all the events in the core (global mode), or events in just one thread.
We use the counters in the global mode, and use only the first thread in each core to handle the configuration etc.
--- arch/mips/oprofile/Makefile | 1 + arch/mips/oprofile/common.c | 1 + arch/mips/oprofile/op_model_mipsxx.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 0 deletions(-)
arch/mips/oprofile/Makefile +1 -0
@@ -14,5 +14,6 @@ oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_R10000) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_SB1) += op_model_mipsxx.o +oprofile-$(CONFIG_CPU_XLR) += op_model_mipsxx.o oprofile-$(CONFIG_CPU_RM9000) += op_model_rm9000.o oprofile-$(CONFIG_CPU_LOONGSON2) += op_model_loongson2.o
arch/mips/oprofile/common.c +1 -0
@@ -89,6 +89,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)case CPU_R10000 :case CPU_R12000 :case CPU_R14000 : +case CPU_XLR : lmodel = &op_model_mipsxx_ops;break ;
arch/mips/oprofile/op_model_mipsxx.c +29 -0
@@ -31,8 +31,22 @@#define M_COUNTER_OVERFLOW (1UL << 31) +/* Netlogic XLR specific, count events in all threads in a core */ +#define M_PERFCTL_COUNT_ALL_THREADS (1UL << 13) +static int (*save_perf_irq)(void ); +/* +* XLR has only one set of counters per core. Designate the +* first hardware thread in the core for setup and init. +* Skip CPUs with non-zero hardware thread id (4 hwt per core) +*/ +#ifdef CONFIG_CPU_XLR +#define oprofile_skip_cpu (c) ((cpu_logical_map(c) & 0x3) != 0) +#else +#define oprofile_skip_cpu (c) 0 +#endif +#ifdef CONFIG_MIPS_MT_SMP static int cpu_has_mipsmt_pertccounters;#define WHAT (M_TC_EN_VPE | \
@@ -152,6 +166,8 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr) reg.control[i] |=M_PERFCTL_USER ;if (ctr[i].exl) reg.control[i] |=M_PERFCTL_EXL ; +if (current_cpu_type () ==CPU_XLR ) + reg.control[i] |=M_PERFCTL_COUNT_ALL_THREADS ; reg.counter[i] =0x80000000 - ctr[i].count; } }
@@ -162,6 +178,9 @@ static void mipsxx_cpu_setup(void *args) {unsigned int counters = op_model_mipsxx_ops.num_counters; +if (oprofile_skip_cpu (smp_processor_id ())) +return ; +switch (counters) {case 4 :w_c0_perfctrl3 (0 );
@@ -183,6 +202,9 @@ static void mipsxx_cpu_start(void *args) {unsigned int counters = op_model_mipsxx_ops.num_counters; +if (oprofile_skip_cpu (smp_processor_id ())) +return ; +switch (counters) {case 4 :w_c0_perfctrl3 (WHAT | reg.control[3 ]);
@@ -200,6 +222,9 @@ static void mipsxx_cpu_stop(void *args) {unsigned int counters = op_model_mipsxx_ops.num_counters; +if (oprofile_skip_cpu (smp_processor_id ())) +return ; +switch (counters) {case 4 :w_c0_perfctrl3 (0 );
@@ -365,6 +390,10 @@ static int __init mipsxx_init(void) op_model_mipsxx_ops.cpu_type ="mips/sb1" ;break ; +case CPU_XLR : + op_model_mipsxx_ops.cpu_type ="mips/xlr" ; +break ; +default :printk (KERN_ERR "Profiling unsupported for this CPU\n" );
Signature · 1 line
1.7.5.4
PATCH 10/11 MIPS: Netlogic: XLP PCIe controller support.
In reply to Jayachandran CFrom: Ganesan Ramalingam <[email protected]>
Adds support for the XLP on-chip PCIe controller. On XLP, the on-chip devices(including the 4 PCIe links) appear in the PCIe configuration space of the XLP as PCI devices.
The changes are to initialize and register the PCIe controller, enable hardware byte swap in the PCIe IO and MEM space, and to enable PCIe interrupts.
--- arch/mips/Kconfig | 1 - arch/mips/include/asm/netlogic/xlp-hal/iomap.h | 3 + arch/mips/include/asm/netlogic/xlp-hal/pcibus.h | 76 +++++++ arch/mips/include/asm/netlogic/xlp-hal/xlp.h | 8 +- arch/mips/netlogic/xlp/nlm_hal.c | 16 ++ arch/mips/pci/Makefile | 1 + arch/mips/pci/pci-xlp.c | 247 +++++++++++++++++++++++ 7 files changed, 349 insertions(+), 3 deletions(-) create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/pcibus.h create mode 100644 arch/mips/pci/pci-xlp.c
arch/mips/Kconfig +0 -1
@@ -794,7 +794,6 @@ config NLM_XLP_BOARD select SYS_HAS_CPU_XLP select SYS_SUPPORTS_SMP select HW_HAS_PCI - select SWAP_IO_SPACE select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL select 64BIT_PHYS_ADDR
arch/mips/include/asm/netlogic/xlp-hal/iomap.h +3 -0
@@ -36,6 +36,9 @@#define __NLM_HAL_IOMAP_H__#define XLP_DEFAULT_IO_BASE 0x18000000 +#define XLP_DEFAULT_PCI_ECFG_BASE XLP_DEFAULT_IO_BASE +#define XLP_DEFAULT_PCI_CFG_BASE 0x1c000000 +#define NMI_BASE 0xbfc00000#define XLP_IO_CLK 133333333
arch/mips/include/asm/netlogic/xlp-hal/pcibus.h new file +76 -0
76 lines not on this page · raw message
arch/mips/include/asm/netlogic/xlp-hal/xlp.h +6 -2
@@ -35,8 +35,12 @@#ifndef _NLM_HAL_XLP_H#define _NLM_HAL_XLP_H -#define PIC_UART_0_IRQ 17 -#define PIC_UART_1_IRQ 18 +#define PIC_UART_0_IRQ 17 +#define PIC_UART_1_IRQ 18 +#define PIC_PCIE_LINK_0_IRQ 19 +#define PIC_PCIE_LINK_1_IRQ 20 +#define PIC_PCIE_LINK_2_IRQ 21 +#define PIC_PCIE_LINK_3_IRQ 22#ifndef __ASSEMBLY__
arch/mips/netlogic/xlp/nlm_hal.c +16 -0
@@ -69,6 +69,14 @@ int nlm_irq_to_irt(int irq)return PIC_IRT_UART_0_INDEX ;case PIC_UART_1_IRQ :return PIC_IRT_UART_1_INDEX ; +case PIC_PCIE_LINK_0_IRQ : +return PIC_IRT_PCIE_LINK_0_INDEX ; +case PIC_PCIE_LINK_1_IRQ : +return PIC_IRT_PCIE_LINK_1_INDEX ; +case PIC_PCIE_LINK_2_IRQ : +return PIC_IRT_PCIE_LINK_2_INDEX ; +case PIC_PCIE_LINK_3_IRQ : +return PIC_IRT_PCIE_LINK_3_INDEX ;default :return -1 ; }
@@ -81,6 +89,14 @@ int nlm_irt_to_irq(int irt)return PIC_UART_0_IRQ ;case PIC_IRT_UART_1_INDEX :return PIC_UART_1_IRQ ; +case PIC_IRT_PCIE_LINK_0_INDEX : +return PIC_PCIE_LINK_0_IRQ ; +case PIC_IRT_PCIE_LINK_1_INDEX : +return PIC_PCIE_LINK_1_IRQ ; +case PIC_IRT_PCIE_LINK_2_INDEX : +return PIC_PCIE_LINK_2_IRQ ; +case PIC_IRT_PCIE_LINK_3_INDEX : +return PIC_PCIE_LINK_3_IRQ ;default :return -1 ; }
arch/mips/pci/Makefile +1 -0
@@ -57,6 +57,7 @@ obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o obj-$(CONFIG_CPU_CAVIUM_OCTEON) += pci-octeon.o pcie-octeon.o obj-$(CONFIG_CPU_XLR) += pci-xlr.o +obj-$(CONFIG_CPU_XLP) += pci-xlp.o ifdef CONFIG_PCI_MSI obj-$(CONFIG_CPU_CAVIUM_OCTEON) += msi-octeon.o
arch/mips/pci/pci-xlp.c new file +247 -0
247 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 11/11 MIPS: Netlogic: USB support for XLP
In reply to Jayachandran CFrom: Ganesan Ramalingam <[email protected]>
The XLP USB controller appears as a device on the internal SoC PCIe bus, the block has 2 EHCI blocks and 4 OHCI blocks. Change are to:
* Add files netlogic/xlp/usb-init.c and asm/netlogic/xlp-hal/usb.h to initialize the USB controller and define PCI fixups. The PCI fixups are to setup interrupts and DMA mask.
* Update include/asm/xlp-hal/{iomap.h,pic.h,xlp.h} to add interrupt mapping for EHCI/OHCI interrupts.
--- arch/mips/include/asm/netlogic/xlp-hal/iomap.h | 2 +- arch/mips/include/asm/netlogic/xlp-hal/pic.h | 4 + arch/mips/include/asm/netlogic/xlp-hal/usb.h | 64 ++++++++++++ arch/mips/include/asm/netlogic/xlp-hal/xlp.h | 6 + arch/mips/netlogic/xlp/Makefile | 1 + arch/mips/netlogic/xlp/nlm_hal.c | 24 +++++ arch/mips/netlogic/xlp/platform.c | 2 +- arch/mips/netlogic/xlp/usb-init.c | 125 ++++++++++++++++++++++++ 8 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 arch/mips/include/asm/netlogic/xlp-hal/usb.h create mode 100644 arch/mips/netlogic/xlp/usb-init.c
arch/mips/include/asm/netlogic/xlp-hal/iomap.h +1 -1
@@ -132,7 +132,7 @@#define PCI_DEVICE_ID_NLM_PIC 0x1003#define PCI_DEVICE_ID_NLM_PCIE 0x1004#define PCI_DEVICE_ID_NLM_EHCI 0x1007 -#define PCI_DEVICE_ID_NLM_ILK 0x1008 +#define PCI_DEVICE_ID_NLM_OHCI 0x1008#define PCI_DEVICE_ID_NLM_NAE 0x1009#define PCI_DEVICE_ID_NLM_POE 0x100A#define PCI_DEVICE_ID_NLM_FMN 0x100B
arch/mips/include/asm/netlogic/xlp-hal/pic.h +4 -0
@@ -201,7 +201,11 @@#define PIC_NUM_USB_IRTS 6#define PIC_IRT_USB_0_INDEX 115#define PIC_IRT_EHCI_0_INDEX 115 +#define PIC_IRT_OHCI_0_INDEX 116 +#define PIC_IRT_OHCI_1_INDEX 117#define PIC_IRT_EHCI_1_INDEX 118 +#define PIC_IRT_OHCI_2_INDEX 119 +#define PIC_IRT_OHCI_3_INDEX 120#define PIC_IRT_USB_INDEX (num) ((num) + PIC_IRT_USB_0_INDEX)/* 115 to 120 */ #define PIC_IRT_GDX_INDEX 121
arch/mips/include/asm/netlogic/xlp-hal/usb.h new file +64 -0
64 lines not on this page · raw message
arch/mips/include/asm/netlogic/xlp-hal/xlp.h +6 -0
@@ -41,6 +41,12 @@#define PIC_PCIE_LINK_1_IRQ 20#define PIC_PCIE_LINK_2_IRQ 21#define PIC_PCIE_LINK_3_IRQ 22 +#define PIC_EHCI_0_IRQ 23 +#define PIC_EHCI_1_IRQ 24 +#define PIC_OHCI_0_IRQ 25 +#define PIC_OHCI_1_IRQ 26 +#define PIC_OHCI_2_IRQ 27 +#define PIC_OHCI_3_IRQ 28#ifndef __ASSEMBLY__
arch/mips/netlogic/xlp/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-y += setup.o platform.o nlm_hal.o obj-$(CONFIG_SMP) += wakeup.o +obj-$(CONFIG_USB) += usb-init.o
arch/mips/netlogic/xlp/nlm_hal.c +24 -0
@@ -77,6 +77,18 @@ int nlm_irq_to_irt(int irq)return PIC_IRT_PCIE_LINK_2_INDEX ;case PIC_PCIE_LINK_3_IRQ :return PIC_IRT_PCIE_LINK_3_INDEX ; +case PIC_EHCI_0_IRQ : +return PIC_IRT_EHCI_0_INDEX ; +case PIC_EHCI_1_IRQ : +return PIC_IRT_EHCI_1_INDEX ; +case PIC_OHCI_0_IRQ : +return PIC_IRT_OHCI_0_INDEX ; +case PIC_OHCI_1_IRQ : +return PIC_IRT_OHCI_1_INDEX ; +case PIC_OHCI_2_IRQ : +return PIC_IRT_OHCI_2_INDEX ; +case PIC_OHCI_3_IRQ : +return PIC_IRT_OHCI_3_INDEX ;default :return -1 ; }
@@ -97,6 +109,18 @@ int nlm_irt_to_irq(int irt)return PIC_PCIE_LINK_2_IRQ ;case PIC_IRT_PCIE_LINK_3_INDEX :return PIC_PCIE_LINK_3_IRQ ; +case PIC_IRT_EHCI_0_INDEX : +return PIC_EHCI_0_IRQ ; +case PIC_IRT_EHCI_1_INDEX : +return PIC_EHCI_1_IRQ ; +case PIC_IRT_OHCI_0_INDEX : +return PIC_OHCI_0_IRQ ; +case PIC_IRT_OHCI_1_INDEX : +return PIC_OHCI_1_IRQ ; +case PIC_IRT_OHCI_2_INDEX : +return PIC_OHCI_2_IRQ ; +case PIC_IRT_OHCI_3_INDEX : +return PIC_OHCI_3_IRQ ;default :return -1 ; }
arch/mips/netlogic/xlp/platform.c +1 -1
@@ -53,7 +53,7 @@static unsigned int nlm_xlp_uart_in (struct uart_port *p,int offset) { -return nlm_read_reg (p->iobase, offset); +return nlm_read_reg (p->iobase, offset); }static void nlm_xlp_uart_out (struct uart_port *p,int offset,int value)
arch/mips/netlogic/xlp/usb-init.c new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
1.7.5.4