Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Remove NETLOGIC support

No (active) developer owns this hardware, so let's remove Linux support.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

+6 -11559
-1
arch/mips/Kbuild.platforms
··· 19 19 platform-$(CONFIG_MACH_LOONGSON64) += loongson64/ 20 20 platform-$(CONFIG_MIPS_MALTA) += mti-malta/ 21 21 platform-$(CONFIG_MACH_NINTENDO64) += n64/ 22 - platform-$(CONFIG_NLM_COMMON) += netlogic/ 23 22 platform-$(CONFIG_PIC32MZDA) += pic32/ 24 23 platform-$(CONFIG_RALINK) += ralink/ 25 24 platform-$(CONFIG_MIKROTIK_RB532) += rb532/
+2 -89
arch/mips/Kconfig
··· 994 994 Hikari 995 995 Say Y here for most Octeon reference boards. 996 996 997 - config NLM_XLR_BOARD 998 - bool "Netlogic XLR/XLS based systems" 999 - select BOOT_ELF32 1000 - select NLM_COMMON 1001 - select SYS_HAS_CPU_XLR 1002 - select SYS_SUPPORTS_SMP 1003 - select HAVE_PCI 1004 - select SWAP_IO_SPACE 1005 - select SYS_SUPPORTS_32BIT_KERNEL 1006 - select SYS_SUPPORTS_64BIT_KERNEL 1007 - select PHYS_ADDR_T_64BIT 1008 - select SYS_SUPPORTS_BIG_ENDIAN 1009 - select SYS_SUPPORTS_HIGHMEM 1010 - select NR_CPUS_DEFAULT_32 1011 - select CEVT_R4K 1012 - select CSRC_R4K 1013 - select IRQ_MIPS_CPU 1014 - select ZONE_DMA32 if 64BIT 1015 - select SYNC_R4K 1016 - select SYS_HAS_EARLY_PRINTK 1017 - select SYS_SUPPORTS_ZBOOT 1018 - select SYS_SUPPORTS_ZBOOT_UART16550 1019 - help 1020 - Support for systems based on Netlogic XLR and XLS processors. 1021 - Say Y here if you have a XLR or XLS based board. 1022 - 1023 - config NLM_XLP_BOARD 1024 - bool "Netlogic XLP based systems" 1025 - select BOOT_ELF32 1026 - select NLM_COMMON 1027 - select SYS_HAS_CPU_XLP 1028 - select SYS_SUPPORTS_SMP 1029 - select HAVE_PCI 1030 - select SYS_SUPPORTS_32BIT_KERNEL 1031 - select SYS_SUPPORTS_64BIT_KERNEL 1032 - select PHYS_ADDR_T_64BIT 1033 - select GPIOLIB 1034 - select SYS_SUPPORTS_BIG_ENDIAN 1035 - select SYS_SUPPORTS_LITTLE_ENDIAN 1036 - select SYS_SUPPORTS_HIGHMEM 1037 - select NR_CPUS_DEFAULT_32 1038 - select CEVT_R4K 1039 - select CSRC_R4K 1040 - select IRQ_MIPS_CPU 1041 - select ZONE_DMA32 if 64BIT 1042 - select SYNC_R4K 1043 - select SYS_HAS_EARLY_PRINTK 1044 - select USE_OF 1045 - select SYS_SUPPORTS_ZBOOT 1046 - select SYS_SUPPORTS_ZBOOT_UART16550 1047 - help 1048 - This board is based on Netlogic XLP Processor. 1049 - Say Y here if you have a XLP based board. 1050 - 1051 997 endchoice 1052 998 1053 999 source "arch/mips/alchemy/Kconfig" ··· 1016 1070 source "arch/mips/loongson2ef/Kconfig" 1017 1071 source "arch/mips/loongson32/Kconfig" 1018 1072 source "arch/mips/loongson64/Kconfig" 1019 - source "arch/mips/netlogic/Kconfig" 1020 1073 1021 1074 endmenu 1022 1075 ··· 1731 1786 help 1732 1787 Support for BMIPS32/3300/4350/4380 and BMIPS5000 processors. 1733 1788 1734 - config CPU_XLR 1735 - bool "Netlogic XLR SoC" 1736 - depends on SYS_HAS_CPU_XLR 1737 - select CPU_SUPPORTS_32BIT_KERNEL 1738 - select CPU_SUPPORTS_64BIT_KERNEL 1739 - select CPU_SUPPORTS_HIGHMEM 1740 - select CPU_SUPPORTS_HUGEPAGES 1741 - select WEAK_ORDERING 1742 - select WEAK_REORDERING_BEYOND_LLSC 1743 - help 1744 - Netlogic Microsystems XLR/XLS processors. 1745 - 1746 - config CPU_XLP 1747 - bool "Netlogic XLP SoC" 1748 - depends on SYS_HAS_CPU_XLP 1749 - select CPU_SUPPORTS_32BIT_KERNEL 1750 - select CPU_SUPPORTS_64BIT_KERNEL 1751 - select CPU_SUPPORTS_HIGHMEM 1752 - select WEAK_ORDERING 1753 - select WEAK_REORDERING_BEYOND_LLSC 1754 - select CPU_HAS_PREFETCH 1755 - select CPU_MIPSR2 1756 - select CPU_SUPPORTS_HUGEPAGES 1757 - select MIPS_ASID_BITS_VARIABLE 1758 - help 1759 - Netlogic Microsystems XLP processors. 1760 1789 endchoice 1761 1790 1762 1791 config CPU_MIPS32_3_5_FEATURES ··· 1977 2058 select SYS_HAS_CPU_BMIPS 1978 2059 select ARCH_HAS_SYNC_DMA_FOR_CPU 1979 2060 1980 - config SYS_HAS_CPU_XLR 1981 - bool 1982 - 1983 - config SYS_HAS_CPU_XLP 1984 - bool 1985 - 1986 2061 # 1987 2062 # CPU may reorder R->R, R->W, W->R, W->W 1988 2063 # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC ··· 2071 2158 config MIPS_PGD_C0_CONTEXT 2072 2159 bool 2073 2160 depends on 64BIT 2074 - default y if (CPU_MIPSR2 || CPU_MIPSR6) && !CPU_XLP 2161 + default y if (CPU_MIPSR2 || CPU_MIPSR6) 2075 2162 2076 2163 # 2077 2164 # Set to y for ptrace access to watch registers. ··· 2754 2841 2755 2842 config HW_PERF_EVENTS 2756 2843 bool "Enable hardware performance counter support for perf events" 2757 - depends on PERF_EVENTS && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_XLP || CPU_LOONGSON64) 2844 + depends on PERF_EVENTS && (CPU_MIPS32 || CPU_MIPS64 || CPU_R10000 || CPU_SB1 || CPU_CAVIUM_OCTEON || CPU_LOONGSON64) 2758 2845 default y 2759 2846 help 2760 2847 Enable hardware performance counter support for perf events. If
-12
arch/mips/boot/compressed/uart-16550.c
··· 23 23 #define PORT(offset) (CKSEG1ADDR(INGENIC_UART_BASE_ADDR) + (4 * offset)) 24 24 #endif 25 25 26 - #ifdef CONFIG_CPU_XLR 27 - #define UART0_BASE 0x1EF14000 28 - #define PORT(offset) (CKSEG1ADDR(UART0_BASE) + (4 * offset)) 29 - #define IOTYPE unsigned int 30 - #endif 31 - 32 - #ifdef CONFIG_CPU_XLP 33 - #define UART0_BASE 0x18030100 34 - #define PORT(offset) (CKSEG1ADDR(UART0_BASE) + (4 * offset)) 35 - #define IOTYPE unsigned int 36 - #endif 37 - 38 26 #ifndef IOTYPE 39 27 #define IOTYPE char 40 28 #endif
-1
arch/mips/boot/dts/Makefile
··· 9 9 subdir-$(CONFIG_SOC_VCOREIII) += mscc 10 10 subdir-$(CONFIG_MIPS_MALTA) += mti 11 11 subdir-$(CONFIG_LEGACY_BOARD_SEAD3) += mti 12 - subdir-$(CONFIG_NLM_XLP_BOARD) += netlogic 13 12 subdir-$(CONFIG_FIT_IMAGE_FDT_NI169445) += ni 14 13 subdir-$(CONFIG_MACH_PIC32) += pic32 15 14 subdir-$(CONFIG_ATH79) += qca
-8
arch/mips/boot/dts/netlogic/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - dtb-$(CONFIG_DT_XLP_EVP) += xlp_evp.dtb 3 - dtb-$(CONFIG_DT_XLP_SVP) += xlp_svp.dtb 4 - dtb-$(CONFIG_DT_XLP_FVP) += xlp_fvp.dtb 5 - dtb-$(CONFIG_DT_XLP_GVP) += xlp_gvp.dtb 6 - dtb-$(CONFIG_DT_XLP_RVP) += xlp_rvp.dtb 7 - 8 - obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
-131
arch/mips/boot/dts/netlogic/xlp_evp.dts
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * XLP8XX Device Tree Source for EVP boards 4 - */ 5 - 6 - /dts-v1/; 7 - / { 8 - model = "netlogic,XLP-EVP"; 9 - compatible = "netlogic,xlp"; 10 - #address-cells = <2>; 11 - #size-cells = <2>; 12 - 13 - soc { 14 - #address-cells = <2>; 15 - #size-cells = <1>; 16 - compatible = "simple-bus"; 17 - ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 18 - 1 0 0 0x16000000 0x02000000>; // GBU chipselects 19 - 20 - serial0: serial@30000 { 21 - device_type = "serial"; 22 - compatible = "ns16550"; 23 - reg = <0 0x30100 0xa00>; 24 - reg-shift = <2>; 25 - reg-io-width = <4>; 26 - clock-frequency = <133333333>; 27 - interrupt-parent = <&pic>; 28 - interrupts = <17>; 29 - }; 30 - serial1: serial@31000 { 31 - device_type = "serial"; 32 - compatible = "ns16550"; 33 - reg = <0 0x31100 0xa00>; 34 - reg-shift = <2>; 35 - reg-io-width = <4>; 36 - clock-frequency = <133333333>; 37 - interrupt-parent = <&pic>; 38 - interrupts = <18>; 39 - }; 40 - i2c0: ocores@32000 { 41 - compatible = "opencores,i2c-ocores"; 42 - #address-cells = <1>; 43 - #size-cells = <0>; 44 - reg = <0 0x32100 0xa00>; 45 - reg-shift = <2>; 46 - reg-io-width = <4>; 47 - clock-frequency = <32000000>; 48 - interrupt-parent = <&pic>; 49 - interrupts = <30>; 50 - }; 51 - i2c1: ocores@33000 { 52 - compatible = "opencores,i2c-ocores"; 53 - #address-cells = <1>; 54 - #size-cells = <0>; 55 - reg = <0 0x33100 0xa00>; 56 - reg-shift = <2>; 57 - reg-io-width = <4>; 58 - clock-frequency = <32000000>; 59 - interrupt-parent = <&pic>; 60 - interrupts = <31>; 61 - 62 - rtc@68 { 63 - compatible = "dallas,ds1374"; 64 - reg = <0x68>; 65 - }; 66 - 67 - dtt@4c { 68 - compatible = "national,lm90"; 69 - reg = <0x4c>; 70 - }; 71 - }; 72 - pic: pic@4000 { 73 - compatible = "netlogic,xlp-pic"; 74 - #address-cells = <0>; 75 - #interrupt-cells = <1>; 76 - reg = <0 0x4000 0x200>; 77 - interrupt-controller; 78 - }; 79 - 80 - nor_flash@1,0 { 81 - compatible = "cfi-flash"; 82 - #address-cells = <1>; 83 - #size-cells = <1>; 84 - bank-width = <2>; 85 - reg = <1 0 0x1000000>; 86 - 87 - partition@0 { 88 - label = "x-loader"; 89 - reg = <0x0 0x100000>; /* 1M */ 90 - read-only; 91 - }; 92 - 93 - partition@100000 { 94 - label = "u-boot"; 95 - reg = <0x100000 0x100000>; /* 1M */ 96 - }; 97 - 98 - partition@200000 { 99 - label = "kernel"; 100 - reg = <0x200000 0x500000>; /* 5M */ 101 - }; 102 - 103 - partition@700000 { 104 - label = "rootfs"; 105 - reg = <0x700000 0x800000>; /* 8M */ 106 - }; 107 - 108 - partition@f00000 { 109 - label = "env"; 110 - reg = <0xf00000 0x100000>; /* 1M */ 111 - read-only; 112 - }; 113 - }; 114 - 115 - gpio: xlp_gpio@34100 { 116 - compatible = "netlogic,xlp832-gpio"; 117 - reg = <0 0x34100 0x1000>; 118 - #gpio-cells = <2>; 119 - gpio-controller; 120 - 121 - #interrupt-cells = <2>; 122 - interrupt-parent = <&pic>; 123 - interrupts = <39>; 124 - interrupt-controller; 125 - }; 126 - }; 127 - 128 - chosen { 129 - bootargs = "console=ttyS0,115200 rdinit=/sbin/init"; 130 - }; 131 - };
-131
arch/mips/boot/dts/netlogic/xlp_fvp.dts
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * XLP2XX Device Tree Source for FVP boards 4 - */ 5 - 6 - /dts-v1/; 7 - / { 8 - model = "netlogic,XLP-FVP"; 9 - compatible = "netlogic,xlp"; 10 - #address-cells = <2>; 11 - #size-cells = <2>; 12 - 13 - soc { 14 - #address-cells = <2>; 15 - #size-cells = <1>; 16 - compatible = "simple-bus"; 17 - ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 18 - 1 0 0 0x16000000 0x02000000>; // GBU chipselects 19 - 20 - serial0: serial@30000 { 21 - device_type = "serial"; 22 - compatible = "ns16550"; 23 - reg = <0 0x30100 0xa00>; 24 - reg-shift = <2>; 25 - reg-io-width = <4>; 26 - clock-frequency = <133333333>; 27 - interrupt-parent = <&pic>; 28 - interrupts = <17>; 29 - }; 30 - serial1: serial@31000 { 31 - device_type = "serial"; 32 - compatible = "ns16550"; 33 - reg = <0 0x31100 0xa00>; 34 - reg-shift = <2>; 35 - reg-io-width = <4>; 36 - clock-frequency = <133333333>; 37 - interrupt-parent = <&pic>; 38 - interrupts = <18>; 39 - }; 40 - i2c0: ocores@37100 { 41 - compatible = "opencores,i2c-ocores"; 42 - #address-cells = <1>; 43 - #size-cells = <0>; 44 - reg = <0 0x37100 0x20>; 45 - reg-shift = <2>; 46 - reg-io-width = <4>; 47 - clock-frequency = <32000000>; 48 - interrupt-parent = <&pic>; 49 - interrupts = <30>; 50 - }; 51 - i2c1: ocores@37120 { 52 - compatible = "opencores,i2c-ocores"; 53 - #address-cells = <1>; 54 - #size-cells = <0>; 55 - reg = <0 0x37120 0x20>; 56 - reg-shift = <2>; 57 - reg-io-width = <4>; 58 - clock-frequency = <32000000>; 59 - interrupt-parent = <&pic>; 60 - interrupts = <31>; 61 - 62 - rtc@68 { 63 - compatible = "dallas,ds1374"; 64 - reg = <0x68>; 65 - }; 66 - 67 - dtt@4c { 68 - compatible = "national,lm90"; 69 - reg = <0x4c>; 70 - }; 71 - }; 72 - pic: pic@4000 { 73 - compatible = "netlogic,xlp-pic"; 74 - #address-cells = <0>; 75 - #interrupt-cells = <1>; 76 - reg = <0 0x4000 0x200>; 77 - interrupt-controller; 78 - }; 79 - 80 - nor_flash@1,0 { 81 - compatible = "cfi-flash"; 82 - #address-cells = <1>; 83 - #size-cells = <1>; 84 - bank-width = <2>; 85 - reg = <1 0 0x1000000>; 86 - 87 - partition@0 { 88 - label = "x-loader"; 89 - reg = <0x0 0x100000>; /* 1M */ 90 - read-only; 91 - }; 92 - 93 - partition@100000 { 94 - label = "u-boot"; 95 - reg = <0x100000 0x100000>; /* 1M */ 96 - }; 97 - 98 - partition@200000 { 99 - label = "kernel"; 100 - reg = <0x200000 0x500000>; /* 5M */ 101 - }; 102 - 103 - partition@700000 { 104 - label = "rootfs"; 105 - reg = <0x700000 0x800000>; /* 8M */ 106 - }; 107 - 108 - partition@f00000 { 109 - label = "env"; 110 - reg = <0xf00000 0x100000>; /* 1M */ 111 - read-only; 112 - }; 113 - }; 114 - 115 - gpio: xlp_gpio@34100 { 116 - compatible = "netlogic,xlp208-gpio"; 117 - reg = <0 0x34100 0x1000>; 118 - #gpio-cells = <2>; 119 - gpio-controller; 120 - 121 - #interrupt-cells = <2>; 122 - interrupt-parent = <&pic>; 123 - interrupts = <39>; 124 - interrupt-controller; 125 - }; 126 - }; 127 - 128 - chosen { 129 - bootargs = "console=ttyS0,115200 rdinit=/sbin/init"; 130 - }; 131 - };
-89
arch/mips/boot/dts/netlogic/xlp_gvp.dts
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * XLP9XX Device Tree Source for GVP boards 4 - */ 5 - 6 - /dts-v1/; 7 - / { 8 - model = "netlogic,XLP-GVP"; 9 - compatible = "netlogic,xlp"; 10 - #address-cells = <2>; 11 - #size-cells = <2>; 12 - 13 - soc { 14 - #address-cells = <2>; 15 - #size-cells = <1>; 16 - compatible = "simple-bus"; 17 - ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 18 - 1 0 0 0x16000000 0x02000000>; // GBU chipselects 19 - 20 - serial0: serial@30000 { 21 - device_type = "serial"; 22 - compatible = "ns16550"; 23 - reg = <0 0x112100 0xa00>; 24 - reg-shift = <2>; 25 - reg-io-width = <4>; 26 - clock-frequency = <125000000>; 27 - interrupt-parent = <&pic>; 28 - interrupts = <17>; 29 - }; 30 - pic: pic@110000 { 31 - compatible = "netlogic,xlp-pic"; 32 - #address-cells = <0>; 33 - #interrupt-cells = <1>; 34 - reg = <0 0x110000 0x200>; 35 - interrupt-controller; 36 - }; 37 - 38 - nor_flash@1,0 { 39 - compatible = "cfi-flash"; 40 - #address-cells = <1>; 41 - #size-cells = <1>; 42 - bank-width = <2>; 43 - reg = <1 0 0x1000000>; 44 - 45 - partition@0 { 46 - label = "x-loader"; 47 - reg = <0x0 0x100000>; /* 1M */ 48 - read-only; 49 - }; 50 - 51 - partition@100000 { 52 - label = "u-boot"; 53 - reg = <0x100000 0x100000>; /* 1M */ 54 - }; 55 - 56 - partition@200000 { 57 - label = "kernel"; 58 - reg = <0x200000 0x500000>; /* 5M */ 59 - }; 60 - 61 - partition@700000 { 62 - label = "rootfs"; 63 - reg = <0x700000 0x800000>; /* 8M */ 64 - }; 65 - 66 - partition@f00000 { 67 - label = "env"; 68 - reg = <0xf00000 0x100000>; /* 1M */ 69 - read-only; 70 - }; 71 - }; 72 - 73 - gpio: xlp_gpio@114100 { 74 - compatible = "netlogic,xlp980-gpio"; 75 - reg = <0 0x114100 0x1000>; 76 - #gpio-cells = <2>; 77 - gpio-controller; 78 - 79 - #interrupt-cells = <2>; 80 - interrupt-parent = <&pic>; 81 - interrupts = <39>; 82 - interrupt-controller; 83 - }; 84 - }; 85 - 86 - chosen { 87 - bootargs = "console=ttyS0,115200 rdinit=/sbin/init"; 88 - }; 89 - };
-89
arch/mips/boot/dts/netlogic/xlp_rvp.dts
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * XLP5XX Device Tree Source for RVP boards 4 - */ 5 - 6 - /dts-v1/; 7 - / { 8 - model = "netlogic,XLP-RVP"; 9 - compatible = "netlogic,xlp"; 10 - #address-cells = <2>; 11 - #size-cells = <2>; 12 - 13 - soc { 14 - #address-cells = <2>; 15 - #size-cells = <1>; 16 - compatible = "simple-bus"; 17 - ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 18 - 1 0 0 0x16000000 0x02000000>; // GBU chipselects 19 - 20 - serial0: serial@30000 { 21 - device_type = "serial"; 22 - compatible = "ns16550"; 23 - reg = <0 0x112100 0xa00>; 24 - reg-shift = <2>; 25 - reg-io-width = <4>; 26 - clock-frequency = <125000000>; 27 - interrupt-parent = <&pic>; 28 - interrupts = <17>; 29 - }; 30 - pic: pic@110000 { 31 - compatible = "netlogic,xlp-pic"; 32 - #address-cells = <0>; 33 - #interrupt-cells = <1>; 34 - reg = <0 0x110000 0x200>; 35 - interrupt-controller; 36 - }; 37 - 38 - nor_flash@1,0 { 39 - compatible = "cfi-flash"; 40 - #address-cells = <1>; 41 - #size-cells = <1>; 42 - bank-width = <2>; 43 - reg = <1 0 0x1000000>; 44 - 45 - partition@0 { 46 - label = "x-loader"; 47 - reg = <0x0 0x100000>; /* 1M */ 48 - read-only; 49 - }; 50 - 51 - partition@100000 { 52 - label = "u-boot"; 53 - reg = <0x100000 0x100000>; /* 1M */ 54 - }; 55 - 56 - partition@200000 { 57 - label = "kernel"; 58 - reg = <0x200000 0x500000>; /* 5M */ 59 - }; 60 - 61 - partition@700000 { 62 - label = "rootfs"; 63 - reg = <0x700000 0x800000>; /* 8M */ 64 - }; 65 - 66 - partition@f00000 { 67 - label = "env"; 68 - reg = <0xf00000 0x100000>; /* 1M */ 69 - read-only; 70 - }; 71 - }; 72 - 73 - gpio: xlp_gpio@114100 { 74 - compatible = "netlogic,xlp532-gpio"; 75 - reg = <0 0x114100 0x1000>; 76 - #gpio-cells = <2>; 77 - gpio-controller; 78 - 79 - #interrupt-cells = <2>; 80 - interrupt-parent = <&pic>; 81 - interrupts = <39>; 82 - interrupt-controller; 83 - }; 84 - }; 85 - 86 - chosen { 87 - bootargs = "console=ttyS0,115200 rdinit=/sbin/init"; 88 - }; 89 - };
-131
arch/mips/boot/dts/netlogic/xlp_svp.dts
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * XLP3XX Device Tree Source for SVP boards 4 - */ 5 - 6 - /dts-v1/; 7 - / { 8 - model = "netlogic,XLP-SVP"; 9 - compatible = "netlogic,xlp"; 10 - #address-cells = <2>; 11 - #size-cells = <2>; 12 - 13 - soc { 14 - #address-cells = <2>; 15 - #size-cells = <1>; 16 - compatible = "simple-bus"; 17 - ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 18 - 1 0 0 0x16000000 0x02000000>; // GBU chipselects 19 - 20 - serial0: serial@30000 { 21 - device_type = "serial"; 22 - compatible = "ns16550"; 23 - reg = <0 0x30100 0xa00>; 24 - reg-shift = <2>; 25 - reg-io-width = <4>; 26 - clock-frequency = <133333333>; 27 - interrupt-parent = <&pic>; 28 - interrupts = <17>; 29 - }; 30 - serial1: serial@31000 { 31 - device_type = "serial"; 32 - compatible = "ns16550"; 33 - reg = <0 0x31100 0xa00>; 34 - reg-shift = <2>; 35 - reg-io-width = <4>; 36 - clock-frequency = <133333333>; 37 - interrupt-parent = <&pic>; 38 - interrupts = <18>; 39 - }; 40 - i2c0: ocores@32000 { 41 - compatible = "opencores,i2c-ocores"; 42 - #address-cells = <1>; 43 - #size-cells = <0>; 44 - reg = <0 0x32100 0xa00>; 45 - reg-shift = <2>; 46 - reg-io-width = <4>; 47 - clock-frequency = <32000000>; 48 - interrupt-parent = <&pic>; 49 - interrupts = <30>; 50 - }; 51 - i2c1: ocores@33000 { 52 - compatible = "opencores,i2c-ocores"; 53 - #address-cells = <1>; 54 - #size-cells = <0>; 55 - reg = <0 0x33100 0xa00>; 56 - reg-shift = <2>; 57 - reg-io-width = <4>; 58 - clock-frequency = <32000000>; 59 - interrupt-parent = <&pic>; 60 - interrupts = <31>; 61 - 62 - rtc@68 { 63 - compatible = "dallas,ds1374"; 64 - reg = <0x68>; 65 - }; 66 - 67 - dtt@4c { 68 - compatible = "national,lm90"; 69 - reg = <0x4c>; 70 - }; 71 - }; 72 - pic: pic@4000 { 73 - compatible = "netlogic,xlp-pic"; 74 - #address-cells = <0>; 75 - #interrupt-cells = <1>; 76 - reg = <0 0x4000 0x200>; 77 - interrupt-controller; 78 - }; 79 - 80 - nor_flash@1,0 { 81 - compatible = "cfi-flash"; 82 - #address-cells = <1>; 83 - #size-cells = <1>; 84 - bank-width = <2>; 85 - reg = <1 0 0x1000000>; 86 - 87 - partition@0 { 88 - label = "x-loader"; 89 - reg = <0x0 0x100000>; /* 1M */ 90 - read-only; 91 - }; 92 - 93 - partition@100000 { 94 - label = "u-boot"; 95 - reg = <0x100000 0x100000>; /* 1M */ 96 - }; 97 - 98 - partition@200000 { 99 - label = "kernel"; 100 - reg = <0x200000 0x500000>; /* 5M */ 101 - }; 102 - 103 - partition@700000 { 104 - label = "rootfs"; 105 - reg = <0x700000 0x800000>; /* 8M */ 106 - }; 107 - 108 - partition@f00000 { 109 - label = "env"; 110 - reg = <0xf00000 0x100000>; /* 1M */ 111 - read-only; 112 - }; 113 - }; 114 - 115 - gpio: xlp_gpio@34100 { 116 - compatible = "netlogic,xlp316-gpio"; 117 - reg = <0 0x34100 0x1000>; 118 - #gpio-cells = <2>; 119 - gpio-controller; 120 - 121 - #interrupt-cells = <2>; 122 - interrupt-parent = <&pic>; 123 - interrupts = <39>; 124 - interrupt-controller; 125 - }; 126 - }; 127 - 128 - chosen { 129 - bootargs = "console=ttyS0,115200 rdinit=/sbin/init"; 130 - }; 131 - };
-557
arch/mips/configs/nlm_xlp_defconfig
··· 1 - # CONFIG_LOCALVERSION_AUTO is not set 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_AUDIT=y 5 - CONFIG_NO_HZ=y 6 - CONFIG_HIGH_RES_TIMERS=y 7 - CONFIG_BSD_PROCESS_ACCT=y 8 - CONFIG_BSD_PROCESS_ACCT_V3=y 9 - CONFIG_TASKSTATS=y 10 - CONFIG_TASK_DELAY_ACCT=y 11 - CONFIG_TASK_XACCT=y 12 - CONFIG_TASK_IO_ACCOUNTING=y 13 - CONFIG_CGROUPS=y 14 - CONFIG_NAMESPACES=y 15 - CONFIG_BLK_DEV_INITRD=y 16 - CONFIG_KALLSYMS_ALL=y 17 - CONFIG_EMBEDDED=y 18 - # CONFIG_COMPAT_BRK is not set 19 - CONFIG_PROFILING=y 20 - CONFIG_NLM_XLP_BOARD=y 21 - CONFIG_64BIT=y 22 - CONFIG_PAGE_SIZE_16KB=y 23 - # CONFIG_HW_PERF_EVENTS is not set 24 - CONFIG_SMP=y 25 - # CONFIG_SECCOMP is not set 26 - CONFIG_PCI=y 27 - CONFIG_PCI_DEBUG=y 28 - CONFIG_PCI_STUB=y 29 - CONFIG_MIPS32_O32=y 30 - CONFIG_MIPS32_N32=y 31 - CONFIG_PM=y 32 - CONFIG_PM_DEBUG=y 33 - CONFIG_MODULES=y 34 - CONFIG_MODULE_UNLOAD=y 35 - CONFIG_MODVERSIONS=y 36 - CONFIG_MODULE_SRCVERSION_ALL=y 37 - CONFIG_BLK_DEV_INTEGRITY=y 38 - CONFIG_PARTITION_ADVANCED=y 39 - CONFIG_ACORN_PARTITION=y 40 - CONFIG_ACORN_PARTITION_ICS=y 41 - CONFIG_ACORN_PARTITION_RISCIX=y 42 - CONFIG_OSF_PARTITION=y 43 - CONFIG_AMIGA_PARTITION=y 44 - CONFIG_ATARI_PARTITION=y 45 - CONFIG_MAC_PARTITION=y 46 - CONFIG_BSD_DISKLABEL=y 47 - CONFIG_MINIX_SUBPARTITION=y 48 - CONFIG_SOLARIS_X86_PARTITION=y 49 - CONFIG_UNIXWARE_DISKLABEL=y 50 - CONFIG_LDM_PARTITION=y 51 - CONFIG_SGI_PARTITION=y 52 - CONFIG_ULTRIX_PARTITION=y 53 - CONFIG_SUN_PARTITION=y 54 - CONFIG_KARMA_PARTITION=y 55 - CONFIG_SYSV68_PARTITION=y 56 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 57 - CONFIG_BINFMT_MISC=y 58 - CONFIG_KSM=y 59 - CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 60 - CONFIG_NET=y 61 - CONFIG_PACKET=y 62 - CONFIG_UNIX=y 63 - CONFIG_XFRM_USER=m 64 - CONFIG_NET_KEY=m 65 - CONFIG_INET=y 66 - CONFIG_IP_MULTICAST=y 67 - CONFIG_IP_ADVANCED_ROUTER=y 68 - CONFIG_IP_MULTIPLE_TABLES=y 69 - CONFIG_IP_ROUTE_MULTIPATH=y 70 - CONFIG_IP_ROUTE_VERBOSE=y 71 - CONFIG_NET_IPIP=m 72 - CONFIG_IP_MROUTE=y 73 - CONFIG_IP_PIMSM_V1=y 74 - CONFIG_IP_PIMSM_V2=y 75 - CONFIG_SYN_COOKIES=y 76 - CONFIG_INET_AH=m 77 - CONFIG_INET_ESP=m 78 - CONFIG_INET_IPCOMP=m 79 - CONFIG_INET_XFRM_MODE_TRANSPORT=m 80 - CONFIG_INET_XFRM_MODE_TUNNEL=m 81 - CONFIG_INET_XFRM_MODE_BEET=m 82 - CONFIG_TCP_CONG_ADVANCED=y 83 - CONFIG_TCP_CONG_HSTCP=m 84 - CONFIG_TCP_CONG_HYBLA=m 85 - CONFIG_TCP_CONG_SCALABLE=m 86 - CONFIG_TCP_CONG_LP=m 87 - CONFIG_TCP_CONG_VENO=m 88 - CONFIG_TCP_CONG_YEAH=m 89 - CONFIG_TCP_CONG_ILLINOIS=m 90 - CONFIG_TCP_MD5SIG=y 91 - CONFIG_INET6_AH=m 92 - CONFIG_INET6_ESP=m 93 - CONFIG_INET6_IPCOMP=m 94 - CONFIG_INET6_XFRM_MODE_TRANSPORT=m 95 - CONFIG_INET6_XFRM_MODE_TUNNEL=m 96 - CONFIG_INET6_XFRM_MODE_BEET=m 97 - CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m 98 - CONFIG_IPV6_SIT=m 99 - CONFIG_IPV6_TUNNEL=m 100 - CONFIG_IPV6_MULTIPLE_TABLES=y 101 - CONFIG_NETFILTER=y 102 - CONFIG_NF_CONNTRACK=m 103 - CONFIG_NF_CONNTRACK_SECMARK=y 104 - CONFIG_NF_CONNTRACK_EVENTS=y 105 - CONFIG_NF_CONNTRACK_AMANDA=m 106 - CONFIG_NF_CONNTRACK_FTP=m 107 - CONFIG_NF_CONNTRACK_H323=m 108 - CONFIG_NF_CONNTRACK_IRC=m 109 - CONFIG_NF_CONNTRACK_NETBIOS_NS=m 110 - CONFIG_NF_CONNTRACK_PPTP=m 111 - CONFIG_NF_CONNTRACK_SANE=m 112 - CONFIG_NF_CONNTRACK_SIP=m 113 - CONFIG_NF_CONNTRACK_TFTP=m 114 - CONFIG_NF_CT_NETLINK=m 115 - CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 116 - CONFIG_NETFILTER_XT_TARGET_CONNMARK=m 117 - CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m 118 - CONFIG_NETFILTER_XT_TARGET_DSCP=m 119 - CONFIG_NETFILTER_XT_TARGET_MARK=m 120 - CONFIG_NETFILTER_XT_TARGET_NFLOG=m 121 - CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 122 - CONFIG_NETFILTER_XT_TARGET_TPROXY=m 123 - CONFIG_NETFILTER_XT_TARGET_TRACE=m 124 - CONFIG_NETFILTER_XT_TARGET_SECMARK=m 125 - CONFIG_NETFILTER_XT_TARGET_TCPMSS=m 126 - CONFIG_NETFILTER_XT_MATCH_CLUSTER=m 127 - CONFIG_NETFILTER_XT_MATCH_COMMENT=m 128 - CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 129 - CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m 130 - CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 131 - CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 132 - CONFIG_NETFILTER_XT_MATCH_DSCP=m 133 - CONFIG_NETFILTER_XT_MATCH_ESP=m 134 - CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m 135 - CONFIG_NETFILTER_XT_MATCH_HELPER=m 136 - CONFIG_NETFILTER_XT_MATCH_IPRANGE=m 137 - CONFIG_NETFILTER_XT_MATCH_LENGTH=m 138 - CONFIG_NETFILTER_XT_MATCH_LIMIT=m 139 - CONFIG_NETFILTER_XT_MATCH_MAC=m 140 - CONFIG_NETFILTER_XT_MATCH_MARK=m 141 - CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 142 - CONFIG_NETFILTER_XT_MATCH_OSF=m 143 - CONFIG_NETFILTER_XT_MATCH_OWNER=m 144 - CONFIG_NETFILTER_XT_MATCH_POLICY=m 145 - CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m 146 - CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 147 - CONFIG_NETFILTER_XT_MATCH_QUOTA=m 148 - CONFIG_NETFILTER_XT_MATCH_RATEEST=m 149 - CONFIG_NETFILTER_XT_MATCH_REALM=m 150 - CONFIG_NETFILTER_XT_MATCH_RECENT=m 151 - CONFIG_NETFILTER_XT_MATCH_SOCKET=m 152 - CONFIG_NETFILTER_XT_MATCH_STATE=m 153 - CONFIG_NETFILTER_XT_MATCH_STATISTIC=m 154 - CONFIG_NETFILTER_XT_MATCH_STRING=m 155 - CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 156 - CONFIG_NETFILTER_XT_MATCH_TIME=m 157 - CONFIG_NETFILTER_XT_MATCH_U32=m 158 - CONFIG_IP_VS=m 159 - CONFIG_IP_VS_IPV6=y 160 - CONFIG_IP_VS_PROTO_TCP=y 161 - CONFIG_IP_VS_PROTO_UDP=y 162 - CONFIG_IP_VS_PROTO_ESP=y 163 - CONFIG_IP_VS_PROTO_AH=y 164 - CONFIG_IP_VS_RR=m 165 - CONFIG_IP_VS_WRR=m 166 - CONFIG_IP_VS_LC=m 167 - CONFIG_IP_VS_WLC=m 168 - CONFIG_IP_VS_LBLC=m 169 - CONFIG_IP_VS_LBLCR=m 170 - CONFIG_IP_VS_DH=m 171 - CONFIG_IP_VS_SH=m 172 - CONFIG_IP_VS_SED=m 173 - CONFIG_IP_VS_NQ=m 174 - CONFIG_IP_NF_IPTABLES=m 175 - CONFIG_IP_NF_MATCH_AH=m 176 - CONFIG_IP_NF_MATCH_ECN=m 177 - CONFIG_IP_NF_MATCH_TTL=m 178 - CONFIG_IP_NF_FILTER=m 179 - CONFIG_IP_NF_TARGET_REJECT=m 180 - CONFIG_IP_NF_MANGLE=m 181 - CONFIG_IP_NF_TARGET_CLUSTERIP=m 182 - CONFIG_IP_NF_TARGET_ECN=m 183 - CONFIG_IP_NF_TARGET_TTL=m 184 - CONFIG_IP_NF_RAW=m 185 - CONFIG_IP_NF_SECURITY=m 186 - CONFIG_IP_NF_ARPTABLES=m 187 - CONFIG_IP_NF_ARPFILTER=m 188 - CONFIG_IP_NF_ARP_MANGLE=m 189 - CONFIG_IP6_NF_MATCH_AH=m 190 - CONFIG_IP6_NF_MATCH_EUI64=m 191 - CONFIG_IP6_NF_MATCH_FRAG=m 192 - CONFIG_IP6_NF_MATCH_OPTS=m 193 - CONFIG_IP6_NF_MATCH_HL=m 194 - CONFIG_IP6_NF_MATCH_IPV6HEADER=m 195 - CONFIG_IP6_NF_MATCH_MH=m 196 - CONFIG_IP6_NF_MATCH_RT=m 197 - CONFIG_IP6_NF_TARGET_HL=m 198 - CONFIG_IP6_NF_FILTER=m 199 - CONFIG_IP6_NF_TARGET_REJECT=m 200 - CONFIG_IP6_NF_MANGLE=m 201 - CONFIG_IP6_NF_RAW=m 202 - CONFIG_IP6_NF_SECURITY=m 203 - CONFIG_DECNET_NF_GRABULATOR=m 204 - CONFIG_BRIDGE_NF_EBTABLES=m 205 - CONFIG_BRIDGE_EBT_BROUTE=m 206 - CONFIG_BRIDGE_EBT_T_FILTER=m 207 - CONFIG_BRIDGE_EBT_T_NAT=m 208 - CONFIG_BRIDGE_EBT_802_3=m 209 - CONFIG_BRIDGE_EBT_AMONG=m 210 - CONFIG_BRIDGE_EBT_ARP=m 211 - CONFIG_BRIDGE_EBT_IP=m 212 - CONFIG_BRIDGE_EBT_IP6=m 213 - CONFIG_BRIDGE_EBT_LIMIT=m 214 - CONFIG_BRIDGE_EBT_MARK=m 215 - CONFIG_BRIDGE_EBT_PKTTYPE=m 216 - CONFIG_BRIDGE_EBT_STP=m 217 - CONFIG_BRIDGE_EBT_VLAN=m 218 - CONFIG_BRIDGE_EBT_ARPREPLY=m 219 - CONFIG_BRIDGE_EBT_DNAT=m 220 - CONFIG_BRIDGE_EBT_MARK_T=m 221 - CONFIG_BRIDGE_EBT_REDIRECT=m 222 - CONFIG_BRIDGE_EBT_SNAT=m 223 - CONFIG_BRIDGE_EBT_LOG=m 224 - CONFIG_BRIDGE_EBT_NFLOG=m 225 - CONFIG_IP_DCCP=m 226 - CONFIG_RDS=m 227 - CONFIG_RDS_TCP=m 228 - CONFIG_TIPC=m 229 - CONFIG_ATM=m 230 - CONFIG_ATM_CLIP=m 231 - CONFIG_ATM_LANE=m 232 - CONFIG_ATM_MPOA=m 233 - CONFIG_ATM_BR2684=m 234 - CONFIG_BRIDGE=m 235 - CONFIG_VLAN_8021Q=m 236 - CONFIG_VLAN_8021Q_GVRP=y 237 - CONFIG_DECNET=m 238 - CONFIG_LLC2=m 239 - CONFIG_ATALK=m 240 - CONFIG_DEV_APPLETALK=m 241 - CONFIG_IPDDP=m 242 - CONFIG_IPDDP_ENCAP=y 243 - CONFIG_X25=m 244 - CONFIG_LAPB=m 245 - CONFIG_PHONET=m 246 - CONFIG_IEEE802154=m 247 - CONFIG_NET_SCHED=y 248 - CONFIG_NET_SCH_CBQ=m 249 - CONFIG_NET_SCH_HTB=m 250 - CONFIG_NET_SCH_HFSC=m 251 - CONFIG_NET_SCH_ATM=m 252 - CONFIG_NET_SCH_PRIO=m 253 - CONFIG_NET_SCH_MULTIQ=m 254 - CONFIG_NET_SCH_RED=m 255 - CONFIG_NET_SCH_SFQ=m 256 - CONFIG_NET_SCH_TEQL=m 257 - CONFIG_NET_SCH_TBF=m 258 - CONFIG_NET_SCH_GRED=m 259 - CONFIG_NET_SCH_DSMARK=m 260 - CONFIG_NET_SCH_NETEM=m 261 - CONFIG_NET_SCH_DRR=m 262 - CONFIG_NET_SCH_INGRESS=m 263 - CONFIG_NET_CLS_BASIC=m 264 - CONFIG_NET_CLS_TCINDEX=m 265 - CONFIG_NET_CLS_ROUTE4=m 266 - CONFIG_NET_CLS_FW=m 267 - CONFIG_NET_CLS_U32=m 268 - CONFIG_CLS_U32_MARK=y 269 - CONFIG_NET_CLS_RSVP=m 270 - CONFIG_NET_CLS_RSVP6=m 271 - CONFIG_NET_CLS_FLOW=m 272 - CONFIG_NET_EMATCH=y 273 - CONFIG_NET_EMATCH_CMP=m 274 - CONFIG_NET_EMATCH_NBYTE=m 275 - CONFIG_NET_EMATCH_U32=m 276 - CONFIG_NET_EMATCH_META=m 277 - CONFIG_NET_EMATCH_TEXT=m 278 - CONFIG_NET_CLS_ACT=y 279 - CONFIG_NET_ACT_POLICE=m 280 - CONFIG_NET_ACT_GACT=m 281 - CONFIG_GACT_PROB=y 282 - CONFIG_NET_ACT_MIRRED=m 283 - CONFIG_NET_ACT_IPT=m 284 - CONFIG_NET_ACT_NAT=m 285 - CONFIG_NET_ACT_PEDIT=m 286 - CONFIG_NET_ACT_SIMP=m 287 - CONFIG_NET_ACT_SKBEDIT=m 288 - CONFIG_DCB=y 289 - CONFIG_NET_PKTGEN=m 290 - CONFIG_DEVTMPFS=y 291 - CONFIG_DEVTMPFS_MOUNT=y 292 - # CONFIG_STANDALONE is not set 293 - CONFIG_CONNECTOR=y 294 - CONFIG_MTD=y 295 - CONFIG_MTD_CMDLINE_PARTS=y 296 - CONFIG_MTD_BLOCK=y 297 - CONFIG_MTD_CFI=y 298 - CONFIG_MTD_CFI_ADV_OPTIONS=y 299 - CONFIG_MTD_CFI_LE_BYTE_SWAP=y 300 - CONFIG_MTD_CFI_GEOMETRY=y 301 - CONFIG_MTD_CFI_INTELEXT=y 302 - CONFIG_MTD_PHYSMAP=y 303 - CONFIG_MTD_PHYSMAP_OF=y 304 - CONFIG_BLK_DEV_LOOP=y 305 - CONFIG_BLK_DEV_CRYPTOLOOP=m 306 - CONFIG_BLK_DEV_NBD=m 307 - CONFIG_BLK_DEV_RAM=y 308 - CONFIG_BLK_DEV_RAM_SIZE=65536 309 - CONFIG_CDROM_PKTCDVD=y 310 - CONFIG_RAID_ATTRS=m 311 - CONFIG_BLK_DEV_SD=y 312 - CONFIG_CHR_DEV_ST=m 313 - CONFIG_CHR_DEV_OSST=m 314 - CONFIG_BLK_DEV_SR=y 315 - CONFIG_CHR_DEV_SG=y 316 - CONFIG_CHR_DEV_SCH=m 317 - CONFIG_SCSI_CONSTANTS=y 318 - CONFIG_SCSI_LOGGING=y 319 - CONFIG_SCSI_SCAN_ASYNC=y 320 - CONFIG_SCSI_SPI_ATTRS=m 321 - CONFIG_SCSI_SAS_LIBSAS=m 322 - CONFIG_SCSI_SRP_ATTRS=m 323 - CONFIG_ISCSI_TCP=m 324 - CONFIG_SCSI_DEBUG=m 325 - CONFIG_SCSI_DH=y 326 - CONFIG_SCSI_DH_RDAC=m 327 - CONFIG_SCSI_DH_HP_SW=m 328 - CONFIG_SCSI_DH_EMC=m 329 - CONFIG_SCSI_DH_ALUA=m 330 - CONFIG_SCSI_OSD_INITIATOR=m 331 - CONFIG_SCSI_OSD_ULD=m 332 - CONFIG_ATA=y 333 - CONFIG_SATA_AHCI=y 334 - CONFIG_SATA_SIL24=y 335 - # CONFIG_ATA_SFF is not set 336 - CONFIG_NETDEVICES=y 337 - # CONFIG_NET_VENDOR_3COM is not set 338 - # CONFIG_NET_VENDOR_ADAPTEC is not set 339 - # CONFIG_NET_VENDOR_ALTEON is not set 340 - # CONFIG_NET_VENDOR_AMD is not set 341 - # CONFIG_NET_VENDOR_ATHEROS is not set 342 - # CONFIG_NET_VENDOR_BROADCOM is not set 343 - # CONFIG_NET_VENDOR_BROCADE is not set 344 - # CONFIG_NET_VENDOR_CHELSIO is not set 345 - # CONFIG_NET_VENDOR_DEC is not set 346 - # CONFIG_NET_VENDOR_DLINK is not set 347 - # CONFIG_NET_VENDOR_EMULEX is not set 348 - # CONFIG_NET_VENDOR_HP is not set 349 - # CONFIG_NET_VENDOR_I825XX is not set 350 - CONFIG_E1000E=y 351 - CONFIG_SKY2=y 352 - # CONFIG_NET_VENDOR_MELLANOX is not set 353 - # CONFIG_NET_VENDOR_MICREL is not set 354 - # CONFIG_NET_VENDOR_MYRI is not set 355 - # CONFIG_NET_VENDOR_NATSEMI is not set 356 - # CONFIG_NET_VENDOR_NVIDIA is not set 357 - # CONFIG_NET_VENDOR_OKI is not set 358 - # CONFIG_NET_VENDOR_QLOGIC is not set 359 - # CONFIG_NET_VENDOR_RDC is not set 360 - # CONFIG_NET_VENDOR_REALTEK is not set 361 - # CONFIG_NET_VENDOR_SEEQ is not set 362 - # CONFIG_NET_VENDOR_SILAN is not set 363 - # CONFIG_NET_VENDOR_SIS is not set 364 - # CONFIG_NET_VENDOR_SMSC is not set 365 - # CONFIG_NET_VENDOR_STMICRO is not set 366 - # CONFIG_NET_VENDOR_SUN is not set 367 - # CONFIG_NET_VENDOR_TEHUTI is not set 368 - # CONFIG_NET_VENDOR_TI is not set 369 - # CONFIG_NET_VENDOR_TOSHIBA is not set 370 - # CONFIG_NET_VENDOR_VIA is not set 371 - # CONFIG_NET_VENDOR_WIZNET is not set 372 - CONFIG_INPUT_EVDEV=y 373 - CONFIG_INPUT_EVBUG=m 374 - # CONFIG_INPUT_KEYBOARD is not set 375 - # CONFIG_INPUT_MOUSE is not set 376 - CONFIG_SERIO_SERPORT=m 377 - CONFIG_SERIO_LIBPS2=y 378 - CONFIG_SERIO_RAW=m 379 - CONFIG_VT_HW_CONSOLE_BINDING=y 380 - CONFIG_LEGACY_PTY_COUNT=0 381 - CONFIG_SERIAL_NONSTANDARD=y 382 - CONFIG_N_HDLC=m 383 - CONFIG_SERIAL_8250=y 384 - CONFIG_SERIAL_8250_CONSOLE=y 385 - CONFIG_SERIAL_8250_NR_UARTS=48 386 - CONFIG_SERIAL_8250_EXTENDED=y 387 - CONFIG_SERIAL_8250_MANY_PORTS=y 388 - CONFIG_SERIAL_8250_SHARE_IRQ=y 389 - CONFIG_SERIAL_8250_RSA=y 390 - CONFIG_SERIAL_OF_PLATFORM=y 391 - CONFIG_HW_RANDOM=y 392 - CONFIG_HW_RANDOM_TIMERIOMEM=m 393 - CONFIG_RAW_DRIVER=m 394 - CONFIG_I2C=y 395 - CONFIG_I2C_CHARDEV=y 396 - CONFIG_I2C_OCORES=y 397 - CONFIG_SENSORS_LM90=y 398 - CONFIG_THERMAL=y 399 - # CONFIG_VGA_CONSOLE is not set 400 - # CONFIG_USB_SUPPORT is not set 401 - CONFIG_RTC_CLASS=y 402 - CONFIG_RTC_DRV_DS1374=y 403 - CONFIG_UIO=y 404 - CONFIG_UIO_PDRV_GENIRQ=m 405 - # CONFIG_IOMMU_SUPPORT is not set 406 - CONFIG_EXT2_FS=y 407 - CONFIG_EXT2_FS_XATTR=y 408 - CONFIG_EXT2_FS_POSIX_ACL=y 409 - CONFIG_EXT2_FS_SECURITY=y 410 - CONFIG_EXT3_FS=y 411 - CONFIG_EXT3_FS_POSIX_ACL=y 412 - CONFIG_EXT3_FS_SECURITY=y 413 - CONFIG_GFS2_FS=m 414 - CONFIG_BTRFS_FS=m 415 - CONFIG_BTRFS_FS_POSIX_ACL=y 416 - CONFIG_NILFS2_FS=m 417 - CONFIG_QUOTA_NETLINK_INTERFACE=y 418 - CONFIG_AUTOFS4_FS=m 419 - CONFIG_FUSE_FS=y 420 - CONFIG_CUSE=m 421 - CONFIG_FSCACHE=m 422 - CONFIG_FSCACHE_STATS=y 423 - CONFIG_FSCACHE_HISTOGRAM=y 424 - CONFIG_CACHEFILES=m 425 - CONFIG_ISO9660_FS=m 426 - CONFIG_JOLIET=y 427 - CONFIG_ZISOFS=y 428 - CONFIG_UDF_FS=m 429 - CONFIG_MSDOS_FS=m 430 - CONFIG_VFAT_FS=m 431 - CONFIG_NTFS_FS=m 432 - CONFIG_PROC_KCORE=y 433 - CONFIG_TMPFS=y 434 - CONFIG_TMPFS_POSIX_ACL=y 435 - CONFIG_ADFS_FS=m 436 - CONFIG_AFFS_FS=m 437 - CONFIG_ECRYPT_FS=y 438 - CONFIG_HFS_FS=m 439 - CONFIG_HFSPLUS_FS=m 440 - CONFIG_BEFS_FS=m 441 - CONFIG_BFS_FS=m 442 - CONFIG_EFS_FS=m 443 - CONFIG_JFFS2_FS=y 444 - CONFIG_CRAMFS=m 445 - CONFIG_SQUASHFS=m 446 - CONFIG_VXFS_FS=m 447 - CONFIG_MINIX_FS=m 448 - CONFIG_OMFS_FS=m 449 - CONFIG_HPFS_FS=m 450 - CONFIG_QNX4FS_FS=m 451 - CONFIG_ROMFS_FS=m 452 - CONFIG_SYSV_FS=m 453 - CONFIG_UFS_FS=m 454 - CONFIG_EXOFS_FS=m 455 - CONFIG_NFS_FS=m 456 - CONFIG_NFS_V3_ACL=y 457 - CONFIG_NFS_V4=m 458 - CONFIG_NFS_FSCACHE=y 459 - CONFIG_NFSD=m 460 - CONFIG_NFSD_V3_ACL=y 461 - CONFIG_NFSD_V4=y 462 - CONFIG_CIFS=m 463 - CONFIG_CIFS_WEAK_PW_HASH=y 464 - CONFIG_CIFS_UPCALL=y 465 - CONFIG_CIFS_XATTR=y 466 - CONFIG_CIFS_POSIX=y 467 - CONFIG_CIFS_DFS_UPCALL=y 468 - CONFIG_CODA_FS=m 469 - CONFIG_AFS_FS=m 470 - CONFIG_NLS=y 471 - CONFIG_NLS_DEFAULT="cp437" 472 - CONFIG_NLS_CODEPAGE_437=m 473 - CONFIG_NLS_CODEPAGE_737=m 474 - CONFIG_NLS_CODEPAGE_775=m 475 - CONFIG_NLS_CODEPAGE_850=m 476 - CONFIG_NLS_CODEPAGE_852=m 477 - CONFIG_NLS_CODEPAGE_855=m 478 - CONFIG_NLS_CODEPAGE_857=m 479 - CONFIG_NLS_CODEPAGE_860=m 480 - CONFIG_NLS_CODEPAGE_861=m 481 - CONFIG_NLS_CODEPAGE_862=m 482 - CONFIG_NLS_CODEPAGE_863=m 483 - CONFIG_NLS_CODEPAGE_864=m 484 - CONFIG_NLS_CODEPAGE_865=m 485 - CONFIG_NLS_CODEPAGE_866=m 486 - CONFIG_NLS_CODEPAGE_869=m 487 - CONFIG_NLS_CODEPAGE_936=m 488 - CONFIG_NLS_CODEPAGE_950=m 489 - CONFIG_NLS_CODEPAGE_932=m 490 - CONFIG_NLS_CODEPAGE_949=m 491 - CONFIG_NLS_CODEPAGE_874=m 492 - CONFIG_NLS_ISO8859_8=m 493 - CONFIG_NLS_CODEPAGE_1250=m 494 - CONFIG_NLS_CODEPAGE_1251=m 495 - CONFIG_NLS_ASCII=m 496 - CONFIG_NLS_ISO8859_1=m 497 - CONFIG_NLS_ISO8859_2=m 498 - CONFIG_NLS_ISO8859_3=m 499 - CONFIG_NLS_ISO8859_4=m 500 - CONFIG_NLS_ISO8859_5=m 501 - CONFIG_NLS_ISO8859_6=m 502 - CONFIG_NLS_ISO8859_7=m 503 - CONFIG_NLS_ISO8859_9=m 504 - CONFIG_NLS_ISO8859_13=m 505 - CONFIG_NLS_ISO8859_14=m 506 - CONFIG_NLS_ISO8859_15=m 507 - CONFIG_NLS_KOI8_R=m 508 - CONFIG_NLS_KOI8_U=m 509 - CONFIG_SECURITY=y 510 - CONFIG_LSM_MMAP_MIN_ADDR=0 511 - CONFIG_SECURITY_SELINUX=y 512 - CONFIG_SECURITY_SELINUX_BOOTPARAM=y 513 - CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 514 - CONFIG_SECURITY_SELINUX_DISABLE=y 515 - CONFIG_SECURITY_SMACK=y 516 - CONFIG_SECURITY_TOMOYO=y 517 - CONFIG_CRYPTO_CRYPTD=m 518 - CONFIG_CRYPTO_TEST=m 519 - CONFIG_CRYPTO_GCM=m 520 - CONFIG_CRYPTO_CTS=m 521 - CONFIG_CRYPTO_LRW=m 522 - CONFIG_CRYPTO_PCBC=m 523 - CONFIG_CRYPTO_XTS=m 524 - CONFIG_CRYPTO_HMAC=y 525 - CONFIG_CRYPTO_XCBC=m 526 - CONFIG_CRYPTO_VMAC=m 527 - CONFIG_CRYPTO_MICHAEL_MIC=m 528 - CONFIG_CRYPTO_RMD128=m 529 - CONFIG_CRYPTO_RMD160=m 530 - CONFIG_CRYPTO_RMD256=m 531 - CONFIG_CRYPTO_RMD320=m 532 - CONFIG_CRYPTO_TGR192=m 533 - CONFIG_CRYPTO_WP512=m 534 - CONFIG_CRYPTO_ANUBIS=m 535 - CONFIG_CRYPTO_BLOWFISH=m 536 - CONFIG_CRYPTO_CAMELLIA=m 537 - CONFIG_CRYPTO_CAST5=m 538 - CONFIG_CRYPTO_CAST6=m 539 - CONFIG_CRYPTO_FCRYPT=m 540 - CONFIG_CRYPTO_KHAZAD=m 541 - CONFIG_CRYPTO_SALSA20=m 542 - CONFIG_CRYPTO_SEED=m 543 - CONFIG_CRYPTO_SERPENT=m 544 - CONFIG_CRYPTO_TEA=m 545 - CONFIG_CRYPTO_TWOFISH=m 546 - CONFIG_CRYPTO_LZO=m 547 - CONFIG_CRC7=m 548 - CONFIG_PRINTK_TIME=y 549 - CONFIG_DEBUG_INFO=y 550 - # CONFIG_ENABLE_MUST_CHECK is not set 551 - CONFIG_FRAME_WARN=1024 552 - CONFIG_DEBUG_MEMORY_INIT=y 553 - CONFIG_DETECT_HUNG_TASK=y 554 - CONFIG_SCHEDSTATS=y 555 - CONFIG_SCHED_TRACER=y 556 - CONFIG_BLK_DEV_IO_TRACE=y 557 - CONFIG_KGDB=y
-508
arch/mips/configs/nlm_xlr_defconfig
··· 1 - # CONFIG_LOCALVERSION_AUTO is not set 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_AUDIT=y 5 - CONFIG_NO_HZ=y 6 - CONFIG_HIGH_RES_TIMERS=y 7 - CONFIG_PREEMPT_VOLUNTARY=y 8 - CONFIG_BSD_PROCESS_ACCT=y 9 - CONFIG_BSD_PROCESS_ACCT_V3=y 10 - CONFIG_TASKSTATS=y 11 - CONFIG_TASK_DELAY_ACCT=y 12 - CONFIG_TASK_XACCT=y 13 - CONFIG_TASK_IO_ACCOUNTING=y 14 - CONFIG_NAMESPACES=y 15 - CONFIG_SCHED_AUTOGROUP=y 16 - CONFIG_BLK_DEV_INITRD=y 17 - CONFIG_EXPERT=y 18 - # CONFIG_ELF_CORE is not set 19 - CONFIG_KALLSYMS_ALL=y 20 - # CONFIG_PERF_EVENTS is not set 21 - # CONFIG_COMPAT_BRK is not set 22 - CONFIG_PROFILING=y 23 - CONFIG_NLM_XLR_BOARD=y 24 - CONFIG_HIGHMEM=y 25 - CONFIG_SMP=y 26 - CONFIG_KEXEC=y 27 - CONFIG_PCI=y 28 - CONFIG_PCI_MSI=y 29 - CONFIG_PCI_DEBUG=y 30 - CONFIG_PM=y 31 - CONFIG_PM_DEBUG=y 32 - CONFIG_MODULES=y 33 - CONFIG_MODULE_UNLOAD=y 34 - CONFIG_MODVERSIONS=y 35 - CONFIG_MODULE_SRCVERSION_ALL=y 36 - CONFIG_BLK_DEV_INTEGRITY=y 37 - CONFIG_PARTITION_ADVANCED=y 38 - CONFIG_ACORN_PARTITION=y 39 - CONFIG_ACORN_PARTITION_ICS=y 40 - CONFIG_ACORN_PARTITION_RISCIX=y 41 - CONFIG_OSF_PARTITION=y 42 - CONFIG_AMIGA_PARTITION=y 43 - CONFIG_ATARI_PARTITION=y 44 - CONFIG_MAC_PARTITION=y 45 - CONFIG_BSD_DISKLABEL=y 46 - CONFIG_MINIX_SUBPARTITION=y 47 - CONFIG_SOLARIS_X86_PARTITION=y 48 - CONFIG_UNIXWARE_DISKLABEL=y 49 - CONFIG_LDM_PARTITION=y 50 - CONFIG_SGI_PARTITION=y 51 - CONFIG_ULTRIX_PARTITION=y 52 - CONFIG_SUN_PARTITION=y 53 - CONFIG_KARMA_PARTITION=y 54 - CONFIG_SYSV68_PARTITION=y 55 - CONFIG_BINFMT_MISC=m 56 - CONFIG_KSM=y 57 - CONFIG_DEFAULT_MMAP_MIN_ADDR=65536 58 - CONFIG_NET=y 59 - CONFIG_PACKET=y 60 - CONFIG_UNIX=y 61 - CONFIG_XFRM_USER=m 62 - CONFIG_NET_KEY=m 63 - CONFIG_INET=y 64 - CONFIG_IP_MULTICAST=y 65 - CONFIG_IP_ADVANCED_ROUTER=y 66 - CONFIG_IP_MULTIPLE_TABLES=y 67 - CONFIG_IP_ROUTE_MULTIPATH=y 68 - CONFIG_IP_ROUTE_VERBOSE=y 69 - CONFIG_NET_IPIP=m 70 - CONFIG_IP_MROUTE=y 71 - CONFIG_IP_PIMSM_V1=y 72 - CONFIG_IP_PIMSM_V2=y 73 - CONFIG_SYN_COOKIES=y 74 - CONFIG_INET_AH=m 75 - CONFIG_INET_ESP=m 76 - CONFIG_INET_IPCOMP=m 77 - CONFIG_INET_XFRM_MODE_TRANSPORT=m 78 - CONFIG_INET_XFRM_MODE_TUNNEL=m 79 - CONFIG_INET_XFRM_MODE_BEET=m 80 - CONFIG_TCP_CONG_ADVANCED=y 81 - CONFIG_TCP_CONG_HSTCP=m 82 - CONFIG_TCP_CONG_HYBLA=m 83 - CONFIG_TCP_CONG_SCALABLE=m 84 - CONFIG_TCP_CONG_LP=m 85 - CONFIG_TCP_CONG_VENO=m 86 - CONFIG_TCP_CONG_YEAH=m 87 - CONFIG_TCP_CONG_ILLINOIS=m 88 - CONFIG_TCP_MD5SIG=y 89 - CONFIG_INET6_AH=m 90 - CONFIG_INET6_ESP=m 91 - CONFIG_INET6_IPCOMP=m 92 - CONFIG_INET6_XFRM_MODE_TRANSPORT=m 93 - CONFIG_INET6_XFRM_MODE_TUNNEL=m 94 - CONFIG_INET6_XFRM_MODE_BEET=m 95 - CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m 96 - CONFIG_IPV6_SIT=m 97 - CONFIG_IPV6_TUNNEL=m 98 - CONFIG_IPV6_MULTIPLE_TABLES=y 99 - CONFIG_NETFILTER=y 100 - CONFIG_NF_CONNTRACK=m 101 - CONFIG_NF_CONNTRACK_SECMARK=y 102 - CONFIG_NF_CONNTRACK_EVENTS=y 103 - CONFIG_NF_CONNTRACK_AMANDA=m 104 - CONFIG_NF_CONNTRACK_FTP=m 105 - CONFIG_NF_CONNTRACK_H323=m 106 - CONFIG_NF_CONNTRACK_IRC=m 107 - CONFIG_NF_CONNTRACK_NETBIOS_NS=m 108 - CONFIG_NF_CONNTRACK_PPTP=m 109 - CONFIG_NF_CONNTRACK_SANE=m 110 - CONFIG_NF_CONNTRACK_SIP=m 111 - CONFIG_NF_CONNTRACK_TFTP=m 112 - CONFIG_NF_CT_NETLINK=m 113 - CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m 114 - CONFIG_NETFILTER_XT_TARGET_CONNMARK=m 115 - CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m 116 - CONFIG_NETFILTER_XT_TARGET_DSCP=m 117 - CONFIG_NETFILTER_XT_TARGET_MARK=m 118 - CONFIG_NETFILTER_XT_TARGET_NFLOG=m 119 - CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m 120 - CONFIG_NETFILTER_XT_TARGET_TPROXY=m 121 - CONFIG_NETFILTER_XT_TARGET_TRACE=m 122 - CONFIG_NETFILTER_XT_TARGET_SECMARK=m 123 - CONFIG_NETFILTER_XT_TARGET_TCPMSS=m 124 - CONFIG_NETFILTER_XT_MATCH_CLUSTER=m 125 - CONFIG_NETFILTER_XT_MATCH_COMMENT=m 126 - CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m 127 - CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m 128 - CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 129 - CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 130 - CONFIG_NETFILTER_XT_MATCH_DSCP=m 131 - CONFIG_NETFILTER_XT_MATCH_ESP=m 132 - CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m 133 - CONFIG_NETFILTER_XT_MATCH_HELPER=m 134 - CONFIG_NETFILTER_XT_MATCH_IPRANGE=m 135 - CONFIG_NETFILTER_XT_MATCH_LENGTH=m 136 - CONFIG_NETFILTER_XT_MATCH_LIMIT=m 137 - CONFIG_NETFILTER_XT_MATCH_MAC=m 138 - CONFIG_NETFILTER_XT_MATCH_MARK=m 139 - CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m 140 - CONFIG_NETFILTER_XT_MATCH_OSF=m 141 - CONFIG_NETFILTER_XT_MATCH_OWNER=m 142 - CONFIG_NETFILTER_XT_MATCH_POLICY=m 143 - CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m 144 - CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 145 - CONFIG_NETFILTER_XT_MATCH_QUOTA=m 146 - CONFIG_NETFILTER_XT_MATCH_RATEEST=m 147 - CONFIG_NETFILTER_XT_MATCH_REALM=m 148 - CONFIG_NETFILTER_XT_MATCH_RECENT=m 149 - CONFIG_NETFILTER_XT_MATCH_SOCKET=m 150 - CONFIG_NETFILTER_XT_MATCH_STATE=m 151 - CONFIG_NETFILTER_XT_MATCH_STATISTIC=m 152 - CONFIG_NETFILTER_XT_MATCH_STRING=m 153 - CONFIG_NETFILTER_XT_MATCH_TCPMSS=m 154 - CONFIG_NETFILTER_XT_MATCH_TIME=m 155 - CONFIG_NETFILTER_XT_MATCH_U32=m 156 - CONFIG_IP_VS=m 157 - CONFIG_IP_VS_IPV6=y 158 - CONFIG_IP_VS_PROTO_TCP=y 159 - CONFIG_IP_VS_PROTO_UDP=y 160 - CONFIG_IP_VS_PROTO_ESP=y 161 - CONFIG_IP_VS_PROTO_AH=y 162 - CONFIG_IP_VS_RR=m 163 - CONFIG_IP_VS_WRR=m 164 - CONFIG_IP_VS_LC=m 165 - CONFIG_IP_VS_WLC=m 166 - CONFIG_IP_VS_LBLC=m 167 - CONFIG_IP_VS_LBLCR=m 168 - CONFIG_IP_VS_DH=m 169 - CONFIG_IP_VS_SH=m 170 - CONFIG_IP_VS_SED=m 171 - CONFIG_IP_VS_NQ=m 172 - CONFIG_IP_NF_IPTABLES=m 173 - CONFIG_IP_NF_MATCH_AH=m 174 - CONFIG_IP_NF_MATCH_ECN=m 175 - CONFIG_IP_NF_MATCH_TTL=m 176 - CONFIG_IP_NF_FILTER=m 177 - CONFIG_IP_NF_TARGET_REJECT=m 178 - CONFIG_IP_NF_MANGLE=m 179 - CONFIG_IP_NF_TARGET_CLUSTERIP=m 180 - CONFIG_IP_NF_TARGET_ECN=m 181 - CONFIG_IP_NF_TARGET_TTL=m 182 - CONFIG_IP_NF_RAW=m 183 - CONFIG_IP_NF_SECURITY=m 184 - CONFIG_IP_NF_ARPTABLES=m 185 - CONFIG_IP_NF_ARPFILTER=m 186 - CONFIG_IP_NF_ARP_MANGLE=m 187 - CONFIG_IP6_NF_MATCH_AH=m 188 - CONFIG_IP6_NF_MATCH_EUI64=m 189 - CONFIG_IP6_NF_MATCH_FRAG=m 190 - CONFIG_IP6_NF_MATCH_OPTS=m 191 - CONFIG_IP6_NF_MATCH_HL=m 192 - CONFIG_IP6_NF_MATCH_IPV6HEADER=m 193 - CONFIG_IP6_NF_MATCH_MH=m 194 - CONFIG_IP6_NF_MATCH_RT=m 195 - CONFIG_IP6_NF_TARGET_HL=m 196 - CONFIG_IP6_NF_FILTER=m 197 - CONFIG_IP6_NF_TARGET_REJECT=m 198 - CONFIG_IP6_NF_MANGLE=m 199 - CONFIG_IP6_NF_RAW=m 200 - CONFIG_IP6_NF_SECURITY=m 201 - CONFIG_DECNET_NF_GRABULATOR=m 202 - CONFIG_BRIDGE_NF_EBTABLES=m 203 - CONFIG_BRIDGE_EBT_BROUTE=m 204 - CONFIG_BRIDGE_EBT_T_FILTER=m 205 - CONFIG_BRIDGE_EBT_T_NAT=m 206 - CONFIG_BRIDGE_EBT_802_3=m 207 - CONFIG_BRIDGE_EBT_AMONG=m 208 - CONFIG_BRIDGE_EBT_ARP=m 209 - CONFIG_BRIDGE_EBT_IP=m 210 - CONFIG_BRIDGE_EBT_IP6=m 211 - CONFIG_BRIDGE_EBT_LIMIT=m 212 - CONFIG_BRIDGE_EBT_MARK=m 213 - CONFIG_BRIDGE_EBT_PKTTYPE=m 214 - CONFIG_BRIDGE_EBT_STP=m 215 - CONFIG_BRIDGE_EBT_VLAN=m 216 - CONFIG_BRIDGE_EBT_ARPREPLY=m 217 - CONFIG_BRIDGE_EBT_DNAT=m 218 - CONFIG_BRIDGE_EBT_MARK_T=m 219 - CONFIG_BRIDGE_EBT_REDIRECT=m 220 - CONFIG_BRIDGE_EBT_SNAT=m 221 - CONFIG_BRIDGE_EBT_LOG=m 222 - CONFIG_BRIDGE_EBT_NFLOG=m 223 - CONFIG_IP_DCCP=m 224 - CONFIG_RDS=m 225 - CONFIG_RDS_TCP=m 226 - CONFIG_TIPC=m 227 - CONFIG_ATM=m 228 - CONFIG_ATM_CLIP=m 229 - CONFIG_ATM_LANE=m 230 - CONFIG_ATM_MPOA=m 231 - CONFIG_ATM_BR2684=m 232 - CONFIG_BRIDGE=m 233 - CONFIG_VLAN_8021Q=m 234 - CONFIG_VLAN_8021Q_GVRP=y 235 - CONFIG_DECNET=m 236 - CONFIG_LLC2=m 237 - CONFIG_ATALK=m 238 - CONFIG_DEV_APPLETALK=m 239 - CONFIG_IPDDP=m 240 - CONFIG_IPDDP_ENCAP=y 241 - CONFIG_X25=m 242 - CONFIG_LAPB=m 243 - CONFIG_PHONET=m 244 - CONFIG_IEEE802154=m 245 - CONFIG_NET_SCHED=y 246 - CONFIG_NET_SCH_CBQ=m 247 - CONFIG_NET_SCH_HTB=m 248 - CONFIG_NET_SCH_HFSC=m 249 - CONFIG_NET_SCH_ATM=m 250 - CONFIG_NET_SCH_PRIO=m 251 - CONFIG_NET_SCH_MULTIQ=m 252 - CONFIG_NET_SCH_RED=m 253 - CONFIG_NET_SCH_SFQ=m 254 - CONFIG_NET_SCH_TEQL=m 255 - CONFIG_NET_SCH_TBF=m 256 - CONFIG_NET_SCH_GRED=m 257 - CONFIG_NET_SCH_DSMARK=m 258 - CONFIG_NET_SCH_NETEM=m 259 - CONFIG_NET_SCH_DRR=m 260 - CONFIG_NET_SCH_INGRESS=m 261 - CONFIG_NET_CLS_BASIC=m 262 - CONFIG_NET_CLS_TCINDEX=m 263 - CONFIG_NET_CLS_ROUTE4=m 264 - CONFIG_NET_CLS_FW=m 265 - CONFIG_NET_CLS_U32=m 266 - CONFIG_CLS_U32_MARK=y 267 - CONFIG_NET_CLS_RSVP=m 268 - CONFIG_NET_CLS_RSVP6=m 269 - CONFIG_NET_CLS_FLOW=m 270 - CONFIG_NET_EMATCH=y 271 - CONFIG_NET_EMATCH_CMP=m 272 - CONFIG_NET_EMATCH_NBYTE=m 273 - CONFIG_NET_EMATCH_U32=m 274 - CONFIG_NET_EMATCH_META=m 275 - CONFIG_NET_EMATCH_TEXT=m 276 - CONFIG_NET_CLS_ACT=y 277 - CONFIG_NET_ACT_POLICE=m 278 - CONFIG_NET_ACT_GACT=m 279 - CONFIG_GACT_PROB=y 280 - CONFIG_NET_ACT_MIRRED=m 281 - CONFIG_NET_ACT_IPT=m 282 - CONFIG_NET_ACT_NAT=m 283 - CONFIG_NET_ACT_PEDIT=m 284 - CONFIG_NET_ACT_SIMP=m 285 - CONFIG_NET_ACT_SKBEDIT=m 286 - CONFIG_DCB=y 287 - CONFIG_NET_PKTGEN=m 288 - CONFIG_DEVTMPFS=y 289 - CONFIG_DEVTMPFS_MOUNT=y 290 - # CONFIG_STANDALONE is not set 291 - CONFIG_CONNECTOR=y 292 - CONFIG_BLK_DEV_LOOP=y 293 - CONFIG_BLK_DEV_CRYPTOLOOP=m 294 - CONFIG_BLK_DEV_NBD=m 295 - CONFIG_BLK_DEV_RAM=y 296 - CONFIG_BLK_DEV_RAM_SIZE=65536 297 - CONFIG_CDROM_PKTCDVD=y 298 - CONFIG_RAID_ATTRS=m 299 - CONFIG_SCSI=y 300 - CONFIG_BLK_DEV_SD=y 301 - CONFIG_CHR_DEV_ST=m 302 - CONFIG_CHR_DEV_OSST=m 303 - CONFIG_BLK_DEV_SR=y 304 - CONFIG_CHR_DEV_SG=y 305 - CONFIG_CHR_DEV_SCH=m 306 - CONFIG_SCSI_CONSTANTS=y 307 - CONFIG_SCSI_LOGGING=y 308 - CONFIG_SCSI_SCAN_ASYNC=y 309 - CONFIG_SCSI_SPI_ATTRS=m 310 - CONFIG_SCSI_SAS_LIBSAS=m 311 - CONFIG_SCSI_SRP_ATTRS=m 312 - CONFIG_ISCSI_TCP=m 313 - CONFIG_SCSI_DEBUG=m 314 - CONFIG_SCSI_DH=y 315 - CONFIG_SCSI_DH_RDAC=m 316 - CONFIG_SCSI_DH_HP_SW=m 317 - CONFIG_SCSI_DH_EMC=m 318 - CONFIG_SCSI_DH_ALUA=m 319 - CONFIG_SCSI_OSD_INITIATOR=m 320 - CONFIG_SCSI_OSD_ULD=m 321 - CONFIG_NETDEVICES=y 322 - CONFIG_E1000E=y 323 - CONFIG_SKY2=y 324 - CONFIG_INPUT_EVDEV=y 325 - CONFIG_INPUT_EVBUG=m 326 - # CONFIG_INPUT_KEYBOARD is not set 327 - # CONFIG_INPUT_MOUSE is not set 328 - CONFIG_SERIO_SERPORT=m 329 - CONFIG_SERIO_LIBPS2=y 330 - CONFIG_SERIO_RAW=m 331 - CONFIG_VT_HW_CONSOLE_BINDING=y 332 - CONFIG_LEGACY_PTY_COUNT=0 333 - CONFIG_SERIAL_NONSTANDARD=y 334 - CONFIG_N_HDLC=m 335 - CONFIG_SERIAL_8250=y 336 - CONFIG_SERIAL_8250_CONSOLE=y 337 - CONFIG_SERIAL_8250_NR_UARTS=48 338 - CONFIG_SERIAL_8250_EXTENDED=y 339 - CONFIG_SERIAL_8250_MANY_PORTS=y 340 - CONFIG_SERIAL_8250_SHARE_IRQ=y 341 - CONFIG_SERIAL_8250_RSA=y 342 - CONFIG_HW_RANDOM=y 343 - CONFIG_HW_RANDOM_TIMERIOMEM=m 344 - CONFIG_RAW_DRIVER=m 345 - CONFIG_I2C=y 346 - CONFIG_I2C_XLR=y 347 - # CONFIG_HWMON is not set 348 - # CONFIG_VGA_CONSOLE is not set 349 - # CONFIG_USB_SUPPORT is not set 350 - CONFIG_RTC_CLASS=y 351 - CONFIG_RTC_DRV_DS1374=y 352 - CONFIG_UIO=y 353 - CONFIG_UIO_PDRV_GENIRQ=m 354 - CONFIG_EXT2_FS=y 355 - CONFIG_EXT2_FS_XATTR=y 356 - CONFIG_EXT2_FS_POSIX_ACL=y 357 - CONFIG_EXT2_FS_SECURITY=y 358 - CONFIG_EXT3_FS=y 359 - CONFIG_EXT3_FS_POSIX_ACL=y 360 - CONFIG_EXT3_FS_SECURITY=y 361 - CONFIG_GFS2_FS=m 362 - CONFIG_OCFS2_FS=m 363 - CONFIG_BTRFS_FS=m 364 - CONFIG_BTRFS_FS_POSIX_ACL=y 365 - CONFIG_NILFS2_FS=m 366 - CONFIG_QUOTA_NETLINK_INTERFACE=y 367 - # CONFIG_PRINT_QUOTA_WARNING is not set 368 - CONFIG_QFMT_V1=m 369 - CONFIG_QFMT_V2=m 370 - CONFIG_AUTOFS4_FS=m 371 - CONFIG_FUSE_FS=y 372 - CONFIG_CUSE=m 373 - CONFIG_FSCACHE=m 374 - CONFIG_FSCACHE_STATS=y 375 - CONFIG_FSCACHE_HISTOGRAM=y 376 - CONFIG_CACHEFILES=m 377 - CONFIG_ISO9660_FS=m 378 - CONFIG_JOLIET=y 379 - CONFIG_ZISOFS=y 380 - CONFIG_UDF_FS=m 381 - CONFIG_MSDOS_FS=m 382 - CONFIG_VFAT_FS=m 383 - CONFIG_NTFS_FS=m 384 - CONFIG_PROC_KCORE=y 385 - CONFIG_TMPFS=y 386 - CONFIG_TMPFS_POSIX_ACL=y 387 - CONFIG_CONFIGFS_FS=y 388 - CONFIG_ADFS_FS=m 389 - CONFIG_AFFS_FS=m 390 - CONFIG_ECRYPT_FS=y 391 - CONFIG_HFS_FS=m 392 - CONFIG_HFSPLUS_FS=m 393 - CONFIG_BEFS_FS=m 394 - CONFIG_BFS_FS=m 395 - CONFIG_EFS_FS=m 396 - CONFIG_CRAMFS=m 397 - CONFIG_SQUASHFS=m 398 - CONFIG_VXFS_FS=m 399 - CONFIG_MINIX_FS=m 400 - CONFIG_OMFS_FS=m 401 - CONFIG_HPFS_FS=m 402 - CONFIG_QNX4FS_FS=m 403 - CONFIG_ROMFS_FS=m 404 - CONFIG_SYSV_FS=m 405 - CONFIG_UFS_FS=m 406 - CONFIG_EXOFS_FS=m 407 - CONFIG_NFS_FS=m 408 - CONFIG_NFS_V3_ACL=y 409 - CONFIG_NFS_V4=m 410 - CONFIG_NFS_FSCACHE=y 411 - CONFIG_NFSD=m 412 - CONFIG_NFSD_V3_ACL=y 413 - CONFIG_NFSD_V4=y 414 - CONFIG_CIFS=m 415 - CONFIG_CIFS_WEAK_PW_HASH=y 416 - CONFIG_CIFS_UPCALL=y 417 - CONFIG_CIFS_XATTR=y 418 - CONFIG_CIFS_POSIX=y 419 - CONFIG_CIFS_DFS_UPCALL=y 420 - CONFIG_CODA_FS=m 421 - CONFIG_AFS_FS=m 422 - CONFIG_NLS=y 423 - CONFIG_NLS_DEFAULT="cp437" 424 - CONFIG_NLS_CODEPAGE_437=m 425 - CONFIG_NLS_CODEPAGE_737=m 426 - CONFIG_NLS_CODEPAGE_775=m 427 - CONFIG_NLS_CODEPAGE_850=m 428 - CONFIG_NLS_CODEPAGE_852=m 429 - CONFIG_NLS_CODEPAGE_855=m 430 - CONFIG_NLS_CODEPAGE_857=m 431 - CONFIG_NLS_CODEPAGE_860=m 432 - CONFIG_NLS_CODEPAGE_861=m 433 - CONFIG_NLS_CODEPAGE_862=m 434 - CONFIG_NLS_CODEPAGE_863=m 435 - CONFIG_NLS_CODEPAGE_864=m 436 - CONFIG_NLS_CODEPAGE_865=m 437 - CONFIG_NLS_CODEPAGE_866=m 438 - CONFIG_NLS_CODEPAGE_869=m 439 - CONFIG_NLS_CODEPAGE_936=m 440 - CONFIG_NLS_CODEPAGE_950=m 441 - CONFIG_NLS_CODEPAGE_932=m 442 - CONFIG_NLS_CODEPAGE_949=m 443 - CONFIG_NLS_CODEPAGE_874=m 444 - CONFIG_NLS_ISO8859_8=m 445 - CONFIG_NLS_CODEPAGE_1250=m 446 - CONFIG_NLS_CODEPAGE_1251=m 447 - CONFIG_NLS_ASCII=m 448 - CONFIG_NLS_ISO8859_1=m 449 - CONFIG_NLS_ISO8859_2=m 450 - CONFIG_NLS_ISO8859_3=m 451 - CONFIG_NLS_ISO8859_4=m 452 - CONFIG_NLS_ISO8859_5=m 453 - CONFIG_NLS_ISO8859_6=m 454 - CONFIG_NLS_ISO8859_7=m 455 - CONFIG_NLS_ISO8859_9=m 456 - CONFIG_NLS_ISO8859_13=m 457 - CONFIG_NLS_ISO8859_14=m 458 - CONFIG_NLS_ISO8859_15=m 459 - CONFIG_NLS_KOI8_R=m 460 - CONFIG_NLS_KOI8_U=m 461 - CONFIG_SECURITY=y 462 - CONFIG_LSM_MMAP_MIN_ADDR=0 463 - CONFIG_SECURITY_SELINUX=y 464 - CONFIG_SECURITY_SELINUX_BOOTPARAM=y 465 - CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0 466 - CONFIG_SECURITY_SELINUX_DISABLE=y 467 - CONFIG_SECURITY_SMACK=y 468 - CONFIG_SECURITY_TOMOYO=y 469 - CONFIG_CRYPTO_CRYPTD=m 470 - CONFIG_CRYPTO_TEST=m 471 - CONFIG_CRYPTO_GCM=m 472 - CONFIG_CRYPTO_CTS=m 473 - CONFIG_CRYPTO_LRW=m 474 - CONFIG_CRYPTO_PCBC=m 475 - CONFIG_CRYPTO_XTS=m 476 - CONFIG_CRYPTO_HMAC=y 477 - CONFIG_CRYPTO_XCBC=m 478 - CONFIG_CRYPTO_VMAC=m 479 - CONFIG_CRYPTO_MICHAEL_MIC=m 480 - CONFIG_CRYPTO_RMD128=m 481 - CONFIG_CRYPTO_RMD160=m 482 - CONFIG_CRYPTO_RMD256=m 483 - CONFIG_CRYPTO_RMD320=m 484 - CONFIG_CRYPTO_TGR192=m 485 - CONFIG_CRYPTO_WP512=m 486 - CONFIG_CRYPTO_ANUBIS=m 487 - CONFIG_CRYPTO_BLOWFISH=m 488 - CONFIG_CRYPTO_CAMELLIA=m 489 - CONFIG_CRYPTO_CAST5=m 490 - CONFIG_CRYPTO_CAST6=m 491 - CONFIG_CRYPTO_FCRYPT=m 492 - CONFIG_CRYPTO_KHAZAD=m 493 - CONFIG_CRYPTO_SALSA20=m 494 - CONFIG_CRYPTO_SEED=m 495 - CONFIG_CRYPTO_SERPENT=m 496 - CONFIG_CRYPTO_TEA=m 497 - CONFIG_CRYPTO_TWOFISH=m 498 - CONFIG_CRYPTO_LZO=m 499 - CONFIG_CRC7=m 500 - CONFIG_PRINTK_TIME=y 501 - CONFIG_DEBUG_INFO=y 502 - # CONFIG_ENABLE_MUST_CHECK is not set 503 - CONFIG_DEBUG_MEMORY_INIT=y 504 - CONFIG_DETECT_HUNG_TASK=y 505 - CONFIG_SCHEDSTATS=y 506 - CONFIG_SCHED_TRACER=y 507 - CONFIG_BLK_DEV_IO_TRACE=y 508 - CONFIG_KGDB=y
-11
arch/mips/include/asm/cop2.h
··· 22 22 #define cop2_present 1 23 23 #define cop2_lazy_restore 1 24 24 25 - #elif defined(CONFIG_CPU_XLP) 26 - 27 - extern void nlm_cop2_save(struct nlm_cop2_state *); 28 - extern void nlm_cop2_restore(struct nlm_cop2_state *); 29 - 30 - #define cop2_save(r) nlm_cop2_save(&(r)->thread.cp2) 31 - #define cop2_restore(r) nlm_cop2_restore(&(r)->thread.cp2) 32 - 33 - #define cop2_present 1 34 - #define cop2_lazy_restore 0 35 - 36 25 #elif defined(CONFIG_CPU_LOONGSON64) 37 26 38 27 #define cop2_present 1
-8
arch/mips/include/asm/cpu-type.h
··· 195 195 #ifdef CONFIG_SYS_HAS_CPU_BMIPS5000 196 196 case CPU_BMIPS5000: 197 197 #endif 198 - 199 - #ifdef CONFIG_SYS_HAS_CPU_XLP 200 - case CPU_XLP: 201 - #endif 202 - 203 - #ifdef CONFIG_SYS_HAS_CPU_XLR 204 - case CPU_XLR: 205 - #endif 206 198 break; 207 199 default: 208 200 unreachable();
+1 -1
arch/mips/include/asm/cpu.h
··· 328 328 */ 329 329 CPU_5KC, CPU_5KE, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2EF, 330 330 CPU_LOONGSON64, CPU_CAVIUM_OCTEON, CPU_CAVIUM_OCTEON_PLUS, 331 - CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_XLR, CPU_XLP, CPU_I6500, 331 + CPU_CAVIUM_OCTEON2, CPU_CAVIUM_OCTEON3, CPU_I6500, 332 332 333 333 CPU_QEMU_GENERIC, 334 334
+1 -1
arch/mips/include/asm/hazards.h
··· 160 160 161 161 #elif defined(CONFIG_MIPS_ALCHEMY) || defined(CONFIG_CPU_CAVIUM_OCTEON) || \ 162 162 defined(CONFIG_CPU_LOONGSON2EF) || defined(CONFIG_CPU_LOONGSON64) || \ 163 - defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_R5500) || defined(CONFIG_CPU_XLR) 163 + defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_R5500) 164 164 165 165 /* 166 166 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
-57
arch/mips/include/asm/mach-netlogic/cpu-feature-overrides.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2011 Netlogic Microsystems 7 - * Copyright (C) 2003 Ralf Baechle 8 - */ 9 - #ifndef __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H 10 - #define __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H 11 - 12 - #define cpu_has_4kex 1 13 - #define cpu_has_4k_cache 1 14 - #define cpu_has_watch 1 15 - #define cpu_has_mips16 0 16 - #define cpu_has_mips16e2 0 17 - #define cpu_has_counter 1 18 - #define cpu_has_divec 1 19 - #define cpu_has_vce 0 20 - #define cpu_has_cache_cdex_p 0 21 - #define cpu_has_cache_cdex_s 0 22 - #define cpu_has_prefetch 1 23 - #define cpu_has_mcheck 1 24 - #define cpu_has_ejtag 1 25 - 26 - #define cpu_has_llsc 1 27 - #define cpu_has_vtag_icache 0 28 - #define cpu_has_ic_fills_f_dc 1 29 - #define cpu_has_dsp 0 30 - #define cpu_has_dsp2 0 31 - #define cpu_has_mipsmt 0 32 - #define cpu_icache_snoops_remote_store 1 33 - 34 - #define cpu_has_64bits 1 35 - 36 - #define cpu_has_mips32r1 1 37 - #define cpu_has_mips64r1 1 38 - 39 - #define cpu_has_inclusive_pcaches 0 40 - 41 - #define cpu_dcache_line_size() 32 42 - #define cpu_icache_line_size() 32 43 - 44 - #if defined(CONFIG_CPU_XLR) 45 - #define cpu_has_userlocal 0 46 - #define cpu_has_dc_aliases 0 47 - #define cpu_has_mips32r2 0 48 - #define cpu_has_mips64r2 0 49 - #elif defined(CONFIG_CPU_XLP) 50 - #define cpu_has_userlocal 1 51 - #define cpu_has_mips32r2 1 52 - #define cpu_has_mips64r2 1 53 - #else 54 - #error "Unknown Netlogic CPU" 55 - #endif 56 - 57 - #endif /* __ASM_MACH_NETLOGIC_CPU_FEATURE_OVERRIDES_H */
-17
arch/mips/include/asm/mach-netlogic/irq.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2011 Netlogic Microsystems. 7 - */ 8 - #ifndef __ASM_NETLOGIC_IRQ_H 9 - #define __ASM_NETLOGIC_IRQ_H 10 - 11 - #include <asm/mach-netlogic/multi-node.h> 12 - #define NLM_IRQS_PER_NODE 1024 13 - #define NR_IRQS (NLM_IRQS_PER_NODE * NLM_NR_NODES) 14 - 15 - #define MIPS_CPU_IRQ_BASE 0 16 - 17 - #endif /* __ASM_NETLOGIC_IRQ_H */
-74
arch/mips/include/asm/mach-netlogic/multi-node.h
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _NETLOGIC_MULTI_NODE_H_ 36 - #define _NETLOGIC_MULTI_NODE_H_ 37 - 38 - #ifndef CONFIG_NLM_MULTINODE 39 - #define NLM_NR_NODES 1 40 - #else 41 - #if defined(CONFIG_NLM_MULTINODE_2) 42 - #define NLM_NR_NODES 2 43 - #elif defined(CONFIG_NLM_MULTINODE_4) 44 - #define NLM_NR_NODES 4 45 - #else 46 - #define NLM_NR_NODES 1 47 - #endif 48 - #endif 49 - 50 - #define NLM_THREADS_PER_CORE 4 51 - 52 - struct nlm_soc_info { 53 - unsigned long coremask; /* cores enabled on the soc */ 54 - unsigned long ebase; /* not used now */ 55 - uint64_t irqmask; /* EIMR for the node */ 56 - uint64_t sysbase; /* only for XLP - sys block base */ 57 - uint64_t picbase; /* PIC block base */ 58 - spinlock_t piclock; /* lock for PIC access */ 59 - cpumask_t cpumask; /* logical cpu mask for node */ 60 - unsigned int socbus; 61 - }; 62 - 63 - extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; 64 - #define nlm_get_node(i) (&nlm_nodes[i]) 65 - #define nlm_node_present(n) ((n) >= 0 && (n) < NLM_NR_NODES && \ 66 - nlm_get_node(n)->coremask != 0) 67 - #ifdef CONFIG_CPU_XLR 68 - #define nlm_current_node() (&nlm_nodes[0]) 69 - #else 70 - #define nlm_current_node() (&nlm_nodes[nlm_nodeid()]) 71 - #endif 72 - void nlm_node_init(int node); 73 - 74 - #endif
-132
arch/mips/include/asm/netlogic/common.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _NETLOGIC_COMMON_H_ 36 - #define _NETLOGIC_COMMON_H_ 37 - 38 - /* 39 - * Common SMP definitions 40 - */ 41 - #define RESET_VEC_PHYS 0x1fc00000 42 - #define RESET_VEC_SIZE 8192 /* 8KB reset code and data */ 43 - #define RESET_DATA_PHYS (RESET_VEC_PHYS + (1<<10)) 44 - 45 - /* Offsets of parameters in the RESET_DATA_PHYS area */ 46 - #define BOOT_THREAD_MODE 0 47 - #define BOOT_NMI_LOCK 4 48 - #define BOOT_NMI_HANDLER 8 49 - 50 - /* CPU ready flags for each CPU */ 51 - #define BOOT_CPU_READY 2048 52 - 53 - #ifndef __ASSEMBLY__ 54 - #include <linux/cpumask.h> 55 - #include <linux/spinlock.h> 56 - #include <asm/irq.h> 57 - #include <asm/mach-netlogic/multi-node.h> 58 - 59 - struct irq_desc; 60 - void nlm_smp_function_ipi_handler(struct irq_desc *desc); 61 - void nlm_smp_resched_ipi_handler(struct irq_desc *desc); 62 - void nlm_smp_irq_init(int hwcpuid); 63 - void nlm_boot_secondary_cpus(void); 64 - int nlm_wakeup_secondary_cpus(void); 65 - void nlm_rmiboot_preboot(void); 66 - void nlm_percpu_init(int hwcpuid); 67 - 68 - static inline void * 69 - nlm_get_boot_data(int offset) 70 - { 71 - return (void *)(CKSEG1ADDR(RESET_DATA_PHYS) + offset); 72 - } 73 - 74 - static inline void 75 - nlm_set_nmi_handler(void *handler) 76 - { 77 - void *nmih = nlm_get_boot_data(BOOT_NMI_HANDLER); 78 - 79 - *(int64_t *)nmih = (long)handler; 80 - } 81 - 82 - /* 83 - * Misc. 84 - */ 85 - void nlm_init_boot_cpu(void); 86 - unsigned int nlm_get_cpu_frequency(void); 87 - extern const struct plat_smp_ops nlm_smp_ops; 88 - extern char nlm_reset_entry[], nlm_reset_entry_end[]; 89 - 90 - extern unsigned int nlm_threads_per_core; 91 - extern cpumask_t nlm_cpumask; 92 - 93 - struct irq_data; 94 - uint64_t nlm_pci_irqmask(int node); 95 - void nlm_setup_pic_irq(int node, int picirq, int irq, int irt); 96 - void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *)); 97 - 98 - #ifdef CONFIG_PCI_MSI 99 - void nlm_dispatch_msi(int node, int lirq); 100 - void nlm_dispatch_msix(int node, int msixirq); 101 - #endif 102 - 103 - /* 104 - * The NR_IRQs is divided between nodes, each of them has a separate irq space 105 - */ 106 - static inline int nlm_irq_to_xirq(int node, int irq) 107 - { 108 - return node * NR_IRQS / NLM_NR_NODES + irq; 109 - } 110 - 111 - #ifdef CONFIG_CPU_XLR 112 - #define nlm_cores_per_node() 8 113 - #else 114 - static inline int nlm_cores_per_node(void) 115 - { 116 - return ((read_c0_prid() & PRID_IMP_MASK) 117 - == PRID_IMP_NETLOGIC_XLP9XX) ? 32 : 8; 118 - } 119 - #endif 120 - static inline int nlm_threads_per_node(void) 121 - { 122 - return nlm_cores_per_node() * NLM_THREADS_PER_CORE; 123 - } 124 - 125 - static inline int nlm_hwtid_to_node(int hwtid) 126 - { 127 - return hwtid / nlm_threads_per_node(); 128 - } 129 - 130 - extern int nlm_cpu_ready[]; 131 - #endif /* __ASSEMBLY__ */ 132 - #endif /* _NETLOGIC_COMMON_H_ */
-171
arch/mips/include/asm/netlogic/haldefs.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __NLM_HAL_HALDEFS_H__ 36 - #define __NLM_HAL_HALDEFS_H__ 37 - 38 - #include <linux/irqflags.h> /* for local_irq_disable */ 39 - 40 - /* 41 - * This file contains platform specific memory mapped IO implementation 42 - * and will provide a way to read 32/64 bit memory mapped registers in 43 - * all ABIs 44 - */ 45 - static inline uint32_t 46 - nlm_read_reg(uint64_t base, uint32_t reg) 47 - { 48 - volatile uint32_t *addr = (volatile uint32_t *)(long)base + reg; 49 - 50 - return *addr; 51 - } 52 - 53 - static inline void 54 - nlm_write_reg(uint64_t base, uint32_t reg, uint32_t val) 55 - { 56 - volatile uint32_t *addr = (volatile uint32_t *)(long)base + reg; 57 - 58 - *addr = val; 59 - } 60 - 61 - /* 62 - * For o32 compilation, we have to disable interrupts to access 64 bit 63 - * registers 64 - * 65 - * We need to disable interrupts because we save just the lower 32 bits of 66 - * registers in interrupt handling. So if we get hit by an interrupt while 67 - * using the upper 32 bits of a register, we lose. 68 - */ 69 - 70 - static inline uint64_t 71 - nlm_read_reg64(uint64_t base, uint32_t reg) 72 - { 73 - uint64_t addr = base + (reg >> 1) * sizeof(uint64_t); 74 - volatile uint64_t *ptr = (volatile uint64_t *)(long)addr; 75 - uint64_t val; 76 - 77 - if (sizeof(unsigned long) == 4) { 78 - unsigned long flags; 79 - 80 - local_irq_save(flags); 81 - __asm__ __volatile__( 82 - ".set push" "\n\t" 83 - ".set mips64" "\n\t" 84 - "ld %L0, %1" "\n\t" 85 - "dsra32 %M0, %L0, 0" "\n\t" 86 - "sll %L0, %L0, 0" "\n\t" 87 - ".set pop" "\n" 88 - : "=r" (val) 89 - : "m" (*ptr)); 90 - local_irq_restore(flags); 91 - } else 92 - val = *ptr; 93 - 94 - return val; 95 - } 96 - 97 - static inline void 98 - nlm_write_reg64(uint64_t base, uint32_t reg, uint64_t val) 99 - { 100 - uint64_t addr = base + (reg >> 1) * sizeof(uint64_t); 101 - volatile uint64_t *ptr = (volatile uint64_t *)(long)addr; 102 - 103 - if (sizeof(unsigned long) == 4) { 104 - unsigned long flags; 105 - uint64_t tmp; 106 - 107 - local_irq_save(flags); 108 - __asm__ __volatile__( 109 - ".set push" "\n\t" 110 - ".set mips64" "\n\t" 111 - "dsll32 %L0, %L0, 0" "\n\t" 112 - "dsrl32 %L0, %L0, 0" "\n\t" 113 - "dsll32 %M0, %M0, 0" "\n\t" 114 - "or %L0, %L0, %M0" "\n\t" 115 - "sd %L0, %2" "\n\t" 116 - ".set pop" "\n" 117 - : "=r" (tmp) 118 - : "0" (val), "m" (*ptr)); 119 - local_irq_restore(flags); 120 - } else 121 - *ptr = val; 122 - } 123 - 124 - /* 125 - * Routines to store 32/64 bit values to 64 bit addresses, 126 - * used when going thru XKPHYS to access registers 127 - */ 128 - static inline uint32_t 129 - nlm_read_reg_xkphys(uint64_t base, uint32_t reg) 130 - { 131 - return nlm_read_reg(base, reg); 132 - } 133 - 134 - static inline void 135 - nlm_write_reg_xkphys(uint64_t base, uint32_t reg, uint32_t val) 136 - { 137 - nlm_write_reg(base, reg, val); 138 - } 139 - 140 - static inline uint64_t 141 - nlm_read_reg64_xkphys(uint64_t base, uint32_t reg) 142 - { 143 - return nlm_read_reg64(base, reg); 144 - } 145 - 146 - static inline void 147 - nlm_write_reg64_xkphys(uint64_t base, uint32_t reg, uint64_t val) 148 - { 149 - nlm_write_reg64(base, reg, val); 150 - } 151 - 152 - /* Location where IO base is mapped */ 153 - extern uint64_t nlm_io_base; 154 - 155 - #if defined(CONFIG_CPU_XLP) 156 - static inline uint64_t 157 - nlm_pcicfg_base(uint32_t devoffset) 158 - { 159 - return nlm_io_base + devoffset; 160 - } 161 - 162 - #elif defined(CONFIG_CPU_XLR) 163 - 164 - static inline uint64_t 165 - nlm_mmio_base(uint32_t devoffset) 166 - { 167 - return nlm_io_base + devoffset; 168 - } 169 - #endif 170 - 171 - #endif
-45
arch/mips/include/asm/netlogic/interrupt.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NLM_INTERRUPT_H 36 - #define _ASM_NLM_INTERRUPT_H 37 - 38 - /* Defines for the IRQ numbers */ 39 - 40 - #define IRQ_IPI_SMP_FUNCTION 3 41 - #define IRQ_IPI_SMP_RESCHEDULE 4 42 - #define IRQ_FMN 5 43 - #define IRQ_TIMER 7 44 - 45 - #endif
-301
arch/mips/include/asm/netlogic/mips-extns.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NLM_MIPS_EXTS_H 36 - #define _ASM_NLM_MIPS_EXTS_H 37 - 38 - /* 39 - * XLR and XLP interrupt request and interrupt mask registers 40 - */ 41 - /* 42 - * NOTE: Do not save/restore flags around write_c0_eimr(). 43 - * On non-R2 platforms the flags has part of EIMR that is shadowed in STATUS 44 - * register. Restoring flags will overwrite the lower 8 bits of EIMR. 45 - * 46 - * Call with interrupts disabled. 47 - */ 48 - #define write_c0_eimr(val) \ 49 - do { \ 50 - if (sizeof(unsigned long) == 4) { \ 51 - __asm__ __volatile__( \ 52 - ".set\tmips64\n\t" \ 53 - "dsll\t%L0, %L0, 32\n\t" \ 54 - "dsrl\t%L0, %L0, 32\n\t" \ 55 - "dsll\t%M0, %M0, 32\n\t" \ 56 - "or\t%L0, %L0, %M0\n\t" \ 57 - "dmtc0\t%L0, $9, 7\n\t" \ 58 - ".set\tmips0" \ 59 - : : "r" (val)); \ 60 - } else \ 61 - __write_64bit_c0_register($9, 7, (val)); \ 62 - } while (0) 63 - 64 - /* 65 - * Handling the 64 bit EIMR and EIRR registers in 32-bit mode with 66 - * standard functions will be very inefficient. This provides 67 - * optimized functions for the normal operations on the registers. 68 - * 69 - * Call with interrupts disabled. 70 - */ 71 - static inline void ack_c0_eirr(int irq) 72 - { 73 - __asm__ __volatile__( 74 - ".set push\n\t" 75 - ".set mips64\n\t" 76 - ".set noat\n\t" 77 - "li $1, 1\n\t" 78 - "dsllv $1, $1, %0\n\t" 79 - "dmtc0 $1, $9, 6\n\t" 80 - ".set pop" 81 - : : "r" (irq)); 82 - } 83 - 84 - static inline void set_c0_eimr(int irq) 85 - { 86 - __asm__ __volatile__( 87 - ".set push\n\t" 88 - ".set mips64\n\t" 89 - ".set noat\n\t" 90 - "li $1, 1\n\t" 91 - "dsllv %0, $1, %0\n\t" 92 - "dmfc0 $1, $9, 7\n\t" 93 - "or $1, %0\n\t" 94 - "dmtc0 $1, $9, 7\n\t" 95 - ".set pop" 96 - : "+r" (irq)); 97 - } 98 - 99 - static inline void clear_c0_eimr(int irq) 100 - { 101 - __asm__ __volatile__( 102 - ".set push\n\t" 103 - ".set mips64\n\t" 104 - ".set noat\n\t" 105 - "li $1, 1\n\t" 106 - "dsllv %0, $1, %0\n\t" 107 - "dmfc0 $1, $9, 7\n\t" 108 - "or $1, %0\n\t" 109 - "xor $1, %0\n\t" 110 - "dmtc0 $1, $9, 7\n\t" 111 - ".set pop" 112 - : "+r" (irq)); 113 - } 114 - 115 - /* 116 - * Read c0 eimr and c0 eirr, do AND of the two values, the result is 117 - * the interrupts which are raised and are not masked. 118 - */ 119 - static inline uint64_t read_c0_eirr_and_eimr(void) 120 - { 121 - uint64_t val; 122 - 123 - #ifdef CONFIG_64BIT 124 - val = __read_64bit_c0_register($9, 6) & __read_64bit_c0_register($9, 7); 125 - #else 126 - __asm__ __volatile__( 127 - ".set push\n\t" 128 - ".set mips64\n\t" 129 - ".set noat\n\t" 130 - "dmfc0 %M0, $9, 6\n\t" 131 - "dmfc0 %L0, $9, 7\n\t" 132 - "and %M0, %L0\n\t" 133 - "dsll %L0, %M0, 32\n\t" 134 - "dsra %M0, %M0, 32\n\t" 135 - "dsra %L0, %L0, 32\n\t" 136 - ".set pop" 137 - : "=r" (val)); 138 - #endif 139 - return val; 140 - } 141 - 142 - static inline int hard_smp_processor_id(void) 143 - { 144 - return __read_32bit_c0_register($15, 1) & 0x3ff; 145 - } 146 - 147 - static inline int nlm_nodeid(void) 148 - { 149 - uint32_t prid = read_c0_prid() & PRID_IMP_MASK; 150 - 151 - if ((prid == PRID_IMP_NETLOGIC_XLP9XX) || 152 - (prid == PRID_IMP_NETLOGIC_XLP5XX)) 153 - return (__read_32bit_c0_register($15, 1) >> 7) & 0x7; 154 - else 155 - return (__read_32bit_c0_register($15, 1) >> 5) & 0x3; 156 - } 157 - 158 - static inline unsigned int nlm_core_id(void) 159 - { 160 - uint32_t prid = read_c0_prid() & PRID_IMP_MASK; 161 - 162 - if ((prid == PRID_IMP_NETLOGIC_XLP9XX) || 163 - (prid == PRID_IMP_NETLOGIC_XLP5XX)) 164 - return (read_c0_ebase() & 0x7c) >> 2; 165 - else 166 - return (read_c0_ebase() & 0x1c) >> 2; 167 - } 168 - 169 - static inline unsigned int nlm_thread_id(void) 170 - { 171 - return read_c0_ebase() & 0x3; 172 - } 173 - 174 - #define __read_64bit_c2_split(source, sel) \ 175 - ({ \ 176 - unsigned long long __val; \ 177 - unsigned long __flags; \ 178 - \ 179 - local_irq_save(__flags); \ 180 - if (sel == 0) \ 181 - __asm__ __volatile__( \ 182 - ".set\tmips64\n\t" \ 183 - "dmfc2\t%M0, " #source "\n\t" \ 184 - "dsll\t%L0, %M0, 32\n\t" \ 185 - "dsra\t%M0, %M0, 32\n\t" \ 186 - "dsra\t%L0, %L0, 32\n\t" \ 187 - ".set\tmips0\n\t" \ 188 - : "=r" (__val)); \ 189 - else \ 190 - __asm__ __volatile__( \ 191 - ".set\tmips64\n\t" \ 192 - "dmfc2\t%M0, " #source ", " #sel "\n\t" \ 193 - "dsll\t%L0, %M0, 32\n\t" \ 194 - "dsra\t%M0, %M0, 32\n\t" \ 195 - "dsra\t%L0, %L0, 32\n\t" \ 196 - ".set\tmips0\n\t" \ 197 - : "=r" (__val)); \ 198 - local_irq_restore(__flags); \ 199 - \ 200 - __val; \ 201 - }) 202 - 203 - #define __write_64bit_c2_split(source, sel, val) \ 204 - do { \ 205 - unsigned long __flags; \ 206 - \ 207 - local_irq_save(__flags); \ 208 - if (sel == 0) \ 209 - __asm__ __volatile__( \ 210 - ".set\tmips64\n\t" \ 211 - "dsll\t%L0, %L0, 32\n\t" \ 212 - "dsrl\t%L0, %L0, 32\n\t" \ 213 - "dsll\t%M0, %M0, 32\n\t" \ 214 - "or\t%L0, %L0, %M0\n\t" \ 215 - "dmtc2\t%L0, " #source "\n\t" \ 216 - ".set\tmips0\n\t" \ 217 - : : "r" (val)); \ 218 - else \ 219 - __asm__ __volatile__( \ 220 - ".set\tmips64\n\t" \ 221 - "dsll\t%L0, %L0, 32\n\t" \ 222 - "dsrl\t%L0, %L0, 32\n\t" \ 223 - "dsll\t%M0, %M0, 32\n\t" \ 224 - "or\t%L0, %L0, %M0\n\t" \ 225 - "dmtc2\t%L0, " #source ", " #sel "\n\t" \ 226 - ".set\tmips0\n\t" \ 227 - : : "r" (val)); \ 228 - local_irq_restore(__flags); \ 229 - } while (0) 230 - 231 - #define __read_32bit_c2_register(source, sel) \ 232 - ({ uint32_t __res; \ 233 - if (sel == 0) \ 234 - __asm__ __volatile__( \ 235 - ".set\tmips32\n\t" \ 236 - "mfc2\t%0, " #source "\n\t" \ 237 - ".set\tmips0\n\t" \ 238 - : "=r" (__res)); \ 239 - else \ 240 - __asm__ __volatile__( \ 241 - ".set\tmips32\n\t" \ 242 - "mfc2\t%0, " #source ", " #sel "\n\t" \ 243 - ".set\tmips0\n\t" \ 244 - : "=r" (__res)); \ 245 - __res; \ 246 - }) 247 - 248 - #define __read_64bit_c2_register(source, sel) \ 249 - ({ unsigned long long __res; \ 250 - if (sizeof(unsigned long) == 4) \ 251 - __res = __read_64bit_c2_split(source, sel); \ 252 - else if (sel == 0) \ 253 - __asm__ __volatile__( \ 254 - ".set\tmips64\n\t" \ 255 - "dmfc2\t%0, " #source "\n\t" \ 256 - ".set\tmips0\n\t" \ 257 - : "=r" (__res)); \ 258 - else \ 259 - __asm__ __volatile__( \ 260 - ".set\tmips64\n\t" \ 261 - "dmfc2\t%0, " #source ", " #sel "\n\t" \ 262 - ".set\tmips0\n\t" \ 263 - : "=r" (__res)); \ 264 - __res; \ 265 - }) 266 - 267 - #define __write_64bit_c2_register(register, sel, value) \ 268 - do { \ 269 - if (sizeof(unsigned long) == 4) \ 270 - __write_64bit_c2_split(register, sel, value); \ 271 - else if (sel == 0) \ 272 - __asm__ __volatile__( \ 273 - ".set\tmips64\n\t" \ 274 - "dmtc2\t%z0, " #register "\n\t" \ 275 - ".set\tmips0\n\t" \ 276 - : : "Jr" (value)); \ 277 - else \ 278 - __asm__ __volatile__( \ 279 - ".set\tmips64\n\t" \ 280 - "dmtc2\t%z0, " #register ", " #sel "\n\t" \ 281 - ".set\tmips0\n\t" \ 282 - : : "Jr" (value)); \ 283 - } while (0) 284 - 285 - #define __write_32bit_c2_register(reg, sel, value) \ 286 - ({ \ 287 - if (sel == 0) \ 288 - __asm__ __volatile__( \ 289 - ".set\tmips32\n\t" \ 290 - "mtc2\t%z0, " #reg "\n\t" \ 291 - ".set\tmips0\n\t" \ 292 - : : "Jr" (value)); \ 293 - else \ 294 - __asm__ __volatile__( \ 295 - ".set\tmips32\n\t" \ 296 - "mtc2\t%z0, " #reg ", " #sel "\n\t" \ 297 - ".set\tmips0\n\t" \ 298 - : : "Jr" (value)); \ 299 - }) 300 - 301 - #endif /*_ASM_NLM_MIPS_EXTS_H */
-95
arch/mips/include/asm/netlogic/psb-bootinfo.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NETLOGIC_BOOTINFO_H 36 - #define _ASM_NETLOGIC_BOOTINFO_H 37 - 38 - struct psb_info { 39 - uint64_t boot_level; 40 - uint64_t io_base; 41 - uint64_t output_device; 42 - uint64_t uart_print; 43 - uint64_t led_output; 44 - uint64_t init; 45 - uint64_t exit; 46 - uint64_t warm_reset; 47 - uint64_t wakeup; 48 - uint64_t online_cpu_map; 49 - uint64_t master_reentry_sp; 50 - uint64_t master_reentry_gp; 51 - uint64_t master_reentry_fn; 52 - uint64_t slave_reentry_fn; 53 - uint64_t magic_dword; 54 - uint64_t uart_putchar; 55 - uint64_t size; 56 - uint64_t uart_getchar; 57 - uint64_t nmi_handler; 58 - uint64_t psb_version; 59 - uint64_t mac_addr; 60 - uint64_t cpu_frequency; 61 - uint64_t board_version; 62 - uint64_t malloc; 63 - uint64_t free; 64 - uint64_t global_shmem_addr; 65 - uint64_t global_shmem_size; 66 - uint64_t psb_os_cpu_map; 67 - uint64_t userapp_cpu_map; 68 - uint64_t wakeup_os; 69 - uint64_t psb_mem_map; 70 - uint64_t board_major_version; 71 - uint64_t board_minor_version; 72 - uint64_t board_manf_revision; 73 - uint64_t board_serial_number; 74 - uint64_t psb_physaddr_map; 75 - uint64_t xlr_loaderip_config; 76 - uint64_t bldr_envp; 77 - uint64_t avail_mem_map; 78 - }; 79 - 80 - /* This is what netlboot passes and linux boot_mem_map is subtly different */ 81 - #define NLM_BOOT_MEM_MAP_MAX 32 82 - struct nlm_boot_mem_map { 83 - int nr_map; 84 - struct nlm_boot_mem_map_entry { 85 - uint64_t addr; /* start of memory segment */ 86 - uint64_t size; /* size of memory segment */ 87 - uint32_t type; /* type of memory segment */ 88 - } map[NLM_BOOT_MEM_MAP_MAX]; 89 - }; 90 - #define NLM_BOOT_MEM_RAM 1 91 - 92 - /* Pointer to saved boot loader info */ 93 - extern struct psb_info nlm_prom_info; 94 - 95 - #endif
-186
arch/mips/include/asm/netlogic/xlp-hal/bridge.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __NLM_HAL_BRIDGE_H__ 36 - #define __NLM_HAL_BRIDGE_H__ 37 - 38 - /** 39 - * @file_name mio.h 40 - * @author Netlogic Microsystems 41 - * @brief Basic definitions of XLP memory and io subsystem 42 - */ 43 - 44 - /* 45 - * BRIDGE specific registers 46 - * 47 - * These registers start after the PCIe header, which has 0x40 48 - * standard entries 49 - */ 50 - #define BRIDGE_MODE 0x00 51 - #define BRIDGE_PCI_CFG_BASE 0x01 52 - #define BRIDGE_PCI_CFG_LIMIT 0x02 53 - #define BRIDGE_PCIE_CFG_BASE 0x03 54 - #define BRIDGE_PCIE_CFG_LIMIT 0x04 55 - #define BRIDGE_BUSNUM_BAR0 0x05 56 - #define BRIDGE_BUSNUM_BAR1 0x06 57 - #define BRIDGE_BUSNUM_BAR2 0x07 58 - #define BRIDGE_BUSNUM_BAR3 0x08 59 - #define BRIDGE_BUSNUM_BAR4 0x09 60 - #define BRIDGE_BUSNUM_BAR5 0x0a 61 - #define BRIDGE_BUSNUM_BAR6 0x0b 62 - #define BRIDGE_FLASH_BAR0 0x0c 63 - #define BRIDGE_FLASH_BAR1 0x0d 64 - #define BRIDGE_FLASH_BAR2 0x0e 65 - #define BRIDGE_FLASH_BAR3 0x0f 66 - #define BRIDGE_FLASH_LIMIT0 0x10 67 - #define BRIDGE_FLASH_LIMIT1 0x11 68 - #define BRIDGE_FLASH_LIMIT2 0x12 69 - #define BRIDGE_FLASH_LIMIT3 0x13 70 - 71 - #define BRIDGE_DRAM_BAR(i) (0x14 + (i)) 72 - #define BRIDGE_DRAM_LIMIT(i) (0x1c + (i)) 73 - #define BRIDGE_DRAM_NODE_TRANSLN(i) (0x24 + (i)) 74 - #define BRIDGE_DRAM_CHNL_TRANSLN(i) (0x2c + (i)) 75 - 76 - #define BRIDGE_PCIEMEM_BASE0 0x34 77 - #define BRIDGE_PCIEMEM_BASE1 0x35 78 - #define BRIDGE_PCIEMEM_BASE2 0x36 79 - #define BRIDGE_PCIEMEM_BASE3 0x37 80 - #define BRIDGE_PCIEMEM_LIMIT0 0x38 81 - #define BRIDGE_PCIEMEM_LIMIT1 0x39 82 - #define BRIDGE_PCIEMEM_LIMIT2 0x3a 83 - #define BRIDGE_PCIEMEM_LIMIT3 0x3b 84 - #define BRIDGE_PCIEIO_BASE0 0x3c 85 - #define BRIDGE_PCIEIO_BASE1 0x3d 86 - #define BRIDGE_PCIEIO_BASE2 0x3e 87 - #define BRIDGE_PCIEIO_BASE3 0x3f 88 - #define BRIDGE_PCIEIO_LIMIT0 0x40 89 - #define BRIDGE_PCIEIO_LIMIT1 0x41 90 - #define BRIDGE_PCIEIO_LIMIT2 0x42 91 - #define BRIDGE_PCIEIO_LIMIT3 0x43 92 - #define BRIDGE_PCIEMEM_BASE4 0x44 93 - #define BRIDGE_PCIEMEM_BASE5 0x45 94 - #define BRIDGE_PCIEMEM_BASE6 0x46 95 - #define BRIDGE_PCIEMEM_LIMIT4 0x47 96 - #define BRIDGE_PCIEMEM_LIMIT5 0x48 97 - #define BRIDGE_PCIEMEM_LIMIT6 0x49 98 - #define BRIDGE_PCIEIO_BASE4 0x4a 99 - #define BRIDGE_PCIEIO_BASE5 0x4b 100 - #define BRIDGE_PCIEIO_BASE6 0x4c 101 - #define BRIDGE_PCIEIO_LIMIT4 0x4d 102 - #define BRIDGE_PCIEIO_LIMIT5 0x4e 103 - #define BRIDGE_PCIEIO_LIMIT6 0x4f 104 - #define BRIDGE_NBU_EVENT_CNT_CTL 0x50 105 - #define BRIDGE_EVNTCTR1_LOW 0x51 106 - #define BRIDGE_EVNTCTR1_HI 0x52 107 - #define BRIDGE_EVNT_CNT_CTL2 0x53 108 - #define BRIDGE_EVNTCTR2_LOW 0x54 109 - #define BRIDGE_EVNTCTR2_HI 0x55 110 - #define BRIDGE_TRACEBUF_MATCH0 0x56 111 - #define BRIDGE_TRACEBUF_MATCH1 0x57 112 - #define BRIDGE_TRACEBUF_MATCH_LOW 0x58 113 - #define BRIDGE_TRACEBUF_MATCH_HI 0x59 114 - #define BRIDGE_TRACEBUF_CTRL 0x5a 115 - #define BRIDGE_TRACEBUF_INIT 0x5b 116 - #define BRIDGE_TRACEBUF_ACCESS 0x5c 117 - #define BRIDGE_TRACEBUF_READ_DATA0 0x5d 118 - #define BRIDGE_TRACEBUF_READ_DATA1 0x5d 119 - #define BRIDGE_TRACEBUF_READ_DATA2 0x5f 120 - #define BRIDGE_TRACEBUF_READ_DATA3 0x60 121 - #define BRIDGE_TRACEBUF_STATUS 0x61 122 - #define BRIDGE_ADDRESS_ERROR0 0x62 123 - #define BRIDGE_ADDRESS_ERROR1 0x63 124 - #define BRIDGE_ADDRESS_ERROR2 0x64 125 - #define BRIDGE_TAG_ECC_ADDR_ERROR0 0x65 126 - #define BRIDGE_TAG_ECC_ADDR_ERROR1 0x66 127 - #define BRIDGE_TAG_ECC_ADDR_ERROR2 0x67 128 - #define BRIDGE_LINE_FLUSH0 0x68 129 - #define BRIDGE_LINE_FLUSH1 0x69 130 - #define BRIDGE_NODE_ID 0x6a 131 - #define BRIDGE_ERROR_INTERRUPT_EN 0x6b 132 - #define BRIDGE_PCIE0_WEIGHT 0x2c0 133 - #define BRIDGE_PCIE1_WEIGHT 0x2c1 134 - #define BRIDGE_PCIE2_WEIGHT 0x2c2 135 - #define BRIDGE_PCIE3_WEIGHT 0x2c3 136 - #define BRIDGE_USB_WEIGHT 0x2c4 137 - #define BRIDGE_NET_WEIGHT 0x2c5 138 - #define BRIDGE_POE_WEIGHT 0x2c6 139 - #define BRIDGE_CMS_WEIGHT 0x2c7 140 - #define BRIDGE_DMAENG_WEIGHT 0x2c8 141 - #define BRIDGE_SEC_WEIGHT 0x2c9 142 - #define BRIDGE_COMP_WEIGHT 0x2ca 143 - #define BRIDGE_GIO_WEIGHT 0x2cb 144 - #define BRIDGE_FLASH_WEIGHT 0x2cc 145 - 146 - /* FIXME verify */ 147 - #define BRIDGE_9XX_FLASH_BAR(i) (0x11 + (i)) 148 - #define BRIDGE_9XX_FLASH_BAR_LIMIT(i) (0x15 + (i)) 149 - 150 - #define BRIDGE_9XX_DRAM_BAR(i) (0x19 + (i)) 151 - #define BRIDGE_9XX_DRAM_LIMIT(i) (0x29 + (i)) 152 - #define BRIDGE_9XX_DRAM_NODE_TRANSLN(i) (0x39 + (i)) 153 - #define BRIDGE_9XX_DRAM_CHNL_TRANSLN(i) (0x49 + (i)) 154 - 155 - #define BRIDGE_9XX_ADDRESS_ERROR0 0x9d 156 - #define BRIDGE_9XX_ADDRESS_ERROR1 0x9e 157 - #define BRIDGE_9XX_ADDRESS_ERROR2 0x9f 158 - 159 - #define BRIDGE_9XX_PCIEMEM_BASE0 0x59 160 - #define BRIDGE_9XX_PCIEMEM_BASE1 0x5a 161 - #define BRIDGE_9XX_PCIEMEM_BASE2 0x5b 162 - #define BRIDGE_9XX_PCIEMEM_BASE3 0x5c 163 - #define BRIDGE_9XX_PCIEMEM_LIMIT0 0x5d 164 - #define BRIDGE_9XX_PCIEMEM_LIMIT1 0x5e 165 - #define BRIDGE_9XX_PCIEMEM_LIMIT2 0x5f 166 - #define BRIDGE_9XX_PCIEMEM_LIMIT3 0x60 167 - #define BRIDGE_9XX_PCIEIO_BASE0 0x61 168 - #define BRIDGE_9XX_PCIEIO_BASE1 0x62 169 - #define BRIDGE_9XX_PCIEIO_BASE2 0x63 170 - #define BRIDGE_9XX_PCIEIO_BASE3 0x64 171 - #define BRIDGE_9XX_PCIEIO_LIMIT0 0x65 172 - #define BRIDGE_9XX_PCIEIO_LIMIT1 0x66 173 - #define BRIDGE_9XX_PCIEIO_LIMIT2 0x67 174 - #define BRIDGE_9XX_PCIEIO_LIMIT3 0x68 175 - 176 - #ifndef __ASSEMBLY__ 177 - 178 - #define nlm_read_bridge_reg(b, r) nlm_read_reg(b, r) 179 - #define nlm_write_bridge_reg(b, r, v) nlm_write_reg(b, r, v) 180 - #define nlm_get_bridge_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \ 181 - XLP9XX_IO_BRIDGE_OFFSET(node) : XLP_IO_BRIDGE_OFFSET(node)) 182 - #define nlm_get_bridge_regbase(node) \ 183 - (nlm_get_bridge_pcibase(node) + XLP_IO_PCI_HDRSZ) 184 - 185 - #endif /* __ASSEMBLY__ */ 186 - #endif /* __NLM_HAL_BRIDGE_H__ */
-89
arch/mips/include/asm/netlogic/xlp-hal/cpucontrol.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __NLM_HAL_CPUCONTROL_H__ 36 - #define __NLM_HAL_CPUCONTROL_H__ 37 - 38 - #define CPU_BLOCKID_IFU 0 39 - #define CPU_BLOCKID_ICU 1 40 - #define CPU_BLOCKID_IEU 2 41 - #define CPU_BLOCKID_LSU 3 42 - #define CPU_BLOCKID_MMU 4 43 - #define CPU_BLOCKID_PRF 5 44 - #define CPU_BLOCKID_SCH 7 45 - #define CPU_BLOCKID_SCU 8 46 - #define CPU_BLOCKID_FPU 9 47 - #define CPU_BLOCKID_MAP 10 48 - 49 - #define IFU_BRUB_RESERVE 0x007 50 - 51 - #define ICU_DEFEATURE 0x100 52 - 53 - #define LSU_DEFEATURE 0x304 54 - #define LSU_DEBUG_ADDR 0x305 55 - #define LSU_DEBUG_DATA0 0x306 56 - #define LSU_CERRLOG_REGID 0x309 57 - #define SCHED_DEFEATURE 0x700 58 - 59 - /* Offsets of interest from the 'MAP' Block */ 60 - #define MAP_THREADMODE 0x00 61 - #define MAP_EXT_EBASE_ENABLE 0x04 62 - #define MAP_CCDI_CONFIG 0x08 63 - #define MAP_THRD0_CCDI_STATUS 0x0c 64 - #define MAP_THRD1_CCDI_STATUS 0x10 65 - #define MAP_THRD2_CCDI_STATUS 0x14 66 - #define MAP_THRD3_CCDI_STATUS 0x18 67 - #define MAP_THRD0_DEBUG_MODE 0x1c 68 - #define MAP_THRD1_DEBUG_MODE 0x20 69 - #define MAP_THRD2_DEBUG_MODE 0x24 70 - #define MAP_THRD3_DEBUG_MODE 0x28 71 - #define MAP_MISC_STATE 0x60 72 - #define MAP_DEBUG_READ_CTL 0x64 73 - #define MAP_DEBUG_READ_REG0 0x68 74 - #define MAP_DEBUG_READ_REG1 0x6c 75 - 76 - #define MMU_SETUP 0x400 77 - #define MMU_LFSRSEED 0x401 78 - #define MMU_HPW_NUM_PAGE_LVL 0x410 79 - #define MMU_PGWKR_PGDBASE 0x411 80 - #define MMU_PGWKR_PGDSHFT 0x412 81 - #define MMU_PGWKR_PGDMASK 0x413 82 - #define MMU_PGWKR_PUDSHFT 0x414 83 - #define MMU_PGWKR_PUDMASK 0x415 84 - #define MMU_PGWKR_PMDSHFT 0x416 85 - #define MMU_PGWKR_PMDMASK 0x417 86 - #define MMU_PGWKR_PTESHFT 0x418 87 - #define MMU_PGWKR_PTEMASK 0x419 88 - 89 - #endif /* __NLM_CPUCONTROL_H__ */
-214
arch/mips/include/asm/netlogic/xlp-hal/iomap.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __NLM_HAL_IOMAP_H__ 36 - #define __NLM_HAL_IOMAP_H__ 37 - 38 - #define XLP_DEFAULT_IO_BASE 0x18000000 39 - #define XLP_DEFAULT_PCI_ECFG_BASE XLP_DEFAULT_IO_BASE 40 - #define XLP_DEFAULT_PCI_CFG_BASE 0x1c000000 41 - 42 - #define NMI_BASE 0xbfc00000 43 - #define XLP_IO_CLK 133333333 44 - 45 - #define XLP_PCIE_CFG_SIZE 0x1000 /* 4K */ 46 - #define XLP_PCIE_DEV_BLK_SIZE (8 * XLP_PCIE_CFG_SIZE) 47 - #define XLP_PCIE_BUS_BLK_SIZE (256 * XLP_PCIE_DEV_BLK_SIZE) 48 - #define XLP_IO_SIZE (64 << 20) /* ECFG space size */ 49 - #define XLP_IO_PCI_HDRSZ 0x100 50 - #define XLP_IO_DEV(node, dev) ((dev) + (node) * 8) 51 - #define XLP_IO_PCI_OFFSET(b, d, f) (((b) << 20) | ((d) << 15) | ((f) << 12)) 52 - 53 - #define XLP_HDR_OFFSET(node, bus, dev, fn) \ 54 - XLP_IO_PCI_OFFSET(bus, XLP_IO_DEV(node, dev), fn) 55 - 56 - #define XLP_IO_BRIDGE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 0) 57 - /* coherent inter chip */ 58 - #define XLP_IO_CIC0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 1) 59 - #define XLP_IO_CIC1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 2) 60 - #define XLP_IO_CIC2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 3) 61 - #define XLP_IO_PIC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 0, 4) 62 - 63 - #define XLP_IO_PCIE_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 1, i) 64 - #define XLP_IO_PCIE0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 0) 65 - #define XLP_IO_PCIE1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 1) 66 - #define XLP_IO_PCIE2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 2) 67 - #define XLP_IO_PCIE3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 1, 3) 68 - 69 - #define XLP_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 2, i) 70 - #define XLP_IO_USB_EHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 0) 71 - #define XLP_IO_USB_OHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 1) 72 - #define XLP_IO_USB_OHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 2) 73 - #define XLP_IO_USB_EHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 3) 74 - #define XLP_IO_USB_OHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 4) 75 - #define XLP_IO_USB_OHCI3_OFFSET(node) XLP_HDR_OFFSET(node, 0, 2, 5) 76 - 77 - #define XLP_IO_SATA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 2) 78 - 79 - /* XLP2xx has an updated USB block */ 80 - #define XLP2XX_IO_USB_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 4, i) 81 - #define XLP2XX_IO_USB_XHCI0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 1) 82 - #define XLP2XX_IO_USB_XHCI1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 2) 83 - #define XLP2XX_IO_USB_XHCI2_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 3) 84 - 85 - #define XLP_IO_NAE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 0) 86 - #define XLP_IO_POE_OFFSET(node) XLP_HDR_OFFSET(node, 0, 3, 1) 87 - 88 - #define XLP_IO_CMS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 4, 0) 89 - 90 - #define XLP_IO_DMA_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 1) 91 - #define XLP_IO_SEC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 2) 92 - #define XLP_IO_CMP_OFFSET(node) XLP_HDR_OFFSET(node, 0, 5, 3) 93 - 94 - #define XLP_IO_UART_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, i) 95 - #define XLP_IO_UART0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 0) 96 - #define XLP_IO_UART1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 1) 97 - #define XLP_IO_I2C_OFFSET(node, i) XLP_HDR_OFFSET(node, 0, 6, 2 + i) 98 - #define XLP_IO_I2C0_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 2) 99 - #define XLP_IO_I2C1_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 3) 100 - #define XLP_IO_GPIO_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 4) 101 - /* on 2XX, all I2C busses are on the same block */ 102 - #define XLP2XX_IO_I2C_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 7) 103 - 104 - /* system management */ 105 - #define XLP_IO_SYS_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 5) 106 - #define XLP_IO_JTAG_OFFSET(node) XLP_HDR_OFFSET(node, 0, 6, 6) 107 - 108 - /* Flash */ 109 - #define XLP_IO_NOR_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 0) 110 - #define XLP_IO_NAND_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 1) 111 - #define XLP_IO_SPI_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 2) 112 - #define XLP_IO_MMC_OFFSET(node) XLP_HDR_OFFSET(node, 0, 7, 3) 113 - 114 - /* Things have changed drastically in XLP 9XX */ 115 - #define XLP9XX_HDR_OFFSET(n, d, f) \ 116 - XLP_IO_PCI_OFFSET(xlp9xx_get_socbus(n), d, f) 117 - 118 - #define XLP9XX_IO_BRIDGE_OFFSET(node) XLP_IO_PCI_OFFSET(0, 0, node) 119 - #define XLP9XX_IO_PIC_OFFSET(node) XLP9XX_HDR_OFFSET(node, 2, 0) 120 - #define XLP9XX_IO_UART_OFFSET(node) XLP9XX_HDR_OFFSET(node, 2, 2) 121 - #define XLP9XX_IO_SYS_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 0) 122 - #define XLP9XX_IO_FUSE_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 1) 123 - #define XLP9XX_IO_CLOCK_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 2) 124 - #define XLP9XX_IO_POWER_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 3) 125 - #define XLP9XX_IO_JTAG_OFFSET(node) XLP9XX_HDR_OFFSET(node, 6, 4) 126 - 127 - #define XLP9XX_IO_PCIE_OFFSET(node, i) XLP9XX_HDR_OFFSET(node, 1, i) 128 - #define XLP9XX_IO_PCIE0_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 0) 129 - #define XLP9XX_IO_PCIE2_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 2) 130 - #define XLP9XX_IO_PCIE3_OFFSET(node) XLP9XX_HDR_OFFSET(node, 1, 3) 131 - 132 - /* XLP9xx USB block */ 133 - #define XLP9XX_IO_USB_OFFSET(node, i) XLP9XX_HDR_OFFSET(node, 4, i) 134 - #define XLP9XX_IO_USB_XHCI0_OFFSET(node) XLP9XX_HDR_OFFSET(node, 4, 1) 135 - #define XLP9XX_IO_USB_XHCI1_OFFSET(node) XLP9XX_HDR_OFFSET(node, 4, 2) 136 - 137 - /* XLP9XX on-chip SATA controller */ 138 - #define XLP9XX_IO_SATA_OFFSET(node) XLP9XX_HDR_OFFSET(node, 3, 2) 139 - 140 - /* Flash */ 141 - #define XLP9XX_IO_NOR_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 0) 142 - #define XLP9XX_IO_NAND_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 1) 143 - #define XLP9XX_IO_SPI_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 2) 144 - #define XLP9XX_IO_MMC_OFFSET(node) XLP9XX_HDR_OFFSET(node, 7, 3) 145 - 146 - /* PCI config header register id's */ 147 - #define XLP_PCI_CFGREG0 0x00 148 - #define XLP_PCI_CFGREG1 0x01 149 - #define XLP_PCI_CFGREG2 0x02 150 - #define XLP_PCI_CFGREG3 0x03 151 - #define XLP_PCI_CFGREG4 0x04 152 - #define XLP_PCI_CFGREG5 0x05 153 - #define XLP_PCI_DEVINFO_REG0 0x30 154 - #define XLP_PCI_DEVINFO_REG1 0x31 155 - #define XLP_PCI_DEVINFO_REG2 0x32 156 - #define XLP_PCI_DEVINFO_REG3 0x33 157 - #define XLP_PCI_DEVINFO_REG4 0x34 158 - #define XLP_PCI_DEVINFO_REG5 0x35 159 - #define XLP_PCI_DEVINFO_REG6 0x36 160 - #define XLP_PCI_DEVINFO_REG7 0x37 161 - #define XLP_PCI_DEVSCRATCH_REG0 0x38 162 - #define XLP_PCI_DEVSCRATCH_REG1 0x39 163 - #define XLP_PCI_DEVSCRATCH_REG2 0x3a 164 - #define XLP_PCI_DEVSCRATCH_REG3 0x3b 165 - #define XLP_PCI_MSGSTN_REG 0x3c 166 - #define XLP_PCI_IRTINFO_REG 0x3d 167 - #define XLP_PCI_UCODEINFO_REG 0x3e 168 - #define XLP_PCI_SBB_WT_REG 0x3f 169 - 170 - /* PCI IDs for SoC device */ 171 - #define PCI_VENDOR_NETLOGIC 0x184e 172 - 173 - #define PCI_DEVICE_ID_NLM_ROOT 0x1001 174 - #define PCI_DEVICE_ID_NLM_ICI 0x1002 175 - #define PCI_DEVICE_ID_NLM_PIC 0x1003 176 - #define PCI_DEVICE_ID_NLM_PCIE 0x1004 177 - #define PCI_DEVICE_ID_NLM_EHCI 0x1007 178 - #define PCI_DEVICE_ID_NLM_OHCI 0x1008 179 - #define PCI_DEVICE_ID_NLM_NAE 0x1009 180 - #define PCI_DEVICE_ID_NLM_POE 0x100A 181 - #define PCI_DEVICE_ID_NLM_FMN 0x100B 182 - #define PCI_DEVICE_ID_NLM_RAID 0x100D 183 - #define PCI_DEVICE_ID_NLM_SAE 0x100D 184 - #define PCI_DEVICE_ID_NLM_RSA 0x100E 185 - #define PCI_DEVICE_ID_NLM_CMP 0x100F 186 - #define PCI_DEVICE_ID_NLM_UART 0x1010 187 - #define PCI_DEVICE_ID_NLM_I2C 0x1011 188 - #define PCI_DEVICE_ID_NLM_NOR 0x1015 189 - #define PCI_DEVICE_ID_NLM_NAND 0x1016 190 - #define PCI_DEVICE_ID_NLM_MMC 0x1018 191 - #define PCI_DEVICE_ID_NLM_SATA 0x101A 192 - #define PCI_DEVICE_ID_NLM_XHCI 0x101D 193 - 194 - #define PCI_DEVICE_ID_XLP9XX_MMC 0x9018 195 - #define PCI_DEVICE_ID_XLP9XX_SATA 0x901A 196 - #define PCI_DEVICE_ID_XLP9XX_XHCI 0x901D 197 - 198 - #ifndef __ASSEMBLY__ 199 - 200 - #define nlm_read_pci_reg(b, r) nlm_read_reg(b, r) 201 - #define nlm_write_pci_reg(b, r, v) nlm_write_reg(b, r, v) 202 - 203 - static inline int xlp9xx_get_socbus(int node) 204 - { 205 - uint64_t socbridge; 206 - 207 - if (node == 0) 208 - return 1; 209 - socbridge = nlm_pcicfg_base(XLP9XX_IO_BRIDGE_OFFSET(node)); 210 - return (nlm_read_pci_reg(socbridge, 0x6) >> 8) & 0xff; 211 - } 212 - #endif /* !__ASSEMBLY */ 213 - 214 - #endif /* __NLM_HAL_IOMAP_H__ */
-113
arch/mips/include/asm/netlogic/xlp-hal/pcibus.h
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __NLM_HAL_PCIBUS_H__ 36 - #define __NLM_HAL_PCIBUS_H__ 37 - 38 - /* PCIE Memory and IO regions */ 39 - #define PCIE_MEM_BASE 0xd0000000ULL 40 - #define PCIE_MEM_LIMIT 0xdfffffffULL 41 - #define PCIE_IO_BASE 0x14000000ULL 42 - #define PCIE_IO_LIMIT 0x15ffffffULL 43 - 44 - #define PCIE_BRIDGE_CMD 0x1 45 - #define PCIE_BRIDGE_MSI_CAP 0x14 46 - #define PCIE_BRIDGE_MSI_ADDRL 0x15 47 - #define PCIE_BRIDGE_MSI_ADDRH 0x16 48 - #define PCIE_BRIDGE_MSI_DATA 0x17 49 - 50 - /* XLP Global PCIE configuration space registers */ 51 - #define PCIE_BYTE_SWAP_MEM_BASE 0x247 52 - #define PCIE_BYTE_SWAP_MEM_LIM 0x248 53 - #define PCIE_BYTE_SWAP_IO_BASE 0x249 54 - #define PCIE_BYTE_SWAP_IO_LIM 0x24A 55 - 56 - #define PCIE_BRIDGE_MSIX_ADDR_BASE 0x24F 57 - #define PCIE_BRIDGE_MSIX_ADDR_LIMIT 0x250 58 - #define PCIE_MSI_STATUS 0x25A 59 - #define PCIE_MSI_EN 0x25B 60 - #define PCIE_MSIX_STATUS 0x25D 61 - #define PCIE_INT_STATUS0 0x25F 62 - #define PCIE_INT_STATUS1 0x260 63 - #define PCIE_INT_EN0 0x261 64 - #define PCIE_INT_EN1 0x262 65 - 66 - /* XLP9XX has basic changes */ 67 - #define PCIE_9XX_BYTE_SWAP_MEM_BASE 0x25c 68 - #define PCIE_9XX_BYTE_SWAP_MEM_LIM 0x25d 69 - #define PCIE_9XX_BYTE_SWAP_IO_BASE 0x25e 70 - #define PCIE_9XX_BYTE_SWAP_IO_LIM 0x25f 71 - 72 - #define PCIE_9XX_BRIDGE_MSIX_ADDR_BASE 0x264 73 - #define PCIE_9XX_BRIDGE_MSIX_ADDR_LIMIT 0x265 74 - #define PCIE_9XX_MSI_STATUS 0x283 75 - #define PCIE_9XX_MSI_EN 0x284 76 - /* 128 MSIX vectors available in 9xx */ 77 - #define PCIE_9XX_MSIX_STATUS0 0x286 78 - #define PCIE_9XX_MSIX_STATUSX(n) (n + 0x286) 79 - #define PCIE_9XX_MSIX_VEC 0x296 80 - #define PCIE_9XX_MSIX_VECX(n) (n + 0x296) 81 - #define PCIE_9XX_INT_STATUS0 0x397 82 - #define PCIE_9XX_INT_STATUS1 0x398 83 - #define PCIE_9XX_INT_EN0 0x399 84 - #define PCIE_9XX_INT_EN1 0x39a 85 - 86 - /* other */ 87 - #define PCIE_NLINKS 4 88 - 89 - /* MSI addresses */ 90 - #define MSI_ADDR_BASE 0xfffee00000ULL 91 - #define MSI_ADDR_SZ 0x10000 92 - #define MSI_LINK_ADDR(n, l) (MSI_ADDR_BASE + \ 93 - (PCIE_NLINKS * (n) + (l)) * MSI_ADDR_SZ) 94 - #define MSIX_ADDR_BASE 0xfffef00000ULL 95 - #define MSIX_LINK_ADDR(n, l) (MSIX_ADDR_BASE + \ 96 - (PCIE_NLINKS * (n) + (l)) * MSI_ADDR_SZ) 97 - #ifndef __ASSEMBLY__ 98 - 99 - #define nlm_read_pcie_reg(b, r) nlm_read_reg(b, r) 100 - #define nlm_write_pcie_reg(b, r, v) nlm_write_reg(b, r, v) 101 - #define nlm_get_pcie_base(node, inst) nlm_pcicfg_base(cpu_is_xlp9xx() ? \ 102 - XLP9XX_IO_PCIE_OFFSET(node, inst) : XLP_IO_PCIE_OFFSET(node, inst)) 103 - 104 - #ifdef CONFIG_PCI_MSI 105 - void xlp_init_node_msi_irqs(int node, int link); 106 - #else 107 - static inline void xlp_init_node_msi_irqs(int node, int link) {} 108 - #endif 109 - 110 - struct pci_dev *xlp_get_pcie_link(const struct pci_dev *dev); 111 - 112 - #endif 113 - #endif /* __NLM_HAL_PCIBUS_H__ */
-366
arch/mips/include/asm/netlogic/xlp-hal/pic.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _NLM_HAL_PIC_H 36 - #define _NLM_HAL_PIC_H 37 - 38 - /* PIC Specific registers */ 39 - #define PIC_CTRL 0x00 40 - 41 - /* PIC control register defines */ 42 - #define PIC_CTRL_ITV 32 /* interrupt timeout value */ 43 - #define PIC_CTRL_ICI 19 /* ICI interrupt timeout enable */ 44 - #define PIC_CTRL_ITE 18 /* interrupt timeout enable */ 45 - #define PIC_CTRL_STE 10 /* system timer interrupt enable */ 46 - #define PIC_CTRL_WWR1 8 /* watchdog 1 wraparound count for reset */ 47 - #define PIC_CTRL_WWR0 6 /* watchdog 0 wraparound count for reset */ 48 - #define PIC_CTRL_WWN1 4 /* watchdog 1 wraparound count for NMI */ 49 - #define PIC_CTRL_WWN0 2 /* watchdog 0 wraparound count for NMI */ 50 - #define PIC_CTRL_WTE 0 /* watchdog timer enable */ 51 - 52 - /* PIC Status register defines */ 53 - #define PIC_ICI_STATUS 33 /* ICI interrupt timeout status */ 54 - #define PIC_ITE_STATUS 32 /* interrupt timeout status */ 55 - #define PIC_STS_STATUS 4 /* System timer interrupt status */ 56 - #define PIC_WNS_STATUS 2 /* NMI status for watchdog timers */ 57 - #define PIC_WIS_STATUS 0 /* Interrupt status for watchdog timers */ 58 - 59 - /* PIC IPI control register offsets */ 60 - #define PIC_IPICTRL_NMI 32 61 - #define PIC_IPICTRL_RIV 20 /* received interrupt vector */ 62 - #define PIC_IPICTRL_IDB 16 /* interrupt destination base */ 63 - #define PIC_IPICTRL_DTE 0 /* interrupt destination thread enables */ 64 - 65 - /* PIC IRT register offsets */ 66 - #define PIC_IRT_ENABLE 31 67 - #define PIC_IRT_NMI 29 68 - #define PIC_IRT_SCH 28 /* Scheduling scheme */ 69 - #define PIC_IRT_RVEC 20 /* Interrupt receive vectors */ 70 - #define PIC_IRT_DT 19 /* Destination type */ 71 - #define PIC_IRT_DB 16 /* Destination base */ 72 - #define PIC_IRT_DTE 0 /* Destination thread enables */ 73 - 74 - #define PIC_BYTESWAP 0x02 75 - #define PIC_STATUS 0x04 76 - #define PIC_INTR_TIMEOUT 0x06 77 - #define PIC_ICI0_INTR_TIMEOUT 0x08 78 - #define PIC_ICI1_INTR_TIMEOUT 0x0a 79 - #define PIC_ICI2_INTR_TIMEOUT 0x0c 80 - #define PIC_IPI_CTL 0x0e 81 - #define PIC_INT_ACK 0x10 82 - #define PIC_INT_PENDING0 0x12 83 - #define PIC_INT_PENDING1 0x14 84 - #define PIC_INT_PENDING2 0x16 85 - 86 - #define PIC_WDOG0_MAXVAL 0x18 87 - #define PIC_WDOG0_COUNT 0x1a 88 - #define PIC_WDOG0_ENABLE0 0x1c 89 - #define PIC_WDOG0_ENABLE1 0x1e 90 - #define PIC_WDOG0_BEATCMD 0x20 91 - #define PIC_WDOG0_BEAT0 0x22 92 - #define PIC_WDOG0_BEAT1 0x24 93 - 94 - #define PIC_WDOG1_MAXVAL 0x26 95 - #define PIC_WDOG1_COUNT 0x28 96 - #define PIC_WDOG1_ENABLE0 0x2a 97 - #define PIC_WDOG1_ENABLE1 0x2c 98 - #define PIC_WDOG1_BEATCMD 0x2e 99 - #define PIC_WDOG1_BEAT0 0x30 100 - #define PIC_WDOG1_BEAT1 0x32 101 - 102 - #define PIC_WDOG_MAXVAL(i) (PIC_WDOG0_MAXVAL + ((i) ? 7 : 0)) 103 - #define PIC_WDOG_COUNT(i) (PIC_WDOG0_COUNT + ((i) ? 7 : 0)) 104 - #define PIC_WDOG_ENABLE0(i) (PIC_WDOG0_ENABLE0 + ((i) ? 7 : 0)) 105 - #define PIC_WDOG_ENABLE1(i) (PIC_WDOG0_ENABLE1 + ((i) ? 7 : 0)) 106 - #define PIC_WDOG_BEATCMD(i) (PIC_WDOG0_BEATCMD + ((i) ? 7 : 0)) 107 - #define PIC_WDOG_BEAT0(i) (PIC_WDOG0_BEAT0 + ((i) ? 7 : 0)) 108 - #define PIC_WDOG_BEAT1(i) (PIC_WDOG0_BEAT1 + ((i) ? 7 : 0)) 109 - 110 - #define PIC_TIMER0_MAXVAL 0x34 111 - #define PIC_TIMER1_MAXVAL 0x36 112 - #define PIC_TIMER2_MAXVAL 0x38 113 - #define PIC_TIMER3_MAXVAL 0x3a 114 - #define PIC_TIMER4_MAXVAL 0x3c 115 - #define PIC_TIMER5_MAXVAL 0x3e 116 - #define PIC_TIMER6_MAXVAL 0x40 117 - #define PIC_TIMER7_MAXVAL 0x42 118 - #define PIC_TIMER_MAXVAL(i) (PIC_TIMER0_MAXVAL + ((i) * 2)) 119 - 120 - #define PIC_TIMER0_COUNT 0x44 121 - #define PIC_TIMER1_COUNT 0x46 122 - #define PIC_TIMER2_COUNT 0x48 123 - #define PIC_TIMER3_COUNT 0x4a 124 - #define PIC_TIMER4_COUNT 0x4c 125 - #define PIC_TIMER5_COUNT 0x4e 126 - #define PIC_TIMER6_COUNT 0x50 127 - #define PIC_TIMER7_COUNT 0x52 128 - #define PIC_TIMER_COUNT(i) (PIC_TIMER0_COUNT + ((i) * 2)) 129 - 130 - #define PIC_ITE0_N0_N1 0x54 131 - #define PIC_ITE1_N0_N1 0x58 132 - #define PIC_ITE2_N0_N1 0x5c 133 - #define PIC_ITE3_N0_N1 0x60 134 - #define PIC_ITE4_N0_N1 0x64 135 - #define PIC_ITE5_N0_N1 0x68 136 - #define PIC_ITE6_N0_N1 0x6c 137 - #define PIC_ITE7_N0_N1 0x70 138 - #define PIC_ITE_N0_N1(i) (PIC_ITE0_N0_N1 + ((i) * 4)) 139 - 140 - #define PIC_ITE0_N2_N3 0x56 141 - #define PIC_ITE1_N2_N3 0x5a 142 - #define PIC_ITE2_N2_N3 0x5e 143 - #define PIC_ITE3_N2_N3 0x62 144 - #define PIC_ITE4_N2_N3 0x66 145 - #define PIC_ITE5_N2_N3 0x6a 146 - #define PIC_ITE6_N2_N3 0x6e 147 - #define PIC_ITE7_N2_N3 0x72 148 - #define PIC_ITE_N2_N3(i) (PIC_ITE0_N2_N3 + ((i) * 4)) 149 - 150 - #define PIC_IRT0 0x74 151 - #define PIC_IRT(i) (PIC_IRT0 + ((i) * 2)) 152 - 153 - #define PIC_9XX_PENDING_0 0x6 154 - #define PIC_9XX_PENDING_1 0x8 155 - #define PIC_9XX_PENDING_2 0xa 156 - #define PIC_9XX_PENDING_3 0xc 157 - 158 - #define PIC_9XX_IRT0 0x1c0 159 - #define PIC_9XX_IRT(i) (PIC_9XX_IRT0 + ((i) * 2)) 160 - 161 - /* 162 - * IRT Map 163 - */ 164 - #define PIC_NUM_IRTS 160 165 - #define PIC_9XX_NUM_IRTS 256 166 - 167 - #define PIC_IRT_WD_0_INDEX 0 168 - #define PIC_IRT_WD_1_INDEX 1 169 - #define PIC_IRT_WD_NMI_0_INDEX 2 170 - #define PIC_IRT_WD_NMI_1_INDEX 3 171 - #define PIC_IRT_TIMER_0_INDEX 4 172 - #define PIC_IRT_TIMER_1_INDEX 5 173 - #define PIC_IRT_TIMER_2_INDEX 6 174 - #define PIC_IRT_TIMER_3_INDEX 7 175 - #define PIC_IRT_TIMER_4_INDEX 8 176 - #define PIC_IRT_TIMER_5_INDEX 9 177 - #define PIC_IRT_TIMER_6_INDEX 10 178 - #define PIC_IRT_TIMER_7_INDEX 11 179 - #define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX 180 - #define PIC_IRT_TIMER_INDEX(num) ((num) + PIC_IRT_TIMER_0_INDEX) 181 - 182 - 183 - /* 11 and 12 */ 184 - #define PIC_NUM_MSG_Q_IRTS 32 185 - #define PIC_IRT_MSG_Q0_INDEX 12 186 - #define PIC_IRT_MSG_Q_INDEX(qid) ((qid) + PIC_IRT_MSG_Q0_INDEX) 187 - /* 12 to 43 */ 188 - #define PIC_IRT_MSG_0_INDEX 44 189 - #define PIC_IRT_MSG_1_INDEX 45 190 - /* 44 and 45 */ 191 - #define PIC_NUM_PCIE_MSIX_IRTS 32 192 - #define PIC_IRT_PCIE_MSIX_0_INDEX 46 193 - #define PIC_IRT_PCIE_MSIX_INDEX(num) ((num) + PIC_IRT_PCIE_MSIX_0_INDEX) 194 - /* 46 to 77 */ 195 - #define PIC_NUM_PCIE_LINK_IRTS 4 196 - #define PIC_IRT_PCIE_LINK_0_INDEX 78 197 - #define PIC_IRT_PCIE_LINK_1_INDEX 79 198 - #define PIC_IRT_PCIE_LINK_2_INDEX 80 199 - #define PIC_IRT_PCIE_LINK_3_INDEX 81 200 - #define PIC_IRT_PCIE_LINK_INDEX(num) ((num) + PIC_IRT_PCIE_LINK_0_INDEX) 201 - 202 - #define PIC_9XX_IRT_PCIE_LINK_0_INDEX 191 203 - #define PIC_9XX_IRT_PCIE_LINK_INDEX(num) \ 204 - ((num) + PIC_9XX_IRT_PCIE_LINK_0_INDEX) 205 - 206 - #define PIC_CLOCK_TIMER 7 207 - 208 - #if !defined(LOCORE) && !defined(__ASSEMBLY__) 209 - 210 - /* 211 - * Misc 212 - */ 213 - #define PIC_IRT_VALID 1 214 - #define PIC_LOCAL_SCHEDULING 1 215 - #define PIC_GLOBAL_SCHEDULING 0 216 - 217 - #define nlm_read_pic_reg(b, r) nlm_read_reg64(b, r) 218 - #define nlm_write_pic_reg(b, r, v) nlm_write_reg64(b, r, v) 219 - #define nlm_get_pic_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \ 220 - XLP9XX_IO_PIC_OFFSET(node) : XLP_IO_PIC_OFFSET(node)) 221 - #define nlm_get_pic_regbase(node) (nlm_get_pic_pcibase(node) + XLP_IO_PCI_HDRSZ) 222 - 223 - /* We use PIC on node 0 as a timer */ 224 - #define pic_timer_freq() nlm_get_pic_frequency(0) 225 - 226 - /* IRT and h/w interrupt routines */ 227 - static inline void 228 - nlm_9xx_pic_write_irt(uint64_t base, int irt_num, int en, int nmi, 229 - int sch, int vec, int dt, int db, int cpu) 230 - { 231 - uint64_t val; 232 - 233 - val = (((uint64_t)en & 0x1) << 22) | ((nmi & 0x1) << 23) | 234 - ((0 /*mc*/) << 20) | ((vec & 0x3f) << 24) | 235 - ((dt & 0x1) << 21) | (0 /*ptr*/ << 16) | 236 - (cpu & 0x3ff); 237 - 238 - nlm_write_pic_reg(base, PIC_9XX_IRT(irt_num), val); 239 - } 240 - 241 - static inline void 242 - nlm_pic_write_irt(uint64_t base, int irt_num, int en, int nmi, 243 - int sch, int vec, int dt, int db, int dte) 244 - { 245 - uint64_t val; 246 - 247 - val = (((uint64_t)en & 0x1) << 31) | ((nmi & 0x1) << 29) | 248 - ((sch & 0x1) << 28) | ((vec & 0x3f) << 20) | 249 - ((dt & 0x1) << 19) | ((db & 0x7) << 16) | 250 - (dte & 0xffff); 251 - 252 - nlm_write_pic_reg(base, PIC_IRT(irt_num), val); 253 - } 254 - 255 - static inline void 256 - nlm_pic_write_irt_direct(uint64_t base, int irt_num, int en, int nmi, 257 - int sch, int vec, int cpu) 258 - { 259 - if (cpu_is_xlp9xx()) 260 - nlm_9xx_pic_write_irt(base, irt_num, en, nmi, sch, vec, 261 - 1, 0, cpu); 262 - else 263 - nlm_pic_write_irt(base, irt_num, en, nmi, sch, vec, 1, 264 - (cpu >> 4), /* thread group */ 265 - 1 << (cpu & 0xf)); /* thread mask */ 266 - } 267 - 268 - static inline uint64_t 269 - nlm_pic_read_timer(uint64_t base, int timer) 270 - { 271 - return nlm_read_pic_reg(base, PIC_TIMER_COUNT(timer)); 272 - } 273 - 274 - static inline uint32_t 275 - nlm_pic_read_timer32(uint64_t base, int timer) 276 - { 277 - return (uint32_t)nlm_read_pic_reg(base, PIC_TIMER_COUNT(timer)); 278 - } 279 - 280 - static inline void 281 - nlm_pic_write_timer(uint64_t base, int timer, uint64_t value) 282 - { 283 - nlm_write_pic_reg(base, PIC_TIMER_COUNT(timer), value); 284 - } 285 - 286 - static inline void 287 - nlm_pic_set_timer(uint64_t base, int timer, uint64_t value, int irq, int cpu) 288 - { 289 - uint64_t pic_ctrl = nlm_read_pic_reg(base, PIC_CTRL); 290 - int en; 291 - 292 - en = (irq > 0); 293 - nlm_write_pic_reg(base, PIC_TIMER_MAXVAL(timer), value); 294 - nlm_pic_write_irt_direct(base, PIC_IRT_TIMER_INDEX(timer), 295 - en, 0, 0, irq, cpu); 296 - 297 - /* enable the timer */ 298 - pic_ctrl |= (1 << (PIC_CTRL_STE + timer)); 299 - nlm_write_pic_reg(base, PIC_CTRL, pic_ctrl); 300 - } 301 - 302 - static inline void 303 - nlm_pic_enable_irt(uint64_t base, int irt) 304 - { 305 - uint64_t reg; 306 - 307 - if (cpu_is_xlp9xx()) { 308 - reg = nlm_read_pic_reg(base, PIC_9XX_IRT(irt)); 309 - nlm_write_pic_reg(base, PIC_9XX_IRT(irt), reg | (1 << 22)); 310 - } else { 311 - reg = nlm_read_pic_reg(base, PIC_IRT(irt)); 312 - nlm_write_pic_reg(base, PIC_IRT(irt), reg | (1u << 31)); 313 - } 314 - } 315 - 316 - static inline void 317 - nlm_pic_disable_irt(uint64_t base, int irt) 318 - { 319 - uint64_t reg; 320 - 321 - if (cpu_is_xlp9xx()) { 322 - reg = nlm_read_pic_reg(base, PIC_9XX_IRT(irt)); 323 - reg &= ~((uint64_t)1 << 22); 324 - nlm_write_pic_reg(base, PIC_9XX_IRT(irt), reg); 325 - } else { 326 - reg = nlm_read_pic_reg(base, PIC_IRT(irt)); 327 - reg &= ~((uint64_t)1 << 31); 328 - nlm_write_pic_reg(base, PIC_IRT(irt), reg); 329 - } 330 - } 331 - 332 - static inline void 333 - nlm_pic_send_ipi(uint64_t base, int hwt, int irq, int nmi) 334 - { 335 - uint64_t ipi; 336 - 337 - if (cpu_is_xlp9xx()) 338 - ipi = (nmi << 23) | (irq << 24) | 339 - (0/*mcm*/ << 20) | (0/*ptr*/ << 16) | hwt; 340 - else 341 - ipi = ((uint64_t)nmi << 31) | (irq << 20) | 342 - ((hwt >> 4) << 16) | (1 << (hwt & 0xf)); 343 - 344 - nlm_write_pic_reg(base, PIC_IPI_CTL, ipi); 345 - } 346 - 347 - static inline void 348 - nlm_pic_ack(uint64_t base, int irt_num) 349 - { 350 - nlm_write_pic_reg(base, PIC_INT_ACK, irt_num); 351 - 352 - /* Ack the Status register for Watchdog & System timers */ 353 - if (irt_num < 12) 354 - nlm_write_pic_reg(base, PIC_STATUS, (1 << irt_num)); 355 - } 356 - 357 - static inline void 358 - nlm_pic_init_irt(uint64_t base, int irt, int irq, int hwt, int en) 359 - { 360 - nlm_pic_write_irt_direct(base, irt, en, 0, 0, irq, hwt); 361 - } 362 - 363 - int nlm_irq_to_irt(int irq); 364 - 365 - #endif /* __ASSEMBLY__ */ 366 - #endif /* _NLM_HAL_PIC_H */
-213
arch/mips/include/asm/netlogic/xlp-hal/sys.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __NLM_HAL_SYS_H__ 36 - #define __NLM_HAL_SYS_H__ 37 - 38 - /** 39 - * @file_name sys.h 40 - * @author Netlogic Microsystems 41 - * @brief HAL for System configuration registers 42 - */ 43 - #define SYS_CHIP_RESET 0x00 44 - #define SYS_POWER_ON_RESET_CFG 0x01 45 - #define SYS_EFUSE_DEVICE_CFG_STATUS0 0x02 46 - #define SYS_EFUSE_DEVICE_CFG_STATUS1 0x03 47 - #define SYS_EFUSE_DEVICE_CFG_STATUS2 0x04 48 - #define SYS_EFUSE_DEVICE_CFG3 0x05 49 - #define SYS_EFUSE_DEVICE_CFG4 0x06 50 - #define SYS_EFUSE_DEVICE_CFG5 0x07 51 - #define SYS_EFUSE_DEVICE_CFG6 0x08 52 - #define SYS_EFUSE_DEVICE_CFG7 0x09 53 - #define SYS_PLL_CTRL 0x0a 54 - #define SYS_CPU_RESET 0x0b 55 - #define SYS_CPU_NONCOHERENT_MODE 0x0d 56 - #define SYS_CORE_DFS_DIS_CTRL 0x0e 57 - #define SYS_CORE_DFS_RST_CTRL 0x0f 58 - #define SYS_CORE_DFS_BYP_CTRL 0x10 59 - #define SYS_CORE_DFS_PHA_CTRL 0x11 60 - #define SYS_CORE_DFS_DIV_INC_CTRL 0x12 61 - #define SYS_CORE_DFS_DIV_DEC_CTRL 0x13 62 - #define SYS_CORE_DFS_DIV_VALUE 0x14 63 - #define SYS_RESET 0x15 64 - #define SYS_DFS_DIS_CTRL 0x16 65 - #define SYS_DFS_RST_CTRL 0x17 66 - #define SYS_DFS_BYP_CTRL 0x18 67 - #define SYS_DFS_DIV_INC_CTRL 0x19 68 - #define SYS_DFS_DIV_DEC_CTRL 0x1a 69 - #define SYS_DFS_DIV_VALUE0 0x1b 70 - #define SYS_DFS_DIV_VALUE1 0x1c 71 - #define SYS_SENSE_AMP_DLY 0x1d 72 - #define SYS_SOC_SENSE_AMP_DLY 0x1e 73 - #define SYS_CTRL0 0x1f 74 - #define SYS_CTRL1 0x20 75 - #define SYS_TIMEOUT_BS1 0x21 76 - #define SYS_BYTE_SWAP 0x22 77 - #define SYS_VRM_VID 0x23 78 - #define SYS_PWR_RAM_CMD 0x24 79 - #define SYS_PWR_RAM_ADDR 0x25 80 - #define SYS_PWR_RAM_DATA0 0x26 81 - #define SYS_PWR_RAM_DATA1 0x27 82 - #define SYS_PWR_RAM_DATA2 0x28 83 - #define SYS_PWR_UCODE 0x29 84 - #define SYS_CPU0_PWR_STATUS 0x2a 85 - #define SYS_CPU1_PWR_STATUS 0x2b 86 - #define SYS_CPU2_PWR_STATUS 0x2c 87 - #define SYS_CPU3_PWR_STATUS 0x2d 88 - #define SYS_CPU4_PWR_STATUS 0x2e 89 - #define SYS_CPU5_PWR_STATUS 0x2f 90 - #define SYS_CPU6_PWR_STATUS 0x30 91 - #define SYS_CPU7_PWR_STATUS 0x31 92 - #define SYS_STATUS 0x32 93 - #define SYS_INT_POL 0x33 94 - #define SYS_INT_TYPE 0x34 95 - #define SYS_INT_STATUS 0x35 96 - #define SYS_INT_MASK0 0x36 97 - #define SYS_INT_MASK1 0x37 98 - #define SYS_UCO_S_ECC 0x38 99 - #define SYS_UCO_M_ECC 0x39 100 - #define SYS_UCO_ADDR 0x3a 101 - #define SYS_UCO_INSTR 0x3b 102 - #define SYS_MEM_BIST0 0x3c 103 - #define SYS_MEM_BIST1 0x3d 104 - #define SYS_MEM_BIST2 0x3e 105 - #define SYS_MEM_BIST3 0x3f 106 - #define SYS_MEM_BIST4 0x40 107 - #define SYS_MEM_BIST5 0x41 108 - #define SYS_MEM_BIST6 0x42 109 - #define SYS_MEM_BIST7 0x43 110 - #define SYS_MEM_BIST8 0x44 111 - #define SYS_MEM_BIST9 0x45 112 - #define SYS_MEM_BIST10 0x46 113 - #define SYS_MEM_BIST11 0x47 114 - #define SYS_MEM_BIST12 0x48 115 - #define SYS_SCRTCH0 0x49 116 - #define SYS_SCRTCH1 0x4a 117 - #define SYS_SCRTCH2 0x4b 118 - #define SYS_SCRTCH3 0x4c 119 - 120 - /* PLL registers XLP2XX */ 121 - #define SYS_CPU_PLL_CTRL0(core) (0x1c0 + (core * 4)) 122 - #define SYS_CPU_PLL_CTRL1(core) (0x1c1 + (core * 4)) 123 - #define SYS_CPU_PLL_CTRL2(core) (0x1c2 + (core * 4)) 124 - #define SYS_CPU_PLL_CTRL3(core) (0x1c3 + (core * 4)) 125 - #define SYS_PLL_CTRL0 0x240 126 - #define SYS_PLL_CTRL1 0x241 127 - #define SYS_PLL_CTRL2 0x242 128 - #define SYS_PLL_CTRL3 0x243 129 - #define SYS_DMC_PLL_CTRL0 0x244 130 - #define SYS_DMC_PLL_CTRL1 0x245 131 - #define SYS_DMC_PLL_CTRL2 0x246 132 - #define SYS_DMC_PLL_CTRL3 0x247 133 - 134 - #define SYS_PLL_CTRL0_DEVX(x) (0x248 + (x) * 4) 135 - #define SYS_PLL_CTRL1_DEVX(x) (0x249 + (x) * 4) 136 - #define SYS_PLL_CTRL2_DEVX(x) (0x24a + (x) * 4) 137 - #define SYS_PLL_CTRL3_DEVX(x) (0x24b + (x) * 4) 138 - 139 - #define SYS_CPU_PLL_CHG_CTRL 0x288 140 - #define SYS_PLL_CHG_CTRL 0x289 141 - #define SYS_CLK_DEV_DIS 0x28a 142 - #define SYS_CLK_DEV_SEL 0x28b 143 - #define SYS_CLK_DEV_DIV 0x28c 144 - #define SYS_CLK_DEV_CHG 0x28d 145 - #define SYS_CLK_DEV_SEL_REG 0x28e 146 - #define SYS_CLK_DEV_DIV_REG 0x28f 147 - #define SYS_CPU_PLL_LOCK 0x29f 148 - #define SYS_SYS_PLL_LOCK 0x2a0 149 - #define SYS_PLL_MEM_CMD 0x2a1 150 - #define SYS_CPU_PLL_MEM_REQ 0x2a2 151 - #define SYS_SYS_PLL_MEM_REQ 0x2a3 152 - #define SYS_PLL_MEM_STAT 0x2a4 153 - 154 - /* PLL registers XLP9XX */ 155 - #define SYS_9XX_CPU_PLL_CTRL0(core) (0xc0 + (core * 4)) 156 - #define SYS_9XX_CPU_PLL_CTRL1(core) (0xc1 + (core * 4)) 157 - #define SYS_9XX_CPU_PLL_CTRL2(core) (0xc2 + (core * 4)) 158 - #define SYS_9XX_CPU_PLL_CTRL3(core) (0xc3 + (core * 4)) 159 - #define SYS_9XX_DMC_PLL_CTRL0 0x140 160 - #define SYS_9XX_DMC_PLL_CTRL1 0x141 161 - #define SYS_9XX_DMC_PLL_CTRL2 0x142 162 - #define SYS_9XX_DMC_PLL_CTRL3 0x143 163 - #define SYS_9XX_PLL_CTRL0 0x144 164 - #define SYS_9XX_PLL_CTRL1 0x145 165 - #define SYS_9XX_PLL_CTRL2 0x146 166 - #define SYS_9XX_PLL_CTRL3 0x147 167 - 168 - #define SYS_9XX_PLL_CTRL0_DEVX(x) (0x148 + (x) * 4) 169 - #define SYS_9XX_PLL_CTRL1_DEVX(x) (0x149 + (x) * 4) 170 - #define SYS_9XX_PLL_CTRL2_DEVX(x) (0x14a + (x) * 4) 171 - #define SYS_9XX_PLL_CTRL3_DEVX(x) (0x14b + (x) * 4) 172 - 173 - #define SYS_9XX_CPU_PLL_CHG_CTRL 0x188 174 - #define SYS_9XX_PLL_CHG_CTRL 0x189 175 - #define SYS_9XX_CLK_DEV_DIS 0x18a 176 - #define SYS_9XX_CLK_DEV_SEL 0x18b 177 - #define SYS_9XX_CLK_DEV_DIV 0x18d 178 - #define SYS_9XX_CLK_DEV_CHG 0x18f 179 - 180 - #define SYS_9XX_CLK_DEV_SEL_REG 0x1a4 181 - #define SYS_9XX_CLK_DEV_DIV_REG 0x1a6 182 - 183 - /* Registers changed on 9XX */ 184 - #define SYS_9XX_POWER_ON_RESET_CFG 0x00 185 - #define SYS_9XX_CHIP_RESET 0x01 186 - #define SYS_9XX_CPU_RESET 0x02 187 - #define SYS_9XX_CPU_NONCOHERENT_MODE 0x03 188 - 189 - /* XLP 9XX fuse block registers */ 190 - #define FUSE_9XX_DEVCFG6 0xc6 191 - 192 - #ifndef __ASSEMBLY__ 193 - 194 - #define nlm_read_sys_reg(b, r) nlm_read_reg(b, r) 195 - #define nlm_write_sys_reg(b, r, v) nlm_write_reg(b, r, v) 196 - #define nlm_get_sys_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \ 197 - XLP9XX_IO_SYS_OFFSET(node) : XLP_IO_SYS_OFFSET(node)) 198 - #define nlm_get_sys_regbase(node) (nlm_get_sys_pcibase(node) + XLP_IO_PCI_HDRSZ) 199 - 200 - /* XLP9XX fuse block */ 201 - #define nlm_get_fuse_pcibase(node) \ 202 - nlm_pcicfg_base(XLP9XX_IO_FUSE_OFFSET(node)) 203 - #define nlm_get_fuse_regbase(node) \ 204 - (nlm_get_fuse_pcibase(node) + XLP_IO_PCI_HDRSZ) 205 - 206 - #define nlm_get_clock_pcibase(node) \ 207 - nlm_pcicfg_base(XLP9XX_IO_CLOCK_OFFSET(node)) 208 - #define nlm_get_clock_regbase(node) \ 209 - (nlm_get_clock_pcibase(node) + XLP_IO_PCI_HDRSZ) 210 - 211 - unsigned int nlm_get_pic_frequency(int node); 212 - #endif 213 - #endif
-192
arch/mips/include/asm/netlogic/xlp-hal/uart.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef __XLP_HAL_UART_H__ 36 - #define __XLP_HAL_UART_H__ 37 - 38 - /* UART Specific registers */ 39 - #define UART_RX_DATA 0x00 40 - #define UART_TX_DATA 0x00 41 - 42 - #define UART_INT_EN 0x01 43 - #define UART_INT_ID 0x02 44 - #define UART_FIFO_CTL 0x02 45 - #define UART_LINE_CTL 0x03 46 - #define UART_MODEM_CTL 0x04 47 - #define UART_LINE_STS 0x05 48 - #define UART_MODEM_STS 0x06 49 - 50 - #define UART_DIVISOR0 0x00 51 - #define UART_DIVISOR1 0x01 52 - 53 - #define BASE_BAUD (XLP_IO_CLK/16) 54 - #define BAUD_DIVISOR(baud) (BASE_BAUD / baud) 55 - 56 - /* LCR mask values */ 57 - #define LCR_5BITS 0x00 58 - #define LCR_6BITS 0x01 59 - #define LCR_7BITS 0x02 60 - #define LCR_8BITS 0x03 61 - #define LCR_STOPB 0x04 62 - #define LCR_PENAB 0x08 63 - #define LCR_PODD 0x00 64 - #define LCR_PEVEN 0x10 65 - #define LCR_PONE 0x20 66 - #define LCR_PZERO 0x30 67 - #define LCR_SBREAK 0x40 68 - #define LCR_EFR_ENABLE 0xbf 69 - #define LCR_DLAB 0x80 70 - 71 - /* MCR mask values */ 72 - #define MCR_DTR 0x01 73 - #define MCR_RTS 0x02 74 - #define MCR_DRS 0x04 75 - #define MCR_IE 0x08 76 - #define MCR_LOOPBACK 0x10 77 - 78 - /* FCR mask values */ 79 - #define FCR_RCV_RST 0x02 80 - #define FCR_XMT_RST 0x04 81 - #define FCR_RX_LOW 0x00 82 - #define FCR_RX_MEDL 0x40 83 - #define FCR_RX_MEDH 0x80 84 - #define FCR_RX_HIGH 0xc0 85 - 86 - /* IER mask values */ 87 - #define IER_ERXRDY 0x1 88 - #define IER_ETXRDY 0x2 89 - #define IER_ERLS 0x4 90 - #define IER_EMSC 0x8 91 - 92 - #if !defined(LOCORE) && !defined(__ASSEMBLY__) 93 - 94 - #define nlm_read_uart_reg(b, r) nlm_read_reg(b, r) 95 - #define nlm_write_uart_reg(b, r, v) nlm_write_reg(b, r, v) 96 - #define nlm_get_uart_pcibase(node, inst) \ 97 - nlm_pcicfg_base(cpu_is_xlp9xx() ? XLP9XX_IO_UART_OFFSET(node) : \ 98 - XLP_IO_UART_OFFSET(node, inst)) 99 - #define nlm_get_uart_regbase(node, inst) \ 100 - (nlm_get_uart_pcibase(node, inst) + XLP_IO_PCI_HDRSZ) 101 - 102 - static inline void 103 - nlm_uart_set_baudrate(uint64_t base, int baud) 104 - { 105 - uint32_t lcr; 106 - 107 - lcr = nlm_read_uart_reg(base, UART_LINE_CTL); 108 - 109 - /* enable divisor register, and write baud values */ 110 - nlm_write_uart_reg(base, UART_LINE_CTL, lcr | (1 << 7)); 111 - nlm_write_uart_reg(base, UART_DIVISOR0, 112 - (BAUD_DIVISOR(baud) & 0xff)); 113 - nlm_write_uart_reg(base, UART_DIVISOR1, 114 - ((BAUD_DIVISOR(baud) >> 8) & 0xff)); 115 - 116 - /* restore default lcr */ 117 - nlm_write_uart_reg(base, UART_LINE_CTL, lcr); 118 - } 119 - 120 - static inline void 121 - nlm_uart_outbyte(uint64_t base, char c) 122 - { 123 - uint32_t lsr; 124 - 125 - for (;;) { 126 - lsr = nlm_read_uart_reg(base, UART_LINE_STS); 127 - if (lsr & 0x20) 128 - break; 129 - } 130 - 131 - nlm_write_uart_reg(base, UART_TX_DATA, (int)c); 132 - } 133 - 134 - static inline char 135 - nlm_uart_inbyte(uint64_t base) 136 - { 137 - int data, lsr; 138 - 139 - for (;;) { 140 - lsr = nlm_read_uart_reg(base, UART_LINE_STS); 141 - if (lsr & 0x80) { /* parity/frame/break-error - push a zero */ 142 - data = 0; 143 - break; 144 - } 145 - if (lsr & 0x01) { /* Rx data */ 146 - data = nlm_read_uart_reg(base, UART_RX_DATA); 147 - break; 148 - } 149 - } 150 - 151 - return (char)data; 152 - } 153 - 154 - static inline int 155 - nlm_uart_init(uint64_t base, int baud, int databits, int stopbits, 156 - int parity, int int_en, int loopback) 157 - { 158 - uint32_t lcr; 159 - 160 - lcr = 0; 161 - if (databits >= 8) 162 - lcr |= LCR_8BITS; 163 - else if (databits == 7) 164 - lcr |= LCR_7BITS; 165 - else if (databits == 6) 166 - lcr |= LCR_6BITS; 167 - else 168 - lcr |= LCR_5BITS; 169 - 170 - if (stopbits > 1) 171 - lcr |= LCR_STOPB; 172 - 173 - lcr |= parity << 3; 174 - 175 - /* setup default lcr */ 176 - nlm_write_uart_reg(base, UART_LINE_CTL, lcr); 177 - 178 - /* Reset the FIFOs */ 179 - nlm_write_uart_reg(base, UART_LINE_CTL, FCR_RCV_RST | FCR_XMT_RST); 180 - 181 - nlm_uart_set_baudrate(base, baud); 182 - 183 - if (loopback) 184 - nlm_write_uart_reg(base, UART_MODEM_CTL, 0x1f); 185 - 186 - if (int_en) 187 - nlm_write_uart_reg(base, UART_INT_EN, IER_ERXRDY | IER_ETXRDY); 188 - 189 - return 0; 190 - } 191 - #endif /* !LOCORE && !__ASSEMBLY__ */ 192 - #endif /* __XLP_HAL_UART_H__ */
-119
arch/mips/include/asm/netlogic/xlp-hal/xlp.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _NLM_HAL_XLP_H 36 - #define _NLM_HAL_XLP_H 37 - 38 - #define PIC_UART_0_IRQ 17 39 - #define PIC_UART_1_IRQ 18 40 - 41 - #define PIC_PCIE_LINK_LEGACY_IRQ_BASE 19 42 - #define PIC_PCIE_LINK_LEGACY_IRQ(i) (19 + (i)) 43 - 44 - #define PIC_EHCI_0_IRQ 23 45 - #define PIC_EHCI_1_IRQ 24 46 - #define PIC_OHCI_0_IRQ 25 47 - #define PIC_OHCI_1_IRQ 26 48 - #define PIC_OHCI_2_IRQ 27 49 - #define PIC_OHCI_3_IRQ 28 50 - #define PIC_2XX_XHCI_0_IRQ 23 51 - #define PIC_2XX_XHCI_1_IRQ 24 52 - #define PIC_2XX_XHCI_2_IRQ 25 53 - #define PIC_9XX_XHCI_0_IRQ 23 54 - #define PIC_9XX_XHCI_1_IRQ 24 55 - #define PIC_9XX_XHCI_2_IRQ 25 56 - 57 - #define PIC_MMC_IRQ 29 58 - #define PIC_I2C_0_IRQ 30 59 - #define PIC_I2C_1_IRQ 31 60 - #define PIC_I2C_2_IRQ 32 61 - #define PIC_I2C_3_IRQ 33 62 - #define PIC_SPI_IRQ 34 63 - #define PIC_NAND_IRQ 37 64 - #define PIC_SATA_IRQ 38 65 - #define PIC_GPIO_IRQ 39 66 - 67 - #define PIC_PCIE_LINK_MSI_IRQ_BASE 44 /* 44 - 47 MSI IRQ */ 68 - #define PIC_PCIE_LINK_MSI_IRQ(i) (44 + (i)) 69 - 70 - /* MSI-X with second link-level dispatch */ 71 - #define PIC_PCIE_MSIX_IRQ_BASE 48 /* 48 - 51 MSI-X IRQ */ 72 - #define PIC_PCIE_MSIX_IRQ(i) (48 + (i)) 73 - 74 - /* XLP9xx and XLP8xx has 128 and 32 MSIX vectors respectively */ 75 - #define NLM_MSIX_VEC_BASE 96 /* 96 - 223 - MSIX mapped */ 76 - #define NLM_MSI_VEC_BASE 224 /* 224 -351 - MSI mapped */ 77 - 78 - #define NLM_PIC_INDIRECT_VEC_BASE 512 79 - #define NLM_GPIO_VEC_BASE 768 80 - 81 - #define PIC_IRQ_BASE 8 82 - #define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE 83 - #define PIC_IRT_LAST_IRQ 63 84 - 85 - #ifndef __ASSEMBLY__ 86 - 87 - /* SMP support functions */ 88 - void xlp_boot_core0_siblings(void); 89 - void xlp_wakeup_secondary_cpus(void); 90 - 91 - void xlp_mmu_init(void); 92 - void nlm_hal_init(void); 93 - int nlm_get_dram_map(int node, uint64_t *dram_map, int nentries); 94 - 95 - struct pci_dev; 96 - int xlp_socdev_to_node(const struct pci_dev *dev); 97 - 98 - /* Device tree related */ 99 - void xlp_early_init_devtree(void); 100 - void *xlp_dt_init(void *fdtp); 101 - 102 - static inline int cpu_is_xlpii(void) 103 - { 104 - int chip = read_c0_prid() & PRID_IMP_MASK; 105 - 106 - return chip == PRID_IMP_NETLOGIC_XLP2XX || 107 - chip == PRID_IMP_NETLOGIC_XLP9XX || 108 - chip == PRID_IMP_NETLOGIC_XLP5XX; 109 - } 110 - 111 - static inline int cpu_is_xlp9xx(void) 112 - { 113 - int chip = read_c0_prid() & PRID_IMP_MASK; 114 - 115 - return chip == PRID_IMP_NETLOGIC_XLP9XX || 116 - chip == PRID_IMP_NETLOGIC_XLP5XX; 117 - } 118 - #endif /* !__ASSEMBLY__ */ 119 - #endif /* _ASM_NLM_XLP_H */
-104
arch/mips/include/asm/netlogic/xlr/bridge.h
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - #ifndef _ASM_NLM_BRIDGE_H_ 35 - #define _ASM_NLM_BRIDGE_H_ 36 - 37 - #define BRIDGE_DRAM_0_BAR 0 38 - #define BRIDGE_DRAM_1_BAR 1 39 - #define BRIDGE_DRAM_2_BAR 2 40 - #define BRIDGE_DRAM_3_BAR 3 41 - #define BRIDGE_DRAM_4_BAR 4 42 - #define BRIDGE_DRAM_5_BAR 5 43 - #define BRIDGE_DRAM_6_BAR 6 44 - #define BRIDGE_DRAM_7_BAR 7 45 - #define BRIDGE_DRAM_CHN_0_MTR_0_BAR 8 46 - #define BRIDGE_DRAM_CHN_0_MTR_1_BAR 9 47 - #define BRIDGE_DRAM_CHN_0_MTR_2_BAR 10 48 - #define BRIDGE_DRAM_CHN_0_MTR_3_BAR 11 49 - #define BRIDGE_DRAM_CHN_0_MTR_4_BAR 12 50 - #define BRIDGE_DRAM_CHN_0_MTR_5_BAR 13 51 - #define BRIDGE_DRAM_CHN_0_MTR_6_BAR 14 52 - #define BRIDGE_DRAM_CHN_0_MTR_7_BAR 15 53 - #define BRIDGE_DRAM_CHN_1_MTR_0_BAR 16 54 - #define BRIDGE_DRAM_CHN_1_MTR_1_BAR 17 55 - #define BRIDGE_DRAM_CHN_1_MTR_2_BAR 18 56 - #define BRIDGE_DRAM_CHN_1_MTR_3_BAR 19 57 - #define BRIDGE_DRAM_CHN_1_MTR_4_BAR 20 58 - #define BRIDGE_DRAM_CHN_1_MTR_5_BAR 21 59 - #define BRIDGE_DRAM_CHN_1_MTR_6_BAR 22 60 - #define BRIDGE_DRAM_CHN_1_MTR_7_BAR 23 61 - #define BRIDGE_CFG_BAR 24 62 - #define BRIDGE_PHNX_IO_BAR 25 63 - #define BRIDGE_FLASH_BAR 26 64 - #define BRIDGE_SRAM_BAR 27 65 - #define BRIDGE_HTMEM_BAR 28 66 - #define BRIDGE_HTINT_BAR 29 67 - #define BRIDGE_HTPIC_BAR 30 68 - #define BRIDGE_HTSM_BAR 31 69 - #define BRIDGE_HTIO_BAR 32 70 - #define BRIDGE_HTCFG_BAR 33 71 - #define BRIDGE_PCIXCFG_BAR 34 72 - #define BRIDGE_PCIXMEM_BAR 35 73 - #define BRIDGE_PCIXIO_BAR 36 74 - #define BRIDGE_DEVICE_MASK 37 75 - #define BRIDGE_AERR_INTR_LOG1 38 76 - #define BRIDGE_AERR_INTR_LOG2 39 77 - #define BRIDGE_AERR_INTR_LOG3 40 78 - #define BRIDGE_AERR_DEV_STAT 41 79 - #define BRIDGE_AERR1_LOG1 42 80 - #define BRIDGE_AERR1_LOG2 43 81 - #define BRIDGE_AERR1_LOG3 44 82 - #define BRIDGE_AERR1_DEV_STAT 45 83 - #define BRIDGE_AERR_INTR_EN 46 84 - #define BRIDGE_AERR_UPG 47 85 - #define BRIDGE_AERR_CLEAR 48 86 - #define BRIDGE_AERR1_CLEAR 49 87 - #define BRIDGE_SBE_COUNTS 50 88 - #define BRIDGE_DBE_COUNTS 51 89 - #define BRIDGE_BITERR_INT_EN 52 90 - 91 - #define BRIDGE_SYS2IO_CREDITS 53 92 - #define BRIDGE_EVNT_CNT_CTRL1 54 93 - #define BRIDGE_EVNT_COUNTER1 55 94 - #define BRIDGE_EVNT_CNT_CTRL2 56 95 - #define BRIDGE_EVNT_COUNTER2 57 96 - #define BRIDGE_RESERVED1 58 97 - 98 - #define BRIDGE_DEFEATURE 59 99 - #define BRIDGE_SCRATCH0 60 100 - #define BRIDGE_SCRATCH1 61 101 - #define BRIDGE_SCRATCH2 62 102 - #define BRIDGE_SCRATCH3 63 103 - 104 - #endif
-55
arch/mips/include/asm/netlogic/xlr/flash.h
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - #ifndef _ASM_NLM_FLASH_H_ 35 - #define _ASM_NLM_FLASH_H_ 36 - 37 - #define FLASH_CSBASE_ADDR(cs) (cs) 38 - #define FLASH_CSADDR_MASK(cs) (0x10 + (cs)) 39 - #define FLASH_CSDEV_PARM(cs) (0x20 + (cs)) 40 - #define FLASH_CSTIME_PARMA(cs) (0x30 + (cs)) 41 - #define FLASH_CSTIME_PARMB(cs) (0x40 + (cs)) 42 - 43 - #define FLASH_INT_MASK 0x50 44 - #define FLASH_INT_STATUS 0x60 45 - #define FLASH_ERROR_STATUS 0x70 46 - #define FLASH_ERROR_ADDR 0x80 47 - 48 - #define FLASH_NAND_CLE(cs) (0x90 + (cs)) 49 - #define FLASH_NAND_ALE(cs) (0xa0 + (cs)) 50 - 51 - #define FLASH_NAND_CSDEV_PARAM 0x000041e6 52 - #define FLASH_NAND_CSTIME_PARAMA 0x4f400e22 53 - #define FLASH_NAND_CSTIME_PARAMB 0x000083cf 54 - 55 - #endif
-365
arch/mips/include/asm/netlogic/xlr/fmn.h
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _NLM_FMN_H_ 36 - #define _NLM_FMN_H_ 37 - 38 - #include <asm/netlogic/mips-extns.h> /* for COP2 access */ 39 - 40 - /* Station IDs */ 41 - #define FMN_STNID_CPU0 0x00 42 - #define FMN_STNID_CPU1 0x08 43 - #define FMN_STNID_CPU2 0x10 44 - #define FMN_STNID_CPU3 0x18 45 - #define FMN_STNID_CPU4 0x20 46 - #define FMN_STNID_CPU5 0x28 47 - #define FMN_STNID_CPU6 0x30 48 - #define FMN_STNID_CPU7 0x38 49 - 50 - #define FMN_STNID_XGS0_TX 64 51 - #define FMN_STNID_XMAC0_00_TX 64 52 - #define FMN_STNID_XMAC0_01_TX 65 53 - #define FMN_STNID_XMAC0_02_TX 66 54 - #define FMN_STNID_XMAC0_03_TX 67 55 - #define FMN_STNID_XMAC0_04_TX 68 56 - #define FMN_STNID_XMAC0_05_TX 69 57 - #define FMN_STNID_XMAC0_06_TX 70 58 - #define FMN_STNID_XMAC0_07_TX 71 59 - #define FMN_STNID_XMAC0_08_TX 72 60 - #define FMN_STNID_XMAC0_09_TX 73 61 - #define FMN_STNID_XMAC0_10_TX 74 62 - #define FMN_STNID_XMAC0_11_TX 75 63 - #define FMN_STNID_XMAC0_12_TX 76 64 - #define FMN_STNID_XMAC0_13_TX 77 65 - #define FMN_STNID_XMAC0_14_TX 78 66 - #define FMN_STNID_XMAC0_15_TX 79 67 - 68 - #define FMN_STNID_XGS1_TX 80 69 - #define FMN_STNID_XMAC1_00_TX 80 70 - #define FMN_STNID_XMAC1_01_TX 81 71 - #define FMN_STNID_XMAC1_02_TX 82 72 - #define FMN_STNID_XMAC1_03_TX 83 73 - #define FMN_STNID_XMAC1_04_TX 84 74 - #define FMN_STNID_XMAC1_05_TX 85 75 - #define FMN_STNID_XMAC1_06_TX 86 76 - #define FMN_STNID_XMAC1_07_TX 87 77 - #define FMN_STNID_XMAC1_08_TX 88 78 - #define FMN_STNID_XMAC1_09_TX 89 79 - #define FMN_STNID_XMAC1_10_TX 90 80 - #define FMN_STNID_XMAC1_11_TX 91 81 - #define FMN_STNID_XMAC1_12_TX 92 82 - #define FMN_STNID_XMAC1_13_TX 93 83 - #define FMN_STNID_XMAC1_14_TX 94 84 - #define FMN_STNID_XMAC1_15_TX 95 85 - 86 - #define FMN_STNID_GMAC 96 87 - #define FMN_STNID_GMACJFR_0 96 88 - #define FMN_STNID_GMACRFR_0 97 89 - #define FMN_STNID_GMACTX0 98 90 - #define FMN_STNID_GMACTX1 99 91 - #define FMN_STNID_GMACTX2 100 92 - #define FMN_STNID_GMACTX3 101 93 - #define FMN_STNID_GMACJFR_1 102 94 - #define FMN_STNID_GMACRFR_1 103 95 - 96 - #define FMN_STNID_DMA 104 97 - #define FMN_STNID_DMA_0 104 98 - #define FMN_STNID_DMA_1 105 99 - #define FMN_STNID_DMA_2 106 100 - #define FMN_STNID_DMA_3 107 101 - 102 - #define FMN_STNID_XGS0FR 112 103 - #define FMN_STNID_XMAC0JFR 112 104 - #define FMN_STNID_XMAC0RFR 113 105 - 106 - #define FMN_STNID_XGS1FR 114 107 - #define FMN_STNID_XMAC1JFR 114 108 - #define FMN_STNID_XMAC1RFR 115 109 - #define FMN_STNID_SEC 120 110 - #define FMN_STNID_SEC0 120 111 - #define FMN_STNID_SEC1 121 112 - #define FMN_STNID_SEC2 122 113 - #define FMN_STNID_SEC3 123 114 - #define FMN_STNID_PK0 124 115 - #define FMN_STNID_SEC_RSA 124 116 - #define FMN_STNID_SEC_RSVD0 125 117 - #define FMN_STNID_SEC_RSVD1 126 118 - #define FMN_STNID_SEC_RSVD2 127 119 - 120 - #define FMN_STNID_GMAC1 80 121 - #define FMN_STNID_GMAC1_FR_0 81 122 - #define FMN_STNID_GMAC1_TX0 82 123 - #define FMN_STNID_GMAC1_TX1 83 124 - #define FMN_STNID_GMAC1_TX2 84 125 - #define FMN_STNID_GMAC1_TX3 85 126 - #define FMN_STNID_GMAC1_FR_1 87 127 - #define FMN_STNID_GMAC0 96 128 - #define FMN_STNID_GMAC0_FR_0 97 129 - #define FMN_STNID_GMAC0_TX0 98 130 - #define FMN_STNID_GMAC0_TX1 99 131 - #define FMN_STNID_GMAC0_TX2 100 132 - #define FMN_STNID_GMAC0_TX3 101 133 - #define FMN_STNID_GMAC0_FR_1 103 134 - #define FMN_STNID_CMP_0 108 135 - #define FMN_STNID_CMP_1 109 136 - #define FMN_STNID_CMP_2 110 137 - #define FMN_STNID_CMP_3 111 138 - #define FMN_STNID_PCIE_0 116 139 - #define FMN_STNID_PCIE_1 117 140 - #define FMN_STNID_PCIE_2 118 141 - #define FMN_STNID_PCIE_3 119 142 - #define FMN_STNID_XLS_PK0 121 143 - 144 - #define nlm_read_c2_cc0(s) __read_32bit_c2_register($16, s) 145 - #define nlm_read_c2_cc1(s) __read_32bit_c2_register($17, s) 146 - #define nlm_read_c2_cc2(s) __read_32bit_c2_register($18, s) 147 - #define nlm_read_c2_cc3(s) __read_32bit_c2_register($19, s) 148 - #define nlm_read_c2_cc4(s) __read_32bit_c2_register($20, s) 149 - #define nlm_read_c2_cc5(s) __read_32bit_c2_register($21, s) 150 - #define nlm_read_c2_cc6(s) __read_32bit_c2_register($22, s) 151 - #define nlm_read_c2_cc7(s) __read_32bit_c2_register($23, s) 152 - #define nlm_read_c2_cc8(s) __read_32bit_c2_register($24, s) 153 - #define nlm_read_c2_cc9(s) __read_32bit_c2_register($25, s) 154 - #define nlm_read_c2_cc10(s) __read_32bit_c2_register($26, s) 155 - #define nlm_read_c2_cc11(s) __read_32bit_c2_register($27, s) 156 - #define nlm_read_c2_cc12(s) __read_32bit_c2_register($28, s) 157 - #define nlm_read_c2_cc13(s) __read_32bit_c2_register($29, s) 158 - #define nlm_read_c2_cc14(s) __read_32bit_c2_register($30, s) 159 - #define nlm_read_c2_cc15(s) __read_32bit_c2_register($31, s) 160 - 161 - #define nlm_write_c2_cc0(s, v) __write_32bit_c2_register($16, s, v) 162 - #define nlm_write_c2_cc1(s, v) __write_32bit_c2_register($17, s, v) 163 - #define nlm_write_c2_cc2(s, v) __write_32bit_c2_register($18, s, v) 164 - #define nlm_write_c2_cc3(s, v) __write_32bit_c2_register($19, s, v) 165 - #define nlm_write_c2_cc4(s, v) __write_32bit_c2_register($20, s, v) 166 - #define nlm_write_c2_cc5(s, v) __write_32bit_c2_register($21, s, v) 167 - #define nlm_write_c2_cc6(s, v) __write_32bit_c2_register($22, s, v) 168 - #define nlm_write_c2_cc7(s, v) __write_32bit_c2_register($23, s, v) 169 - #define nlm_write_c2_cc8(s, v) __write_32bit_c2_register($24, s, v) 170 - #define nlm_write_c2_cc9(s, v) __write_32bit_c2_register($25, s, v) 171 - #define nlm_write_c2_cc10(s, v) __write_32bit_c2_register($26, s, v) 172 - #define nlm_write_c2_cc11(s, v) __write_32bit_c2_register($27, s, v) 173 - #define nlm_write_c2_cc12(s, v) __write_32bit_c2_register($28, s, v) 174 - #define nlm_write_c2_cc13(s, v) __write_32bit_c2_register($29, s, v) 175 - #define nlm_write_c2_cc14(s, v) __write_32bit_c2_register($30, s, v) 176 - #define nlm_write_c2_cc15(s, v) __write_32bit_c2_register($31, s, v) 177 - 178 - #define nlm_read_c2_status0() __read_32bit_c2_register($2, 0) 179 - #define nlm_write_c2_status0(v) __write_32bit_c2_register($2, 0, v) 180 - #define nlm_read_c2_status1() __read_32bit_c2_register($2, 1) 181 - #define nlm_write_c2_status1(v) __write_32bit_c2_register($2, 1, v) 182 - #define nlm_read_c2_status(sel) __read_32bit_c2_register($2, 0) 183 - #define nlm_read_c2_config() __read_32bit_c2_register($3, 0) 184 - #define nlm_write_c2_config(v) __write_32bit_c2_register($3, 0, v) 185 - #define nlm_read_c2_bucksize(b) __read_32bit_c2_register($4, b) 186 - #define nlm_write_c2_bucksize(b, v) __write_32bit_c2_register($4, b, v) 187 - 188 - #define nlm_read_c2_rx_msg0() __read_64bit_c2_register($1, 0) 189 - #define nlm_read_c2_rx_msg1() __read_64bit_c2_register($1, 1) 190 - #define nlm_read_c2_rx_msg2() __read_64bit_c2_register($1, 2) 191 - #define nlm_read_c2_rx_msg3() __read_64bit_c2_register($1, 3) 192 - 193 - #define nlm_write_c2_tx_msg0(v) __write_64bit_c2_register($0, 0, v) 194 - #define nlm_write_c2_tx_msg1(v) __write_64bit_c2_register($0, 1, v) 195 - #define nlm_write_c2_tx_msg2(v) __write_64bit_c2_register($0, 2, v) 196 - #define nlm_write_c2_tx_msg3(v) __write_64bit_c2_register($0, 3, v) 197 - 198 - #define FMN_STN_RX_QSIZE 256 199 - #define FMN_NSTATIONS 128 200 - #define FMN_CORE_NBUCKETS 8 201 - 202 - static inline void nlm_msgsnd(unsigned int stid) 203 - { 204 - __asm__ volatile ( 205 - ".set push\n" 206 - ".set noreorder\n" 207 - ".set noat\n" 208 - "move $1, %0\n" 209 - "c2 0x10001\n" /* msgsnd $1 */ 210 - ".set pop\n" 211 - : : "r" (stid) : "$1" 212 - ); 213 - } 214 - 215 - static inline void nlm_msgld(unsigned int pri) 216 - { 217 - __asm__ volatile ( 218 - ".set push\n" 219 - ".set noreorder\n" 220 - ".set noat\n" 221 - "move $1, %0\n" 222 - "c2 0x10002\n" /* msgld $1 */ 223 - ".set pop\n" 224 - : : "r" (pri) : "$1" 225 - ); 226 - } 227 - 228 - static inline void nlm_msgwait(unsigned int mask) 229 - { 230 - __asm__ volatile ( 231 - ".set push\n" 232 - ".set noreorder\n" 233 - ".set noat\n" 234 - "move $8, %0\n" 235 - "c2 0x10003\n" /* msgwait $1 */ 236 - ".set pop\n" 237 - : : "r" (mask) : "$1" 238 - ); 239 - } 240 - 241 - /* 242 - * Disable interrupts and enable COP2 access 243 - */ 244 - static inline uint32_t nlm_cop2_enable_irqsave(void) 245 - { 246 - uint32_t sr = read_c0_status(); 247 - 248 - write_c0_status((sr & ~ST0_IE) | ST0_CU2); 249 - return sr; 250 - } 251 - 252 - static inline void nlm_cop2_disable_irqrestore(uint32_t sr) 253 - { 254 - write_c0_status(sr); 255 - } 256 - 257 - static inline void nlm_fmn_setup_intr(int irq, unsigned int tmask) 258 - { 259 - uint32_t config; 260 - 261 - config = (1 << 24) /* interrupt water mark - 1 msg */ 262 - | (irq << 16) /* irq */ 263 - | (tmask << 8) /* thread mask */ 264 - | 0x2; /* enable watermark intr, disable empty intr */ 265 - nlm_write_c2_config(config); 266 - } 267 - 268 - struct nlm_fmn_msg { 269 - uint64_t msg0; 270 - uint64_t msg1; 271 - uint64_t msg2; 272 - uint64_t msg3; 273 - }; 274 - 275 - static inline int nlm_fmn_send(unsigned int size, unsigned int code, 276 - unsigned int stid, struct nlm_fmn_msg *msg) 277 - { 278 - unsigned int dest; 279 - uint32_t status; 280 - int i; 281 - 282 - /* 283 - * Make sure that all the writes pending at the cpu are flushed. 284 - * Any writes pending on CPU will not be see by devices. L1/L2 285 - * caches are coherent with IO, so no cache flush needed. 286 - */ 287 - __asm __volatile("sync"); 288 - 289 - /* Load TX message buffers */ 290 - nlm_write_c2_tx_msg0(msg->msg0); 291 - nlm_write_c2_tx_msg1(msg->msg1); 292 - nlm_write_c2_tx_msg2(msg->msg2); 293 - nlm_write_c2_tx_msg3(msg->msg3); 294 - dest = ((size - 1) << 16) | (code << 8) | stid; 295 - 296 - /* 297 - * Retry a few times on credit fail, this should be a 298 - * transient condition, unless there is a configuration 299 - * failure, or the receiver is stuck. 300 - */ 301 - for (i = 0; i < 8; i++) { 302 - nlm_msgsnd(dest); 303 - status = nlm_read_c2_status0(); 304 - if ((status & 0x4) == 0) 305 - return 0; 306 - } 307 - 308 - /* If there is a credit failure, return error */ 309 - return status & 0x06; 310 - } 311 - 312 - static inline int nlm_fmn_receive(int bucket, int *size, int *code, int *stid, 313 - struct nlm_fmn_msg *msg) 314 - { 315 - uint32_t status, tmp; 316 - 317 - nlm_msgld(bucket); 318 - 319 - /* wait for load pending to clear */ 320 - do { 321 - status = nlm_read_c2_status0(); 322 - } while ((status & 0x08) != 0); 323 - 324 - /* receive error bits */ 325 - tmp = status & 0x30; 326 - if (tmp != 0) 327 - return tmp; 328 - 329 - *size = ((status & 0xc0) >> 6) + 1; 330 - *code = (status & 0xff00) >> 8; 331 - *stid = (status & 0x7f0000) >> 16; 332 - msg->msg0 = nlm_read_c2_rx_msg0(); 333 - msg->msg1 = nlm_read_c2_rx_msg1(); 334 - msg->msg2 = nlm_read_c2_rx_msg2(); 335 - msg->msg3 = nlm_read_c2_rx_msg3(); 336 - 337 - return 0; 338 - } 339 - 340 - struct xlr_fmn_info { 341 - int num_buckets; 342 - int start_stn_id; 343 - int end_stn_id; 344 - int credit_config[128]; 345 - }; 346 - 347 - struct xlr_board_fmn_config { 348 - int bucket_size[128]; /* size of buckets for all stations */ 349 - struct xlr_fmn_info cpu[8]; 350 - struct xlr_fmn_info gmac[2]; 351 - struct xlr_fmn_info dma; 352 - struct xlr_fmn_info cmp; 353 - struct xlr_fmn_info sae; 354 - struct xlr_fmn_info xgmac[2]; 355 - }; 356 - 357 - extern int nlm_register_fmn_handler(int start, int end, 358 - void (*fn)(int, int, int, int, struct nlm_fmn_msg *, void *), 359 - void *arg); 360 - extern void xlr_percpu_fmn_init(void); 361 - extern void nlm_setup_fmn_irq(void); 362 - extern void xlr_board_info_setup(void); 363 - 364 - extern struct xlr_board_fmn_config xlr_board_fmn_config; 365 - #endif
-74
arch/mips/include/asm/netlogic/xlr/gpio.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NLM_GPIO_H 36 - #define _ASM_NLM_GPIO_H 37 - 38 - #define GPIO_INT_EN_REG 0 39 - #define GPIO_INPUT_INVERSION_REG 1 40 - #define GPIO_IO_DIR_REG 2 41 - #define GPIO_IO_DATA_WR_REG 3 42 - #define GPIO_IO_DATA_RD_REG 4 43 - 44 - #define GPIO_SWRESET_REG 8 45 - #define GPIO_DRAM1_CNTRL_REG 9 46 - #define GPIO_DRAM1_RATIO_REG 10 47 - #define GPIO_DRAM1_RESET_REG 11 48 - #define GPIO_DRAM1_STATUS_REG 12 49 - #define GPIO_DRAM2_CNTRL_REG 13 50 - #define GPIO_DRAM2_RATIO_REG 14 51 - #define GPIO_DRAM2_RESET_REG 15 52 - #define GPIO_DRAM2_STATUS_REG 16 53 - 54 - #define GPIO_PWRON_RESET_CFG_REG 21 55 - #define GPIO_BIST_ALL_GO_STATUS_REG 24 56 - #define GPIO_BIST_CPU_GO_STATUS_REG 25 57 - #define GPIO_BIST_DEV_GO_STATUS_REG 26 58 - 59 - #define GPIO_FUSE_BANK_REG 35 60 - #define GPIO_CPU_RESET_REG 40 61 - #define GPIO_RNG_REG 43 62 - 63 - #define PWRON_RESET_PCMCIA_BOOT 17 64 - 65 - #define GPIO_LED_BITMAP 0x1700000 66 - #define GPIO_LED_0_SHIFT 20 67 - #define GPIO_LED_1_SHIFT 24 68 - 69 - #define GPIO_LED_OUTPUT_CODE_RESET 0x01 70 - #define GPIO_LED_OUTPUT_CODE_HARD_RESET 0x02 71 - #define GPIO_LED_OUTPUT_CODE_SOFT_RESET 0x03 72 - #define GPIO_LED_OUTPUT_CODE_MAIN 0x04 73 - 74 - #endif
-109
arch/mips/include/asm/netlogic/xlr/iomap.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NLM_IOMAP_H 36 - #define _ASM_NLM_IOMAP_H 37 - 38 - #define DEFAULT_NETLOGIC_IO_BASE CKSEG1ADDR(0x1ef00000) 39 - #define NETLOGIC_IO_DDR2_CHN0_OFFSET 0x01000 40 - #define NETLOGIC_IO_DDR2_CHN1_OFFSET 0x02000 41 - #define NETLOGIC_IO_DDR2_CHN2_OFFSET 0x03000 42 - #define NETLOGIC_IO_DDR2_CHN3_OFFSET 0x04000 43 - #define NETLOGIC_IO_PIC_OFFSET 0x08000 44 - #define NETLOGIC_IO_UART_0_OFFSET 0x14000 45 - #define NETLOGIC_IO_UART_1_OFFSET 0x15100 46 - 47 - #define NETLOGIC_IO_SIZE 0x1000 48 - 49 - #define NETLOGIC_IO_BRIDGE_OFFSET 0x00000 50 - 51 - #define NETLOGIC_IO_RLD2_CHN0_OFFSET 0x05000 52 - #define NETLOGIC_IO_RLD2_CHN1_OFFSET 0x06000 53 - 54 - #define NETLOGIC_IO_SRAM_OFFSET 0x07000 55 - 56 - #define NETLOGIC_IO_PCIX_OFFSET 0x09000 57 - #define NETLOGIC_IO_HT_OFFSET 0x0A000 58 - 59 - #define NETLOGIC_IO_SECURITY_OFFSET 0x0B000 60 - 61 - #define NETLOGIC_IO_GMAC_0_OFFSET 0x0C000 62 - #define NETLOGIC_IO_GMAC_1_OFFSET 0x0D000 63 - #define NETLOGIC_IO_GMAC_2_OFFSET 0x0E000 64 - #define NETLOGIC_IO_GMAC_3_OFFSET 0x0F000 65 - 66 - /* XLS devices */ 67 - #define NETLOGIC_IO_GMAC_4_OFFSET 0x20000 68 - #define NETLOGIC_IO_GMAC_5_OFFSET 0x21000 69 - #define NETLOGIC_IO_GMAC_6_OFFSET 0x22000 70 - #define NETLOGIC_IO_GMAC_7_OFFSET 0x23000 71 - 72 - #define NETLOGIC_IO_PCIE_0_OFFSET 0x1E000 73 - #define NETLOGIC_IO_PCIE_1_OFFSET 0x1F000 74 - #define NETLOGIC_IO_SRIO_0_OFFSET 0x1E000 75 - #define NETLOGIC_IO_SRIO_1_OFFSET 0x1F000 76 - 77 - #define NETLOGIC_IO_USB_0_OFFSET 0x24000 78 - #define NETLOGIC_IO_USB_1_OFFSET 0x25000 79 - 80 - #define NETLOGIC_IO_COMP_OFFSET 0x1D000 81 - /* end XLS devices */ 82 - 83 - /* XLR devices */ 84 - #define NETLOGIC_IO_SPI4_0_OFFSET 0x10000 85 - #define NETLOGIC_IO_XGMAC_0_OFFSET 0x11000 86 - #define NETLOGIC_IO_SPI4_1_OFFSET 0x12000 87 - #define NETLOGIC_IO_XGMAC_1_OFFSET 0x13000 88 - /* end XLR devices */ 89 - 90 - #define NETLOGIC_IO_I2C_0_OFFSET 0x16000 91 - #define NETLOGIC_IO_I2C_1_OFFSET 0x17000 92 - 93 - #define NETLOGIC_IO_GPIO_OFFSET 0x18000 94 - #define NETLOGIC_IO_FLASH_OFFSET 0x19000 95 - #define NETLOGIC_IO_TB_OFFSET 0x1C000 96 - 97 - #define NETLOGIC_CPLD_OFFSET KSEG1ADDR(0x1d840000) 98 - 99 - /* 100 - * Base Address (Virtual) of the PCI Config address space 101 - * For now, choose 256M phys in kseg1 = 0xA0000000 + (1<<28) 102 - * Config space spans 256 (num of buses) * 256 (num functions) * 256 bytes 103 - * ie 1<<24 = 16M 104 - */ 105 - #define DEFAULT_PCI_CONFIG_BASE 0x18000000 106 - #define DEFAULT_HT_TYPE0_CFG_BASE 0x16000000 107 - #define DEFAULT_HT_TYPE1_CFG_BASE 0x17000000 108 - 109 - #endif
-84
arch/mips/include/asm/netlogic/xlr/msidef.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef ASM_RMI_MSIDEF_H 36 - #define ASM_RMI_MSIDEF_H 37 - 38 - /* 39 - * Constants for Intel APIC based MSI messages. 40 - * Adapted for the RMI XLR using identical defines 41 - */ 42 - 43 - /* 44 - * Shifts for MSI data 45 - */ 46 - 47 - #define MSI_DATA_VECTOR_SHIFT 0 48 - #define MSI_DATA_VECTOR_MASK 0x000000ff 49 - #define MSI_DATA_VECTOR(v) (((v) << MSI_DATA_VECTOR_SHIFT) & \ 50 - MSI_DATA_VECTOR_MASK) 51 - 52 - #define MSI_DATA_DELIVERY_MODE_SHIFT 8 53 - #define MSI_DATA_DELIVERY_FIXED (0 << MSI_DATA_DELIVERY_MODE_SHIFT) 54 - #define MSI_DATA_DELIVERY_LOWPRI (1 << MSI_DATA_DELIVERY_MODE_SHIFT) 55 - 56 - #define MSI_DATA_LEVEL_SHIFT 14 57 - #define MSI_DATA_LEVEL_DEASSERT (0 << MSI_DATA_LEVEL_SHIFT) 58 - #define MSI_DATA_LEVEL_ASSERT (1 << MSI_DATA_LEVEL_SHIFT) 59 - 60 - #define MSI_DATA_TRIGGER_SHIFT 15 61 - #define MSI_DATA_TRIGGER_EDGE (0 << MSI_DATA_TRIGGER_SHIFT) 62 - #define MSI_DATA_TRIGGER_LEVEL (1 << MSI_DATA_TRIGGER_SHIFT) 63 - 64 - /* 65 - * Shift/mask fields for msi address 66 - */ 67 - 68 - #define MSI_ADDR_BASE_HI 0 69 - #define MSI_ADDR_BASE_LO 0xfee00000 70 - 71 - #define MSI_ADDR_DEST_MODE_SHIFT 2 72 - #define MSI_ADDR_DEST_MODE_PHYSICAL (0 << MSI_ADDR_DEST_MODE_SHIFT) 73 - #define MSI_ADDR_DEST_MODE_LOGICAL (1 << MSI_ADDR_DEST_MODE_SHIFT) 74 - 75 - #define MSI_ADDR_REDIRECTION_SHIFT 3 76 - #define MSI_ADDR_REDIRECTION_CPU (0 << MSI_ADDR_REDIRECTION_SHIFT) 77 - #define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT) 78 - 79 - #define MSI_ADDR_DEST_ID_SHIFT 12 80 - #define MSI_ADDR_DEST_ID_MASK 0x00ffff0 81 - #define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ 82 - MSI_ADDR_DEST_ID_MASK) 83 - 84 - #endif /* ASM_RMI_MSIDEF_H */
-306
arch/mips/include/asm/netlogic/xlr/pic.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NLM_XLR_PIC_H 36 - #define _ASM_NLM_XLR_PIC_H 37 - 38 - #define PIC_CLK_HZ 66666666 39 - #define pic_timer_freq() PIC_CLK_HZ 40 - 41 - /* PIC hardware interrupt numbers */ 42 - #define PIC_IRT_WD_INDEX 0 43 - #define PIC_IRT_TIMER_0_INDEX 1 44 - #define PIC_IRT_TIMER_INDEX(i) ((i) + PIC_IRT_TIMER_0_INDEX) 45 - #define PIC_IRT_TIMER_1_INDEX 2 46 - #define PIC_IRT_TIMER_2_INDEX 3 47 - #define PIC_IRT_TIMER_3_INDEX 4 48 - #define PIC_IRT_TIMER_4_INDEX 5 49 - #define PIC_IRT_TIMER_5_INDEX 6 50 - #define PIC_IRT_TIMER_6_INDEX 7 51 - #define PIC_IRT_TIMER_7_INDEX 8 52 - #define PIC_IRT_CLOCK_INDEX PIC_IRT_TIMER_7_INDEX 53 - #define PIC_IRT_UART_0_INDEX 9 54 - #define PIC_IRT_UART_1_INDEX 10 55 - #define PIC_IRT_I2C_0_INDEX 11 56 - #define PIC_IRT_I2C_1_INDEX 12 57 - #define PIC_IRT_PCMCIA_INDEX 13 58 - #define PIC_IRT_GPIO_INDEX 14 59 - #define PIC_IRT_HYPER_INDEX 15 60 - #define PIC_IRT_PCIX_INDEX 16 61 - /* XLS */ 62 - #define PIC_IRT_CDE_INDEX 15 63 - #define PIC_IRT_BRIDGE_TB_XLS_INDEX 16 64 - /* XLS */ 65 - #define PIC_IRT_GMAC0_INDEX 17 66 - #define PIC_IRT_GMAC1_INDEX 18 67 - #define PIC_IRT_GMAC2_INDEX 19 68 - #define PIC_IRT_GMAC3_INDEX 20 69 - #define PIC_IRT_XGS0_INDEX 21 70 - #define PIC_IRT_XGS1_INDEX 22 71 - #define PIC_IRT_HYPER_FATAL_INDEX 23 72 - #define PIC_IRT_PCIX_FATAL_INDEX 24 73 - #define PIC_IRT_BRIDGE_AERR_INDEX 25 74 - #define PIC_IRT_BRIDGE_BERR_INDEX 26 75 - #define PIC_IRT_BRIDGE_TB_XLR_INDEX 27 76 - #define PIC_IRT_BRIDGE_AERR_NMI_INDEX 28 77 - /* XLS */ 78 - #define PIC_IRT_GMAC4_INDEX 21 79 - #define PIC_IRT_GMAC5_INDEX 22 80 - #define PIC_IRT_GMAC6_INDEX 23 81 - #define PIC_IRT_GMAC7_INDEX 24 82 - #define PIC_IRT_BRIDGE_ERR_INDEX 25 83 - #define PIC_IRT_PCIE_LINK0_INDEX 26 84 - #define PIC_IRT_PCIE_LINK1_INDEX 27 85 - #define PIC_IRT_PCIE_LINK2_INDEX 23 86 - #define PIC_IRT_PCIE_LINK3_INDEX 24 87 - #define PIC_IRT_PCIE_XLSB0_LINK2_INDEX 28 88 - #define PIC_IRT_PCIE_XLSB0_LINK3_INDEX 29 89 - #define PIC_IRT_SRIO_LINK0_INDEX 26 90 - #define PIC_IRT_SRIO_LINK1_INDEX 27 91 - #define PIC_IRT_SRIO_LINK2_INDEX 28 92 - #define PIC_IRT_SRIO_LINK3_INDEX 29 93 - #define PIC_IRT_PCIE_INT_INDEX 28 94 - #define PIC_IRT_PCIE_FATAL_INDEX 29 95 - #define PIC_IRT_GPIO_B_INDEX 30 96 - #define PIC_IRT_USB_INDEX 31 97 - /* XLS */ 98 - #define PIC_NUM_IRTS 32 99 - 100 - 101 - #define PIC_CLOCK_TIMER 7 102 - 103 - /* PIC Registers */ 104 - #define PIC_CTRL 0x00 105 - #define PIC_CTRL_STE 8 /* timer enable start bit */ 106 - #define PIC_IPI 0x04 107 - #define PIC_INT_ACK 0x06 108 - 109 - #define WD_MAX_VAL_0 0x08 110 - #define WD_MAX_VAL_1 0x09 111 - #define WD_MASK_0 0x0a 112 - #define WD_MASK_1 0x0b 113 - #define WD_HEARBEAT_0 0x0c 114 - #define WD_HEARBEAT_1 0x0d 115 - 116 - #define PIC_IRT_0_BASE 0x40 117 - #define PIC_IRT_1_BASE 0x80 118 - #define PIC_TIMER_MAXVAL_0_BASE 0x100 119 - #define PIC_TIMER_MAXVAL_1_BASE 0x110 120 - #define PIC_TIMER_COUNT_0_BASE 0x120 121 - #define PIC_TIMER_COUNT_1_BASE 0x130 122 - 123 - #define PIC_IRT_0(picintr) (PIC_IRT_0_BASE + (picintr)) 124 - #define PIC_IRT_1(picintr) (PIC_IRT_1_BASE + (picintr)) 125 - 126 - #define PIC_TIMER_MAXVAL_0(i) (PIC_TIMER_MAXVAL_0_BASE + (i)) 127 - #define PIC_TIMER_MAXVAL_1(i) (PIC_TIMER_MAXVAL_1_BASE + (i)) 128 - #define PIC_TIMER_COUNT_0(i) (PIC_TIMER_COUNT_0_BASE + (i)) 129 - #define PIC_TIMER_COUNT_1(i) (PIC_TIMER_COUNT_0_BASE + (i)) 130 - 131 - /* 132 - * Mapping between hardware interrupt numbers and IRQs on CPU 133 - * we use a simple scheme to map PIC interrupts 0-31 to IRQs 134 - * 8-39. This leaves the IRQ 0-7 for cpu interrupts like 135 - * count/compare and FMN 136 - */ 137 - #define PIC_IRQ_BASE 8 138 - #define PIC_INTR_TO_IRQ(i) (PIC_IRQ_BASE + (i)) 139 - #define PIC_IRQ_TO_INTR(i) ((i) - PIC_IRQ_BASE) 140 - 141 - #define PIC_IRT_FIRST_IRQ PIC_IRQ_BASE 142 - #define PIC_WD_IRQ PIC_INTR_TO_IRQ(PIC_IRT_WD_INDEX) 143 - #define PIC_TIMER_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_0_INDEX) 144 - #define PIC_TIMER_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_1_INDEX) 145 - #define PIC_TIMER_2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_2_INDEX) 146 - #define PIC_TIMER_3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_3_INDEX) 147 - #define PIC_TIMER_4_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_4_INDEX) 148 - #define PIC_TIMER_5_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_5_INDEX) 149 - #define PIC_TIMER_6_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_6_INDEX) 150 - #define PIC_TIMER_7_IRQ PIC_INTR_TO_IRQ(PIC_IRT_TIMER_7_INDEX) 151 - #define PIC_CLOCK_IRQ (PIC_TIMER_7_IRQ) 152 - #define PIC_UART_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_UART_0_INDEX) 153 - #define PIC_UART_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_UART_1_INDEX) 154 - #define PIC_I2C_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_I2C_0_INDEX) 155 - #define PIC_I2C_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_I2C_1_INDEX) 156 - #define PIC_PCMCIA_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCMCIA_INDEX) 157 - #define PIC_GPIO_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GPIO_INDEX) 158 - #define PIC_HYPER_IRQ PIC_INTR_TO_IRQ(PIC_IRT_HYPER_INDEX) 159 - #define PIC_PCIX_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIX_INDEX) 160 - /* XLS */ 161 - #define PIC_CDE_IRQ PIC_INTR_TO_IRQ(PIC_IRT_CDE_INDEX) 162 - #define PIC_BRIDGE_TB_XLS_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_TB_XLS_INDEX) 163 - /* end XLS */ 164 - #define PIC_GMAC_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC0_INDEX) 165 - #define PIC_GMAC_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC1_INDEX) 166 - #define PIC_GMAC_2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC2_INDEX) 167 - #define PIC_GMAC_3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC3_INDEX) 168 - #define PIC_XGS_0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_XGS0_INDEX) 169 - #define PIC_XGS_1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_XGS1_INDEX) 170 - #define PIC_HYPER_FATAL_IRQ PIC_INTR_TO_IRQ(PIC_IRT_HYPER_FATAL_INDEX) 171 - #define PIC_PCIX_FATAL_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIX_FATAL_INDEX) 172 - #define PIC_BRIDGE_AERR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_AERR_INDEX) 173 - #define PIC_BRIDGE_BERR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_BERR_INDEX) 174 - #define PIC_BRIDGE_TB_XLR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_TB_XLR_INDEX) 175 - #define PIC_BRIDGE_AERR_NMI_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_AERR_NMI_INDEX) 176 - /* XLS defines */ 177 - #define PIC_GMAC_4_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC4_INDEX) 178 - #define PIC_GMAC_5_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC5_INDEX) 179 - #define PIC_GMAC_6_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC6_INDEX) 180 - #define PIC_GMAC_7_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GMAC7_INDEX) 181 - #define PIC_BRIDGE_ERR_IRQ PIC_INTR_TO_IRQ(PIC_IRT_BRIDGE_ERR_INDEX) 182 - #define PIC_PCIE_LINK0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK0_INDEX) 183 - #define PIC_PCIE_LINK1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK1_INDEX) 184 - #define PIC_PCIE_LINK2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK2_INDEX) 185 - #define PIC_PCIE_LINK3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_LINK3_INDEX) 186 - #define PIC_PCIE_XLSB0_LINK2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_XLSB0_LINK2_INDEX) 187 - #define PIC_PCIE_XLSB0_LINK3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_XLSB0_LINK3_INDEX) 188 - #define PIC_SRIO_LINK0_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK0_INDEX) 189 - #define PIC_SRIO_LINK1_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK1_INDEX) 190 - #define PIC_SRIO_LINK2_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK2_INDEX) 191 - #define PIC_SRIO_LINK3_IRQ PIC_INTR_TO_IRQ(PIC_IRT_SRIO_LINK3_INDEX) 192 - #define PIC_PCIE_INT_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_INT__INDEX) 193 - #define PIC_PCIE_FATAL_IRQ PIC_INTR_TO_IRQ(PIC_IRT_PCIE_FATAL_INDEX) 194 - #define PIC_GPIO_B_IRQ PIC_INTR_TO_IRQ(PIC_IRT_GPIO_B_INDEX) 195 - #define PIC_USB_IRQ PIC_INTR_TO_IRQ(PIC_IRT_USB_INDEX) 196 - #define PIC_IRT_LAST_IRQ PIC_USB_IRQ 197 - /* end XLS */ 198 - 199 - #ifndef __ASSEMBLY__ 200 - 201 - #define PIC_IRQ_IS_EDGE_TRIGGERED(irq) (((irq) >= PIC_TIMER_0_IRQ) && \ 202 - ((irq) <= PIC_TIMER_7_IRQ)) 203 - #define PIC_IRQ_IS_IRT(irq) (((irq) >= PIC_IRT_FIRST_IRQ) && \ 204 - ((irq) <= PIC_IRT_LAST_IRQ)) 205 - 206 - static inline int 207 - nlm_irq_to_irt(int irq) 208 - { 209 - if (PIC_IRQ_IS_IRT(irq) == 0) 210 - return -1; 211 - 212 - return PIC_IRQ_TO_INTR(irq); 213 - } 214 - 215 - static inline int 216 - nlm_irt_to_irq(int irt) 217 - { 218 - 219 - return PIC_INTR_TO_IRQ(irt); 220 - } 221 - 222 - static inline void 223 - nlm_pic_enable_irt(uint64_t base, int irt) 224 - { 225 - uint32_t reg; 226 - 227 - reg = nlm_read_reg(base, PIC_IRT_1(irt)); 228 - nlm_write_reg(base, PIC_IRT_1(irt), reg | (1u << 31)); 229 - } 230 - 231 - static inline void 232 - nlm_pic_disable_irt(uint64_t base, int irt) 233 - { 234 - uint32_t reg; 235 - 236 - reg = nlm_read_reg(base, PIC_IRT_1(irt)); 237 - nlm_write_reg(base, PIC_IRT_1(irt), reg & ~(1u << 31)); 238 - } 239 - 240 - static inline void 241 - nlm_pic_send_ipi(uint64_t base, int hwt, int irq, int nmi) 242 - { 243 - unsigned int tid, pid; 244 - 245 - tid = hwt & 0x3; 246 - pid = (hwt >> 2) & 0x07; 247 - nlm_write_reg(base, PIC_IPI, 248 - (pid << 20) | (tid << 16) | (nmi << 8) | irq); 249 - } 250 - 251 - static inline void 252 - nlm_pic_ack(uint64_t base, int irt) 253 - { 254 - nlm_write_reg(base, PIC_INT_ACK, 1u << irt); 255 - } 256 - 257 - static inline void 258 - nlm_pic_init_irt(uint64_t base, int irt, int irq, int hwt, int en) 259 - { 260 - nlm_write_reg(base, PIC_IRT_0(irt), (1u << hwt)); 261 - /* local scheduling, invalid, level by default */ 262 - nlm_write_reg(base, PIC_IRT_1(irt), 263 - (en << 30) | (1 << 6) | irq); 264 - } 265 - 266 - static inline uint64_t 267 - nlm_pic_read_timer(uint64_t base, int timer) 268 - { 269 - uint32_t up1, up2, low; 270 - 271 - up1 = nlm_read_reg(base, PIC_TIMER_COUNT_1(timer)); 272 - low = nlm_read_reg(base, PIC_TIMER_COUNT_0(timer)); 273 - up2 = nlm_read_reg(base, PIC_TIMER_COUNT_1(timer)); 274 - 275 - if (up1 != up2) /* wrapped, get the new low */ 276 - low = nlm_read_reg(base, PIC_TIMER_COUNT_0(timer)); 277 - return ((uint64_t)up2 << 32) | low; 278 - 279 - } 280 - 281 - static inline uint32_t 282 - nlm_pic_read_timer32(uint64_t base, int timer) 283 - { 284 - return nlm_read_reg(base, PIC_TIMER_COUNT_0(timer)); 285 - } 286 - 287 - static inline void 288 - nlm_pic_set_timer(uint64_t base, int timer, uint64_t value, int irq, int cpu) 289 - { 290 - uint32_t up, low; 291 - uint64_t pic_ctrl = nlm_read_reg(base, PIC_CTRL); 292 - int en; 293 - 294 - en = (irq > 0); 295 - up = value >> 32; 296 - low = value & 0xFFFFFFFF; 297 - nlm_write_reg(base, PIC_TIMER_MAXVAL_0(timer), low); 298 - nlm_write_reg(base, PIC_TIMER_MAXVAL_1(timer), up); 299 - nlm_pic_init_irt(base, PIC_IRT_TIMER_INDEX(timer), irq, cpu, 0); 300 - 301 - /* enable the timer */ 302 - pic_ctrl |= (1 << (PIC_CTRL_STE + timer)); 303 - nlm_write_reg(base, PIC_CTRL, pic_ctrl); 304 - } 305 - #endif 306 - #endif /* _ASM_NLM_XLR_PIC_H */
-59
arch/mips/include/asm/netlogic/xlr/xlr.h
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #ifndef _ASM_NLM_XLR_H 36 - #define _ASM_NLM_XLR_H 37 - 38 - /* SMP helpers */ 39 - void xlr_wakeup_secondary_cpus(void); 40 - 41 - /* XLS B silicon "Rook" */ 42 - static inline unsigned int nlm_chip_is_xls_b(void) 43 - { 44 - uint32_t prid = read_c0_prid(); 45 - 46 - return ((prid & 0xf000) == 0x4000); 47 - } 48 - 49 - /* XLR chip types */ 50 - /* The XLS product line has chip versions 0x[48c]? */ 51 - static inline unsigned int nlm_chip_is_xls(void) 52 - { 53 - uint32_t prid = read_c0_prid(); 54 - 55 - return ((prid & 0xf000) == 0x8000 || (prid & 0xf000) == 0x4000 || 56 - (prid & 0xf000) == 0xc000); 57 - } 58 - 59 - #endif /* _ASM_NLM_XLR_H */
-13
arch/mips/include/asm/processor.h
··· 207 207 [cpu_dcache_line_size() / sizeof(unsigned long)]; 208 208 }; 209 209 210 - #elif defined(CONFIG_CPU_XLP) 211 - struct nlm_cop2_state { 212 - u64 rx[4]; 213 - u64 tx[4]; 214 - u32 tx_msg_status; 215 - u32 rx_msg_status; 216 - }; 217 - 218 - #define COP2_INIT \ 219 - .cp2 = {{0}, {0}, 0, 0}, 220 210 #else 221 211 #define COP2_INIT 222 212 #endif ··· 264 274 #ifdef CONFIG_CPU_CAVIUM_OCTEON 265 275 struct octeon_cop2_state cp2 __attribute__ ((__aligned__(128))); 266 276 struct octeon_cvmseg_state cvmseg __attribute__ ((__aligned__(128))); 267 - #endif 268 - #ifdef CONFIG_CPU_XLP 269 - struct nlm_cop2_state cp2; 270 277 #endif 271 278 struct mips_abi *abi; 272 279 };
-4
arch/mips/include/asm/vermagic.h
··· 54 54 #define MODULE_PROC_FAMILY "OCTEON " 55 55 #elif defined CONFIG_CPU_P5600 56 56 #define MODULE_PROC_FAMILY "P5600 " 57 - #elif defined CONFIG_CPU_XLR 58 - #define MODULE_PROC_FAMILY "XLR " 59 - #elif defined CONFIG_CPU_XLP 60 - #define MODULE_PROC_FAMILY "XLP " 61 57 #else 62 58 #error MODULE_PROC_FAMILY undefined for your processor configuration 63 59 #endif
-84
arch/mips/kernel/cpu-probe.c
··· 1886 1886 } 1887 1887 } 1888 1888 1889 - static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) 1890 - { 1891 - decode_configs(c); 1892 - 1893 - if ((c->processor_id & PRID_IMP_MASK) == PRID_IMP_NETLOGIC_AU13XX) { 1894 - c->cputype = CPU_ALCHEMY; 1895 - __cpu_name[cpu] = "Au1300"; 1896 - /* following stuff is not for Alchemy */ 1897 - return; 1898 - } 1899 - 1900 - c->options = (MIPS_CPU_TLB | 1901 - MIPS_CPU_4KEX | 1902 - MIPS_CPU_COUNTER | 1903 - MIPS_CPU_DIVEC | 1904 - MIPS_CPU_WATCH | 1905 - MIPS_CPU_EJTAG | 1906 - MIPS_CPU_LLSC); 1907 - 1908 - switch (c->processor_id & PRID_IMP_MASK) { 1909 - case PRID_IMP_NETLOGIC_XLP2XX: 1910 - case PRID_IMP_NETLOGIC_XLP9XX: 1911 - case PRID_IMP_NETLOGIC_XLP5XX: 1912 - c->cputype = CPU_XLP; 1913 - __cpu_name[cpu] = "Broadcom XLPII"; 1914 - break; 1915 - 1916 - case PRID_IMP_NETLOGIC_XLP8XX: 1917 - case PRID_IMP_NETLOGIC_XLP3XX: 1918 - c->cputype = CPU_XLP; 1919 - __cpu_name[cpu] = "Netlogic XLP"; 1920 - break; 1921 - 1922 - case PRID_IMP_NETLOGIC_XLR732: 1923 - case PRID_IMP_NETLOGIC_XLR716: 1924 - case PRID_IMP_NETLOGIC_XLR532: 1925 - case PRID_IMP_NETLOGIC_XLR308: 1926 - case PRID_IMP_NETLOGIC_XLR532C: 1927 - case PRID_IMP_NETLOGIC_XLR516C: 1928 - case PRID_IMP_NETLOGIC_XLR508C: 1929 - case PRID_IMP_NETLOGIC_XLR308C: 1930 - c->cputype = CPU_XLR; 1931 - __cpu_name[cpu] = "Netlogic XLR"; 1932 - break; 1933 - 1934 - case PRID_IMP_NETLOGIC_XLS608: 1935 - case PRID_IMP_NETLOGIC_XLS408: 1936 - case PRID_IMP_NETLOGIC_XLS404: 1937 - case PRID_IMP_NETLOGIC_XLS208: 1938 - case PRID_IMP_NETLOGIC_XLS204: 1939 - case PRID_IMP_NETLOGIC_XLS108: 1940 - case PRID_IMP_NETLOGIC_XLS104: 1941 - case PRID_IMP_NETLOGIC_XLS616B: 1942 - case PRID_IMP_NETLOGIC_XLS608B: 1943 - case PRID_IMP_NETLOGIC_XLS416B: 1944 - case PRID_IMP_NETLOGIC_XLS412B: 1945 - case PRID_IMP_NETLOGIC_XLS408B: 1946 - case PRID_IMP_NETLOGIC_XLS404B: 1947 - c->cputype = CPU_XLR; 1948 - __cpu_name[cpu] = "Netlogic XLS"; 1949 - break; 1950 - 1951 - default: 1952 - pr_info("Unknown Netlogic chip id [%02x]!\n", 1953 - c->processor_id); 1954 - c->cputype = CPU_XLR; 1955 - break; 1956 - } 1957 - 1958 - if (c->cputype == CPU_XLP) { 1959 - set_isa(c, MIPS_CPU_ISA_M64R2); 1960 - c->options |= (MIPS_CPU_FPU | MIPS_CPU_ULRI | MIPS_CPU_MCHECK); 1961 - /* This will be updated again after all threads are woken up */ 1962 - c->tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1; 1963 - } else { 1964 - set_isa(c, MIPS_CPU_ISA_M64R1); 1965 - c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1; 1966 - } 1967 - c->kscratch_mask = 0xf; 1968 - } 1969 - 1970 1889 #ifdef CONFIG_64BIT 1971 1890 /* For use by uaccess.h */ 1972 1891 u64 __ua_limit; ··· 1949 2030 case PRID_COMP_INGENIC_D1: 1950 2031 case PRID_COMP_INGENIC_E1: 1951 2032 cpu_probe_ingenic(c, cpu); 1952 - break; 1953 - case PRID_COMP_NETLOGIC: 1954 - cpu_probe_netlogic(c, cpu); 1955 2033 break; 1956 2034 } 1957 2035
-2
arch/mips/kernel/idle.c
··· 175 175 case CPU_CAVIUM_OCTEON3: 176 176 case CPU_XBURST: 177 177 case CPU_LOONGSON32: 178 - case CPU_XLR: 179 - case CPU_XLP: 180 178 cpu_wait = r4k_wait; 181 179 break; 182 180 case CPU_LOONGSON64:
-86
arch/mips/kernel/perf_event_mipsxx.c
··· 1002 1002 [PERF_COUNT_HW_BRANCH_MISSES] = { 0x02, CNTR_ODD, T }, 1003 1003 }; 1004 1004 1005 - static const struct mips_perf_event xlp_event_map[PERF_COUNT_HW_MAX] = { 1006 - [PERF_COUNT_HW_CPU_CYCLES] = { 0x01, CNTR_ALL }, 1007 - [PERF_COUNT_HW_INSTRUCTIONS] = { 0x18, CNTR_ALL }, /* PAPI_TOT_INS */ 1008 - [PERF_COUNT_HW_CACHE_REFERENCES] = { 0x04, CNTR_ALL }, /* PAPI_L1_ICA */ 1009 - [PERF_COUNT_HW_CACHE_MISSES] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */ 1010 - [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = { 0x1b, CNTR_ALL }, /* PAPI_BR_CN */ 1011 - [PERF_COUNT_HW_BRANCH_MISSES] = { 0x1c, CNTR_ALL }, /* PAPI_BR_MSP */ 1012 - }; 1013 - 1014 1005 /* 24K/34K/1004K/interAptiv/loongson1 cores share the same cache event map. */ 1015 1006 static const struct mips_perf_event mipsxxcore_cache_map 1016 1007 [PERF_COUNT_HW_CACHE_MAX] ··· 1468 1477 }, 1469 1478 }; 1470 1479 1471 - static const struct mips_perf_event xlp_cache_map 1472 - [PERF_COUNT_HW_CACHE_MAX] 1473 - [PERF_COUNT_HW_CACHE_OP_MAX] 1474 - [PERF_COUNT_HW_CACHE_RESULT_MAX] = { 1475 - [C(L1D)] = { 1476 - [C(OP_READ)] = { 1477 - [C(RESULT_ACCESS)] = { 0x31, CNTR_ALL }, /* PAPI_L1_DCR */ 1478 - [C(RESULT_MISS)] = { 0x30, CNTR_ALL }, /* PAPI_L1_LDM */ 1479 - }, 1480 - [C(OP_WRITE)] = { 1481 - [C(RESULT_ACCESS)] = { 0x2f, CNTR_ALL }, /* PAPI_L1_DCW */ 1482 - [C(RESULT_MISS)] = { 0x2e, CNTR_ALL }, /* PAPI_L1_STM */ 1483 - }, 1484 - }, 1485 - [C(L1I)] = { 1486 - [C(OP_READ)] = { 1487 - [C(RESULT_ACCESS)] = { 0x04, CNTR_ALL }, /* PAPI_L1_ICA */ 1488 - [C(RESULT_MISS)] = { 0x07, CNTR_ALL }, /* PAPI_L1_ICM */ 1489 - }, 1490 - }, 1491 - [C(LL)] = { 1492 - [C(OP_READ)] = { 1493 - [C(RESULT_ACCESS)] = { 0x35, CNTR_ALL }, /* PAPI_L2_DCR */ 1494 - [C(RESULT_MISS)] = { 0x37, CNTR_ALL }, /* PAPI_L2_LDM */ 1495 - }, 1496 - [C(OP_WRITE)] = { 1497 - [C(RESULT_ACCESS)] = { 0x34, CNTR_ALL }, /* PAPI_L2_DCA */ 1498 - [C(RESULT_MISS)] = { 0x36, CNTR_ALL }, /* PAPI_L2_DCM */ 1499 - }, 1500 - }, 1501 - [C(DTLB)] = { 1502 - /* 1503 - * Only general DTLB misses are counted use the same event for 1504 - * read and write. 1505 - */ 1506 - [C(OP_READ)] = { 1507 - [C(RESULT_MISS)] = { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */ 1508 - }, 1509 - [C(OP_WRITE)] = { 1510 - [C(RESULT_MISS)] = { 0x2d, CNTR_ALL }, /* PAPI_TLB_DM */ 1511 - }, 1512 - }, 1513 - [C(ITLB)] = { 1514 - [C(OP_READ)] = { 1515 - [C(RESULT_MISS)] = { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */ 1516 - }, 1517 - [C(OP_WRITE)] = { 1518 - [C(RESULT_MISS)] = { 0x08, CNTR_ALL }, /* PAPI_TLB_IM */ 1519 - }, 1520 - }, 1521 - [C(BPU)] = { 1522 - [C(OP_READ)] = { 1523 - [C(RESULT_MISS)] = { 0x25, CNTR_ALL }, 1524 - }, 1525 - }, 1526 - }; 1527 - 1528 1480 static int __hw_perf_event_init(struct perf_event *event) 1529 1481 { 1530 1482 struct perf_event_attr *attr = &event->attr; ··· 1887 1953 return &raw_event; 1888 1954 } 1889 1955 1890 - static const struct mips_perf_event *xlp_pmu_map_raw_event(u64 config) 1891 - { 1892 - unsigned int raw_id = config & 0xff; 1893 - 1894 - /* Only 1-63 are defined */ 1895 - if ((raw_id < 0x01) || (raw_id > 0x3f)) 1896 - return ERR_PTR(-EOPNOTSUPP); 1897 - 1898 - raw_event.cntr_mask = CNTR_ALL; 1899 - raw_event.event_id = raw_id; 1900 - 1901 - return &raw_event; 1902 - } 1903 - 1904 1956 static int __init 1905 1957 init_hw_perf_events(void) 1906 1958 { ··· 2010 2090 mipspmu.name = "BMIPS5000"; 2011 2091 mipspmu.general_event_map = &bmips5000_event_map; 2012 2092 mipspmu.cache_event_map = &bmips5000_cache_map; 2013 - break; 2014 - case CPU_XLP: 2015 - mipspmu.name = "xlp"; 2016 - mipspmu.general_event_map = &xlp_event_map; 2017 - mipspmu.cache_event_map = &xlp_cache_map; 2018 - mipspmu.map_raw_event = xlp_pmu_map_raw_event; 2019 2093 break; 2020 2094 default: 2021 2095 pr_cont("Either hardware does not support performance "
+1 -7
arch/mips/kvm/entry.c
··· 104 104 */ 105 105 static int c0_kscratch(void) 106 106 { 107 - switch (boot_cpu_type()) { 108 - case CPU_XLP: 109 - case CPU_XLR: 110 - return 22; 111 - default: 112 - return 31; 113 - } 107 + return 31; 114 108 } 115 109 116 110 /**
-2
arch/mips/mm/c-r4k.c
··· 1410 1410 case CPU_I6500: 1411 1411 case CPU_SB1: 1412 1412 case CPU_SB1A: 1413 - case CPU_XLR: 1414 1413 c->dcache.flags |= MIPS_CACHE_PINDEX; 1415 1414 break; 1416 1415 ··· 1698 1699 return; 1699 1700 1700 1701 case CPU_CAVIUM_OCTEON3: 1701 - case CPU_XLP: 1702 1702 /* don't need to worry about L2, fully coherent */ 1703 1703 return; 1704 1704
+1 -8
arch/mips/mm/tlbex.c
··· 325 325 326 326 static inline int __maybe_unused c0_kscratch(void) 327 327 { 328 - switch (current_cpu_type()) { 329 - case CPU_XLP: 330 - case CPU_XLR: 331 - return 22; 332 - default: 333 - return 31; 334 - } 328 + return 31; 335 329 } 336 330 337 331 static int allocate_kscratch(void) ··· 547 553 case CPU_5KC: 548 554 case CPU_TX49XX: 549 555 case CPU_PR4450: 550 - case CPU_XLR: 551 556 uasm_i_nop(p); 552 557 tlbw(p); 553 558 break;
-86
arch/mips/netlogic/Kconfig
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - if NLM_XLP_BOARD || NLM_XLR_BOARD 3 - 4 - if NLM_XLP_BOARD 5 - config DT_XLP_EVP 6 - bool "Built-in device tree for XLP EVP boards" 7 - default y 8 - select BUILTIN_DTB 9 - help 10 - Add an FDT blob for XLP EVP boards into the kernel. 11 - This DTB will be used if the firmware does not pass in a DTB 12 - pointer to the kernel. The corresponding DTS file is at 13 - arch/mips/netlogic/dts/xlp_evp.dts 14 - 15 - config DT_XLP_SVP 16 - bool "Built-in device tree for XLP SVP boards" 17 - default y 18 - select BUILTIN_DTB 19 - help 20 - Add an FDT blob for XLP VP boards into the kernel. 21 - This DTB will be used if the firmware does not pass in a DTB 22 - pointer to the kernel. The corresponding DTS file is at 23 - arch/mips/netlogic/dts/xlp_svp.dts 24 - 25 - config DT_XLP_FVP 26 - bool "Built-in device tree for XLP FVP boards" 27 - default y 28 - select BUILTIN_DTB 29 - help 30 - Add an FDT blob for XLP FVP board into the kernel. 31 - This DTB will be used if the firmware does not pass in a DTB 32 - pointer to the kernel. The corresponding DTS file is at 33 - arch/mips/netlogic/dts/xlp_fvp.dts 34 - 35 - config DT_XLP_GVP 36 - bool "Built-in device tree for XLP GVP boards" 37 - default y 38 - select BUILTIN_DTB 39 - help 40 - Add an FDT blob for XLP GVP board into the kernel. 41 - This DTB will be used if the firmware does not pass in a DTB 42 - pointer to the kernel. The corresponding DTS file is at 43 - arch/mips/netlogic/dts/xlp_gvp.dts 44 - 45 - config DT_XLP_RVP 46 - bool "Built-in device tree for XLP RVP boards" 47 - default y 48 - help 49 - Add an FDT blob for XLP RVP board into the kernel. 50 - This DTB will be used if the firmware does not pass in a DTB 51 - pointer to the kernel. The corresponding DTS file is at 52 - arch/mips/netlogic/dts/xlp_rvp.dts 53 - 54 - config NLM_MULTINODE 55 - bool "Support for multi-chip boards" 56 - depends on NLM_XLP_BOARD 57 - default n 58 - help 59 - Add support for boards with 2 or 4 XLPs connected over ICI. 60 - 61 - if NLM_MULTINODE 62 - choice 63 - prompt "Number of XLPs on the board" 64 - default NLM_MULTINODE_2 65 - help 66 - In the multi-node case, specify the number of SoCs on the board. 67 - 68 - config NLM_MULTINODE_2 69 - bool "Dual-XLP board" 70 - help 71 - Support boards with upto two XLPs connected over ICI. 72 - 73 - config NLM_MULTINODE_4 74 - bool "Quad-XLP board" 75 - help 76 - Support boards with upto four XLPs connected over ICI. 77 - 78 - endchoice 79 - 80 - endif 81 - endif 82 - 83 - config NLM_COMMON 84 - bool 85 - 86 - endif
-4
arch/mips/netlogic/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-$(CONFIG_NLM_COMMON) += common/ 3 - obj-$(CONFIG_CPU_XLR) += xlr/ 4 - obj-$(CONFIG_CPU_XLP) += xlp/
-16
arch/mips/netlogic/Platform
··· 1 - # 2 - # NETLOGIC includes 3 - # 4 - cflags-$(CONFIG_NLM_COMMON) += -I$(srctree)/arch/mips/include/asm/mach-netlogic 5 - cflags-$(CONFIG_NLM_COMMON) += -I$(srctree)/arch/mips/include/asm/netlogic 6 - 7 - # 8 - # use mips64 if xlr is not available 9 - # 10 - cflags-$(CONFIG_CPU_XLR) += $(call cc-option,-march=xlr,-march=mips64) 11 - cflags-$(CONFIG_CPU_XLP) += $(call cc-option,-march=xlp,-march=mips64r2) 12 - 13 - # 14 - # NETLOGIC processor support 15 - # 16 - load-$(CONFIG_NLM_COMMON) += 0xffffffff80100000
-5
arch/mips/netlogic/common/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - obj-y += irq.o time.o 3 - obj-y += reset.o 4 - obj-$(CONFIG_SMP) += smp.o smpboot.o 5 - obj-$(CONFIG_EARLY_PRINTK) += earlycons.o
-63
arch/mips/netlogic/common/earlycons.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/types.h> 36 - #include <linux/serial_reg.h> 37 - 38 - #include <asm/mipsregs.h> 39 - #include <asm/setup.h> 40 - #include <asm/netlogic/haldefs.h> 41 - #include <asm/netlogic/common.h> 42 - 43 - #if defined(CONFIG_CPU_XLP) 44 - #include <asm/netlogic/xlp-hal/iomap.h> 45 - #include <asm/netlogic/xlp-hal/xlp.h> 46 - #include <asm/netlogic/xlp-hal/uart.h> 47 - #elif defined(CONFIG_CPU_XLR) 48 - #include <asm/netlogic/xlr/iomap.h> 49 - #endif 50 - 51 - void prom_putchar(char c) 52 - { 53 - uint64_t uartbase; 54 - 55 - #if defined(CONFIG_CPU_XLP) 56 - uartbase = nlm_get_uart_regbase(0, 0); 57 - #elif defined(CONFIG_CPU_XLR) 58 - uartbase = nlm_mmio_base(NETLOGIC_IO_UART_0_OFFSET); 59 - #endif 60 - while ((nlm_read_reg(uartbase, UART_LSR) & UART_LSR_THRE) == 0) 61 - ; 62 - nlm_write_reg(uartbase, UART_TX, c); 63 - }
-350
arch/mips/netlogic/common/irq.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/init.h> 37 - #include <linux/linkage.h> 38 - #include <linux/interrupt.h> 39 - #include <linux/mm.h> 40 - #include <linux/slab.h> 41 - #include <linux/irq.h> 42 - 43 - #include <linux/irqdomain.h> 44 - #include <linux/of_address.h> 45 - #include <linux/of_irq.h> 46 - 47 - #include <asm/errno.h> 48 - #include <asm/signal.h> 49 - #include <asm/ptrace.h> 50 - #include <asm/mipsregs.h> 51 - #include <asm/thread_info.h> 52 - 53 - #include <asm/netlogic/mips-extns.h> 54 - #include <asm/netlogic/interrupt.h> 55 - #include <asm/netlogic/haldefs.h> 56 - #include <asm/netlogic/common.h> 57 - 58 - #if defined(CONFIG_CPU_XLP) 59 - #include <asm/netlogic/xlp-hal/iomap.h> 60 - #include <asm/netlogic/xlp-hal/xlp.h> 61 - #include <asm/netlogic/xlp-hal/pic.h> 62 - #elif defined(CONFIG_CPU_XLR) 63 - #include <asm/netlogic/xlr/iomap.h> 64 - #include <asm/netlogic/xlr/pic.h> 65 - #include <asm/netlogic/xlr/fmn.h> 66 - #else 67 - #error "Unknown CPU" 68 - #endif 69 - 70 - #ifdef CONFIG_SMP 71 - #define SMP_IRQ_MASK ((1ULL << IRQ_IPI_SMP_FUNCTION) | \ 72 - (1ULL << IRQ_IPI_SMP_RESCHEDULE)) 73 - #else 74 - #define SMP_IRQ_MASK 0 75 - #endif 76 - #define PERCPU_IRQ_MASK (SMP_IRQ_MASK | (1ull << IRQ_TIMER) | \ 77 - (1ull << IRQ_FMN)) 78 - 79 - struct nlm_pic_irq { 80 - void (*extra_ack)(struct irq_data *); 81 - struct nlm_soc_info *node; 82 - int picirq; 83 - int irt; 84 - int flags; 85 - }; 86 - 87 - static void xlp_pic_enable(struct irq_data *d) 88 - { 89 - unsigned long flags; 90 - struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d); 91 - 92 - BUG_ON(!pd); 93 - spin_lock_irqsave(&pd->node->piclock, flags); 94 - nlm_pic_enable_irt(pd->node->picbase, pd->irt); 95 - spin_unlock_irqrestore(&pd->node->piclock, flags); 96 - } 97 - 98 - static void xlp_pic_disable(struct irq_data *d) 99 - { 100 - struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d); 101 - unsigned long flags; 102 - 103 - BUG_ON(!pd); 104 - spin_lock_irqsave(&pd->node->piclock, flags); 105 - nlm_pic_disable_irt(pd->node->picbase, pd->irt); 106 - spin_unlock_irqrestore(&pd->node->piclock, flags); 107 - } 108 - 109 - static void xlp_pic_mask_ack(struct irq_data *d) 110 - { 111 - struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d); 112 - 113 - clear_c0_eimr(pd->picirq); 114 - ack_c0_eirr(pd->picirq); 115 - } 116 - 117 - static void xlp_pic_unmask(struct irq_data *d) 118 - { 119 - struct nlm_pic_irq *pd = irq_data_get_irq_chip_data(d); 120 - 121 - BUG_ON(!pd); 122 - 123 - if (pd->extra_ack) 124 - pd->extra_ack(d); 125 - 126 - /* re-enable the intr on this cpu */ 127 - set_c0_eimr(pd->picirq); 128 - 129 - /* Ack is a single write, no need to lock */ 130 - nlm_pic_ack(pd->node->picbase, pd->irt); 131 - } 132 - 133 - static struct irq_chip xlp_pic = { 134 - .name = "XLP-PIC", 135 - .irq_enable = xlp_pic_enable, 136 - .irq_disable = xlp_pic_disable, 137 - .irq_mask_ack = xlp_pic_mask_ack, 138 - .irq_unmask = xlp_pic_unmask, 139 - }; 140 - 141 - static void cpuintr_disable(struct irq_data *d) 142 - { 143 - clear_c0_eimr(d->irq); 144 - } 145 - 146 - static void cpuintr_enable(struct irq_data *d) 147 - { 148 - set_c0_eimr(d->irq); 149 - } 150 - 151 - static void cpuintr_ack(struct irq_data *d) 152 - { 153 - ack_c0_eirr(d->irq); 154 - } 155 - 156 - /* 157 - * Chip definition for CPU originated interrupts(timer, msg) and 158 - * IPIs 159 - */ 160 - struct irq_chip nlm_cpu_intr = { 161 - .name = "XLP-CPU-INTR", 162 - .irq_enable = cpuintr_enable, 163 - .irq_disable = cpuintr_disable, 164 - .irq_mask = cpuintr_disable, 165 - .irq_ack = cpuintr_ack, 166 - .irq_eoi = cpuintr_enable, 167 - }; 168 - 169 - static void __init nlm_init_percpu_irqs(void) 170 - { 171 - int i; 172 - 173 - for (i = 0; i < PIC_IRT_FIRST_IRQ; i++) 174 - irq_set_chip_and_handler(i, &nlm_cpu_intr, handle_percpu_irq); 175 - #ifdef CONFIG_SMP 176 - irq_set_chip_and_handler(IRQ_IPI_SMP_FUNCTION, &nlm_cpu_intr, 177 - nlm_smp_function_ipi_handler); 178 - irq_set_chip_and_handler(IRQ_IPI_SMP_RESCHEDULE, &nlm_cpu_intr, 179 - nlm_smp_resched_ipi_handler); 180 - #endif 181 - } 182 - 183 - 184 - void nlm_setup_pic_irq(int node, int picirq, int irq, int irt) 185 - { 186 - struct nlm_pic_irq *pic_data; 187 - int xirq; 188 - 189 - xirq = nlm_irq_to_xirq(node, irq); 190 - pic_data = kzalloc(sizeof(*pic_data), GFP_KERNEL); 191 - BUG_ON(pic_data == NULL); 192 - pic_data->irt = irt; 193 - pic_data->picirq = picirq; 194 - pic_data->node = nlm_get_node(node); 195 - irq_set_chip_and_handler(xirq, &xlp_pic, handle_level_irq); 196 - irq_set_chip_data(xirq, pic_data); 197 - } 198 - 199 - void nlm_set_pic_extra_ack(int node, int irq, void (*xack)(struct irq_data *)) 200 - { 201 - struct nlm_pic_irq *pic_data; 202 - int xirq; 203 - 204 - xirq = nlm_irq_to_xirq(node, irq); 205 - pic_data = irq_get_chip_data(xirq); 206 - if (WARN_ON(!pic_data)) 207 - return; 208 - pic_data->extra_ack = xack; 209 - } 210 - 211 - static void nlm_init_node_irqs(int node) 212 - { 213 - struct nlm_soc_info *nodep; 214 - int i, irt; 215 - 216 - pr_info("Init IRQ for node %d\n", node); 217 - nodep = nlm_get_node(node); 218 - nodep->irqmask = PERCPU_IRQ_MASK; 219 - for (i = PIC_IRT_FIRST_IRQ; i <= PIC_IRT_LAST_IRQ; i++) { 220 - irt = nlm_irq_to_irt(i); 221 - if (irt == -1) /* unused irq */ 222 - continue; 223 - nodep->irqmask |= 1ull << i; 224 - if (irt == -2) /* not a direct PIC irq */ 225 - continue; 226 - 227 - nlm_pic_init_irt(nodep->picbase, irt, i, 228 - node * nlm_threads_per_node(), 0); 229 - nlm_setup_pic_irq(node, i, i, irt); 230 - } 231 - } 232 - 233 - void nlm_smp_irq_init(int hwtid) 234 - { 235 - int cpu, node; 236 - 237 - cpu = hwtid % nlm_threads_per_node(); 238 - node = hwtid / nlm_threads_per_node(); 239 - 240 - if (cpu == 0 && node != 0) 241 - nlm_init_node_irqs(node); 242 - write_c0_eimr(nlm_get_node(node)->irqmask); 243 - } 244 - 245 - asmlinkage void plat_irq_dispatch(void) 246 - { 247 - uint64_t eirr; 248 - int i, node; 249 - 250 - node = nlm_nodeid(); 251 - eirr = read_c0_eirr_and_eimr(); 252 - if (eirr == 0) 253 - return; 254 - 255 - i = __ffs64(eirr); 256 - /* per-CPU IRQs don't need translation */ 257 - if (i < PIC_IRQ_BASE) { 258 - do_IRQ(i); 259 - return; 260 - } 261 - 262 - #if defined(CONFIG_PCI_MSI) && defined(CONFIG_CPU_XLP) 263 - /* PCI interrupts need a second level dispatch for MSI bits */ 264 - if (i >= PIC_PCIE_LINK_MSI_IRQ(0) && i <= PIC_PCIE_LINK_MSI_IRQ(3)) { 265 - nlm_dispatch_msi(node, i); 266 - return; 267 - } 268 - if (i >= PIC_PCIE_MSIX_IRQ(0) && i <= PIC_PCIE_MSIX_IRQ(3)) { 269 - nlm_dispatch_msix(node, i); 270 - return; 271 - } 272 - 273 - #endif 274 - /* top level irq handling */ 275 - do_IRQ(nlm_irq_to_xirq(node, i)); 276 - } 277 - 278 - #ifdef CONFIG_CPU_XLP 279 - static int __init xlp_of_pic_init(struct device_node *node, 280 - struct device_node *parent) 281 - { 282 - const int n_picirqs = PIC_IRT_LAST_IRQ - PIC_IRQ_BASE + 1; 283 - struct irq_domain *xlp_pic_domain; 284 - struct resource res; 285 - int socid, ret, bus; 286 - 287 - /* we need a hack to get the PIC's SoC chip id */ 288 - ret = of_address_to_resource(node, 0, &res); 289 - if (ret < 0) { 290 - pr_err("PIC %pOFn: reg property not found!\n", node); 291 - return -EINVAL; 292 - } 293 - 294 - if (cpu_is_xlp9xx()) { 295 - bus = (res.start >> 20) & 0xf; 296 - for (socid = 0; socid < NLM_NR_NODES; socid++) { 297 - if (!nlm_node_present(socid)) 298 - continue; 299 - if (nlm_get_node(socid)->socbus == bus) 300 - break; 301 - } 302 - if (socid == NLM_NR_NODES) { 303 - pr_err("PIC %pOFn: Node mapping for bus %d not found!\n", 304 - node, bus); 305 - return -EINVAL; 306 - } 307 - } else { 308 - socid = (res.start >> 18) & 0x3; 309 - if (!nlm_node_present(socid)) { 310 - pr_err("PIC %pOFn: node %d does not exist!\n", 311 - node, socid); 312 - return -EINVAL; 313 - } 314 - } 315 - 316 - if (!nlm_node_present(socid)) { 317 - pr_err("PIC %pOFn: node %d does not exist!\n", node, socid); 318 - return -EINVAL; 319 - } 320 - 321 - xlp_pic_domain = irq_domain_add_legacy(node, n_picirqs, 322 - nlm_irq_to_xirq(socid, PIC_IRQ_BASE), PIC_IRQ_BASE, 323 - &irq_domain_simple_ops, NULL); 324 - if (xlp_pic_domain == NULL) { 325 - pr_err("PIC %pOFn: Creating legacy domain failed!\n", node); 326 - return -EINVAL; 327 - } 328 - pr_info("Node %d: IRQ domain created for PIC@%pR\n", socid, &res); 329 - return 0; 330 - } 331 - 332 - static struct of_device_id __initdata xlp_pic_irq_ids[] = { 333 - { .compatible = "netlogic,xlp-pic", .data = xlp_of_pic_init }, 334 - {}, 335 - }; 336 - #endif 337 - 338 - void __init arch_init_irq(void) 339 - { 340 - /* Initialize the irq descriptors */ 341 - nlm_init_percpu_irqs(); 342 - nlm_init_node_irqs(0); 343 - write_c0_eimr(nlm_current_node()->irqmask); 344 - #if defined(CONFIG_CPU_XLR) 345 - nlm_setup_fmn_irq(); 346 - #endif 347 - #ifdef CONFIG_CPU_XLP 348 - of_irq_init(xlp_pic_irq_ids); 349 - #endif 350 - }
-299
arch/mips/netlogic/common/reset.S
··· 1 - /* 2 - * Copyright 2003-2013 Broadcom Corporation. 3 - * All Rights Reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - 36 - #include <asm/asm.h> 37 - #include <asm/asm-offsets.h> 38 - #include <asm/cpu.h> 39 - #include <asm/cacheops.h> 40 - #include <asm/regdef.h> 41 - #include <asm/mipsregs.h> 42 - #include <asm/stackframe.h> 43 - #include <asm/asmmacro.h> 44 - #include <asm/addrspace.h> 45 - 46 - #include <asm/netlogic/common.h> 47 - 48 - #include <asm/netlogic/xlp-hal/iomap.h> 49 - #include <asm/netlogic/xlp-hal/xlp.h> 50 - #include <asm/netlogic/xlp-hal/sys.h> 51 - #include <asm/netlogic/xlp-hal/cpucontrol.h> 52 - 53 - #define SYS_CPU_COHERENT_BASE CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \ 54 - XLP_IO_SYS_OFFSET(0) + XLP_IO_PCI_HDRSZ + \ 55 - SYS_CPU_NONCOHERENT_MODE * 4 56 - 57 - /* Enable XLP features and workarounds in the LSU */ 58 - .macro xlp_config_lsu 59 - li t0, LSU_DEFEATURE 60 - mfcr t1, t0 61 - 62 - lui t2, 0x4080 /* Enable Unaligned Access, L2HPE */ 63 - or t1, t1, t2 64 - mtcr t1, t0 65 - 66 - li t0, ICU_DEFEATURE 67 - mfcr t1, t0 68 - ori t1, 0x1000 /* Enable Icache partitioning */ 69 - mtcr t1, t0 70 - 71 - li t0, SCHED_DEFEATURE 72 - lui t1, 0x0100 /* Disable BRU accepting ALU ops */ 73 - mtcr t1, t0 74 - .endm 75 - 76 - /* 77 - * Allow access to physical mem >64G by enabling ELPA in PAGEGRAIN 78 - * register. This is needed before going to C code since the SP can 79 - * in this region. Called from all HW threads. 80 - */ 81 - .macro xlp_early_mmu_init 82 - mfc0 t0, CP0_PAGEMASK, 1 83 - li t1, (1 << 29) /* ELPA bit */ 84 - or t0, t1 85 - mtc0 t0, CP0_PAGEMASK, 1 86 - .endm 87 - 88 - /* 89 - * L1D cache has to be flushed before enabling threads in XLP. 90 - * On XLP8xx/XLP3xx, we do a low level flush using processor control 91 - * registers. On XLPII CPUs, usual cache instructions work. 92 - */ 93 - .macro xlp_flush_l1_dcache 94 - mfc0 t0, CP0_PRID 95 - andi t0, t0, PRID_IMP_MASK 96 - slt t1, t0, 0x1200 97 - beqz t1, 15f 98 - nop 99 - 100 - /* XLP8xx low level cache flush */ 101 - li t0, LSU_DEBUG_DATA0 102 - li t1, LSU_DEBUG_ADDR 103 - li t2, 0 /* index */ 104 - li t3, 0x1000 /* loop count */ 105 - 11: 106 - sll v0, t2, 5 107 - mtcr zero, t0 108 - ori v1, v0, 0x3 /* way0 | write_enable | write_active */ 109 - mtcr v1, t1 110 - 12: 111 - mfcr v1, t1 112 - andi v1, 0x1 /* wait for write_active == 0 */ 113 - bnez v1, 12b 114 - nop 115 - mtcr zero, t0 116 - ori v1, v0, 0x7 /* way1 | write_enable | write_active */ 117 - mtcr v1, t1 118 - 13: 119 - mfcr v1, t1 120 - andi v1, 0x1 /* wait for write_active == 0 */ 121 - bnez v1, 13b 122 - nop 123 - addi t2, 1 124 - bne t3, t2, 11b 125 - nop 126 - b 17f 127 - nop 128 - 129 - /* XLPII CPUs, Invalidate all 64k of L1 D-cache */ 130 - 15: 131 - li t0, 0x80000000 132 - li t1, 0x80010000 133 - 16: cache Index_Writeback_Inv_D, 0(t0) 134 - addiu t0, t0, 32 135 - bne t0, t1, 16b 136 - nop 137 - 17: 138 - .endm 139 - 140 - /* 141 - * nlm_reset_entry will be copied to the reset entry point for 142 - * XLR and XLP. The XLP cores start here when they are woken up. This 143 - * is also the NMI entry point. 144 - * 145 - * We use scratch reg 6/7 to save k0/k1 and check for NMI first. 146 - * 147 - * The data corresponding to reset/NMI is stored at RESET_DATA_PHYS 148 - * location, this will have the thread mask (used when core is woken up) 149 - * and the current NMI handler in case we reached here for an NMI. 150 - * 151 - * When a core or thread is newly woken up, it marks itself ready and 152 - * loops in a 'wait'. When the CPU really needs waking up, we send an NMI 153 - * IPI to it, with the NMI handler set to prom_boot_secondary_cpus 154 - */ 155 - .set noreorder 156 - .set noat 157 - .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */ 158 - 159 - FEXPORT(nlm_reset_entry) 160 - dmtc0 k0, $22, 6 161 - dmtc0 k1, $22, 7 162 - mfc0 k0, CP0_STATUS 163 - li k1, 0x80000 164 - and k1, k0, k1 165 - beqz k1, 1f /* go to real reset entry */ 166 - nop 167 - li k1, CKSEG1ADDR(RESET_DATA_PHYS) /* NMI */ 168 - ld k0, BOOT_NMI_HANDLER(k1) 169 - jr k0 170 - nop 171 - 172 - 1: /* Entry point on core wakeup */ 173 - mfc0 t0, CP0_PRID /* processor ID */ 174 - andi t0, PRID_IMP_MASK 175 - li t1, 0x1500 /* XLP 9xx */ 176 - beq t0, t1, 2f /* does not need to set coherent */ 177 - nop 178 - 179 - li t1, 0x1300 /* XLP 5xx */ 180 - beq t0, t1, 2f /* does not need to set coherent */ 181 - nop 182 - 183 - /* set bit in SYS coherent register for the core */ 184 - mfc0 t0, CP0_EBASE 185 - mfc0 t1, CP0_EBASE 186 - srl t1, 5 187 - andi t1, 0x3 /* t1 <- node */ 188 - li t2, 0x40000 189 - mul t3, t2, t1 /* t3 = node * 0x40000 */ 190 - srl t0, t0, 2 191 - and t0, t0, 0x7 /* t0 <- core */ 192 - li t1, 0x1 193 - sll t0, t1, t0 194 - nor t0, t0, zero /* t0 <- ~(1 << core) */ 195 - li t2, SYS_CPU_COHERENT_BASE 196 - add t2, t2, t3 /* t2 <- SYS offset for node */ 197 - lw t1, 0(t2) 198 - and t1, t1, t0 199 - sw t1, 0(t2) 200 - 201 - /* read back to ensure complete */ 202 - lw t1, 0(t2) 203 - sync 204 - 205 - 2: 206 - /* Configure LSU on Non-0 Cores. */ 207 - xlp_config_lsu 208 - /* FALL THROUGH */ 209 - 210 - /* 211 - * Wake up sibling threads from the initial thread in a core. 212 - */ 213 - EXPORT(nlm_boot_siblings) 214 - /* core L1D flush before enable threads */ 215 - xlp_flush_l1_dcache 216 - /* save ra and sp, will be used later (only for boot cpu) */ 217 - dmtc0 ra, $22, 6 218 - dmtc0 sp, $22, 7 219 - /* Enable hw threads by writing to MAP_THREADMODE of the core */ 220 - li t0, CKSEG1ADDR(RESET_DATA_PHYS) 221 - lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */ 222 - li t0, ((CPU_BLOCKID_MAP << 8) | MAP_THREADMODE) 223 - mfcr t2, t0 224 - or t2, t2, t1 225 - mtcr t2, t0 226 - 227 - /* 228 - * The new hardware thread starts at the next instruction 229 - * For all the cases other than core 0 thread 0, we will 230 - * jump to the secondary wait function. 231 - 232 - * NOTE: All GPR contents are lost after the mtcr above! 233 - */ 234 - mfc0 v0, CP0_EBASE 235 - andi v0, 0x3ff /* v0 <- node/core */ 236 - 237 - /* 238 - * Errata: to avoid potential live lock, setup IFU_BRUB_RESERVE 239 - * when running 4 threads per core 240 - */ 241 - andi v1, v0, 0x3 /* v1 <- thread id */ 242 - bnez v1, 2f 243 - nop 244 - 245 - /* thread 0 of each core. */ 246 - li t0, CKSEG1ADDR(RESET_DATA_PHYS) 247 - lw t1, BOOT_THREAD_MODE(t0) /* t1 <- thread mode */ 248 - subu t1, 0x3 /* 4-thread per core mode? */ 249 - bnez t1, 2f 250 - nop 251 - 252 - li t0, IFU_BRUB_RESERVE 253 - li t1, 0x55 254 - mtcr t1, t0 255 - _ehb 256 - 2: 257 - beqz v0, 4f /* boot cpu (cpuid == 0)? */ 258 - nop 259 - 260 - /* setup status reg */ 261 - move t1, zero 262 - #ifdef CONFIG_64BIT 263 - ori t1, ST0_KX 264 - #endif 265 - mtc0 t1, CP0_STATUS 266 - 267 - xlp_early_mmu_init 268 - 269 - /* mark CPU ready */ 270 - li t3, CKSEG1ADDR(RESET_DATA_PHYS) 271 - ADDIU t1, t3, BOOT_CPU_READY 272 - sll v1, v0, 2 273 - PTR_ADDU t1, v1 274 - li t2, 1 275 - sw t2, 0(t1) 276 - /* Wait until NMI hits */ 277 - 3: wait 278 - b 3b 279 - nop 280 - 281 - /* 282 - * For the boot CPU, we have to restore ra and sp and return, rest 283 - * of the registers will be restored by the caller 284 - */ 285 - 4: 286 - dmfc0 ra, $22, 6 287 - dmfc0 sp, $22, 7 288 - jr ra 289 - nop 290 - EXPORT(nlm_reset_entry_end) 291 - 292 - LEAF(nlm_init_boot_cpu) 293 - #ifdef CONFIG_CPU_XLP 294 - xlp_config_lsu 295 - xlp_early_mmu_init 296 - #endif 297 - jr ra 298 - nop 299 - END(nlm_init_boot_cpu)
-285
arch/mips/netlogic/common/smp.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/delay.h> 37 - #include <linux/init.h> 38 - #include <linux/sched/task_stack.h> 39 - #include <linux/smp.h> 40 - #include <linux/irq.h> 41 - 42 - #include <asm/mmu_context.h> 43 - 44 - #include <asm/netlogic/interrupt.h> 45 - #include <asm/netlogic/mips-extns.h> 46 - #include <asm/netlogic/haldefs.h> 47 - #include <asm/netlogic/common.h> 48 - 49 - #if defined(CONFIG_CPU_XLP) 50 - #include <asm/netlogic/xlp-hal/iomap.h> 51 - #include <asm/netlogic/xlp-hal/xlp.h> 52 - #include <asm/netlogic/xlp-hal/pic.h> 53 - #elif defined(CONFIG_CPU_XLR) 54 - #include <asm/netlogic/xlr/iomap.h> 55 - #include <asm/netlogic/xlr/pic.h> 56 - #include <asm/netlogic/xlr/xlr.h> 57 - #else 58 - #error "Unknown CPU" 59 - #endif 60 - 61 - void nlm_send_ipi_single(int logical_cpu, unsigned int action) 62 - { 63 - unsigned int hwtid; 64 - uint64_t picbase; 65 - 66 - /* node id is part of hwtid, and needed for send_ipi */ 67 - hwtid = cpu_logical_map(logical_cpu); 68 - picbase = nlm_get_node(nlm_hwtid_to_node(hwtid))->picbase; 69 - 70 - if (action & SMP_CALL_FUNCTION) 71 - nlm_pic_send_ipi(picbase, hwtid, IRQ_IPI_SMP_FUNCTION, 0); 72 - if (action & SMP_RESCHEDULE_YOURSELF) 73 - nlm_pic_send_ipi(picbase, hwtid, IRQ_IPI_SMP_RESCHEDULE, 0); 74 - } 75 - 76 - void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action) 77 - { 78 - int cpu; 79 - 80 - for_each_cpu(cpu, mask) { 81 - nlm_send_ipi_single(cpu, action); 82 - } 83 - } 84 - 85 - /* IRQ_IPI_SMP_FUNCTION Handler */ 86 - void nlm_smp_function_ipi_handler(struct irq_desc *desc) 87 - { 88 - unsigned int irq = irq_desc_get_irq(desc); 89 - clear_c0_eimr(irq); 90 - ack_c0_eirr(irq); 91 - generic_smp_call_function_interrupt(); 92 - set_c0_eimr(irq); 93 - } 94 - 95 - /* IRQ_IPI_SMP_RESCHEDULE handler */ 96 - void nlm_smp_resched_ipi_handler(struct irq_desc *desc) 97 - { 98 - unsigned int irq = irq_desc_get_irq(desc); 99 - clear_c0_eimr(irq); 100 - ack_c0_eirr(irq); 101 - scheduler_ipi(); 102 - set_c0_eimr(irq); 103 - } 104 - 105 - /* 106 - * Called before going into mips code, early cpu init 107 - */ 108 - void nlm_early_init_secondary(int cpu) 109 - { 110 - change_c0_config(CONF_CM_CMASK, 0x3); 111 - #ifdef CONFIG_CPU_XLP 112 - xlp_mmu_init(); 113 - #endif 114 - write_c0_ebase(nlm_current_node()->ebase); 115 - } 116 - 117 - /* 118 - * Code to run on secondary just after probing the CPU 119 - */ 120 - static void nlm_init_secondary(void) 121 - { 122 - int hwtid; 123 - 124 - hwtid = hard_smp_processor_id(); 125 - cpu_set_core(&current_cpu_data, hwtid / NLM_THREADS_PER_CORE); 126 - current_cpu_data.package = nlm_nodeid(); 127 - nlm_percpu_init(hwtid); 128 - nlm_smp_irq_init(hwtid); 129 - } 130 - 131 - void nlm_prepare_cpus(unsigned int max_cpus) 132 - { 133 - /* declare we are SMT capable */ 134 - smp_num_siblings = nlm_threads_per_core; 135 - } 136 - 137 - void nlm_smp_finish(void) 138 - { 139 - local_irq_enable(); 140 - } 141 - 142 - /* 143 - * Boot all other cpus in the system, initialize them, and bring them into 144 - * the boot function 145 - */ 146 - unsigned long nlm_next_gp; 147 - unsigned long nlm_next_sp; 148 - static cpumask_t phys_cpu_present_mask; 149 - 150 - int nlm_boot_secondary(int logical_cpu, struct task_struct *idle) 151 - { 152 - uint64_t picbase; 153 - int hwtid; 154 - 155 - hwtid = cpu_logical_map(logical_cpu); 156 - picbase = nlm_get_node(nlm_hwtid_to_node(hwtid))->picbase; 157 - 158 - nlm_next_sp = (unsigned long)__KSTK_TOS(idle); 159 - nlm_next_gp = (unsigned long)task_thread_info(idle); 160 - 161 - /* barrier for sp/gp store above */ 162 - __sync(); 163 - nlm_pic_send_ipi(picbase, hwtid, 1, 1); /* NMI */ 164 - 165 - return 0; 166 - } 167 - 168 - void __init nlm_smp_setup(void) 169 - { 170 - unsigned int boot_cpu; 171 - int num_cpus, i, ncore, node; 172 - volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY); 173 - 174 - boot_cpu = hard_smp_processor_id(); 175 - cpumask_clear(&phys_cpu_present_mask); 176 - 177 - cpumask_set_cpu(boot_cpu, &phys_cpu_present_mask); 178 - __cpu_number_map[boot_cpu] = 0; 179 - __cpu_logical_map[0] = boot_cpu; 180 - set_cpu_possible(0, true); 181 - 182 - num_cpus = 1; 183 - for (i = 0; i < NR_CPUS; i++) { 184 - /* 185 - * cpu_ready array is not set for the boot_cpu, 186 - * it is only set for ASPs (see smpboot.S) 187 - */ 188 - if (cpu_ready[i]) { 189 - cpumask_set_cpu(i, &phys_cpu_present_mask); 190 - __cpu_number_map[i] = num_cpus; 191 - __cpu_logical_map[num_cpus] = i; 192 - set_cpu_possible(num_cpus, true); 193 - node = nlm_hwtid_to_node(i); 194 - cpumask_set_cpu(num_cpus, &nlm_get_node(node)->cpumask); 195 - ++num_cpus; 196 - } 197 - } 198 - 199 - pr_info("Physical CPU mask: %*pb\n", 200 - cpumask_pr_args(&phys_cpu_present_mask)); 201 - pr_info("Possible CPU mask: %*pb\n", 202 - cpumask_pr_args(cpu_possible_mask)); 203 - 204 - /* check with the cores we have woken up */ 205 - for (ncore = 0, i = 0; i < NLM_NR_NODES; i++) 206 - ncore += hweight32(nlm_get_node(i)->coremask); 207 - 208 - pr_info("Detected (%dc%dt) %d Slave CPU(s)\n", ncore, 209 - nlm_threads_per_core, num_cpus); 210 - 211 - /* switch NMI handler to boot CPUs */ 212 - nlm_set_nmi_handler(nlm_boot_secondary_cpus); 213 - } 214 - 215 - static int nlm_parse_cpumask(cpumask_t *wakeup_mask) 216 - { 217 - uint32_t core0_thr_mask, core_thr_mask; 218 - int threadmode, i, j; 219 - 220 - core0_thr_mask = 0; 221 - for (i = 0; i < NLM_THREADS_PER_CORE; i++) 222 - if (cpumask_test_cpu(i, wakeup_mask)) 223 - core0_thr_mask |= (1 << i); 224 - switch (core0_thr_mask) { 225 - case 1: 226 - nlm_threads_per_core = 1; 227 - threadmode = 0; 228 - break; 229 - case 3: 230 - nlm_threads_per_core = 2; 231 - threadmode = 2; 232 - break; 233 - case 0xf: 234 - nlm_threads_per_core = 4; 235 - threadmode = 3; 236 - break; 237 - default: 238 - goto unsupp; 239 - } 240 - 241 - /* Verify other cores CPU masks */ 242 - for (i = 0; i < NR_CPUS; i += NLM_THREADS_PER_CORE) { 243 - core_thr_mask = 0; 244 - for (j = 0; j < NLM_THREADS_PER_CORE; j++) 245 - if (cpumask_test_cpu(i + j, wakeup_mask)) 246 - core_thr_mask |= (1 << j); 247 - if (core_thr_mask != 0 && core_thr_mask != core0_thr_mask) 248 - goto unsupp; 249 - } 250 - return threadmode; 251 - 252 - unsupp: 253 - panic("Unsupported CPU mask %*pb", cpumask_pr_args(wakeup_mask)); 254 - return 0; 255 - } 256 - 257 - int nlm_wakeup_secondary_cpus(void) 258 - { 259 - u32 *reset_data; 260 - int threadmode; 261 - 262 - /* verify the mask and setup core config variables */ 263 - threadmode = nlm_parse_cpumask(&nlm_cpumask); 264 - 265 - /* Setup CPU init parameters */ 266 - reset_data = nlm_get_boot_data(BOOT_THREAD_MODE); 267 - *reset_data = threadmode; 268 - 269 - #ifdef CONFIG_CPU_XLP 270 - xlp_wakeup_secondary_cpus(); 271 - #else 272 - xlr_wakeup_secondary_cpus(); 273 - #endif 274 - return 0; 275 - } 276 - 277 - const struct plat_smp_ops nlm_smp_ops = { 278 - .send_ipi_single = nlm_send_ipi_single, 279 - .send_ipi_mask = nlm_send_ipi_mask, 280 - .init_secondary = nlm_init_secondary, 281 - .smp_finish = nlm_smp_finish, 282 - .boot_secondary = nlm_boot_secondary, 283 - .smp_setup = nlm_smp_setup, 284 - .prepare_cpus = nlm_prepare_cpus, 285 - };
-141
arch/mips/netlogic/common/smpboot.S
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - 36 - #include <asm/asm.h> 37 - #include <asm/asm-offsets.h> 38 - #include <asm/regdef.h> 39 - #include <asm/mipsregs.h> 40 - #include <asm/stackframe.h> 41 - #include <asm/asmmacro.h> 42 - #include <asm/addrspace.h> 43 - 44 - #include <asm/netlogic/common.h> 45 - 46 - #include <asm/netlogic/xlp-hal/iomap.h> 47 - #include <asm/netlogic/xlp-hal/xlp.h> 48 - #include <asm/netlogic/xlp-hal/sys.h> 49 - #include <asm/netlogic/xlp-hal/cpucontrol.h> 50 - 51 - .set noreorder 52 - .set noat 53 - .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */ 54 - 55 - /* Called by the boot cpu to wake up its sibling threads */ 56 - NESTED(xlp_boot_core0_siblings, PT_SIZE, sp) 57 - /* CPU register contents lost when enabling threads, save them first */ 58 - SAVE_ALL 59 - sync 60 - /* find the location to which nlm_boot_siblings was relocated */ 61 - li t0, CKSEG1ADDR(RESET_VEC_PHYS) 62 - PTR_LA t1, nlm_reset_entry 63 - PTR_LA t2, nlm_boot_siblings 64 - dsubu t2, t1 65 - daddu t2, t0 66 - /* call it */ 67 - jalr t2 68 - nop 69 - RESTORE_ALL 70 - jr ra 71 - nop 72 - END(xlp_boot_core0_siblings) 73 - 74 - NESTED(nlm_boot_secondary_cpus, 16, sp) 75 - /* Initialize CP0 Status */ 76 - move t1, zero 77 - #ifdef CONFIG_64BIT 78 - ori t1, ST0_KX 79 - #endif 80 - mtc0 t1, CP0_STATUS 81 - PTR_LA t1, nlm_next_sp 82 - PTR_L sp, 0(t1) 83 - PTR_LA t1, nlm_next_gp 84 - PTR_L gp, 0(t1) 85 - 86 - /* a0 has the processor id */ 87 - mfc0 a0, CP0_EBASE 88 - andi a0, 0x3ff /* a0 <- node/core */ 89 - PTR_LA t0, nlm_early_init_secondary 90 - jalr t0 91 - nop 92 - 93 - PTR_LA t0, smp_bootstrap 94 - jr t0 95 - nop 96 - END(nlm_boot_secondary_cpus) 97 - 98 - /* 99 - * In case of RMIboot bootloader which is used on XLR boards, the CPUs 100 - * be already woken up and waiting in bootloader code. 101 - * This will get them out of the bootloader code and into linux. Needed 102 - * because the bootloader area will be taken and initialized by linux. 103 - */ 104 - NESTED(nlm_rmiboot_preboot, 16, sp) 105 - mfc0 t0, $15, 1 /* read ebase */ 106 - andi t0, 0x1f /* t0 has the processor_id() */ 107 - andi t2, t0, 0x3 /* thread num */ 108 - sll t0, 2 /* offset in cpu array */ 109 - 110 - li t3, CKSEG1ADDR(RESET_DATA_PHYS) 111 - ADDIU t1, t3, BOOT_CPU_READY 112 - ADDU t1, t0 113 - li t3, 1 114 - sw t3, 0(t1) 115 - 116 - bnez t2, 1f /* skip thread programming */ 117 - nop /* for thread id != 0 */ 118 - 119 - /* 120 - * XLR MMU setup only for first thread in core 121 - */ 122 - li t0, 0x400 123 - mfcr t1, t0 124 - li t2, 6 /* XLR thread mode mask */ 125 - nor t3, t2, zero 126 - and t2, t1, t2 /* t2 - current thread mode */ 127 - li v0, CKSEG1ADDR(RESET_DATA_PHYS) 128 - lw v1, BOOT_THREAD_MODE(v0) /* v1 - new thread mode */ 129 - sll v1, 1 130 - beq v1, t2, 1f /* same as request value */ 131 - nop /* nothing to do */ 132 - 133 - and t2, t1, t3 /* mask out old thread mode */ 134 - or t1, t2, v1 /* put in new value */ 135 - mtcr t1, t0 /* update core control */ 136 - 137 - /* wait for NMI to hit */ 138 - 1: wait 139 - b 1b 140 - nop 141 - END(nlm_rmiboot_preboot)
-110
arch/mips/netlogic/common/time.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/init.h> 36 - 37 - #include <asm/time.h> 38 - #include <asm/cpu-features.h> 39 - 40 - #include <asm/netlogic/interrupt.h> 41 - #include <asm/netlogic/common.h> 42 - #include <asm/netlogic/haldefs.h> 43 - 44 - #if defined(CONFIG_CPU_XLP) 45 - #include <asm/netlogic/xlp-hal/iomap.h> 46 - #include <asm/netlogic/xlp-hal/xlp.h> 47 - #include <asm/netlogic/xlp-hal/sys.h> 48 - #include <asm/netlogic/xlp-hal/pic.h> 49 - #elif defined(CONFIG_CPU_XLR) 50 - #include <asm/netlogic/xlr/iomap.h> 51 - #include <asm/netlogic/xlr/pic.h> 52 - #include <asm/netlogic/xlr/xlr.h> 53 - #else 54 - #error "Unknown CPU" 55 - #endif 56 - 57 - unsigned int get_c0_compare_int(void) 58 - { 59 - return IRQ_TIMER; 60 - } 61 - 62 - static u64 nlm_get_pic_timer(struct clocksource *cs) 63 - { 64 - uint64_t picbase = nlm_get_node(0)->picbase; 65 - 66 - return ~nlm_pic_read_timer(picbase, PIC_CLOCK_TIMER); 67 - } 68 - 69 - static u64 nlm_get_pic_timer32(struct clocksource *cs) 70 - { 71 - uint64_t picbase = nlm_get_node(0)->picbase; 72 - 73 - return ~nlm_pic_read_timer32(picbase, PIC_CLOCK_TIMER); 74 - } 75 - 76 - static struct clocksource csrc_pic = { 77 - .name = "PIC", 78 - .flags = CLOCK_SOURCE_IS_CONTINUOUS, 79 - }; 80 - 81 - static void nlm_init_pic_timer(void) 82 - { 83 - uint64_t picbase = nlm_get_node(0)->picbase; 84 - u32 picfreq; 85 - 86 - nlm_pic_set_timer(picbase, PIC_CLOCK_TIMER, ~0ULL, 0, 0); 87 - if (current_cpu_data.cputype == CPU_XLR) { 88 - csrc_pic.mask = CLOCKSOURCE_MASK(32); 89 - csrc_pic.read = nlm_get_pic_timer32; 90 - } else { 91 - csrc_pic.mask = CLOCKSOURCE_MASK(64); 92 - csrc_pic.read = nlm_get_pic_timer; 93 - } 94 - csrc_pic.rating = 1000; 95 - picfreq = pic_timer_freq(); 96 - clocksource_register_hz(&csrc_pic, picfreq); 97 - pr_info("PIC clock source added, frequency %d\n", picfreq); 98 - } 99 - 100 - void __init plat_time_init(void) 101 - { 102 - nlm_init_pic_timer(); 103 - mips_hpt_frequency = nlm_get_cpu_frequency(); 104 - if (current_cpu_type() == CPU_XLR) 105 - preset_lpj = mips_hpt_frequency / (3 * HZ); 106 - else 107 - preset_lpj = mips_hpt_frequency / (2 * HZ); 108 - pr_info("MIPS counter frequency [%ld]\n", 109 - (unsigned long)mips_hpt_frequency); 110 - }
-11
arch/mips/netlogic/xlp/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - obj-y += setup.o nlm_hal.o cop2-ex.o dt.o 3 - obj-$(CONFIG_SMP) += wakeup.o 4 - ifdef CONFIG_USB 5 - obj-y += usb-init.o 6 - obj-y += usb-init-xlp2.o 7 - endif 8 - ifdef CONFIG_SATA_AHCI 9 - obj-y += ahci-init.o 10 - obj-y += ahci-init-xlp2.o 11 - endif
-390
arch/mips/netlogic/xlp/ahci-init-xlp2.c
··· 1 - /* 2 - * Copyright (c) 2003-2014 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/dma-mapping.h> 36 - #include <linux/kernel.h> 37 - #include <linux/delay.h> 38 - #include <linux/init.h> 39 - #include <linux/pci.h> 40 - #include <linux/irq.h> 41 - #include <linux/bitops.h> 42 - #include <linux/pci_ids.h> 43 - #include <linux/nodemask.h> 44 - 45 - #include <asm/cpu.h> 46 - #include <asm/mipsregs.h> 47 - 48 - #include <asm/netlogic/common.h> 49 - #include <asm/netlogic/haldefs.h> 50 - #include <asm/netlogic/mips-extns.h> 51 - #include <asm/netlogic/xlp-hal/xlp.h> 52 - #include <asm/netlogic/xlp-hal/iomap.h> 53 - 54 - #define SATA_CTL 0x0 55 - #define SATA_STATUS 0x1 /* Status Reg */ 56 - #define SATA_INT 0x2 /* Interrupt Reg */ 57 - #define SATA_INT_MASK 0x3 /* Interrupt Mask Reg */ 58 - #define SATA_BIU_TIMEOUT 0x4 59 - #define AXIWRSPERRLOG 0x5 60 - #define AXIRDSPERRLOG 0x6 61 - #define BiuTimeoutLow 0x7 62 - #define BiuTimeoutHi 0x8 63 - #define BiuSlvErLow 0x9 64 - #define BiuSlvErHi 0xa 65 - #define IO_CONFIG_SWAP_DIS 0xb 66 - #define CR_REG_TIMER 0xc 67 - #define CORE_ID 0xd 68 - #define AXI_SLAVE_OPT1 0xe 69 - #define PHY_MEM_ACCESS 0xf 70 - #define PHY0_CNTRL 0x10 71 - #define PHY0_STAT 0x11 72 - #define PHY0_RX_ALIGN 0x12 73 - #define PHY0_RX_EQ_LO 0x13 74 - #define PHY0_RX_EQ_HI 0x14 75 - #define PHY0_BIST_LOOP 0x15 76 - #define PHY1_CNTRL 0x16 77 - #define PHY1_STAT 0x17 78 - #define PHY1_RX_ALIGN 0x18 79 - #define PHY1_RX_EQ_LO 0x19 80 - #define PHY1_RX_EQ_HI 0x1a 81 - #define PHY1_BIST_LOOP 0x1b 82 - #define RdExBase 0x1c 83 - #define RdExLimit 0x1d 84 - #define CacheAllocBase 0x1e 85 - #define CacheAllocLimit 0x1f 86 - #define BiuSlaveCmdGstNum 0x20 87 - 88 - /*SATA_CTL Bits */ 89 - #define SATA_RST_N BIT(0) /* Active low reset sata_core phy */ 90 - #define SataCtlReserve0 BIT(1) 91 - #define M_CSYSREQ BIT(2) /* AXI master low power, not used */ 92 - #define S_CSYSREQ BIT(3) /* AXI slave low power, not used */ 93 - #define P0_CP_DET BIT(8) /* Reserved, bring in from pad */ 94 - #define P0_MP_SW BIT(9) /* Mech Switch */ 95 - #define P0_DISABLE BIT(10) /* disable p0 */ 96 - #define P0_ACT_LED_EN BIT(11) /* Active LED enable */ 97 - #define P0_IRST_HARD_SYNTH BIT(12) /* PHY hard synth reset */ 98 - #define P0_IRST_HARD_TXRX BIT(13) /* PHY lane hard reset */ 99 - #define P0_IRST_POR BIT(14) /* PHY power on reset*/ 100 - #define P0_IPDTXL BIT(15) /* PHY Tx lane dis/power down */ 101 - #define P0_IPDRXL BIT(16) /* PHY Rx lane dis/power down */ 102 - #define P0_IPDIPDMSYNTH BIT(17) /* PHY synthesizer dis/porwer down */ 103 - #define P0_CP_POD_EN BIT(18) /* CP_POD enable */ 104 - #define P0_AT_BYPASS BIT(19) /* P0 address translation by pass */ 105 - #define P1_CP_DET BIT(20) /* Reserved,Cold Detect */ 106 - #define P1_MP_SW BIT(21) /* Mech Switch */ 107 - #define P1_DISABLE BIT(22) /* disable p1 */ 108 - #define P1_ACT_LED_EN BIT(23) /* Active LED enable */ 109 - #define P1_IRST_HARD_SYNTH BIT(24) /* PHY hard synth reset */ 110 - #define P1_IRST_HARD_TXRX BIT(25) /* PHY lane hard reset */ 111 - #define P1_IRST_POR BIT(26) /* PHY power on reset*/ 112 - #define P1_IPDTXL BIT(27) /* PHY Tx lane dis/porwer down */ 113 - #define P1_IPDRXL BIT(28) /* PHY Rx lane dis/porwer down */ 114 - #define P1_IPDIPDMSYNTH BIT(29) /* PHY synthesizer dis/porwer down */ 115 - #define P1_CP_POD_EN BIT(30) 116 - #define P1_AT_BYPASS BIT(31) /* P1 address translation by pass */ 117 - 118 - /* Status register */ 119 - #define M_CACTIVE BIT(0) /* m_cactive, not used */ 120 - #define S_CACTIVE BIT(1) /* s_cactive, not used */ 121 - #define P0_PHY_READY BIT(8) /* phy is ready */ 122 - #define P0_CP_POD BIT(9) /* Cold PowerOn */ 123 - #define P0_SLUMBER BIT(10) /* power mode slumber */ 124 - #define P0_PATIAL BIT(11) /* power mode patial */ 125 - #define P0_PHY_SIG_DET BIT(12) /* phy dignal detect */ 126 - #define P0_PHY_CALI BIT(13) /* phy calibration done */ 127 - #define P1_PHY_READY BIT(16) /* phy is ready */ 128 - #define P1_CP_POD BIT(17) /* Cold PowerOn */ 129 - #define P1_SLUMBER BIT(18) /* power mode slumber */ 130 - #define P1_PATIAL BIT(19) /* power mode patial */ 131 - #define P1_PHY_SIG_DET BIT(20) /* phy dignal detect */ 132 - #define P1_PHY_CALI BIT(21) /* phy calibration done */ 133 - 134 - /* SATA CR_REG_TIMER bits */ 135 - #define CR_TIME_SCALE (0x1000 << 0) 136 - 137 - /* SATA PHY specific registers start and end address */ 138 - #define RXCDRCALFOSC0 0x0065 139 - #define CALDUTY 0x006e 140 - #define RXDPIF 0x8065 141 - #define PPMDRIFTMAX_HI 0x80A4 142 - 143 - #define nlm_read_sata_reg(b, r) nlm_read_reg(b, r) 144 - #define nlm_write_sata_reg(b, r, v) nlm_write_reg(b, r, v) 145 - #define nlm_get_sata_pcibase(node) \ 146 - nlm_pcicfg_base(XLP9XX_IO_SATA_OFFSET(node)) 147 - #define nlm_get_sata_regbase(node) \ 148 - (nlm_get_sata_pcibase(node) + 0x100) 149 - 150 - /* SATA PHY config for register block 1 0x0065 .. 0x006e */ 151 - static const u8 sata_phy_config1[] = { 152 - 0xC9, 0xC9, 0x07, 0x07, 0x18, 0x18, 0x01, 0x01, 0x22, 0x00 153 - }; 154 - 155 - /* SATA PHY config for register block 2 0x8065 .. 0x80A4 */ 156 - static const u8 sata_phy_config2[] = { 157 - 0xAA, 0x00, 0x4C, 0xC9, 0xC9, 0x07, 0x07, 0x18, 158 - 0x18, 0x05, 0x0C, 0x10, 0x00, 0x10, 0x00, 0xFF, 159 - 0xCF, 0xF7, 0xE1, 0xF5, 0xFD, 0xFD, 0xFF, 0xFF, 160 - 0xFF, 0xFF, 0xE3, 0xE7, 0xDB, 0xF5, 0xFD, 0xFD, 161 - 0xF5, 0xF5, 0xFF, 0xFF, 0xE3, 0xE7, 0xDB, 0xF5, 162 - 0xFD, 0xFD, 0xF5, 0xF5, 0xFF, 0xFF, 0xFF, 0xF5, 163 - 0x3F, 0x00, 0x32, 0x00, 0x03, 0x01, 0x05, 0x05, 164 - 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x00, 0x04, 165 - }; 166 - 167 - const int sata_phy_debug = 0; /* set to verify PHY writes */ 168 - 169 - static void sata_clear_glue_reg(u64 regbase, u32 off, u32 bit) 170 - { 171 - u32 reg_val; 172 - 173 - reg_val = nlm_read_sata_reg(regbase, off); 174 - nlm_write_sata_reg(regbase, off, (reg_val & ~bit)); 175 - } 176 - 177 - static void sata_set_glue_reg(u64 regbase, u32 off, u32 bit) 178 - { 179 - u32 reg_val; 180 - 181 - reg_val = nlm_read_sata_reg(regbase, off); 182 - nlm_write_sata_reg(regbase, off, (reg_val | bit)); 183 - } 184 - 185 - static void write_phy_reg(u64 regbase, u32 addr, u32 physel, u8 data) 186 - { 187 - nlm_write_sata_reg(regbase, PHY_MEM_ACCESS, 188 - (1u << 31) | (physel << 24) | (data << 16) | addr); 189 - udelay(850); 190 - } 191 - 192 - static u8 read_phy_reg(u64 regbase, u32 addr, u32 physel) 193 - { 194 - u32 val; 195 - 196 - nlm_write_sata_reg(regbase, PHY_MEM_ACCESS, 197 - (0 << 31) | (physel << 24) | (0 << 16) | addr); 198 - udelay(850); 199 - val = nlm_read_sata_reg(regbase, PHY_MEM_ACCESS); 200 - return (val >> 16) & 0xff; 201 - } 202 - 203 - static void config_sata_phy(u64 regbase) 204 - { 205 - u32 port, i, reg; 206 - u8 val; 207 - 208 - for (port = 0; port < 2; port++) { 209 - for (i = 0, reg = RXCDRCALFOSC0; reg <= CALDUTY; reg++, i++) 210 - write_phy_reg(regbase, reg, port, sata_phy_config1[i]); 211 - 212 - for (i = 0, reg = RXDPIF; reg <= PPMDRIFTMAX_HI; reg++, i++) 213 - write_phy_reg(regbase, reg, port, sata_phy_config2[i]); 214 - 215 - /* Fix for PHY link up failures at lower temperatures */ 216 - write_phy_reg(regbase, 0x800F, port, 0x1f); 217 - 218 - val = read_phy_reg(regbase, 0x0029, port); 219 - write_phy_reg(regbase, 0x0029, port, val | (0x7 << 1)); 220 - 221 - val = read_phy_reg(regbase, 0x0056, port); 222 - write_phy_reg(regbase, 0x0056, port, val & ~(1 << 3)); 223 - 224 - val = read_phy_reg(regbase, 0x0018, port); 225 - write_phy_reg(regbase, 0x0018, port, val & ~(0x7 << 0)); 226 - } 227 - } 228 - 229 - static void check_phy_register(u64 regbase, u32 addr, u32 physel, u8 xdata) 230 - { 231 - u8 data; 232 - 233 - data = read_phy_reg(regbase, addr, physel); 234 - pr_info("PHY read addr = 0x%x physel = %d data = 0x%x %s\n", 235 - addr, physel, data, data == xdata ? "TRUE" : "FALSE"); 236 - } 237 - 238 - static void verify_sata_phy_config(u64 regbase) 239 - { 240 - u32 port, i, reg; 241 - 242 - for (port = 0; port < 2; port++) { 243 - for (i = 0, reg = RXCDRCALFOSC0; reg <= CALDUTY; reg++, i++) 244 - check_phy_register(regbase, reg, port, 245 - sata_phy_config1[i]); 246 - 247 - for (i = 0, reg = RXDPIF; reg <= PPMDRIFTMAX_HI; reg++, i++) 248 - check_phy_register(regbase, reg, port, 249 - sata_phy_config2[i]); 250 - } 251 - } 252 - 253 - static void nlm_sata_firmware_init(int node) 254 - { 255 - u32 reg_val; 256 - u64 regbase; 257 - int n; 258 - 259 - pr_info("Initializing XLP9XX On-chip AHCI...\n"); 260 - regbase = nlm_get_sata_regbase(node); 261 - 262 - /* Reset port0 */ 263 - sata_clear_glue_reg(regbase, SATA_CTL, P0_IRST_POR); 264 - sata_clear_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_TXRX); 265 - sata_clear_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_SYNTH); 266 - sata_clear_glue_reg(regbase, SATA_CTL, P0_IPDTXL); 267 - sata_clear_glue_reg(regbase, SATA_CTL, P0_IPDRXL); 268 - sata_clear_glue_reg(regbase, SATA_CTL, P0_IPDIPDMSYNTH); 269 - 270 - /* port1 */ 271 - sata_clear_glue_reg(regbase, SATA_CTL, P1_IRST_POR); 272 - sata_clear_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_TXRX); 273 - sata_clear_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_SYNTH); 274 - sata_clear_glue_reg(regbase, SATA_CTL, P1_IPDTXL); 275 - sata_clear_glue_reg(regbase, SATA_CTL, P1_IPDRXL); 276 - sata_clear_glue_reg(regbase, SATA_CTL, P1_IPDIPDMSYNTH); 277 - udelay(300); 278 - 279 - /* Set PHY */ 280 - sata_set_glue_reg(regbase, SATA_CTL, P0_IPDTXL); 281 - sata_set_glue_reg(regbase, SATA_CTL, P0_IPDRXL); 282 - sata_set_glue_reg(regbase, SATA_CTL, P0_IPDIPDMSYNTH); 283 - sata_set_glue_reg(regbase, SATA_CTL, P1_IPDTXL); 284 - sata_set_glue_reg(regbase, SATA_CTL, P1_IPDRXL); 285 - sata_set_glue_reg(regbase, SATA_CTL, P1_IPDIPDMSYNTH); 286 - 287 - udelay(1000); 288 - sata_set_glue_reg(regbase, SATA_CTL, P0_IRST_POR); 289 - udelay(1000); 290 - sata_set_glue_reg(regbase, SATA_CTL, P1_IRST_POR); 291 - udelay(1000); 292 - 293 - /* setup PHY */ 294 - config_sata_phy(regbase); 295 - if (sata_phy_debug) 296 - verify_sata_phy_config(regbase); 297 - 298 - udelay(1000); 299 - sata_set_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_TXRX); 300 - sata_set_glue_reg(regbase, SATA_CTL, P0_IRST_HARD_SYNTH); 301 - sata_set_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_TXRX); 302 - sata_set_glue_reg(regbase, SATA_CTL, P1_IRST_HARD_SYNTH); 303 - udelay(300); 304 - 305 - /* Override reset in serial PHY mode */ 306 - sata_set_glue_reg(regbase, CR_REG_TIMER, CR_TIME_SCALE); 307 - /* Set reset SATA */ 308 - sata_set_glue_reg(regbase, SATA_CTL, SATA_RST_N); 309 - sata_set_glue_reg(regbase, SATA_CTL, M_CSYSREQ); 310 - sata_set_glue_reg(regbase, SATA_CTL, S_CSYSREQ); 311 - 312 - pr_debug("Waiting for PHYs to come up.\n"); 313 - n = 10000; 314 - do { 315 - reg_val = nlm_read_sata_reg(regbase, SATA_STATUS); 316 - if ((reg_val & P1_PHY_READY) && (reg_val & P0_PHY_READY)) 317 - break; 318 - udelay(10); 319 - } while (--n > 0); 320 - 321 - if (reg_val & P0_PHY_READY) 322 - pr_info("PHY0 is up.\n"); 323 - else 324 - pr_info("PHY0 is down.\n"); 325 - if (reg_val & P1_PHY_READY) 326 - pr_info("PHY1 is up.\n"); 327 - else 328 - pr_info("PHY1 is down.\n"); 329 - 330 - pr_info("XLP AHCI Init Done.\n"); 331 - } 332 - 333 - static int __init nlm_ahci_init(void) 334 - { 335 - int node; 336 - 337 - if (!cpu_is_xlp9xx()) 338 - return 0; 339 - for (node = 0; node < NLM_NR_NODES; node++) 340 - if (nlm_node_present(node)) 341 - nlm_sata_firmware_init(node); 342 - return 0; 343 - } 344 - 345 - static void nlm_sata_intr_ack(struct irq_data *data) 346 - { 347 - u64 regbase; 348 - u32 val; 349 - int node; 350 - 351 - node = data->irq / NLM_IRQS_PER_NODE; 352 - regbase = nlm_get_sata_regbase(node); 353 - val = nlm_read_sata_reg(regbase, SATA_INT); 354 - sata_set_glue_reg(regbase, SATA_INT, val); 355 - } 356 - 357 - static void nlm_sata_fixup_bar(struct pci_dev *dev) 358 - { 359 - dev->resource[5] = dev->resource[0]; 360 - memset(&dev->resource[0], 0, sizeof(dev->resource[0])); 361 - } 362 - 363 - static void nlm_sata_fixup_final(struct pci_dev *dev) 364 - { 365 - u32 val; 366 - u64 regbase; 367 - int node; 368 - 369 - /* Find end bridge function to find node */ 370 - node = xlp_socdev_to_node(dev); 371 - regbase = nlm_get_sata_regbase(node); 372 - 373 - /* clear pending interrupts and then enable them */ 374 - val = nlm_read_sata_reg(regbase, SATA_INT); 375 - sata_set_glue_reg(regbase, SATA_INT, val); 376 - 377 - /* Enable only the core interrupt */ 378 - sata_set_glue_reg(regbase, SATA_INT_MASK, 0x1); 379 - 380 - dev->irq = nlm_irq_to_xirq(node, PIC_SATA_IRQ); 381 - nlm_set_pic_extra_ack(node, PIC_SATA_IRQ, nlm_sata_intr_ack); 382 - } 383 - 384 - arch_initcall(nlm_ahci_init); 385 - 386 - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_XLP9XX_SATA, 387 - nlm_sata_fixup_bar); 388 - 389 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_XLP9XX_SATA, 390 - nlm_sata_fixup_final);
-209
arch/mips/netlogic/xlp/ahci-init.c
··· 1 - /* 2 - * Copyright (c) 2003-2014 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/dma-mapping.h> 36 - #include <linux/kernel.h> 37 - #include <linux/delay.h> 38 - #include <linux/init.h> 39 - #include <linux/pci.h> 40 - #include <linux/irq.h> 41 - #include <linux/bitops.h> 42 - 43 - #include <asm/cpu.h> 44 - #include <asm/mipsregs.h> 45 - 46 - #include <asm/netlogic/haldefs.h> 47 - #include <asm/netlogic/xlp-hal/xlp.h> 48 - #include <asm/netlogic/common.h> 49 - #include <asm/netlogic/xlp-hal/iomap.h> 50 - #include <asm/netlogic/mips-extns.h> 51 - 52 - #define SATA_CTL 0x0 53 - #define SATA_STATUS 0x1 /* Status Reg */ 54 - #define SATA_INT 0x2 /* Interrupt Reg */ 55 - #define SATA_INT_MASK 0x3 /* Interrupt Mask Reg */ 56 - #define SATA_CR_REG_TIMER 0x4 /* PHY Conrol Timer Reg */ 57 - #define SATA_CORE_ID 0x5 /* Core ID Reg */ 58 - #define SATA_AXI_SLAVE_OPT1 0x6 /* AXI Slave Options Reg */ 59 - #define SATA_PHY_LOS_LEV 0x7 /* PHY LOS Level Reg */ 60 - #define SATA_PHY_MULTI 0x8 /* PHY Multiplier Reg */ 61 - #define SATA_PHY_CLK_SEL 0x9 /* Clock Select Reg */ 62 - #define SATA_PHY_AMP1_GEN1 0xa /* PHY Transmit Amplitude Reg 1 */ 63 - #define SATA_PHY_AMP1_GEN2 0xb /* PHY Transmit Amplitude Reg 2 */ 64 - #define SATA_PHY_AMP1_GEN3 0xc /* PHY Transmit Amplitude Reg 3 */ 65 - #define SATA_PHY_PRE1 0xd /* PHY Transmit Preemphasis Reg 1 */ 66 - #define SATA_PHY_PRE2 0xe /* PHY Transmit Preemphasis Reg 2 */ 67 - #define SATA_PHY_PRE3 0xf /* PHY Transmit Preemphasis Reg 3 */ 68 - #define SATA_SPDMODE 0x10 /* Speed Mode Reg */ 69 - #define SATA_REFCLK 0x11 /* Reference Clock Control Reg */ 70 - #define SATA_BYTE_SWAP_DIS 0x12 /* byte swap disable */ 71 - 72 - /*SATA_CTL Bits */ 73 - #define SATA_RST_N BIT(0) 74 - #define PHY0_RESET_N BIT(16) 75 - #define PHY1_RESET_N BIT(17) 76 - #define PHY2_RESET_N BIT(18) 77 - #define PHY3_RESET_N BIT(19) 78 - #define M_CSYSREQ BIT(2) 79 - #define S_CSYSREQ BIT(3) 80 - 81 - /*SATA_STATUS Bits */ 82 - #define P0_PHY_READY BIT(4) 83 - #define P1_PHY_READY BIT(5) 84 - #define P2_PHY_READY BIT(6) 85 - #define P3_PHY_READY BIT(7) 86 - 87 - #define nlm_read_sata_reg(b, r) nlm_read_reg(b, r) 88 - #define nlm_write_sata_reg(b, r, v) nlm_write_reg(b, r, v) 89 - #define nlm_get_sata_pcibase(node) \ 90 - nlm_pcicfg_base(XLP_IO_SATA_OFFSET(node)) 91 - /* SATA device specific configuration registers are starts at 0x900 offset */ 92 - #define nlm_get_sata_regbase(node) \ 93 - (nlm_get_sata_pcibase(node) + 0x900) 94 - 95 - static void sata_clear_glue_reg(uint64_t regbase, uint32_t off, uint32_t bit) 96 - { 97 - uint32_t reg_val; 98 - 99 - reg_val = nlm_read_sata_reg(regbase, off); 100 - nlm_write_sata_reg(regbase, off, (reg_val & ~bit)); 101 - } 102 - 103 - static void sata_set_glue_reg(uint64_t regbase, uint32_t off, uint32_t bit) 104 - { 105 - uint32_t reg_val; 106 - 107 - reg_val = nlm_read_sata_reg(regbase, off); 108 - nlm_write_sata_reg(regbase, off, (reg_val | bit)); 109 - } 110 - 111 - static void nlm_sata_firmware_init(int node) 112 - { 113 - uint32_t reg_val; 114 - uint64_t regbase; 115 - int i; 116 - 117 - pr_info("XLP AHCI Initialization started.\n"); 118 - regbase = nlm_get_sata_regbase(node); 119 - 120 - /* Reset SATA */ 121 - sata_clear_glue_reg(regbase, SATA_CTL, SATA_RST_N); 122 - /* Reset PHY */ 123 - sata_clear_glue_reg(regbase, SATA_CTL, 124 - (PHY3_RESET_N | PHY2_RESET_N 125 - | PHY1_RESET_N | PHY0_RESET_N)); 126 - 127 - /* Set SATA */ 128 - sata_set_glue_reg(regbase, SATA_CTL, SATA_RST_N); 129 - /* Set PHY */ 130 - sata_set_glue_reg(regbase, SATA_CTL, 131 - (PHY3_RESET_N | PHY2_RESET_N 132 - | PHY1_RESET_N | PHY0_RESET_N)); 133 - 134 - pr_debug("Waiting for PHYs to come up.\n"); 135 - i = 0; 136 - do { 137 - reg_val = nlm_read_sata_reg(regbase, SATA_STATUS); 138 - i++; 139 - } while (((reg_val & 0xF0) != 0xF0) && (i < 10000)); 140 - 141 - for (i = 0; i < 4; i++) { 142 - if (reg_val & (P0_PHY_READY << i)) 143 - pr_info("PHY%d is up.\n", i); 144 - else 145 - pr_info("PHY%d is down.\n", i); 146 - } 147 - 148 - pr_info("XLP AHCI init done.\n"); 149 - } 150 - 151 - static int __init nlm_ahci_init(void) 152 - { 153 - int node = 0; 154 - int chip = read_c0_prid() & PRID_IMP_MASK; 155 - 156 - if (chip == PRID_IMP_NETLOGIC_XLP3XX) 157 - nlm_sata_firmware_init(node); 158 - return 0; 159 - } 160 - 161 - static void nlm_sata_intr_ack(struct irq_data *data) 162 - { 163 - uint32_t val = 0; 164 - uint64_t regbase; 165 - 166 - regbase = nlm_get_sata_regbase(nlm_nodeid()); 167 - val = nlm_read_sata_reg(regbase, SATA_INT); 168 - sata_set_glue_reg(regbase, SATA_INT, val); 169 - } 170 - 171 - static void nlm_sata_fixup_bar(struct pci_dev *dev) 172 - { 173 - /* 174 - * The AHCI resource is in BAR 0, move it to 175 - * BAR 5, where it is expected 176 - */ 177 - dev->resource[5] = dev->resource[0]; 178 - memset(&dev->resource[0], 0, sizeof(dev->resource[0])); 179 - } 180 - 181 - static void nlm_sata_fixup_final(struct pci_dev *dev) 182 - { 183 - uint32_t val; 184 - uint64_t regbase; 185 - int node = 0; /* XLP3XX does not support multi-node */ 186 - 187 - regbase = nlm_get_sata_regbase(node); 188 - 189 - /* clear pending interrupts and then enable them */ 190 - val = nlm_read_sata_reg(regbase, SATA_INT); 191 - sata_set_glue_reg(regbase, SATA_INT, val); 192 - 193 - /* Mask the core interrupt. If all the interrupts 194 - * are enabled there are spurious interrupt flow 195 - * happening, to avoid only enable core interrupt 196 - * mask. 197 - */ 198 - sata_set_glue_reg(regbase, SATA_INT_MASK, 0x1); 199 - 200 - dev->irq = PIC_SATA_IRQ; 201 - nlm_set_pic_extra_ack(node, PIC_SATA_IRQ, nlm_sata_intr_ack); 202 - } 203 - 204 - arch_initcall(nlm_ahci_init); 205 - 206 - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_SATA, 207 - nlm_sata_fixup_bar); 208 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_SATA, 209 - nlm_sata_fixup_final);
-121
arch/mips/netlogic/xlp/cop2-ex.c
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2013 Broadcom Corporation. 7 - * 8 - * based on arch/mips/cavium-octeon/cpu.c 9 - * Copyright (C) 2009 Wind River Systems, 10 - * written by Ralf Baechle <ralf@linux-mips.org> 11 - */ 12 - #include <linux/capability.h> 13 - #include <linux/init.h> 14 - #include <linux/irqflags.h> 15 - #include <linux/notifier.h> 16 - #include <linux/prefetch.h> 17 - #include <linux/ptrace.h> 18 - #include <linux/sched.h> 19 - #include <linux/sched/task_stack.h> 20 - 21 - #include <asm/cop2.h> 22 - #include <asm/current.h> 23 - #include <asm/mipsregs.h> 24 - #include <asm/page.h> 25 - 26 - #include <asm/netlogic/mips-extns.h> 27 - 28 - /* 29 - * 64 bit ops are done in inline assembly to support 32 bit 30 - * compilation 31 - */ 32 - void nlm_cop2_save(struct nlm_cop2_state *r) 33 - { 34 - asm volatile( 35 - ".set push\n" 36 - ".set noat\n" 37 - "dmfc2 $1, $0, 0\n" 38 - "sd $1, 0(%1)\n" 39 - "dmfc2 $1, $0, 1\n" 40 - "sd $1, 8(%1)\n" 41 - "dmfc2 $1, $0, 2\n" 42 - "sd $1, 16(%1)\n" 43 - "dmfc2 $1, $0, 3\n" 44 - "sd $1, 24(%1)\n" 45 - "dmfc2 $1, $1, 0\n" 46 - "sd $1, 0(%2)\n" 47 - "dmfc2 $1, $1, 1\n" 48 - "sd $1, 8(%2)\n" 49 - "dmfc2 $1, $1, 2\n" 50 - "sd $1, 16(%2)\n" 51 - "dmfc2 $1, $1, 3\n" 52 - "sd $1, 24(%2)\n" 53 - ".set pop\n" 54 - : "=m"(*r) 55 - : "r"(r->tx), "r"(r->rx)); 56 - 57 - r->tx_msg_status = __read_32bit_c2_register($2, 0); 58 - r->rx_msg_status = __read_32bit_c2_register($3, 0) & 0x0fffffff; 59 - } 60 - 61 - void nlm_cop2_restore(struct nlm_cop2_state *r) 62 - { 63 - u32 rstat; 64 - 65 - asm volatile( 66 - ".set push\n" 67 - ".set noat\n" 68 - "ld $1, 0(%1)\n" 69 - "dmtc2 $1, $0, 0\n" 70 - "ld $1, 8(%1)\n" 71 - "dmtc2 $1, $0, 1\n" 72 - "ld $1, 16(%1)\n" 73 - "dmtc2 $1, $0, 2\n" 74 - "ld $1, 24(%1)\n" 75 - "dmtc2 $1, $0, 3\n" 76 - "ld $1, 0(%2)\n" 77 - "dmtc2 $1, $1, 0\n" 78 - "ld $1, 8(%2)\n" 79 - "dmtc2 $1, $1, 1\n" 80 - "ld $1, 16(%2)\n" 81 - "dmtc2 $1, $1, 2\n" 82 - "ld $1, 24(%2)\n" 83 - "dmtc2 $1, $1, 3\n" 84 - ".set pop\n" 85 - : : "m"(*r), "r"(r->tx), "r"(r->rx)); 86 - 87 - __write_32bit_c2_register($2, 0, r->tx_msg_status); 88 - rstat = __read_32bit_c2_register($3, 0) & 0xf0000000u; 89 - __write_32bit_c2_register($3, 0, r->rx_msg_status | rstat); 90 - } 91 - 92 - static int nlm_cu2_call(struct notifier_block *nfb, unsigned long action, 93 - void *data) 94 - { 95 - unsigned long flags; 96 - unsigned int status; 97 - 98 - switch (action) { 99 - case CU2_EXCEPTION: 100 - if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) 101 - break; 102 - local_irq_save(flags); 103 - KSTK_STATUS(current) |= ST0_CU2; 104 - status = read_c0_status(); 105 - write_c0_status(status | ST0_CU2); 106 - nlm_cop2_restore(&(current->thread.cp2)); 107 - write_c0_status(status & ~ST0_CU2); 108 - local_irq_restore(flags); 109 - pr_info("COP2 access enabled for pid %d (%s)\n", 110 - current->pid, current->comm); 111 - return NOTIFY_BAD; /* Don't call default notifier */ 112 - } 113 - 114 - return NOTIFY_OK; /* Let default notifier send signals */ 115 - } 116 - 117 - static int __init nlm_cu2_setup(void) 118 - { 119 - return cu2_notifier(nlm_cu2_call, 0); 120 - } 121 - early_initcall(nlm_cu2_setup);
-95
arch/mips/netlogic/xlp/dt.c
··· 1 - /* 2 - * Copyright 2003-2013 Broadcom Corporation. 3 - * All Rights Reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/memblock.h> 37 - 38 - #include <linux/of_fdt.h> 39 - #include <linux/of_platform.h> 40 - #include <linux/of_device.h> 41 - 42 - #include <asm/prom.h> 43 - 44 - extern u32 __dtb_xlp_evp_begin[], __dtb_xlp_svp_begin[], __dtb_xlp_fvp_begin[], 45 - __dtb_xlp_gvp_begin[], __dtb_xlp_rvp_begin[]; 46 - static void *xlp_fdt_blob; 47 - 48 - void __init *xlp_dt_init(void *fdtp) 49 - { 50 - if (!fdtp) { 51 - switch (current_cpu_data.processor_id & PRID_IMP_MASK) { 52 - #ifdef CONFIG_DT_XLP_RVP 53 - case PRID_IMP_NETLOGIC_XLP5XX: 54 - fdtp = __dtb_xlp_rvp_begin; 55 - break; 56 - #endif 57 - #ifdef CONFIG_DT_XLP_GVP 58 - case PRID_IMP_NETLOGIC_XLP9XX: 59 - fdtp = __dtb_xlp_gvp_begin; 60 - break; 61 - #endif 62 - #ifdef CONFIG_DT_XLP_FVP 63 - case PRID_IMP_NETLOGIC_XLP2XX: 64 - fdtp = __dtb_xlp_fvp_begin; 65 - break; 66 - #endif 67 - #ifdef CONFIG_DT_XLP_SVP 68 - case PRID_IMP_NETLOGIC_XLP3XX: 69 - fdtp = __dtb_xlp_svp_begin; 70 - break; 71 - #endif 72 - #ifdef CONFIG_DT_XLP_EVP 73 - case PRID_IMP_NETLOGIC_XLP8XX: 74 - fdtp = __dtb_xlp_evp_begin; 75 - break; 76 - #endif 77 - default: 78 - /* Pick a built-in if any, and hope for the best */ 79 - fdtp = __dtb_start; 80 - break; 81 - } 82 - } 83 - xlp_fdt_blob = fdtp; 84 - return fdtp; 85 - } 86 - 87 - void __init xlp_early_init_devtree(void) 88 - { 89 - __dt_setup_arch(xlp_fdt_blob); 90 - } 91 - 92 - void __init device_tree_init(void) 93 - { 94 - unflatten_and_copy_device_tree(); 95 - }
-508
arch/mips/netlogic/xlp/nlm_hal.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/types.h> 36 - #include <linux/kernel.h> 37 - #include <linux/mm.h> 38 - #include <linux/delay.h> 39 - 40 - #include <asm/mipsregs.h> 41 - #include <asm/time.h> 42 - 43 - #include <asm/netlogic/common.h> 44 - #include <asm/netlogic/haldefs.h> 45 - #include <asm/netlogic/xlp-hal/iomap.h> 46 - #include <asm/netlogic/xlp-hal/xlp.h> 47 - #include <asm/netlogic/xlp-hal/bridge.h> 48 - #include <asm/netlogic/xlp-hal/pic.h> 49 - #include <asm/netlogic/xlp-hal/sys.h> 50 - 51 - /* Main initialization */ 52 - void nlm_node_init(int node) 53 - { 54 - struct nlm_soc_info *nodep; 55 - 56 - nodep = nlm_get_node(node); 57 - if (node == 0) 58 - nodep->coremask = 1; /* node 0, boot cpu */ 59 - nodep->sysbase = nlm_get_sys_regbase(node); 60 - nodep->picbase = nlm_get_pic_regbase(node); 61 - nodep->ebase = read_c0_ebase() & MIPS_EBASE_BASE; 62 - if (cpu_is_xlp9xx()) 63 - nodep->socbus = xlp9xx_get_socbus(node); 64 - else 65 - nodep->socbus = 0; 66 - spin_lock_init(&nodep->piclock); 67 - } 68 - 69 - static int xlp9xx_irq_to_irt(int irq) 70 - { 71 - switch (irq) { 72 - case PIC_GPIO_IRQ: 73 - return 12; 74 - case PIC_I2C_0_IRQ: 75 - return 125; 76 - case PIC_I2C_1_IRQ: 77 - return 126; 78 - case PIC_I2C_2_IRQ: 79 - return 127; 80 - case PIC_I2C_3_IRQ: 81 - return 128; 82 - case PIC_9XX_XHCI_0_IRQ: 83 - return 114; 84 - case PIC_9XX_XHCI_1_IRQ: 85 - return 115; 86 - case PIC_9XX_XHCI_2_IRQ: 87 - return 116; 88 - case PIC_UART_0_IRQ: 89 - return 133; 90 - case PIC_UART_1_IRQ: 91 - return 134; 92 - case PIC_SATA_IRQ: 93 - return 143; 94 - case PIC_NAND_IRQ: 95 - return 151; 96 - case PIC_SPI_IRQ: 97 - return 152; 98 - case PIC_MMC_IRQ: 99 - return 153; 100 - case PIC_PCIE_LINK_LEGACY_IRQ(0): 101 - case PIC_PCIE_LINK_LEGACY_IRQ(1): 102 - case PIC_PCIE_LINK_LEGACY_IRQ(2): 103 - case PIC_PCIE_LINK_LEGACY_IRQ(3): 104 - return 191 + irq - PIC_PCIE_LINK_LEGACY_IRQ_BASE; 105 - } 106 - return -1; 107 - } 108 - 109 - static int xlp_irq_to_irt(int irq) 110 - { 111 - uint64_t pcibase; 112 - int devoff, irt; 113 - 114 - devoff = 0; 115 - switch (irq) { 116 - case PIC_UART_0_IRQ: 117 - devoff = XLP_IO_UART0_OFFSET(0); 118 - break; 119 - case PIC_UART_1_IRQ: 120 - devoff = XLP_IO_UART1_OFFSET(0); 121 - break; 122 - case PIC_MMC_IRQ: 123 - devoff = XLP_IO_MMC_OFFSET(0); 124 - break; 125 - case PIC_I2C_0_IRQ: /* I2C will be fixed up */ 126 - case PIC_I2C_1_IRQ: 127 - case PIC_I2C_2_IRQ: 128 - case PIC_I2C_3_IRQ: 129 - if (cpu_is_xlpii()) 130 - devoff = XLP2XX_IO_I2C_OFFSET(0); 131 - else 132 - devoff = XLP_IO_I2C0_OFFSET(0); 133 - break; 134 - case PIC_SATA_IRQ: 135 - devoff = XLP_IO_SATA_OFFSET(0); 136 - break; 137 - case PIC_GPIO_IRQ: 138 - devoff = XLP_IO_GPIO_OFFSET(0); 139 - break; 140 - case PIC_NAND_IRQ: 141 - devoff = XLP_IO_NAND_OFFSET(0); 142 - break; 143 - case PIC_SPI_IRQ: 144 - devoff = XLP_IO_SPI_OFFSET(0); 145 - break; 146 - default: 147 - if (cpu_is_xlpii()) { 148 - switch (irq) { 149 - /* XLP2XX has three XHCI USB controller */ 150 - case PIC_2XX_XHCI_0_IRQ: 151 - devoff = XLP2XX_IO_USB_XHCI0_OFFSET(0); 152 - break; 153 - case PIC_2XX_XHCI_1_IRQ: 154 - devoff = XLP2XX_IO_USB_XHCI1_OFFSET(0); 155 - break; 156 - case PIC_2XX_XHCI_2_IRQ: 157 - devoff = XLP2XX_IO_USB_XHCI2_OFFSET(0); 158 - break; 159 - } 160 - } else { 161 - switch (irq) { 162 - case PIC_EHCI_0_IRQ: 163 - devoff = XLP_IO_USB_EHCI0_OFFSET(0); 164 - break; 165 - case PIC_EHCI_1_IRQ: 166 - devoff = XLP_IO_USB_EHCI1_OFFSET(0); 167 - break; 168 - case PIC_OHCI_0_IRQ: 169 - devoff = XLP_IO_USB_OHCI0_OFFSET(0); 170 - break; 171 - case PIC_OHCI_1_IRQ: 172 - devoff = XLP_IO_USB_OHCI1_OFFSET(0); 173 - break; 174 - case PIC_OHCI_2_IRQ: 175 - devoff = XLP_IO_USB_OHCI2_OFFSET(0); 176 - break; 177 - case PIC_OHCI_3_IRQ: 178 - devoff = XLP_IO_USB_OHCI3_OFFSET(0); 179 - break; 180 - } 181 - } 182 - } 183 - 184 - if (devoff != 0) { 185 - uint32_t val; 186 - 187 - pcibase = nlm_pcicfg_base(devoff); 188 - val = nlm_read_reg(pcibase, XLP_PCI_IRTINFO_REG); 189 - if (val == 0xffffffff) { 190 - irt = -1; 191 - } else { 192 - irt = val & 0xffff; 193 - /* HW weirdness, I2C IRT entry has to be fixed up */ 194 - switch (irq) { 195 - case PIC_I2C_1_IRQ: 196 - irt = irt + 1; break; 197 - case PIC_I2C_2_IRQ: 198 - irt = irt + 2; break; 199 - case PIC_I2C_3_IRQ: 200 - irt = irt + 3; break; 201 - } 202 - } 203 - } else if (irq >= PIC_PCIE_LINK_LEGACY_IRQ(0) && 204 - irq <= PIC_PCIE_LINK_LEGACY_IRQ(3)) { 205 - /* HW bug, PCI IRT entries are bad on early silicon, fix */ 206 - irt = PIC_IRT_PCIE_LINK_INDEX(irq - 207 - PIC_PCIE_LINK_LEGACY_IRQ_BASE); 208 - } else { 209 - irt = -1; 210 - } 211 - return irt; 212 - } 213 - 214 - int nlm_irq_to_irt(int irq) 215 - { 216 - /* return -2 for irqs without 1-1 mapping */ 217 - if (irq >= PIC_PCIE_LINK_MSI_IRQ(0) && irq <= PIC_PCIE_LINK_MSI_IRQ(3)) 218 - return -2; 219 - if (irq >= PIC_PCIE_MSIX_IRQ(0) && irq <= PIC_PCIE_MSIX_IRQ(3)) 220 - return -2; 221 - 222 - if (cpu_is_xlp9xx()) 223 - return xlp9xx_irq_to_irt(irq); 224 - else 225 - return xlp_irq_to_irt(irq); 226 - } 227 - 228 - static unsigned int nlm_xlp2_get_core_frequency(int node, int core) 229 - { 230 - unsigned int pll_post_div, ctrl_val0, ctrl_val1, denom; 231 - uint64_t num, sysbase, clockbase; 232 - 233 - if (cpu_is_xlp9xx()) { 234 - clockbase = nlm_get_clock_regbase(node); 235 - ctrl_val0 = nlm_read_sys_reg(clockbase, 236 - SYS_9XX_CPU_PLL_CTRL0(core)); 237 - ctrl_val1 = nlm_read_sys_reg(clockbase, 238 - SYS_9XX_CPU_PLL_CTRL1(core)); 239 - } else { 240 - sysbase = nlm_get_node(node)->sysbase; 241 - ctrl_val0 = nlm_read_sys_reg(sysbase, 242 - SYS_CPU_PLL_CTRL0(core)); 243 - ctrl_val1 = nlm_read_sys_reg(sysbase, 244 - SYS_CPU_PLL_CTRL1(core)); 245 - } 246 - 247 - /* Find PLL post divider value */ 248 - switch ((ctrl_val0 >> 24) & 0x7) { 249 - case 1: 250 - pll_post_div = 2; 251 - break; 252 - case 3: 253 - pll_post_div = 4; 254 - break; 255 - case 7: 256 - pll_post_div = 8; 257 - break; 258 - case 6: 259 - pll_post_div = 16; 260 - break; 261 - case 0: 262 - default: 263 - pll_post_div = 1; 264 - break; 265 - } 266 - 267 - num = 1000000ULL * (400 * 3 + 100 * (ctrl_val1 & 0x3f)); 268 - denom = 3 * pll_post_div; 269 - do_div(num, denom); 270 - 271 - return (unsigned int)num; 272 - } 273 - 274 - static unsigned int nlm_xlp_get_core_frequency(int node, int core) 275 - { 276 - unsigned int pll_divf, pll_divr, dfs_div, ext_div; 277 - unsigned int rstval, dfsval, denom; 278 - uint64_t num, sysbase; 279 - 280 - sysbase = nlm_get_node(node)->sysbase; 281 - rstval = nlm_read_sys_reg(sysbase, SYS_POWER_ON_RESET_CFG); 282 - dfsval = nlm_read_sys_reg(sysbase, SYS_CORE_DFS_DIV_VALUE); 283 - pll_divf = ((rstval >> 10) & 0x7f) + 1; 284 - pll_divr = ((rstval >> 8) & 0x3) + 1; 285 - ext_div = ((rstval >> 30) & 0x3) + 1; 286 - dfs_div = ((dfsval >> (core * 4)) & 0xf) + 1; 287 - 288 - num = 800000000ULL * pll_divf; 289 - denom = 3 * pll_divr * ext_div * dfs_div; 290 - do_div(num, denom); 291 - 292 - return (unsigned int)num; 293 - } 294 - 295 - unsigned int nlm_get_core_frequency(int node, int core) 296 - { 297 - if (cpu_is_xlpii()) 298 - return nlm_xlp2_get_core_frequency(node, core); 299 - else 300 - return nlm_xlp_get_core_frequency(node, core); 301 - } 302 - 303 - /* 304 - * Calculate PIC frequency from PLL registers. 305 - * freq_out = (ref_freq/2 * (6 + ctrl2[7:0]) + ctrl2[20:8]/2^13) / 306 - * ((2^ctrl0[7:5]) * Table(ctrl0[26:24])) 307 - */ 308 - static unsigned int nlm_xlp2_get_pic_frequency(int node) 309 - { 310 - u32 ctrl_val0, ctrl_val2, vco_post_div, pll_post_div, cpu_xlp9xx; 311 - u32 mdiv, fdiv, pll_out_freq_den, reg_select, ref_div, pic_div; 312 - u64 sysbase, pll_out_freq_num, ref_clk_select, clockbase, ref_clk; 313 - 314 - sysbase = nlm_get_node(node)->sysbase; 315 - clockbase = nlm_get_clock_regbase(node); 316 - cpu_xlp9xx = cpu_is_xlp9xx(); 317 - 318 - /* Find ref_clk_base */ 319 - if (cpu_xlp9xx) 320 - ref_clk_select = (nlm_read_sys_reg(sysbase, 321 - SYS_9XX_POWER_ON_RESET_CFG) >> 18) & 0x3; 322 - else 323 - ref_clk_select = (nlm_read_sys_reg(sysbase, 324 - SYS_POWER_ON_RESET_CFG) >> 18) & 0x3; 325 - switch (ref_clk_select) { 326 - case 0: 327 - ref_clk = 200000000ULL; 328 - ref_div = 3; 329 - break; 330 - case 1: 331 - ref_clk = 100000000ULL; 332 - ref_div = 1; 333 - break; 334 - case 2: 335 - ref_clk = 125000000ULL; 336 - ref_div = 1; 337 - break; 338 - case 3: 339 - ref_clk = 400000000ULL; 340 - ref_div = 3; 341 - break; 342 - } 343 - 344 - /* Find the clock source PLL device for PIC */ 345 - if (cpu_xlp9xx) { 346 - reg_select = nlm_read_sys_reg(clockbase, 347 - SYS_9XX_CLK_DEV_SEL_REG) & 0x3; 348 - switch (reg_select) { 349 - case 0: 350 - ctrl_val0 = nlm_read_sys_reg(clockbase, 351 - SYS_9XX_PLL_CTRL0); 352 - ctrl_val2 = nlm_read_sys_reg(clockbase, 353 - SYS_9XX_PLL_CTRL2); 354 - break; 355 - case 1: 356 - ctrl_val0 = nlm_read_sys_reg(clockbase, 357 - SYS_9XX_PLL_CTRL0_DEVX(0)); 358 - ctrl_val2 = nlm_read_sys_reg(clockbase, 359 - SYS_9XX_PLL_CTRL2_DEVX(0)); 360 - break; 361 - case 2: 362 - ctrl_val0 = nlm_read_sys_reg(clockbase, 363 - SYS_9XX_PLL_CTRL0_DEVX(1)); 364 - ctrl_val2 = nlm_read_sys_reg(clockbase, 365 - SYS_9XX_PLL_CTRL2_DEVX(1)); 366 - break; 367 - case 3: 368 - ctrl_val0 = nlm_read_sys_reg(clockbase, 369 - SYS_9XX_PLL_CTRL0_DEVX(2)); 370 - ctrl_val2 = nlm_read_sys_reg(clockbase, 371 - SYS_9XX_PLL_CTRL2_DEVX(2)); 372 - break; 373 - } 374 - } else { 375 - reg_select = (nlm_read_sys_reg(sysbase, 376 - SYS_CLK_DEV_SEL_REG) >> 22) & 0x3; 377 - switch (reg_select) { 378 - case 0: 379 - ctrl_val0 = nlm_read_sys_reg(sysbase, 380 - SYS_PLL_CTRL0); 381 - ctrl_val2 = nlm_read_sys_reg(sysbase, 382 - SYS_PLL_CTRL2); 383 - break; 384 - case 1: 385 - ctrl_val0 = nlm_read_sys_reg(sysbase, 386 - SYS_PLL_CTRL0_DEVX(0)); 387 - ctrl_val2 = nlm_read_sys_reg(sysbase, 388 - SYS_PLL_CTRL2_DEVX(0)); 389 - break; 390 - case 2: 391 - ctrl_val0 = nlm_read_sys_reg(sysbase, 392 - SYS_PLL_CTRL0_DEVX(1)); 393 - ctrl_val2 = nlm_read_sys_reg(sysbase, 394 - SYS_PLL_CTRL2_DEVX(1)); 395 - break; 396 - case 3: 397 - ctrl_val0 = nlm_read_sys_reg(sysbase, 398 - SYS_PLL_CTRL0_DEVX(2)); 399 - ctrl_val2 = nlm_read_sys_reg(sysbase, 400 - SYS_PLL_CTRL2_DEVX(2)); 401 - break; 402 - } 403 - } 404 - 405 - vco_post_div = (ctrl_val0 >> 5) & 0x7; 406 - pll_post_div = (ctrl_val0 >> 24) & 0x7; 407 - mdiv = ctrl_val2 & 0xff; 408 - fdiv = (ctrl_val2 >> 8) & 0x1fff; 409 - 410 - /* Find PLL post divider value */ 411 - switch (pll_post_div) { 412 - case 1: 413 - pll_post_div = 2; 414 - break; 415 - case 3: 416 - pll_post_div = 4; 417 - break; 418 - case 7: 419 - pll_post_div = 8; 420 - break; 421 - case 6: 422 - pll_post_div = 16; 423 - break; 424 - case 0: 425 - default: 426 - pll_post_div = 1; 427 - break; 428 - } 429 - 430 - fdiv = fdiv/(1 << 13); 431 - pll_out_freq_num = ((ref_clk >> 1) * (6 + mdiv)) + fdiv; 432 - pll_out_freq_den = (1 << vco_post_div) * pll_post_div * ref_div; 433 - 434 - if (pll_out_freq_den > 0) 435 - do_div(pll_out_freq_num, pll_out_freq_den); 436 - 437 - /* PIC post divider, which happens after PLL */ 438 - if (cpu_xlp9xx) 439 - pic_div = nlm_read_sys_reg(clockbase, 440 - SYS_9XX_CLK_DEV_DIV_REG) & 0x3; 441 - else 442 - pic_div = (nlm_read_sys_reg(sysbase, 443 - SYS_CLK_DEV_DIV_REG) >> 22) & 0x3; 444 - do_div(pll_out_freq_num, 1 << pic_div); 445 - 446 - return pll_out_freq_num; 447 - } 448 - 449 - unsigned int nlm_get_pic_frequency(int node) 450 - { 451 - if (cpu_is_xlpii()) 452 - return nlm_xlp2_get_pic_frequency(node); 453 - else 454 - return 133333333; 455 - } 456 - 457 - unsigned int nlm_get_cpu_frequency(void) 458 - { 459 - return nlm_get_core_frequency(0, 0); 460 - } 461 - 462 - /* 463 - * Fills upto 8 pairs of entries containing the DRAM map of a node 464 - * if node < 0, get dram map for all nodes 465 - */ 466 - int nlm_get_dram_map(int node, uint64_t *dram_map, int nentries) 467 - { 468 - uint64_t bridgebase, base, lim; 469 - uint32_t val; 470 - unsigned int barreg, limreg, xlatreg; 471 - int i, n, rv; 472 - 473 - /* Look only at mapping on Node 0, we don't handle crazy configs */ 474 - bridgebase = nlm_get_bridge_regbase(0); 475 - rv = 0; 476 - for (i = 0; i < 8; i++) { 477 - if (rv + 1 >= nentries) 478 - break; 479 - if (cpu_is_xlp9xx()) { 480 - barreg = BRIDGE_9XX_DRAM_BAR(i); 481 - limreg = BRIDGE_9XX_DRAM_LIMIT(i); 482 - xlatreg = BRIDGE_9XX_DRAM_NODE_TRANSLN(i); 483 - } else { 484 - barreg = BRIDGE_DRAM_BAR(i); 485 - limreg = BRIDGE_DRAM_LIMIT(i); 486 - xlatreg = BRIDGE_DRAM_NODE_TRANSLN(i); 487 - } 488 - if (node >= 0) { 489 - /* node specified, get node mapping of BAR */ 490 - val = nlm_read_bridge_reg(bridgebase, xlatreg); 491 - n = (val >> 1) & 0x3; 492 - if (n != node) 493 - continue; 494 - } 495 - val = nlm_read_bridge_reg(bridgebase, barreg); 496 - val = (val >> 12) & 0xfffff; 497 - base = (uint64_t) val << 20; 498 - val = nlm_read_bridge_reg(bridgebase, limreg); 499 - val = (val >> 12) & 0xfffff; 500 - if (val == 0) /* BAR not used */ 501 - continue; 502 - lim = ((uint64_t)val + 1) << 20; 503 - dram_map[rv] = base; 504 - dram_map[rv + 1] = lim; 505 - rv += 2; 506 - } 507 - return rv; 508 - }
-174
arch/mips/netlogic/xlp/setup.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/of_fdt.h> 37 - #include <linux/memblock.h> 38 - 39 - #include <asm/idle.h> 40 - #include <asm/reboot.h> 41 - #include <asm/time.h> 42 - #include <asm/bootinfo.h> 43 - 44 - #include <asm/netlogic/haldefs.h> 45 - #include <asm/netlogic/common.h> 46 - 47 - #include <asm/netlogic/xlp-hal/iomap.h> 48 - #include <asm/netlogic/xlp-hal/xlp.h> 49 - #include <asm/netlogic/xlp-hal/sys.h> 50 - 51 - uint64_t nlm_io_base; 52 - struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; 53 - cpumask_t nlm_cpumask = CPU_MASK_CPU0; 54 - unsigned int nlm_threads_per_core; 55 - 56 - static void nlm_linux_exit(void) 57 - { 58 - uint64_t sysbase = nlm_get_node(0)->sysbase; 59 - 60 - if (cpu_is_xlp9xx()) 61 - nlm_write_sys_reg(sysbase, SYS_9XX_CHIP_RESET, 1); 62 - else 63 - nlm_write_sys_reg(sysbase, SYS_CHIP_RESET, 1); 64 - for ( ; ; ) 65 - cpu_wait(); 66 - } 67 - 68 - static void nlm_fixup_mem(void) 69 - { 70 - const int pref_backup = 512; 71 - struct memblock_region *mem; 72 - 73 - for_each_mem_region(mem) { 74 - memblock_remove(mem->base + mem->size - pref_backup, 75 - pref_backup); 76 - } 77 - } 78 - 79 - static void __init xlp_init_mem_from_bars(void) 80 - { 81 - uint64_t map[16]; 82 - int i, n; 83 - 84 - n = nlm_get_dram_map(-1, map, ARRAY_SIZE(map)); /* -1 : all nodes */ 85 - for (i = 0; i < n; i += 2) { 86 - /* exclude 0x1000_0000-0x2000_0000, u-boot device */ 87 - if (map[i] <= 0x10000000 && map[i+1] > 0x10000000) 88 - map[i+1] = 0x10000000; 89 - if (map[i] > 0x10000000 && map[i] < 0x20000000) 90 - map[i] = 0x20000000; 91 - 92 - memblock_add(map[i], map[i+1] - map[i]); 93 - } 94 - } 95 - 96 - void __init plat_mem_setup(void) 97 - { 98 - #ifdef CONFIG_SMP 99 - nlm_wakeup_secondary_cpus(); 100 - 101 - /* update TLB size after waking up threads */ 102 - current_cpu_data.tlbsize = ((read_c0_config6() >> 16) & 0xffff) + 1; 103 - 104 - register_smp_ops(&nlm_smp_ops); 105 - #endif 106 - _machine_restart = (void (*)(char *))nlm_linux_exit; 107 - _machine_halt = nlm_linux_exit; 108 - pm_power_off = nlm_linux_exit; 109 - 110 - /* memory and bootargs from DT */ 111 - xlp_early_init_devtree(); 112 - 113 - if (memblock_end_of_DRAM() == 0) { 114 - pr_info("Using DRAM BARs for memory map.\n"); 115 - xlp_init_mem_from_bars(); 116 - } 117 - /* Calculate and setup wired entries for mapped kernel */ 118 - nlm_fixup_mem(); 119 - } 120 - 121 - const char *get_system_type(void) 122 - { 123 - switch (read_c0_prid() & PRID_IMP_MASK) { 124 - case PRID_IMP_NETLOGIC_XLP9XX: 125 - case PRID_IMP_NETLOGIC_XLP5XX: 126 - case PRID_IMP_NETLOGIC_XLP2XX: 127 - return "Broadcom XLPII Series"; 128 - default: 129 - return "Netlogic XLP Series"; 130 - } 131 - } 132 - 133 - void xlp_mmu_init(void) 134 - { 135 - u32 conf4; 136 - 137 - if (cpu_is_xlpii()) { 138 - /* XLPII series has extended pagesize in config 4 */ 139 - conf4 = read_c0_config4() & ~0x1f00u; 140 - write_c0_config4(conf4 | ((PAGE_SHIFT - 10) / 2 << 8)); 141 - } else { 142 - /* enable extended TLB and Large Fixed TLB */ 143 - write_c0_config6(read_c0_config6() | 0x24); 144 - 145 - /* set page mask of extended Fixed TLB in config7 */ 146 - write_c0_config7(PM_DEFAULT_MASK >> 147 - (13 + (ffz(PM_DEFAULT_MASK >> 13) / 2))); 148 - } 149 - } 150 - 151 - void nlm_percpu_init(int hwcpuid) 152 - { 153 - } 154 - 155 - void __init prom_init(void) 156 - { 157 - void *reset_vec; 158 - 159 - nlm_io_base = CKSEG1ADDR(XLP_DEFAULT_IO_BASE); 160 - nlm_init_boot_cpu(); 161 - xlp_mmu_init(); 162 - nlm_node_init(0); 163 - xlp_dt_init((void *)(long)fw_arg0); 164 - 165 - /* Update reset entry point with CPU init code */ 166 - reset_vec = (void *)CKSEG1ADDR(RESET_VEC_PHYS); 167 - memset(reset_vec, 0, RESET_VEC_SIZE); 168 - memcpy(reset_vec, (void *)nlm_reset_entry, 169 - (nlm_reset_entry_end - nlm_reset_entry)); 170 - 171 - #ifdef CONFIG_SMP 172 - cpumask_setall(&nlm_cpumask); 173 - #endif 174 - }
-288
arch/mips/netlogic/xlp/usb-init-xlp2.c
··· 1 - /* 2 - * Copyright (c) 2003-2013 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/dma-mapping.h> 36 - #include <linux/kernel.h> 37 - #include <linux/delay.h> 38 - #include <linux/init.h> 39 - #include <linux/pci.h> 40 - #include <linux/pci_ids.h> 41 - #include <linux/platform_device.h> 42 - #include <linux/irq.h> 43 - 44 - #include <asm/netlogic/common.h> 45 - #include <asm/netlogic/haldefs.h> 46 - #include <asm/netlogic/xlp-hal/iomap.h> 47 - #include <asm/netlogic/xlp-hal/xlp.h> 48 - 49 - #define XLPII_USB3_CTL_0 0xc0 50 - #define XLPII_VAUXRST BIT(0) 51 - #define XLPII_VCCRST BIT(1) 52 - #define XLPII_NUM2PORT 9 53 - #define XLPII_NUM3PORT 13 54 - #define XLPII_RTUNEREQ BIT(20) 55 - #define XLPII_MS_CSYSREQ BIT(21) 56 - #define XLPII_XS_CSYSREQ BIT(22) 57 - #define XLPII_RETENABLEN BIT(23) 58 - #define XLPII_TX2RX BIT(24) 59 - #define XLPII_XHCIREV BIT(25) 60 - #define XLPII_ECCDIS BIT(26) 61 - 62 - #define XLPII_USB3_INT_REG 0xc2 63 - #define XLPII_USB3_INT_MASK 0xc3 64 - 65 - #define XLPII_USB_PHY_TEST 0xc6 66 - #define XLPII_PRESET BIT(0) 67 - #define XLPII_ATERESET BIT(1) 68 - #define XLPII_LOOPEN BIT(2) 69 - #define XLPII_TESTPDHSP BIT(3) 70 - #define XLPII_TESTPDSSP BIT(4) 71 - #define XLPII_TESTBURNIN BIT(5) 72 - 73 - #define XLPII_USB_PHY_LOS_LV 0xc9 74 - #define XLPII_LOSLEV 0 75 - #define XLPII_LOSBIAS 5 76 - #define XLPII_SQRXTX 8 77 - #define XLPII_TXBOOST 11 78 - #define XLPII_RSLKSEL 16 79 - #define XLPII_FSEL 20 80 - 81 - #define XLPII_USB_RFCLK_REG 0xcc 82 - #define XLPII_VVLD 30 83 - 84 - #define nlm_read_usb_reg(b, r) nlm_read_reg(b, r) 85 - #define nlm_write_usb_reg(b, r, v) nlm_write_reg(b, r, v) 86 - 87 - #define nlm_xlpii_get_usb_pcibase(node, inst) \ 88 - nlm_pcicfg_base(cpu_is_xlp9xx() ? \ 89 - XLP9XX_IO_USB_OFFSET(node, inst) : \ 90 - XLP2XX_IO_USB_OFFSET(node, inst)) 91 - #define nlm_xlpii_get_usb_regbase(node, inst) \ 92 - (nlm_xlpii_get_usb_pcibase(node, inst) + XLP_IO_PCI_HDRSZ) 93 - 94 - static void xlp2xx_usb_ack(struct irq_data *data) 95 - { 96 - u64 port_addr; 97 - 98 - switch (data->irq) { 99 - case PIC_2XX_XHCI_0_IRQ: 100 - port_addr = nlm_xlpii_get_usb_regbase(0, 1); 101 - break; 102 - case PIC_2XX_XHCI_1_IRQ: 103 - port_addr = nlm_xlpii_get_usb_regbase(0, 2); 104 - break; 105 - case PIC_2XX_XHCI_2_IRQ: 106 - port_addr = nlm_xlpii_get_usb_regbase(0, 3); 107 - break; 108 - default: 109 - pr_err("No matching USB irq!\n"); 110 - return; 111 - } 112 - nlm_write_usb_reg(port_addr, XLPII_USB3_INT_REG, 0xffffffff); 113 - } 114 - 115 - static void xlp9xx_usb_ack(struct irq_data *data) 116 - { 117 - u64 port_addr; 118 - int node, irq; 119 - 120 - /* Find the node and irq on the node */ 121 - irq = data->irq % NLM_IRQS_PER_NODE; 122 - node = data->irq / NLM_IRQS_PER_NODE; 123 - 124 - switch (irq) { 125 - case PIC_9XX_XHCI_0_IRQ: 126 - port_addr = nlm_xlpii_get_usb_regbase(node, 1); 127 - break; 128 - case PIC_9XX_XHCI_1_IRQ: 129 - port_addr = nlm_xlpii_get_usb_regbase(node, 2); 130 - break; 131 - case PIC_9XX_XHCI_2_IRQ: 132 - port_addr = nlm_xlpii_get_usb_regbase(node, 3); 133 - break; 134 - default: 135 - pr_err("No matching USB irq %d node %d!\n", irq, node); 136 - return; 137 - } 138 - nlm_write_usb_reg(port_addr, XLPII_USB3_INT_REG, 0xffffffff); 139 - } 140 - 141 - static void nlm_xlpii_usb_hw_reset(int node, int port) 142 - { 143 - u64 port_addr, xhci_base, pci_base; 144 - void __iomem *corebase; 145 - u32 val; 146 - 147 - port_addr = nlm_xlpii_get_usb_regbase(node, port); 148 - 149 - /* Set frequency */ 150 - val = nlm_read_usb_reg(port_addr, XLPII_USB_PHY_LOS_LV); 151 - val &= ~(0x3f << XLPII_FSEL); 152 - val |= (0x27 << XLPII_FSEL); 153 - nlm_write_usb_reg(port_addr, XLPII_USB_PHY_LOS_LV, val); 154 - 155 - val = nlm_read_usb_reg(port_addr, XLPII_USB_RFCLK_REG); 156 - val |= (1 << XLPII_VVLD); 157 - nlm_write_usb_reg(port_addr, XLPII_USB_RFCLK_REG, val); 158 - 159 - /* PHY reset */ 160 - val = nlm_read_usb_reg(port_addr, XLPII_USB_PHY_TEST); 161 - val &= (XLPII_ATERESET | XLPII_LOOPEN | XLPII_TESTPDHSP 162 - | XLPII_TESTPDSSP | XLPII_TESTBURNIN); 163 - nlm_write_usb_reg(port_addr, XLPII_USB_PHY_TEST, val); 164 - 165 - /* Setup control register */ 166 - val = XLPII_VAUXRST | XLPII_VCCRST | (1 << XLPII_NUM2PORT) 167 - | (1 << XLPII_NUM3PORT) | XLPII_MS_CSYSREQ | XLPII_XS_CSYSREQ 168 - | XLPII_RETENABLEN | XLPII_XHCIREV; 169 - nlm_write_usb_reg(port_addr, XLPII_USB3_CTL_0, val); 170 - 171 - /* Enable interrupts */ 172 - nlm_write_usb_reg(port_addr, XLPII_USB3_INT_MASK, 0x00000001); 173 - 174 - /* Clear all interrupts */ 175 - nlm_write_usb_reg(port_addr, XLPII_USB3_INT_REG, 0xffffffff); 176 - 177 - udelay(2000); 178 - 179 - /* XHCI configuration at PCI mem */ 180 - pci_base = nlm_xlpii_get_usb_pcibase(node, port); 181 - xhci_base = nlm_read_usb_reg(pci_base, 0x4) & ~0xf; 182 - corebase = ioremap(xhci_base, 0x10000); 183 - if (!corebase) 184 - return; 185 - 186 - writel(0x240002, corebase + 0xc2c0); 187 - /* GCTL 0xc110 */ 188 - val = readl(corebase + 0xc110); 189 - val &= ~(0x3 << 12); 190 - val |= (1 << 12); 191 - writel(val, corebase + 0xc110); 192 - udelay(100); 193 - 194 - /* PHYCFG 0xc200 */ 195 - val = readl(corebase + 0xc200); 196 - val &= ~(1 << 6); 197 - writel(val, corebase + 0xc200); 198 - udelay(100); 199 - 200 - /* PIPECTL 0xc2c0 */ 201 - val = readl(corebase + 0xc2c0); 202 - val &= ~(1 << 17); 203 - writel(val, corebase + 0xc2c0); 204 - 205 - iounmap(corebase); 206 - } 207 - 208 - static int __init nlm_platform_xlpii_usb_init(void) 209 - { 210 - int node; 211 - 212 - if (!cpu_is_xlpii()) 213 - return 0; 214 - 215 - if (!cpu_is_xlp9xx()) { 216 - /* XLP 2XX single node */ 217 - pr_info("Initializing 2XX USB Interface\n"); 218 - nlm_xlpii_usb_hw_reset(0, 1); 219 - nlm_xlpii_usb_hw_reset(0, 2); 220 - nlm_xlpii_usb_hw_reset(0, 3); 221 - nlm_set_pic_extra_ack(0, PIC_2XX_XHCI_0_IRQ, xlp2xx_usb_ack); 222 - nlm_set_pic_extra_ack(0, PIC_2XX_XHCI_1_IRQ, xlp2xx_usb_ack); 223 - nlm_set_pic_extra_ack(0, PIC_2XX_XHCI_2_IRQ, xlp2xx_usb_ack); 224 - return 0; 225 - } 226 - 227 - /* XLP 9XX, multi-node */ 228 - pr_info("Initializing 9XX/5XX USB Interface\n"); 229 - for (node = 0; node < NLM_NR_NODES; node++) { 230 - if (!nlm_node_present(node)) 231 - continue; 232 - nlm_xlpii_usb_hw_reset(node, 1); 233 - nlm_xlpii_usb_hw_reset(node, 2); 234 - nlm_xlpii_usb_hw_reset(node, 3); 235 - nlm_set_pic_extra_ack(node, PIC_9XX_XHCI_0_IRQ, xlp9xx_usb_ack); 236 - nlm_set_pic_extra_ack(node, PIC_9XX_XHCI_1_IRQ, xlp9xx_usb_ack); 237 - nlm_set_pic_extra_ack(node, PIC_9XX_XHCI_2_IRQ, xlp9xx_usb_ack); 238 - } 239 - return 0; 240 - } 241 - 242 - arch_initcall(nlm_platform_xlpii_usb_init); 243 - 244 - static u64 xlp_usb_dmamask = ~(u32)0; 245 - 246 - /* Fixup the IRQ for USB devices which is exist on XLP9XX SOC PCIE bus */ 247 - static void nlm_xlp9xx_usb_fixup_final(struct pci_dev *dev) 248 - { 249 - int node; 250 - 251 - node = xlp_socdev_to_node(dev); 252 - dev->dev.dma_mask = &xlp_usb_dmamask; 253 - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 254 - switch (dev->devfn) { 255 - case 0x21: 256 - dev->irq = nlm_irq_to_xirq(node, PIC_9XX_XHCI_0_IRQ); 257 - break; 258 - case 0x22: 259 - dev->irq = nlm_irq_to_xirq(node, PIC_9XX_XHCI_1_IRQ); 260 - break; 261 - case 0x23: 262 - dev->irq = nlm_irq_to_xirq(node, PIC_9XX_XHCI_2_IRQ); 263 - break; 264 - } 265 - } 266 - 267 - /* Fixup the IRQ for USB devices which is exist on XLP2XX SOC PCIE bus */ 268 - static void nlm_xlp2xx_usb_fixup_final(struct pci_dev *dev) 269 - { 270 - dev->dev.dma_mask = &xlp_usb_dmamask; 271 - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 272 - switch (dev->devfn) { 273 - case 0x21: 274 - dev->irq = PIC_2XX_XHCI_0_IRQ; 275 - break; 276 - case 0x22: 277 - dev->irq = PIC_2XX_XHCI_1_IRQ; 278 - break; 279 - case 0x23: 280 - dev->irq = PIC_2XX_XHCI_2_IRQ; 281 - break; 282 - } 283 - } 284 - 285 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_XLP9XX_XHCI, 286 - nlm_xlp9xx_usb_fixup_final); 287 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_XHCI, 288 - nlm_xlp2xx_usb_fixup_final);
-149
arch/mips/netlogic/xlp/usb-init.c
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/dma-mapping.h> 36 - #include <linux/kernel.h> 37 - #include <linux/delay.h> 38 - #include <linux/init.h> 39 - #include <linux/pci.h> 40 - #include <linux/platform_device.h> 41 - 42 - #include <asm/netlogic/haldefs.h> 43 - #include <asm/netlogic/xlp-hal/iomap.h> 44 - #include <asm/netlogic/xlp-hal/xlp.h> 45 - 46 - /* 47 - * USB glue logic registers, used only during initialization 48 - */ 49 - #define USB_CTL_0 0x01 50 - #define USB_PHY_0 0x0A 51 - #define USB_PHY_RESET 0x01 52 - #define USB_PHY_PORT_RESET_0 0x10 53 - #define USB_PHY_PORT_RESET_1 0x20 54 - #define USB_CONTROLLER_RESET 0x01 55 - #define USB_INT_STATUS 0x0E 56 - #define USB_INT_EN 0x0F 57 - #define USB_PHY_INTERRUPT_EN 0x01 58 - #define USB_OHCI_INTERRUPT_EN 0x02 59 - #define USB_OHCI_INTERRUPT1_EN 0x04 60 - #define USB_OHCI_INTERRUPT2_EN 0x08 61 - #define USB_CTRL_INTERRUPT_EN 0x10 62 - 63 - #define nlm_read_usb_reg(b, r) nlm_read_reg(b, r) 64 - #define nlm_write_usb_reg(b, r, v) nlm_write_reg(b, r, v) 65 - #define nlm_get_usb_pcibase(node, inst) \ 66 - nlm_pcicfg_base(XLP_IO_USB_OFFSET(node, inst)) 67 - #define nlm_get_usb_regbase(node, inst) \ 68 - (nlm_get_usb_pcibase(node, inst) + XLP_IO_PCI_HDRSZ) 69 - 70 - static void nlm_usb_intr_en(int node, int port) 71 - { 72 - uint32_t val; 73 - uint64_t port_addr; 74 - 75 - port_addr = nlm_get_usb_regbase(node, port); 76 - val = nlm_read_usb_reg(port_addr, USB_INT_EN); 77 - val = USB_CTRL_INTERRUPT_EN | USB_OHCI_INTERRUPT_EN | 78 - USB_OHCI_INTERRUPT1_EN | USB_OHCI_INTERRUPT2_EN; 79 - nlm_write_usb_reg(port_addr, USB_INT_EN, val); 80 - } 81 - 82 - static void nlm_usb_hw_reset(int node, int port) 83 - { 84 - uint64_t port_addr; 85 - uint32_t val; 86 - 87 - /* reset USB phy */ 88 - port_addr = nlm_get_usb_regbase(node, port); 89 - val = nlm_read_usb_reg(port_addr, USB_PHY_0); 90 - val &= ~(USB_PHY_RESET | USB_PHY_PORT_RESET_0 | USB_PHY_PORT_RESET_1); 91 - nlm_write_usb_reg(port_addr, USB_PHY_0, val); 92 - 93 - mdelay(100); 94 - val = nlm_read_usb_reg(port_addr, USB_CTL_0); 95 - val &= ~(USB_CONTROLLER_RESET); 96 - val |= 0x4; 97 - nlm_write_usb_reg(port_addr, USB_CTL_0, val); 98 - } 99 - 100 - static int __init nlm_platform_usb_init(void) 101 - { 102 - if (cpu_is_xlpii()) 103 - return 0; 104 - 105 - pr_info("Initializing USB Interface\n"); 106 - nlm_usb_hw_reset(0, 0); 107 - nlm_usb_hw_reset(0, 3); 108 - 109 - /* Enable PHY interrupts */ 110 - nlm_usb_intr_en(0, 0); 111 - nlm_usb_intr_en(0, 3); 112 - 113 - return 0; 114 - } 115 - 116 - arch_initcall(nlm_platform_usb_init); 117 - 118 - static u64 xlp_usb_dmamask = ~(u32)0; 119 - 120 - /* Fixup the IRQ for USB devices which is exist on XLP SOC PCIE bus */ 121 - static void nlm_usb_fixup_final(struct pci_dev *dev) 122 - { 123 - dev->dev.dma_mask = &xlp_usb_dmamask; 124 - dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 125 - switch (dev->devfn) { 126 - case 0x10: 127 - dev->irq = PIC_EHCI_0_IRQ; 128 - break; 129 - case 0x11: 130 - dev->irq = PIC_OHCI_0_IRQ; 131 - break; 132 - case 0x12: 133 - dev->irq = PIC_OHCI_1_IRQ; 134 - break; 135 - case 0x13: 136 - dev->irq = PIC_EHCI_1_IRQ; 137 - break; 138 - case 0x14: 139 - dev->irq = PIC_OHCI_2_IRQ; 140 - break; 141 - case 0x15: 142 - dev->irq = PIC_OHCI_3_IRQ; 143 - break; 144 - } 145 - } 146 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_EHCI, 147 - nlm_usb_fixup_final); 148 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_NETLOGIC, PCI_DEVICE_ID_NLM_OHCI, 149 - nlm_usb_fixup_final);
-212
arch/mips/netlogic/xlp/wakeup.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/threads.h> 37 - 38 - #include <asm/asm.h> 39 - #include <asm/asm-offsets.h> 40 - #include <asm/mipsregs.h> 41 - #include <asm/addrspace.h> 42 - #include <asm/string.h> 43 - 44 - #include <asm/netlogic/haldefs.h> 45 - #include <asm/netlogic/common.h> 46 - #include <asm/netlogic/mips-extns.h> 47 - 48 - #include <asm/netlogic/xlp-hal/iomap.h> 49 - #include <asm/netlogic/xlp-hal/xlp.h> 50 - #include <asm/netlogic/xlp-hal/pic.h> 51 - #include <asm/netlogic/xlp-hal/sys.h> 52 - 53 - static int xlp_wakeup_core(uint64_t sysbase, int node, int core) 54 - { 55 - uint32_t coremask, value; 56 - int count, resetreg; 57 - 58 - coremask = (1 << core); 59 - 60 - /* Enable CPU clock in case of 8xx/3xx */ 61 - if (!cpu_is_xlpii()) { 62 - value = nlm_read_sys_reg(sysbase, SYS_CORE_DFS_DIS_CTRL); 63 - value &= ~coremask; 64 - nlm_write_sys_reg(sysbase, SYS_CORE_DFS_DIS_CTRL, value); 65 - } 66 - 67 - /* On 9XX, mark coherent first */ 68 - if (cpu_is_xlp9xx()) { 69 - value = nlm_read_sys_reg(sysbase, SYS_9XX_CPU_NONCOHERENT_MODE); 70 - value &= ~coremask; 71 - nlm_write_sys_reg(sysbase, SYS_9XX_CPU_NONCOHERENT_MODE, value); 72 - } 73 - 74 - /* Remove CPU Reset */ 75 - resetreg = cpu_is_xlp9xx() ? SYS_9XX_CPU_RESET : SYS_CPU_RESET; 76 - value = nlm_read_sys_reg(sysbase, resetreg); 77 - value &= ~coremask; 78 - nlm_write_sys_reg(sysbase, resetreg, value); 79 - 80 - /* We are done on 9XX */ 81 - if (cpu_is_xlp9xx()) 82 - return 1; 83 - 84 - /* Poll for CPU to mark itself coherent on other type of XLP */ 85 - count = 100000; 86 - do { 87 - value = nlm_read_sys_reg(sysbase, SYS_CPU_NONCOHERENT_MODE); 88 - } while ((value & coremask) != 0 && --count > 0); 89 - 90 - return count != 0; 91 - } 92 - 93 - static int wait_for_cpus(int cpu, int bootcpu) 94 - { 95 - volatile uint32_t *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY); 96 - int i, count, notready; 97 - 98 - count = 0x800000; 99 - do { 100 - notready = nlm_threads_per_core; 101 - for (i = 0; i < nlm_threads_per_core; i++) 102 - if (cpu_ready[cpu + i] || (cpu + i) == bootcpu) 103 - --notready; 104 - } while (notready != 0 && --count > 0); 105 - 106 - return count != 0; 107 - } 108 - 109 - static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask) 110 - { 111 - struct nlm_soc_info *nodep; 112 - uint64_t syspcibase, fusebase; 113 - uint32_t syscoremask, mask, fusemask; 114 - int core, n, cpu, ncores; 115 - 116 - for (n = 0; n < NLM_NR_NODES; n++) { 117 - if (n != 0) { 118 - /* check if node exists and is online */ 119 - if (cpu_is_xlp9xx()) { 120 - int b = xlp9xx_get_socbus(n); 121 - pr_info("Node %d SoC PCI bus %d.\n", n, b); 122 - if (b == 0) 123 - break; 124 - } else { 125 - syspcibase = nlm_get_sys_pcibase(n); 126 - if (nlm_read_reg(syspcibase, 0) == 0xffffffff) 127 - break; 128 - } 129 - nlm_node_init(n); 130 - } 131 - 132 - /* read cores in reset from SYS */ 133 - nodep = nlm_get_node(n); 134 - 135 - if (cpu_is_xlp9xx()) { 136 - fusebase = nlm_get_fuse_regbase(n); 137 - fusemask = nlm_read_reg(fusebase, FUSE_9XX_DEVCFG6); 138 - switch (read_c0_prid() & PRID_IMP_MASK) { 139 - case PRID_IMP_NETLOGIC_XLP5XX: 140 - mask = 0xff; 141 - break; 142 - case PRID_IMP_NETLOGIC_XLP9XX: 143 - default: 144 - mask = 0xfffff; 145 - break; 146 - } 147 - } else { 148 - fusemask = nlm_read_sys_reg(nodep->sysbase, 149 - SYS_EFUSE_DEVICE_CFG_STATUS0); 150 - switch (read_c0_prid() & PRID_IMP_MASK) { 151 - case PRID_IMP_NETLOGIC_XLP3XX: 152 - mask = 0xf; 153 - break; 154 - case PRID_IMP_NETLOGIC_XLP2XX: 155 - mask = 0x3; 156 - break; 157 - case PRID_IMP_NETLOGIC_XLP8XX: 158 - default: 159 - mask = 0xff; 160 - break; 161 - } 162 - } 163 - 164 - /* 165 - * Fused out cores are set in the fusemask, and the remaining 166 - * cores are renumbered to range 0 .. nactive-1 167 - */ 168 - syscoremask = (1 << hweight32(~fusemask & mask)) - 1; 169 - 170 - pr_info("Node %d - SYS/FUSE coremask %x\n", n, syscoremask); 171 - ncores = nlm_cores_per_node(); 172 - for (core = 0; core < ncores; core++) { 173 - /* we will be on node 0 core 0 */ 174 - if (n == 0 && core == 0) 175 - continue; 176 - 177 - /* see if the core exists */ 178 - if ((syscoremask & (1 << core)) == 0) 179 - continue; 180 - 181 - /* see if at least the first hw thread is enabled */ 182 - cpu = (n * ncores + core) * NLM_THREADS_PER_CORE; 183 - if (!cpumask_test_cpu(cpu, wakeup_mask)) 184 - continue; 185 - 186 - /* wake up the core */ 187 - if (!xlp_wakeup_core(nodep->sysbase, n, core)) 188 - continue; 189 - 190 - /* core is up */ 191 - nodep->coremask |= 1u << core; 192 - 193 - /* spin until the hw threads sets their ready */ 194 - if (!wait_for_cpus(cpu, 0)) 195 - pr_err("Node %d : timeout core %d\n", n, core); 196 - } 197 - } 198 - } 199 - 200 - void xlp_wakeup_secondary_cpus(void) 201 - { 202 - /* 203 - * In case of u-boot, the secondaries are in reset 204 - * first wakeup core 0 threads 205 - */ 206 - xlp_boot_core0_siblings(); 207 - if (!wait_for_cpus(0, 0)) 208 - pr_err("Node 0 : timeout core 0\n"); 209 - 210 - /* now get other cores out of reset */ 211 - xlp_enable_secondary_cores(&nlm_cpumask); 212 - }
-3
arch/mips/netlogic/xlr/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-y += fmn.o fmn-config.o setup.o platform.o platform-flash.o 3 - obj-$(CONFIG_SMP) += wakeup.o
-296
arch/mips/netlogic/xlr/fmn-config.c
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <asm/cpu-info.h> 36 - #include <linux/irq.h> 37 - #include <linux/interrupt.h> 38 - 39 - #include <asm/cpu.h> 40 - #include <asm/mipsregs.h> 41 - #include <asm/netlogic/xlr/fmn.h> 42 - #include <asm/netlogic/xlr/xlr.h> 43 - #include <asm/netlogic/common.h> 44 - #include <asm/netlogic/haldefs.h> 45 - 46 - struct xlr_board_fmn_config xlr_board_fmn_config; 47 - 48 - static void __maybe_unused print_credit_config(struct xlr_fmn_info *fmn_info) 49 - { 50 - int bkt; 51 - 52 - pr_info("Bucket size :\n"); 53 - pr_info("Station\t: Size\n"); 54 - for (bkt = 0; bkt < 16; bkt++) 55 - pr_info(" %d %d %d %d %d %d %d %d\n", 56 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 0], 57 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 1], 58 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 2], 59 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 3], 60 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 4], 61 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 5], 62 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 6], 63 - xlr_board_fmn_config.bucket_size[(bkt * 8) + 7]); 64 - pr_info("\n"); 65 - 66 - pr_info("Credits distribution :\n"); 67 - pr_info("Station\t: Size\n"); 68 - for (bkt = 0; bkt < 16; bkt++) 69 - pr_info(" %d %d %d %d %d %d %d %d\n", 70 - fmn_info->credit_config[(bkt * 8) + 0], 71 - fmn_info->credit_config[(bkt * 8) + 1], 72 - fmn_info->credit_config[(bkt * 8) + 2], 73 - fmn_info->credit_config[(bkt * 8) + 3], 74 - fmn_info->credit_config[(bkt * 8) + 4], 75 - fmn_info->credit_config[(bkt * 8) + 5], 76 - fmn_info->credit_config[(bkt * 8) + 6], 77 - fmn_info->credit_config[(bkt * 8) + 7]); 78 - pr_info("\n"); 79 - } 80 - 81 - static void check_credit_distribution(void) 82 - { 83 - struct xlr_board_fmn_config *cfg = &xlr_board_fmn_config; 84 - int bkt, n, total_credits, ncores; 85 - 86 - ncores = hweight32(nlm_current_node()->coremask); 87 - for (bkt = 0; bkt < 128; bkt++) { 88 - total_credits = 0; 89 - for (n = 0; n < ncores; n++) 90 - total_credits += cfg->cpu[n].credit_config[bkt]; 91 - total_credits += cfg->gmac[0].credit_config[bkt]; 92 - total_credits += cfg->gmac[1].credit_config[bkt]; 93 - total_credits += cfg->dma.credit_config[bkt]; 94 - total_credits += cfg->cmp.credit_config[bkt]; 95 - total_credits += cfg->sae.credit_config[bkt]; 96 - total_credits += cfg->xgmac[0].credit_config[bkt]; 97 - total_credits += cfg->xgmac[1].credit_config[bkt]; 98 - if (total_credits > cfg->bucket_size[bkt]) 99 - pr_err("ERROR: Bucket %d: credits (%d) > size (%d)\n", 100 - bkt, total_credits, cfg->bucket_size[bkt]); 101 - } 102 - pr_info("Credit distribution complete.\n"); 103 - } 104 - 105 - /** 106 - * setup_fmn_cc - Configure bucket size and credits for a device. 107 - * @dev_info: FMN information structure for each devices 108 - * @start_stn_id: Starting station id of dev_info 109 - * @end_stn_id: End station id of dev_info 110 - * @num_buckets: Total number of buckets for den_info 111 - * @cpu_credits: Allowed credits to cpu for each devices pointing by dev_info 112 - * @size: Size of the each buckets in the device station 113 - * 114 - * 'size' is the size of the buckets for the device. This size is 115 - * distributed among all the CPUs 116 - * so that all of them can send messages to the device. 117 - * 118 - * The device is also given 'cpu_credits' to send messages to the CPUs 119 - */ 120 - static void setup_fmn_cc(struct xlr_fmn_info *dev_info, int start_stn_id, 121 - int end_stn_id, int num_buckets, int cpu_credits, int size) 122 - { 123 - int i, j, num_core, n, credits_per_cpu; 124 - struct xlr_fmn_info *cpu = xlr_board_fmn_config.cpu; 125 - 126 - num_core = hweight32(nlm_current_node()->coremask); 127 - dev_info->num_buckets = num_buckets; 128 - dev_info->start_stn_id = start_stn_id; 129 - dev_info->end_stn_id = end_stn_id; 130 - 131 - n = num_core; 132 - if (num_core == 3) 133 - n = 4; 134 - 135 - for (i = start_stn_id; i <= end_stn_id; i++) { 136 - xlr_board_fmn_config.bucket_size[i] = size; 137 - 138 - /* Dividing device credits equally to cpus */ 139 - credits_per_cpu = size / n; 140 - for (j = 0; j < num_core; j++) 141 - cpu[j].credit_config[i] = credits_per_cpu; 142 - 143 - /* credits left to distribute */ 144 - credits_per_cpu = size - (credits_per_cpu * num_core); 145 - 146 - /* distribute the remaining credits (if any), among cores */ 147 - for (j = 0; (j < num_core) && (credits_per_cpu >= 4); j++) { 148 - cpu[j].credit_config[i] += 4; 149 - credits_per_cpu -= 4; 150 - } 151 - } 152 - 153 - /* Distributing cpu per bucket credits to devices */ 154 - for (i = 0; i < num_core; i++) { 155 - for (j = 0; j < FMN_CORE_NBUCKETS; j++) 156 - dev_info->credit_config[(i * 8) + j] = cpu_credits; 157 - } 158 - } 159 - 160 - /* 161 - * Each core has 256 slots and 8 buckets, 162 - * Configure the 8 buckets each with 32 slots 163 - */ 164 - static void setup_cpu_fmninfo(struct xlr_fmn_info *cpu, int num_core) 165 - { 166 - int i, j; 167 - 168 - for (i = 0; i < num_core; i++) { 169 - cpu[i].start_stn_id = (8 * i); 170 - cpu[i].end_stn_id = (8 * i + 8); 171 - 172 - for (j = cpu[i].start_stn_id; j < cpu[i].end_stn_id; j++) 173 - xlr_board_fmn_config.bucket_size[j] = 32; 174 - } 175 - } 176 - 177 - /** 178 - * xlr_board_info_setup - Setup FMN details 179 - * 180 - * Setup the FMN details for each devices according to the device available 181 - * in each variant of XLR/XLS processor 182 - */ 183 - void xlr_board_info_setup(void) 184 - { 185 - struct xlr_fmn_info *cpu = xlr_board_fmn_config.cpu; 186 - struct xlr_fmn_info *gmac = xlr_board_fmn_config.gmac; 187 - struct xlr_fmn_info *xgmac = xlr_board_fmn_config.xgmac; 188 - struct xlr_fmn_info *dma = &xlr_board_fmn_config.dma; 189 - struct xlr_fmn_info *cmp = &xlr_board_fmn_config.cmp; 190 - struct xlr_fmn_info *sae = &xlr_board_fmn_config.sae; 191 - int processor_id, num_core; 192 - 193 - num_core = hweight32(nlm_current_node()->coremask); 194 - processor_id = read_c0_prid() & PRID_IMP_MASK; 195 - 196 - setup_cpu_fmninfo(cpu, num_core); 197 - switch (processor_id) { 198 - case PRID_IMP_NETLOGIC_XLS104: 199 - case PRID_IMP_NETLOGIC_XLS108: 200 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 201 - FMN_STNID_GMAC0_TX3, 8, 16, 32); 202 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 203 - FMN_STNID_DMA_3, 4, 8, 64); 204 - setup_fmn_cc(sae, FMN_STNID_SEC0, 205 - FMN_STNID_SEC1, 2, 8, 128); 206 - break; 207 - 208 - case PRID_IMP_NETLOGIC_XLS204: 209 - case PRID_IMP_NETLOGIC_XLS208: 210 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 211 - FMN_STNID_GMAC0_TX3, 8, 16, 32); 212 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 213 - FMN_STNID_DMA_3, 4, 8, 64); 214 - setup_fmn_cc(sae, FMN_STNID_SEC0, 215 - FMN_STNID_SEC1, 2, 8, 128); 216 - break; 217 - 218 - case PRID_IMP_NETLOGIC_XLS404: 219 - case PRID_IMP_NETLOGIC_XLS408: 220 - case PRID_IMP_NETLOGIC_XLS404B: 221 - case PRID_IMP_NETLOGIC_XLS408B: 222 - case PRID_IMP_NETLOGIC_XLS416B: 223 - case PRID_IMP_NETLOGIC_XLS608B: 224 - case PRID_IMP_NETLOGIC_XLS616B: 225 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 226 - FMN_STNID_GMAC0_TX3, 8, 8, 32); 227 - setup_fmn_cc(&gmac[1], FMN_STNID_GMAC1_FR_0, 228 - FMN_STNID_GMAC1_TX3, 8, 8, 32); 229 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 230 - FMN_STNID_DMA_3, 4, 4, 64); 231 - setup_fmn_cc(cmp, FMN_STNID_CMP_0, 232 - FMN_STNID_CMP_3, 4, 4, 64); 233 - setup_fmn_cc(sae, FMN_STNID_SEC0, 234 - FMN_STNID_SEC1, 2, 8, 128); 235 - break; 236 - 237 - case PRID_IMP_NETLOGIC_XLS412B: 238 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 239 - FMN_STNID_GMAC0_TX3, 8, 8, 32); 240 - setup_fmn_cc(&gmac[1], FMN_STNID_GMAC1_FR_0, 241 - FMN_STNID_GMAC1_TX3, 8, 8, 32); 242 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 243 - FMN_STNID_DMA_3, 4, 4, 64); 244 - setup_fmn_cc(cmp, FMN_STNID_CMP_0, 245 - FMN_STNID_CMP_3, 4, 4, 64); 246 - setup_fmn_cc(sae, FMN_STNID_SEC0, 247 - FMN_STNID_SEC1, 2, 8, 128); 248 - break; 249 - 250 - case PRID_IMP_NETLOGIC_XLR308: 251 - case PRID_IMP_NETLOGIC_XLR308C: 252 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 253 - FMN_STNID_GMAC0_TX3, 8, 16, 32); 254 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 255 - FMN_STNID_DMA_3, 4, 8, 64); 256 - setup_fmn_cc(sae, FMN_STNID_SEC0, 257 - FMN_STNID_SEC1, 2, 4, 128); 258 - break; 259 - 260 - case PRID_IMP_NETLOGIC_XLR532: 261 - case PRID_IMP_NETLOGIC_XLR532C: 262 - case PRID_IMP_NETLOGIC_XLR516C: 263 - case PRID_IMP_NETLOGIC_XLR508C: 264 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 265 - FMN_STNID_GMAC0_TX3, 8, 16, 32); 266 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 267 - FMN_STNID_DMA_3, 4, 8, 64); 268 - setup_fmn_cc(sae, FMN_STNID_SEC0, 269 - FMN_STNID_SEC1, 2, 4, 128); 270 - break; 271 - 272 - case PRID_IMP_NETLOGIC_XLR732: 273 - case PRID_IMP_NETLOGIC_XLR716: 274 - setup_fmn_cc(&xgmac[0], FMN_STNID_XMAC0_00_TX, 275 - FMN_STNID_XMAC0_15_TX, 8, 0, 32); 276 - setup_fmn_cc(&xgmac[1], FMN_STNID_XMAC1_00_TX, 277 - FMN_STNID_XMAC1_15_TX, 8, 0, 32); 278 - setup_fmn_cc(&gmac[0], FMN_STNID_GMAC0, 279 - FMN_STNID_GMAC0_TX3, 8, 24, 32); 280 - setup_fmn_cc(dma, FMN_STNID_DMA_0, 281 - FMN_STNID_DMA_3, 4, 4, 64); 282 - setup_fmn_cc(sae, FMN_STNID_SEC0, 283 - FMN_STNID_SEC1, 2, 4, 128); 284 - break; 285 - default: 286 - pr_err("Unknown CPU with processor ID [%d]\n", processor_id); 287 - pr_err("Error: Cannot initialize FMN credits.\n"); 288 - } 289 - 290 - check_credit_distribution(); 291 - 292 - #if 0 /* debug */ 293 - print_credit_config(&cpu[0]); 294 - print_credit_config(&gmac[0]); 295 - #endif 296 - }
-199
arch/mips/netlogic/xlr/fmn.c
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/irqreturn.h> 37 - #include <linux/irq.h> 38 - #include <linux/interrupt.h> 39 - 40 - #include <asm/mipsregs.h> 41 - #include <asm/netlogic/interrupt.h> 42 - #include <asm/netlogic/xlr/fmn.h> 43 - #include <asm/netlogic/common.h> 44 - 45 - #define COP2_CC_INIT_CPU_DEST(dest, conf) \ 46 - do { \ 47 - nlm_write_c2_cc##dest(0, conf[(dest * 8) + 0]); \ 48 - nlm_write_c2_cc##dest(1, conf[(dest * 8) + 1]); \ 49 - nlm_write_c2_cc##dest(2, conf[(dest * 8) + 2]); \ 50 - nlm_write_c2_cc##dest(3, conf[(dest * 8) + 3]); \ 51 - nlm_write_c2_cc##dest(4, conf[(dest * 8) + 4]); \ 52 - nlm_write_c2_cc##dest(5, conf[(dest * 8) + 5]); \ 53 - nlm_write_c2_cc##dest(6, conf[(dest * 8) + 6]); \ 54 - nlm_write_c2_cc##dest(7, conf[(dest * 8) + 7]); \ 55 - } while (0) 56 - 57 - struct fmn_message_handler { 58 - void (*action)(int, int, int, int, struct nlm_fmn_msg *, void *); 59 - void *arg; 60 - } msg_handlers[128]; 61 - 62 - /* 63 - * FMN interrupt handler. We configure the FMN so that any messages in 64 - * any of the CPU buckets will trigger an interrupt on the CPU. 65 - * The message can be from any device on the FMN (like NAE/SAE/DMA). 66 - * The source station id is used to figure out which of the registered 67 - * handlers have to be called. 68 - */ 69 - static irqreturn_t fmn_message_handler(int irq, void *data) 70 - { 71 - struct fmn_message_handler *hndlr; 72 - int bucket, rv; 73 - int size = 0, code = 0, src_stnid = 0; 74 - struct nlm_fmn_msg msg; 75 - uint32_t mflags, bkt_status; 76 - 77 - mflags = nlm_cop2_enable_irqsave(); 78 - /* Disable message ring interrupt */ 79 - nlm_fmn_setup_intr(irq, 0); 80 - while (1) { 81 - /* 8 bkts per core, [24:31] each bit represents one bucket 82 - * Bit is Zero if bucket is not empty */ 83 - bkt_status = (nlm_read_c2_status0() >> 24) & 0xff; 84 - if (bkt_status == 0xff) 85 - break; 86 - for (bucket = 0; bucket < 8; bucket++) { 87 - /* Continue on empty bucket */ 88 - if (bkt_status & (1 << bucket)) 89 - continue; 90 - rv = nlm_fmn_receive(bucket, &size, &code, &src_stnid, 91 - &msg); 92 - if (rv != 0) 93 - continue; 94 - 95 - hndlr = &msg_handlers[src_stnid]; 96 - if (hndlr->action == NULL) 97 - pr_warn("No msgring handler for stnid %d\n", 98 - src_stnid); 99 - else { 100 - nlm_cop2_disable_irqrestore(mflags); 101 - hndlr->action(bucket, src_stnid, size, code, 102 - &msg, hndlr->arg); 103 - mflags = nlm_cop2_enable_irqsave(); 104 - } 105 - } 106 - } 107 - /* Enable message ring intr, to any thread in core */ 108 - nlm_fmn_setup_intr(irq, (1 << nlm_threads_per_core) - 1); 109 - nlm_cop2_disable_irqrestore(mflags); 110 - return IRQ_HANDLED; 111 - } 112 - 113 - void xlr_percpu_fmn_init(void) 114 - { 115 - struct xlr_fmn_info *cpu_fmn_info; 116 - int *bucket_sizes; 117 - uint32_t flags; 118 - int id; 119 - 120 - BUG_ON(nlm_thread_id() != 0); 121 - id = nlm_core_id(); 122 - 123 - bucket_sizes = xlr_board_fmn_config.bucket_size; 124 - cpu_fmn_info = &xlr_board_fmn_config.cpu[id]; 125 - flags = nlm_cop2_enable_irqsave(); 126 - 127 - /* Setup bucket sizes for the core. */ 128 - nlm_write_c2_bucksize(0, bucket_sizes[id * 8 + 0]); 129 - nlm_write_c2_bucksize(1, bucket_sizes[id * 8 + 1]); 130 - nlm_write_c2_bucksize(2, bucket_sizes[id * 8 + 2]); 131 - nlm_write_c2_bucksize(3, bucket_sizes[id * 8 + 3]); 132 - nlm_write_c2_bucksize(4, bucket_sizes[id * 8 + 4]); 133 - nlm_write_c2_bucksize(5, bucket_sizes[id * 8 + 5]); 134 - nlm_write_c2_bucksize(6, bucket_sizes[id * 8 + 6]); 135 - nlm_write_c2_bucksize(7, bucket_sizes[id * 8 + 7]); 136 - 137 - /* 138 - * For sending FMN messages, we need credits on the destination 139 - * bucket. Program the credits this core has on the 128 possible 140 - * destination buckets. 141 - * We cannot use a loop here, because the the first argument has 142 - * to be a constant integer value. 143 - */ 144 - COP2_CC_INIT_CPU_DEST(0, cpu_fmn_info->credit_config); 145 - COP2_CC_INIT_CPU_DEST(1, cpu_fmn_info->credit_config); 146 - COP2_CC_INIT_CPU_DEST(2, cpu_fmn_info->credit_config); 147 - COP2_CC_INIT_CPU_DEST(3, cpu_fmn_info->credit_config); 148 - COP2_CC_INIT_CPU_DEST(4, cpu_fmn_info->credit_config); 149 - COP2_CC_INIT_CPU_DEST(5, cpu_fmn_info->credit_config); 150 - COP2_CC_INIT_CPU_DEST(6, cpu_fmn_info->credit_config); 151 - COP2_CC_INIT_CPU_DEST(7, cpu_fmn_info->credit_config); 152 - COP2_CC_INIT_CPU_DEST(8, cpu_fmn_info->credit_config); 153 - COP2_CC_INIT_CPU_DEST(9, cpu_fmn_info->credit_config); 154 - COP2_CC_INIT_CPU_DEST(10, cpu_fmn_info->credit_config); 155 - COP2_CC_INIT_CPU_DEST(11, cpu_fmn_info->credit_config); 156 - COP2_CC_INIT_CPU_DEST(12, cpu_fmn_info->credit_config); 157 - COP2_CC_INIT_CPU_DEST(13, cpu_fmn_info->credit_config); 158 - COP2_CC_INIT_CPU_DEST(14, cpu_fmn_info->credit_config); 159 - COP2_CC_INIT_CPU_DEST(15, cpu_fmn_info->credit_config); 160 - 161 - /* enable FMN interrupts on this CPU */ 162 - nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1); 163 - nlm_cop2_disable_irqrestore(flags); 164 - } 165 - 166 - 167 - /* 168 - * Register a FMN message handler with respect to the source station id 169 - * @stnid: source station id 170 - * @action: Handler function pointer 171 - */ 172 - int nlm_register_fmn_handler(int start_stnid, int end_stnid, 173 - void (*action)(int, int, int, int, struct nlm_fmn_msg *, void *), 174 - void *arg) 175 - { 176 - int sstnid; 177 - 178 - for (sstnid = start_stnid; sstnid <= end_stnid; sstnid++) { 179 - msg_handlers[sstnid].arg = arg; 180 - smp_wmb(); 181 - msg_handlers[sstnid].action = action; 182 - } 183 - pr_debug("Registered FMN msg handler for stnid %d-%d\n", 184 - start_stnid, end_stnid); 185 - return 0; 186 - } 187 - 188 - void nlm_setup_fmn_irq(void) 189 - { 190 - uint32_t flags; 191 - 192 - /* request irq only once */ 193 - if (request_irq(IRQ_FMN, fmn_message_handler, IRQF_PERCPU, "fmn", NULL)) 194 - pr_err("Failed to request irq %d (fmn)\n", IRQ_FMN); 195 - 196 - flags = nlm_cop2_enable_irqsave(); 197 - nlm_fmn_setup_intr(IRQ_FMN, (1 << nlm_threads_per_core) - 1); 198 - nlm_cop2_disable_irqrestore(flags); 199 - }
-216
arch/mips/netlogic/xlr/platform-flash.c
··· 1 - /* 2 - * Copyright 2011, Netlogic Microsystems. 3 - * Copyright 2004, Matt Porter <mporter@kernel.crashing.org> 4 - * 5 - * This file is licensed under the terms of the GNU General Public 6 - * License version 2. This program is licensed "as is" without any 7 - * warranty of any kind, whether express or implied. 8 - */ 9 - 10 - #include <linux/device.h> 11 - #include <linux/platform_device.h> 12 - #include <linux/kernel.h> 13 - #include <linux/init.h> 14 - #include <linux/io.h> 15 - #include <linux/delay.h> 16 - #include <linux/ioport.h> 17 - #include <linux/resource.h> 18 - #include <linux/spi/flash.h> 19 - 20 - #include <linux/mtd/mtd.h> 21 - #include <linux/mtd/physmap.h> 22 - #include <linux/mtd/platnand.h> 23 - 24 - #include <asm/netlogic/haldefs.h> 25 - #include <asm/netlogic/xlr/iomap.h> 26 - #include <asm/netlogic/xlr/flash.h> 27 - #include <asm/netlogic/xlr/bridge.h> 28 - #include <asm/netlogic/xlr/gpio.h> 29 - #include <asm/netlogic/xlr/xlr.h> 30 - 31 - /* 32 - * Default NOR partition layout 33 - */ 34 - static struct mtd_partition xlr_nor_parts[] = { 35 - { 36 - .name = "User FS", 37 - .offset = 0x800000, 38 - .size = MTDPART_SIZ_FULL, 39 - } 40 - }; 41 - 42 - /* 43 - * Default NAND partition layout 44 - */ 45 - static struct mtd_partition xlr_nand_parts[] = { 46 - { 47 - .name = "Root Filesystem", 48 - .offset = 64 * 64 * 2048, 49 - .size = 432 * 64 * 2048, 50 - }, 51 - { 52 - .name = "Home Filesystem", 53 - .offset = MTDPART_OFS_APPEND, 54 - .size = MTDPART_SIZ_FULL, 55 - }, 56 - }; 57 - 58 - /* Use PHYSMAP flash for NOR */ 59 - struct physmap_flash_data xlr_nor_data = { 60 - .width = 2, 61 - .parts = xlr_nor_parts, 62 - .nr_parts = ARRAY_SIZE(xlr_nor_parts), 63 - }; 64 - 65 - static struct resource xlr_nor_res[] = { 66 - { 67 - .flags = IORESOURCE_MEM, 68 - }, 69 - }; 70 - 71 - static struct platform_device xlr_nor_dev = { 72 - .name = "physmap-flash", 73 - .dev = { 74 - .platform_data = &xlr_nor_data, 75 - }, 76 - .num_resources = ARRAY_SIZE(xlr_nor_res), 77 - .resource = xlr_nor_res, 78 - }; 79 - 80 - /* 81 - * Use "gen_nand" driver for NAND flash 82 - * 83 - * There seems to be no way to store a private pointer containing 84 - * platform specific info in gen_nand drivier. We will use a global 85 - * struct for now, since we currently have only one NAND chip per board. 86 - */ 87 - struct xlr_nand_flash_priv { 88 - int cs; 89 - uint64_t flash_mmio; 90 - }; 91 - 92 - static struct xlr_nand_flash_priv nand_priv; 93 - 94 - static void xlr_nand_ctrl(struct nand_chip *chip, int cmd, 95 - unsigned int ctrl) 96 - { 97 - if (ctrl & NAND_CLE) 98 - nlm_write_reg(nand_priv.flash_mmio, 99 - FLASH_NAND_CLE(nand_priv.cs), cmd); 100 - else if (ctrl & NAND_ALE) 101 - nlm_write_reg(nand_priv.flash_mmio, 102 - FLASH_NAND_ALE(nand_priv.cs), cmd); 103 - } 104 - 105 - struct platform_nand_data xlr_nand_data = { 106 - .chip = { 107 - .nr_chips = 1, 108 - .nr_partitions = ARRAY_SIZE(xlr_nand_parts), 109 - .chip_delay = 50, 110 - .partitions = xlr_nand_parts, 111 - }, 112 - .ctrl = { 113 - .cmd_ctrl = xlr_nand_ctrl, 114 - }, 115 - }; 116 - 117 - static struct resource xlr_nand_res[] = { 118 - { 119 - .flags = IORESOURCE_MEM, 120 - }, 121 - }; 122 - 123 - static struct platform_device xlr_nand_dev = { 124 - .name = "gen_nand", 125 - .id = -1, 126 - .num_resources = ARRAY_SIZE(xlr_nand_res), 127 - .resource = xlr_nand_res, 128 - .dev = { 129 - .platform_data = &xlr_nand_data, 130 - } 131 - }; 132 - 133 - /* 134 - * XLR/XLS supports upto 8 devices on its FLASH interface. The value in 135 - * FLASH_BAR (on the MEM/IO bridge) gives the base for mapping all the 136 - * flash devices. 137 - * Under this, each flash device has an offset and size given by the 138 - * CSBASE_ADDR and CSBASE_MASK registers for the device. 139 - * 140 - * The CSBASE_ registers are expected to be setup by the bootloader. 141 - */ 142 - static void setup_flash_resource(uint64_t flash_mmio, 143 - uint64_t flash_map_base, int cs, struct resource *res) 144 - { 145 - u32 base, mask; 146 - 147 - base = nlm_read_reg(flash_mmio, FLASH_CSBASE_ADDR(cs)); 148 - mask = nlm_read_reg(flash_mmio, FLASH_CSADDR_MASK(cs)); 149 - 150 - res->start = flash_map_base + ((unsigned long)base << 16); 151 - res->end = res->start + (mask + 1) * 64 * 1024; 152 - } 153 - 154 - static int __init xlr_flash_init(void) 155 - { 156 - uint64_t gpio_mmio, flash_mmio, flash_map_base; 157 - u32 gpio_resetcfg, flash_bar; 158 - int cs, boot_nand, boot_nor; 159 - 160 - /* Flash address bits 39:24 is in bridge flash BAR */ 161 - flash_bar = nlm_read_reg(nlm_io_base, BRIDGE_FLASH_BAR); 162 - flash_map_base = (flash_bar & 0xffff0000) << 8; 163 - 164 - gpio_mmio = nlm_mmio_base(NETLOGIC_IO_GPIO_OFFSET); 165 - flash_mmio = nlm_mmio_base(NETLOGIC_IO_FLASH_OFFSET); 166 - 167 - /* Get the chip reset config */ 168 - gpio_resetcfg = nlm_read_reg(gpio_mmio, GPIO_PWRON_RESET_CFG_REG); 169 - 170 - /* Check for boot flash type */ 171 - boot_nor = boot_nand = 0; 172 - if (nlm_chip_is_xls()) { 173 - /* On XLS, check boot from NAND bit (GPIO reset reg bit 16) */ 174 - if (gpio_resetcfg & (1 << 16)) 175 - boot_nand = 1; 176 - 177 - /* check boot from PCMCIA, (GPIO reset reg bit 15 */ 178 - if ((gpio_resetcfg & (1 << 15)) == 0) 179 - boot_nor = 1; /* not set, booted from NOR */ 180 - } else { /* XLR */ 181 - /* check boot from PCMCIA (bit 16 in GPIO reset on XLR) */ 182 - if ((gpio_resetcfg & (1 << 16)) == 0) 183 - boot_nor = 1; /* not set, booted from NOR */ 184 - } 185 - 186 - /* boot flash at chip select 0 */ 187 - cs = 0; 188 - 189 - if (boot_nand) { 190 - nand_priv.cs = cs; 191 - nand_priv.flash_mmio = flash_mmio; 192 - setup_flash_resource(flash_mmio, flash_map_base, cs, 193 - xlr_nand_res); 194 - 195 - /* Initialize NAND flash at CS 0 */ 196 - nlm_write_reg(flash_mmio, FLASH_CSDEV_PARM(cs), 197 - FLASH_NAND_CSDEV_PARAM); 198 - nlm_write_reg(flash_mmio, FLASH_CSTIME_PARMA(cs), 199 - FLASH_NAND_CSTIME_PARAMA); 200 - nlm_write_reg(flash_mmio, FLASH_CSTIME_PARMB(cs), 201 - FLASH_NAND_CSTIME_PARAMB); 202 - 203 - pr_info("ChipSelect %d: NAND Flash %pR\n", cs, xlr_nand_res); 204 - return platform_device_register(&xlr_nand_dev); 205 - } 206 - 207 - if (boot_nor) { 208 - setup_flash_resource(flash_mmio, flash_map_base, cs, 209 - xlr_nor_res); 210 - pr_info("ChipSelect %d: NOR Flash %pR\n", cs, xlr_nor_res); 211 - return platform_device_register(&xlr_nor_dev); 212 - } 213 - return 0; 214 - } 215 - 216 - arch_initcall(xlr_flash_init);
-250
arch/mips/netlogic/xlr/platform.c
··· 1 - /* 2 - * Copyright 2011, Netlogic Microsystems. 3 - * Copyright 2004, Matt Porter <mporter@kernel.crashing.org> 4 - * 5 - * This file is licensed under the terms of the GNU General Public 6 - * License version 2. This program is licensed "as is" without any 7 - * warranty of any kind, whether express or implied. 8 - */ 9 - 10 - #include <linux/device.h> 11 - #include <linux/platform_device.h> 12 - #include <linux/kernel.h> 13 - #include <linux/init.h> 14 - #include <linux/resource.h> 15 - #include <linux/serial_8250.h> 16 - #include <linux/serial_reg.h> 17 - #include <linux/i2c.h> 18 - #include <linux/usb/ehci_pdriver.h> 19 - #include <linux/usb/ohci_pdriver.h> 20 - 21 - #include <asm/netlogic/haldefs.h> 22 - #include <asm/netlogic/xlr/iomap.h> 23 - #include <asm/netlogic/xlr/pic.h> 24 - #include <asm/netlogic/xlr/xlr.h> 25 - 26 - static unsigned int nlm_xlr_uart_in(struct uart_port *p, int offset) 27 - { 28 - uint64_t uartbase; 29 - unsigned int value; 30 - 31 - /* sign extend to 64 bits, if needed */ 32 - uartbase = (uint64_t)(long)p->membase; 33 - value = nlm_read_reg(uartbase, offset); 34 - 35 - /* See XLR/XLS errata */ 36 - if (offset == UART_MSR) 37 - value ^= 0xF0; 38 - else if (offset == UART_MCR) 39 - value ^= 0x3; 40 - 41 - return value; 42 - } 43 - 44 - static void nlm_xlr_uart_out(struct uart_port *p, int offset, int value) 45 - { 46 - uint64_t uartbase; 47 - 48 - /* sign extend to 64 bits, if needed */ 49 - uartbase = (uint64_t)(long)p->membase; 50 - 51 - /* See XLR/XLS errata */ 52 - if (offset == UART_MSR) 53 - value ^= 0xF0; 54 - else if (offset == UART_MCR) 55 - value ^= 0x3; 56 - 57 - nlm_write_reg(uartbase, offset, value); 58 - } 59 - 60 - #define PORT(_irq) \ 61 - { \ 62 - .irq = _irq, \ 63 - .regshift = 2, \ 64 - .iotype = UPIO_MEM32, \ 65 - .flags = (UPF_SKIP_TEST | \ 66 - UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF),\ 67 - .uartclk = PIC_CLK_HZ, \ 68 - .type = PORT_16550A, \ 69 - .serial_in = nlm_xlr_uart_in, \ 70 - .serial_out = nlm_xlr_uart_out, \ 71 - } 72 - 73 - static struct plat_serial8250_port xlr_uart_data[] = { 74 - PORT(PIC_UART_0_IRQ), 75 - PORT(PIC_UART_1_IRQ), 76 - {}, 77 - }; 78 - 79 - static struct platform_device uart_device = { 80 - .name = "serial8250", 81 - .id = PLAT8250_DEV_PLATFORM, 82 - .dev = { 83 - .platform_data = xlr_uart_data, 84 - }, 85 - }; 86 - 87 - static int __init nlm_uart_init(void) 88 - { 89 - unsigned long uartbase; 90 - 91 - uartbase = (unsigned long)nlm_mmio_base(NETLOGIC_IO_UART_0_OFFSET); 92 - xlr_uart_data[0].membase = (void __iomem *)uartbase; 93 - xlr_uart_data[0].mapbase = CPHYSADDR(uartbase); 94 - 95 - uartbase = (unsigned long)nlm_mmio_base(NETLOGIC_IO_UART_1_OFFSET); 96 - xlr_uart_data[1].membase = (void __iomem *)uartbase; 97 - xlr_uart_data[1].mapbase = CPHYSADDR(uartbase); 98 - 99 - return platform_device_register(&uart_device); 100 - } 101 - 102 - arch_initcall(nlm_uart_init); 103 - 104 - #ifdef CONFIG_USB 105 - /* Platform USB devices, only on XLS chips */ 106 - static u64 xls_usb_dmamask = ~(u32)0; 107 - #define USB_PLATFORM_DEV(n, i, irq) \ 108 - { \ 109 - .name = n, \ 110 - .id = i, \ 111 - .num_resources = 2, \ 112 - .dev = { \ 113 - .dma_mask = &xls_usb_dmamask, \ 114 - .coherent_dma_mask = 0xffffffff, \ 115 - }, \ 116 - .resource = (struct resource[]) { \ 117 - { \ 118 - .flags = IORESOURCE_MEM, \ 119 - }, \ 120 - { \ 121 - .start = irq, \ 122 - .end = irq, \ 123 - .flags = IORESOURCE_IRQ, \ 124 - }, \ 125 - }, \ 126 - } 127 - 128 - static struct usb_ehci_pdata xls_usb_ehci_pdata = { 129 - .caps_offset = 0, 130 - }; 131 - 132 - static struct usb_ohci_pdata xls_usb_ohci_pdata; 133 - 134 - static struct platform_device xls_usb_ehci_device = 135 - USB_PLATFORM_DEV("ehci-platform", 0, PIC_USB_IRQ); 136 - static struct platform_device xls_usb_ohci_device_0 = 137 - USB_PLATFORM_DEV("ohci-platform", 1, PIC_USB_IRQ); 138 - static struct platform_device xls_usb_ohci_device_1 = 139 - USB_PLATFORM_DEV("ohci-platform", 2, PIC_USB_IRQ); 140 - 141 - static struct platform_device *xls_platform_devices[] = { 142 - &xls_usb_ehci_device, 143 - &xls_usb_ohci_device_0, 144 - &xls_usb_ohci_device_1, 145 - }; 146 - 147 - int xls_platform_usb_init(void) 148 - { 149 - uint64_t usb_mmio, gpio_mmio; 150 - unsigned long memres; 151 - uint32_t val; 152 - 153 - if (!nlm_chip_is_xls()) 154 - return 0; 155 - 156 - gpio_mmio = nlm_mmio_base(NETLOGIC_IO_GPIO_OFFSET); 157 - usb_mmio = nlm_mmio_base(NETLOGIC_IO_USB_1_OFFSET); 158 - 159 - /* Clear Rogue Phy INTs */ 160 - nlm_write_reg(usb_mmio, 49, 0x10000000); 161 - /* Enable all interrupts */ 162 - nlm_write_reg(usb_mmio, 50, 0x1f000000); 163 - 164 - /* Enable ports */ 165 - nlm_write_reg(usb_mmio, 1, 0x07000500); 166 - 167 - val = nlm_read_reg(gpio_mmio, 21); 168 - if (((val >> 22) & 0x01) == 0) { 169 - pr_info("Detected USB Device mode - Not supported!\n"); 170 - nlm_write_reg(usb_mmio, 0, 0x01000000); 171 - return 0; 172 - } 173 - 174 - pr_info("Detected USB Host mode - Adding XLS USB devices.\n"); 175 - /* Clear reset, host mode */ 176 - nlm_write_reg(usb_mmio, 0, 0x02000000); 177 - 178 - /* Memory resource for various XLS usb ports */ 179 - usb_mmio = nlm_mmio_base(NETLOGIC_IO_USB_0_OFFSET); 180 - memres = CPHYSADDR((unsigned long)usb_mmio); 181 - xls_usb_ehci_device.resource[0].start = memres; 182 - xls_usb_ehci_device.resource[0].end = memres + 0x400 - 1; 183 - xls_usb_ehci_device.dev.platform_data = &xls_usb_ehci_pdata; 184 - 185 - memres += 0x400; 186 - xls_usb_ohci_device_0.resource[0].start = memres; 187 - xls_usb_ohci_device_0.resource[0].end = memres + 0x400 - 1; 188 - xls_usb_ohci_device_0.dev.platform_data = &xls_usb_ohci_pdata; 189 - 190 - memres += 0x400; 191 - xls_usb_ohci_device_1.resource[0].start = memres; 192 - xls_usb_ohci_device_1.resource[0].end = memres + 0x400 - 1; 193 - xls_usb_ohci_device_1.dev.platform_data = &xls_usb_ohci_pdata; 194 - 195 - return platform_add_devices(xls_platform_devices, 196 - ARRAY_SIZE(xls_platform_devices)); 197 - } 198 - 199 - arch_initcall(xls_platform_usb_init); 200 - #endif 201 - 202 - #ifdef CONFIG_I2C 203 - static struct i2c_board_info nlm_i2c_board_info1[] __initdata = { 204 - /* All XLR boards have this RTC and Max6657 Temp Chip */ 205 - [0] = { 206 - .type = "ds1374", 207 - .addr = 0x68 208 - }, 209 - [1] = { 210 - .type = "lm90", 211 - .addr = 0x4c 212 - }, 213 - }; 214 - 215 - static struct resource i2c_resources[] = { 216 - [0] = { 217 - .start = 0, /* filled at init */ 218 - .end = 0, 219 - .flags = IORESOURCE_MEM, 220 - }, 221 - }; 222 - 223 - static struct platform_device nlm_xlr_i2c_1 = { 224 - .name = "xlr-i2cbus", 225 - .id = 1, 226 - .num_resources = 1, 227 - .resource = i2c_resources, 228 - }; 229 - 230 - static int __init nlm_i2c_init(void) 231 - { 232 - int err = 0; 233 - unsigned int offset; 234 - 235 - /* I2C bus 0 does not have any useful devices, configure only bus 1 */ 236 - offset = NETLOGIC_IO_I2C_1_OFFSET; 237 - nlm_xlr_i2c_1.resource[0].start = CPHYSADDR(nlm_mmio_base(offset)); 238 - nlm_xlr_i2c_1.resource[0].end = nlm_xlr_i2c_1.resource[0].start + 0xfff; 239 - 240 - platform_device_register(&nlm_xlr_i2c_1); 241 - 242 - err = i2c_register_board_info(1, nlm_i2c_board_info1, 243 - ARRAY_SIZE(nlm_i2c_board_info1)); 244 - if (err < 0) 245 - pr_err("nlm-i2c: cannot register board I2C devices\n"); 246 - return err; 247 - } 248 - 249 - arch_initcall(nlm_i2c_init); 250 - #endif
-206
arch/mips/netlogic/xlr/setup.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/kernel.h> 36 - #include <linux/serial_8250.h> 37 - #include <linux/memblock.h> 38 - #include <linux/pm.h> 39 - 40 - #include <asm/idle.h> 41 - #include <asm/reboot.h> 42 - #include <asm/time.h> 43 - #include <asm/bootinfo.h> 44 - 45 - #include <asm/netlogic/interrupt.h> 46 - #include <asm/netlogic/psb-bootinfo.h> 47 - #include <asm/netlogic/haldefs.h> 48 - #include <asm/netlogic/common.h> 49 - 50 - #include <asm/netlogic/xlr/xlr.h> 51 - #include <asm/netlogic/xlr/iomap.h> 52 - #include <asm/netlogic/xlr/pic.h> 53 - #include <asm/netlogic/xlr/gpio.h> 54 - #include <asm/netlogic/xlr/fmn.h> 55 - 56 - uint64_t nlm_io_base = DEFAULT_NETLOGIC_IO_BASE; 57 - struct psb_info nlm_prom_info; 58 - 59 - /* default to uniprocessor */ 60 - unsigned int nlm_threads_per_core = 1; 61 - struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; 62 - cpumask_t nlm_cpumask = CPU_MASK_CPU0; 63 - 64 - static void nlm_linux_exit(void) 65 - { 66 - uint64_t gpiobase; 67 - 68 - gpiobase = nlm_mmio_base(NETLOGIC_IO_GPIO_OFFSET); 69 - /* trigger a chip reset by writing 1 to GPIO_SWRESET_REG */ 70 - nlm_write_reg(gpiobase, GPIO_SWRESET_REG, 1); 71 - for ( ; ; ) 72 - cpu_wait(); 73 - } 74 - 75 - void __init plat_mem_setup(void) 76 - { 77 - _machine_restart = (void (*)(char *))nlm_linux_exit; 78 - _machine_halt = nlm_linux_exit; 79 - pm_power_off = nlm_linux_exit; 80 - } 81 - 82 - const char *get_system_type(void) 83 - { 84 - return "Netlogic XLR/XLS Series"; 85 - } 86 - 87 - unsigned int nlm_get_cpu_frequency(void) 88 - { 89 - return (unsigned int)nlm_prom_info.cpu_frequency; 90 - } 91 - 92 - void nlm_percpu_init(int hwcpuid) 93 - { 94 - if (hwcpuid % 4 == 0) 95 - xlr_percpu_fmn_init(); 96 - } 97 - 98 - static void __init build_arcs_cmdline(int *argv) 99 - { 100 - int i, remain, len; 101 - char *arg; 102 - 103 - remain = sizeof(arcs_cmdline) - 1; 104 - arcs_cmdline[0] = '\0'; 105 - for (i = 0; argv[i] != 0; i++) { 106 - arg = (char *)(long)argv[i]; 107 - len = strlen(arg); 108 - if (len + 1 > remain) 109 - break; 110 - strcat(arcs_cmdline, arg); 111 - strcat(arcs_cmdline, " "); 112 - remain -= len + 1; 113 - } 114 - 115 - /* Add the default options here */ 116 - if ((strstr(arcs_cmdline, "console=")) == NULL) { 117 - arg = "console=ttyS0,38400 "; 118 - len = strlen(arg); 119 - if (len > remain) 120 - goto fail; 121 - strcat(arcs_cmdline, arg); 122 - remain -= len; 123 - } 124 - #ifdef CONFIG_BLK_DEV_INITRD 125 - if ((strstr(arcs_cmdline, "rdinit=")) == NULL) { 126 - arg = "rdinit=/sbin/init "; 127 - len = strlen(arg); 128 - if (len > remain) 129 - goto fail; 130 - strcat(arcs_cmdline, arg); 131 - remain -= len; 132 - } 133 - #endif 134 - return; 135 - fail: 136 - panic("Cannot add %s, command line too big!", arg); 137 - } 138 - 139 - static void prom_add_memory(void) 140 - { 141 - struct nlm_boot_mem_map *bootm; 142 - u64 start, size; 143 - u64 pref_backup = 512; /* avoid pref walking beyond end */ 144 - int i; 145 - 146 - bootm = (void *)(long)nlm_prom_info.psb_mem_map; 147 - for (i = 0; i < bootm->nr_map; i++) { 148 - if (bootm->map[i].type != NLM_BOOT_MEM_RAM) 149 - continue; 150 - start = bootm->map[i].addr; 151 - size = bootm->map[i].size; 152 - 153 - /* Work around for using bootloader mem */ 154 - if (i == 0 && start == 0 && size == 0x0c000000) 155 - size = 0x0ff00000; 156 - 157 - memblock_add(start, size - pref_backup); 158 - } 159 - } 160 - 161 - static void nlm_init_node(void) 162 - { 163 - struct nlm_soc_info *nodep; 164 - 165 - nodep = nlm_current_node(); 166 - nodep->picbase = nlm_mmio_base(NETLOGIC_IO_PIC_OFFSET); 167 - nodep->ebase = read_c0_ebase() & MIPS_EBASE_BASE; 168 - spin_lock_init(&nodep->piclock); 169 - } 170 - 171 - void __init prom_init(void) 172 - { 173 - int *argv, *envp; /* passed as 32 bit ptrs */ 174 - struct psb_info *prom_infop; 175 - void *reset_vec; 176 - #ifdef CONFIG_SMP 177 - int i; 178 - #endif 179 - 180 - /* truncate to 32 bit and sign extend all args */ 181 - argv = (int *)(long)(int)fw_arg1; 182 - envp = (int *)(long)(int)fw_arg2; 183 - prom_infop = (struct psb_info *)(long)(int)fw_arg3; 184 - 185 - nlm_prom_info = *prom_infop; 186 - nlm_init_node(); 187 - 188 - /* Update reset entry point with CPU init code */ 189 - reset_vec = (void *)CKSEG1ADDR(RESET_VEC_PHYS); 190 - memset(reset_vec, 0, RESET_VEC_SIZE); 191 - memcpy(reset_vec, (void *)nlm_reset_entry, 192 - (nlm_reset_entry_end - nlm_reset_entry)); 193 - 194 - build_arcs_cmdline(argv); 195 - prom_add_memory(); 196 - 197 - #ifdef CONFIG_SMP 198 - for (i = 0; i < 32; i++) 199 - if (nlm_prom_info.online_cpu_map & (1 << i)) 200 - cpumask_set_cpu(i, &nlm_cpumask); 201 - nlm_wakeup_secondary_cpus(); 202 - register_smp_ops(&nlm_smp_ops); 203 - #endif 204 - xlr_board_info_setup(); 205 - xlr_percpu_fmn_init(); 206 - }
-85
arch/mips/netlogic/xlr/wakeup.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/delay.h> 36 - #include <linux/threads.h> 37 - 38 - #include <asm/asm.h> 39 - #include <asm/asm-offsets.h> 40 - #include <asm/mipsregs.h> 41 - #include <asm/addrspace.h> 42 - #include <asm/string.h> 43 - 44 - #include <asm/netlogic/haldefs.h> 45 - #include <asm/netlogic/common.h> 46 - #include <asm/netlogic/mips-extns.h> 47 - 48 - #include <asm/netlogic/xlr/iomap.h> 49 - #include <asm/netlogic/xlr/pic.h> 50 - 51 - int xlr_wakeup_secondary_cpus(void) 52 - { 53 - struct nlm_soc_info *nodep; 54 - unsigned int i, j, boot_cpu; 55 - volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY); 56 - 57 - /* 58 - * In case of RMI boot, hit with NMI to get the cores 59 - * from bootloader to linux code. 60 - */ 61 - nodep = nlm_get_node(0); 62 - boot_cpu = hard_smp_processor_id(); 63 - nlm_set_nmi_handler(nlm_rmiboot_preboot); 64 - for (i = 0; i < NR_CPUS; i++) { 65 - if (i == boot_cpu || !cpumask_test_cpu(i, &nlm_cpumask)) 66 - continue; 67 - nlm_pic_send_ipi(nodep->picbase, i, 1, 1); /* send NMI */ 68 - } 69 - 70 - /* Fill up the coremask early */ 71 - nodep->coremask = 1; 72 - for (i = 1; i < nlm_cores_per_node(); i++) { 73 - for (j = 1000000; j > 0; j--) { 74 - if (cpu_ready[i * NLM_THREADS_PER_CORE]) 75 - break; 76 - udelay(10); 77 - } 78 - if (j != 0) 79 - nodep->coremask |= (1u << i); 80 - else 81 - pr_err("Failed to wakeup core %d\n", i); 82 - } 83 - 84 - return 0; 85 - }
-3
arch/mips/pci/Makefile
··· 56 56 obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o 57 57 obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o 58 58 obj-$(CONFIG_CAVIUM_OCTEON_SOC) += pci-octeon.o pcie-octeon.o 59 - obj-$(CONFIG_CPU_XLR) += pci-xlr.o 60 - obj-$(CONFIG_CPU_XLP) += pci-xlp.o 61 59 62 60 ifdef CONFIG_PCI_MSI 63 61 obj-$(CONFIG_CAVIUM_OCTEON_SOC) += msi-octeon.o 64 - obj-$(CONFIG_CPU_XLP) += msi-xlp.o 65 62 endif
-571
arch/mips/pci/msi-xlp.c
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/types.h> 36 - #include <linux/pci.h> 37 - #include <linux/kernel.h> 38 - #include <linux/init.h> 39 - #include <linux/msi.h> 40 - #include <linux/mm.h> 41 - #include <linux/irq.h> 42 - #include <linux/irqdesc.h> 43 - #include <linux/console.h> 44 - 45 - #include <asm/io.h> 46 - 47 - #include <asm/netlogic/interrupt.h> 48 - #include <asm/netlogic/haldefs.h> 49 - #include <asm/netlogic/common.h> 50 - #include <asm/netlogic/mips-extns.h> 51 - 52 - #include <asm/netlogic/xlp-hal/iomap.h> 53 - #include <asm/netlogic/xlp-hal/xlp.h> 54 - #include <asm/netlogic/xlp-hal/pic.h> 55 - #include <asm/netlogic/xlp-hal/pcibus.h> 56 - #include <asm/netlogic/xlp-hal/bridge.h> 57 - 58 - #define XLP_MSIVEC_PER_LINK 32 59 - #define XLP_MSIXVEC_TOTAL (cpu_is_xlp9xx() ? 128 : 32) 60 - #define XLP_MSIXVEC_PER_LINK (cpu_is_xlp9xx() ? 32 : 8) 61 - 62 - /* 128 MSI irqs per node, mapped starting at NLM_MSI_VEC_BASE */ 63 - static inline int nlm_link_msiirq(int link, int msivec) 64 - { 65 - return NLM_MSI_VEC_BASE + link * XLP_MSIVEC_PER_LINK + msivec; 66 - } 67 - 68 - /* get the link MSI vector from irq number */ 69 - static inline int nlm_irq_msivec(int irq) 70 - { 71 - return (irq - NLM_MSI_VEC_BASE) % XLP_MSIVEC_PER_LINK; 72 - } 73 - 74 - /* get the link from the irq number */ 75 - static inline int nlm_irq_msilink(int irq) 76 - { 77 - int total_msivec = XLP_MSIVEC_PER_LINK * PCIE_NLINKS; 78 - 79 - return ((irq - NLM_MSI_VEC_BASE) % total_msivec) / 80 - XLP_MSIVEC_PER_LINK; 81 - } 82 - 83 - /* 84 - * For XLP 8xx/4xx/3xx/2xx, only 32 MSI-X vectors are possible because 85 - * there are only 32 PIC interrupts for MSI. We split them statically 86 - * and use 8 MSI-X vectors per link - this keeps the allocation and 87 - * lookup simple. 88 - * On XLP 9xx, there are 32 vectors per link, and the interrupts are 89 - * not routed thru PIC, so we can use all 128 MSI-X vectors. 90 - */ 91 - static inline int nlm_link_msixirq(int link, int bit) 92 - { 93 - return NLM_MSIX_VEC_BASE + link * XLP_MSIXVEC_PER_LINK + bit; 94 - } 95 - 96 - /* get the link MSI vector from irq number */ 97 - static inline int nlm_irq_msixvec(int irq) 98 - { 99 - return (irq - NLM_MSIX_VEC_BASE) % XLP_MSIXVEC_TOTAL; 100 - } 101 - 102 - /* get the link from MSIX vec */ 103 - static inline int nlm_irq_msixlink(int msixvec) 104 - { 105 - return msixvec / XLP_MSIXVEC_PER_LINK; 106 - } 107 - 108 - /* 109 - * Per link MSI and MSI-X information, set as IRQ handler data for 110 - * MSI and MSI-X interrupts. 111 - */ 112 - struct xlp_msi_data { 113 - struct nlm_soc_info *node; 114 - uint64_t lnkbase; 115 - uint32_t msi_enabled_mask; 116 - uint32_t msi_alloc_mask; 117 - uint32_t msix_alloc_mask; 118 - spinlock_t msi_lock; 119 - }; 120 - 121 - /* 122 - * MSI Chip definitions 123 - * 124 - * On XLP, there is a PIC interrupt associated with each PCIe link on the 125 - * chip (which appears as a PCI bridge to us). This gives us 32 MSI irqa 126 - * per link and 128 overall. 127 - * 128 - * When a device connected to the link raises a MSI interrupt, we get a 129 - * link interrupt and we then have to look at PCIE_MSI_STATUS register at 130 - * the bridge to map it to the IRQ 131 - */ 132 - static void xlp_msi_enable(struct irq_data *d) 133 - { 134 - struct xlp_msi_data *md = irq_data_get_irq_chip_data(d); 135 - unsigned long flags; 136 - int vec; 137 - 138 - vec = nlm_irq_msivec(d->irq); 139 - spin_lock_irqsave(&md->msi_lock, flags); 140 - md->msi_enabled_mask |= 1u << vec; 141 - if (cpu_is_xlp9xx()) 142 - nlm_write_reg(md->lnkbase, PCIE_9XX_MSI_EN, 143 - md->msi_enabled_mask); 144 - else 145 - nlm_write_reg(md->lnkbase, PCIE_MSI_EN, md->msi_enabled_mask); 146 - spin_unlock_irqrestore(&md->msi_lock, flags); 147 - } 148 - 149 - static void xlp_msi_disable(struct irq_data *d) 150 - { 151 - struct xlp_msi_data *md = irq_data_get_irq_chip_data(d); 152 - unsigned long flags; 153 - int vec; 154 - 155 - vec = nlm_irq_msivec(d->irq); 156 - spin_lock_irqsave(&md->msi_lock, flags); 157 - md->msi_enabled_mask &= ~(1u << vec); 158 - if (cpu_is_xlp9xx()) 159 - nlm_write_reg(md->lnkbase, PCIE_9XX_MSI_EN, 160 - md->msi_enabled_mask); 161 - else 162 - nlm_write_reg(md->lnkbase, PCIE_MSI_EN, md->msi_enabled_mask); 163 - spin_unlock_irqrestore(&md->msi_lock, flags); 164 - } 165 - 166 - static void xlp_msi_mask_ack(struct irq_data *d) 167 - { 168 - struct xlp_msi_data *md = irq_data_get_irq_chip_data(d); 169 - int link, vec; 170 - 171 - link = nlm_irq_msilink(d->irq); 172 - vec = nlm_irq_msivec(d->irq); 173 - xlp_msi_disable(d); 174 - 175 - /* Ack MSI on bridge */ 176 - if (cpu_is_xlp9xx()) 177 - nlm_write_reg(md->lnkbase, PCIE_9XX_MSI_STATUS, 1u << vec); 178 - else 179 - nlm_write_reg(md->lnkbase, PCIE_MSI_STATUS, 1u << vec); 180 - 181 - } 182 - 183 - static struct irq_chip xlp_msi_chip = { 184 - .name = "XLP-MSI", 185 - .irq_enable = xlp_msi_enable, 186 - .irq_disable = xlp_msi_disable, 187 - .irq_mask_ack = xlp_msi_mask_ack, 188 - .irq_unmask = xlp_msi_enable, 189 - }; 190 - 191 - /* 192 - * XLP8XX/4XX/3XX/2XX: 193 - * The MSI-X interrupt handling is different from MSI, there are 32 MSI-X 194 - * interrupts generated by the PIC and each of these correspond to a MSI-X 195 - * vector (0-31) that can be assigned. 196 - * 197 - * We divide the MSI-X vectors to 8 per link and do a per-link allocation 198 - * 199 - * XLP9XX: 200 - * 32 MSI-X vectors are available per link, and the interrupts are not routed 201 - * thru the PIC. PIC ack not needed. 202 - * 203 - * Enable and disable done using standard MSI functions. 204 - */ 205 - static void xlp_msix_mask_ack(struct irq_data *d) 206 - { 207 - struct xlp_msi_data *md; 208 - int link, msixvec; 209 - uint32_t status_reg, bit; 210 - 211 - msixvec = nlm_irq_msixvec(d->irq); 212 - link = nlm_irq_msixlink(msixvec); 213 - pci_msi_mask_irq(d); 214 - md = irq_data_get_irq_chip_data(d); 215 - 216 - /* Ack MSI on bridge */ 217 - if (cpu_is_xlp9xx()) { 218 - status_reg = PCIE_9XX_MSIX_STATUSX(link); 219 - bit = msixvec % XLP_MSIXVEC_PER_LINK; 220 - } else { 221 - status_reg = PCIE_MSIX_STATUS; 222 - bit = msixvec; 223 - } 224 - nlm_write_reg(md->lnkbase, status_reg, 1u << bit); 225 - 226 - if (!cpu_is_xlp9xx()) 227 - nlm_pic_ack(md->node->picbase, 228 - PIC_IRT_PCIE_MSIX_INDEX(msixvec)); 229 - } 230 - 231 - static struct irq_chip xlp_msix_chip = { 232 - .name = "XLP-MSIX", 233 - .irq_enable = pci_msi_unmask_irq, 234 - .irq_disable = pci_msi_mask_irq, 235 - .irq_mask_ack = xlp_msix_mask_ack, 236 - .irq_unmask = pci_msi_unmask_irq, 237 - }; 238 - 239 - void arch_teardown_msi_irq(unsigned int irq) 240 - { 241 - } 242 - 243 - /* 244 - * Setup a PCIe link for MSI. By default, the links are in 245 - * legacy interrupt mode. We will switch them to MSI mode 246 - * at the first MSI request. 247 - */ 248 - static void xlp_config_link_msi(uint64_t lnkbase, int lirq, uint64_t msiaddr) 249 - { 250 - u32 val; 251 - 252 - if (cpu_is_xlp9xx()) { 253 - val = nlm_read_reg(lnkbase, PCIE_9XX_INT_EN0); 254 - if ((val & 0x200) == 0) { 255 - val |= 0x200; /* MSI Interrupt enable */ 256 - nlm_write_reg(lnkbase, PCIE_9XX_INT_EN0, val); 257 - } 258 - } else { 259 - val = nlm_read_reg(lnkbase, PCIE_INT_EN0); 260 - if ((val & 0x200) == 0) { 261 - val |= 0x200; 262 - nlm_write_reg(lnkbase, PCIE_INT_EN0, val); 263 - } 264 - } 265 - 266 - val = nlm_read_reg(lnkbase, 0x1); /* CMD */ 267 - if ((val & 0x0400) == 0) { 268 - val |= 0x0400; 269 - nlm_write_reg(lnkbase, 0x1, val); 270 - } 271 - 272 - /* Update IRQ in the PCI irq reg */ 273 - val = nlm_read_pci_reg(lnkbase, 0xf); 274 - val &= ~0x1fu; 275 - val |= (1 << 8) | lirq; 276 - nlm_write_pci_reg(lnkbase, 0xf, val); 277 - 278 - /* MSI addr */ 279 - nlm_write_reg(lnkbase, PCIE_BRIDGE_MSI_ADDRH, msiaddr >> 32); 280 - nlm_write_reg(lnkbase, PCIE_BRIDGE_MSI_ADDRL, msiaddr & 0xffffffff); 281 - 282 - /* MSI cap for bridge */ 283 - val = nlm_read_reg(lnkbase, PCIE_BRIDGE_MSI_CAP); 284 - if ((val & (1 << 16)) == 0) { 285 - val |= 0xb << 16; /* mmc32, msi enable */ 286 - nlm_write_reg(lnkbase, PCIE_BRIDGE_MSI_CAP, val); 287 - } 288 - } 289 - 290 - /* 291 - * Allocate a MSI vector on a link 292 - */ 293 - static int xlp_setup_msi(uint64_t lnkbase, int node, int link, 294 - struct msi_desc *desc) 295 - { 296 - struct xlp_msi_data *md; 297 - struct msi_msg msg; 298 - unsigned long flags; 299 - int msivec, irt, lirq, xirq, ret; 300 - uint64_t msiaddr; 301 - 302 - /* Get MSI data for the link */ 303 - lirq = PIC_PCIE_LINK_MSI_IRQ(link); 304 - xirq = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0)); 305 - md = irq_get_chip_data(xirq); 306 - msiaddr = MSI_LINK_ADDR(node, link); 307 - 308 - spin_lock_irqsave(&md->msi_lock, flags); 309 - if (md->msi_alloc_mask == 0) { 310 - xlp_config_link_msi(lnkbase, lirq, msiaddr); 311 - /* switch the link IRQ to MSI range */ 312 - if (cpu_is_xlp9xx()) 313 - irt = PIC_9XX_IRT_PCIE_LINK_INDEX(link); 314 - else 315 - irt = PIC_IRT_PCIE_LINK_INDEX(link); 316 - nlm_setup_pic_irq(node, lirq, lirq, irt); 317 - nlm_pic_init_irt(nlm_get_node(node)->picbase, irt, lirq, 318 - node * nlm_threads_per_node(), 1 /*en */); 319 - } 320 - 321 - /* allocate a MSI vec, and tell the bridge about it */ 322 - msivec = fls(md->msi_alloc_mask); 323 - if (msivec == XLP_MSIVEC_PER_LINK) { 324 - spin_unlock_irqrestore(&md->msi_lock, flags); 325 - return -ENOMEM; 326 - } 327 - md->msi_alloc_mask |= (1u << msivec); 328 - spin_unlock_irqrestore(&md->msi_lock, flags); 329 - 330 - msg.address_hi = msiaddr >> 32; 331 - msg.address_lo = msiaddr & 0xffffffff; 332 - msg.data = 0xc00 | msivec; 333 - 334 - xirq = xirq + msivec; /* msi mapped to global irq space */ 335 - ret = irq_set_msi_desc(xirq, desc); 336 - if (ret < 0) 337 - return ret; 338 - 339 - pci_write_msi_msg(xirq, &msg); 340 - return 0; 341 - } 342 - 343 - /* 344 - * Switch a link to MSI-X mode 345 - */ 346 - static void xlp_config_link_msix(uint64_t lnkbase, int lirq, uint64_t msixaddr) 347 - { 348 - u32 val; 349 - 350 - val = nlm_read_reg(lnkbase, 0x2C); 351 - if ((val & 0x80000000U) == 0) { 352 - val |= 0x80000000U; 353 - nlm_write_reg(lnkbase, 0x2C, val); 354 - } 355 - 356 - if (cpu_is_xlp9xx()) { 357 - val = nlm_read_reg(lnkbase, PCIE_9XX_INT_EN0); 358 - if ((val & 0x200) == 0) { 359 - val |= 0x200; /* MSI Interrupt enable */ 360 - nlm_write_reg(lnkbase, PCIE_9XX_INT_EN0, val); 361 - } 362 - } else { 363 - val = nlm_read_reg(lnkbase, PCIE_INT_EN0); 364 - if ((val & 0x200) == 0) { 365 - val |= 0x200; /* MSI Interrupt enable */ 366 - nlm_write_reg(lnkbase, PCIE_INT_EN0, val); 367 - } 368 - } 369 - 370 - val = nlm_read_reg(lnkbase, 0x1); /* CMD */ 371 - if ((val & 0x0400) == 0) { 372 - val |= 0x0400; 373 - nlm_write_reg(lnkbase, 0x1, val); 374 - } 375 - 376 - /* Update IRQ in the PCI irq reg */ 377 - val = nlm_read_pci_reg(lnkbase, 0xf); 378 - val &= ~0x1fu; 379 - val |= (1 << 8) | lirq; 380 - nlm_write_pci_reg(lnkbase, 0xf, val); 381 - 382 - if (cpu_is_xlp9xx()) { 383 - /* MSI-X addresses */ 384 - nlm_write_reg(lnkbase, PCIE_9XX_BRIDGE_MSIX_ADDR_BASE, 385 - msixaddr >> 8); 386 - nlm_write_reg(lnkbase, PCIE_9XX_BRIDGE_MSIX_ADDR_LIMIT, 387 - (msixaddr + MSI_ADDR_SZ) >> 8); 388 - } else { 389 - /* MSI-X addresses */ 390 - nlm_write_reg(lnkbase, PCIE_BRIDGE_MSIX_ADDR_BASE, 391 - msixaddr >> 8); 392 - nlm_write_reg(lnkbase, PCIE_BRIDGE_MSIX_ADDR_LIMIT, 393 - (msixaddr + MSI_ADDR_SZ) >> 8); 394 - } 395 - } 396 - 397 - /* 398 - * Allocate a MSI-X vector 399 - */ 400 - static int xlp_setup_msix(uint64_t lnkbase, int node, int link, 401 - struct msi_desc *desc) 402 - { 403 - struct xlp_msi_data *md; 404 - struct msi_msg msg; 405 - unsigned long flags; 406 - int t, msixvec, lirq, xirq, ret; 407 - uint64_t msixaddr; 408 - 409 - /* Get MSI data for the link */ 410 - lirq = PIC_PCIE_MSIX_IRQ(link); 411 - xirq = nlm_irq_to_xirq(node, nlm_link_msixirq(link, 0)); 412 - md = irq_get_chip_data(xirq); 413 - msixaddr = MSIX_LINK_ADDR(node, link); 414 - 415 - spin_lock_irqsave(&md->msi_lock, flags); 416 - /* switch the PCIe link to MSI-X mode at the first alloc */ 417 - if (md->msix_alloc_mask == 0) 418 - xlp_config_link_msix(lnkbase, lirq, msixaddr); 419 - 420 - /* allocate a MSI-X vec, and tell the bridge about it */ 421 - t = fls(md->msix_alloc_mask); 422 - if (t == XLP_MSIXVEC_PER_LINK) { 423 - spin_unlock_irqrestore(&md->msi_lock, flags); 424 - return -ENOMEM; 425 - } 426 - md->msix_alloc_mask |= (1u << t); 427 - spin_unlock_irqrestore(&md->msi_lock, flags); 428 - 429 - xirq += t; 430 - msixvec = nlm_irq_msixvec(xirq); 431 - 432 - msg.address_hi = msixaddr >> 32; 433 - msg.address_lo = msixaddr & 0xffffffff; 434 - msg.data = 0xc00 | msixvec; 435 - 436 - ret = irq_set_msi_desc(xirq, desc); 437 - if (ret < 0) 438 - return ret; 439 - 440 - pci_write_msi_msg(xirq, &msg); 441 - return 0; 442 - } 443 - 444 - int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) 445 - { 446 - struct pci_dev *lnkdev; 447 - uint64_t lnkbase; 448 - int node, link, slot; 449 - 450 - lnkdev = xlp_get_pcie_link(dev); 451 - if (lnkdev == NULL) { 452 - dev_err(&dev->dev, "Could not find bridge\n"); 453 - return 1; 454 - } 455 - slot = PCI_SLOT(lnkdev->devfn); 456 - link = PCI_FUNC(lnkdev->devfn); 457 - node = slot / 8; 458 - lnkbase = nlm_get_pcie_base(node, link); 459 - 460 - if (desc->msi_attrib.is_msix) 461 - return xlp_setup_msix(lnkbase, node, link, desc); 462 - else 463 - return xlp_setup_msi(lnkbase, node, link, desc); 464 - } 465 - 466 - void __init xlp_init_node_msi_irqs(int node, int link) 467 - { 468 - struct nlm_soc_info *nodep; 469 - struct xlp_msi_data *md; 470 - int irq, i, irt, msixvec, val; 471 - 472 - pr_info("[%d %d] Init node PCI IRT\n", node, link); 473 - nodep = nlm_get_node(node); 474 - 475 - /* Alloc an MSI block for the link */ 476 - md = kzalloc(sizeof(*md), GFP_KERNEL); 477 - spin_lock_init(&md->msi_lock); 478 - md->msi_enabled_mask = 0; 479 - md->msi_alloc_mask = 0; 480 - md->msix_alloc_mask = 0; 481 - md->node = nodep; 482 - md->lnkbase = nlm_get_pcie_base(node, link); 483 - 484 - /* extended space for MSI interrupts */ 485 - irq = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0)); 486 - for (i = irq; i < irq + XLP_MSIVEC_PER_LINK; i++) { 487 - irq_set_chip_and_handler(i, &xlp_msi_chip, handle_level_irq); 488 - irq_set_chip_data(i, md); 489 - } 490 - 491 - for (i = 0; i < XLP_MSIXVEC_PER_LINK ; i++) { 492 - if (cpu_is_xlp9xx()) { 493 - val = ((node * nlm_threads_per_node()) << 7 | 494 - PIC_PCIE_MSIX_IRQ(link) << 1 | 0 << 0); 495 - nlm_write_pcie_reg(md->lnkbase, PCIE_9XX_MSIX_VECX(i + 496 - (link * XLP_MSIXVEC_PER_LINK)), val); 497 - } else { 498 - /* Initialize MSI-X irts to generate one interrupt 499 - * per link 500 - */ 501 - msixvec = link * XLP_MSIXVEC_PER_LINK + i; 502 - irt = PIC_IRT_PCIE_MSIX_INDEX(msixvec); 503 - nlm_pic_init_irt(nodep->picbase, irt, 504 - PIC_PCIE_MSIX_IRQ(link), 505 - node * nlm_threads_per_node(), 1); 506 - } 507 - 508 - /* Initialize MSI-X extended irq space for the link */ 509 - irq = nlm_irq_to_xirq(node, nlm_link_msixirq(link, i)); 510 - irq_set_chip_and_handler(irq, &xlp_msix_chip, handle_level_irq); 511 - irq_set_chip_data(irq, md); 512 - } 513 - } 514 - 515 - void nlm_dispatch_msi(int node, int lirq) 516 - { 517 - struct xlp_msi_data *md; 518 - int link, i, irqbase; 519 - u32 status; 520 - 521 - link = lirq - PIC_PCIE_LINK_MSI_IRQ_BASE; 522 - irqbase = nlm_irq_to_xirq(node, nlm_link_msiirq(link, 0)); 523 - md = irq_get_chip_data(irqbase); 524 - if (cpu_is_xlp9xx()) 525 - status = nlm_read_reg(md->lnkbase, PCIE_9XX_MSI_STATUS) & 526 - md->msi_enabled_mask; 527 - else 528 - status = nlm_read_reg(md->lnkbase, PCIE_MSI_STATUS) & 529 - md->msi_enabled_mask; 530 - while (status) { 531 - i = __ffs(status); 532 - do_IRQ(irqbase + i); 533 - status &= status - 1; 534 - } 535 - 536 - /* Ack at eirr and PIC */ 537 - ack_c0_eirr(PIC_PCIE_LINK_MSI_IRQ(link)); 538 - if (cpu_is_xlp9xx()) 539 - nlm_pic_ack(md->node->picbase, 540 - PIC_9XX_IRT_PCIE_LINK_INDEX(link)); 541 - else 542 - nlm_pic_ack(md->node->picbase, PIC_IRT_PCIE_LINK_INDEX(link)); 543 - } 544 - 545 - void nlm_dispatch_msix(int node, int lirq) 546 - { 547 - struct xlp_msi_data *md; 548 - int link, i, irqbase; 549 - u32 status; 550 - 551 - link = lirq - PIC_PCIE_MSIX_IRQ_BASE; 552 - irqbase = nlm_irq_to_xirq(node, nlm_link_msixirq(link, 0)); 553 - md = irq_get_chip_data(irqbase); 554 - if (cpu_is_xlp9xx()) 555 - status = nlm_read_reg(md->lnkbase, PCIE_9XX_MSIX_STATUSX(link)); 556 - else 557 - status = nlm_read_reg(md->lnkbase, PCIE_MSIX_STATUS); 558 - 559 - /* narrow it down to the MSI-x vectors for our link */ 560 - if (!cpu_is_xlp9xx()) 561 - status = (status >> (link * XLP_MSIXVEC_PER_LINK)) & 562 - ((1 << XLP_MSIXVEC_PER_LINK) - 1); 563 - 564 - while (status) { 565 - i = __ffs(status); 566 - do_IRQ(irqbase + i); 567 - status &= status - 1; 568 - } 569 - /* Ack at eirr and PIC */ 570 - ack_c0_eirr(PIC_PCIE_MSIX_IRQ(link)); 571 - }
-332
arch/mips/pci/pci-xlp.c
··· 1 - /* 2 - * Copyright (c) 2003-2012 Broadcom Corporation 3 - * All Rights Reserved 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the Broadcom 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/types.h> 36 - #include <linux/pci.h> 37 - #include <linux/kernel.h> 38 - #include <linux/init.h> 39 - #include <linux/msi.h> 40 - #include <linux/mm.h> 41 - #include <linux/irq.h> 42 - #include <linux/irqdesc.h> 43 - #include <linux/console.h> 44 - 45 - #include <asm/io.h> 46 - 47 - #include <asm/netlogic/interrupt.h> 48 - #include <asm/netlogic/haldefs.h> 49 - #include <asm/netlogic/common.h> 50 - #include <asm/netlogic/mips-extns.h> 51 - 52 - #include <asm/netlogic/xlp-hal/iomap.h> 53 - #include <asm/netlogic/xlp-hal/xlp.h> 54 - #include <asm/netlogic/xlp-hal/pic.h> 55 - #include <asm/netlogic/xlp-hal/pcibus.h> 56 - #include <asm/netlogic/xlp-hal/bridge.h> 57 - 58 - static void *pci_config_base; 59 - 60 - #define pci_cfg_addr(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off)) 61 - 62 - /* PCI ops */ 63 - static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn, 64 - int where) 65 - { 66 - u32 data; 67 - u32 *cfgaddr; 68 - 69 - where &= ~3; 70 - if (cpu_is_xlp9xx()) { 71 - /* be very careful on SoC buses */ 72 - if (bus->number == 0) { 73 - /* Scan only existing nodes - uboot bug? */ 74 - if (PCI_SLOT(devfn) != 0 || 75 - !nlm_node_present(PCI_FUNC(devfn))) 76 - return 0xffffffff; 77 - } else if (bus->parent->number == 0) { /* SoC bus */ 78 - if (PCI_SLOT(devfn) == 0) /* b.0.0 hangs */ 79 - return 0xffffffff; 80 - if (devfn == 44) /* b.5.4 hangs */ 81 - return 0xffffffff; 82 - } 83 - } else if (bus->number == 0 && PCI_SLOT(devfn) == 1 && where == 0x954) { 84 - return 0xffffffff; 85 - } 86 - cfgaddr = (u32 *)(pci_config_base + 87 - pci_cfg_addr(bus->number, devfn, where)); 88 - data = *cfgaddr; 89 - return data; 90 - } 91 - 92 - static inline void pci_cfg_write_32bit(struct pci_bus *bus, unsigned int devfn, 93 - int where, u32 data) 94 - { 95 - u32 *cfgaddr; 96 - 97 - cfgaddr = (u32 *)(pci_config_base + 98 - pci_cfg_addr(bus->number, devfn, where & ~3)); 99 - *cfgaddr = data; 100 - } 101 - 102 - static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn, 103 - int where, int size, u32 *val) 104 - { 105 - u32 data; 106 - 107 - if ((size == 2) && (where & 1)) 108 - return PCIBIOS_BAD_REGISTER_NUMBER; 109 - else if ((size == 4) && (where & 3)) 110 - return PCIBIOS_BAD_REGISTER_NUMBER; 111 - 112 - data = pci_cfg_read_32bit(bus, devfn, where); 113 - 114 - if (size == 1) 115 - *val = (data >> ((where & 3) << 3)) & 0xff; 116 - else if (size == 2) 117 - *val = (data >> ((where & 3) << 3)) & 0xffff; 118 - else 119 - *val = data; 120 - 121 - return PCIBIOS_SUCCESSFUL; 122 - } 123 - 124 - 125 - static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn, 126 - int where, int size, u32 val) 127 - { 128 - u32 data; 129 - 130 - if ((size == 2) && (where & 1)) 131 - return PCIBIOS_BAD_REGISTER_NUMBER; 132 - else if ((size == 4) && (where & 3)) 133 - return PCIBIOS_BAD_REGISTER_NUMBER; 134 - 135 - data = pci_cfg_read_32bit(bus, devfn, where); 136 - 137 - if (size == 1) 138 - data = (data & ~(0xff << ((where & 3) << 3))) | 139 - (val << ((where & 3) << 3)); 140 - else if (size == 2) 141 - data = (data & ~(0xffff << ((where & 3) << 3))) | 142 - (val << ((where & 3) << 3)); 143 - else 144 - data = val; 145 - 146 - pci_cfg_write_32bit(bus, devfn, where, data); 147 - 148 - return PCIBIOS_SUCCESSFUL; 149 - } 150 - 151 - struct pci_ops nlm_pci_ops = { 152 - .read = nlm_pcibios_read, 153 - .write = nlm_pcibios_write 154 - }; 155 - 156 - static struct resource nlm_pci_mem_resource = { 157 - .name = "XLP PCI MEM", 158 - .start = 0xd0000000UL, /* 256MB PCI mem @ 0xd000_0000 */ 159 - .end = 0xdfffffffUL, 160 - .flags = IORESOURCE_MEM, 161 - }; 162 - 163 - static struct resource nlm_pci_io_resource = { 164 - .name = "XLP IO MEM", 165 - .start = 0x14000000UL, /* 64MB PCI IO @ 0x1000_0000 */ 166 - .end = 0x17ffffffUL, 167 - .flags = IORESOURCE_IO, 168 - }; 169 - 170 - struct pci_controller nlm_pci_controller = { 171 - .index = 0, 172 - .pci_ops = &nlm_pci_ops, 173 - .mem_resource = &nlm_pci_mem_resource, 174 - .mem_offset = 0x00000000UL, 175 - .io_resource = &nlm_pci_io_resource, 176 - .io_offset = 0x00000000UL, 177 - }; 178 - 179 - struct pci_dev *xlp_get_pcie_link(const struct pci_dev *dev) 180 - { 181 - struct pci_bus *bus, *p; 182 - 183 - bus = dev->bus; 184 - 185 - if (cpu_is_xlp9xx()) { 186 - /* find bus with grand parent number == 0 */ 187 - for (p = bus->parent; p && p->parent && p->parent->number != 0; 188 - p = p->parent) 189 - bus = p; 190 - return (p && p->parent) ? bus->self : NULL; 191 - } else { 192 - /* Find the bridge on bus 0 */ 193 - for (p = bus->parent; p && p->number != 0; p = p->parent) 194 - bus = p; 195 - 196 - return p ? bus->self : NULL; 197 - } 198 - } 199 - 200 - int xlp_socdev_to_node(const struct pci_dev *lnkdev) 201 - { 202 - if (cpu_is_xlp9xx()) 203 - return PCI_FUNC(lnkdev->bus->self->devfn); 204 - else 205 - return PCI_SLOT(lnkdev->devfn) / 8; 206 - } 207 - 208 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 209 - { 210 - struct pci_dev *lnkdev; 211 - int lnkfunc, node; 212 - 213 - /* 214 - * For XLP PCIe, there is an IRQ per Link, find out which 215 - * link the device is on to assign interrupts 216 - */ 217 - lnkdev = xlp_get_pcie_link(dev); 218 - if (lnkdev == NULL) 219 - return 0; 220 - 221 - lnkfunc = PCI_FUNC(lnkdev->devfn); 222 - node = xlp_socdev_to_node(lnkdev); 223 - 224 - return nlm_irq_to_xirq(node, PIC_PCIE_LINK_LEGACY_IRQ(lnkfunc)); 225 - } 226 - 227 - /* Do platform specific device initialization at pci_enable_device() time */ 228 - int pcibios_plat_dev_init(struct pci_dev *dev) 229 - { 230 - return 0; 231 - } 232 - 233 - /* 234 - * If big-endian, enable hardware byteswap on the PCIe bridges. 235 - * This will make both the SoC and PCIe devices behave consistently with 236 - * readl/writel. 237 - */ 238 - #ifdef __BIG_ENDIAN 239 - static void xlp_config_pci_bswap(int node, int link) 240 - { 241 - uint64_t nbubase, lnkbase; 242 - u32 reg; 243 - 244 - nbubase = nlm_get_bridge_regbase(node); 245 - lnkbase = nlm_get_pcie_base(node, link); 246 - 247 - /* 248 - * Enable byte swap in hardware. Program each link's PCIe SWAP regions 249 - * from the link's address ranges. 250 - */ 251 - if (cpu_is_xlp9xx()) { 252 - reg = nlm_read_bridge_reg(nbubase, 253 - BRIDGE_9XX_PCIEMEM_BASE0 + link); 254 - nlm_write_pci_reg(lnkbase, PCIE_9XX_BYTE_SWAP_MEM_BASE, reg); 255 - 256 - reg = nlm_read_bridge_reg(nbubase, 257 - BRIDGE_9XX_PCIEMEM_LIMIT0 + link); 258 - nlm_write_pci_reg(lnkbase, 259 - PCIE_9XX_BYTE_SWAP_MEM_LIM, reg | 0xfff); 260 - 261 - reg = nlm_read_bridge_reg(nbubase, 262 - BRIDGE_9XX_PCIEIO_BASE0 + link); 263 - nlm_write_pci_reg(lnkbase, PCIE_9XX_BYTE_SWAP_IO_BASE, reg); 264 - 265 - reg = nlm_read_bridge_reg(nbubase, 266 - BRIDGE_9XX_PCIEIO_LIMIT0 + link); 267 - nlm_write_pci_reg(lnkbase, 268 - PCIE_9XX_BYTE_SWAP_IO_LIM, reg | 0xfff); 269 - } else { 270 - reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEMEM_BASE0 + link); 271 - nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_MEM_BASE, reg); 272 - 273 - reg = nlm_read_bridge_reg(nbubase, 274 - BRIDGE_PCIEMEM_LIMIT0 + link); 275 - nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_MEM_LIM, reg | 0xfff); 276 - 277 - reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEIO_BASE0 + link); 278 - nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_IO_BASE, reg); 279 - 280 - reg = nlm_read_bridge_reg(nbubase, BRIDGE_PCIEIO_LIMIT0 + link); 281 - nlm_write_pci_reg(lnkbase, PCIE_BYTE_SWAP_IO_LIM, reg | 0xfff); 282 - } 283 - } 284 - #else 285 - /* Swap configuration not needed in little-endian mode */ 286 - static inline void xlp_config_pci_bswap(int node, int link) {} 287 - #endif /* __BIG_ENDIAN */ 288 - 289 - static int __init pcibios_init(void) 290 - { 291 - uint64_t pciebase; 292 - int link, n; 293 - u32 reg; 294 - 295 - /* Firmware assigns PCI resources */ 296 - pci_set_flags(PCI_PROBE_ONLY); 297 - pci_config_base = ioremap(XLP_DEFAULT_PCI_ECFG_BASE, 64 << 20); 298 - 299 - /* Extend IO port for memory mapped io */ 300 - ioport_resource.start = 0; 301 - ioport_resource.end = ~0; 302 - 303 - for (n = 0; n < NLM_NR_NODES; n++) { 304 - if (!nlm_node_present(n)) 305 - continue; 306 - 307 - for (link = 0; link < PCIE_NLINKS; link++) { 308 - pciebase = nlm_get_pcie_base(n, link); 309 - if (nlm_read_pci_reg(pciebase, 0) == 0xffffffff) 310 - continue; 311 - xlp_config_pci_bswap(n, link); 312 - xlp_init_node_msi_irqs(n, link); 313 - 314 - /* put in intpin and irq - u-boot does not */ 315 - reg = nlm_read_pci_reg(pciebase, 0xf); 316 - reg &= ~0x1ffu; 317 - reg |= (1 << 8) | PIC_PCIE_LINK_LEGACY_IRQ(link); 318 - nlm_write_pci_reg(pciebase, 0xf, reg); 319 - pr_info("XLP PCIe: Link %d-%d initialized.\n", n, link); 320 - } 321 - } 322 - 323 - set_io_port_base(CKSEG1); 324 - nlm_pci_controller.io_map_base = CKSEG1; 325 - 326 - register_pci_controller(&nlm_pci_controller); 327 - pr_info("XLP PCIe Controller %pR%pR.\n", &nlm_pci_io_resource, 328 - &nlm_pci_mem_resource); 329 - 330 - return 0; 331 - } 332 - arch_initcall(pcibios_init);
-368
arch/mips/pci/pci-xlr.c
··· 1 - /* 2 - * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights 3 - * reserved. 4 - * 5 - * This software is available to you under a choice of one of two 6 - * licenses. You may choose to be licensed under the terms of the GNU 7 - * General Public License (GPL) Version 2, available from the file 8 - * COPYING in the main directory of this source tree, or the NetLogic 9 - * license below: 10 - * 11 - * Redistribution and use in source and binary forms, with or without 12 - * modification, are permitted provided that the following conditions 13 - * are met: 14 - * 15 - * 1. Redistributions of source code must retain the above copyright 16 - * notice, this list of conditions and the following disclaimer. 17 - * 2. Redistributions in binary form must reproduce the above copyright 18 - * notice, this list of conditions and the following disclaimer in 19 - * the documentation and/or other materials provided with the 20 - * distribution. 21 - * 22 - * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR 23 - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 - * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE 26 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 29 - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 31 - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 32 - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - #include <linux/types.h> 36 - #include <linux/pci.h> 37 - #include <linux/kernel.h> 38 - #include <linux/init.h> 39 - #include <linux/msi.h> 40 - #include <linux/mm.h> 41 - #include <linux/irq.h> 42 - #include <linux/irqdesc.h> 43 - #include <linux/console.h> 44 - #include <linux/pci_regs.h> 45 - 46 - #include <asm/io.h> 47 - 48 - #include <asm/netlogic/interrupt.h> 49 - #include <asm/netlogic/haldefs.h> 50 - #include <asm/netlogic/common.h> 51 - 52 - #include <asm/netlogic/xlr/msidef.h> 53 - #include <asm/netlogic/xlr/iomap.h> 54 - #include <asm/netlogic/xlr/pic.h> 55 - #include <asm/netlogic/xlr/xlr.h> 56 - 57 - static void *pci_config_base; 58 - 59 - #define pci_cfg_addr(bus, devfn, off) (((bus) << 16) | ((devfn) << 8) | (off)) 60 - 61 - /* PCI ops */ 62 - static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn, 63 - int where) 64 - { 65 - u32 data; 66 - u32 *cfgaddr; 67 - 68 - cfgaddr = (u32 *)(pci_config_base + 69 - pci_cfg_addr(bus->number, devfn, where & ~3)); 70 - data = *cfgaddr; 71 - return cpu_to_le32(data); 72 - } 73 - 74 - static inline void pci_cfg_write_32bit(struct pci_bus *bus, unsigned int devfn, 75 - int where, u32 data) 76 - { 77 - u32 *cfgaddr; 78 - 79 - cfgaddr = (u32 *)(pci_config_base + 80 - pci_cfg_addr(bus->number, devfn, where & ~3)); 81 - *cfgaddr = cpu_to_le32(data); 82 - } 83 - 84 - static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn, 85 - int where, int size, u32 *val) 86 - { 87 - u32 data; 88 - 89 - if ((size == 2) && (where & 1)) 90 - return PCIBIOS_BAD_REGISTER_NUMBER; 91 - else if ((size == 4) && (where & 3)) 92 - return PCIBIOS_BAD_REGISTER_NUMBER; 93 - 94 - data = pci_cfg_read_32bit(bus, devfn, where); 95 - 96 - if (size == 1) 97 - *val = (data >> ((where & 3) << 3)) & 0xff; 98 - else if (size == 2) 99 - *val = (data >> ((where & 3) << 3)) & 0xffff; 100 - else 101 - *val = data; 102 - 103 - return PCIBIOS_SUCCESSFUL; 104 - } 105 - 106 - 107 - static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn, 108 - int where, int size, u32 val) 109 - { 110 - u32 data; 111 - 112 - if ((size == 2) && (where & 1)) 113 - return PCIBIOS_BAD_REGISTER_NUMBER; 114 - else if ((size == 4) && (where & 3)) 115 - return PCIBIOS_BAD_REGISTER_NUMBER; 116 - 117 - data = pci_cfg_read_32bit(bus, devfn, where); 118 - 119 - if (size == 1) 120 - data = (data & ~(0xff << ((where & 3) << 3))) | 121 - (val << ((where & 3) << 3)); 122 - else if (size == 2) 123 - data = (data & ~(0xffff << ((where & 3) << 3))) | 124 - (val << ((where & 3) << 3)); 125 - else 126 - data = val; 127 - 128 - pci_cfg_write_32bit(bus, devfn, where, data); 129 - 130 - return PCIBIOS_SUCCESSFUL; 131 - } 132 - 133 - struct pci_ops nlm_pci_ops = { 134 - .read = nlm_pcibios_read, 135 - .write = nlm_pcibios_write 136 - }; 137 - 138 - static struct resource nlm_pci_mem_resource = { 139 - .name = "XLR PCI MEM", 140 - .start = 0xd0000000UL, /* 256MB PCI mem @ 0xd000_0000 */ 141 - .end = 0xdfffffffUL, 142 - .flags = IORESOURCE_MEM, 143 - }; 144 - 145 - static struct resource nlm_pci_io_resource = { 146 - .name = "XLR IO MEM", 147 - .start = 0x10000000UL, /* 16MB PCI IO @ 0x1000_0000 */ 148 - .end = 0x100fffffUL, 149 - .flags = IORESOURCE_IO, 150 - }; 151 - 152 - struct pci_controller nlm_pci_controller = { 153 - .index = 0, 154 - .pci_ops = &nlm_pci_ops, 155 - .mem_resource = &nlm_pci_mem_resource, 156 - .mem_offset = 0x00000000UL, 157 - .io_resource = &nlm_pci_io_resource, 158 - .io_offset = 0x00000000UL, 159 - }; 160 - 161 - /* 162 - * The top level PCIe links on the XLS PCIe controller appear as 163 - * bridges. Given a device, this function finds which link it is 164 - * on. 165 - */ 166 - static struct pci_dev *xls_get_pcie_link(const struct pci_dev *dev) 167 - { 168 - struct pci_bus *bus, *p; 169 - 170 - /* Find the bridge on bus 0 */ 171 - bus = dev->bus; 172 - for (p = bus->parent; p && p->number != 0; p = p->parent) 173 - bus = p; 174 - 175 - return p ? bus->self : NULL; 176 - } 177 - 178 - static int nlm_pci_link_to_irq(int link) 179 - { 180 - switch (link) { 181 - case 0: 182 - return PIC_PCIE_LINK0_IRQ; 183 - case 1: 184 - return PIC_PCIE_LINK1_IRQ; 185 - case 2: 186 - if (nlm_chip_is_xls_b()) 187 - return PIC_PCIE_XLSB0_LINK2_IRQ; 188 - else 189 - return PIC_PCIE_LINK2_IRQ; 190 - case 3: 191 - if (nlm_chip_is_xls_b()) 192 - return PIC_PCIE_XLSB0_LINK3_IRQ; 193 - else 194 - return PIC_PCIE_LINK3_IRQ; 195 - } 196 - WARN(1, "Unexpected link %d\n", link); 197 - return 0; 198 - } 199 - 200 - static int get_irq_vector(const struct pci_dev *dev) 201 - { 202 - struct pci_dev *lnk; 203 - int link; 204 - 205 - if (!nlm_chip_is_xls()) 206 - return PIC_PCIX_IRQ; /* for XLR just one IRQ */ 207 - 208 - lnk = xls_get_pcie_link(dev); 209 - if (lnk == NULL) 210 - return 0; 211 - 212 - link = PCI_SLOT(lnk->devfn); 213 - return nlm_pci_link_to_irq(link); 214 - } 215 - 216 - #ifdef CONFIG_PCI_MSI 217 - void arch_teardown_msi_irq(unsigned int irq) 218 - { 219 - } 220 - 221 - int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) 222 - { 223 - struct msi_msg msg; 224 - struct pci_dev *lnk; 225 - int irq, ret; 226 - u16 val; 227 - 228 - /* MSI not supported on XLR */ 229 - if (!nlm_chip_is_xls()) 230 - return 1; 231 - 232 - /* 233 - * Enable MSI on the XLS PCIe controller bridge which was disabled 234 - * at enumeration, the bridge MSI capability is at 0x50 235 - */ 236 - lnk = xls_get_pcie_link(dev); 237 - if (lnk == NULL) 238 - return 1; 239 - 240 - pci_read_config_word(lnk, 0x50 + PCI_MSI_FLAGS, &val); 241 - if ((val & PCI_MSI_FLAGS_ENABLE) == 0) { 242 - val |= PCI_MSI_FLAGS_ENABLE; 243 - pci_write_config_word(lnk, 0x50 + PCI_MSI_FLAGS, val); 244 - } 245 - 246 - irq = get_irq_vector(dev); 247 - if (irq <= 0) 248 - return 1; 249 - 250 - msg.address_hi = MSI_ADDR_BASE_HI; 251 - msg.address_lo = MSI_ADDR_BASE_LO | 252 - MSI_ADDR_DEST_MODE_PHYSICAL | 253 - MSI_ADDR_REDIRECTION_CPU; 254 - 255 - msg.data = MSI_DATA_TRIGGER_EDGE | 256 - MSI_DATA_LEVEL_ASSERT | 257 - MSI_DATA_DELIVERY_FIXED; 258 - 259 - ret = irq_set_msi_desc(irq, desc); 260 - if (ret < 0) 261 - return ret; 262 - 263 - pci_write_msi_msg(irq, &msg); 264 - return 0; 265 - } 266 - #endif 267 - 268 - /* Extra ACK needed for XLR on chip PCI controller */ 269 - static void xlr_pci_ack(struct irq_data *d) 270 - { 271 - uint64_t pcibase = nlm_mmio_base(NETLOGIC_IO_PCIX_OFFSET); 272 - 273 - nlm_read_reg(pcibase, (0x140 >> 2)); 274 - } 275 - 276 - /* Extra ACK needed for XLS on chip PCIe controller */ 277 - static void xls_pcie_ack(struct irq_data *d) 278 - { 279 - uint64_t pciebase_le = nlm_mmio_base(NETLOGIC_IO_PCIE_1_OFFSET); 280 - 281 - switch (d->irq) { 282 - case PIC_PCIE_LINK0_IRQ: 283 - nlm_write_reg(pciebase_le, (0x90 >> 2), 0xffffffff); 284 - break; 285 - case PIC_PCIE_LINK1_IRQ: 286 - nlm_write_reg(pciebase_le, (0x94 >> 2), 0xffffffff); 287 - break; 288 - case PIC_PCIE_LINK2_IRQ: 289 - nlm_write_reg(pciebase_le, (0x190 >> 2), 0xffffffff); 290 - break; 291 - case PIC_PCIE_LINK3_IRQ: 292 - nlm_write_reg(pciebase_le, (0x194 >> 2), 0xffffffff); 293 - break; 294 - } 295 - } 296 - 297 - /* For XLS B silicon, the 3,4 PCI interrupts are different */ 298 - static void xls_pcie_ack_b(struct irq_data *d) 299 - { 300 - uint64_t pciebase_le = nlm_mmio_base(NETLOGIC_IO_PCIE_1_OFFSET); 301 - 302 - switch (d->irq) { 303 - case PIC_PCIE_LINK0_IRQ: 304 - nlm_write_reg(pciebase_le, (0x90 >> 2), 0xffffffff); 305 - break; 306 - case PIC_PCIE_LINK1_IRQ: 307 - nlm_write_reg(pciebase_le, (0x94 >> 2), 0xffffffff); 308 - break; 309 - case PIC_PCIE_XLSB0_LINK2_IRQ: 310 - nlm_write_reg(pciebase_le, (0x190 >> 2), 0xffffffff); 311 - break; 312 - case PIC_PCIE_XLSB0_LINK3_IRQ: 313 - nlm_write_reg(pciebase_le, (0x194 >> 2), 0xffffffff); 314 - break; 315 - } 316 - } 317 - 318 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 319 - { 320 - return get_irq_vector(dev); 321 - } 322 - 323 - /* Do platform specific device initialization at pci_enable_device() time */ 324 - int pcibios_plat_dev_init(struct pci_dev *dev) 325 - { 326 - return 0; 327 - } 328 - 329 - static int __init pcibios_init(void) 330 - { 331 - void (*extra_ack)(struct irq_data *); 332 - int link, irq; 333 - 334 - /* PSB assigns PCI resources */ 335 - pci_set_flags(PCI_PROBE_ONLY); 336 - pci_config_base = ioremap(DEFAULT_PCI_CONFIG_BASE, 16 << 20); 337 - 338 - /* Extend IO port for memory mapped io */ 339 - ioport_resource.start = 0; 340 - ioport_resource.end = ~0; 341 - 342 - set_io_port_base(CKSEG1); 343 - nlm_pci_controller.io_map_base = CKSEG1; 344 - 345 - pr_info("Registering XLR/XLS PCIX/PCIE Controller.\n"); 346 - register_pci_controller(&nlm_pci_controller); 347 - 348 - /* 349 - * For PCI interrupts, we need to ack the PCI controller too, overload 350 - * irq handler data to do this 351 - */ 352 - if (!nlm_chip_is_xls()) { 353 - /* XLR PCI controller ACK */ 354 - nlm_set_pic_extra_ack(0, PIC_PCIX_IRQ, xlr_pci_ack); 355 - } else { 356 - if (nlm_chip_is_xls_b()) 357 - extra_ack = xls_pcie_ack_b; 358 - else 359 - extra_ack = xls_pcie_ack; 360 - for (link = 0; link < 4; link++) { 361 - irq = nlm_pci_link_to_irq(link); 362 - nlm_set_pic_extra_ack(0, irq, extra_ack); 363 - } 364 - } 365 - return 0; 366 - } 367 - 368 - arch_initcall(pcibios_init);