diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-07 02:19:51 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-07 02:19:51 -0400 |
commit | a1922ed661ab2c1637d0b10cde933bd9cd33d965 (patch) | |
tree | 0f1777542b385ebefd30b3586d830fd8ed6fda5b /arch/mips | |
parent | 75e33751ca8bbb72dd6f1a74d2810ddc8cbe4bdf (diff) | |
parent | d28daf923ac5e4a0d7cecebae56f3e339189366b (diff) |
Merge branch 'tracing/core' into tracing/hw-breakpoints
Conflicts:
arch/Kconfig
kernel/trace/trace.h
Merge reason: resolve the conflicts, plus adopt to the new
ring-buffer APIs.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/mips')
266 files changed, 18693 insertions, 1093 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 25f3b0a11ca8..3ca0fe1a9123 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -22,6 +22,26 @@ choice | |||
22 | config MACH_ALCHEMY | 22 | config MACH_ALCHEMY |
23 | bool "Alchemy processor based machines" | 23 | bool "Alchemy processor based machines" |
24 | 24 | ||
25 | config AR7 | ||
26 | bool "Texas Instruments AR7" | ||
27 | select BOOT_ELF32 | ||
28 | select DMA_NONCOHERENT | ||
29 | select CEVT_R4K | ||
30 | select CSRC_R4K | ||
31 | select IRQ_CPU | ||
32 | select NO_EXCEPT_FILL | ||
33 | select SWAP_IO_SPACE | ||
34 | select SYS_HAS_CPU_MIPS32_R1 | ||
35 | select SYS_HAS_EARLY_PRINTK | ||
36 | select SYS_SUPPORTS_32BIT_KERNEL | ||
37 | select SYS_SUPPORTS_LITTLE_ENDIAN | ||
38 | select GENERIC_GPIO | ||
39 | select GCD | ||
40 | select VLYNQ | ||
41 | help | ||
42 | Support for the Texas Instruments AR7 System-on-a-Chip | ||
43 | family: TNETD7100, 7200 and 7300. | ||
44 | |||
25 | config BASLER_EXCITE | 45 | config BASLER_EXCITE |
26 | bool "Basler eXcite smart camera" | 46 | bool "Basler eXcite smart camera" |
27 | select CEVT_R4K | 47 | select CEVT_R4K |
@@ -209,7 +229,7 @@ config MIPS_MALTA | |||
209 | select SYS_SUPPORTS_64BIT_KERNEL | 229 | select SYS_SUPPORTS_64BIT_KERNEL |
210 | select SYS_SUPPORTS_BIG_ENDIAN | 230 | select SYS_SUPPORTS_BIG_ENDIAN |
211 | select SYS_SUPPORTS_LITTLE_ENDIAN | 231 | select SYS_SUPPORTS_LITTLE_ENDIAN |
212 | select SYS_SUPPORTS_MIPS_CMP if BROKEN # because SYNC_R4K is broken | 232 | select SYS_SUPPORTS_MIPS_CMP |
213 | select SYS_SUPPORTS_MULTITHREADING | 233 | select SYS_SUPPORTS_MULTITHREADING |
214 | select SYS_SUPPORTS_SMARTMIPS | 234 | select SYS_SUPPORTS_SMARTMIPS |
215 | help | 235 | help |
@@ -247,6 +267,7 @@ config MACH_VR41XX | |||
247 | select CEVT_R4K | 267 | select CEVT_R4K |
248 | select CSRC_R4K | 268 | select CSRC_R4K |
249 | select SYS_HAS_CPU_VR41XX | 269 | select SYS_HAS_CPU_VR41XX |
270 | select ARCH_REQUIRE_GPIOLIB | ||
250 | 271 | ||
251 | config NXP_STB220 | 272 | config NXP_STB220 |
252 | bool "NXP STB220 board" | 273 | bool "NXP STB220 board" |
@@ -601,6 +622,7 @@ config CAVIUM_OCTEON_SIMULATOR | |||
601 | select SYS_SUPPORTS_64BIT_KERNEL | 622 | select SYS_SUPPORTS_64BIT_KERNEL |
602 | select SYS_SUPPORTS_BIG_ENDIAN | 623 | select SYS_SUPPORTS_BIG_ENDIAN |
603 | select SYS_SUPPORTS_HIGHMEM | 624 | select SYS_SUPPORTS_HIGHMEM |
625 | select SYS_SUPPORTS_HOTPLUG_CPU | ||
604 | select SYS_HAS_CPU_CAVIUM_OCTEON | 626 | select SYS_HAS_CPU_CAVIUM_OCTEON |
605 | help | 627 | help |
606 | The Octeon simulator is software performance model of the Cavium | 628 | The Octeon simulator is software performance model of the Cavium |
@@ -615,9 +637,12 @@ config CAVIUM_OCTEON_REFERENCE_BOARD | |||
615 | select SYS_SUPPORTS_64BIT_KERNEL | 637 | select SYS_SUPPORTS_64BIT_KERNEL |
616 | select SYS_SUPPORTS_BIG_ENDIAN | 638 | select SYS_SUPPORTS_BIG_ENDIAN |
617 | select SYS_SUPPORTS_HIGHMEM | 639 | select SYS_SUPPORTS_HIGHMEM |
640 | select SYS_SUPPORTS_HOTPLUG_CPU | ||
618 | select SYS_HAS_EARLY_PRINTK | 641 | select SYS_HAS_EARLY_PRINTK |
619 | select SYS_HAS_CPU_CAVIUM_OCTEON | 642 | select SYS_HAS_CPU_CAVIUM_OCTEON |
620 | select SWAP_IO_SPACE | 643 | select SWAP_IO_SPACE |
644 | select HW_HAS_PCI | ||
645 | select ARCH_SUPPORTS_MSI | ||
621 | help | 646 | help |
622 | This option supports all of the Octeon reference boards from Cavium | 647 | This option supports all of the Octeon reference boards from Cavium |
623 | Networks. It builds a kernel that dynamically determines the Octeon | 648 | Networks. It builds a kernel that dynamically determines the Octeon |
@@ -782,8 +807,17 @@ config SYS_HAS_EARLY_PRINTK | |||
782 | bool | 807 | bool |
783 | 808 | ||
784 | config HOTPLUG_CPU | 809 | config HOTPLUG_CPU |
810 | bool "Support for hot-pluggable CPUs" | ||
811 | depends on SMP && HOTPLUG && SYS_SUPPORTS_HOTPLUG_CPU | ||
812 | help | ||
813 | Say Y here to allow turning CPUs off and on. CPUs can be | ||
814 | controlled through /sys/devices/system/cpu. | ||
815 | (Note: power management support will enable this option | ||
816 | automatically on SMP systems. ) | ||
817 | Say N if you want to disable CPU hotplug. | ||
818 | |||
819 | config SYS_SUPPORTS_HOTPLUG_CPU | ||
785 | bool | 820 | bool |
786 | default n | ||
787 | 821 | ||
788 | config I8259 | 822 | config I8259 |
789 | bool | 823 | bool |
@@ -851,6 +885,11 @@ config SYS_SUPPORTS_BIG_ENDIAN | |||
851 | config SYS_SUPPORTS_LITTLE_ENDIAN | 885 | config SYS_SUPPORTS_LITTLE_ENDIAN |
852 | bool | 886 | bool |
853 | 887 | ||
888 | config SYS_SUPPORTS_HUGETLBFS | ||
889 | bool | ||
890 | depends on CPU_SUPPORTS_HUGEPAGES && 64BIT | ||
891 | default y | ||
892 | |||
854 | config IRQ_CPU | 893 | config IRQ_CPU |
855 | bool | 894 | bool |
856 | 895 | ||
@@ -1055,6 +1094,7 @@ config CPU_MIPS64_R1 | |||
1055 | select CPU_SUPPORTS_32BIT_KERNEL | 1094 | select CPU_SUPPORTS_32BIT_KERNEL |
1056 | select CPU_SUPPORTS_64BIT_KERNEL | 1095 | select CPU_SUPPORTS_64BIT_KERNEL |
1057 | select CPU_SUPPORTS_HIGHMEM | 1096 | select CPU_SUPPORTS_HIGHMEM |
1097 | select CPU_SUPPORTS_HUGEPAGES | ||
1058 | help | 1098 | help |
1059 | Choose this option to build a kernel for release 1 or later of the | 1099 | Choose this option to build a kernel for release 1 or later of the |
1060 | MIPS64 architecture. Many modern embedded systems with a 64-bit | 1100 | MIPS64 architecture. Many modern embedded systems with a 64-bit |
@@ -1074,6 +1114,7 @@ config CPU_MIPS64_R2 | |||
1074 | select CPU_SUPPORTS_32BIT_KERNEL | 1114 | select CPU_SUPPORTS_32BIT_KERNEL |
1075 | select CPU_SUPPORTS_64BIT_KERNEL | 1115 | select CPU_SUPPORTS_64BIT_KERNEL |
1076 | select CPU_SUPPORTS_HIGHMEM | 1116 | select CPU_SUPPORTS_HIGHMEM |
1117 | select CPU_SUPPORTS_HUGEPAGES | ||
1077 | help | 1118 | help |
1078 | Choose this option to build a kernel for release 2 or later of the | 1119 | Choose this option to build a kernel for release 2 or later of the |
1079 | MIPS64 architecture. Many modern embedded systems with a 64-bit | 1120 | MIPS64 architecture. Many modern embedded systems with a 64-bit |
@@ -1160,6 +1201,7 @@ config CPU_R5500 | |||
1160 | select CPU_HAS_LLSC | 1201 | select CPU_HAS_LLSC |
1161 | select CPU_SUPPORTS_32BIT_KERNEL | 1202 | select CPU_SUPPORTS_32BIT_KERNEL |
1162 | select CPU_SUPPORTS_64BIT_KERNEL | 1203 | select CPU_SUPPORTS_64BIT_KERNEL |
1204 | select CPU_SUPPORTS_HUGEPAGES | ||
1163 | help | 1205 | help |
1164 | NEC VR5500 and VR5500A series processors implement 64-bit MIPS IV | 1206 | NEC VR5500 and VR5500A series processors implement 64-bit MIPS IV |
1165 | instruction set. | 1207 | instruction set. |
@@ -1245,6 +1287,7 @@ config CPU_CAVIUM_OCTEON | |||
1245 | select WEAK_ORDERING | 1287 | select WEAK_ORDERING |
1246 | select WEAK_REORDERING_BEYOND_LLSC | 1288 | select WEAK_REORDERING_BEYOND_LLSC |
1247 | select CPU_SUPPORTS_HIGHMEM | 1289 | select CPU_SUPPORTS_HIGHMEM |
1290 | select CPU_SUPPORTS_HUGEPAGES | ||
1248 | help | 1291 | help |
1249 | The Cavium Octeon processor is a highly integrated chip containing | 1292 | The Cavium Octeon processor is a highly integrated chip containing |
1250 | many ethernet hardware widgets for networking tasks. The processor | 1293 | many ethernet hardware widgets for networking tasks. The processor |
@@ -1364,6 +1407,8 @@ config CPU_SUPPORTS_32BIT_KERNEL | |||
1364 | bool | 1407 | bool |
1365 | config CPU_SUPPORTS_64BIT_KERNEL | 1408 | config CPU_SUPPORTS_64BIT_KERNEL |
1366 | bool | 1409 | bool |
1410 | config CPU_SUPPORTS_HUGEPAGES | ||
1411 | bool | ||
1367 | 1412 | ||
1368 | # | 1413 | # |
1369 | # Set to y for ptrace access to watch registers. | 1414 | # Set to y for ptrace access to watch registers. |
@@ -1611,7 +1656,7 @@ config MIPS_APSP_KSPD | |||
1611 | config MIPS_CMP | 1656 | config MIPS_CMP |
1612 | bool "MIPS CMP framework support" | 1657 | bool "MIPS CMP framework support" |
1613 | depends on SYS_SUPPORTS_MIPS_CMP | 1658 | depends on SYS_SUPPORTS_MIPS_CMP |
1614 | select SYNC_R4K if BROKEN | 1659 | select SYNC_R4K |
1615 | select SYS_SUPPORTS_SMP | 1660 | select SYS_SUPPORTS_SMP |
1616 | select SYS_SUPPORTS_SCHED_SMT if SMP | 1661 | select SYS_SUPPORTS_SCHED_SMT if SMP |
1617 | select WEAK_ORDERING | 1662 | select WEAK_ORDERING |
@@ -2121,9 +2166,13 @@ endmenu | |||
2121 | 2166 | ||
2122 | menu "Power management options" | 2167 | menu "Power management options" |
2123 | 2168 | ||
2169 | config ARCH_HIBERNATION_POSSIBLE | ||
2170 | def_bool y | ||
2171 | depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP | ||
2172 | |||
2124 | config ARCH_SUSPEND_POSSIBLE | 2173 | config ARCH_SUSPEND_POSSIBLE |
2125 | def_bool y | 2174 | def_bool y |
2126 | depends on !SMP | 2175 | depends on SYS_SUPPORTS_HOTPLUG_CPU || !SMP |
2127 | 2176 | ||
2128 | source "kernel/power/Kconfig" | 2177 | source "kernel/power/Kconfig" |
2129 | 2178 | ||
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index c4cae9e6b802..861da514a468 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -167,13 +167,19 @@ libs-$(CONFIG_ARC) += arch/mips/fw/arc/ | |||
167 | libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ | 167 | libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ |
168 | libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/ | 168 | libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/ |
169 | libs-y += arch/mips/fw/lib/ | 169 | libs-y += arch/mips/fw/lib/ |
170 | libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/ | ||
171 | 170 | ||
172 | # | 171 | # |
173 | # Board-dependent options and extra files | 172 | # Board-dependent options and extra files |
174 | # | 173 | # |
175 | 174 | ||
176 | # | 175 | # |
176 | # Texas Instruments AR7 | ||
177 | # | ||
178 | core-$(CONFIG_AR7) += arch/mips/ar7/ | ||
179 | cflags-$(CONFIG_AR7) += -I$(srctree)/arch/mips/include/asm/mach-ar7 | ||
180 | load-$(CONFIG_AR7) += 0xffffffff94100000 | ||
181 | |||
182 | # | ||
177 | # Acer PICA 61, Mips Magnum 4000 and Olivetti M700. | 183 | # Acer PICA 61, Mips Magnum 4000 and Olivetti M700. |
178 | # | 184 | # |
179 | core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ | 185 | core-$(CONFIG_MACH_JAZZ) += arch/mips/jazz/ |
@@ -184,7 +190,6 @@ load-$(CONFIG_MACH_JAZZ) += 0xffffffff80080000 | |||
184 | # Common Alchemy Au1x00 stuff | 190 | # Common Alchemy Au1x00 stuff |
185 | # | 191 | # |
186 | core-$(CONFIG_SOC_AU1X00) += arch/mips/alchemy/common/ | 192 | core-$(CONFIG_SOC_AU1X00) += arch/mips/alchemy/common/ |
187 | cflags-$(CONFIG_SOC_AU1X00) += -I$(srctree)/arch/mips/include/asm/mach-au1x00 | ||
188 | 193 | ||
189 | # | 194 | # |
190 | # AMD Alchemy Pb1000 eval board | 195 | # AMD Alchemy Pb1000 eval board |
@@ -282,6 +287,10 @@ load-$(CONFIG_MIPS_MTX1) += 0xffffffff80100000 | |||
282 | libs-$(CONFIG_MIPS_XXS1500) += arch/mips/alchemy/xxs1500/ | 287 | libs-$(CONFIG_MIPS_XXS1500) += arch/mips/alchemy/xxs1500/ |
283 | load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000 | 288 | load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000 |
284 | 289 | ||
290 | # must be last for Alchemy systems for GPIO to work properly | ||
291 | cflags-$(CONFIG_SOC_AU1X00) += -I$(srctree)/arch/mips/include/asm/mach-au1x00 | ||
292 | |||
293 | |||
285 | # | 294 | # |
286 | # Cobalt Server | 295 | # Cobalt Server |
287 | # | 296 | # |
@@ -675,6 +684,9 @@ core-y += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/ | |||
675 | 684 | ||
676 | drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/ | 685 | drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/ |
677 | 686 | ||
687 | # suspend and hibernation support | ||
688 | drivers-$(CONFIG_PM) += arch/mips/power/ | ||
689 | |||
678 | ifdef CONFIG_LASAT | 690 | ifdef CONFIG_LASAT |
679 | rom.bin rom.sw: vmlinux | 691 | rom.bin rom.sw: vmlinux |
680 | $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@ | 692 | $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@ |
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig index 8128aebfb155..00b498e97c83 100644 --- a/arch/mips/alchemy/Kconfig +++ b/arch/mips/alchemy/Kconfig | |||
@@ -1,3 +1,14 @@ | |||
1 | # au1000-style gpio | ||
2 | config ALCHEMY_GPIO_AU1000 | ||
3 | bool | ||
4 | |||
5 | # select this in your board config if you don't want to use the gpio | ||
6 | # namespace as documented in the manuals. In this case however you need | ||
7 | # to create the necessary gpio_* functions in your board code/headers! | ||
8 | # see arch/mips/include/asm/mach-au1x00/gpio.h for more information. | ||
9 | config ALCHEMY_GPIO_INDIRECT | ||
10 | def_bool n | ||
11 | |||
1 | choice | 12 | choice |
2 | prompt "Machine type" | 13 | prompt "Machine type" |
3 | depends on MACH_ALCHEMY | 14 | depends on MACH_ALCHEMY |
@@ -108,22 +119,27 @@ endchoice | |||
108 | config SOC_AU1000 | 119 | config SOC_AU1000 |
109 | bool | 120 | bool |
110 | select SOC_AU1X00 | 121 | select SOC_AU1X00 |
122 | select ALCHEMY_GPIO_AU1000 | ||
111 | 123 | ||
112 | config SOC_AU1100 | 124 | config SOC_AU1100 |
113 | bool | 125 | bool |
114 | select SOC_AU1X00 | 126 | select SOC_AU1X00 |
127 | select ALCHEMY_GPIO_AU1000 | ||
115 | 128 | ||
116 | config SOC_AU1500 | 129 | config SOC_AU1500 |
117 | bool | 130 | bool |
118 | select SOC_AU1X00 | 131 | select SOC_AU1X00 |
132 | select ALCHEMY_GPIO_AU1000 | ||
119 | 133 | ||
120 | config SOC_AU1550 | 134 | config SOC_AU1550 |
121 | bool | 135 | bool |
122 | select SOC_AU1X00 | 136 | select SOC_AU1X00 |
137 | select ALCHEMY_GPIO_AU1000 | ||
123 | 138 | ||
124 | config SOC_AU1200 | 139 | config SOC_AU1200 |
125 | bool | 140 | bool |
126 | select SOC_AU1X00 | 141 | select SOC_AU1X00 |
142 | select ALCHEMY_GPIO_AU1000 | ||
127 | 143 | ||
128 | config SOC_AU1X00 | 144 | config SOC_AU1X00 |
129 | bool | 145 | bool |
@@ -134,4 +150,5 @@ config SOC_AU1X00 | |||
134 | select SYS_HAS_CPU_MIPS32_R1 | 150 | select SYS_HAS_CPU_MIPS32_R1 |
135 | select SYS_SUPPORTS_32BIT_KERNEL | 151 | select SYS_SUPPORTS_32BIT_KERNEL |
136 | select SYS_SUPPORTS_APM_EMULATION | 152 | select SYS_SUPPORTS_APM_EMULATION |
137 | select ARCH_REQUIRE_GPIOLIB | 153 | select GENERIC_GPIO |
154 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile index d50d4764eafe..b67fb512529d 100644 --- a/arch/mips/alchemy/common/Makefile +++ b/arch/mips/alchemy/common/Makefile | |||
@@ -7,7 +7,14 @@ | |||
7 | 7 | ||
8 | obj-y += prom.o irq.o puts.o time.o reset.o \ | 8 | obj-y += prom.o irq.o puts.o time.o reset.o \ |
9 | clocks.o platform.o power.o setup.o \ | 9 | clocks.o platform.o power.o setup.o \ |
10 | sleeper.o dma.o dbdma.o gpio.o | 10 | sleeper.o dma.o dbdma.o |
11 | |||
12 | # optional gpiolib support | ||
13 | ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),) | ||
14 | ifeq ($(CONFIG_GPIOLIB),y) | ||
15 | obj-$(CONFIG_ALCHEMY_GPIO_AU1000) += gpiolib-au1000.o | ||
16 | endif | ||
17 | endif | ||
11 | 18 | ||
12 | obj-$(CONFIG_PCI) += pci.o | 19 | obj-$(CONFIG_PCI) += pci.o |
13 | 20 | ||
diff --git a/arch/mips/alchemy/common/gpio.c b/arch/mips/alchemy/common/gpio.c deleted file mode 100644 index 91a9c4436c39..000000000000 --- a/arch/mips/alchemy/common/gpio.c +++ /dev/null | |||
@@ -1,201 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2009, OpenWrt.org, Florian Fainelli <florian@openwrt.org> | ||
3 | * Architecture specific GPIO support | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
11 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
13 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
14 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
15 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
16 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
17 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
18 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
19 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License along | ||
22 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | * Notes : | ||
26 | * au1000 SoC have only one GPIO line : GPIO1 | ||
27 | * others have a second one : GPIO2 | ||
28 | */ | ||
29 | |||
30 | #include <linux/kernel.h> | ||
31 | #include <linux/module.h> | ||
32 | #include <linux/types.h> | ||
33 | #include <linux/platform_device.h> | ||
34 | #include <linux/gpio.h> | ||
35 | |||
36 | #include <asm/mach-au1x00/au1000.h> | ||
37 | #include <asm/gpio.h> | ||
38 | |||
39 | struct au1000_gpio_chip { | ||
40 | struct gpio_chip chip; | ||
41 | void __iomem *regbase; | ||
42 | }; | ||
43 | |||
44 | #if !defined(CONFIG_SOC_AU1000) | ||
45 | static int au1000_gpio2_get(struct gpio_chip *chip, unsigned offset) | ||
46 | { | ||
47 | u32 mask = 1 << offset; | ||
48 | struct au1000_gpio_chip *gpch; | ||
49 | |||
50 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
51 | return readl(gpch->regbase + AU1000_GPIO2_ST) & mask; | ||
52 | } | ||
53 | |||
54 | static void au1000_gpio2_set(struct gpio_chip *chip, | ||
55 | unsigned offset, int value) | ||
56 | { | ||
57 | u32 mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset)); | ||
58 | struct au1000_gpio_chip *gpch; | ||
59 | unsigned long flags; | ||
60 | |||
61 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
62 | |||
63 | local_irq_save(flags); | ||
64 | writel(mask, gpch->regbase + AU1000_GPIO2_OUT); | ||
65 | local_irq_restore(flags); | ||
66 | } | ||
67 | |||
68 | static int au1000_gpio2_direction_input(struct gpio_chip *chip, unsigned offset) | ||
69 | { | ||
70 | u32 mask = 1 << offset; | ||
71 | u32 tmp; | ||
72 | struct au1000_gpio_chip *gpch; | ||
73 | unsigned long flags; | ||
74 | |||
75 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
76 | |||
77 | local_irq_save(flags); | ||
78 | tmp = readl(gpch->regbase + AU1000_GPIO2_DIR); | ||
79 | tmp &= ~mask; | ||
80 | writel(tmp, gpch->regbase + AU1000_GPIO2_DIR); | ||
81 | local_irq_restore(flags); | ||
82 | |||
83 | return 0; | ||
84 | } | ||
85 | |||
86 | static int au1000_gpio2_direction_output(struct gpio_chip *chip, | ||
87 | unsigned offset, int value) | ||
88 | { | ||
89 | u32 mask = 1 << offset; | ||
90 | u32 out_mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset)); | ||
91 | u32 tmp; | ||
92 | struct au1000_gpio_chip *gpch; | ||
93 | unsigned long flags; | ||
94 | |||
95 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
96 | |||
97 | local_irq_save(flags); | ||
98 | tmp = readl(gpch->regbase + AU1000_GPIO2_DIR); | ||
99 | tmp |= mask; | ||
100 | writel(tmp, gpch->regbase + AU1000_GPIO2_DIR); | ||
101 | writel(out_mask, gpch->regbase + AU1000_GPIO2_OUT); | ||
102 | local_irq_restore(flags); | ||
103 | |||
104 | return 0; | ||
105 | } | ||
106 | #endif /* !defined(CONFIG_SOC_AU1000) */ | ||
107 | |||
108 | static int au1000_gpio1_get(struct gpio_chip *chip, unsigned offset) | ||
109 | { | ||
110 | u32 mask = 1 << offset; | ||
111 | struct au1000_gpio_chip *gpch; | ||
112 | |||
113 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
114 | return readl(gpch->regbase + AU1000_GPIO1_ST) & mask; | ||
115 | } | ||
116 | |||
117 | static void au1000_gpio1_set(struct gpio_chip *chip, | ||
118 | unsigned offset, int value) | ||
119 | { | ||
120 | u32 mask = 1 << offset; | ||
121 | u32 reg_offset; | ||
122 | struct au1000_gpio_chip *gpch; | ||
123 | unsigned long flags; | ||
124 | |||
125 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
126 | |||
127 | if (value) | ||
128 | reg_offset = AU1000_GPIO1_OUT; | ||
129 | else | ||
130 | reg_offset = AU1000_GPIO1_CLR; | ||
131 | |||
132 | local_irq_save(flags); | ||
133 | writel(mask, gpch->regbase + reg_offset); | ||
134 | local_irq_restore(flags); | ||
135 | } | ||
136 | |||
137 | static int au1000_gpio1_direction_input(struct gpio_chip *chip, unsigned offset) | ||
138 | { | ||
139 | u32 mask = 1 << offset; | ||
140 | struct au1000_gpio_chip *gpch; | ||
141 | |||
142 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
143 | writel(mask, gpch->regbase + AU1000_GPIO1_ST); | ||
144 | |||
145 | return 0; | ||
146 | } | ||
147 | |||
148 | static int au1000_gpio1_direction_output(struct gpio_chip *chip, | ||
149 | unsigned offset, int value) | ||
150 | { | ||
151 | u32 mask = 1 << offset; | ||
152 | struct au1000_gpio_chip *gpch; | ||
153 | |||
154 | gpch = container_of(chip, struct au1000_gpio_chip, chip); | ||
155 | |||
156 | writel(mask, gpch->regbase + AU1000_GPIO1_TRI_OUT); | ||
157 | au1000_gpio1_set(chip, offset, value); | ||
158 | |||
159 | return 0; | ||
160 | } | ||
161 | |||
162 | struct au1000_gpio_chip au1000_gpio_chip[] = { | ||
163 | [0] = { | ||
164 | .regbase = (void __iomem *)SYS_BASE, | ||
165 | .chip = { | ||
166 | .label = "au1000-gpio1", | ||
167 | .direction_input = au1000_gpio1_direction_input, | ||
168 | .direction_output = au1000_gpio1_direction_output, | ||
169 | .get = au1000_gpio1_get, | ||
170 | .set = au1000_gpio1_set, | ||
171 | .base = 0, | ||
172 | .ngpio = 32, | ||
173 | }, | ||
174 | }, | ||
175 | #if !defined(CONFIG_SOC_AU1000) | ||
176 | [1] = { | ||
177 | .regbase = (void __iomem *)GPIO2_BASE, | ||
178 | .chip = { | ||
179 | .label = "au1000-gpio2", | ||
180 | .direction_input = au1000_gpio2_direction_input, | ||
181 | .direction_output = au1000_gpio2_direction_output, | ||
182 | .get = au1000_gpio2_get, | ||
183 | .set = au1000_gpio2_set, | ||
184 | .base = AU1XXX_GPIO_BASE, | ||
185 | .ngpio = 32, | ||
186 | }, | ||
187 | }, | ||
188 | #endif | ||
189 | }; | ||
190 | |||
191 | static int __init au1000_gpio_init(void) | ||
192 | { | ||
193 | gpiochip_add(&au1000_gpio_chip[0].chip); | ||
194 | #if !defined(CONFIG_SOC_AU1000) | ||
195 | gpiochip_add(&au1000_gpio_chip[1].chip); | ||
196 | #endif | ||
197 | |||
198 | return 0; | ||
199 | } | ||
200 | arch_initcall(au1000_gpio_init); | ||
201 | |||
diff --git a/arch/mips/alchemy/common/gpiolib-au1000.c b/arch/mips/alchemy/common/gpiolib-au1000.c new file mode 100644 index 000000000000..1bfa91f939f4 --- /dev/null +++ b/arch/mips/alchemy/common/gpiolib-au1000.c | |||
@@ -0,0 +1,130 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2009, OpenWrt.org, Florian Fainelli <florian@openwrt.org> | ||
3 | * GPIOLIB support for Au1000, Au1500, Au1100, Au1550 and Au12x0. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
11 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
13 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
14 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
15 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
16 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
17 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
18 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
19 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License along | ||
22 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | * Notes : | ||
26 | * au1000 SoC have only one GPIO block : GPIO1 | ||
27 | * Au1100, Au15x0, Au12x0 have a second one : GPIO2 | ||
28 | */ | ||
29 | |||
30 | #include <linux/kernel.h> | ||
31 | #include <linux/module.h> | ||
32 | #include <linux/types.h> | ||
33 | #include <linux/platform_device.h> | ||
34 | #include <linux/gpio.h> | ||
35 | |||
36 | #include <asm/mach-au1x00/au1000.h> | ||
37 | #include <asm/mach-au1x00/gpio.h> | ||
38 | |||
39 | #if !defined(CONFIG_SOC_AU1000) | ||
40 | static int gpio2_get(struct gpio_chip *chip, unsigned offset) | ||
41 | { | ||
42 | return alchemy_gpio2_get_value(offset + ALCHEMY_GPIO2_BASE); | ||
43 | } | ||
44 | |||
45 | static void gpio2_set(struct gpio_chip *chip, unsigned offset, int value) | ||
46 | { | ||
47 | alchemy_gpio2_set_value(offset + ALCHEMY_GPIO2_BASE, value); | ||
48 | } | ||
49 | |||
50 | static int gpio2_direction_input(struct gpio_chip *chip, unsigned offset) | ||
51 | { | ||
52 | return alchemy_gpio2_direction_input(offset + ALCHEMY_GPIO2_BASE); | ||
53 | } | ||
54 | |||
55 | static int gpio2_direction_output(struct gpio_chip *chip, unsigned offset, | ||
56 | int value) | ||
57 | { | ||
58 | return alchemy_gpio2_direction_output(offset + ALCHEMY_GPIO2_BASE, | ||
59 | value); | ||
60 | } | ||
61 | |||
62 | static int gpio2_to_irq(struct gpio_chip *chip, unsigned offset) | ||
63 | { | ||
64 | return alchemy_gpio2_to_irq(offset + ALCHEMY_GPIO2_BASE); | ||
65 | } | ||
66 | #endif /* !defined(CONFIG_SOC_AU1000) */ | ||
67 | |||
68 | static int gpio1_get(struct gpio_chip *chip, unsigned offset) | ||
69 | { | ||
70 | return alchemy_gpio1_get_value(offset + ALCHEMY_GPIO1_BASE); | ||
71 | } | ||
72 | |||
73 | static void gpio1_set(struct gpio_chip *chip, | ||
74 | unsigned offset, int value) | ||
75 | { | ||
76 | alchemy_gpio1_set_value(offset + ALCHEMY_GPIO1_BASE, value); | ||
77 | } | ||
78 | |||
79 | static int gpio1_direction_input(struct gpio_chip *chip, unsigned offset) | ||
80 | { | ||
81 | return alchemy_gpio1_direction_input(offset + ALCHEMY_GPIO1_BASE); | ||
82 | } | ||
83 | |||
84 | static int gpio1_direction_output(struct gpio_chip *chip, | ||
85 | unsigned offset, int value) | ||
86 | { | ||
87 | return alchemy_gpio1_direction_output(offset + ALCHEMY_GPIO1_BASE, | ||
88 | value); | ||
89 | } | ||
90 | |||
91 | static int gpio1_to_irq(struct gpio_chip *chip, unsigned offset) | ||
92 | { | ||
93 | return alchemy_gpio1_to_irq(offset + ALCHEMY_GPIO1_BASE); | ||
94 | } | ||
95 | |||
96 | struct gpio_chip alchemy_gpio_chip[] = { | ||
97 | [0] = { | ||
98 | .label = "alchemy-gpio1", | ||
99 | .direction_input = gpio1_direction_input, | ||
100 | .direction_output = gpio1_direction_output, | ||
101 | .get = gpio1_get, | ||
102 | .set = gpio1_set, | ||
103 | .to_irq = gpio1_to_irq, | ||
104 | .base = ALCHEMY_GPIO1_BASE, | ||
105 | .ngpio = ALCHEMY_GPIO1_NUM, | ||
106 | }, | ||
107 | #if !defined(CONFIG_SOC_AU1000) | ||
108 | [1] = { | ||
109 | .label = "alchemy-gpio2", | ||
110 | .direction_input = gpio2_direction_input, | ||
111 | .direction_output = gpio2_direction_output, | ||
112 | .get = gpio2_get, | ||
113 | .set = gpio2_set, | ||
114 | .to_irq = gpio2_to_irq, | ||
115 | .base = ALCHEMY_GPIO2_BASE, | ||
116 | .ngpio = ALCHEMY_GPIO2_NUM, | ||
117 | }, | ||
118 | #endif | ||
119 | }; | ||
120 | |||
121 | static int __init alchemy_gpiolib_init(void) | ||
122 | { | ||
123 | gpiochip_add(&alchemy_gpio_chip[0]); | ||
124 | #if !defined(CONFIG_SOC_AU1000) | ||
125 | gpiochip_add(&alchemy_gpio_chip[1]); | ||
126 | #endif | ||
127 | |||
128 | return 0; | ||
129 | } | ||
130 | arch_initcall(alchemy_gpiolib_init); | ||
diff --git a/arch/mips/alchemy/common/reset.c b/arch/mips/alchemy/common/reset.c index 0191c936cb5e..4791011e8f92 100644 --- a/arch/mips/alchemy/common/reset.c +++ b/arch/mips/alchemy/common/reset.c | |||
@@ -27,8 +27,9 @@ | |||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 27 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <asm/cacheflush.h> | 30 | #include <linux/gpio.h> |
31 | 31 | ||
32 | #include <asm/cacheflush.h> | ||
32 | #include <asm/mach-au1x00/au1000.h> | 33 | #include <asm/mach-au1x00/au1000.h> |
33 | 34 | ||
34 | void au1000_restart(char *command) | 35 | void au1000_restart(char *command) |
@@ -161,7 +162,7 @@ void au1000_halt(void) | |||
161 | #else | 162 | #else |
162 | printk(KERN_NOTICE "\n** You can safely turn off the power\n"); | 163 | printk(KERN_NOTICE "\n** You can safely turn off the power\n"); |
163 | #ifdef CONFIG_MIPS_MIRAGE | 164 | #ifdef CONFIG_MIPS_MIRAGE |
164 | au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT); | 165 | gpio_direction_output(210, 1); |
165 | #endif | 166 | #endif |
166 | #ifdef CONFIG_MIPS_DB1200 | 167 | #ifdef CONFIG_MIPS_DB1200 |
167 | au_writew(au_readw(0xB980001C) | (1 << 14), 0xB980001C); | 168 | au_writew(au_readw(0xB980001C) | (1 << 14), 0xB980001C); |
diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c index a75ffbf99f25..de30d8ea7176 100644 --- a/arch/mips/alchemy/devboards/db1x00/board_setup.c +++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 27 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/gpio.h> | ||
30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
31 | 32 | ||
32 | #include <asm/mach-au1x00/au1000.h> | 33 | #include <asm/mach-au1x00/au1000.h> |
@@ -94,12 +95,12 @@ void __init board_setup(void) | |||
94 | #endif | 95 | #endif |
95 | bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */ | 96 | bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */ |
96 | 97 | ||
97 | #ifdef CONFIG_MIPS_MIRAGE | ||
98 | /* Enable GPIO[31:0] inputs */ | 98 | /* Enable GPIO[31:0] inputs */ |
99 | au_writel(0, SYS_PININPUTEN); | 99 | alchemy_gpio1_input_enable(); |
100 | 100 | ||
101 | /* GPIO[20] is output, tristate the other input primary GPIOs */ | 101 | #ifdef CONFIG_MIPS_MIRAGE |
102 | au_writel(~(1 << 20), SYS_TRIOUTCLR); | 102 | /* GPIO[20] is output */ |
103 | alchemy_gpio_direction_output(20, 0); | ||
103 | 104 | ||
104 | /* Set GPIO[210:208] instead of SSI_0 */ | 105 | /* Set GPIO[210:208] instead of SSI_0 */ |
105 | pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0; | 106 | pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0; |
@@ -118,8 +119,7 @@ void __init board_setup(void) | |||
118 | * Enable speaker amplifier. This should | 119 | * Enable speaker amplifier. This should |
119 | * be part of the audio driver. | 120 | * be part of the audio driver. |
120 | */ | 121 | */ |
121 | au_writel(au_readl(GPIO2_DIR) | 0x200, GPIO2_DIR); | 122 | alchemy_gpio_direction_output(209, 1); |
122 | au_writel(0x02000200, GPIO2_OUTPUT); | ||
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | au_sync(); | 125 | au_sync(); |
diff --git a/arch/mips/alchemy/devboards/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c index aed2fdecc709..cd273545e810 100644 --- a/arch/mips/alchemy/devboards/pb1000/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c | |||
@@ -24,6 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/gpio.h> | ||
27 | #include <linux/init.h> | 28 | #include <linux/init.h> |
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
29 | #include <asm/mach-au1x00/au1000.h> | 30 | #include <asm/mach-au1x00/au1000.h> |
@@ -130,8 +131,11 @@ void __init board_setup(void) | |||
130 | pin_func |= SYS_PF_USB; | 131 | pin_func |= SYS_PF_USB; |
131 | 132 | ||
132 | au_writel(pin_func, SYS_PINFUNC); | 133 | au_writel(pin_func, SYS_PINFUNC); |
133 | au_writel(0x2800, SYS_TRIOUTCLR); | 134 | |
134 | au_writel(0x0030, SYS_OUTPUTCLR); | 135 | alchemy_gpio_direction_input(11); |
136 | alchemy_gpio_direction_input(13); | ||
137 | alchemy_gpio_direction_output(4, 0); | ||
138 | alchemy_gpio_direction_output(5, 0); | ||
135 | #endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ | 139 | #endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ |
136 | 140 | ||
137 | /* Make GPIO 15 an input (for interrupt line) */ | 141 | /* Make GPIO 15 an input (for interrupt line) */ |
@@ -140,7 +144,7 @@ void __init board_setup(void) | |||
140 | pin_func |= SYS_PF_I2S; | 144 | pin_func |= SYS_PF_I2S; |
141 | au_writel(pin_func, SYS_PINFUNC); | 145 | au_writel(pin_func, SYS_PINFUNC); |
142 | 146 | ||
143 | au_writel(0x8000, SYS_TRIOUTCLR); | 147 | alchemy_gpio_direction_input(15); |
144 | 148 | ||
145 | static_cfg0 = au_readl(MEM_STCFG0) & ~0xc00; | 149 | static_cfg0 = au_readl(MEM_STCFG0) & ~0xc00; |
146 | au_writel(static_cfg0, MEM_STCFG0); | 150 | au_writel(static_cfg0, MEM_STCFG0); |
diff --git a/arch/mips/alchemy/devboards/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c index 4df57fae15d4..61263081ef58 100644 --- a/arch/mips/alchemy/devboards/pb1100/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/gpio.h> | ||
26 | #include <linux/init.h> | 27 | #include <linux/init.h> |
27 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
@@ -88,7 +89,7 @@ void __init board_setup(void) | |||
88 | 89 | ||
89 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ | 90 | /* Set AUX clock to 12 MHz * 8 = 96 MHz */ |
90 | au_writel(8, SYS_AUXPLL); | 91 | au_writel(8, SYS_AUXPLL); |
91 | au_writel(0, SYS_PININPUTEN); | 92 | alchemy_gpio1_input_enable(); |
92 | udelay(100); | 93 | udelay(100); |
93 | 94 | ||
94 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 95 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
diff --git a/arch/mips/alchemy/devboards/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c index fed3b093156a..d7a56569e7ed 100644 --- a/arch/mips/alchemy/devboards/pb1500/board_setup.c +++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c | |||
@@ -23,8 +23,9 @@ | |||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/init.h> | ||
27 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/gpio.h> | ||
28 | #include <linux/init.h> | ||
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
29 | 30 | ||
30 | #include <asm/mach-au1x00/au1000.h> | 31 | #include <asm/mach-au1x00/au1000.h> |
@@ -90,11 +91,12 @@ void __init board_setup(void) | |||
90 | au_writel(0, SYS_PINSTATERD); | 91 | au_writel(0, SYS_PINSTATERD); |
91 | udelay(100); | 92 | udelay(100); |
92 | 93 | ||
93 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
94 | |||
95 | /* GPIO201 is input for PCMCIA card detect */ | 94 | /* GPIO201 is input for PCMCIA card detect */ |
96 | /* GPIO203 is input for PCMCIA interrupt request */ | 95 | /* GPIO203 is input for PCMCIA interrupt request */ |
97 | au_writel(au_readl(GPIO2_DIR) & ~((1 << 1) | (1 << 3)), GPIO2_DIR); | 96 | alchemy_gpio_direction_input(201); |
97 | alchemy_gpio_direction_input(203); | ||
98 | |||
99 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
98 | 100 | ||
99 | /* Zero and disable FREQ2 */ | 101 | /* Zero and disable FREQ2 */ |
100 | sys_freqctrl = au_readl(SYS_FREQCTRL0); | 102 | sys_freqctrl = au_readl(SYS_FREQCTRL0); |
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c index d5eb9c325ed0..632f9862a0fb 100644 --- a/arch/mips/alchemy/devboards/pm.c +++ b/arch/mips/alchemy/devboards/pm.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/suspend.h> | 9 | #include <linux/suspend.h> |
10 | #include <linux/sysfs.h> | 10 | #include <linux/sysfs.h> |
11 | #include <asm/mach-au1x00/au1000.h> | 11 | #include <asm/mach-au1x00/au1000.h> |
12 | #include <asm/mach-au1x00/gpio.h> | ||
12 | 13 | ||
13 | /* | 14 | /* |
14 | * Generic suspend userspace interface for Alchemy development boards. | 15 | * Generic suspend userspace interface for Alchemy development boards. |
@@ -26,7 +27,7 @@ static unsigned long db1x_pm_last_wakesrc; | |||
26 | static int db1x_pm_enter(suspend_state_t state) | 27 | static int db1x_pm_enter(suspend_state_t state) |
27 | { | 28 | { |
28 | /* enable GPIO based wakeup */ | 29 | /* enable GPIO based wakeup */ |
29 | au_writel(1, SYS_PININPUTEN); | 30 | alchemy_gpio1_input_enable(); |
30 | 31 | ||
31 | /* clear and setup wake cause and source */ | 32 | /* clear and setup wake cause and source */ |
32 | au_writel(0, SYS_WAKEMSK); | 33 | au_writel(0, SYS_WAKEMSK); |
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c index 8ed1ae12bc55..cc32c69a74ad 100644 --- a/arch/mips/alchemy/mtx-1/board_setup.c +++ b/arch/mips/alchemy/mtx-1/board_setup.c | |||
@@ -28,6 +28,7 @@ | |||
28 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 28 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <linux/gpio.h> | ||
31 | #include <linux/init.h> | 32 | #include <linux/init.h> |
32 | 33 | ||
33 | #include <asm/mach-au1x00/au1000.h> | 34 | #include <asm/mach-au1x00/au1000.h> |
@@ -55,10 +56,11 @@ void __init board_setup(void) | |||
55 | } | 56 | } |
56 | #endif | 57 | #endif |
57 | 58 | ||
59 | alchemy_gpio2_enable(); | ||
60 | |||
58 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 61 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
59 | /* Enable USB power switch */ | 62 | /* Enable USB power switch */ |
60 | au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); | 63 | alchemy_gpio_direction_output(204, 0); |
61 | au_writel(0x100000, GPIO2_OUTPUT); | ||
62 | #endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ | 64 | #endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ |
63 | 65 | ||
64 | #ifdef CONFIG_PCI | 66 | #ifdef CONFIG_PCI |
@@ -74,14 +76,14 @@ void __init board_setup(void) | |||
74 | 76 | ||
75 | /* Initialize GPIO */ | 77 | /* Initialize GPIO */ |
76 | au_writel(0xFFFFFFFF, SYS_TRIOUTCLR); | 78 | au_writel(0xFFFFFFFF, SYS_TRIOUTCLR); |
77 | au_writel(0x00000001, SYS_OUTPUTCLR); /* set M66EN (PCI 66MHz) to OFF */ | 79 | alchemy_gpio_direction_output(0, 0); /* Disable M66EN (PCI 66MHz) */ |
78 | au_writel(0x00000008, SYS_OUTPUTSET); /* set PCI CLKRUN# to OFF */ | 80 | alchemy_gpio_direction_output(3, 1); /* Disable PCI CLKRUN# */ |
79 | au_writel(0x00000002, SYS_OUTPUTSET); /* set EXT_IO3 ON */ | 81 | alchemy_gpio_direction_output(1, 1); /* Enable EXT_IO3 */ |
80 | au_writel(0x00000020, SYS_OUTPUTCLR); /* set eth PHY TX_ER to OFF */ | 82 | alchemy_gpio_direction_output(5, 0); /* Disable eth PHY TX_ER */ |
81 | 83 | ||
82 | /* Enable LED and set it to green */ | 84 | /* Enable LED and set it to green */ |
83 | au_writel(au_readl(GPIO2_DIR) | 0x1800, GPIO2_DIR); | 85 | alchemy_gpio_direction_output(211, 1); /* green on */ |
84 | au_writel(0x18000800, GPIO2_OUTPUT); | 86 | alchemy_gpio_direction_output(212, 0); /* red off */ |
85 | 87 | ||
86 | board_pci_idsel = mtx1_pci_idsel; | 88 | board_pci_idsel = mtx1_pci_idsel; |
87 | 89 | ||
@@ -101,10 +103,10 @@ mtx1_pci_idsel(unsigned int devsel, int assert) | |||
101 | 103 | ||
102 | if (assert && devsel != 0) | 104 | if (assert && devsel != 0) |
103 | /* Suppress signal to Cardbus */ | 105 | /* Suppress signal to Cardbus */ |
104 | au_writel(0x00000002, SYS_OUTPUTCLR); /* set EXT_IO3 OFF */ | 106 | gpio_set_value(1, 0); /* set EXT_IO3 OFF */ |
105 | else | 107 | else |
106 | au_writel(0x00000002, SYS_OUTPUTSET); /* set EXT_IO3 ON */ | 108 | gpio_set_value(1, 1); /* set EXT_IO3 ON */ |
109 | |||
107 | au_sync_udelay(1); | 110 | au_sync_udelay(1); |
108 | return 1; | 111 | return 1; |
109 | } | 112 | } |
110 | |||
diff --git a/arch/mips/alchemy/mtx-1/platform.c b/arch/mips/alchemy/mtx-1/platform.c index 8b5914d1241f..e30e42add697 100644 --- a/arch/mips/alchemy/mtx-1/platform.c +++ b/arch/mips/alchemy/mtx-1/platform.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * MTX-1 platform devices registration | 2 | * MTX-1 platform devices registration |
3 | * | 3 | * |
4 | * Copyright (C) 2007, Florian Fainelli <florian@openwrt.org> | 4 | * Copyright (C) 2007-2009, Florian Fainelli <florian@openwrt.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -142,7 +142,17 @@ static struct __initdata platform_device * mtx1_devs[] = { | |||
142 | 142 | ||
143 | static int __init mtx1_register_devices(void) | 143 | static int __init mtx1_register_devices(void) |
144 | { | 144 | { |
145 | gpio_direction_input(207); | 145 | int rc; |
146 | |||
147 | rc = gpio_request(mtx1_gpio_button[0].gpio, | ||
148 | mtx1_gpio_button[0].desc); | ||
149 | if (rc < 0) { | ||
150 | printk(KERN_INFO "mtx1: failed to request %d\n", | ||
151 | mtx1_gpio_button[0].gpio); | ||
152 | goto out; | ||
153 | } | ||
154 | gpio_direction_input(mtx1_gpio_button[0].gpio); | ||
155 | out: | ||
146 | return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs)); | 156 | return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs)); |
147 | } | 157 | } |
148 | 158 | ||
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c index a2634fabc50d..4de2d48caed8 100644 --- a/arch/mips/alchemy/xxs1500/board_setup.c +++ b/arch/mips/alchemy/xxs1500/board_setup.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/gpio.h> | ||
26 | #include <linux/init.h> | 27 | #include <linux/init.h> |
27 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
28 | 29 | ||
@@ -50,6 +51,9 @@ void __init board_setup(void) | |||
50 | } | 51 | } |
51 | #endif | 52 | #endif |
52 | 53 | ||
54 | alchemy_gpio1_input_enable(); | ||
55 | alchemy_gpio2_enable(); | ||
56 | |||
53 | /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ | 57 | /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ |
54 | pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; | 58 | pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; |
55 | pin_func |= SYS_PF_UR3; | 59 | pin_func |= SYS_PF_UR3; |
@@ -65,20 +69,19 @@ void __init board_setup(void) | |||
65 | au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ | 69 | au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ |
66 | 70 | ||
67 | #ifdef CONFIG_PCMCIA_XXS1500 | 71 | #ifdef CONFIG_PCMCIA_XXS1500 |
68 | /* Setup PCMCIA signals */ | ||
69 | au_writel(0, SYS_PININPUTEN); | ||
70 | |||
71 | /* GPIO 0, 1, and 4 are inputs */ | 72 | /* GPIO 0, 1, and 4 are inputs */ |
72 | au_writel(1 | (1 << 1) | (1 << 4), SYS_TRIOUTCLR); | 73 | alchemy_gpio_direction_input(0); |
74 | alchemy_gpio_direction_input(1); | ||
75 | alchemy_gpio_direction_input(4); | ||
73 | 76 | ||
74 | /* Enable GPIO2 if not already enabled */ | ||
75 | au_writel(1, GPIO2_ENABLE); | ||
76 | /* GPIO2 208/9/10/11 are inputs */ | 77 | /* GPIO2 208/9/10/11 are inputs */ |
77 | au_writel((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11), GPIO2_DIR); | 78 | alchemy_gpio_direction_input(208); |
79 | alchemy_gpio_direction_input(209); | ||
80 | alchemy_gpio_direction_input(210); | ||
81 | alchemy_gpio_direction_input(211); | ||
78 | 82 | ||
79 | /* Turn off power */ | 83 | /* Turn off power */ |
80 | au_writel((au_readl(GPIO2_PINSTATE) & ~(1 << 14)) | (1 << 30), | 84 | alchemy_gpio_direction_output(214, 0); |
81 | GPIO2_OUTPUT); | ||
82 | #endif | 85 | #endif |
83 | 86 | ||
84 | #ifdef CONFIG_PCI | 87 | #ifdef CONFIG_PCI |
diff --git a/arch/mips/ar7/Makefile b/arch/mips/ar7/Makefile new file mode 100644 index 000000000000..26bc5da18997 --- /dev/null +++ b/arch/mips/ar7/Makefile | |||
@@ -0,0 +1,11 @@ | |||
1 | |||
2 | obj-y := \ | ||
3 | prom.o \ | ||
4 | setup.o \ | ||
5 | memory.o \ | ||
6 | irq.o \ | ||
7 | time.o \ | ||
8 | platform.o \ | ||
9 | gpio.o \ | ||
10 | clock.o | ||
11 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/mips/ar7/clock.c b/arch/mips/ar7/clock.c new file mode 100644 index 000000000000..cc65c8eb391b --- /dev/null +++ b/arch/mips/ar7/clock.c | |||
@@ -0,0 +1,427 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> | ||
3 | * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/types.h> | ||
23 | #include <linux/module.h> | ||
24 | #include <linux/delay.h> | ||
25 | #include <linux/gcd.h> | ||
26 | #include <linux/io.h> | ||
27 | |||
28 | #include <asm/addrspace.h> | ||
29 | #include <asm/mach-ar7/ar7.h> | ||
30 | |||
31 | #define BOOT_PLL_SOURCE_MASK 0x3 | ||
32 | #define CPU_PLL_SOURCE_SHIFT 16 | ||
33 | #define BUS_PLL_SOURCE_SHIFT 14 | ||
34 | #define USB_PLL_SOURCE_SHIFT 18 | ||
35 | #define DSP_PLL_SOURCE_SHIFT 22 | ||
36 | #define BOOT_PLL_SOURCE_AFE 0 | ||
37 | #define BOOT_PLL_SOURCE_BUS 0 | ||
38 | #define BOOT_PLL_SOURCE_REF 1 | ||
39 | #define BOOT_PLL_SOURCE_XTAL 2 | ||
40 | #define BOOT_PLL_SOURCE_CPU 3 | ||
41 | #define BOOT_PLL_BYPASS 0x00000020 | ||
42 | #define BOOT_PLL_ASYNC_MODE 0x02000000 | ||
43 | #define BOOT_PLL_2TO1_MODE 0x00008000 | ||
44 | |||
45 | #define TNETD7200_CLOCK_ID_CPU 0 | ||
46 | #define TNETD7200_CLOCK_ID_DSP 1 | ||
47 | #define TNETD7200_CLOCK_ID_USB 2 | ||
48 | |||
49 | #define TNETD7200_DEF_CPU_CLK 211000000 | ||
50 | #define TNETD7200_DEF_DSP_CLK 125000000 | ||
51 | #define TNETD7200_DEF_USB_CLK 48000000 | ||
52 | |||
53 | struct tnetd7300_clock { | ||
54 | u32 ctrl; | ||
55 | #define PREDIV_MASK 0x001f0000 | ||
56 | #define PREDIV_SHIFT 16 | ||
57 | #define POSTDIV_MASK 0x0000001f | ||
58 | u32 unused1[3]; | ||
59 | u32 pll; | ||
60 | #define MUL_MASK 0x0000f000 | ||
61 | #define MUL_SHIFT 12 | ||
62 | #define PLL_MODE_MASK 0x00000001 | ||
63 | #define PLL_NDIV 0x00000800 | ||
64 | #define PLL_DIV 0x00000002 | ||
65 | #define PLL_STATUS 0x00000001 | ||
66 | u32 unused2[3]; | ||
67 | }; | ||
68 | |||
69 | struct tnetd7300_clocks { | ||
70 | struct tnetd7300_clock bus; | ||
71 | struct tnetd7300_clock cpu; | ||
72 | struct tnetd7300_clock usb; | ||
73 | struct tnetd7300_clock dsp; | ||
74 | }; | ||
75 | |||
76 | struct tnetd7200_clock { | ||
77 | u32 ctrl; | ||
78 | u32 unused1[3]; | ||
79 | #define DIVISOR_ENABLE_MASK 0x00008000 | ||
80 | u32 mul; | ||
81 | u32 prediv; | ||
82 | u32 postdiv; | ||
83 | u32 postdiv2; | ||
84 | u32 unused2[6]; | ||
85 | u32 cmd; | ||
86 | u32 status; | ||
87 | u32 cmden; | ||
88 | u32 padding[15]; | ||
89 | }; | ||
90 | |||
91 | struct tnetd7200_clocks { | ||
92 | struct tnetd7200_clock cpu; | ||
93 | struct tnetd7200_clock dsp; | ||
94 | struct tnetd7200_clock usb; | ||
95 | }; | ||
96 | |||
97 | int ar7_cpu_clock = 150000000; | ||
98 | EXPORT_SYMBOL(ar7_cpu_clock); | ||
99 | int ar7_bus_clock = 125000000; | ||
100 | EXPORT_SYMBOL(ar7_bus_clock); | ||
101 | int ar7_dsp_clock; | ||
102 | EXPORT_SYMBOL(ar7_dsp_clock); | ||
103 | |||
104 | static void approximate(int base, int target, int *prediv, | ||
105 | int *postdiv, int *mul) | ||
106 | { | ||
107 | int i, j, k, freq, res = target; | ||
108 | for (i = 1; i <= 16; i++) | ||
109 | for (j = 1; j <= 32; j++) | ||
110 | for (k = 1; k <= 32; k++) { | ||
111 | freq = abs(base / j * i / k - target); | ||
112 | if (freq < res) { | ||
113 | res = freq; | ||
114 | *mul = i; | ||
115 | *prediv = j; | ||
116 | *postdiv = k; | ||
117 | } | ||
118 | } | ||
119 | } | ||
120 | |||
121 | static void calculate(int base, int target, int *prediv, int *postdiv, | ||
122 | int *mul) | ||
123 | { | ||
124 | int tmp_gcd, tmp_base, tmp_freq; | ||
125 | |||
126 | for (*prediv = 1; *prediv <= 32; (*prediv)++) { | ||
127 | tmp_base = base / *prediv; | ||
128 | tmp_gcd = gcd(target, tmp_base); | ||
129 | *mul = target / tmp_gcd; | ||
130 | *postdiv = tmp_base / tmp_gcd; | ||
131 | if ((*mul < 1) || (*mul >= 16)) | ||
132 | continue; | ||
133 | if ((*postdiv > 0) & (*postdiv <= 32)) | ||
134 | break; | ||
135 | } | ||
136 | |||
137 | if (base / *prediv * *mul / *postdiv != target) { | ||
138 | approximate(base, target, prediv, postdiv, mul); | ||
139 | tmp_freq = base / *prediv * *mul / *postdiv; | ||
140 | printk(KERN_WARNING | ||
141 | "Adjusted requested frequency %d to %d\n", | ||
142 | target, tmp_freq); | ||
143 | } | ||
144 | |||
145 | printk(KERN_DEBUG "Clocks: prediv: %d, postdiv: %d, mul: %d\n", | ||
146 | *prediv, *postdiv, *mul); | ||
147 | } | ||
148 | |||
149 | static int tnetd7300_dsp_clock(void) | ||
150 | { | ||
151 | u32 didr1, didr2; | ||
152 | u8 rev = ar7_chip_rev(); | ||
153 | didr1 = readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x18)); | ||
154 | didr2 = readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x1c)); | ||
155 | if (didr2 & (1 << 23)) | ||
156 | return 0; | ||
157 | if ((rev >= 0x23) && (rev != 0x57)) | ||
158 | return 250000000; | ||
159 | if ((((didr2 & 0x1fff) << 10) | ((didr1 & 0xffc00000) >> 22)) | ||
160 | > 4208000) | ||
161 | return 250000000; | ||
162 | return 0; | ||
163 | } | ||
164 | |||
165 | static int tnetd7300_get_clock(u32 shift, struct tnetd7300_clock *clock, | ||
166 | u32 *bootcr, u32 bus_clock) | ||
167 | { | ||
168 | int product; | ||
169 | int base_clock = AR7_REF_CLOCK; | ||
170 | u32 ctrl = readl(&clock->ctrl); | ||
171 | u32 pll = readl(&clock->pll); | ||
172 | int prediv = ((ctrl & PREDIV_MASK) >> PREDIV_SHIFT) + 1; | ||
173 | int postdiv = (ctrl & POSTDIV_MASK) + 1; | ||
174 | int divisor = prediv * postdiv; | ||
175 | int mul = ((pll & MUL_MASK) >> MUL_SHIFT) + 1; | ||
176 | |||
177 | switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) { | ||
178 | case BOOT_PLL_SOURCE_BUS: | ||
179 | base_clock = bus_clock; | ||
180 | break; | ||
181 | case BOOT_PLL_SOURCE_REF: | ||
182 | base_clock = AR7_REF_CLOCK; | ||
183 | break; | ||
184 | case BOOT_PLL_SOURCE_XTAL: | ||
185 | base_clock = AR7_XTAL_CLOCK; | ||
186 | break; | ||
187 | case BOOT_PLL_SOURCE_CPU: | ||
188 | base_clock = ar7_cpu_clock; | ||
189 | break; | ||
190 | } | ||
191 | |||
192 | if (*bootcr & BOOT_PLL_BYPASS) | ||
193 | return base_clock / divisor; | ||
194 | |||
195 | if ((pll & PLL_MODE_MASK) == 0) | ||
196 | return (base_clock >> (mul / 16 + 1)) / divisor; | ||
197 | |||
198 | if ((pll & (PLL_NDIV | PLL_DIV)) == (PLL_NDIV | PLL_DIV)) { | ||
199 | product = (mul & 1) ? | ||
200 | (base_clock * mul) >> 1 : | ||
201 | (base_clock * (mul - 1)) >> 2; | ||
202 | return product / divisor; | ||
203 | } | ||
204 | |||
205 | if (mul == 16) | ||
206 | return base_clock / divisor; | ||
207 | |||
208 | return base_clock * mul / divisor; | ||
209 | } | ||
210 | |||
211 | static void tnetd7300_set_clock(u32 shift, struct tnetd7300_clock *clock, | ||
212 | u32 *bootcr, u32 frequency) | ||
213 | { | ||
214 | int prediv, postdiv, mul; | ||
215 | int base_clock = ar7_bus_clock; | ||
216 | |||
217 | switch ((*bootcr & (BOOT_PLL_SOURCE_MASK << shift)) >> shift) { | ||
218 | case BOOT_PLL_SOURCE_BUS: | ||
219 | base_clock = ar7_bus_clock; | ||
220 | break; | ||
221 | case BOOT_PLL_SOURCE_REF: | ||
222 | base_clock = AR7_REF_CLOCK; | ||
223 | break; | ||
224 | case BOOT_PLL_SOURCE_XTAL: | ||
225 | base_clock = AR7_XTAL_CLOCK; | ||
226 | break; | ||
227 | case BOOT_PLL_SOURCE_CPU: | ||
228 | base_clock = ar7_cpu_clock; | ||
229 | break; | ||
230 | } | ||
231 | |||
232 | calculate(base_clock, frequency, &prediv, &postdiv, &mul); | ||
233 | |||
234 | writel(((prediv - 1) << PREDIV_SHIFT) | (postdiv - 1), &clock->ctrl); | ||
235 | msleep(1); | ||
236 | writel(4, &clock->pll); | ||
237 | while (readl(&clock->pll) & PLL_STATUS) | ||
238 | ; | ||
239 | writel(((mul - 1) << MUL_SHIFT) | (0xff << 3) | 0x0e, &clock->pll); | ||
240 | msleep(75); | ||
241 | } | ||
242 | |||
243 | static void __init tnetd7300_init_clocks(void) | ||
244 | { | ||
245 | u32 *bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4); | ||
246 | struct tnetd7300_clocks *clocks = | ||
247 | ioremap_nocache(UR8_REGS_CLOCKS, | ||
248 | sizeof(struct tnetd7300_clocks)); | ||
249 | |||
250 | ar7_bus_clock = tnetd7300_get_clock(BUS_PLL_SOURCE_SHIFT, | ||
251 | &clocks->bus, bootcr, AR7_AFE_CLOCK); | ||
252 | |||
253 | if (*bootcr & BOOT_PLL_ASYNC_MODE) | ||
254 | ar7_cpu_clock = tnetd7300_get_clock(CPU_PLL_SOURCE_SHIFT, | ||
255 | &clocks->cpu, bootcr, AR7_AFE_CLOCK); | ||
256 | else | ||
257 | ar7_cpu_clock = ar7_bus_clock; | ||
258 | |||
259 | if (ar7_dsp_clock == 250000000) | ||
260 | tnetd7300_set_clock(DSP_PLL_SOURCE_SHIFT, &clocks->dsp, | ||
261 | bootcr, ar7_dsp_clock); | ||
262 | |||
263 | iounmap(clocks); | ||
264 | iounmap(bootcr); | ||
265 | } | ||
266 | |||
267 | static void tnetd7200_set_clock(int base, struct tnetd7200_clock *clock, | ||
268 | int prediv, int postdiv, int postdiv2, int mul, u32 frequency) | ||
269 | { | ||
270 | printk(KERN_INFO | ||
271 | "Clocks: base = %d, frequency = %u, prediv = %d, " | ||
272 | "postdiv = %d, postdiv2 = %d, mul = %d\n", | ||
273 | base, frequency, prediv, postdiv, postdiv2, mul); | ||
274 | |||
275 | writel(0, &clock->ctrl); | ||
276 | writel(DIVISOR_ENABLE_MASK | ((prediv - 1) & 0x1F), &clock->prediv); | ||
277 | writel((mul - 1) & 0xF, &clock->mul); | ||
278 | |||
279 | while (readl(&clock->status) & 0x1) | ||
280 | ; /* nop */ | ||
281 | |||
282 | writel(DIVISOR_ENABLE_MASK | ((postdiv - 1) & 0x1F), &clock->postdiv); | ||
283 | |||
284 | writel(readl(&clock->cmden) | 1, &clock->cmden); | ||
285 | writel(readl(&clock->cmd) | 1, &clock->cmd); | ||
286 | |||
287 | while (readl(&clock->status) & 0x1) | ||
288 | ; /* nop */ | ||
289 | |||
290 | writel(DIVISOR_ENABLE_MASK | ((postdiv2 - 1) & 0x1F), &clock->postdiv2); | ||
291 | |||
292 | writel(readl(&clock->cmden) | 1, &clock->cmden); | ||
293 | writel(readl(&clock->cmd) | 1, &clock->cmd); | ||
294 | |||
295 | while (readl(&clock->status) & 0x1) | ||
296 | ; /* nop */ | ||
297 | |||
298 | writel(readl(&clock->ctrl) | 1, &clock->ctrl); | ||
299 | } | ||
300 | |||
301 | static int tnetd7200_get_clock_base(int clock_id, u32 *bootcr) | ||
302 | { | ||
303 | if (*bootcr & BOOT_PLL_ASYNC_MODE) | ||
304 | /* Async */ | ||
305 | switch (clock_id) { | ||
306 | case TNETD7200_CLOCK_ID_DSP: | ||
307 | return AR7_REF_CLOCK; | ||
308 | default: | ||
309 | return AR7_AFE_CLOCK; | ||
310 | } | ||
311 | else | ||
312 | /* Sync */ | ||
313 | if (*bootcr & BOOT_PLL_2TO1_MODE) | ||
314 | /* 2:1 */ | ||
315 | switch (clock_id) { | ||
316 | case TNETD7200_CLOCK_ID_DSP: | ||
317 | return AR7_REF_CLOCK; | ||
318 | default: | ||
319 | return AR7_AFE_CLOCK; | ||
320 | } | ||
321 | else | ||
322 | /* 1:1 */ | ||
323 | return AR7_REF_CLOCK; | ||
324 | } | ||
325 | |||
326 | |||
327 | static void __init tnetd7200_init_clocks(void) | ||
328 | { | ||
329 | u32 *bootcr = (u32 *)ioremap_nocache(AR7_REGS_DCL, 4); | ||
330 | struct tnetd7200_clocks *clocks = | ||
331 | ioremap_nocache(AR7_REGS_CLOCKS, | ||
332 | sizeof(struct tnetd7200_clocks)); | ||
333 | int cpu_base, cpu_mul, cpu_prediv, cpu_postdiv; | ||
334 | int dsp_base, dsp_mul, dsp_prediv, dsp_postdiv; | ||
335 | int usb_base, usb_mul, usb_prediv, usb_postdiv; | ||
336 | |||
337 | cpu_base = tnetd7200_get_clock_base(TNETD7200_CLOCK_ID_CPU, bootcr); | ||
338 | dsp_base = tnetd7200_get_clock_base(TNETD7200_CLOCK_ID_DSP, bootcr); | ||
339 | |||
340 | if (*bootcr & BOOT_PLL_ASYNC_MODE) { | ||
341 | printk(KERN_INFO "Clocks: Async mode\n"); | ||
342 | |||
343 | printk(KERN_INFO "Clocks: Setting DSP clock\n"); | ||
344 | calculate(dsp_base, TNETD7200_DEF_DSP_CLK, | ||
345 | &dsp_prediv, &dsp_postdiv, &dsp_mul); | ||
346 | ar7_bus_clock = | ||
347 | ((dsp_base / dsp_prediv) * dsp_mul) / dsp_postdiv; | ||
348 | tnetd7200_set_clock(dsp_base, &clocks->dsp, | ||
349 | dsp_prediv, dsp_postdiv * 2, dsp_postdiv, dsp_mul * 2, | ||
350 | ar7_bus_clock); | ||
351 | |||
352 | printk(KERN_INFO "Clocks: Setting CPU clock\n"); | ||
353 | calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv, | ||
354 | &cpu_postdiv, &cpu_mul); | ||
355 | ar7_cpu_clock = | ||
356 | ((cpu_base / cpu_prediv) * cpu_mul) / cpu_postdiv; | ||
357 | tnetd7200_set_clock(cpu_base, &clocks->cpu, | ||
358 | cpu_prediv, cpu_postdiv, -1, cpu_mul, | ||
359 | ar7_cpu_clock); | ||
360 | |||
361 | } else | ||
362 | if (*bootcr & BOOT_PLL_2TO1_MODE) { | ||
363 | printk(KERN_INFO "Clocks: Sync 2:1 mode\n"); | ||
364 | |||
365 | printk(KERN_INFO "Clocks: Setting CPU clock\n"); | ||
366 | calculate(cpu_base, TNETD7200_DEF_CPU_CLK, &cpu_prediv, | ||
367 | &cpu_postdiv, &cpu_mul); | ||
368 | ar7_cpu_clock = ((cpu_base / cpu_prediv) * cpu_mul) | ||
369 | / cpu_postdiv; | ||
370 | tnetd7200_set_clock(cpu_base, &clocks->cpu, | ||
371 | cpu_prediv, cpu_postdiv, -1, cpu_mul, | ||
372 | ar7_cpu_clock); | ||
373 | |||
374 | printk(KERN_INFO "Clocks: Setting DSP clock\n"); | ||
375 | calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv, | ||
376 | &dsp_postdiv, &dsp_mul); | ||
377 | ar7_bus_clock = ar7_cpu_clock / 2; | ||
378 | tnetd7200_set_clock(dsp_base, &clocks->dsp, | ||
379 | dsp_prediv, dsp_postdiv * 2, dsp_postdiv, | ||
380 | dsp_mul * 2, ar7_bus_clock); | ||
381 | } else { | ||
382 | printk(KERN_INFO "Clocks: Sync 1:1 mode\n"); | ||
383 | |||
384 | printk(KERN_INFO "Clocks: Setting DSP clock\n"); | ||
385 | calculate(dsp_base, TNETD7200_DEF_DSP_CLK, &dsp_prediv, | ||
386 | &dsp_postdiv, &dsp_mul); | ||
387 | ar7_bus_clock = ((dsp_base / dsp_prediv) * dsp_mul) | ||
388 | / dsp_postdiv; | ||
389 | tnetd7200_set_clock(dsp_base, &clocks->dsp, | ||
390 | dsp_prediv, dsp_postdiv * 2, dsp_postdiv, | ||
391 | dsp_mul * 2, ar7_bus_clock); | ||
392 | |||
393 | ar7_cpu_clock = ar7_bus_clock; | ||
394 | } | ||
395 | |||
396 | printk(KERN_INFO "Clocks: Setting USB clock\n"); | ||
397 | usb_base = ar7_bus_clock; | ||
398 | calculate(usb_base, TNETD7200_DEF_USB_CLK, &usb_prediv, | ||
399 | &usb_postdiv, &usb_mul); | ||
400 | tnetd7200_set_clock(usb_base, &clocks->usb, | ||
401 | usb_prediv, usb_postdiv, -1, usb_mul, | ||
402 | TNETD7200_DEF_USB_CLK); | ||
403 | |||
404 | ar7_dsp_clock = ar7_cpu_clock; | ||
405 | |||
406 | iounmap(clocks); | ||
407 | iounmap(bootcr); | ||
408 | } | ||
409 | |||
410 | int __init ar7_init_clocks(void) | ||
411 | { | ||
412 | switch (ar7_chip_id()) { | ||
413 | case AR7_CHIP_7100: | ||
414 | case AR7_CHIP_7200: | ||
415 | tnetd7200_init_clocks(); | ||
416 | break; | ||
417 | case AR7_CHIP_7300: | ||
418 | ar7_dsp_clock = tnetd7300_dsp_clock(); | ||
419 | tnetd7300_init_clocks(); | ||
420 | break; | ||
421 | default: | ||
422 | break; | ||
423 | } | ||
424 | |||
425 | return 0; | ||
426 | } | ||
427 | arch_initcall(ar7_init_clocks); | ||
diff --git a/arch/mips/ar7/gpio.c b/arch/mips/ar7/gpio.c new file mode 100644 index 000000000000..74e14a3dbf4a --- /dev/null +++ b/arch/mips/ar7/gpio.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> | ||
3 | * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/module.h> | ||
21 | |||
22 | #include <asm/mach-ar7/gpio.h> | ||
23 | |||
24 | static const char *ar7_gpio_list[AR7_GPIO_MAX]; | ||
25 | |||
26 | int gpio_request(unsigned gpio, const char *label) | ||
27 | { | ||
28 | if (gpio >= AR7_GPIO_MAX) | ||
29 | return -EINVAL; | ||
30 | |||
31 | if (ar7_gpio_list[gpio]) | ||
32 | return -EBUSY; | ||
33 | |||
34 | if (label) | ||
35 | ar7_gpio_list[gpio] = label; | ||
36 | else | ||
37 | ar7_gpio_list[gpio] = "busy"; | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | EXPORT_SYMBOL(gpio_request); | ||
42 | |||
43 | void gpio_free(unsigned gpio) | ||
44 | { | ||
45 | BUG_ON(!ar7_gpio_list[gpio]); | ||
46 | ar7_gpio_list[gpio] = NULL; | ||
47 | } | ||
48 | EXPORT_SYMBOL(gpio_free); | ||
diff --git a/arch/mips/ar7/irq.c b/arch/mips/ar7/irq.c new file mode 100644 index 000000000000..c781556c44e4 --- /dev/null +++ b/arch/mips/ar7/irq.c | |||
@@ -0,0 +1,176 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> | ||
3 | * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/interrupt.h> | ||
21 | #include <linux/io.h> | ||
22 | |||
23 | #include <asm/irq_cpu.h> | ||
24 | #include <asm/mipsregs.h> | ||
25 | #include <asm/mach-ar7/ar7.h> | ||
26 | |||
27 | #define EXCEPT_OFFSET 0x80 | ||
28 | #define PACE_OFFSET 0xA0 | ||
29 | #define CHNLS_OFFSET 0x200 | ||
30 | |||
31 | #define REG_OFFSET(irq, reg) ((irq) / 32 * 0x4 + reg * 0x10) | ||
32 | #define SEC_REG_OFFSET(reg) (EXCEPT_OFFSET + reg * 0x8) | ||
33 | #define SEC_SR_OFFSET (SEC_REG_OFFSET(0)) /* 0x80 */ | ||
34 | #define CR_OFFSET(irq) (REG_OFFSET(irq, 1)) /* 0x10 */ | ||
35 | #define SEC_CR_OFFSET (SEC_REG_OFFSET(1)) /* 0x88 */ | ||
36 | #define ESR_OFFSET(irq) (REG_OFFSET(irq, 2)) /* 0x20 */ | ||
37 | #define SEC_ESR_OFFSET (SEC_REG_OFFSET(2)) /* 0x90 */ | ||
38 | #define ECR_OFFSET(irq) (REG_OFFSET(irq, 3)) /* 0x30 */ | ||
39 | #define SEC_ECR_OFFSET (SEC_REG_OFFSET(3)) /* 0x98 */ | ||
40 | #define PIR_OFFSET (0x40) | ||
41 | #define MSR_OFFSET (0x44) | ||
42 | #define PM_OFFSET(irq) (REG_OFFSET(irq, 5)) /* 0x50 */ | ||
43 | #define TM_OFFSET(irq) (REG_OFFSET(irq, 6)) /* 0x60 */ | ||
44 | |||
45 | #define REG(addr) ((u32 *)(KSEG1ADDR(AR7_REGS_IRQ) + addr)) | ||
46 | |||
47 | #define CHNL_OFFSET(chnl) (CHNLS_OFFSET + (chnl * 4)) | ||
48 | |||
49 | static int ar7_irq_base; | ||
50 | |||
51 | static void ar7_unmask_irq(unsigned int irq) | ||
52 | { | ||
53 | writel(1 << ((irq - ar7_irq_base) % 32), | ||
54 | REG(ESR_OFFSET(irq - ar7_irq_base))); | ||
55 | } | ||
56 | |||
57 | static void ar7_mask_irq(unsigned int irq) | ||
58 | { | ||
59 | writel(1 << ((irq - ar7_irq_base) % 32), | ||
60 | REG(ECR_OFFSET(irq - ar7_irq_base))); | ||
61 | } | ||
62 | |||
63 | static void ar7_ack_irq(unsigned int irq) | ||
64 | { | ||
65 | writel(1 << ((irq - ar7_irq_base) % 32), | ||
66 | REG(CR_OFFSET(irq - ar7_irq_base))); | ||
67 | } | ||
68 | |||
69 | static void ar7_unmask_sec_irq(unsigned int irq) | ||
70 | { | ||
71 | writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ESR_OFFSET)); | ||
72 | } | ||
73 | |||
74 | static void ar7_mask_sec_irq(unsigned int irq) | ||
75 | { | ||
76 | writel(1 << (irq - ar7_irq_base - 40), REG(SEC_ECR_OFFSET)); | ||
77 | } | ||
78 | |||
79 | static void ar7_ack_sec_irq(unsigned int irq) | ||
80 | { | ||
81 | writel(1 << (irq - ar7_irq_base - 40), REG(SEC_CR_OFFSET)); | ||
82 | } | ||
83 | |||
84 | static struct irq_chip ar7_irq_type = { | ||
85 | .name = "AR7", | ||
86 | .unmask = ar7_unmask_irq, | ||
87 | .mask = ar7_mask_irq, | ||
88 | .ack = ar7_ack_irq | ||
89 | }; | ||
90 | |||
91 | static struct irq_chip ar7_sec_irq_type = { | ||
92 | .name = "AR7", | ||
93 | .unmask = ar7_unmask_sec_irq, | ||
94 | .mask = ar7_mask_sec_irq, | ||
95 | .ack = ar7_ack_sec_irq, | ||
96 | }; | ||
97 | |||
98 | static struct irqaction ar7_cascade_action = { | ||
99 | .handler = no_action, | ||
100 | .name = "AR7 cascade interrupt" | ||
101 | }; | ||
102 | |||
103 | static void __init ar7_irq_init(int base) | ||
104 | { | ||
105 | int i; | ||
106 | /* | ||
107 | * Disable interrupts and clear pending | ||
108 | */ | ||
109 | writel(0xffffffff, REG(ECR_OFFSET(0))); | ||
110 | writel(0xff, REG(ECR_OFFSET(32))); | ||
111 | writel(0xffffffff, REG(SEC_ECR_OFFSET)); | ||
112 | writel(0xffffffff, REG(CR_OFFSET(0))); | ||
113 | writel(0xff, REG(CR_OFFSET(32))); | ||
114 | writel(0xffffffff, REG(SEC_CR_OFFSET)); | ||
115 | |||
116 | ar7_irq_base = base; | ||
117 | |||
118 | for (i = 0; i < 40; i++) { | ||
119 | writel(i, REG(CHNL_OFFSET(i))); | ||
120 | /* Primary IRQ's */ | ||
121 | set_irq_chip_and_handler(base + i, &ar7_irq_type, | ||
122 | handle_level_irq); | ||
123 | /* Secondary IRQ's */ | ||
124 | if (i < 32) | ||
125 | set_irq_chip_and_handler(base + i + 40, | ||
126 | &ar7_sec_irq_type, | ||
127 | handle_level_irq); | ||
128 | } | ||
129 | |||
130 | setup_irq(2, &ar7_cascade_action); | ||
131 | setup_irq(ar7_irq_base, &ar7_cascade_action); | ||
132 | set_c0_status(IE_IRQ0); | ||
133 | } | ||
134 | |||
135 | void __init arch_init_irq(void) | ||
136 | { | ||
137 | mips_cpu_irq_init(); | ||
138 | ar7_irq_init(8); | ||
139 | } | ||
140 | |||
141 | static void ar7_cascade(void) | ||
142 | { | ||
143 | u32 status; | ||
144 | int i, irq; | ||
145 | |||
146 | /* Primary IRQ's */ | ||
147 | irq = readl(REG(PIR_OFFSET)) & 0x3f; | ||
148 | if (irq) { | ||
149 | do_IRQ(ar7_irq_base + irq); | ||
150 | return; | ||
151 | } | ||
152 | |||
153 | /* Secondary IRQ's are cascaded through primary '0' */ | ||
154 | writel(1, REG(CR_OFFSET(irq))); | ||
155 | status = readl(REG(SEC_SR_OFFSET)); | ||
156 | for (i = 0; i < 32; i++) { | ||
157 | if (status & 1) { | ||
158 | do_IRQ(ar7_irq_base + i + 40); | ||
159 | return; | ||
160 | } | ||
161 | status >>= 1; | ||
162 | } | ||
163 | |||
164 | spurious_interrupt(); | ||
165 | } | ||
166 | |||
167 | asmlinkage void plat_irq_dispatch(void) | ||
168 | { | ||
169 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; | ||
170 | if (pending & STATUSF_IP7) /* cpu timer */ | ||
171 | do_IRQ(7); | ||
172 | else if (pending & STATUSF_IP2) /* int0 hardware line */ | ||
173 | ar7_cascade(); | ||
174 | else | ||
175 | spurious_interrupt(); | ||
176 | } | ||
diff --git a/arch/mips/ar7/memory.c b/arch/mips/ar7/memory.c new file mode 100644 index 000000000000..696c723dc6d4 --- /dev/null +++ b/arch/mips/ar7/memory.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Felix Fietkau <nbd@openwrt.org> | ||
3 | * Copyright (C) 2007 Eugene Konev <ejka@openwrt.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | #include <linux/bootmem.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/mm.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/pfn.h> | ||
24 | #include <linux/proc_fs.h> | ||
25 | #include <linux/string.h> | ||
26 | #include <linux/swap.h> | ||
27 | |||
28 | #include <asm/bootinfo.h> | ||
29 | #include <asm/page.h> | ||
30 | #include <asm/sections.h> | ||
31 | |||
32 | #include <asm/mach-ar7/ar7.h> | ||
33 | #include <asm/mips-boards/prom.h> | ||
34 | |||
35 | static int __init memsize(void) | ||
36 | { | ||
37 | u32 size = (64 << 20); | ||
38 | u32 *addr = (u32 *)KSEG1ADDR(AR7_SDRAM_BASE + size - 4); | ||
39 | u32 *kernel_end = (u32 *)KSEG1ADDR(CPHYSADDR((u32)&_end)); | ||
40 | u32 *tmpaddr = addr; | ||
41 | |||
42 | while (tmpaddr > kernel_end) { | ||
43 | *tmpaddr = (u32)tmpaddr; | ||
44 | size >>= 1; | ||
45 | tmpaddr -= size >> 2; | ||
46 | } | ||
47 | |||
48 | do { | ||
49 | tmpaddr += size >> 2; | ||
50 | if (*tmpaddr != (u32)tmpaddr) | ||
51 | break; | ||
52 | size <<= 1; | ||
53 | } while (size < (64 << 20)); | ||
54 | |||
55 | writel((u32)tmpaddr, &addr); | ||
56 | |||
57 | return size; | ||
58 | } | ||
59 | |||
60 | void __init prom_meminit(void) | ||
61 | { | ||
62 | unsigned long pages; | ||
63 | |||
64 | pages = memsize() >> PAGE_SHIFT; | ||
65 | add_memory_region(PHYS_OFFSET, pages << PAGE_SHIFT, | ||
66 | BOOT_MEM_RAM); | ||
67 | } | ||
68 | |||
69 | void __init prom_free_prom_memory(void) | ||
70 | { | ||
71 | /* Nothing to free */ | ||
72 | } | ||
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c new file mode 100644 index 000000000000..2ecab6155932 --- /dev/null +++ b/arch/mips/ar7/platform.c | |||
@@ -0,0 +1,555 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> | ||
3 | * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #include <linux/init.h> | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/delay.h> | ||
24 | #include <linux/dma-mapping.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/mtd/physmap.h> | ||
27 | #include <linux/serial.h> | ||
28 | #include <linux/serial_8250.h> | ||
29 | #include <linux/ioport.h> | ||
30 | #include <linux/io.h> | ||
31 | #include <linux/vlynq.h> | ||
32 | #include <linux/leds.h> | ||
33 | #include <linux/string.h> | ||
34 | #include <linux/etherdevice.h> | ||
35 | |||
36 | #include <asm/addrspace.h> | ||
37 | #include <asm/mach-ar7/ar7.h> | ||
38 | #include <asm/mach-ar7/gpio.h> | ||
39 | #include <asm/mach-ar7/prom.h> | ||
40 | |||
41 | struct plat_vlynq_data { | ||
42 | struct plat_vlynq_ops ops; | ||
43 | int gpio_bit; | ||
44 | int reset_bit; | ||
45 | }; | ||
46 | |||
47 | |||
48 | static int vlynq_on(struct vlynq_device *dev) | ||
49 | { | ||
50 | int result; | ||
51 | struct plat_vlynq_data *pdata = dev->dev.platform_data; | ||
52 | |||
53 | result = gpio_request(pdata->gpio_bit, "vlynq"); | ||
54 | if (result) | ||
55 | goto out; | ||
56 | |||
57 | ar7_device_reset(pdata->reset_bit); | ||
58 | |||
59 | result = ar7_gpio_disable(pdata->gpio_bit); | ||
60 | if (result) | ||
61 | goto out_enabled; | ||
62 | |||
63 | result = ar7_gpio_enable(pdata->gpio_bit); | ||
64 | if (result) | ||
65 | goto out_enabled; | ||
66 | |||
67 | result = gpio_direction_output(pdata->gpio_bit, 0); | ||
68 | if (result) | ||
69 | goto out_gpio_enabled; | ||
70 | |||
71 | msleep(50); | ||
72 | |||
73 | gpio_set_value(pdata->gpio_bit, 1); | ||
74 | msleep(50); | ||
75 | |||
76 | return 0; | ||
77 | |||
78 | out_gpio_enabled: | ||
79 | ar7_gpio_disable(pdata->gpio_bit); | ||
80 | out_enabled: | ||
81 | ar7_device_disable(pdata->reset_bit); | ||
82 | gpio_free(pdata->gpio_bit); | ||
83 | out: | ||
84 | return result; | ||
85 | } | ||
86 | |||
87 | static void vlynq_off(struct vlynq_device *dev) | ||
88 | { | ||
89 | struct plat_vlynq_data *pdata = dev->dev.platform_data; | ||
90 | ar7_gpio_disable(pdata->gpio_bit); | ||
91 | gpio_free(pdata->gpio_bit); | ||
92 | ar7_device_disable(pdata->reset_bit); | ||
93 | } | ||
94 | |||
95 | static struct resource physmap_flash_resource = { | ||
96 | .name = "mem", | ||
97 | .flags = IORESOURCE_MEM, | ||
98 | .start = 0x10000000, | ||
99 | .end = 0x107fffff, | ||
100 | }; | ||
101 | |||
102 | static struct resource cpmac_low_res[] = { | ||
103 | { | ||
104 | .name = "regs", | ||
105 | .flags = IORESOURCE_MEM, | ||
106 | .start = AR7_REGS_MAC0, | ||
107 | .end = AR7_REGS_MAC0 + 0x7ff, | ||
108 | }, | ||
109 | { | ||
110 | .name = "irq", | ||
111 | .flags = IORESOURCE_IRQ, | ||
112 | .start = 27, | ||
113 | .end = 27, | ||
114 | }, | ||
115 | }; | ||
116 | |||
117 | static struct resource cpmac_high_res[] = { | ||
118 | { | ||
119 | .name = "regs", | ||
120 | .flags = IORESOURCE_MEM, | ||
121 | .start = AR7_REGS_MAC1, | ||
122 | .end = AR7_REGS_MAC1 + 0x7ff, | ||
123 | }, | ||
124 | { | ||
125 | .name = "irq", | ||
126 | .flags = IORESOURCE_IRQ, | ||
127 | .start = 41, | ||
128 | .end = 41, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static struct resource vlynq_low_res[] = { | ||
133 | { | ||
134 | .name = "regs", | ||
135 | .flags = IORESOURCE_MEM, | ||
136 | .start = AR7_REGS_VLYNQ0, | ||
137 | .end = AR7_REGS_VLYNQ0 + 0xff, | ||
138 | }, | ||
139 | { | ||
140 | .name = "irq", | ||
141 | .flags = IORESOURCE_IRQ, | ||
142 | .start = 29, | ||
143 | .end = 29, | ||
144 | }, | ||
145 | { | ||
146 | .name = "mem", | ||
147 | .flags = IORESOURCE_MEM, | ||
148 | .start = 0x04000000, | ||
149 | .end = 0x04ffffff, | ||
150 | }, | ||
151 | { | ||
152 | .name = "devirq", | ||
153 | .flags = IORESOURCE_IRQ, | ||
154 | .start = 80, | ||
155 | .end = 111, | ||
156 | }, | ||
157 | }; | ||
158 | |||
159 | static struct resource vlynq_high_res[] = { | ||
160 | { | ||
161 | .name = "regs", | ||
162 | .flags = IORESOURCE_MEM, | ||
163 | .start = AR7_REGS_VLYNQ1, | ||
164 | .end = AR7_REGS_VLYNQ1 + 0xff, | ||
165 | }, | ||
166 | { | ||
167 | .name = "irq", | ||
168 | .flags = IORESOURCE_IRQ, | ||
169 | .start = 33, | ||
170 | .end = 33, | ||
171 | }, | ||
172 | { | ||
173 | .name = "mem", | ||
174 | .flags = IORESOURCE_MEM, | ||
175 | .start = 0x0c000000, | ||
176 | .end = 0x0cffffff, | ||
177 | }, | ||
178 | { | ||
179 | .name = "devirq", | ||
180 | .flags = IORESOURCE_IRQ, | ||
181 | .start = 112, | ||
182 | .end = 143, | ||
183 | }, | ||
184 | }; | ||
185 | |||
186 | static struct resource usb_res[] = { | ||
187 | { | ||
188 | .name = "regs", | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | .start = AR7_REGS_USB, | ||
191 | .end = AR7_REGS_USB + 0xff, | ||
192 | }, | ||
193 | { | ||
194 | .name = "irq", | ||
195 | .flags = IORESOURCE_IRQ, | ||
196 | .start = 32, | ||
197 | .end = 32, | ||
198 | }, | ||
199 | { | ||
200 | .name = "mem", | ||
201 | .flags = IORESOURCE_MEM, | ||
202 | .start = 0x03400000, | ||
203 | .end = 0x034001fff, | ||
204 | }, | ||
205 | }; | ||
206 | |||
207 | static struct physmap_flash_data physmap_flash_data = { | ||
208 | .width = 2, | ||
209 | }; | ||
210 | |||
211 | static struct plat_cpmac_data cpmac_low_data = { | ||
212 | .reset_bit = 17, | ||
213 | .power_bit = 20, | ||
214 | .phy_mask = 0x80000000, | ||
215 | }; | ||
216 | |||
217 | static struct plat_cpmac_data cpmac_high_data = { | ||
218 | .reset_bit = 21, | ||
219 | .power_bit = 22, | ||
220 | .phy_mask = 0x7fffffff, | ||
221 | }; | ||
222 | |||
223 | static struct plat_vlynq_data vlynq_low_data = { | ||
224 | .ops.on = vlynq_on, | ||
225 | .ops.off = vlynq_off, | ||
226 | .reset_bit = 20, | ||
227 | .gpio_bit = 18, | ||
228 | }; | ||
229 | |||
230 | static struct plat_vlynq_data vlynq_high_data = { | ||
231 | .ops.on = vlynq_on, | ||
232 | .ops.off = vlynq_off, | ||
233 | .reset_bit = 16, | ||
234 | .gpio_bit = 19, | ||
235 | }; | ||
236 | |||
237 | static struct platform_device physmap_flash = { | ||
238 | .id = 0, | ||
239 | .name = "physmap-flash", | ||
240 | .dev.platform_data = &physmap_flash_data, | ||
241 | .resource = &physmap_flash_resource, | ||
242 | .num_resources = 1, | ||
243 | }; | ||
244 | |||
245 | static u64 cpmac_dma_mask = DMA_BIT_MASK(32); | ||
246 | static struct platform_device cpmac_low = { | ||
247 | .id = 0, | ||
248 | .name = "cpmac", | ||
249 | .dev = { | ||
250 | .dma_mask = &cpmac_dma_mask, | ||
251 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
252 | .platform_data = &cpmac_low_data, | ||
253 | }, | ||
254 | .resource = cpmac_low_res, | ||
255 | .num_resources = ARRAY_SIZE(cpmac_low_res), | ||
256 | }; | ||
257 | |||
258 | static struct platform_device cpmac_high = { | ||
259 | .id = 1, | ||
260 | .name = "cpmac", | ||
261 | .dev = { | ||
262 | .dma_mask = &cpmac_dma_mask, | ||
263 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
264 | .platform_data = &cpmac_high_data, | ||
265 | }, | ||
266 | .resource = cpmac_high_res, | ||
267 | .num_resources = ARRAY_SIZE(cpmac_high_res), | ||
268 | }; | ||
269 | |||
270 | static struct platform_device vlynq_low = { | ||
271 | .id = 0, | ||
272 | .name = "vlynq", | ||
273 | .dev.platform_data = &vlynq_low_data, | ||
274 | .resource = vlynq_low_res, | ||
275 | .num_resources = ARRAY_SIZE(vlynq_low_res), | ||
276 | }; | ||
277 | |||
278 | static struct platform_device vlynq_high = { | ||
279 | .id = 1, | ||
280 | .name = "vlynq", | ||
281 | .dev.platform_data = &vlynq_high_data, | ||
282 | .resource = vlynq_high_res, | ||
283 | .num_resources = ARRAY_SIZE(vlynq_high_res), | ||
284 | }; | ||
285 | |||
286 | |||
287 | static struct gpio_led default_leds[] = { | ||
288 | { | ||
289 | .name = "status", | ||
290 | .gpio = 8, | ||
291 | .active_low = 1, | ||
292 | }, | ||
293 | }; | ||
294 | |||
295 | static struct gpio_led dsl502t_leds[] = { | ||
296 | { | ||
297 | .name = "status", | ||
298 | .gpio = 9, | ||
299 | .active_low = 1, | ||
300 | }, | ||
301 | { | ||
302 | .name = "ethernet", | ||
303 | .gpio = 7, | ||
304 | .active_low = 1, | ||
305 | }, | ||
306 | { | ||
307 | .name = "usb", | ||
308 | .gpio = 12, | ||
309 | .active_low = 1, | ||
310 | }, | ||
311 | }; | ||
312 | |||
313 | static struct gpio_led dg834g_leds[] = { | ||
314 | { | ||
315 | .name = "ppp", | ||
316 | .gpio = 6, | ||
317 | .active_low = 1, | ||
318 | }, | ||
319 | { | ||
320 | .name = "status", | ||
321 | .gpio = 7, | ||
322 | .active_low = 1, | ||
323 | }, | ||
324 | { | ||
325 | .name = "adsl", | ||
326 | .gpio = 8, | ||
327 | .active_low = 1, | ||
328 | }, | ||
329 | { | ||
330 | .name = "wifi", | ||
331 | .gpio = 12, | ||
332 | .active_low = 1, | ||
333 | }, | ||
334 | { | ||
335 | .name = "power", | ||
336 | .gpio = 14, | ||
337 | .active_low = 1, | ||
338 | .default_trigger = "default-on", | ||
339 | }, | ||
340 | }; | ||
341 | |||
342 | static struct gpio_led fb_sl_leds[] = { | ||
343 | { | ||
344 | .name = "1", | ||
345 | .gpio = 7, | ||
346 | }, | ||
347 | { | ||
348 | .name = "2", | ||
349 | .gpio = 13, | ||
350 | .active_low = 1, | ||
351 | }, | ||
352 | { | ||
353 | .name = "3", | ||
354 | .gpio = 10, | ||
355 | .active_low = 1, | ||
356 | }, | ||
357 | { | ||
358 | .name = "4", | ||
359 | .gpio = 12, | ||
360 | .active_low = 1, | ||
361 | }, | ||
362 | { | ||
363 | .name = "5", | ||
364 | .gpio = 9, | ||
365 | .active_low = 1, | ||
366 | }, | ||
367 | }; | ||
368 | |||
369 | static struct gpio_led fb_fon_leds[] = { | ||
370 | { | ||
371 | .name = "1", | ||
372 | .gpio = 8, | ||
373 | }, | ||
374 | { | ||
375 | .name = "2", | ||
376 | .gpio = 3, | ||
377 | .active_low = 1, | ||
378 | }, | ||
379 | { | ||
380 | .name = "3", | ||
381 | .gpio = 5, | ||
382 | }, | ||
383 | { | ||
384 | .name = "4", | ||
385 | .gpio = 4, | ||
386 | .active_low = 1, | ||
387 | }, | ||
388 | { | ||
389 | .name = "5", | ||
390 | .gpio = 11, | ||
391 | .active_low = 1, | ||
392 | }, | ||
393 | }; | ||
394 | |||
395 | static struct gpio_led_platform_data ar7_led_data; | ||
396 | |||
397 | static struct platform_device ar7_gpio_leds = { | ||
398 | .name = "leds-gpio", | ||
399 | .id = -1, | ||
400 | .dev = { | ||
401 | .platform_data = &ar7_led_data, | ||
402 | } | ||
403 | }; | ||
404 | |||
405 | static struct platform_device ar7_udc = { | ||
406 | .id = -1, | ||
407 | .name = "ar7_udc", | ||
408 | .resource = usb_res, | ||
409 | .num_resources = ARRAY_SIZE(usb_res), | ||
410 | }; | ||
411 | |||
412 | static inline unsigned char char2hex(char h) | ||
413 | { | ||
414 | switch (h) { | ||
415 | case '0': case '1': case '2': case '3': case '4': | ||
416 | case '5': case '6': case '7': case '8': case '9': | ||
417 | return h - '0'; | ||
418 | case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': | ||
419 | return h - 'A' + 10; | ||
420 | case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': | ||
421 | return h - 'a' + 10; | ||
422 | default: | ||
423 | return 0; | ||
424 | } | ||
425 | } | ||
426 | |||
427 | static void cpmac_get_mac(int instance, unsigned char *dev_addr) | ||
428 | { | ||
429 | int i; | ||
430 | char name[5], default_mac[ETH_ALEN], *mac; | ||
431 | |||
432 | mac = NULL; | ||
433 | sprintf(name, "mac%c", 'a' + instance); | ||
434 | mac = prom_getenv(name); | ||
435 | if (!mac) { | ||
436 | sprintf(name, "mac%c", 'a'); | ||
437 | mac = prom_getenv(name); | ||
438 | } | ||
439 | if (!mac) { | ||
440 | random_ether_addr(default_mac); | ||
441 | mac = default_mac; | ||
442 | } | ||
443 | for (i = 0; i < 6; i++) | ||
444 | dev_addr[i] = (char2hex(mac[i * 3]) << 4) + | ||
445 | char2hex(mac[i * 3 + 1]); | ||
446 | } | ||
447 | |||
448 | static void __init detect_leds(void) | ||
449 | { | ||
450 | char *prid, *usb_prod; | ||
451 | |||
452 | /* Default LEDs */ | ||
453 | ar7_led_data.num_leds = ARRAY_SIZE(default_leds); | ||
454 | ar7_led_data.leds = default_leds; | ||
455 | |||
456 | /* FIXME: the whole thing is unreliable */ | ||
457 | prid = prom_getenv("ProductID"); | ||
458 | usb_prod = prom_getenv("usb_prod"); | ||
459 | |||
460 | /* If we can't get the product id from PROM, use the default LEDs */ | ||
461 | if (!prid) | ||
462 | return; | ||
463 | |||
464 | if (strstr(prid, "Fritz_Box_FON")) { | ||
465 | ar7_led_data.num_leds = ARRAY_SIZE(fb_fon_leds); | ||
466 | ar7_led_data.leds = fb_fon_leds; | ||
467 | } else if (strstr(prid, "Fritz_Box_")) { | ||
468 | ar7_led_data.num_leds = ARRAY_SIZE(fb_sl_leds); | ||
469 | ar7_led_data.leds = fb_sl_leds; | ||
470 | } else if ((!strcmp(prid, "AR7RD") || !strcmp(prid, "AR7DB")) | ||
471 | && usb_prod != NULL && strstr(usb_prod, "DSL-502T")) { | ||
472 | ar7_led_data.num_leds = ARRAY_SIZE(dsl502t_leds); | ||
473 | ar7_led_data.leds = dsl502t_leds; | ||
474 | } else if (strstr(prid, "DG834")) { | ||
475 | ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds); | ||
476 | ar7_led_data.leds = dg834g_leds; | ||
477 | } | ||
478 | } | ||
479 | |||
480 | static int __init ar7_register_devices(void) | ||
481 | { | ||
482 | int res; | ||
483 | #ifdef CONFIG_SERIAL_8250 | ||
484 | static struct uart_port uart_port[2]; | ||
485 | |||
486 | memset(uart_port, 0, sizeof(struct uart_port) * 2); | ||
487 | |||
488 | uart_port[0].type = PORT_16550A; | ||
489 | uart_port[0].line = 0; | ||
490 | uart_port[0].irq = AR7_IRQ_UART0; | ||
491 | uart_port[0].uartclk = ar7_bus_freq() / 2; | ||
492 | uart_port[0].iotype = UPIO_MEM32; | ||
493 | uart_port[0].mapbase = AR7_REGS_UART0; | ||
494 | uart_port[0].membase = ioremap(uart_port[0].mapbase, 256); | ||
495 | uart_port[0].regshift = 2; | ||
496 | res = early_serial_setup(&uart_port[0]); | ||
497 | if (res) | ||
498 | return res; | ||
499 | |||
500 | |||
501 | /* Only TNETD73xx have a second serial port */ | ||
502 | if (ar7_has_second_uart()) { | ||
503 | uart_port[1].type = PORT_16550A; | ||
504 | uart_port[1].line = 1; | ||
505 | uart_port[1].irq = AR7_IRQ_UART1; | ||
506 | uart_port[1].uartclk = ar7_bus_freq() / 2; | ||
507 | uart_port[1].iotype = UPIO_MEM32; | ||
508 | uart_port[1].mapbase = UR8_REGS_UART1; | ||
509 | uart_port[1].membase = ioremap(uart_port[1].mapbase, 256); | ||
510 | uart_port[1].regshift = 2; | ||
511 | res = early_serial_setup(&uart_port[1]); | ||
512 | if (res) | ||
513 | return res; | ||
514 | } | ||
515 | #endif /* CONFIG_SERIAL_8250 */ | ||
516 | res = platform_device_register(&physmap_flash); | ||
517 | if (res) | ||
518 | return res; | ||
519 | |||
520 | ar7_device_disable(vlynq_low_data.reset_bit); | ||
521 | res = platform_device_register(&vlynq_low); | ||
522 | if (res) | ||
523 | return res; | ||
524 | |||
525 | if (ar7_has_high_vlynq()) { | ||
526 | ar7_device_disable(vlynq_high_data.reset_bit); | ||
527 | res = platform_device_register(&vlynq_high); | ||
528 | if (res) | ||
529 | return res; | ||
530 | } | ||
531 | |||
532 | if (ar7_has_high_cpmac()) { | ||
533 | cpmac_get_mac(1, cpmac_high_data.dev_addr); | ||
534 | res = platform_device_register(&cpmac_high); | ||
535 | if (res) | ||
536 | return res; | ||
537 | } else { | ||
538 | cpmac_low_data.phy_mask = 0xffffffff; | ||
539 | } | ||
540 | |||
541 | cpmac_get_mac(0, cpmac_low_data.dev_addr); | ||
542 | res = platform_device_register(&cpmac_low); | ||
543 | if (res) | ||
544 | return res; | ||
545 | |||
546 | detect_leds(); | ||
547 | res = platform_device_register(&ar7_gpio_leds); | ||
548 | if (res) | ||
549 | return res; | ||
550 | |||
551 | res = platform_device_register(&ar7_udc); | ||
552 | |||
553 | return res; | ||
554 | } | ||
555 | arch_initcall(ar7_register_devices); | ||
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c new file mode 100644 index 000000000000..5ad6f1db6567 --- /dev/null +++ b/arch/mips/ar7/prom.c | |||
@@ -0,0 +1,297 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * Putting things on the screen/serial line using YAMONs facilities. | ||
19 | */ | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/serial_reg.h> | ||
23 | #include <linux/spinlock.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <linux/string.h> | ||
26 | #include <linux/io.h> | ||
27 | #include <asm/bootinfo.h> | ||
28 | |||
29 | #include <asm/mach-ar7/ar7.h> | ||
30 | #include <asm/mach-ar7/prom.h> | ||
31 | |||
32 | #define MAX_ENTRY 80 | ||
33 | |||
34 | struct env_var { | ||
35 | char *name; | ||
36 | char *value; | ||
37 | }; | ||
38 | |||
39 | static struct env_var adam2_env[MAX_ENTRY]; | ||
40 | |||
41 | char *prom_getenv(const char *name) | ||
42 | { | ||
43 | int i; | ||
44 | for (i = 0; (i < MAX_ENTRY) && adam2_env[i].name; i++) | ||
45 | if (!strcmp(name, adam2_env[i].name)) | ||
46 | return adam2_env[i].value; | ||
47 | |||
48 | return NULL; | ||
49 | } | ||
50 | EXPORT_SYMBOL(prom_getenv); | ||
51 | |||
52 | char * __init prom_getcmdline(void) | ||
53 | { | ||
54 | return &(arcs_cmdline[0]); | ||
55 | } | ||
56 | |||
57 | static void __init ar7_init_cmdline(int argc, char *argv[]) | ||
58 | { | ||
59 | char *cp; | ||
60 | int actr; | ||
61 | |||
62 | actr = 1; /* Always ignore argv[0] */ | ||
63 | |||
64 | cp = &(arcs_cmdline[0]); | ||
65 | while (actr < argc) { | ||
66 | strcpy(cp, argv[actr]); | ||
67 | cp += strlen(argv[actr]); | ||
68 | *cp++ = ' '; | ||
69 | actr++; | ||
70 | } | ||
71 | if (cp != &(arcs_cmdline[0])) { | ||
72 | /* get rid of trailing space */ | ||
73 | --cp; | ||
74 | *cp = '\0'; | ||
75 | } | ||
76 | } | ||
77 | |||
78 | struct psbl_rec { | ||
79 | u32 psbl_size; | ||
80 | u32 env_base; | ||
81 | u32 env_size; | ||
82 | u32 ffs_base; | ||
83 | u32 ffs_size; | ||
84 | }; | ||
85 | |||
86 | static __initdata char psp_env_version[] = "TIENV0.8"; | ||
87 | |||
88 | struct psp_env_chunk { | ||
89 | u8 num; | ||
90 | u8 ctrl; | ||
91 | u16 csum; | ||
92 | u8 len; | ||
93 | char data[11]; | ||
94 | } __attribute__ ((packed)); | ||
95 | |||
96 | struct psp_var_map_entry { | ||
97 | u8 num; | ||
98 | char *value; | ||
99 | }; | ||
100 | |||
101 | static struct psp_var_map_entry psp_var_map[] = { | ||
102 | { 1, "cpufrequency" }, | ||
103 | { 2, "memsize" }, | ||
104 | { 3, "flashsize" }, | ||
105 | { 4, "modetty0" }, | ||
106 | { 5, "modetty1" }, | ||
107 | { 8, "maca" }, | ||
108 | { 9, "macb" }, | ||
109 | { 28, "sysfrequency" }, | ||
110 | { 38, "mipsfrequency" }, | ||
111 | }; | ||
112 | |||
113 | /* | ||
114 | |||
115 | Well-known variable (num is looked up in table above for matching variable name) | ||
116 | Example: cpufrequency=211968000 | ||
117 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
118 | | 01 |CTRL|CHECKSUM | 01 | _2 | _1 | _1 | _9 | _6 | _8 | _0 | _0 | _0 | \0 | FF | ||
119 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
120 | |||
121 | Name=Value pair in a single chunk | ||
122 | Example: NAME=VALUE | ||
123 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
124 | | 00 |CTRL|CHECKSUM | 01 | _N | _A | _M | _E | _0 | _V | _A | _L | _U | _E | \0 | ||
125 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
126 | |||
127 | Name=Value pair in 2 chunks (len is the number of chunks) | ||
128 | Example: bootloaderVersion=1.3.7.15 | ||
129 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
130 | | 00 |CTRL|CHECKSUM | 02 | _b | _o | _o | _t | _l | _o | _a | _d | _e | _r | _V | ||
131 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
132 | | _e | _r | _s | _i | _o | _n | \0 | _1 | _. | _3 | _. | _7 | _. | _1 | _5 | \0 | ||
133 | +----+----+----+----+----+----+----+----+----+----+----+----+----+----+----+--- | ||
134 | |||
135 | Data is padded with 0xFF | ||
136 | |||
137 | */ | ||
138 | |||
139 | #define PSP_ENV_SIZE 4096 | ||
140 | |||
141 | static char psp_env_data[PSP_ENV_SIZE] = { 0, }; | ||
142 | |||
143 | static char * __init lookup_psp_var_map(u8 num) | ||
144 | { | ||
145 | int i; | ||
146 | |||
147 | for (i = 0; i < ARRAY_SIZE(psp_var_map); i++) | ||
148 | if (psp_var_map[i].num == num) | ||
149 | return psp_var_map[i].value; | ||
150 | |||
151 | return NULL; | ||
152 | } | ||
153 | |||
154 | static void __init add_adam2_var(char *name, char *value) | ||
155 | { | ||
156 | int i; | ||
157 | for (i = 0; i < MAX_ENTRY; i++) { | ||
158 | if (!adam2_env[i].name) { | ||
159 | adam2_env[i].name = name; | ||
160 | adam2_env[i].value = value; | ||
161 | return; | ||
162 | } else if (!strcmp(adam2_env[i].name, name)) { | ||
163 | adam2_env[i].value = value; | ||
164 | return; | ||
165 | } | ||
166 | } | ||
167 | } | ||
168 | |||
169 | static int __init parse_psp_env(void *psp_env_base) | ||
170 | { | ||
171 | int i, n; | ||
172 | char *name, *value; | ||
173 | struct psp_env_chunk *chunks = (struct psp_env_chunk *)psp_env_data; | ||
174 | |||
175 | memcpy_fromio(chunks, psp_env_base, PSP_ENV_SIZE); | ||
176 | |||
177 | i = 1; | ||
178 | n = PSP_ENV_SIZE / sizeof(struct psp_env_chunk); | ||
179 | while (i < n) { | ||
180 | if ((chunks[i].num == 0xff) || ((i + chunks[i].len) > n)) | ||
181 | break; | ||
182 | value = chunks[i].data; | ||
183 | if (chunks[i].num) { | ||
184 | name = lookup_psp_var_map(chunks[i].num); | ||
185 | } else { | ||
186 | name = value; | ||
187 | value += strlen(name) + 1; | ||
188 | } | ||
189 | if (name) | ||
190 | add_adam2_var(name, value); | ||
191 | i += chunks[i].len; | ||
192 | } | ||
193 | return 0; | ||
194 | } | ||
195 | |||
196 | static void __init ar7_init_env(struct env_var *env) | ||
197 | { | ||
198 | int i; | ||
199 | struct psbl_rec *psbl = (struct psbl_rec *)(KSEG1ADDR(0x14000300)); | ||
200 | void *psp_env = (void *)KSEG1ADDR(psbl->env_base); | ||
201 | |||
202 | if (strcmp(psp_env, psp_env_version) == 0) { | ||
203 | parse_psp_env(psp_env); | ||
204 | } else { | ||
205 | for (i = 0; i < MAX_ENTRY; i++, env++) | ||
206 | if (env->name) | ||
207 | add_adam2_var(env->name, env->value); | ||
208 | } | ||
209 | } | ||
210 | |||
211 | static void __init console_config(void) | ||
212 | { | ||
213 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
214 | char console_string[40]; | ||
215 | int baud = 0; | ||
216 | char parity = '\0', bits = '\0', flow = '\0'; | ||
217 | char *s, *p; | ||
218 | |||
219 | if (strstr(prom_getcmdline(), "console=")) | ||
220 | return; | ||
221 | |||
222 | #ifdef CONFIG_KGDB | ||
223 | if (!strstr(prom_getcmdline(), "nokgdb")) { | ||
224 | strcat(prom_getcmdline(), " console=kgdb"); | ||
225 | kgdb_enabled = 1; | ||
226 | return; | ||
227 | } | ||
228 | #endif | ||
229 | |||
230 | s = prom_getenv("modetty0"); | ||
231 | if (s) { | ||
232 | baud = simple_strtoul(s, &p, 10); | ||
233 | s = p; | ||
234 | if (*s == ',') | ||
235 | s++; | ||
236 | if (*s) | ||
237 | parity = *s++; | ||
238 | if (*s == ',') | ||
239 | s++; | ||
240 | if (*s) | ||
241 | bits = *s++; | ||
242 | if (*s == ',') | ||
243 | s++; | ||
244 | if (*s == 'h') | ||
245 | flow = 'r'; | ||
246 | } | ||
247 | |||
248 | if (baud == 0) | ||
249 | baud = 38400; | ||
250 | if (parity != 'n' && parity != 'o' && parity != 'e') | ||
251 | parity = 'n'; | ||
252 | if (bits != '7' && bits != '8') | ||
253 | bits = '8'; | ||
254 | |||
255 | if (flow == 'r') | ||
256 | sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, | ||
257 | parity, bits, flow); | ||
258 | else | ||
259 | sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity, | ||
260 | bits); | ||
261 | strcat(prom_getcmdline(), console_string); | ||
262 | #endif | ||
263 | } | ||
264 | |||
265 | void __init prom_init(void) | ||
266 | { | ||
267 | ar7_init_cmdline(fw_arg0, (char **)fw_arg1); | ||
268 | ar7_init_env((struct env_var *)fw_arg2); | ||
269 | console_config(); | ||
270 | } | ||
271 | |||
272 | #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4))) | ||
273 | static inline unsigned int serial_in(int offset) | ||
274 | { | ||
275 | return readl((void *)PORT(offset)); | ||
276 | } | ||
277 | |||
278 | static inline void serial_out(int offset, int value) | ||
279 | { | ||
280 | writel(value, (void *)PORT(offset)); | ||
281 | } | ||
282 | |||
283 | char prom_getchar(void) | ||
284 | { | ||
285 | while (!(serial_in(UART_LSR) & UART_LSR_DR)) | ||
286 | ; | ||
287 | return serial_in(UART_RX); | ||
288 | } | ||
289 | |||
290 | int prom_putchar(char c) | ||
291 | { | ||
292 | while ((serial_in(UART_LSR) & UART_LSR_TEMT) == 0) | ||
293 | ; | ||
294 | serial_out(UART_TX, c); | ||
295 | return 1; | ||
296 | } | ||
297 | |||
diff --git a/arch/mips/ar7/setup.c b/arch/mips/ar7/setup.c new file mode 100644 index 000000000000..39f6b5b96463 --- /dev/null +++ b/arch/mips/ar7/setup.c | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | */ | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/ioport.h> | ||
20 | #include <linux/pm.h> | ||
21 | #include <linux/time.h> | ||
22 | |||
23 | #include <asm/reboot.h> | ||
24 | #include <asm/mach-ar7/ar7.h> | ||
25 | #include <asm/mach-ar7/prom.h> | ||
26 | |||
27 | static void ar7_machine_restart(char *command) | ||
28 | { | ||
29 | u32 *softres_reg = ioremap(AR7_REGS_RESET + | ||
30 | AR7_RESET_SOFTWARE, 1); | ||
31 | writel(1, softres_reg); | ||
32 | } | ||
33 | |||
34 | static void ar7_machine_halt(void) | ||
35 | { | ||
36 | while (1) | ||
37 | ; | ||
38 | } | ||
39 | |||
40 | static void ar7_machine_power_off(void) | ||
41 | { | ||
42 | u32 *power_reg = (u32 *)ioremap(AR7_REGS_POWER, 1); | ||
43 | u32 power_state = readl(power_reg) | (3 << 30); | ||
44 | writel(power_state, power_reg); | ||
45 | ar7_machine_halt(); | ||
46 | } | ||
47 | |||
48 | const char *get_system_type(void) | ||
49 | { | ||
50 | u16 chip_id = ar7_chip_id(); | ||
51 | switch (chip_id) { | ||
52 | case AR7_CHIP_7300: | ||
53 | return "TI AR7 (TNETD7300)"; | ||
54 | case AR7_CHIP_7100: | ||
55 | return "TI AR7 (TNETD7100)"; | ||
56 | case AR7_CHIP_7200: | ||
57 | return "TI AR7 (TNETD7200)"; | ||
58 | default: | ||
59 | return "TI AR7 (Unknown)"; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | static int __init ar7_init_console(void) | ||
64 | { | ||
65 | return 0; | ||
66 | } | ||
67 | console_initcall(ar7_init_console); | ||
68 | |||
69 | /* | ||
70 | * Initializes basic routines and structures pointers, memory size (as | ||
71 | * given by the bios and saves the command line. | ||
72 | */ | ||
73 | |||
74 | void __init plat_mem_setup(void) | ||
75 | { | ||
76 | unsigned long io_base; | ||
77 | |||
78 | _machine_restart = ar7_machine_restart; | ||
79 | _machine_halt = ar7_machine_halt; | ||
80 | pm_power_off = ar7_machine_power_off; | ||
81 | panic_timeout = 3; | ||
82 | |||
83 | io_base = (unsigned long)ioremap(AR7_REGS_BASE, 0x10000); | ||
84 | if (!io_base) | ||
85 | panic("Can't remap IO base!\n"); | ||
86 | set_io_port_base(io_base); | ||
87 | |||
88 | prom_meminit(); | ||
89 | |||
90 | printk(KERN_INFO "%s, ID: 0x%04x, Revision: 0x%02x\n", | ||
91 | get_system_type(), | ||
92 | ar7_chip_id(), ar7_chip_rev()); | ||
93 | } | ||
diff --git a/arch/mips/ar7/time.c b/arch/mips/ar7/time.c new file mode 100644 index 000000000000..a1fba894daa2 --- /dev/null +++ b/arch/mips/ar7/time.c | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * Setting up the clock on the MIPS boards. | ||
19 | */ | ||
20 | |||
21 | #include <linux/init.h> | ||
22 | #include <linux/time.h> | ||
23 | |||
24 | #include <asm/time.h> | ||
25 | #include <asm/mach-ar7/ar7.h> | ||
26 | |||
27 | void __init plat_time_init(void) | ||
28 | { | ||
29 | mips_hpt_frequency = ar7_cpu_freq() / 2; | ||
30 | } | ||
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c index 01b1ef94b361..4b92bfc662db 100644 --- a/arch/mips/cavium-octeon/dma-octeon.c +++ b/arch/mips/cavium-octeon/dma-octeon.c | |||
@@ -13,20 +13,327 @@ | |||
13 | */ | 13 | */ |
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/module.h> | ||
17 | #include <linux/string.h> | ||
18 | #include <linux/dma-mapping.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | #include <linux/scatterlist.h> | ||
21 | |||
22 | #include <linux/cache.h> | ||
23 | #include <linux/io.h> | ||
24 | |||
25 | #include <asm/octeon/octeon.h> | ||
26 | #include <asm/octeon/cvmx-npi-defs.h> | ||
27 | #include <asm/octeon/cvmx-pci-defs.h> | ||
16 | 28 | ||
17 | #include <dma-coherence.h> | 29 | #include <dma-coherence.h> |
18 | 30 | ||
31 | #ifdef CONFIG_PCI | ||
32 | #include <asm/octeon/pci-octeon.h> | ||
33 | #endif | ||
34 | |||
35 | #define BAR2_PCI_ADDRESS 0x8000000000ul | ||
36 | |||
37 | struct bar1_index_state { | ||
38 | int16_t ref_count; /* Number of PCI mappings using this index */ | ||
39 | uint16_t address_bits; /* Upper bits of physical address. This is | ||
40 | shifted 22 bits */ | ||
41 | }; | ||
42 | |||
43 | #ifdef CONFIG_PCI | ||
44 | static DEFINE_SPINLOCK(bar1_lock); | ||
45 | static struct bar1_index_state bar1_state[32]; | ||
46 | #endif | ||
47 | |||
19 | dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size) | 48 | dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size) |
20 | { | 49 | { |
50 | #ifndef CONFIG_PCI | ||
21 | /* Without PCI/PCIe this function can be called for Octeon internal | 51 | /* Without PCI/PCIe this function can be called for Octeon internal |
22 | devices such as USB. These devices all support 64bit addressing */ | 52 | devices such as USB. These devices all support 64bit addressing */ |
23 | mb(); | 53 | mb(); |
24 | return virt_to_phys(ptr); | 54 | return virt_to_phys(ptr); |
55 | #else | ||
56 | unsigned long flags; | ||
57 | uint64_t dma_mask; | ||
58 | int64_t start_index; | ||
59 | dma_addr_t result = -1; | ||
60 | uint64_t physical = virt_to_phys(ptr); | ||
61 | int64_t index; | ||
62 | |||
63 | mb(); | ||
64 | /* | ||
65 | * Use the DMA masks to determine the allowed memory | ||
66 | * region. For us it doesn't limit the actual memory, just the | ||
67 | * address visible over PCI. Devices with limits need to use | ||
68 | * lower indexed Bar1 entries. | ||
69 | */ | ||
70 | if (dev) { | ||
71 | dma_mask = dev->coherent_dma_mask; | ||
72 | if (dev->dma_mask) | ||
73 | dma_mask = *dev->dma_mask; | ||
74 | } else { | ||
75 | dma_mask = 0xfffffffful; | ||
76 | } | ||
77 | |||
78 | /* | ||
79 | * Platform devices, such as the internal USB, skip all | ||
80 | * translation and use Octeon physical addresses directly. | ||
81 | */ | ||
82 | if (!dev || dev->bus == &platform_bus_type) | ||
83 | return physical; | ||
84 | |||
85 | switch (octeon_dma_bar_type) { | ||
86 | case OCTEON_DMA_BAR_TYPE_PCIE: | ||
87 | if (unlikely(physical < (16ul << 10))) | ||
88 | panic("dma_map_single: Not allowed to map first 16KB." | ||
89 | " It interferes with BAR0 special area\n"); | ||
90 | else if ((physical + size >= (256ul << 20)) && | ||
91 | (physical < (512ul << 20))) | ||
92 | panic("dma_map_single: Not allowed to map bootbus\n"); | ||
93 | else if ((physical + size >= 0x400000000ull) && | ||
94 | physical < 0x410000000ull) | ||
95 | panic("dma_map_single: " | ||
96 | "Attempt to map illegal memory address 0x%llx\n", | ||
97 | physical); | ||
98 | else if (physical >= 0x420000000ull) | ||
99 | panic("dma_map_single: " | ||
100 | "Attempt to map illegal memory address 0x%llx\n", | ||
101 | physical); | ||
102 | else if ((physical + size >= | ||
103 | (4ull<<30) - (OCTEON_PCI_BAR1_HOLE_SIZE<<20)) | ||
104 | && physical < (4ull<<30)) | ||
105 | pr_warning("dma_map_single: Warning: " | ||
106 | "Mapping memory address that might " | ||
107 | "conflict with devices 0x%llx-0x%llx\n", | ||
108 | physical, physical+size-1); | ||
109 | /* The 2nd 256MB is mapped at 256<<20 instead of 0x410000000 */ | ||
110 | if ((physical >= 0x410000000ull) && physical < 0x420000000ull) | ||
111 | result = physical - 0x400000000ull; | ||
112 | else | ||
113 | result = physical; | ||
114 | if (((result+size-1) & dma_mask) != result+size-1) | ||
115 | panic("dma_map_single: Attempt to map address " | ||
116 | "0x%llx-0x%llx, which can't be accessed " | ||
117 | "according to the dma mask 0x%llx\n", | ||
118 | physical, physical+size-1, dma_mask); | ||
119 | goto done; | ||
120 | |||
121 | case OCTEON_DMA_BAR_TYPE_BIG: | ||
122 | #ifdef CONFIG_64BIT | ||
123 | /* If the device supports 64bit addressing, then use BAR2 */ | ||
124 | if (dma_mask > BAR2_PCI_ADDRESS) { | ||
125 | result = physical + BAR2_PCI_ADDRESS; | ||
126 | goto done; | ||
127 | } | ||
128 | #endif | ||
129 | if (unlikely(physical < (4ul << 10))) { | ||
130 | panic("dma_map_single: Not allowed to map first 4KB. " | ||
131 | "It interferes with BAR0 special area\n"); | ||
132 | } else if (physical < (256ul << 20)) { | ||
133 | if (unlikely(physical + size > (256ul << 20))) | ||
134 | panic("dma_map_single: Requested memory spans " | ||
135 | "Bar0 0:256MB and bootbus\n"); | ||
136 | result = physical; | ||
137 | goto done; | ||
138 | } else if (unlikely(physical < (512ul << 20))) { | ||
139 | panic("dma_map_single: Not allowed to map bootbus\n"); | ||
140 | } else if (physical < (2ul << 30)) { | ||
141 | if (unlikely(physical + size > (2ul << 30))) | ||
142 | panic("dma_map_single: Requested memory spans " | ||
143 | "Bar0 512MB:2GB and BAR1\n"); | ||
144 | result = physical; | ||
145 | goto done; | ||
146 | } else if (physical < (2ul << 30) + (128 << 20)) { | ||
147 | /* Fall through */ | ||
148 | } else if (physical < | ||
149 | (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20)) { | ||
150 | if (unlikely | ||
151 | (physical + size > | ||
152 | (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20))) | ||
153 | panic("dma_map_single: Requested memory " | ||
154 | "extends past Bar1 (4GB-%luMB)\n", | ||
155 | OCTEON_PCI_BAR1_HOLE_SIZE); | ||
156 | result = physical; | ||
157 | goto done; | ||
158 | } else if ((physical >= 0x410000000ull) && | ||
159 | (physical < 0x420000000ull)) { | ||
160 | if (unlikely(physical + size > 0x420000000ull)) | ||
161 | panic("dma_map_single: Requested memory spans " | ||
162 | "non existant memory\n"); | ||
163 | /* BAR0 fixed mapping 256MB:512MB -> | ||
164 | * 16GB+256MB:16GB+512MB */ | ||
165 | result = physical - 0x400000000ull; | ||
166 | goto done; | ||
167 | } else { | ||
168 | /* Continued below switch statement */ | ||
169 | } | ||
170 | break; | ||
171 | |||
172 | case OCTEON_DMA_BAR_TYPE_SMALL: | ||
173 | #ifdef CONFIG_64BIT | ||
174 | /* If the device supports 64bit addressing, then use BAR2 */ | ||
175 | if (dma_mask > BAR2_PCI_ADDRESS) { | ||
176 | result = physical + BAR2_PCI_ADDRESS; | ||
177 | goto done; | ||
178 | } | ||
179 | #endif | ||
180 | /* Continued below switch statement */ | ||
181 | break; | ||
182 | |||
183 | default: | ||
184 | panic("dma_map_single: Invalid octeon_dma_bar_type\n"); | ||
185 | } | ||
186 | |||
187 | /* Don't allow mapping to span multiple Bar entries. The hardware guys | ||
188 | won't guarantee that DMA across boards work */ | ||
189 | if (unlikely((physical >> 22) != ((physical + size - 1) >> 22))) | ||
190 | panic("dma_map_single: " | ||
191 | "Requested memory spans more than one Bar1 entry\n"); | ||
192 | |||
193 | if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) | ||
194 | start_index = 31; | ||
195 | else if (unlikely(dma_mask < (1ul << 27))) | ||
196 | start_index = (dma_mask >> 22); | ||
197 | else | ||
198 | start_index = 31; | ||
199 | |||
200 | /* Only one processor can access the Bar register at once */ | ||
201 | spin_lock_irqsave(&bar1_lock, flags); | ||
202 | |||
203 | /* Look through Bar1 for existing mapping that will work */ | ||
204 | for (index = start_index; index >= 0; index--) { | ||
205 | if ((bar1_state[index].address_bits == physical >> 22) && | ||
206 | (bar1_state[index].ref_count)) { | ||
207 | /* An existing mapping will work, use it */ | ||
208 | bar1_state[index].ref_count++; | ||
209 | if (unlikely(bar1_state[index].ref_count < 0)) | ||
210 | panic("dma_map_single: " | ||
211 | "Bar1[%d] reference count overflowed\n", | ||
212 | (int) index); | ||
213 | result = (index << 22) | (physical & ((1 << 22) - 1)); | ||
214 | /* Large BAR1 is offset at 2GB */ | ||
215 | if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) | ||
216 | result += 2ul << 30; | ||
217 | goto done_unlock; | ||
218 | } | ||
219 | } | ||
220 | |||
221 | /* No existing mappings, look for a free entry */ | ||
222 | for (index = start_index; index >= 0; index--) { | ||
223 | if (unlikely(bar1_state[index].ref_count == 0)) { | ||
224 | union cvmx_pci_bar1_indexx bar1_index; | ||
225 | /* We have a free entry, use it */ | ||
226 | bar1_state[index].ref_count = 1; | ||
227 | bar1_state[index].address_bits = physical >> 22; | ||
228 | bar1_index.u32 = 0; | ||
229 | /* Address bits[35:22] sent to L2C */ | ||
230 | bar1_index.s.addr_idx = physical >> 22; | ||
231 | /* Don't put PCI accesses in L2. */ | ||
232 | bar1_index.s.ca = 1; | ||
233 | /* Endian Swap Mode */ | ||
234 | bar1_index.s.end_swp = 1; | ||
235 | /* Set '1' when the selected address range is valid. */ | ||
236 | bar1_index.s.addr_v = 1; | ||
237 | octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), | ||
238 | bar1_index.u32); | ||
239 | /* An existing mapping will work, use it */ | ||
240 | result = (index << 22) | (physical & ((1 << 22) - 1)); | ||
241 | /* Large BAR1 is offset at 2GB */ | ||
242 | if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) | ||
243 | result += 2ul << 30; | ||
244 | goto done_unlock; | ||
245 | } | ||
246 | } | ||
247 | |||
248 | pr_err("dma_map_single: " | ||
249 | "Can't find empty BAR1 index for physical mapping 0x%llx\n", | ||
250 | (unsigned long long) physical); | ||
251 | |||
252 | done_unlock: | ||
253 | spin_unlock_irqrestore(&bar1_lock, flags); | ||
254 | done: | ||
255 | pr_debug("dma_map_single 0x%llx->0x%llx\n", physical, result); | ||
256 | return result; | ||
257 | #endif | ||
25 | } | 258 | } |
26 | 259 | ||
27 | void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 260 | void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) |
28 | { | 261 | { |
29 | /* Without PCI/PCIe this function can be called for Octeon internal | 262 | #ifndef CONFIG_PCI |
30 | * devices such as USB. These devices all support 64bit addressing */ | 263 | /* |
264 | * Without PCI/PCIe this function can be called for Octeon internal | ||
265 | * devices such as USB. These devices all support 64bit addressing. | ||
266 | */ | ||
267 | return; | ||
268 | #else | ||
269 | unsigned long flags; | ||
270 | uint64_t index; | ||
271 | |||
272 | /* | ||
273 | * Platform devices, such as the internal USB, skip all | ||
274 | * translation and use Octeon physical addresses directly. | ||
275 | */ | ||
276 | if (dev->bus == &platform_bus_type) | ||
277 | return; | ||
278 | |||
279 | switch (octeon_dma_bar_type) { | ||
280 | case OCTEON_DMA_BAR_TYPE_PCIE: | ||
281 | /* Nothing to do, all mappings are static */ | ||
282 | goto done; | ||
283 | |||
284 | case OCTEON_DMA_BAR_TYPE_BIG: | ||
285 | #ifdef CONFIG_64BIT | ||
286 | /* Nothing to do for addresses using BAR2 */ | ||
287 | if (dma_addr >= BAR2_PCI_ADDRESS) | ||
288 | goto done; | ||
289 | #endif | ||
290 | if (unlikely(dma_addr < (4ul << 10))) | ||
291 | panic("dma_unmap_single: Unexpect DMA address 0x%llx\n", | ||
292 | dma_addr); | ||
293 | else if (dma_addr < (2ul << 30)) | ||
294 | /* Nothing to do for addresses using BAR0 */ | ||
295 | goto done; | ||
296 | else if (dma_addr < (2ul << 30) + (128ul << 20)) | ||
297 | /* Need to unmap, fall through */ | ||
298 | index = (dma_addr - (2ul << 30)) >> 22; | ||
299 | else if (dma_addr < | ||
300 | (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20)) | ||
301 | goto done; /* Nothing to do for the rest of BAR1 */ | ||
302 | else | ||
303 | panic("dma_unmap_single: Unexpect DMA address 0x%llx\n", | ||
304 | dma_addr); | ||
305 | /* Continued below switch statement */ | ||
306 | break; | ||
307 | |||
308 | case OCTEON_DMA_BAR_TYPE_SMALL: | ||
309 | #ifdef CONFIG_64BIT | ||
310 | /* Nothing to do for addresses using BAR2 */ | ||
311 | if (dma_addr >= BAR2_PCI_ADDRESS) | ||
312 | goto done; | ||
313 | #endif | ||
314 | index = dma_addr >> 22; | ||
315 | /* Continued below switch statement */ | ||
316 | break; | ||
317 | |||
318 | default: | ||
319 | panic("dma_unmap_single: Invalid octeon_dma_bar_type\n"); | ||
320 | } | ||
321 | |||
322 | if (unlikely(index > 31)) | ||
323 | panic("dma_unmap_single: " | ||
324 | "Attempt to unmap an invalid address (0x%llx)\n", | ||
325 | dma_addr); | ||
326 | |||
327 | spin_lock_irqsave(&bar1_lock, flags); | ||
328 | bar1_state[index].ref_count--; | ||
329 | if (bar1_state[index].ref_count == 0) | ||
330 | octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), 0); | ||
331 | else if (unlikely(bar1_state[index].ref_count < 0)) | ||
332 | panic("dma_unmap_single: Bar1[%u] reference count < 0\n", | ||
333 | (int) index); | ||
334 | spin_unlock_irqrestore(&bar1_lock, flags); | ||
335 | done: | ||
336 | pr_debug("dma_unmap_single 0x%llx\n", dma_addr); | ||
31 | return; | 337 | return; |
338 | #endif | ||
32 | } | 339 | } |
diff --git a/arch/mips/cavium-octeon/executive/Makefile b/arch/mips/cavium-octeon/executive/Makefile index 80d6cb26766b..2fd66db6939e 100644 --- a/arch/mips/cavium-octeon/executive/Makefile +++ b/arch/mips/cavium-octeon/executive/Makefile | |||
@@ -11,3 +11,4 @@ | |||
11 | 11 | ||
12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o | 12 | obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o |
13 | 13 | ||
14 | obj-$(CONFIG_PCI) += cvmx-helper-errata.o cvmx-helper-jtag.o | ||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c index 4f5a08b37ccd..25666da17b22 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c +++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c | |||
@@ -31,6 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
34 | #include <linux/module.h> | ||
34 | 35 | ||
35 | #include <asm/octeon/cvmx.h> | 36 | #include <asm/octeon/cvmx.h> |
36 | #include <asm/octeon/cvmx-spinlock.h> | 37 | #include <asm/octeon/cvmx-spinlock.h> |
@@ -97,6 +98,33 @@ void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment) | |||
97 | return cvmx_bootmem_alloc_range(size, alignment, 0, 0); | 98 | return cvmx_bootmem_alloc_range(size, alignment, 0, 0); |
98 | } | 99 | } |
99 | 100 | ||
101 | void *cvmx_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr, | ||
102 | uint64_t max_addr, uint64_t align, | ||
103 | char *name) | ||
104 | { | ||
105 | int64_t addr; | ||
106 | |||
107 | addr = cvmx_bootmem_phy_named_block_alloc(size, min_addr, max_addr, | ||
108 | align, name, 0); | ||
109 | if (addr >= 0) | ||
110 | return cvmx_phys_to_ptr(addr); | ||
111 | else | ||
112 | return NULL; | ||
113 | } | ||
114 | |||
115 | void *cvmx_bootmem_alloc_named_address(uint64_t size, uint64_t address, | ||
116 | char *name) | ||
117 | { | ||
118 | return cvmx_bootmem_alloc_named_range(size, address, address + size, | ||
119 | 0, name); | ||
120 | } | ||
121 | |||
122 | void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment, char *name) | ||
123 | { | ||
124 | return cvmx_bootmem_alloc_named_range(size, 0, 0, alignment, name); | ||
125 | } | ||
126 | EXPORT_SYMBOL(cvmx_bootmem_alloc_named); | ||
127 | |||
100 | int cvmx_bootmem_free_named(char *name) | 128 | int cvmx_bootmem_free_named(char *name) |
101 | { | 129 | { |
102 | return cvmx_bootmem_phy_named_block_free(name, 0); | 130 | return cvmx_bootmem_phy_named_block_free(name, 0); |
@@ -106,6 +134,7 @@ struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name) | |||
106 | { | 134 | { |
107 | return cvmx_bootmem_phy_named_block_find(name, 0); | 135 | return cvmx_bootmem_phy_named_block_find(name, 0); |
108 | } | 136 | } |
137 | EXPORT_SYMBOL(cvmx_bootmem_find_named_block); | ||
109 | 138 | ||
110 | void cvmx_bootmem_lock(void) | 139 | void cvmx_bootmem_lock(void) |
111 | { | 140 | { |
@@ -584,3 +613,78 @@ int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags) | |||
584 | cvmx_bootmem_unlock(); | 613 | cvmx_bootmem_unlock(); |
585 | return named_block_ptr != NULL; /* 0 on failure, 1 on success */ | 614 | return named_block_ptr != NULL; /* 0 on failure, 1 on success */ |
586 | } | 615 | } |
616 | |||
617 | int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr, | ||
618 | uint64_t max_addr, | ||
619 | uint64_t alignment, | ||
620 | char *name, | ||
621 | uint32_t flags) | ||
622 | { | ||
623 | int64_t addr_allocated; | ||
624 | struct cvmx_bootmem_named_block_desc *named_block_desc_ptr; | ||
625 | |||
626 | #ifdef DEBUG | ||
627 | cvmx_dprintf("cvmx_bootmem_phy_named_block_alloc: size: 0x%llx, min: " | ||
628 | "0x%llx, max: 0x%llx, align: 0x%llx, name: %s\n", | ||
629 | (unsigned long long)size, | ||
630 | (unsigned long long)min_addr, | ||
631 | (unsigned long long)max_addr, | ||
632 | (unsigned long long)alignment, | ||
633 | name); | ||
634 | #endif | ||
635 | if (cvmx_bootmem_desc->major_version != 3) { | ||
636 | cvmx_dprintf("ERROR: Incompatible bootmem descriptor version: " | ||
637 | "%d.%d at addr: %p\n", | ||
638 | (int)cvmx_bootmem_desc->major_version, | ||
639 | (int)cvmx_bootmem_desc->minor_version, | ||
640 | cvmx_bootmem_desc); | ||
641 | return -1; | ||
642 | } | ||
643 | |||
644 | /* | ||
645 | * Take lock here, as name lookup/block alloc/name add need to | ||
646 | * be atomic. | ||
647 | */ | ||
648 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
649 | cvmx_spinlock_lock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock)); | ||
650 | |||
651 | /* Get pointer to first available named block descriptor */ | ||
652 | named_block_desc_ptr = | ||
653 | cvmx_bootmem_phy_named_block_find(NULL, | ||
654 | flags | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
655 | |||
656 | /* | ||
657 | * Check to see if name already in use, return error if name | ||
658 | * not available or no more room for blocks. | ||
659 | */ | ||
660 | if (cvmx_bootmem_phy_named_block_find(name, | ||
661 | flags | CVMX_BOOTMEM_FLAG_NO_LOCKING) || !named_block_desc_ptr) { | ||
662 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
663 | cvmx_spinlock_unlock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock)); | ||
664 | return -1; | ||
665 | } | ||
666 | |||
667 | |||
668 | /* | ||
669 | * Round size up to mult of minimum alignment bytes We need | ||
670 | * the actual size allocated to allow for blocks to be | ||
671 | * coallesced when they are freed. The alloc routine does the | ||
672 | * same rounding up on all allocations. | ||
673 | */ | ||
674 | size = __ALIGN_MASK(size, (CVMX_BOOTMEM_ALIGNMENT_SIZE - 1)); | ||
675 | |||
676 | addr_allocated = cvmx_bootmem_phy_alloc(size, min_addr, max_addr, | ||
677 | alignment, | ||
678 | flags | CVMX_BOOTMEM_FLAG_NO_LOCKING); | ||
679 | if (addr_allocated >= 0) { | ||
680 | named_block_desc_ptr->base_addr = addr_allocated; | ||
681 | named_block_desc_ptr->size = size; | ||
682 | strncpy(named_block_desc_ptr->name, name, | ||
683 | cvmx_bootmem_desc->named_block_name_len); | ||
684 | named_block_desc_ptr->name[cvmx_bootmem_desc->named_block_name_len - 1] = 0; | ||
685 | } | ||
686 | |||
687 | if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING)) | ||
688 | cvmx_spinlock_unlock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock)); | ||
689 | return addr_allocated; | ||
690 | } | ||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c b/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c new file mode 100644 index 000000000000..868659e64d4a --- /dev/null +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c | |||
@@ -0,0 +1,73 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /** | ||
29 | * | ||
30 | * Fixes and workaround for Octeon chip errata. This file | ||
31 | * contains functions called by cvmx-helper to workaround known | ||
32 | * chip errata. For the most part, code doesn't need to call | ||
33 | * these functions directly. | ||
34 | * | ||
35 | */ | ||
36 | #include <linux/module.h> | ||
37 | |||
38 | #include <asm/octeon/octeon.h> | ||
39 | |||
40 | #include <asm/octeon/cvmx-helper-jtag.h> | ||
41 | |||
42 | /** | ||
43 | * Due to errata G-720, the 2nd order CDR circuit on CN52XX pass | ||
44 | * 1 doesn't work properly. The following code disables 2nd order | ||
45 | * CDR for the specified QLM. | ||
46 | * | ||
47 | * @qlm: QLM to disable 2nd order CDR for. | ||
48 | */ | ||
49 | void __cvmx_helper_errata_qlm_disable_2nd_order_cdr(int qlm) | ||
50 | { | ||
51 | int lane; | ||
52 | cvmx_helper_qlm_jtag_init(); | ||
53 | /* We need to load all four lanes of the QLM, a total of 1072 bits */ | ||
54 | for (lane = 0; lane < 4; lane++) { | ||
55 | /* | ||
56 | * Each lane has 268 bits. We need to set | ||
57 | * cfg_cdr_incx<67:64> = 3 and cfg_cdr_secord<77> = | ||
58 | * 1. All other bits are zero. Bits go in LSB first, | ||
59 | * so start off with the zeros for bits <63:0>. | ||
60 | */ | ||
61 | cvmx_helper_qlm_jtag_shift_zeros(qlm, 63 - 0 + 1); | ||
62 | /* cfg_cdr_incx<67:64>=3 */ | ||
63 | cvmx_helper_qlm_jtag_shift(qlm, 67 - 64 + 1, 3); | ||
64 | /* Zeros for bits <76:68> */ | ||
65 | cvmx_helper_qlm_jtag_shift_zeros(qlm, 76 - 68 + 1); | ||
66 | /* cfg_cdr_secord<77>=1 */ | ||
67 | cvmx_helper_qlm_jtag_shift(qlm, 77 - 77 + 1, 1); | ||
68 | /* Zeros for bits <267:78> */ | ||
69 | cvmx_helper_qlm_jtag_shift_zeros(qlm, 267 - 78 + 1); | ||
70 | } | ||
71 | cvmx_helper_qlm_jtag_update(qlm); | ||
72 | } | ||
73 | EXPORT_SYMBOL(__cvmx_helper_errata_qlm_disable_2nd_order_cdr); | ||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c b/arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c new file mode 100644 index 000000000000..c1c54890bae0 --- /dev/null +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c | |||
@@ -0,0 +1,144 @@ | |||
1 | |||
2 | /***********************license start*************** | ||
3 | * Author: Cavium Networks | ||
4 | * | ||
5 | * Contact: support@caviumnetworks.com | ||
6 | * This file is part of the OCTEON SDK | ||
7 | * | ||
8 | * Copyright (c) 2003-2008 Cavium Networks | ||
9 | * | ||
10 | * This file is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License, Version 2, as | ||
12 | * published by the Free Software Foundation. | ||
13 | * | ||
14 | * This file is distributed in the hope that it will be useful, but | ||
15 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
16 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
17 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
18 | * details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this file; if not, write to the Free Software | ||
22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
23 | * or visit http://www.gnu.org/licenses/. | ||
24 | * | ||
25 | * This file may also be available under a different license from Cavium. | ||
26 | * Contact Cavium Networks for more information | ||
27 | ***********************license end**************************************/ | ||
28 | |||
29 | /** | ||
30 | * | ||
31 | * Helper utilities for qlm_jtag. | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | #include <asm/octeon/octeon.h> | ||
36 | #include <asm/octeon/cvmx-helper-jtag.h> | ||
37 | |||
38 | |||
39 | /** | ||
40 | * Initialize the internal QLM JTAG logic to allow programming | ||
41 | * of the JTAG chain by the cvmx_helper_qlm_jtag_*() functions. | ||
42 | * These functions should only be used at the direction of Cavium | ||
43 | * Networks. Programming incorrect values into the JTAG chain | ||
44 | * can cause chip damage. | ||
45 | */ | ||
46 | void cvmx_helper_qlm_jtag_init(void) | ||
47 | { | ||
48 | union cvmx_ciu_qlm_jtgc jtgc; | ||
49 | uint32_t clock_div = 0; | ||
50 | uint32_t divisor = cvmx_sysinfo_get()->cpu_clock_hz / (25 * 1000000); | ||
51 | divisor = (divisor - 1) >> 2; | ||
52 | /* Convert the divisor into a power of 2 shift */ | ||
53 | while (divisor) { | ||
54 | clock_div++; | ||
55 | divisor = divisor >> 1; | ||
56 | } | ||
57 | |||
58 | /* | ||
59 | * Clock divider for QLM JTAG operations. eclk is divided by | ||
60 | * 2^(CLK_DIV + 2) | ||
61 | */ | ||
62 | jtgc.u64 = 0; | ||
63 | jtgc.s.clk_div = clock_div; | ||
64 | jtgc.s.mux_sel = 0; | ||
65 | if (OCTEON_IS_MODEL(OCTEON_CN52XX)) | ||
66 | jtgc.s.bypass = 0x3; | ||
67 | else | ||
68 | jtgc.s.bypass = 0xf; | ||
69 | cvmx_write_csr(CVMX_CIU_QLM_JTGC, jtgc.u64); | ||
70 | cvmx_read_csr(CVMX_CIU_QLM_JTGC); | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * Write up to 32bits into the QLM jtag chain. Bits are shifted | ||
75 | * into the MSB and out the LSB, so you should shift in the low | ||
76 | * order bits followed by the high order bits. The JTAG chain is | ||
77 | * 4 * 268 bits long, or 1072. | ||
78 | * | ||
79 | * @qlm: QLM to shift value into | ||
80 | * @bits: Number of bits to shift in (1-32). | ||
81 | * @data: Data to shift in. Bit 0 enters the chain first, followed by | ||
82 | * bit 1, etc. | ||
83 | * | ||
84 | * Returns The low order bits of the JTAG chain that shifted out of the | ||
85 | * circle. | ||
86 | */ | ||
87 | uint32_t cvmx_helper_qlm_jtag_shift(int qlm, int bits, uint32_t data) | ||
88 | { | ||
89 | union cvmx_ciu_qlm_jtgd jtgd; | ||
90 | jtgd.u64 = 0; | ||
91 | jtgd.s.shift = 1; | ||
92 | jtgd.s.shft_cnt = bits - 1; | ||
93 | jtgd.s.shft_reg = data; | ||
94 | if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)) | ||
95 | jtgd.s.select = 1 << qlm; | ||
96 | cvmx_write_csr(CVMX_CIU_QLM_JTGD, jtgd.u64); | ||
97 | do { | ||
98 | jtgd.u64 = cvmx_read_csr(CVMX_CIU_QLM_JTGD); | ||
99 | } while (jtgd.s.shift); | ||
100 | return jtgd.s.shft_reg >> (32 - bits); | ||
101 | } | ||
102 | |||
103 | /** | ||
104 | * Shift long sequences of zeros into the QLM JTAG chain. It is | ||
105 | * common to need to shift more than 32 bits of zeros into the | ||
106 | * chain. This function is a convience wrapper around | ||
107 | * cvmx_helper_qlm_jtag_shift() to shift more than 32 bits of | ||
108 | * zeros at a time. | ||
109 | * | ||
110 | * @qlm: QLM to shift zeros into | ||
111 | * @bits: | ||
112 | */ | ||
113 | void cvmx_helper_qlm_jtag_shift_zeros(int qlm, int bits) | ||
114 | { | ||
115 | while (bits > 0) { | ||
116 | int n = bits; | ||
117 | if (n > 32) | ||
118 | n = 32; | ||
119 | cvmx_helper_qlm_jtag_shift(qlm, n, 0); | ||
120 | bits -= n; | ||
121 | } | ||
122 | } | ||
123 | |||
124 | /** | ||
125 | * Program the QLM JTAG chain into all lanes of the QLM. You must | ||
126 | * have already shifted in 268*4, or 1072 bits into the JTAG | ||
127 | * chain. Updating invalid values can possibly cause chip damage. | ||
128 | * | ||
129 | * @qlm: QLM to program | ||
130 | */ | ||
131 | void cvmx_helper_qlm_jtag_update(int qlm) | ||
132 | { | ||
133 | union cvmx_ciu_qlm_jtgd jtgd; | ||
134 | |||
135 | /* Update the new data */ | ||
136 | jtgd.u64 = 0; | ||
137 | jtgd.s.update = 1; | ||
138 | if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)) | ||
139 | jtgd.s.select = 1 << qlm; | ||
140 | cvmx_write_csr(CVMX_CIU_QLM_JTGD, jtgd.u64); | ||
141 | do { | ||
142 | jtgd.u64 = cvmx_read_csr(CVMX_CIU_QLM_JTGD); | ||
143 | } while (jtgd.s.update); | ||
144 | } | ||
diff --git a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c index 4812370706a1..e5838890cba5 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c +++ b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c | |||
@@ -29,6 +29,7 @@ | |||
29 | * This module provides system/board/application information obtained | 29 | * This module provides system/board/application information obtained |
30 | * by the bootloader. | 30 | * by the bootloader. |
31 | */ | 31 | */ |
32 | #include <linux/module.h> | ||
32 | 33 | ||
33 | #include <asm/octeon/cvmx.h> | 34 | #include <asm/octeon/cvmx.h> |
34 | #include <asm/octeon/cvmx-spinlock.h> | 35 | #include <asm/octeon/cvmx-spinlock.h> |
@@ -69,6 +70,7 @@ struct cvmx_sysinfo *cvmx_sysinfo_get(void) | |||
69 | { | 70 | { |
70 | return &(state.sysinfo); | 71 | return &(state.sysinfo); |
71 | } | 72 | } |
73 | EXPORT_SYMBOL(cvmx_sysinfo_get); | ||
72 | 74 | ||
73 | /** | 75 | /** |
74 | * This function is used in non-simple executive environments (such as | 76 | * This function is used in non-simple executive environments (such as |
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index d3a0c8154bec..384f1842bfb1 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -7,9 +7,11 @@ | |||
7 | */ | 7 | */ |
8 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
9 | #include <linux/interrupt.h> | 9 | #include <linux/interrupt.h> |
10 | #include <linux/hardirq.h> | 10 | #include <linux/smp.h> |
11 | 11 | ||
12 | #include <asm/octeon/octeon.h> | 12 | #include <asm/octeon/octeon.h> |
13 | #include <asm/octeon/cvmx-pexp-defs.h> | ||
14 | #include <asm/octeon/cvmx-npi-defs.h> | ||
13 | 15 | ||
14 | DEFINE_RWLOCK(octeon_irq_ciu0_rwlock); | 16 | DEFINE_RWLOCK(octeon_irq_ciu0_rwlock); |
15 | DEFINE_RWLOCK(octeon_irq_ciu1_rwlock); | 17 | DEFINE_RWLOCK(octeon_irq_ciu1_rwlock); |
@@ -499,3 +501,62 @@ asmlinkage void plat_irq_dispatch(void) | |||
499 | } | 501 | } |
500 | } | 502 | } |
501 | } | 503 | } |
504 | |||
505 | #ifdef CONFIG_HOTPLUG_CPU | ||
506 | static int is_irq_enabled_on_cpu(unsigned int irq, unsigned int cpu) | ||
507 | { | ||
508 | unsigned int isset; | ||
509 | #ifdef CONFIG_SMP | ||
510 | int coreid = cpu_logical_map(cpu); | ||
511 | #else | ||
512 | int coreid = cvmx_get_core_num(); | ||
513 | #endif | ||
514 | int bit = (irq < OCTEON_IRQ_WDOG0) ? | ||
515 | irq - OCTEON_IRQ_WORKQ0 : irq - OCTEON_IRQ_WDOG0; | ||
516 | if (irq < 64) { | ||
517 | isset = (cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2)) & | ||
518 | (1ull << bit)) >> bit; | ||
519 | } else { | ||
520 | isset = (cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1)) & | ||
521 | (1ull << bit)) >> bit; | ||
522 | } | ||
523 | return isset; | ||
524 | } | ||
525 | |||
526 | void fixup_irqs(void) | ||
527 | { | ||
528 | int irq; | ||
529 | |||
530 | for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++) | ||
531 | octeon_irq_core_disable_local(irq); | ||
532 | |||
533 | for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_GPIO15; irq++) { | ||
534 | if (is_irq_enabled_on_cpu(irq, smp_processor_id())) { | ||
535 | /* ciu irq migrates to next cpu */ | ||
536 | octeon_irq_chip_ciu0.disable(irq); | ||
537 | octeon_irq_ciu0_set_affinity(irq, &cpu_online_map); | ||
538 | } | ||
539 | } | ||
540 | |||
541 | #if 0 | ||
542 | for (irq = OCTEON_IRQ_MBOX0; irq <= OCTEON_IRQ_MBOX1; irq++) | ||
543 | octeon_irq_mailbox_mask(irq); | ||
544 | #endif | ||
545 | for (irq = OCTEON_IRQ_UART0; irq <= OCTEON_IRQ_BOOTDMA; irq++) { | ||
546 | if (is_irq_enabled_on_cpu(irq, smp_processor_id())) { | ||
547 | /* ciu irq migrates to next cpu */ | ||
548 | octeon_irq_chip_ciu0.disable(irq); | ||
549 | octeon_irq_ciu0_set_affinity(irq, &cpu_online_map); | ||
550 | } | ||
551 | } | ||
552 | |||
553 | for (irq = OCTEON_IRQ_UART2; irq <= OCTEON_IRQ_RESERVED135; irq++) { | ||
554 | if (is_irq_enabled_on_cpu(irq, smp_processor_id())) { | ||
555 | /* ciu irq migrates to next cpu */ | ||
556 | octeon_irq_chip_ciu1.disable(irq); | ||
557 | octeon_irq_ciu1_set_affinity(irq, &cpu_online_map); | ||
558 | } | ||
559 | } | ||
560 | } | ||
561 | |||
562 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
diff --git a/arch/mips/cavium-octeon/octeon_boot.h b/arch/mips/cavium-octeon/octeon_boot.h new file mode 100644 index 000000000000..0f7f84accf9a --- /dev/null +++ b/arch/mips/cavium-octeon/octeon_boot.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * (C) Copyright 2004, 2005 Cavium Networks | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation; either version 2 of | ||
7 | * the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
17 | * MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __OCTEON_BOOT_H__ | ||
21 | #define __OCTEON_BOOT_H__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | struct boot_init_vector { | ||
26 | uint32_t stack_addr; | ||
27 | uint32_t code_addr; | ||
28 | uint32_t app_start_func_addr; | ||
29 | uint32_t k0_val; | ||
30 | uint32_t flags; | ||
31 | uint32_t boot_info_addr; | ||
32 | uint32_t pad; | ||
33 | uint32_t pad2; | ||
34 | }; | ||
35 | |||
36 | /* similar to bootloader's linux_app_boot_info but without global data */ | ||
37 | struct linux_app_boot_info { | ||
38 | uint32_t labi_signature; | ||
39 | uint32_t start_core0_addr; | ||
40 | uint32_t avail_coremask; | ||
41 | uint32_t pci_console_active; | ||
42 | uint32_t icache_prefetch_disable; | ||
43 | uint32_t InitTLBStart_addr; | ||
44 | uint32_t start_app_addr; | ||
45 | uint32_t cur_exception_base; | ||
46 | uint32_t no_mark_private_data; | ||
47 | uint32_t compact_flash_common_base_addr; | ||
48 | uint32_t compact_flash_attribute_base_addr; | ||
49 | uint32_t led_display_base_addr; | ||
50 | }; | ||
51 | |||
52 | /* If not to copy a lot of bootloader's structures | ||
53 | here is only offset of requested member */ | ||
54 | #define AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK 0x765c | ||
55 | |||
56 | /* hardcoded in bootloader */ | ||
57 | #define LABI_ADDR_IN_BOOTLOADER 0x700 | ||
58 | |||
59 | #define LINUX_APP_BOOT_BLOCK_NAME "linux-app-boot" | ||
60 | |||
61 | #define LABI_SIGNATURE 0xAABBCCDD | ||
62 | |||
63 | /* from uboot-headers/octeon_mem_map.h */ | ||
64 | #define EXCEPTION_BASE_INCR (4 * 1024) | ||
65 | /* Increment size for exception base addresses (4k minimum) */ | ||
66 | #define EXCEPTION_BASE_BASE 0 | ||
67 | #define BOOTLOADER_PRIV_DATA_BASE (EXCEPTION_BASE_BASE + 0x800) | ||
68 | #define BOOTLOADER_BOOT_VECTOR (BOOTLOADER_PRIV_DATA_BASE) | ||
69 | |||
70 | #endif /* __OCTEON_BOOT_H__ */ | ||
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index 5f4e49ba4713..da559249cc2f 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/serial.h> | 15 | #include <linux/serial.h> |
16 | #include <linux/smp.h> | ||
16 | #include <linux/types.h> | 17 | #include <linux/types.h> |
17 | #include <linux/string.h> /* for memset */ | 18 | #include <linux/string.h> /* for memset */ |
18 | #include <linux/tty.h> | 19 | #include <linux/tty.h> |
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c index 24e0ad63980a..32d51a31dc48 100644 --- a/arch/mips/cavium-octeon/smp.c +++ b/arch/mips/cavium-octeon/smp.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (C) 2004-2008 Cavium Networks | 6 | * Copyright (C) 2004-2008 Cavium Networks |
7 | */ | 7 | */ |
8 | #include <linux/cpu.h> | ||
8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
9 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
10 | #include <linux/smp.h> | 11 | #include <linux/smp.h> |
@@ -19,10 +20,16 @@ | |||
19 | 20 | ||
20 | #include <asm/octeon/octeon.h> | 21 | #include <asm/octeon/octeon.h> |
21 | 22 | ||
23 | #include "octeon_boot.h" | ||
24 | |||
22 | volatile unsigned long octeon_processor_boot = 0xff; | 25 | volatile unsigned long octeon_processor_boot = 0xff; |
23 | volatile unsigned long octeon_processor_sp; | 26 | volatile unsigned long octeon_processor_sp; |
24 | volatile unsigned long octeon_processor_gp; | 27 | volatile unsigned long octeon_processor_gp; |
25 | 28 | ||
29 | #ifdef CONFIG_HOTPLUG_CPU | ||
30 | static unsigned int InitTLBStart_addr; | ||
31 | #endif | ||
32 | |||
26 | static irqreturn_t mailbox_interrupt(int irq, void *dev_id) | 33 | static irqreturn_t mailbox_interrupt(int irq, void *dev_id) |
27 | { | 34 | { |
28 | const int coreid = cvmx_get_core_num(); | 35 | const int coreid = cvmx_get_core_num(); |
@@ -67,8 +74,28 @@ static inline void octeon_send_ipi_mask(cpumask_t mask, unsigned int action) | |||
67 | } | 74 | } |
68 | 75 | ||
69 | /** | 76 | /** |
70 | * Detect available CPUs, populate phys_cpu_present_map | 77 | * Detect available CPUs, populate cpu_possible_map |
71 | */ | 78 | */ |
79 | static void octeon_smp_hotplug_setup(void) | ||
80 | { | ||
81 | #ifdef CONFIG_HOTPLUG_CPU | ||
82 | uint32_t labi_signature; | ||
83 | |||
84 | labi_signature = | ||
85 | cvmx_read64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
86 | LABI_ADDR_IN_BOOTLOADER + | ||
87 | offsetof(struct linux_app_boot_info, | ||
88 | labi_signature))); | ||
89 | if (labi_signature != LABI_SIGNATURE) | ||
90 | pr_err("The bootloader version on this board is incorrect\n"); | ||
91 | InitTLBStart_addr = | ||
92 | cvmx_read64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
93 | LABI_ADDR_IN_BOOTLOADER + | ||
94 | offsetof(struct linux_app_boot_info, | ||
95 | InitTLBStart_addr))); | ||
96 | #endif | ||
97 | } | ||
98 | |||
72 | static void octeon_smp_setup(void) | 99 | static void octeon_smp_setup(void) |
73 | { | 100 | { |
74 | const int coreid = cvmx_get_core_num(); | 101 | const int coreid = cvmx_get_core_num(); |
@@ -91,6 +118,9 @@ static void octeon_smp_setup(void) | |||
91 | cpus++; | 118 | cpus++; |
92 | } | 119 | } |
93 | } | 120 | } |
121 | cpu_present_map = cpu_possible_map; | ||
122 | |||
123 | octeon_smp_hotplug_setup(); | ||
94 | } | 124 | } |
95 | 125 | ||
96 | /** | 126 | /** |
@@ -128,6 +158,17 @@ static void octeon_init_secondary(void) | |||
128 | const int coreid = cvmx_get_core_num(); | 158 | const int coreid = cvmx_get_core_num(); |
129 | union cvmx_ciu_intx_sum0 interrupt_enable; | 159 | union cvmx_ciu_intx_sum0 interrupt_enable; |
130 | 160 | ||
161 | #ifdef CONFIG_HOTPLUG_CPU | ||
162 | unsigned int cur_exception_base; | ||
163 | |||
164 | cur_exception_base = cvmx_read64_uint32( | ||
165 | CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
166 | LABI_ADDR_IN_BOOTLOADER + | ||
167 | offsetof(struct linux_app_boot_info, | ||
168 | cur_exception_base))); | ||
169 | /* cur_exception_base is incremented in bootloader after setting */ | ||
170 | write_c0_ebase((unsigned int)(cur_exception_base - EXCEPTION_BASE_INCR)); | ||
171 | #endif | ||
131 | octeon_check_cpu_bist(); | 172 | octeon_check_cpu_bist(); |
132 | octeon_init_cvmcount(); | 173 | octeon_init_cvmcount(); |
133 | /* | 174 | /* |
@@ -153,11 +194,11 @@ static void octeon_init_secondary(void) | |||
153 | void octeon_prepare_cpus(unsigned int max_cpus) | 194 | void octeon_prepare_cpus(unsigned int max_cpus) |
154 | { | 195 | { |
155 | cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff); | 196 | cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff); |
156 | if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_SHARED, | 197 | if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_DISABLED, |
157 | "mailbox0", mailbox_interrupt)) { | 198 | "mailbox0", mailbox_interrupt)) { |
158 | panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n"); | 199 | panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n"); |
159 | } | 200 | } |
160 | if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_SHARED, | 201 | if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_DISABLED, |
161 | "mailbox1", mailbox_interrupt)) { | 202 | "mailbox1", mailbox_interrupt)) { |
162 | panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n"); | 203 | panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n"); |
163 | } | 204 | } |
@@ -199,6 +240,193 @@ static void octeon_cpus_done(void) | |||
199 | #endif | 240 | #endif |
200 | } | 241 | } |
201 | 242 | ||
243 | #ifdef CONFIG_HOTPLUG_CPU | ||
244 | |||
245 | /* State of each CPU. */ | ||
246 | DEFINE_PER_CPU(int, cpu_state); | ||
247 | |||
248 | extern void fixup_irqs(void); | ||
249 | |||
250 | static DEFINE_SPINLOCK(smp_reserve_lock); | ||
251 | |||
252 | static int octeon_cpu_disable(void) | ||
253 | { | ||
254 | unsigned int cpu = smp_processor_id(); | ||
255 | |||
256 | if (cpu == 0) | ||
257 | return -EBUSY; | ||
258 | |||
259 | spin_lock(&smp_reserve_lock); | ||
260 | |||
261 | cpu_clear(cpu, cpu_online_map); | ||
262 | cpu_clear(cpu, cpu_callin_map); | ||
263 | local_irq_disable(); | ||
264 | fixup_irqs(); | ||
265 | local_irq_enable(); | ||
266 | |||
267 | flush_cache_all(); | ||
268 | local_flush_tlb_all(); | ||
269 | |||
270 | spin_unlock(&smp_reserve_lock); | ||
271 | |||
272 | return 0; | ||
273 | } | ||
274 | |||
275 | static void octeon_cpu_die(unsigned int cpu) | ||
276 | { | ||
277 | int coreid = cpu_logical_map(cpu); | ||
278 | uint32_t avail_coremask; | ||
279 | struct cvmx_bootmem_named_block_desc *block_desc; | ||
280 | |||
281 | #ifdef CONFIG_CAVIUM_OCTEON_WATCHDOG | ||
282 | /* Disable the watchdog */ | ||
283 | cvmx_ciu_wdogx_t ciu_wdog; | ||
284 | ciu_wdog.u64 = cvmx_read_csr(CVMX_CIU_WDOGX(cpu)); | ||
285 | ciu_wdog.s.mode = 0; | ||
286 | cvmx_write_csr(CVMX_CIU_WDOGX(cpu), ciu_wdog.u64); | ||
287 | #endif | ||
288 | |||
289 | while (per_cpu(cpu_state, cpu) != CPU_DEAD) | ||
290 | cpu_relax(); | ||
291 | |||
292 | /* | ||
293 | * This is a bit complicated strategics of getting/settig available | ||
294 | * cores mask, copied from bootloader | ||
295 | */ | ||
296 | /* LINUX_APP_BOOT_BLOCK is initialized in bootoct binary */ | ||
297 | block_desc = cvmx_bootmem_find_named_block(LINUX_APP_BOOT_BLOCK_NAME); | ||
298 | |||
299 | if (!block_desc) { | ||
300 | avail_coremask = | ||
301 | cvmx_read64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
302 | LABI_ADDR_IN_BOOTLOADER + | ||
303 | offsetof | ||
304 | (struct linux_app_boot_info, | ||
305 | avail_coremask))); | ||
306 | } else { /* alternative, already initialized */ | ||
307 | avail_coremask = | ||
308 | cvmx_read64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
309 | block_desc->base_addr + | ||
310 | AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK)); | ||
311 | } | ||
312 | |||
313 | avail_coremask |= 1 << coreid; | ||
314 | |||
315 | /* Setting avail_coremask for bootoct binary */ | ||
316 | if (!block_desc) { | ||
317 | cvmx_write64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
318 | LABI_ADDR_IN_BOOTLOADER + | ||
319 | offsetof(struct linux_app_boot_info, | ||
320 | avail_coremask)), | ||
321 | avail_coremask); | ||
322 | } else { | ||
323 | cvmx_write64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
324 | block_desc->base_addr + | ||
325 | AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK), | ||
326 | avail_coremask); | ||
327 | } | ||
328 | |||
329 | pr_info("Reset core %d. Available Coremask = %x \n", coreid, | ||
330 | avail_coremask); | ||
331 | cvmx_write_csr(CVMX_CIU_PP_RST, 1 << coreid); | ||
332 | cvmx_write_csr(CVMX_CIU_PP_RST, 0); | ||
333 | } | ||
334 | |||
335 | void play_dead(void) | ||
336 | { | ||
337 | int coreid = cvmx_get_core_num(); | ||
338 | |||
339 | idle_task_exit(); | ||
340 | octeon_processor_boot = 0xff; | ||
341 | per_cpu(cpu_state, coreid) = CPU_DEAD; | ||
342 | |||
343 | while (1) /* core will be reset here */ | ||
344 | ; | ||
345 | } | ||
346 | |||
347 | extern void kernel_entry(unsigned long arg1, ...); | ||
348 | |||
349 | static void start_after_reset(void) | ||
350 | { | ||
351 | kernel_entry(0, 0, 0); /* set a2 = 0 for secondary core */ | ||
352 | } | ||
353 | |||
354 | int octeon_update_boot_vector(unsigned int cpu) | ||
355 | { | ||
356 | |||
357 | int coreid = cpu_logical_map(cpu); | ||
358 | unsigned int avail_coremask; | ||
359 | struct cvmx_bootmem_named_block_desc *block_desc; | ||
360 | struct boot_init_vector *boot_vect = | ||
361 | (struct boot_init_vector *) cvmx_phys_to_ptr(0x0 + | ||
362 | BOOTLOADER_BOOT_VECTOR); | ||
363 | |||
364 | block_desc = cvmx_bootmem_find_named_block(LINUX_APP_BOOT_BLOCK_NAME); | ||
365 | |||
366 | if (!block_desc) { | ||
367 | avail_coremask = | ||
368 | cvmx_read64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
369 | LABI_ADDR_IN_BOOTLOADER + | ||
370 | offsetof(struct linux_app_boot_info, | ||
371 | avail_coremask))); | ||
372 | } else { /* alternative, already initialized */ | ||
373 | avail_coremask = | ||
374 | cvmx_read64_uint32(CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, | ||
375 | block_desc->base_addr + | ||
376 | AVAIL_COREMASK_OFFSET_IN_LINUX_APP_BOOT_BLOCK)); | ||
377 | } | ||
378 | |||
379 | if (!(avail_coremask & (1 << coreid))) { | ||
380 | /* core not available, assume, that catched by simple-executive */ | ||
381 | cvmx_write_csr(CVMX_CIU_PP_RST, 1 << coreid); | ||
382 | cvmx_write_csr(CVMX_CIU_PP_RST, 0); | ||
383 | } | ||
384 | |||
385 | boot_vect[coreid].app_start_func_addr = | ||
386 | (uint32_t) (unsigned long) start_after_reset; | ||
387 | boot_vect[coreid].code_addr = InitTLBStart_addr; | ||
388 | |||
389 | CVMX_SYNC; | ||
390 | |||
391 | cvmx_write_csr(CVMX_CIU_NMI, (1 << coreid) & avail_coremask); | ||
392 | |||
393 | return 0; | ||
394 | } | ||
395 | |||
396 | static int __cpuinit octeon_cpu_callback(struct notifier_block *nfb, | ||
397 | unsigned long action, void *hcpu) | ||
398 | { | ||
399 | unsigned int cpu = (unsigned long)hcpu; | ||
400 | |||
401 | switch (action) { | ||
402 | case CPU_UP_PREPARE: | ||
403 | octeon_update_boot_vector(cpu); | ||
404 | break; | ||
405 | case CPU_ONLINE: | ||
406 | pr_info("Cpu %d online\n", cpu); | ||
407 | break; | ||
408 | case CPU_DEAD: | ||
409 | break; | ||
410 | } | ||
411 | |||
412 | return NOTIFY_OK; | ||
413 | } | ||
414 | |||
415 | static struct notifier_block __cpuinitdata octeon_cpu_notifier = { | ||
416 | .notifier_call = octeon_cpu_callback, | ||
417 | }; | ||
418 | |||
419 | static int __cpuinit register_cavium_notifier(void) | ||
420 | { | ||
421 | register_hotcpu_notifier(&octeon_cpu_notifier); | ||
422 | |||
423 | return 0; | ||
424 | } | ||
425 | |||
426 | late_initcall(register_cavium_notifier); | ||
427 | |||
428 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
429 | |||
202 | struct plat_smp_ops octeon_smp_ops = { | 430 | struct plat_smp_ops octeon_smp_ops = { |
203 | .send_ipi_single = octeon_send_ipi_single, | 431 | .send_ipi_single = octeon_send_ipi_single, |
204 | .send_ipi_mask = octeon_send_ipi_mask, | 432 | .send_ipi_mask = octeon_send_ipi_mask, |
@@ -208,4 +436,8 @@ struct plat_smp_ops octeon_smp_ops = { | |||
208 | .boot_secondary = octeon_boot_secondary, | 436 | .boot_secondary = octeon_boot_secondary, |
209 | .smp_setup = octeon_smp_setup, | 437 | .smp_setup = octeon_smp_setup, |
210 | .prepare_cpus = octeon_prepare_cpus, | 438 | .prepare_cpus = octeon_prepare_cpus, |
439 | #ifdef CONFIG_HOTPLUG_CPU | ||
440 | .cpu_disable = octeon_cpu_disable, | ||
441 | .cpu_die = octeon_cpu_die, | ||
442 | #endif | ||
211 | }; | 443 | }; |
diff --git a/arch/mips/cobalt/buttons.c b/arch/mips/cobalt/buttons.c index 9e143989c7b8..4eaec8b46e0c 100644 --- a/arch/mips/cobalt/buttons.c +++ b/arch/mips/cobalt/buttons.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Cobalt buttons platform device. | 2 | * Cobalt buttons platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/cobalt/lcd.c b/arch/mips/cobalt/lcd.c index 0720e4fae311..0f1cd90f37ed 100644 --- a/arch/mips/cobalt/lcd.c +++ b/arch/mips/cobalt/lcd.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Registration of Cobalt LCD platform device. | 2 | * Registration of Cobalt LCD platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/cobalt/led.c b/arch/mips/cobalt/led.c index 1c6ebd468b07..d3ce6fa1dc74 100644 --- a/arch/mips/cobalt/led.c +++ b/arch/mips/cobalt/led.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Registration of Cobalt LED platform device. | 2 | * Registration of Cobalt LED platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/cobalt/mtd.c b/arch/mips/cobalt/mtd.c index 2b088ef3839a..691d620b6766 100644 --- a/arch/mips/cobalt/mtd.c +++ b/arch/mips/cobalt/mtd.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Registration of Cobalt MTD device. | 2 | * Registration of Cobalt MTD device. |
3 | * | 3 | * |
4 | * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2006 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/cobalt/rtc.c b/arch/mips/cobalt/rtc.c index e70794b8bcba..3ab39898b4e4 100644 --- a/arch/mips/cobalt/rtc.c +++ b/arch/mips/cobalt/rtc.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Registration of Cobalt RTC platform device. | 2 | * Registration of Cobalt RTC platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/cobalt/serial.c b/arch/mips/cobalt/serial.c index 53b8d0d6da90..7cb51f57275e 100644 --- a/arch/mips/cobalt/serial.c +++ b/arch/mips/cobalt/serial.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Registration of Cobalt UART platform device. | 2 | * Registration of Cobalt UART platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c index 4a570e7145fe..0162f9edc693 100644 --- a/arch/mips/cobalt/time.c +++ b/arch/mips/cobalt/time.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Cobalt time initialization. | 2 | * Cobalt time initialization. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/configs/ar7_defconfig b/arch/mips/configs/ar7_defconfig new file mode 100644 index 000000000000..dad5b6769d74 --- /dev/null +++ b/arch/mips/configs/ar7_defconfig | |||
@@ -0,0 +1,1182 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.30 | ||
4 | # Wed Jun 24 14:08:59 2009 | ||
5 | # | ||
6 | CONFIG_MIPS=y | ||
7 | |||
8 | # | ||
9 | # Machine selection | ||
10 | # | ||
11 | # CONFIG_MACH_ALCHEMY is not set | ||
12 | CONFIG_AR7=y | ||
13 | # CONFIG_BASLER_EXCITE is not set | ||
14 | # CONFIG_BCM47XX is not set | ||
15 | # CONFIG_MIPS_COBALT is not set | ||
16 | # CONFIG_MACH_DECSTATION is not set | ||
17 | # CONFIG_MACH_JAZZ is not set | ||
18 | # CONFIG_LASAT is not set | ||
19 | # CONFIG_LEMOTE_FULONG is not set | ||
20 | # CONFIG_MIPS_MALTA is not set | ||
21 | # CONFIG_MIPS_SIM is not set | ||
22 | # CONFIG_NEC_MARKEINS is not set | ||
23 | # CONFIG_MACH_VR41XX is not set | ||
24 | # CONFIG_NXP_STB220 is not set | ||
25 | # CONFIG_NXP_STB225 is not set | ||
26 | # CONFIG_PNX8550_JBS is not set | ||
27 | # CONFIG_PNX8550_STB810 is not set | ||
28 | # CONFIG_PMC_MSP is not set | ||
29 | # CONFIG_PMC_YOSEMITE is not set | ||
30 | # CONFIG_SGI_IP22 is not set | ||
31 | # CONFIG_SGI_IP27 is not set | ||
32 | # CONFIG_SGI_IP28 is not set | ||
33 | # CONFIG_SGI_IP32 is not set | ||
34 | # CONFIG_SIBYTE_CRHINE is not set | ||
35 | # CONFIG_SIBYTE_CARMEL is not set | ||
36 | # CONFIG_SIBYTE_CRHONE is not set | ||
37 | # CONFIG_SIBYTE_RHONE is not set | ||
38 | # CONFIG_SIBYTE_SWARM is not set | ||
39 | # CONFIG_SIBYTE_LITTLESUR is not set | ||
40 | # CONFIG_SIBYTE_SENTOSA is not set | ||
41 | # CONFIG_SIBYTE_BIGSUR is not set | ||
42 | # CONFIG_SNI_RM is not set | ||
43 | # CONFIG_MACH_TX39XX is not set | ||
44 | # CONFIG_MACH_TX49XX is not set | ||
45 | # CONFIG_MIKROTIK_RB532 is not set | ||
46 | # CONFIG_WR_PPMC is not set | ||
47 | # CONFIG_CAVIUM_OCTEON_SIMULATOR is not set | ||
48 | # CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set | ||
49 | # CONFIG_ALCHEMY_GPIO_INDIRECT is not set | ||
50 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
51 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | ||
52 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | ||
53 | CONFIG_ARCH_SUPPORTS_OPROFILE=y | ||
54 | CONFIG_GENERIC_FIND_NEXT_BIT=y | ||
55 | CONFIG_GENERIC_HWEIGHT=y | ||
56 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
57 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
58 | CONFIG_GENERIC_TIME=y | ||
59 | CONFIG_GENERIC_CMOS_UPDATE=y | ||
60 | CONFIG_SCHED_OMIT_FRAME_POINTER=y | ||
61 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
62 | CONFIG_CEVT_R4K_LIB=y | ||
63 | CONFIG_CEVT_R4K=y | ||
64 | CONFIG_CSRC_R4K_LIB=y | ||
65 | CONFIG_CSRC_R4K=y | ||
66 | CONFIG_DMA_NONCOHERENT=y | ||
67 | CONFIG_DMA_NEED_PCI_MAP_STATE=y | ||
68 | CONFIG_EARLY_PRINTK=y | ||
69 | CONFIG_SYS_HAS_EARLY_PRINTK=y | ||
70 | # CONFIG_HOTPLUG_CPU is not set | ||
71 | # CONFIG_NO_IOPORT is not set | ||
72 | CONFIG_GENERIC_GPIO=y | ||
73 | # CONFIG_CPU_BIG_ENDIAN is not set | ||
74 | CONFIG_CPU_LITTLE_ENDIAN=y | ||
75 | CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y | ||
76 | CONFIG_IRQ_CPU=y | ||
77 | CONFIG_NO_EXCEPT_FILL=y | ||
78 | CONFIG_SWAP_IO_SPACE=y | ||
79 | CONFIG_BOOT_ELF32=y | ||
80 | CONFIG_MIPS_L1_CACHE_SHIFT=5 | ||
81 | |||
82 | # | ||
83 | # CPU selection | ||
84 | # | ||
85 | # CONFIG_CPU_LOONGSON2 is not set | ||
86 | CONFIG_CPU_MIPS32_R1=y | ||
87 | # CONFIG_CPU_MIPS32_R2 is not set | ||
88 | # CONFIG_CPU_MIPS64_R1 is not set | ||
89 | # CONFIG_CPU_MIPS64_R2 is not set | ||
90 | # CONFIG_CPU_R3000 is not set | ||
91 | # CONFIG_CPU_TX39XX is not set | ||
92 | # CONFIG_CPU_VR41XX is not set | ||
93 | # CONFIG_CPU_R4300 is not set | ||
94 | # CONFIG_CPU_R4X00 is not set | ||
95 | # CONFIG_CPU_TX49XX is not set | ||
96 | # CONFIG_CPU_R5000 is not set | ||
97 | # CONFIG_CPU_R5432 is not set | ||
98 | # CONFIG_CPU_R5500 is not set | ||
99 | # CONFIG_CPU_R6000 is not set | ||
100 | # CONFIG_CPU_NEVADA is not set | ||
101 | # CONFIG_CPU_R8000 is not set | ||
102 | # CONFIG_CPU_R10000 is not set | ||
103 | # CONFIG_CPU_RM7000 is not set | ||
104 | # CONFIG_CPU_RM9000 is not set | ||
105 | # CONFIG_CPU_SB1 is not set | ||
106 | # CONFIG_CPU_CAVIUM_OCTEON is not set | ||
107 | CONFIG_SYS_HAS_CPU_MIPS32_R1=y | ||
108 | CONFIG_CPU_MIPS32=y | ||
109 | CONFIG_CPU_MIPSR1=y | ||
110 | CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y | ||
111 | CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y | ||
112 | CONFIG_HARDWARE_WATCHPOINTS=y | ||
113 | |||
114 | # | ||
115 | # Kernel type | ||
116 | # | ||
117 | CONFIG_32BIT=y | ||
118 | # CONFIG_64BIT is not set | ||
119 | CONFIG_PAGE_SIZE_4KB=y | ||
120 | # CONFIG_PAGE_SIZE_8KB is not set | ||
121 | # CONFIG_PAGE_SIZE_16KB is not set | ||
122 | # CONFIG_PAGE_SIZE_32KB is not set | ||
123 | # CONFIG_PAGE_SIZE_64KB is not set | ||
124 | CONFIG_CPU_HAS_PREFETCH=y | ||
125 | CONFIG_MIPS_MT_DISABLED=y | ||
126 | # CONFIG_MIPS_MT_SMP is not set | ||
127 | # CONFIG_MIPS_MT_SMTC is not set | ||
128 | CONFIG_CPU_HAS_LLSC=y | ||
129 | CONFIG_CPU_HAS_SYNC=y | ||
130 | CONFIG_GENERIC_HARDIRQS=y | ||
131 | CONFIG_GENERIC_IRQ_PROBE=y | ||
132 | CONFIG_CPU_SUPPORTS_HIGHMEM=y | ||
133 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
134 | CONFIG_ARCH_POPULATES_NODE_MAP=y | ||
135 | CONFIG_SELECT_MEMORY_MODEL=y | ||
136 | CONFIG_FLATMEM_MANUAL=y | ||
137 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
138 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
139 | CONFIG_FLATMEM=y | ||
140 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
141 | CONFIG_PAGEFLAGS_EXTENDED=y | ||
142 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
143 | # CONFIG_PHYS_ADDR_T_64BIT is not set | ||
144 | CONFIG_ZONE_DMA_FLAG=0 | ||
145 | CONFIG_VIRT_TO_BUS=y | ||
146 | CONFIG_HAVE_MLOCK=y | ||
147 | CONFIG_HAVE_MLOCKED_PAGE_BIT=y | ||
148 | CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 | ||
149 | CONFIG_TICK_ONESHOT=y | ||
150 | # CONFIG_NO_HZ is not set | ||
151 | CONFIG_HIGH_RES_TIMERS=y | ||
152 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
153 | # CONFIG_HZ_48 is not set | ||
154 | CONFIG_HZ_100=y | ||
155 | # CONFIG_HZ_128 is not set | ||
156 | # CONFIG_HZ_250 is not set | ||
157 | # CONFIG_HZ_256 is not set | ||
158 | # CONFIG_HZ_1000 is not set | ||
159 | # CONFIG_HZ_1024 is not set | ||
160 | CONFIG_SYS_SUPPORTS_ARBIT_HZ=y | ||
161 | CONFIG_HZ=100 | ||
162 | CONFIG_PREEMPT_NONE=y | ||
163 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
164 | # CONFIG_PREEMPT is not set | ||
165 | CONFIG_KEXEC=y | ||
166 | # CONFIG_SECCOMP is not set | ||
167 | CONFIG_LOCKDEP_SUPPORT=y | ||
168 | CONFIG_STACKTRACE_SUPPORT=y | ||
169 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | ||
170 | |||
171 | # | ||
172 | # General setup | ||
173 | # | ||
174 | CONFIG_EXPERIMENTAL=y | ||
175 | CONFIG_BROKEN_ON_SMP=y | ||
176 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
177 | CONFIG_LOCALVERSION="" | ||
178 | # CONFIG_LOCALVERSION_AUTO is not set | ||
179 | CONFIG_SWAP=y | ||
180 | CONFIG_SYSVIPC=y | ||
181 | CONFIG_SYSVIPC_SYSCTL=y | ||
182 | # CONFIG_POSIX_MQUEUE is not set | ||
183 | CONFIG_BSD_PROCESS_ACCT=y | ||
184 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
185 | # CONFIG_TASKSTATS is not set | ||
186 | # CONFIG_AUDIT is not set | ||
187 | |||
188 | # | ||
189 | # RCU Subsystem | ||
190 | # | ||
191 | CONFIG_CLASSIC_RCU=y | ||
192 | # CONFIG_TREE_RCU is not set | ||
193 | # CONFIG_PREEMPT_RCU is not set | ||
194 | # CONFIG_TREE_RCU_TRACE is not set | ||
195 | # CONFIG_PREEMPT_RCU_TRACE is not set | ||
196 | # CONFIG_IKCONFIG is not set | ||
197 | CONFIG_LOG_BUF_SHIFT=14 | ||
198 | # CONFIG_GROUP_SCHED is not set | ||
199 | # CONFIG_CGROUPS is not set | ||
200 | CONFIG_SYSFS_DEPRECATED=y | ||
201 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
202 | CONFIG_RELAY=y | ||
203 | # CONFIG_NAMESPACES is not set | ||
204 | CONFIG_BLK_DEV_INITRD=y | ||
205 | CONFIG_INITRAMFS_SOURCE="" | ||
206 | CONFIG_RD_GZIP=y | ||
207 | # CONFIG_RD_BZIP2 is not set | ||
208 | CONFIG_RD_LZMA=y | ||
209 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
210 | CONFIG_SYSCTL=y | ||
211 | CONFIG_ANON_INODES=y | ||
212 | CONFIG_EMBEDDED=y | ||
213 | CONFIG_SYSCTL_SYSCALL=y | ||
214 | # CONFIG_KALLSYMS is not set | ||
215 | CONFIG_HOTPLUG=y | ||
216 | CONFIG_PRINTK=y | ||
217 | CONFIG_BUG=y | ||
218 | # CONFIG_ELF_CORE is not set | ||
219 | # CONFIG_PCSPKR_PLATFORM is not set | ||
220 | CONFIG_BASE_FULL=y | ||
221 | CONFIG_FUTEX=y | ||
222 | CONFIG_EPOLL=y | ||
223 | CONFIG_SIGNALFD=y | ||
224 | CONFIG_TIMERFD=y | ||
225 | CONFIG_EVENTFD=y | ||
226 | CONFIG_SHMEM=y | ||
227 | CONFIG_AIO=y | ||
228 | |||
229 | # | ||
230 | # Performance Counters | ||
231 | # | ||
232 | # CONFIG_VM_EVENT_COUNTERS is not set | ||
233 | CONFIG_STRIP_ASM_SYMS=y | ||
234 | # CONFIG_COMPAT_BRK is not set | ||
235 | CONFIG_SLAB=y | ||
236 | # CONFIG_SLUB is not set | ||
237 | # CONFIG_SLOB is not set | ||
238 | # CONFIG_PROFILING is not set | ||
239 | # CONFIG_MARKERS is not set | ||
240 | CONFIG_HAVE_OPROFILE=y | ||
241 | # CONFIG_SLOW_WORK is not set | ||
242 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
243 | CONFIG_SLABINFO=y | ||
244 | CONFIG_RT_MUTEXES=y | ||
245 | CONFIG_BASE_SMALL=0 | ||
246 | CONFIG_MODULES=y | ||
247 | # CONFIG_MODULE_FORCE_LOAD is not set | ||
248 | CONFIG_MODULE_UNLOAD=y | ||
249 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
250 | # CONFIG_MODVERSIONS is not set | ||
251 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
252 | CONFIG_BLOCK=y | ||
253 | # CONFIG_LBD is not set | ||
254 | # CONFIG_BLK_DEV_BSG is not set | ||
255 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
256 | |||
257 | # | ||
258 | # IO Schedulers | ||
259 | # | ||
260 | CONFIG_IOSCHED_NOOP=y | ||
261 | # CONFIG_IOSCHED_AS is not set | ||
262 | CONFIG_IOSCHED_DEADLINE=y | ||
263 | # CONFIG_IOSCHED_CFQ is not set | ||
264 | # CONFIG_DEFAULT_AS is not set | ||
265 | CONFIG_DEFAULT_DEADLINE=y | ||
266 | # CONFIG_DEFAULT_CFQ is not set | ||
267 | # CONFIG_DEFAULT_NOOP is not set | ||
268 | CONFIG_DEFAULT_IOSCHED="deadline" | ||
269 | CONFIG_PROBE_INITRD_HEADER=y | ||
270 | # CONFIG_FREEZER is not set | ||
271 | |||
272 | # | ||
273 | # Bus options (PCI, PCMCIA, EISA, ISA, TC) | ||
274 | # | ||
275 | # CONFIG_ARCH_SUPPORTS_MSI is not set | ||
276 | CONFIG_MMU=y | ||
277 | # CONFIG_PCCARD is not set | ||
278 | |||
279 | # | ||
280 | # Executable file formats | ||
281 | # | ||
282 | CONFIG_BINFMT_ELF=y | ||
283 | # CONFIG_HAVE_AOUT is not set | ||
284 | # CONFIG_BINFMT_MISC is not set | ||
285 | CONFIG_TRAD_SIGNALS=y | ||
286 | |||
287 | # | ||
288 | # Power management options | ||
289 | # | ||
290 | CONFIG_ARCH_HIBERNATION_POSSIBLE=y | ||
291 | CONFIG_ARCH_SUSPEND_POSSIBLE=y | ||
292 | # CONFIG_PM is not set | ||
293 | CONFIG_NET=y | ||
294 | |||
295 | # | ||
296 | # Networking options | ||
297 | # | ||
298 | CONFIG_PACKET=y | ||
299 | CONFIG_PACKET_MMAP=y | ||
300 | CONFIG_UNIX=y | ||
301 | # CONFIG_NET_KEY is not set | ||
302 | CONFIG_INET=y | ||
303 | CONFIG_IP_MULTICAST=y | ||
304 | CONFIG_IP_ADVANCED_ROUTER=y | ||
305 | CONFIG_ASK_IP_FIB_HASH=y | ||
306 | # CONFIG_IP_FIB_TRIE is not set | ||
307 | CONFIG_IP_FIB_HASH=y | ||
308 | CONFIG_IP_MULTIPLE_TABLES=y | ||
309 | CONFIG_IP_ROUTE_MULTIPATH=y | ||
310 | CONFIG_IP_ROUTE_VERBOSE=y | ||
311 | # CONFIG_IP_PNP is not set | ||
312 | # CONFIG_NET_IPIP is not set | ||
313 | # CONFIG_NET_IPGRE is not set | ||
314 | CONFIG_IP_MROUTE=y | ||
315 | # CONFIG_IP_PIMSM_V1 is not set | ||
316 | # CONFIG_IP_PIMSM_V2 is not set | ||
317 | CONFIG_ARPD=y | ||
318 | CONFIG_SYN_COOKIES=y | ||
319 | # CONFIG_INET_AH is not set | ||
320 | # CONFIG_INET_ESP is not set | ||
321 | # CONFIG_INET_IPCOMP is not set | ||
322 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
323 | # CONFIG_INET_TUNNEL is not set | ||
324 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
325 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
326 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
327 | # CONFIG_INET_LRO is not set | ||
328 | # CONFIG_INET_DIAG is not set | ||
329 | CONFIG_TCP_CONG_ADVANCED=y | ||
330 | # CONFIG_TCP_CONG_BIC is not set | ||
331 | # CONFIG_TCP_CONG_CUBIC is not set | ||
332 | CONFIG_TCP_CONG_WESTWOOD=y | ||
333 | # CONFIG_TCP_CONG_HTCP is not set | ||
334 | # CONFIG_TCP_CONG_HSTCP is not set | ||
335 | # CONFIG_TCP_CONG_HYBLA is not set | ||
336 | # CONFIG_TCP_CONG_VEGAS is not set | ||
337 | # CONFIG_TCP_CONG_SCALABLE is not set | ||
338 | # CONFIG_TCP_CONG_LP is not set | ||
339 | # CONFIG_TCP_CONG_VENO is not set | ||
340 | # CONFIG_TCP_CONG_YEAH is not set | ||
341 | # CONFIG_TCP_CONG_ILLINOIS is not set | ||
342 | # CONFIG_DEFAULT_BIC is not set | ||
343 | # CONFIG_DEFAULT_CUBIC is not set | ||
344 | # CONFIG_DEFAULT_HTCP is not set | ||
345 | # CONFIG_DEFAULT_VEGAS is not set | ||
346 | CONFIG_DEFAULT_WESTWOOD=y | ||
347 | # CONFIG_DEFAULT_RENO is not set | ||
348 | CONFIG_DEFAULT_TCP_CONG="westwood" | ||
349 | # CONFIG_TCP_MD5SIG is not set | ||
350 | # CONFIG_IPV6 is not set | ||
351 | # CONFIG_NETWORK_SECMARK is not set | ||
352 | CONFIG_NETFILTER=y | ||
353 | # CONFIG_NETFILTER_DEBUG is not set | ||
354 | CONFIG_NETFILTER_ADVANCED=y | ||
355 | # CONFIG_BRIDGE_NETFILTER is not set | ||
356 | |||
357 | # | ||
358 | # Core Netfilter Configuration | ||
359 | # | ||
360 | # CONFIG_NETFILTER_NETLINK_QUEUE is not set | ||
361 | # CONFIG_NETFILTER_NETLINK_LOG is not set | ||
362 | CONFIG_NF_CONNTRACK=m | ||
363 | # CONFIG_NF_CT_ACCT is not set | ||
364 | CONFIG_NF_CONNTRACK_MARK=y | ||
365 | # CONFIG_NF_CONNTRACK_EVENTS is not set | ||
366 | # CONFIG_NF_CT_PROTO_DCCP is not set | ||
367 | # CONFIG_NF_CT_PROTO_SCTP is not set | ||
368 | # CONFIG_NF_CT_PROTO_UDPLITE is not set | ||
369 | # CONFIG_NF_CONNTRACK_AMANDA is not set | ||
370 | CONFIG_NF_CONNTRACK_FTP=m | ||
371 | # CONFIG_NF_CONNTRACK_H323 is not set | ||
372 | CONFIG_NF_CONNTRACK_IRC=m | ||
373 | # CONFIG_NF_CONNTRACK_NETBIOS_NS is not set | ||
374 | # CONFIG_NF_CONNTRACK_PPTP is not set | ||
375 | # CONFIG_NF_CONNTRACK_SANE is not set | ||
376 | # CONFIG_NF_CONNTRACK_SIP is not set | ||
377 | CONFIG_NF_CONNTRACK_TFTP=m | ||
378 | # CONFIG_NF_CT_NETLINK is not set | ||
379 | # CONFIG_NETFILTER_TPROXY is not set | ||
380 | CONFIG_NETFILTER_XTABLES=m | ||
381 | # CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set | ||
382 | # CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set | ||
383 | # CONFIG_NETFILTER_XT_TARGET_DSCP is not set | ||
384 | # CONFIG_NETFILTER_XT_TARGET_HL is not set | ||
385 | # CONFIG_NETFILTER_XT_TARGET_LED is not set | ||
386 | # CONFIG_NETFILTER_XT_TARGET_MARK is not set | ||
387 | # CONFIG_NETFILTER_XT_TARGET_NFLOG is not set | ||
388 | # CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set | ||
389 | CONFIG_NETFILTER_XT_TARGET_NOTRACK=m | ||
390 | # CONFIG_NETFILTER_XT_TARGET_RATEEST is not set | ||
391 | # CONFIG_NETFILTER_XT_TARGET_TRACE is not set | ||
392 | CONFIG_NETFILTER_XT_TARGET_TCPMSS=m | ||
393 | # CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set | ||
394 | # CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set | ||
395 | # CONFIG_NETFILTER_XT_MATCH_COMMENT is not set | ||
396 | # CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set | ||
397 | # CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set | ||
398 | # CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set | ||
399 | # CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set | ||
400 | # CONFIG_NETFILTER_XT_MATCH_DCCP is not set | ||
401 | # CONFIG_NETFILTER_XT_MATCH_DSCP is not set | ||
402 | # CONFIG_NETFILTER_XT_MATCH_ESP is not set | ||
403 | # CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set | ||
404 | # CONFIG_NETFILTER_XT_MATCH_HELPER is not set | ||
405 | # CONFIG_NETFILTER_XT_MATCH_HL is not set | ||
406 | # CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set | ||
407 | # CONFIG_NETFILTER_XT_MATCH_LENGTH is not set | ||
408 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | ||
409 | CONFIG_NETFILTER_XT_MATCH_MAC=m | ||
410 | # CONFIG_NETFILTER_XT_MATCH_MARK is not set | ||
411 | CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m | ||
412 | # CONFIG_NETFILTER_XT_MATCH_OWNER is not set | ||
413 | # CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set | ||
414 | # CONFIG_NETFILTER_XT_MATCH_QUOTA is not set | ||
415 | # CONFIG_NETFILTER_XT_MATCH_RATEEST is not set | ||
416 | # CONFIG_NETFILTER_XT_MATCH_REALM is not set | ||
417 | # CONFIG_NETFILTER_XT_MATCH_RECENT is not set | ||
418 | # CONFIG_NETFILTER_XT_MATCH_SCTP is not set | ||
419 | CONFIG_NETFILTER_XT_MATCH_STATE=m | ||
420 | # CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set | ||
421 | # CONFIG_NETFILTER_XT_MATCH_STRING is not set | ||
422 | # CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set | ||
423 | # CONFIG_NETFILTER_XT_MATCH_TIME is not set | ||
424 | # CONFIG_NETFILTER_XT_MATCH_U32 is not set | ||
425 | # CONFIG_IP_VS is not set | ||
426 | |||
427 | # | ||
428 | # IP: Netfilter Configuration | ||
429 | # | ||
430 | CONFIG_NF_DEFRAG_IPV4=m | ||
431 | CONFIG_NF_CONNTRACK_IPV4=m | ||
432 | CONFIG_NF_CONNTRACK_PROC_COMPAT=y | ||
433 | # CONFIG_IP_NF_QUEUE is not set | ||
434 | CONFIG_IP_NF_IPTABLES=m | ||
435 | # CONFIG_IP_NF_MATCH_ADDRTYPE is not set | ||
436 | # CONFIG_IP_NF_MATCH_AH is not set | ||
437 | # CONFIG_IP_NF_MATCH_ECN is not set | ||
438 | # CONFIG_IP_NF_MATCH_TTL is not set | ||
439 | CONFIG_IP_NF_FILTER=m | ||
440 | CONFIG_IP_NF_TARGET_REJECT=m | ||
441 | CONFIG_IP_NF_TARGET_LOG=m | ||
442 | # CONFIG_IP_NF_TARGET_ULOG is not set | ||
443 | CONFIG_NF_NAT=m | ||
444 | CONFIG_NF_NAT_NEEDED=y | ||
445 | CONFIG_IP_NF_TARGET_MASQUERADE=m | ||
446 | # CONFIG_IP_NF_TARGET_NETMAP is not set | ||
447 | # CONFIG_IP_NF_TARGET_REDIRECT is not set | ||
448 | # CONFIG_NF_NAT_SNMP_BASIC is not set | ||
449 | CONFIG_NF_NAT_FTP=m | ||
450 | CONFIG_NF_NAT_IRC=m | ||
451 | CONFIG_NF_NAT_TFTP=m | ||
452 | # CONFIG_NF_NAT_AMANDA is not set | ||
453 | # CONFIG_NF_NAT_PPTP is not set | ||
454 | # CONFIG_NF_NAT_H323 is not set | ||
455 | # CONFIG_NF_NAT_SIP is not set | ||
456 | CONFIG_IP_NF_MANGLE=m | ||
457 | # CONFIG_IP_NF_TARGET_CLUSTERIP is not set | ||
458 | # CONFIG_IP_NF_TARGET_ECN is not set | ||
459 | # CONFIG_IP_NF_TARGET_TTL is not set | ||
460 | CONFIG_IP_NF_RAW=m | ||
461 | # CONFIG_IP_NF_ARPTABLES is not set | ||
462 | # CONFIG_IP_DCCP is not set | ||
463 | # CONFIG_IP_SCTP is not set | ||
464 | # CONFIG_TIPC is not set | ||
465 | CONFIG_ATM=m | ||
466 | # CONFIG_ATM_CLIP is not set | ||
467 | # CONFIG_ATM_LANE is not set | ||
468 | CONFIG_ATM_BR2684=m | ||
469 | CONFIG_ATM_BR2684_IPFILTER=y | ||
470 | CONFIG_STP=y | ||
471 | CONFIG_BRIDGE=y | ||
472 | # CONFIG_NET_DSA is not set | ||
473 | CONFIG_VLAN_8021Q=y | ||
474 | # CONFIG_VLAN_8021Q_GVRP is not set | ||
475 | # CONFIG_DECNET is not set | ||
476 | CONFIG_LLC=y | ||
477 | # CONFIG_LLC2 is not set | ||
478 | # CONFIG_IPX is not set | ||
479 | # CONFIG_ATALK is not set | ||
480 | # CONFIG_X25 is not set | ||
481 | # CONFIG_LAPB is not set | ||
482 | # CONFIG_ECONET is not set | ||
483 | # CONFIG_WAN_ROUTER is not set | ||
484 | # CONFIG_PHONET is not set | ||
485 | # CONFIG_IEEE802154 is not set | ||
486 | CONFIG_NET_SCHED=y | ||
487 | |||
488 | # | ||
489 | # Queueing/Scheduling | ||
490 | # | ||
491 | # CONFIG_NET_SCH_CBQ is not set | ||
492 | # CONFIG_NET_SCH_HTB is not set | ||
493 | # CONFIG_NET_SCH_HFSC is not set | ||
494 | # CONFIG_NET_SCH_ATM is not set | ||
495 | # CONFIG_NET_SCH_PRIO is not set | ||
496 | # CONFIG_NET_SCH_MULTIQ is not set | ||
497 | # CONFIG_NET_SCH_RED is not set | ||
498 | # CONFIG_NET_SCH_SFQ is not set | ||
499 | # CONFIG_NET_SCH_TEQL is not set | ||
500 | # CONFIG_NET_SCH_TBF is not set | ||
501 | # CONFIG_NET_SCH_GRED is not set | ||
502 | # CONFIG_NET_SCH_DSMARK is not set | ||
503 | # CONFIG_NET_SCH_NETEM is not set | ||
504 | # CONFIG_NET_SCH_DRR is not set | ||
505 | # CONFIG_NET_SCH_INGRESS is not set | ||
506 | |||
507 | # | ||
508 | # Classification | ||
509 | # | ||
510 | # CONFIG_NET_CLS_BASIC is not set | ||
511 | # CONFIG_NET_CLS_TCINDEX is not set | ||
512 | # CONFIG_NET_CLS_ROUTE4 is not set | ||
513 | # CONFIG_NET_CLS_FW is not set | ||
514 | # CONFIG_NET_CLS_U32 is not set | ||
515 | # CONFIG_NET_CLS_RSVP is not set | ||
516 | # CONFIG_NET_CLS_RSVP6 is not set | ||
517 | # CONFIG_NET_CLS_FLOW is not set | ||
518 | # CONFIG_NET_EMATCH is not set | ||
519 | CONFIG_NET_CLS_ACT=y | ||
520 | CONFIG_NET_ACT_POLICE=y | ||
521 | # CONFIG_NET_ACT_GACT is not set | ||
522 | # CONFIG_NET_ACT_MIRRED is not set | ||
523 | # CONFIG_NET_ACT_IPT is not set | ||
524 | # CONFIG_NET_ACT_NAT is not set | ||
525 | # CONFIG_NET_ACT_PEDIT is not set | ||
526 | # CONFIG_NET_ACT_SIMP is not set | ||
527 | # CONFIG_NET_ACT_SKBEDIT is not set | ||
528 | CONFIG_NET_SCH_FIFO=y | ||
529 | # CONFIG_DCB is not set | ||
530 | |||
531 | # | ||
532 | # Network testing | ||
533 | # | ||
534 | # CONFIG_NET_PKTGEN is not set | ||
535 | CONFIG_HAMRADIO=y | ||
536 | |||
537 | # | ||
538 | # Packet Radio protocols | ||
539 | # | ||
540 | # CONFIG_AX25 is not set | ||
541 | # CONFIG_CAN is not set | ||
542 | # CONFIG_IRDA is not set | ||
543 | # CONFIG_BT is not set | ||
544 | # CONFIG_AF_RXRPC is not set | ||
545 | CONFIG_FIB_RULES=y | ||
546 | CONFIG_WIRELESS=y | ||
547 | CONFIG_CFG80211=m | ||
548 | # CONFIG_CFG80211_REG_DEBUG is not set | ||
549 | # CONFIG_CFG80211_DEBUGFS is not set | ||
550 | # CONFIG_WIRELESS_OLD_REGULATORY is not set | ||
551 | CONFIG_WIRELESS_EXT=y | ||
552 | CONFIG_WIRELESS_EXT_SYSFS=y | ||
553 | # CONFIG_LIB80211 is not set | ||
554 | CONFIG_MAC80211=m | ||
555 | CONFIG_MAC80211_DEFAULT_PS=y | ||
556 | CONFIG_MAC80211_DEFAULT_PS_VALUE=1 | ||
557 | |||
558 | # | ||
559 | # Rate control algorithm selection | ||
560 | # | ||
561 | CONFIG_MAC80211_RC_PID=y | ||
562 | CONFIG_MAC80211_RC_MINSTREL=y | ||
563 | CONFIG_MAC80211_RC_DEFAULT_PID=y | ||
564 | # CONFIG_MAC80211_RC_DEFAULT_MINSTREL is not set | ||
565 | CONFIG_MAC80211_RC_DEFAULT="pid" | ||
566 | # CONFIG_MAC80211_MESH is not set | ||
567 | # CONFIG_MAC80211_LEDS is not set | ||
568 | # CONFIG_MAC80211_DEBUGFS is not set | ||
569 | # CONFIG_MAC80211_DEBUG_MENU is not set | ||
570 | # CONFIG_WIMAX is not set | ||
571 | # CONFIG_RFKILL is not set | ||
572 | # CONFIG_NET_9P is not set | ||
573 | |||
574 | # | ||
575 | # Device Drivers | ||
576 | # | ||
577 | |||
578 | # | ||
579 | # Generic Driver Options | ||
580 | # | ||
581 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
582 | CONFIG_STANDALONE=y | ||
583 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
584 | CONFIG_FW_LOADER=y | ||
585 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
586 | CONFIG_EXTRA_FIRMWARE="" | ||
587 | # CONFIG_SYS_HYPERVISOR is not set | ||
588 | # CONFIG_CONNECTOR is not set | ||
589 | CONFIG_MTD=y | ||
590 | # CONFIG_MTD_DEBUG is not set | ||
591 | # CONFIG_MTD_CONCAT is not set | ||
592 | CONFIG_MTD_PARTITIONS=y | ||
593 | # CONFIG_MTD_TESTS is not set | ||
594 | # CONFIG_MTD_REDBOOT_PARTS is not set | ||
595 | # CONFIG_MTD_CMDLINE_PARTS is not set | ||
596 | # CONFIG_MTD_AR7_PARTS is not set | ||
597 | |||
598 | # | ||
599 | # User Modules And Translation Layers | ||
600 | # | ||
601 | CONFIG_MTD_CHAR=y | ||
602 | CONFIG_MTD_BLKDEVS=y | ||
603 | CONFIG_MTD_BLOCK=y | ||
604 | # CONFIG_FTL is not set | ||
605 | # CONFIG_NFTL is not set | ||
606 | # CONFIG_INFTL is not set | ||
607 | # CONFIG_RFD_FTL is not set | ||
608 | # CONFIG_SSFDC is not set | ||
609 | # CONFIG_MTD_OOPS is not set | ||
610 | |||
611 | # | ||
612 | # RAM/ROM/Flash chip drivers | ||
613 | # | ||
614 | CONFIG_MTD_CFI=y | ||
615 | # CONFIG_MTD_JEDECPROBE is not set | ||
616 | CONFIG_MTD_GEN_PROBE=y | ||
617 | # CONFIG_MTD_CFI_ADV_OPTIONS is not set | ||
618 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | ||
619 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | ||
620 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | ||
621 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | ||
622 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | ||
623 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | ||
624 | CONFIG_MTD_CFI_I1=y | ||
625 | CONFIG_MTD_CFI_I2=y | ||
626 | # CONFIG_MTD_CFI_I4 is not set | ||
627 | # CONFIG_MTD_CFI_I8 is not set | ||
628 | CONFIG_MTD_CFI_INTELEXT=y | ||
629 | CONFIG_MTD_CFI_AMDSTD=y | ||
630 | CONFIG_MTD_CFI_STAA=y | ||
631 | CONFIG_MTD_CFI_UTIL=y | ||
632 | # CONFIG_MTD_RAM is not set | ||
633 | # CONFIG_MTD_ROM is not set | ||
634 | # CONFIG_MTD_ABSENT is not set | ||
635 | |||
636 | # | ||
637 | # Mapping drivers for chip access | ||
638 | # | ||
639 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
640 | CONFIG_MTD_PHYSMAP=y | ||
641 | # CONFIG_MTD_PHYSMAP_COMPAT is not set | ||
642 | # CONFIG_MTD_PLATRAM is not set | ||
643 | |||
644 | # | ||
645 | # Self-contained MTD device drivers | ||
646 | # | ||
647 | # CONFIG_MTD_SLRAM is not set | ||
648 | # CONFIG_MTD_PHRAM is not set | ||
649 | # CONFIG_MTD_MTDRAM is not set | ||
650 | # CONFIG_MTD_BLOCK2MTD is not set | ||
651 | |||
652 | # | ||
653 | # Disk-On-Chip Device Drivers | ||
654 | # | ||
655 | # CONFIG_MTD_DOC2000 is not set | ||
656 | # CONFIG_MTD_DOC2001 is not set | ||
657 | # CONFIG_MTD_DOC2001PLUS is not set | ||
658 | # CONFIG_MTD_NAND is not set | ||
659 | # CONFIG_MTD_ONENAND is not set | ||
660 | |||
661 | # | ||
662 | # LPDDR flash memory drivers | ||
663 | # | ||
664 | # CONFIG_MTD_LPDDR is not set | ||
665 | |||
666 | # | ||
667 | # UBI - Unsorted block images | ||
668 | # | ||
669 | # CONFIG_MTD_UBI is not set | ||
670 | # CONFIG_PARPORT is not set | ||
671 | CONFIG_BLK_DEV=y | ||
672 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
673 | # CONFIG_BLK_DEV_LOOP is not set | ||
674 | # CONFIG_BLK_DEV_NBD is not set | ||
675 | # CONFIG_BLK_DEV_RAM is not set | ||
676 | # CONFIG_CDROM_PKTCDVD is not set | ||
677 | # CONFIG_ATA_OVER_ETH is not set | ||
678 | # CONFIG_BLK_DEV_HD is not set | ||
679 | CONFIG_MISC_DEVICES=y | ||
680 | # CONFIG_ENCLOSURE_SERVICES is not set | ||
681 | # CONFIG_C2PORT is not set | ||
682 | |||
683 | # | ||
684 | # EEPROM support | ||
685 | # | ||
686 | # CONFIG_EEPROM_93CX6 is not set | ||
687 | CONFIG_HAVE_IDE=y | ||
688 | # CONFIG_IDE is not set | ||
689 | |||
690 | # | ||
691 | # SCSI device support | ||
692 | # | ||
693 | # CONFIG_RAID_ATTRS is not set | ||
694 | # CONFIG_SCSI is not set | ||
695 | # CONFIG_SCSI_DMA is not set | ||
696 | # CONFIG_SCSI_NETLINK is not set | ||
697 | # CONFIG_ATA is not set | ||
698 | # CONFIG_MD is not set | ||
699 | CONFIG_NETDEVICES=y | ||
700 | # CONFIG_IFB is not set | ||
701 | # CONFIG_DUMMY is not set | ||
702 | # CONFIG_BONDING is not set | ||
703 | # CONFIG_MACVLAN is not set | ||
704 | # CONFIG_EQUALIZER is not set | ||
705 | # CONFIG_TUN is not set | ||
706 | # CONFIG_VETH is not set | ||
707 | CONFIG_PHYLIB=y | ||
708 | |||
709 | # | ||
710 | # MII PHY device drivers | ||
711 | # | ||
712 | # CONFIG_MARVELL_PHY is not set | ||
713 | # CONFIG_DAVICOM_PHY is not set | ||
714 | # CONFIG_QSEMI_PHY is not set | ||
715 | # CONFIG_LXT_PHY is not set | ||
716 | # CONFIG_CICADA_PHY is not set | ||
717 | # CONFIG_VITESSE_PHY is not set | ||
718 | # CONFIG_SMSC_PHY is not set | ||
719 | # CONFIG_BROADCOM_PHY is not set | ||
720 | # CONFIG_ICPLUS_PHY is not set | ||
721 | # CONFIG_REALTEK_PHY is not set | ||
722 | # CONFIG_NATIONAL_PHY is not set | ||
723 | # CONFIG_STE10XP is not set | ||
724 | # CONFIG_LSI_ET1011C_PHY is not set | ||
725 | CONFIG_FIXED_PHY=y | ||
726 | # CONFIG_MDIO_BITBANG is not set | ||
727 | CONFIG_NET_ETHERNET=y | ||
728 | CONFIG_MII=y | ||
729 | # CONFIG_AX88796 is not set | ||
730 | # CONFIG_SMC91X is not set | ||
731 | # CONFIG_DM9000 is not set | ||
732 | # CONFIG_ETHOC is not set | ||
733 | # CONFIG_DNET is not set | ||
734 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
735 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
736 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
737 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
738 | # CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set | ||
739 | # CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set | ||
740 | # CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set | ||
741 | # CONFIG_B44 is not set | ||
742 | # CONFIG_KS8842 is not set | ||
743 | CONFIG_CPMAC=y | ||
744 | # CONFIG_NETDEV_1000 is not set | ||
745 | # CONFIG_NETDEV_10000 is not set | ||
746 | |||
747 | # | ||
748 | # Wireless LAN | ||
749 | # | ||
750 | # CONFIG_WLAN_PRE80211 is not set | ||
751 | CONFIG_WLAN_80211=y | ||
752 | # CONFIG_LIBERTAS is not set | ||
753 | # CONFIG_LIBERTAS_THINFIRM is not set | ||
754 | # CONFIG_MAC80211_HWSIM is not set | ||
755 | # CONFIG_P54_COMMON is not set | ||
756 | # CONFIG_HOSTAP is not set | ||
757 | # CONFIG_B43 is not set | ||
758 | # CONFIG_B43LEGACY is not set | ||
759 | # CONFIG_RT2X00 is not set | ||
760 | |||
761 | # | ||
762 | # Enable WiMAX (Networking options) to see the WiMAX drivers | ||
763 | # | ||
764 | # CONFIG_WAN is not set | ||
765 | CONFIG_ATM_DRIVERS=y | ||
766 | # CONFIG_ATM_DUMMY is not set | ||
767 | # CONFIG_ATM_TCP is not set | ||
768 | CONFIG_PPP=m | ||
769 | CONFIG_PPP_MULTILINK=y | ||
770 | CONFIG_PPP_FILTER=y | ||
771 | CONFIG_PPP_ASYNC=m | ||
772 | # CONFIG_PPP_SYNC_TTY is not set | ||
773 | # CONFIG_PPP_DEFLATE is not set | ||
774 | # CONFIG_PPP_BSDCOMP is not set | ||
775 | # CONFIG_PPP_MPPE is not set | ||
776 | CONFIG_PPPOE=m | ||
777 | CONFIG_PPPOATM=m | ||
778 | # CONFIG_PPPOL2TP is not set | ||
779 | # CONFIG_SLIP is not set | ||
780 | CONFIG_SLHC=m | ||
781 | # CONFIG_NETCONSOLE is not set | ||
782 | # CONFIG_NETPOLL is not set | ||
783 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
784 | # CONFIG_ISDN is not set | ||
785 | # CONFIG_PHONE is not set | ||
786 | |||
787 | # | ||
788 | # Input device support | ||
789 | # | ||
790 | # CONFIG_INPUT is not set | ||
791 | |||
792 | # | ||
793 | # Hardware I/O ports | ||
794 | # | ||
795 | # CONFIG_SERIO is not set | ||
796 | # CONFIG_GAMEPORT is not set | ||
797 | |||
798 | # | ||
799 | # Character devices | ||
800 | # | ||
801 | # CONFIG_VT is not set | ||
802 | # CONFIG_DEVKMEM is not set | ||
803 | # CONFIG_SERIAL_NONSTANDARD is not set | ||
804 | |||
805 | # | ||
806 | # Serial drivers | ||
807 | # | ||
808 | CONFIG_SERIAL_8250=y | ||
809 | CONFIG_SERIAL_8250_CONSOLE=y | ||
810 | CONFIG_SERIAL_8250_NR_UARTS=2 | ||
811 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 | ||
812 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
813 | |||
814 | # | ||
815 | # Non-8250 serial port support | ||
816 | # | ||
817 | CONFIG_SERIAL_CORE=y | ||
818 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
819 | CONFIG_UNIX98_PTYS=y | ||
820 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | ||
821 | # CONFIG_LEGACY_PTYS is not set | ||
822 | # CONFIG_IPMI_HANDLER is not set | ||
823 | CONFIG_HW_RANDOM=y | ||
824 | # CONFIG_HW_RANDOM_TIMERIOMEM is not set | ||
825 | # CONFIG_R3964 is not set | ||
826 | # CONFIG_RAW_DRIVER is not set | ||
827 | # CONFIG_TCG_TPM is not set | ||
828 | # CONFIG_I2C is not set | ||
829 | # CONFIG_SPI is not set | ||
830 | # CONFIG_W1 is not set | ||
831 | # CONFIG_POWER_SUPPLY is not set | ||
832 | # CONFIG_HWMON is not set | ||
833 | # CONFIG_THERMAL is not set | ||
834 | # CONFIG_THERMAL_HWMON is not set | ||
835 | CONFIG_WATCHDOG=y | ||
836 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
837 | |||
838 | # | ||
839 | # Watchdog Device Drivers | ||
840 | # | ||
841 | # CONFIG_SOFT_WATCHDOG is not set | ||
842 | CONFIG_AR7_WDT=y | ||
843 | CONFIG_SSB_POSSIBLE=y | ||
844 | |||
845 | # | ||
846 | # Sonics Silicon Backplane | ||
847 | # | ||
848 | CONFIG_SSB=y | ||
849 | # CONFIG_SSB_SILENT is not set | ||
850 | # CONFIG_SSB_DEBUG is not set | ||
851 | CONFIG_SSB_SERIAL=y | ||
852 | CONFIG_SSB_DRIVER_MIPS=y | ||
853 | CONFIG_SSB_EMBEDDED=y | ||
854 | CONFIG_SSB_DRIVER_EXTIF=y | ||
855 | |||
856 | # | ||
857 | # Multifunction device drivers | ||
858 | # | ||
859 | # CONFIG_MFD_CORE is not set | ||
860 | # CONFIG_MFD_SM501 is not set | ||
861 | # CONFIG_HTC_PASIC3 is not set | ||
862 | # CONFIG_MFD_TMIO is not set | ||
863 | # CONFIG_REGULATOR is not set | ||
864 | # CONFIG_MEDIA_SUPPORT is not set | ||
865 | |||
866 | # | ||
867 | # Graphics support | ||
868 | # | ||
869 | # CONFIG_VGASTATE is not set | ||
870 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | ||
871 | # CONFIG_FB is not set | ||
872 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
873 | |||
874 | # | ||
875 | # Display device support | ||
876 | # | ||
877 | # CONFIG_DISPLAY_SUPPORT is not set | ||
878 | # CONFIG_SOUND is not set | ||
879 | # CONFIG_USB_SUPPORT is not set | ||
880 | # CONFIG_MMC is not set | ||
881 | # CONFIG_MEMSTICK is not set | ||
882 | CONFIG_NEW_LEDS=y | ||
883 | CONFIG_LEDS_CLASS=y | ||
884 | |||
885 | # | ||
886 | # LED drivers | ||
887 | # | ||
888 | # CONFIG_LEDS_GPIO is not set | ||
889 | |||
890 | # | ||
891 | # LED Triggers | ||
892 | # | ||
893 | CONFIG_LEDS_TRIGGERS=y | ||
894 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
895 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
896 | # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set | ||
897 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
898 | |||
899 | # | ||
900 | # iptables trigger is under Netfilter config (LED target) | ||
901 | # | ||
902 | # CONFIG_ACCESSIBILITY is not set | ||
903 | CONFIG_RTC_LIB=y | ||
904 | # CONFIG_RTC_CLASS is not set | ||
905 | # CONFIG_DMADEVICES is not set | ||
906 | # CONFIG_AUXDISPLAY is not set | ||
907 | # CONFIG_UIO is not set | ||
908 | |||
909 | # | ||
910 | # TI VLYNQ | ||
911 | # | ||
912 | CONFIG_VLYNQ=y | ||
913 | # CONFIG_STAGING is not set | ||
914 | |||
915 | # | ||
916 | # File systems | ||
917 | # | ||
918 | # CONFIG_EXT2_FS is not set | ||
919 | # CONFIG_EXT3_FS is not set | ||
920 | # CONFIG_EXT4_FS is not set | ||
921 | # CONFIG_REISERFS_FS is not set | ||
922 | # CONFIG_JFS_FS is not set | ||
923 | # CONFIG_FS_POSIX_ACL is not set | ||
924 | # CONFIG_XFS_FS is not set | ||
925 | # CONFIG_OCFS2_FS is not set | ||
926 | # CONFIG_BTRFS_FS is not set | ||
927 | CONFIG_FILE_LOCKING=y | ||
928 | CONFIG_FSNOTIFY=y | ||
929 | # CONFIG_DNOTIFY is not set | ||
930 | # CONFIG_INOTIFY is not set | ||
931 | CONFIG_INOTIFY_USER=y | ||
932 | # CONFIG_QUOTA is not set | ||
933 | # CONFIG_AUTOFS_FS is not set | ||
934 | # CONFIG_AUTOFS4_FS is not set | ||
935 | # CONFIG_FUSE_FS is not set | ||
936 | |||
937 | # | ||
938 | # Caches | ||
939 | # | ||
940 | # CONFIG_FSCACHE is not set | ||
941 | |||
942 | # | ||
943 | # CD-ROM/DVD Filesystems | ||
944 | # | ||
945 | # CONFIG_ISO9660_FS is not set | ||
946 | # CONFIG_UDF_FS is not set | ||
947 | |||
948 | # | ||
949 | # DOS/FAT/NT Filesystems | ||
950 | # | ||
951 | # CONFIG_MSDOS_FS is not set | ||
952 | # CONFIG_VFAT_FS is not set | ||
953 | # CONFIG_NTFS_FS is not set | ||
954 | |||
955 | # | ||
956 | # Pseudo filesystems | ||
957 | # | ||
958 | CONFIG_PROC_FS=y | ||
959 | CONFIG_PROC_KCORE=y | ||
960 | CONFIG_PROC_SYSCTL=y | ||
961 | # CONFIG_PROC_PAGE_MONITOR is not set | ||
962 | CONFIG_SYSFS=y | ||
963 | CONFIG_TMPFS=y | ||
964 | # CONFIG_TMPFS_POSIX_ACL is not set | ||
965 | # CONFIG_HUGETLB_PAGE is not set | ||
966 | # CONFIG_CONFIGFS_FS is not set | ||
967 | CONFIG_MISC_FILESYSTEMS=y | ||
968 | # CONFIG_ADFS_FS is not set | ||
969 | # CONFIG_AFFS_FS is not set | ||
970 | # CONFIG_HFS_FS is not set | ||
971 | # CONFIG_HFSPLUS_FS is not set | ||
972 | # CONFIG_BEFS_FS is not set | ||
973 | # CONFIG_BFS_FS is not set | ||
974 | # CONFIG_EFS_FS is not set | ||
975 | CONFIG_JFFS2_FS=y | ||
976 | CONFIG_JFFS2_FS_DEBUG=0 | ||
977 | CONFIG_JFFS2_FS_WRITEBUFFER=y | ||
978 | # CONFIG_JFFS2_FS_WBUF_VERIFY is not set | ||
979 | CONFIG_JFFS2_SUMMARY=y | ||
980 | # CONFIG_JFFS2_FS_XATTR is not set | ||
981 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
982 | CONFIG_JFFS2_ZLIB=y | ||
983 | # CONFIG_JFFS2_LZO is not set | ||
984 | CONFIG_JFFS2_RTIME=y | ||
985 | # CONFIG_JFFS2_RUBIN is not set | ||
986 | # CONFIG_JFFS2_CMODE_NONE is not set | ||
987 | CONFIG_JFFS2_CMODE_PRIORITY=y | ||
988 | # CONFIG_JFFS2_CMODE_SIZE is not set | ||
989 | # CONFIG_JFFS2_CMODE_FAVOURLZO is not set | ||
990 | # CONFIG_CRAMFS is not set | ||
991 | CONFIG_SQUASHFS=y | ||
992 | # CONFIG_SQUASHFS_EMBEDDED is not set | ||
993 | CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 | ||
994 | # CONFIG_VXFS_FS is not set | ||
995 | # CONFIG_MINIX_FS is not set | ||
996 | # CONFIG_OMFS_FS is not set | ||
997 | # CONFIG_HPFS_FS is not set | ||
998 | # CONFIG_QNX4FS_FS is not set | ||
999 | # CONFIG_ROMFS_FS is not set | ||
1000 | # CONFIG_SYSV_FS is not set | ||
1001 | # CONFIG_UFS_FS is not set | ||
1002 | # CONFIG_NILFS2_FS is not set | ||
1003 | CONFIG_NETWORK_FILESYSTEMS=y | ||
1004 | # CONFIG_NFS_FS is not set | ||
1005 | # CONFIG_NFSD is not set | ||
1006 | # CONFIG_SMB_FS is not set | ||
1007 | # CONFIG_CIFS is not set | ||
1008 | # CONFIG_NCP_FS is not set | ||
1009 | # CONFIG_CODA_FS is not set | ||
1010 | # CONFIG_AFS_FS is not set | ||
1011 | |||
1012 | # | ||
1013 | # Partition Types | ||
1014 | # | ||
1015 | CONFIG_PARTITION_ADVANCED=y | ||
1016 | # CONFIG_ACORN_PARTITION is not set | ||
1017 | # CONFIG_OSF_PARTITION is not set | ||
1018 | # CONFIG_AMIGA_PARTITION is not set | ||
1019 | # CONFIG_ATARI_PARTITION is not set | ||
1020 | # CONFIG_MAC_PARTITION is not set | ||
1021 | CONFIG_MSDOS_PARTITION=y | ||
1022 | CONFIG_BSD_DISKLABEL=y | ||
1023 | # CONFIG_MINIX_SUBPARTITION is not set | ||
1024 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
1025 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
1026 | # CONFIG_LDM_PARTITION is not set | ||
1027 | # CONFIG_SGI_PARTITION is not set | ||
1028 | # CONFIG_ULTRIX_PARTITION is not set | ||
1029 | # CONFIG_SUN_PARTITION is not set | ||
1030 | # CONFIG_KARMA_PARTITION is not set | ||
1031 | # CONFIG_EFI_PARTITION is not set | ||
1032 | # CONFIG_SYSV68_PARTITION is not set | ||
1033 | # CONFIG_NLS is not set | ||
1034 | # CONFIG_DLM is not set | ||
1035 | |||
1036 | # | ||
1037 | # Kernel hacking | ||
1038 | # | ||
1039 | CONFIG_TRACE_IRQFLAGS_SUPPORT=y | ||
1040 | # CONFIG_PRINTK_TIME is not set | ||
1041 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
1042 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
1043 | CONFIG_FRAME_WARN=1024 | ||
1044 | # CONFIG_MAGIC_SYSRQ is not set | ||
1045 | # CONFIG_UNUSED_SYMBOLS is not set | ||
1046 | CONFIG_DEBUG_FS=y | ||
1047 | # CONFIG_HEADERS_CHECK is not set | ||
1048 | # CONFIG_DEBUG_KERNEL is not set | ||
1049 | # CONFIG_DEBUG_MEMORY_INIT is not set | ||
1050 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
1051 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
1052 | CONFIG_TRACING_SUPPORT=y | ||
1053 | # CONFIG_FTRACE is not set | ||
1054 | # CONFIG_DYNAMIC_DEBUG is not set | ||
1055 | # CONFIG_SAMPLES is not set | ||
1056 | CONFIG_HAVE_ARCH_KGDB=y | ||
1057 | CONFIG_CMDLINE="rootfstype=squashfs,jffs2" | ||
1058 | |||
1059 | # | ||
1060 | # Security options | ||
1061 | # | ||
1062 | # CONFIG_KEYS is not set | ||
1063 | # CONFIG_SECURITY is not set | ||
1064 | # CONFIG_SECURITYFS is not set | ||
1065 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
1066 | CONFIG_CRYPTO=y | ||
1067 | |||
1068 | # | ||
1069 | # Crypto core or helper | ||
1070 | # | ||
1071 | # CONFIG_CRYPTO_FIPS is not set | ||
1072 | CONFIG_CRYPTO_ALGAPI=m | ||
1073 | CONFIG_CRYPTO_ALGAPI2=m | ||
1074 | CONFIG_CRYPTO_AEAD2=m | ||
1075 | CONFIG_CRYPTO_BLKCIPHER=m | ||
1076 | CONFIG_CRYPTO_BLKCIPHER2=m | ||
1077 | CONFIG_CRYPTO_HASH2=m | ||
1078 | CONFIG_CRYPTO_RNG2=m | ||
1079 | CONFIG_CRYPTO_PCOMP=m | ||
1080 | CONFIG_CRYPTO_MANAGER=m | ||
1081 | CONFIG_CRYPTO_MANAGER2=m | ||
1082 | # CONFIG_CRYPTO_GF128MUL is not set | ||
1083 | # CONFIG_CRYPTO_NULL is not set | ||
1084 | CONFIG_CRYPTO_WORKQUEUE=m | ||
1085 | # CONFIG_CRYPTO_CRYPTD is not set | ||
1086 | # CONFIG_CRYPTO_AUTHENC is not set | ||
1087 | # CONFIG_CRYPTO_TEST is not set | ||
1088 | |||
1089 | # | ||
1090 | # Authenticated Encryption with Associated Data | ||
1091 | # | ||
1092 | # CONFIG_CRYPTO_CCM is not set | ||
1093 | # CONFIG_CRYPTO_GCM is not set | ||
1094 | # CONFIG_CRYPTO_SEQIV is not set | ||
1095 | |||
1096 | # | ||
1097 | # Block modes | ||
1098 | # | ||
1099 | # CONFIG_CRYPTO_CBC is not set | ||
1100 | # CONFIG_CRYPTO_CTR is not set | ||
1101 | # CONFIG_CRYPTO_CTS is not set | ||
1102 | CONFIG_CRYPTO_ECB=m | ||
1103 | # CONFIG_CRYPTO_LRW is not set | ||
1104 | # CONFIG_CRYPTO_PCBC is not set | ||
1105 | # CONFIG_CRYPTO_XTS is not set | ||
1106 | |||
1107 | # | ||
1108 | # Hash modes | ||
1109 | # | ||
1110 | # CONFIG_CRYPTO_HMAC is not set | ||
1111 | # CONFIG_CRYPTO_XCBC is not set | ||
1112 | |||
1113 | # | ||
1114 | # Digest | ||
1115 | # | ||
1116 | # CONFIG_CRYPTO_CRC32C is not set | ||
1117 | # CONFIG_CRYPTO_MD4 is not set | ||
1118 | # CONFIG_CRYPTO_MD5 is not set | ||
1119 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
1120 | # CONFIG_CRYPTO_RMD128 is not set | ||
1121 | # CONFIG_CRYPTO_RMD160 is not set | ||
1122 | # CONFIG_CRYPTO_RMD256 is not set | ||
1123 | # CONFIG_CRYPTO_RMD320 is not set | ||
1124 | # CONFIG_CRYPTO_SHA1 is not set | ||
1125 | # CONFIG_CRYPTO_SHA256 is not set | ||
1126 | # CONFIG_CRYPTO_SHA512 is not set | ||
1127 | # CONFIG_CRYPTO_TGR192 is not set | ||
1128 | # CONFIG_CRYPTO_WP512 is not set | ||
1129 | |||
1130 | # | ||
1131 | # Ciphers | ||
1132 | # | ||
1133 | CONFIG_CRYPTO_AES=m | ||
1134 | # CONFIG_CRYPTO_ANUBIS is not set | ||
1135 | CONFIG_CRYPTO_ARC4=m | ||
1136 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
1137 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
1138 | # CONFIG_CRYPTO_CAST5 is not set | ||
1139 | # CONFIG_CRYPTO_CAST6 is not set | ||
1140 | # CONFIG_CRYPTO_DES is not set | ||
1141 | # CONFIG_CRYPTO_FCRYPT is not set | ||
1142 | # CONFIG_CRYPTO_KHAZAD is not set | ||
1143 | # CONFIG_CRYPTO_SALSA20 is not set | ||
1144 | # CONFIG_CRYPTO_SEED is not set | ||
1145 | # CONFIG_CRYPTO_SERPENT is not set | ||
1146 | # CONFIG_CRYPTO_TEA is not set | ||
1147 | # CONFIG_CRYPTO_TWOFISH is not set | ||
1148 | |||
1149 | # | ||
1150 | # Compression | ||
1151 | # | ||
1152 | # CONFIG_CRYPTO_DEFLATE is not set | ||
1153 | # CONFIG_CRYPTO_ZLIB is not set | ||
1154 | # CONFIG_CRYPTO_LZO is not set | ||
1155 | |||
1156 | # | ||
1157 | # Random Number Generation | ||
1158 | # | ||
1159 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
1160 | # CONFIG_CRYPTO_HW is not set | ||
1161 | # CONFIG_BINARY_PRINTF is not set | ||
1162 | |||
1163 | # | ||
1164 | # Library routines | ||
1165 | # | ||
1166 | CONFIG_BITREVERSE=y | ||
1167 | CONFIG_GENERIC_FIND_LAST_BIT=y | ||
1168 | CONFIG_CRC_CCITT=m | ||
1169 | # CONFIG_CRC16 is not set | ||
1170 | # CONFIG_CRC_T10DIF is not set | ||
1171 | # CONFIG_CRC_ITU_T is not set | ||
1172 | CONFIG_CRC32=y | ||
1173 | # CONFIG_CRC7 is not set | ||
1174 | # CONFIG_LIBCRC32C is not set | ||
1175 | CONFIG_ZLIB_INFLATE=y | ||
1176 | CONFIG_ZLIB_DEFLATE=y | ||
1177 | CONFIG_DECOMPRESS_GZIP=y | ||
1178 | CONFIG_DECOMPRESS_LZMA=y | ||
1179 | CONFIG_HAS_IOMEM=y | ||
1180 | CONFIG_HAS_IOPORT=y | ||
1181 | CONFIG_HAS_DMA=y | ||
1182 | CONFIG_NLATTR=y | ||
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c index 6a17c9b508ea..7abce661b90f 100644 --- a/arch/mips/dec/ecc-berr.c +++ b/arch/mips/dec/ecc-berr.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/dec/ecc-berr.c | ||
3 | * | ||
4 | * Bus error event handling code for systems equipped with ECC | 2 | * Bus error event handling code for systems equipped with ECC |
5 | * handling logic, i.e. DECstation/DECsystem 5000/200 (KN02), | 3 | * handling logic, i.e. DECstation/DECsystem 5000/200 (KN02), |
6 | * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03), | 4 | * 5000/240 (KN03), 5000/260 (KN05) and DECsystem 5900 (KN03), |
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S index 00cecdcc75f2..82c852818781 100644 --- a/arch/mips/dec/int-handler.S +++ b/arch/mips/dec/int-handler.S | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/dec/int-handler.S | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen | 2 | * Copyright (C) 1995, 1996, 1997 Paul M. Antoine and Harald Koerfgen |
5 | * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki | 3 | * Copyright (C) 2000, 2001, 2002, 2003, 2005 Maciej W. Rozycki |
6 | * | 4 | * |
diff --git a/arch/mips/dec/ioasic-irq.c b/arch/mips/dec/ioasic-irq.c index 3acb133668dc..cb41954fc321 100644 --- a/arch/mips/dec/ioasic-irq.c +++ b/arch/mips/dec/ioasic-irq.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/dec/ioasic-irq.c | ||
3 | * | ||
4 | * DEC I/O ASIC interrupts. | 2 | * DEC I/O ASIC interrupts. |
5 | * | 3 | * |
6 | * Copyright (c) 2002, 2003 Maciej W. Rozycki | 4 | * Copyright (c) 2002, 2003 Maciej W. Rozycki |
diff --git a/arch/mips/dec/kn01-berr.c b/arch/mips/dec/kn01-berr.c index d3b8002bf1e7..b0dc6d53edd6 100644 --- a/arch/mips/dec/kn01-berr.c +++ b/arch/mips/dec/kn01-berr.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/dec/kn01-berr.c | ||
3 | * | ||
4 | * Bus error event handling code for DECstation/DECsystem 3100 | 2 | * Bus error event handling code for DECstation/DECsystem 3100 |
5 | * and 2100 (KN01) systems equipped with parity error detection | 3 | * and 2100 (KN01) systems equipped with parity error detection |
6 | * logic. | 4 | * logic. |
diff --git a/arch/mips/dec/kn02-irq.c b/arch/mips/dec/kn02-irq.c index 02439dc0ba83..ed90a8deabcc 100644 --- a/arch/mips/dec/kn02-irq.c +++ b/arch/mips/dec/kn02-irq.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/dec/kn02-irq.c | ||
3 | * | ||
4 | * DECstation 5000/200 (KN02) Control and Status Register | 2 | * DECstation 5000/200 (KN02) Control and Status Register |
5 | * interrupts. | 3 | * interrupts. |
6 | * | 4 | * |
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c index 5f04545c3606..07ca5405d48d 100644 --- a/arch/mips/dec/kn02xa-berr.c +++ b/arch/mips/dec/kn02xa-berr.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/dec/kn02xa-berr.c | ||
3 | * | ||
4 | * Bus error event handling code for 5000-series systems equipped | 2 | * Bus error event handling code for 5000-series systems equipped |
5 | * with parity error detection logic, i.e. DECstation/DECsystem | 3 | * with parity error detection logic, i.e. DECstation/DECsystem |
6 | * 5000/120, /125, /133 (KN02-BA), 5000/150 (KN04-BA) and Personal | 4 | * 5000/120, /125, /133 (KN02-BA), 5000/150 (KN04-BA) and Personal |
diff --git a/arch/mips/dec/prom/call_o32.S b/arch/mips/dec/prom/call_o32.S index e523454bda3a..8c8498159e43 100644 --- a/arch/mips/dec/prom/call_o32.S +++ b/arch/mips/dec/prom/call_o32.S | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/dec/prom/call_o32.S | ||
3 | * | ||
4 | * O32 interface for the 64 (or N32) ABI. | 2 | * O32 interface for the 64 (or N32) ABI. |
5 | * | 3 | * |
6 | * Copyright (C) 2002 Maciej W. Rozycki | 4 | * Copyright (C) 2002 Maciej W. Rozycki |
diff --git a/arch/mips/dec/prom/console.c b/arch/mips/dec/prom/console.c index 078e1a12421d..caa6e047caf1 100644 --- a/arch/mips/dec/prom/console.c +++ b/arch/mips/dec/prom/console.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/dec/prom/console.c | ||
3 | * | ||
4 | * DECstation PROM-based early console support. | 2 | * DECstation PROM-based early console support. |
5 | * | 3 | * |
6 | * Copyright (C) 2004, 2007 Maciej W. Rozycki | 4 | * Copyright (C) 2004, 2007 Maciej W. Rozycki |
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c index 1359c03ded51..463136e6685a 100644 --- a/arch/mips/dec/time.c +++ b/arch/mips/dec/time.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/dec/time.c | ||
3 | * | ||
4 | * Copyright (C) 1991, 1992, 1995 Linus Torvalds | 2 | * Copyright (C) 1991, 1992, 1995 Linus Torvalds |
5 | * Copyright (C) 2000, 2003 Maciej W. Rozycki | 3 | * Copyright (C) 2000, 2003 Maciej W. Rozycki |
6 | * | 4 | * |
diff --git a/arch/mips/emma/common/Makefile b/arch/mips/emma/common/Makefile index c392d28c1ef1..f27d84d1904f 100644 --- a/arch/mips/emma/common/Makefile +++ b/arch/mips/emma/common/Makefile | |||
@@ -1,7 +1,4 @@ | |||
1 | # | 1 | # |
2 | # arch/mips/emma2rh/common/Makefile | ||
3 | # Makefile for the common code of NEC EMMA2RH based board. | ||
4 | # | ||
5 | # Copyright (C) NEC Electronics Corporation 2005-2006 | 2 | # Copyright (C) NEC Electronics Corporation 2005-2006 |
6 | # | 3 | # |
7 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
diff --git a/arch/mips/emma/common/prom.c b/arch/mips/emma/common/prom.c index 120f53fbdb45..708f08761406 100644 --- a/arch/mips/emma/common/prom.c +++ b/arch/mips/emma/common/prom.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/emma2rh/common/prom.c | ||
3 | * This file is prom file. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This file is based on the arch/mips/ddb5xxx/common/prom.c | 4 | * This file is based on the arch/mips/ddb5xxx/common/prom.c |
diff --git a/arch/mips/emma/markeins/Makefile b/arch/mips/emma/markeins/Makefile index 16e0017ba919..f8ba2508fa2b 100644 --- a/arch/mips/emma/markeins/Makefile +++ b/arch/mips/emma/markeins/Makefile | |||
@@ -1,7 +1,4 @@ | |||
1 | # | 1 | # |
2 | # arch/mips/emma2rh/markeins/Makefile | ||
3 | # Makefile for the common code of NEC EMMA2RH based board. | ||
4 | # | ||
5 | # Copyright (C) NEC Electronics Corporation 2005-2006 | 2 | # Copyright (C) NEC Electronics Corporation 2005-2006 |
6 | # | 3 | # |
7 | # This program is free software; you can redistribute it and/or modify | 4 | # This program is free software; you can redistribute it and/or modify |
diff --git a/arch/mips/emma/markeins/irq.c b/arch/mips/emma/markeins/irq.c index 43828ae796ec..9504b7ee0b7c 100644 --- a/arch/mips/emma/markeins/irq.c +++ b/arch/mips/emma/markeins/irq.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/emma2rh/markeins/irq.c | ||
3 | * This file defines the irq handler for EMMA2RH. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c | 4 | * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c |
diff --git a/arch/mips/emma/markeins/led.c b/arch/mips/emma/markeins/led.c index 377a181b6561..49755896857f 100644 --- a/arch/mips/emma/markeins/led.c +++ b/arch/mips/emma/markeins/led.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/emma2rh/markeins/led.c | ||
3 | * This file defines the led display for Mark-eins. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
diff --git a/arch/mips/emma/markeins/platform.c b/arch/mips/emma/markeins/platform.c index 80ae12ef87db..b05b08b92a34 100644 --- a/arch/mips/emma/markeins/platform.c +++ b/arch/mips/emma/markeins/platform.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/emma2rh/markeins/platofrm.c | ||
3 | * This file sets up platform devices for EMMA2RH Mark-eins. | ||
4 | * | ||
5 | * Copyright(C) MontaVista Software Inc, 2006 | 2 | * Copyright(C) MontaVista Software Inc, 2006 |
6 | * | 3 | * |
7 | * Author: dmitry pervushin <dpervushin@ru.mvista.com> | 4 | * Author: dmitry pervushin <dpervushin@ru.mvista.com> |
diff --git a/arch/mips/emma/markeins/setup.c b/arch/mips/emma/markeins/setup.c index 67f456500084..335dc8c1a1bb 100644 --- a/arch/mips/emma/markeins/setup.c +++ b/arch/mips/emma/markeins/setup.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/emma2rh/markeins/setup.c | ||
3 | * This file is setup for EMMA2RH Mark-eins. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This file is based on the arch/mips/ddb5xxx/ddb5477/setup.c. | 4 | * This file is based on the arch/mips/ddb5xxx/ddb5477/setup.c. |
diff --git a/arch/mips/fw/lib/call_o32.S b/arch/mips/fw/lib/call_o32.S index bdf7d1d4081a..e0a68713b3c3 100644 --- a/arch/mips/fw/lib/call_o32.S +++ b/arch/mips/fw/lib/call_o32.S | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/dec/prom/call_o32.S | ||
3 | * | ||
4 | * O32 interface for the 64 (or N32) ABI. | 2 | * O32 interface for the 64 (or N32) ABI. |
5 | * | 3 | * |
6 | * Copyright (C) 2002 Maciej W. Rozycki | 4 | * Copyright (C) 2002 Maciej W. Rozycki |
diff --git a/arch/mips/gt64120/wrppmc/serial.c b/arch/mips/gt64120/wrppmc/serial.c index 5ec1c2ffd3a5..6f9d0858f596 100644 --- a/arch/mips/gt64120/wrppmc/serial.c +++ b/arch/mips/gt64120/wrppmc/serial.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Registration of WRPPMC UART platform device. | 2 | * Registration of WRPPMC UART platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/amon.h b/arch/mips/include/asm/amon.h new file mode 100644 index 000000000000..c3dc1a68dd8d --- /dev/null +++ b/arch/mips/include/asm/amon.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Amon support | ||
3 | */ | ||
4 | |||
5 | int amon_cpu_avail(int); | ||
6 | void amon_cpu_start(int, unsigned long, unsigned long, | ||
7 | unsigned long, unsigned long); | ||
diff --git a/arch/mips/include/asm/bug.h b/arch/mips/include/asm/bug.h index 08ea46863fe5..6cf29c26e873 100644 --- a/arch/mips/include/asm/bug.h +++ b/arch/mips/include/asm/bug.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_BUG_H | 1 | #ifndef __ASM_BUG_H |
2 | #define __ASM_BUG_H | 2 | #define __ASM_BUG_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | ||
4 | #include <asm/sgidefs.h> | 5 | #include <asm/sgidefs.h> |
5 | 6 | ||
6 | #ifdef CONFIG_BUG | 7 | #ifdef CONFIG_BUG |
diff --git a/arch/mips/include/asm/bugs.h b/arch/mips/include/asm/bugs.h index 9dc10df32078..b160a706795d 100644 --- a/arch/mips/include/asm/bugs.h +++ b/arch/mips/include/asm/bugs.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/bug.h> | 12 | #include <linux/bug.h> |
13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
14 | #include <linux/smp.h> | ||
14 | 15 | ||
15 | #include <asm/cpu.h> | 16 | #include <asm/cpu.h> |
16 | #include <asm/cpu-info.h> | 17 | #include <asm/cpu-info.h> |
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h index c0047f861337..8ab1d12ba7f4 100644 --- a/arch/mips/include/asm/cpu-features.h +++ b/arch/mips/include/asm/cpu-features.h | |||
@@ -147,6 +147,10 @@ | |||
147 | #define cpu_has_mips_r (cpu_has_mips32r1 | cpu_has_mips32r2 | \ | 147 | #define cpu_has_mips_r (cpu_has_mips32r1 | cpu_has_mips32r2 | \ |
148 | cpu_has_mips64r1 | cpu_has_mips64r2) | 148 | cpu_has_mips64r1 | cpu_has_mips64r2) |
149 | 149 | ||
150 | #ifndef cpu_has_mips_r2_exec_hazard | ||
151 | #define cpu_has_mips_r2_exec_hazard cpu_has_mips_r2 | ||
152 | #endif | ||
153 | |||
150 | /* | 154 | /* |
151 | * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other | 155 | * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other |
152 | * pre-MIPS32/MIPS53 processors have CLO, CLZ. For 64-bit kernels | 156 | * pre-MIPS32/MIPS53 processors have CLO, CLZ. For 64-bit kernels |
@@ -230,4 +234,8 @@ | |||
230 | #define cpu_scache_line_size() cpu_data[0].scache.linesz | 234 | #define cpu_scache_line_size() cpu_data[0].scache.linesz |
231 | #endif | 235 | #endif |
232 | 236 | ||
237 | #ifndef cpu_hwrena_impl_bits | ||
238 | #define cpu_hwrena_impl_bits 0 | ||
239 | #endif | ||
240 | |||
233 | #endif /* __ASM_CPU_FEATURES_H */ | 241 | #endif /* __ASM_CPU_FEATURES_H */ |
diff --git a/arch/mips/include/asm/delay.h b/arch/mips/include/asm/delay.h index a07e51b2be13..d2d8949be6b7 100644 --- a/arch/mips/include/asm/delay.h +++ b/arch/mips/include/asm/delay.h | |||
@@ -15,7 +15,7 @@ extern void __delay(unsigned int loops); | |||
15 | extern void __ndelay(unsigned int ns); | 15 | extern void __ndelay(unsigned int ns); |
16 | extern void __udelay(unsigned int us); | 16 | extern void __udelay(unsigned int us); |
17 | 17 | ||
18 | #define ndelay(ns) __udelay(ns) | 18 | #define ndelay(ns) __ndelay(ns) |
19 | #define udelay(us) __udelay(us) | 19 | #define udelay(us) __udelay(us) |
20 | 20 | ||
21 | /* make sure "usecs *= ..." in udelay do not overflow. */ | 21 | /* make sure "usecs *= ..." in udelay do not overflow. */ |
diff --git a/arch/mips/include/asm/ds1287.h b/arch/mips/include/asm/ds1287.h index ba1702e86931..3af0b8fb3b8c 100644 --- a/arch/mips/include/asm/ds1287.h +++ b/arch/mips/include/asm/ds1287.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * DS1287 timer functions. | 2 | * DS1287 timer functions. |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h index d58f128aa747..7990694cda22 100644 --- a/arch/mips/include/asm/elf.h +++ b/arch/mips/include/asm/elf.h | |||
@@ -316,9 +316,13 @@ extern void elf_dump_regs(elf_greg_t *, struct pt_regs *regs); | |||
316 | extern int dump_task_regs(struct task_struct *, elf_gregset_t *); | 316 | extern int dump_task_regs(struct task_struct *, elf_gregset_t *); |
317 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); | 317 | extern int dump_task_fpu(struct task_struct *, elf_fpregset_t *); |
318 | 318 | ||
319 | #ifndef ELF_CORE_COPY_REGS | ||
319 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ | 320 | #define ELF_CORE_COPY_REGS(elf_regs, regs) \ |
320 | elf_dump_regs((elf_greg_t *)&(elf_regs), regs); | 321 | elf_dump_regs((elf_greg_t *)&(elf_regs), regs); |
322 | #endif | ||
323 | #ifndef ELF_CORE_COPY_TASK_REGS | ||
321 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) | 324 | #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs) |
325 | #endif | ||
322 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ | 326 | #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) \ |
323 | dump_task_fpu(tsk, elf_fpregs) | 327 | dump_task_fpu(tsk, elf_fpregs) |
324 | 328 | ||
diff --git a/arch/mips/include/asm/emma/emma2rh.h b/arch/mips/include/asm/emma/emma2rh.h index 30aea91de626..2afb2fe11b30 100644 --- a/arch/mips/include/asm/emma/emma2rh.h +++ b/arch/mips/include/asm/emma/emma2rh.h | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/include/asm/emma/emma2rh.h | ||
3 | * This file is EMMA2RH common header. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2005-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2005-2006 |
6 | * | 3 | * |
7 | * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h | 4 | * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h |
diff --git a/arch/mips/include/asm/emma/markeins.h b/arch/mips/include/asm/emma/markeins.h index 973b0628490d..2618bf230248 100644 --- a/arch/mips/include/asm/emma/markeins.h +++ b/arch/mips/include/asm/emma/markeins.h | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-mips/emma2rh/markeins.h | ||
3 | * This file is EMMA2RH board depended header. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2005-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2005-2006 |
6 | * | 3 | * |
7 | * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h | 4 | * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h |
diff --git a/arch/mips/include/asm/gcmpregs.h b/arch/mips/include/asm/gcmpregs.h index d74a8a4ca861..36fd969d64d6 100644 --- a/arch/mips/include/asm/gcmpregs.h +++ b/arch/mips/include/asm/gcmpregs.h | |||
@@ -114,4 +114,6 @@ | |||
114 | #define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */ | 114 | #define GCMP_CCB_DINTGROUP_OFS 0x0030 /* DINT Group Participate */ |
115 | #define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ | 115 | #define GCMP_CCB_DBGGROUP_OFS 0x0100 /* DebugBreak Group */ |
116 | 116 | ||
117 | extern int __init gcmp_probe(unsigned long, unsigned long); | ||
118 | |||
117 | #endif /* _ASM_GCMPREGS_H */ | 119 | #endif /* _ASM_GCMPREGS_H */ |
diff --git a/arch/mips/include/asm/gic.h b/arch/mips/include/asm/gic.h index 954807d9d66a..a8f57341f123 100644 --- a/arch/mips/include/asm/gic.h +++ b/arch/mips/include/asm/gic.h | |||
@@ -20,7 +20,11 @@ | |||
20 | #define GIC_TRIG_EDGE 1 | 20 | #define GIC_TRIG_EDGE 1 |
21 | #define GIC_TRIG_LEVEL 0 | 21 | #define GIC_TRIG_LEVEL 0 |
22 | 22 | ||
23 | #ifdef CONFIG_SMP | ||
24 | #define GIC_NUM_INTRS (24 + NR_CPUS * 2) | ||
25 | #else | ||
23 | #define GIC_NUM_INTRS 32 | 26 | #define GIC_NUM_INTRS 32 |
27 | #endif | ||
24 | 28 | ||
25 | #define MSK(n) ((1 << (n)) - 1) | 29 | #define MSK(n) ((1 << (n)) - 1) |
26 | #define REG32(addr) (*(volatile unsigned int *) (addr)) | 30 | #define REG32(addr) (*(volatile unsigned int *) (addr)) |
@@ -483,5 +487,7 @@ extern void gic_init(unsigned long gic_base_addr, | |||
483 | 487 | ||
484 | extern unsigned int gic_get_int(void); | 488 | extern unsigned int gic_get_int(void); |
485 | extern void gic_send_ipi(unsigned int intr); | 489 | extern void gic_send_ipi(unsigned int intr); |
490 | extern unsigned int plat_ipi_call_int_xlate(unsigned int); | ||
491 | extern unsigned int plat_ipi_resched_int_xlate(unsigned int); | ||
486 | 492 | ||
487 | #endif /* _ASM_GICREGS_H */ | 493 | #endif /* _ASM_GICREGS_H */ |
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h new file mode 100644 index 000000000000..f5e856015329 --- /dev/null +++ b/arch/mips/include/asm/hugetlb.h | |||
@@ -0,0 +1,114 @@ | |||
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) 2008, 2009 Cavium Networks, Inc. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_HUGETLB_H | ||
10 | #define __ASM_HUGETLB_H | ||
11 | |||
12 | #include <asm/page.h> | ||
13 | |||
14 | |||
15 | static inline int is_hugepage_only_range(struct mm_struct *mm, | ||
16 | unsigned long addr, | ||
17 | unsigned long len) | ||
18 | { | ||
19 | return 0; | ||
20 | } | ||
21 | |||
22 | static inline int prepare_hugepage_range(struct file *file, | ||
23 | unsigned long addr, | ||
24 | unsigned long len) | ||
25 | { | ||
26 | unsigned long task_size = STACK_TOP; | ||
27 | struct hstate *h = hstate_file(file); | ||
28 | |||
29 | if (len & ~huge_page_mask(h)) | ||
30 | return -EINVAL; | ||
31 | if (addr & ~huge_page_mask(h)) | ||
32 | return -EINVAL; | ||
33 | if (len > task_size) | ||
34 | return -ENOMEM; | ||
35 | if (task_size - len < addr) | ||
36 | return -EINVAL; | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb, | ||
45 | unsigned long addr, | ||
46 | unsigned long end, | ||
47 | unsigned long floor, | ||
48 | unsigned long ceiling) | ||
49 | { | ||
50 | free_pgd_range(tlb, addr, end, floor, ceiling); | ||
51 | } | ||
52 | |||
53 | static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
54 | pte_t *ptep, pte_t pte) | ||
55 | { | ||
56 | set_pte_at(mm, addr, ptep, pte); | ||
57 | } | ||
58 | |||
59 | static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | ||
60 | unsigned long addr, pte_t *ptep) | ||
61 | { | ||
62 | pte_t clear; | ||
63 | pte_t pte = *ptep; | ||
64 | |||
65 | pte_val(clear) = (unsigned long)invalid_pte_table; | ||
66 | set_pte_at(mm, addr, ptep, clear); | ||
67 | return pte; | ||
68 | } | ||
69 | |||
70 | static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, | ||
71 | unsigned long addr, pte_t *ptep) | ||
72 | { | ||
73 | } | ||
74 | |||
75 | static inline int huge_pte_none(pte_t pte) | ||
76 | { | ||
77 | unsigned long val = pte_val(pte) & ~_PAGE_GLOBAL; | ||
78 | return !val || (val == (unsigned long)invalid_pte_table); | ||
79 | } | ||
80 | |||
81 | static inline pte_t huge_pte_wrprotect(pte_t pte) | ||
82 | { | ||
83 | return pte_wrprotect(pte); | ||
84 | } | ||
85 | |||
86 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | ||
87 | unsigned long addr, pte_t *ptep) | ||
88 | { | ||
89 | ptep_set_wrprotect(mm, addr, ptep); | ||
90 | } | ||
91 | |||
92 | static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, | ||
93 | unsigned long addr, | ||
94 | pte_t *ptep, pte_t pte, | ||
95 | int dirty) | ||
96 | { | ||
97 | return ptep_set_access_flags(vma, addr, ptep, pte, dirty); | ||
98 | } | ||
99 | |||
100 | static inline pte_t huge_ptep_get(pte_t *ptep) | ||
101 | { | ||
102 | return *ptep; | ||
103 | } | ||
104 | |||
105 | static inline int arch_prepare_hugepage(struct page *page) | ||
106 | { | ||
107 | return 0; | ||
108 | } | ||
109 | |||
110 | static inline void arch_release_hugepage(struct page *page) | ||
111 | { | ||
112 | } | ||
113 | |||
114 | #endif /* __ASM_HUGETLB_H */ | ||
diff --git a/arch/mips/include/asm/ioctl.h b/arch/mips/include/asm/ioctl.h index 916163401b2c..c515a1a4c47c 100644 --- a/arch/mips/include/asm/ioctl.h +++ b/arch/mips/include/asm/ioctl.h | |||
@@ -3,40 +3,16 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle | 6 | * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle <ralf@linux-mips.org> |
7 | * Copyright (C) 2009 Wind River Systems | ||
8 | * Written by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | 9 | */ |
8 | #ifndef _ASM_IOCTL_H | 10 | #ifndef __ASM_IOCTL_H |
9 | #define _ASM_IOCTL_H | 11 | #define __ASM_IOCTL_H |
10 | 12 | ||
11 | /* | ||
12 | * The original linux ioctl numbering scheme was just a general | ||
13 | * "anything goes" setup, where more or less random numbers were | ||
14 | * assigned. Sorry, I was clueless when I started out on this. | ||
15 | * | ||
16 | * On the alpha, we'll try to clean it up a bit, using a more sane | ||
17 | * ioctl numbering, and also trying to be compatible with OSF/1 in | ||
18 | * the process. I'd like to clean it up for the i386 as well, but | ||
19 | * it's so painful recognizing both the new and the old numbers.. | ||
20 | * | ||
21 | * The same applies for for the MIPS ABI; in fact even the macros | ||
22 | * from Linux/Alpha fit almost perfectly. | ||
23 | */ | ||
24 | |||
25 | #define _IOC_NRBITS 8 | ||
26 | #define _IOC_TYPEBITS 8 | ||
27 | #define _IOC_SIZEBITS 13 | 13 | #define _IOC_SIZEBITS 13 |
28 | #define _IOC_DIRBITS 3 | 14 | #define _IOC_DIRBITS 3 |
29 | 15 | ||
30 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
31 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
32 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
33 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
34 | |||
35 | #define _IOC_NRSHIFT 0 | ||
36 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
37 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
38 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
39 | |||
40 | /* | 16 | /* |
41 | * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit. | 17 | * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit. |
42 | * And this turns out useful to catch old ioctl numbers in header | 18 | * And this turns out useful to catch old ioctl numbers in header |
@@ -46,53 +22,6 @@ | |||
46 | #define _IOC_READ 2U | 22 | #define _IOC_READ 2U |
47 | #define _IOC_WRITE 4U | 23 | #define _IOC_WRITE 4U |
48 | 24 | ||
49 | /* | 25 | #include <asm-generic/ioctl.h> |
50 | * The following are included for compatibility | ||
51 | */ | ||
52 | #define _IOC_VOID 0x20000000 | ||
53 | #define _IOC_OUT 0x40000000 | ||
54 | #define _IOC_IN 0x80000000 | ||
55 | #define _IOC_INOUT (IOC_IN|IOC_OUT) | ||
56 | |||
57 | #define _IOC(dir, type, nr, size) \ | ||
58 | (((dir) << _IOC_DIRSHIFT) | \ | ||
59 | ((type) << _IOC_TYPESHIFT) | \ | ||
60 | ((nr) << _IOC_NRSHIFT) | \ | ||
61 | ((size) << _IOC_SIZESHIFT)) | ||
62 | |||
63 | #ifdef __KERNEL__ | ||
64 | /* provoke compile error for invalid uses of size argument */ | ||
65 | extern unsigned int __invalid_size_argument_for_IOC; | ||
66 | #define _IOC_TYPECHECK(t) \ | ||
67 | ((sizeof(t) == sizeof(t[1]) && \ | ||
68 | sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ | ||
69 | sizeof(t) : __invalid_size_argument_for_IOC) | ||
70 | #else | ||
71 | #define _IOC_TYPECHECK(t) (sizeof(t)) | ||
72 | #endif | ||
73 | |||
74 | /* used to create numbers */ | ||
75 | #define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0) | ||
76 | #define _IOR(type, nr, size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size))) | ||
77 | #define _IOW(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size))) | ||
78 | #define _IOWR(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size))) | ||
79 | #define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size)) | ||
80 | #define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size)) | ||
81 | #define _IOWR_BAD(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), sizeof(size)) | ||
82 | |||
83 | |||
84 | /* used to decode them.. */ | ||
85 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
86 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
87 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
88 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
89 | |||
90 | /* ...and for the drivers/sound files... */ | ||
91 | |||
92 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
93 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
94 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
95 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
96 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
97 | 26 | ||
98 | #endif /* _ASM_IOCTL_H */ | 27 | #endif /* __ASM_IOCTL_H */ |
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h index 4f1eed107b08..09b08d05ff72 100644 --- a/arch/mips/include/asm/irq.h +++ b/arch/mips/include/asm/irq.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define _ASM_IRQ_H | 10 | #define _ASM_IRQ_H |
11 | 11 | ||
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <linux/smp.h> | ||
13 | 14 | ||
14 | #include <asm/mipsmtregs.h> | 15 | #include <asm/mipsmtregs.h> |
15 | 16 | ||
diff --git a/arch/mips/include/asm/irq_gt641xx.h b/arch/mips/include/asm/irq_gt641xx.h index f9a7c3ac2e66..250a2407b599 100644 --- a/arch/mips/include/asm/irq_gt641xx.h +++ b/arch/mips/include/asm/irq_gt641xx.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Galileo/Marvell GT641xx IRQ definitions. | 2 | * Galileo/Marvell GT641xx IRQ definitions. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h new file mode 100644 index 000000000000..de71694614de --- /dev/null +++ b/arch/mips/include/asm/mach-ar7/ar7.h | |||
@@ -0,0 +1,178 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006,2007 Felix Fietkau <nbd@openwrt.org> | ||
3 | * Copyright (C) 2006,2007 Eugene Konev <ejka@openwrt.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __AR7_H__ | ||
21 | #define __AR7_H__ | ||
22 | |||
23 | #include <linux/delay.h> | ||
24 | #include <linux/io.h> | ||
25 | #include <linux/errno.h> | ||
26 | |||
27 | #include <asm/addrspace.h> | ||
28 | |||
29 | #define AR7_SDRAM_BASE 0x14000000 | ||
30 | |||
31 | #define AR7_REGS_BASE 0x08610000 | ||
32 | |||
33 | #define AR7_REGS_MAC0 (AR7_REGS_BASE + 0x0000) | ||
34 | #define AR7_REGS_GPIO (AR7_REGS_BASE + 0x0900) | ||
35 | /* 0x08610A00 - 0x08610BFF (512 bytes, 128 bytes / clock) */ | ||
36 | #define AR7_REGS_POWER (AR7_REGS_BASE + 0x0a00) | ||
37 | #define AR7_REGS_CLOCKS (AR7_REGS_POWER + 0x80) | ||
38 | #define UR8_REGS_CLOCKS (AR7_REGS_POWER + 0x20) | ||
39 | #define AR7_REGS_UART0 (AR7_REGS_BASE + 0x0e00) | ||
40 | #define AR7_REGS_USB (AR7_REGS_BASE + 0x1200) | ||
41 | #define AR7_REGS_RESET (AR7_REGS_BASE + 0x1600) | ||
42 | #define AR7_REGS_VLYNQ0 (AR7_REGS_BASE + 0x1800) | ||
43 | #define AR7_REGS_DCL (AR7_REGS_BASE + 0x1a00) | ||
44 | #define AR7_REGS_VLYNQ1 (AR7_REGS_BASE + 0x1c00) | ||
45 | #define AR7_REGS_MDIO (AR7_REGS_BASE + 0x1e00) | ||
46 | #define AR7_REGS_IRQ (AR7_REGS_BASE + 0x2400) | ||
47 | #define AR7_REGS_MAC1 (AR7_REGS_BASE + 0x2800) | ||
48 | |||
49 | #define AR7_REGS_WDT (AR7_REGS_BASE + 0x1f00) | ||
50 | #define UR8_REGS_WDT (AR7_REGS_BASE + 0x0b00) | ||
51 | #define UR8_REGS_UART1 (AR7_REGS_BASE + 0x0f00) | ||
52 | |||
53 | #define AR7_RESET_PEREPHERIAL 0x0 | ||
54 | #define AR7_RESET_SOFTWARE 0x4 | ||
55 | #define AR7_RESET_STATUS 0x8 | ||
56 | |||
57 | #define AR7_RESET_BIT_CPMAC_LO 17 | ||
58 | #define AR7_RESET_BIT_CPMAC_HI 21 | ||
59 | #define AR7_RESET_BIT_MDIO 22 | ||
60 | #define AR7_RESET_BIT_EPHY 26 | ||
61 | |||
62 | /* GPIO control registers */ | ||
63 | #define AR7_GPIO_INPUT 0x0 | ||
64 | #define AR7_GPIO_OUTPUT 0x4 | ||
65 | #define AR7_GPIO_DIR 0x8 | ||
66 | #define AR7_GPIO_ENABLE 0xc | ||
67 | |||
68 | #define AR7_CHIP_7100 0x18 | ||
69 | #define AR7_CHIP_7200 0x2b | ||
70 | #define AR7_CHIP_7300 0x05 | ||
71 | |||
72 | /* Interrupts */ | ||
73 | #define AR7_IRQ_UART0 15 | ||
74 | #define AR7_IRQ_UART1 16 | ||
75 | |||
76 | /* Clocks */ | ||
77 | #define AR7_AFE_CLOCK 35328000 | ||
78 | #define AR7_REF_CLOCK 25000000 | ||
79 | #define AR7_XTAL_CLOCK 24000000 | ||
80 | |||
81 | struct plat_cpmac_data { | ||
82 | int reset_bit; | ||
83 | int power_bit; | ||
84 | u32 phy_mask; | ||
85 | char dev_addr[6]; | ||
86 | }; | ||
87 | |||
88 | struct plat_dsl_data { | ||
89 | int reset_bit_dsl; | ||
90 | int reset_bit_sar; | ||
91 | }; | ||
92 | |||
93 | extern int ar7_cpu_clock, ar7_bus_clock, ar7_dsp_clock; | ||
94 | |||
95 | static inline u16 ar7_chip_id(void) | ||
96 | { | ||
97 | return readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) & 0xffff; | ||
98 | } | ||
99 | |||
100 | static inline u8 ar7_chip_rev(void) | ||
101 | { | ||
102 | return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff; | ||
103 | } | ||
104 | |||
105 | static inline int ar7_cpu_freq(void) | ||
106 | { | ||
107 | return ar7_cpu_clock; | ||
108 | } | ||
109 | |||
110 | static inline int ar7_bus_freq(void) | ||
111 | { | ||
112 | return ar7_bus_clock; | ||
113 | } | ||
114 | |||
115 | static inline int ar7_vbus_freq(void) | ||
116 | { | ||
117 | return ar7_bus_clock / 2; | ||
118 | } | ||
119 | #define ar7_cpmac_freq ar7_vbus_freq | ||
120 | |||
121 | static inline int ar7_dsp_freq(void) | ||
122 | { | ||
123 | return ar7_dsp_clock; | ||
124 | } | ||
125 | |||
126 | static inline int ar7_has_high_cpmac(void) | ||
127 | { | ||
128 | u16 chip_id = ar7_chip_id(); | ||
129 | switch (chip_id) { | ||
130 | case AR7_CHIP_7100: | ||
131 | case AR7_CHIP_7200: | ||
132 | return 0; | ||
133 | case AR7_CHIP_7300: | ||
134 | return 1; | ||
135 | default: | ||
136 | return -ENXIO; | ||
137 | } | ||
138 | } | ||
139 | #define ar7_has_high_vlynq ar7_has_high_cpmac | ||
140 | #define ar7_has_second_uart ar7_has_high_cpmac | ||
141 | |||
142 | static inline void ar7_device_enable(u32 bit) | ||
143 | { | ||
144 | void *reset_reg = | ||
145 | (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL); | ||
146 | writel(readl(reset_reg) | (1 << bit), reset_reg); | ||
147 | msleep(20); | ||
148 | } | ||
149 | |||
150 | static inline void ar7_device_disable(u32 bit) | ||
151 | { | ||
152 | void *reset_reg = | ||
153 | (void *)KSEG1ADDR(AR7_REGS_RESET + AR7_RESET_PEREPHERIAL); | ||
154 | writel(readl(reset_reg) & ~(1 << bit), reset_reg); | ||
155 | msleep(20); | ||
156 | } | ||
157 | |||
158 | static inline void ar7_device_reset(u32 bit) | ||
159 | { | ||
160 | ar7_device_disable(bit); | ||
161 | ar7_device_enable(bit); | ||
162 | } | ||
163 | |||
164 | static inline void ar7_device_on(u32 bit) | ||
165 | { | ||
166 | void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER); | ||
167 | writel(readl(power_reg) | (1 << bit), power_reg); | ||
168 | msleep(20); | ||
169 | } | ||
170 | |||
171 | static inline void ar7_device_off(u32 bit) | ||
172 | { | ||
173 | void *power_reg = (void *)KSEG1ADDR(AR7_REGS_POWER); | ||
174 | writel(readl(power_reg) & ~(1 << bit), power_reg); | ||
175 | msleep(20); | ||
176 | } | ||
177 | |||
178 | #endif /* __AR7_H__ */ | ||
diff --git a/arch/mips/include/asm/mach-ar7/gpio.h b/arch/mips/include/asm/mach-ar7/gpio.h new file mode 100644 index 000000000000..cbe9c4f126df --- /dev/null +++ b/arch/mips/include/asm/mach-ar7/gpio.h | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Florian Fainelli <florian@openwrt.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __AR7_GPIO_H__ | ||
20 | #define __AR7_GPIO_H__ | ||
21 | |||
22 | #include <asm/mach-ar7/ar7.h> | ||
23 | |||
24 | #define AR7_GPIO_MAX 32 | ||
25 | |||
26 | extern int gpio_request(unsigned gpio, const char *label); | ||
27 | extern void gpio_free(unsigned gpio); | ||
28 | |||
29 | /* Common GPIO layer */ | ||
30 | static inline int gpio_get_value(unsigned gpio) | ||
31 | { | ||
32 | void __iomem *gpio_in = | ||
33 | (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_INPUT); | ||
34 | |||
35 | return readl(gpio_in) & (1 << gpio); | ||
36 | } | ||
37 | |||
38 | static inline void gpio_set_value(unsigned gpio, int value) | ||
39 | { | ||
40 | void __iomem *gpio_out = | ||
41 | (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_OUTPUT); | ||
42 | unsigned tmp; | ||
43 | |||
44 | tmp = readl(gpio_out) & ~(1 << gpio); | ||
45 | if (value) | ||
46 | tmp |= 1 << gpio; | ||
47 | writel(tmp, gpio_out); | ||
48 | } | ||
49 | |||
50 | static inline int gpio_direction_input(unsigned gpio) | ||
51 | { | ||
52 | void __iomem *gpio_dir = | ||
53 | (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR); | ||
54 | |||
55 | if (gpio >= AR7_GPIO_MAX) | ||
56 | return -EINVAL; | ||
57 | |||
58 | writel(readl(gpio_dir) | (1 << gpio), gpio_dir); | ||
59 | |||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | static inline int gpio_direction_output(unsigned gpio, int value) | ||
64 | { | ||
65 | void __iomem *gpio_dir = | ||
66 | (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_DIR); | ||
67 | |||
68 | if (gpio >= AR7_GPIO_MAX) | ||
69 | return -EINVAL; | ||
70 | |||
71 | gpio_set_value(gpio, value); | ||
72 | writel(readl(gpio_dir) & ~(1 << gpio), gpio_dir); | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | static inline int gpio_to_irq(unsigned gpio) | ||
78 | { | ||
79 | return -EINVAL; | ||
80 | } | ||
81 | |||
82 | static inline int irq_to_gpio(unsigned irq) | ||
83 | { | ||
84 | return -EINVAL; | ||
85 | } | ||
86 | |||
87 | /* Board specific GPIO functions */ | ||
88 | static inline int ar7_gpio_enable(unsigned gpio) | ||
89 | { | ||
90 | void __iomem *gpio_en = | ||
91 | (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE); | ||
92 | |||
93 | writel(readl(gpio_en) | (1 << gpio), gpio_en); | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | |||
98 | static inline int ar7_gpio_disable(unsigned gpio) | ||
99 | { | ||
100 | void __iomem *gpio_en = | ||
101 | (void __iomem *)KSEG1ADDR(AR7_REGS_GPIO + AR7_GPIO_ENABLE); | ||
102 | |||
103 | writel(readl(gpio_en) & ~(1 << gpio), gpio_en); | ||
104 | |||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | #include <asm-generic/gpio.h> | ||
109 | |||
110 | #endif | ||
diff --git a/arch/mips/include/asm/mach-ar7/irq.h b/arch/mips/include/asm/mach-ar7/irq.h new file mode 100644 index 000000000000..39e9757e3d93 --- /dev/null +++ b/arch/mips/include/asm/mach-ar7/irq.h | |||
@@ -0,0 +1,16 @@ | |||
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 | * Shamelessly copied from asm-mips/mach-emma2rh/ | ||
7 | * Copyright (C) 2003 by Ralf Baechle | ||
8 | */ | ||
9 | #ifndef __ASM_AR7_IRQ_H | ||
10 | #define __ASM_AR7_IRQ_H | ||
11 | |||
12 | #define NR_IRQS 256 | ||
13 | |||
14 | #include_next <irq.h> | ||
15 | |||
16 | #endif /* __ASM_AR7_IRQ_H */ | ||
diff --git a/arch/mips/include/asm/mach-ar7/prom.h b/arch/mips/include/asm/mach-ar7/prom.h new file mode 100644 index 000000000000..088f61fe85ea --- /dev/null +++ b/arch/mips/include/asm/mach-ar7/prom.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006, 2007 Florian Fainelli <florian@openwrt.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __PROM_H__ | ||
20 | #define __PROM_H__ | ||
21 | |||
22 | extern char *prom_getenv(const char *name); | ||
23 | extern void prom_meminit(void); | ||
24 | |||
25 | #endif /* __PROM_H__ */ | ||
diff --git a/arch/mips/include/asm/mach-ar7/spaces.h b/arch/mips/include/asm/mach-ar7/spaces.h new file mode 100644 index 000000000000..ac28f273449c --- /dev/null +++ b/arch/mips/include/asm/mach-ar7/spaces.h | |||
@@ -0,0 +1,22 @@ | |||
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) 1994 - 1999, 2000, 03, 04 Ralf Baechle | ||
7 | * Copyright (C) 2000, 2002 Maciej W. Rozycki | ||
8 | * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc. | ||
9 | */ | ||
10 | #ifndef _ASM_AR7_SPACES_H | ||
11 | #define _ASM_AR7_SPACES_H | ||
12 | |||
13 | /* | ||
14 | * This handles the memory map. | ||
15 | * We handle pages at KSEG0 for kernels with 32 bit address space. | ||
16 | */ | ||
17 | #define PAGE_OFFSET 0x94000000UL | ||
18 | #define PHYS_OFFSET 0x14000000UL | ||
19 | |||
20 | #include <asm/mach-generic/spaces.h> | ||
21 | |||
22 | #endif /* __ASM_AR7_SPACES_H */ | ||
diff --git a/arch/mips/include/asm/mach-ar7/war.h b/arch/mips/include/asm/mach-ar7/war.h new file mode 100644 index 000000000000..f4862b563080 --- /dev/null +++ b/arch/mips/include/asm/mach-ar7/war.h | |||
@@ -0,0 +1,25 @@ | |||
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) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | ||
7 | */ | ||
8 | #ifndef __ASM_MIPS_MACH_AR7_WAR_H | ||
9 | #define __ASM_MIPS_MACH_AR7_WAR_H | ||
10 | |||
11 | #define R4600_V1_INDEX_ICACHEOP_WAR 0 | ||
12 | #define R4600_V1_HIT_CACHEOP_WAR 0 | ||
13 | #define R4600_V2_HIT_CACHEOP_WAR 0 | ||
14 | #define R5432_CP0_INTERRUPT_WAR 0 | ||
15 | #define BCM1250_M3_WAR 0 | ||
16 | #define SIBYTE_1956_WAR 0 | ||
17 | #define MIPS4K_ICACHE_REFILL_WAR 0 | ||
18 | #define MIPS_CACHE_SYNC_WAR 0 | ||
19 | #define TX49XX_ICACHE_INDEX_INV_WAR 0 | ||
20 | #define RM9000_CDEX_SMP_WAR 0 | ||
21 | #define ICACHE_REFILLS_WORKAROUND_WAR 0 | ||
22 | #define R10000_LLSC_WAR 0 | ||
23 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
24 | |||
25 | #endif /* __ASM_MIPS_MACH_AR7_WAR_H */ | ||
diff --git a/arch/mips/include/asm/mach-au1x00/au1000_gpio.h b/arch/mips/include/asm/mach-au1x00/au1000_gpio.h deleted file mode 100644 index d8c96fda5549..000000000000 --- a/arch/mips/include/asm/mach-au1x00/au1000_gpio.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * FILE NAME au1000_gpio.h | ||
3 | * | ||
4 | * BRIEF MODULE DESCRIPTION | ||
5 | * API to Alchemy Au1xx0 GPIO device. | ||
6 | * | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * Steve Longerbeam | ||
9 | * | ||
10 | * Copyright 2001, 2008 MontaVista Software Inc. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
20 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
23 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
24 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | * | ||
28 | * You should have received a copy of the GNU General Public License along | ||
29 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
31 | */ | ||
32 | |||
33 | #ifndef __AU1000_GPIO_H | ||
34 | #define __AU1000_GPIO_H | ||
35 | |||
36 | #include <linux/ioctl.h> | ||
37 | |||
38 | #define AU1000GPIO_IOC_MAGIC 'A' | ||
39 | |||
40 | #define AU1000GPIO_IN _IOR(AU1000GPIO_IOC_MAGIC, 0, int) | ||
41 | #define AU1000GPIO_SET _IOW(AU1000GPIO_IOC_MAGIC, 1, int) | ||
42 | #define AU1000GPIO_CLEAR _IOW(AU1000GPIO_IOC_MAGIC, 2, int) | ||
43 | #define AU1000GPIO_OUT _IOW(AU1000GPIO_IOC_MAGIC, 3, int) | ||
44 | #define AU1000GPIO_TRISTATE _IOW(AU1000GPIO_IOC_MAGIC, 4, int) | ||
45 | #define AU1000GPIO_AVAIL_MASK _IOR(AU1000GPIO_IOC_MAGIC, 5, int) | ||
46 | |||
47 | #ifdef __KERNEL__ | ||
48 | extern u32 get_au1000_avail_gpio_mask(void); | ||
49 | extern int au1000gpio_tristate(u32 data); | ||
50 | extern int au1000gpio_in(u32 *data); | ||
51 | extern int au1000gpio_set(u32 data); | ||
52 | extern int au1000gpio_clear(u32 data); | ||
53 | extern int au1000gpio_out(u32 data); | ||
54 | #endif | ||
55 | |||
56 | #endif | ||
diff --git a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h new file mode 100644 index 000000000000..127d4ed9f073 --- /dev/null +++ b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h | |||
@@ -0,0 +1,604 @@ | |||
1 | /* | ||
2 | * GPIO functions for Au1000, Au1500, Au1100, Au1550, Au1200 | ||
3 | * | ||
4 | * Copyright (c) 2009 Manuel Lauss. | ||
5 | * | ||
6 | * Licensed under the terms outlined in the file COPYING. | ||
7 | */ | ||
8 | |||
9 | #ifndef _ALCHEMY_GPIO_AU1000_H_ | ||
10 | #define _ALCHEMY_GPIO_AU1000_H_ | ||
11 | |||
12 | #include <asm/mach-au1x00/au1000.h> | ||
13 | |||
14 | /* The default GPIO numberspace as documented in the Alchemy manuals. | ||
15 | * GPIO0-31 from GPIO1 block, GPIO200-215 from GPIO2 block. | ||
16 | */ | ||
17 | #define ALCHEMY_GPIO1_BASE 0 | ||
18 | #define ALCHEMY_GPIO2_BASE 200 | ||
19 | |||
20 | #define ALCHEMY_GPIO1_NUM 32 | ||
21 | #define ALCHEMY_GPIO2_NUM 16 | ||
22 | #define ALCHEMY_GPIO1_MAX (ALCHEMY_GPIO1_BASE + ALCHEMY_GPIO1_NUM - 1) | ||
23 | #define ALCHEMY_GPIO2_MAX (ALCHEMY_GPIO2_BASE + ALCHEMY_GPIO2_NUM - 1) | ||
24 | |||
25 | #define MAKE_IRQ(intc, off) (AU1000_INTC##intc##_INT_BASE + (off)) | ||
26 | |||
27 | |||
28 | static inline int au1000_gpio1_to_irq(int gpio) | ||
29 | { | ||
30 | return MAKE_IRQ(1, gpio - ALCHEMY_GPIO1_BASE); | ||
31 | } | ||
32 | |||
33 | static inline int au1000_gpio2_to_irq(int gpio) | ||
34 | { | ||
35 | return -ENXIO; | ||
36 | } | ||
37 | |||
38 | #ifdef CONFIG_SOC_AU1000 | ||
39 | static inline int au1000_irq_to_gpio(int irq) | ||
40 | { | ||
41 | if ((irq >= AU1000_GPIO_0) && (irq <= AU1000_GPIO_31)) | ||
42 | return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; | ||
43 | |||
44 | return -ENXIO; | ||
45 | } | ||
46 | #endif | ||
47 | |||
48 | static inline int au1500_gpio1_to_irq(int gpio) | ||
49 | { | ||
50 | gpio -= ALCHEMY_GPIO1_BASE; | ||
51 | |||
52 | switch (gpio) { | ||
53 | case 0 ... 15: | ||
54 | case 20: | ||
55 | case 23 ... 28: return MAKE_IRQ(1, gpio); | ||
56 | } | ||
57 | |||
58 | return -ENXIO; | ||
59 | } | ||
60 | |||
61 | static inline int au1500_gpio2_to_irq(int gpio) | ||
62 | { | ||
63 | gpio -= ALCHEMY_GPIO2_BASE; | ||
64 | |||
65 | switch (gpio) { | ||
66 | case 0 ... 3: return MAKE_IRQ(1, 16 + gpio - 0); | ||
67 | case 4 ... 5: return MAKE_IRQ(1, 21 + gpio - 4); | ||
68 | case 6 ... 7: return MAKE_IRQ(1, 29 + gpio - 6); | ||
69 | } | ||
70 | |||
71 | return -ENXIO; | ||
72 | } | ||
73 | |||
74 | #ifdef CONFIG_SOC_AU1500 | ||
75 | static inline int au1500_irq_to_gpio(int irq) | ||
76 | { | ||
77 | switch (irq) { | ||
78 | case AU1000_GPIO_0 ... AU1000_GPIO_15: | ||
79 | case AU1500_GPIO_20: | ||
80 | case AU1500_GPIO_23 ... AU1500_GPIO_28: | ||
81 | return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; | ||
82 | case AU1500_GPIO_200 ... AU1500_GPIO_203: | ||
83 | return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_200) + 0; | ||
84 | case AU1500_GPIO_204 ... AU1500_GPIO_205: | ||
85 | return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_204) + 4; | ||
86 | case AU1500_GPIO_206 ... AU1500_GPIO_207: | ||
87 | return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_206) + 6; | ||
88 | case AU1500_GPIO_208_215: | ||
89 | return ALCHEMY_GPIO2_BASE + 8; | ||
90 | } | ||
91 | |||
92 | return -ENXIO; | ||
93 | } | ||
94 | #endif | ||
95 | |||
96 | static inline int au1100_gpio1_to_irq(int gpio) | ||
97 | { | ||
98 | return MAKE_IRQ(1, gpio - ALCHEMY_GPIO1_BASE); | ||
99 | } | ||
100 | |||
101 | static inline int au1100_gpio2_to_irq(int gpio) | ||
102 | { | ||
103 | gpio -= ALCHEMY_GPIO2_BASE; | ||
104 | |||
105 | if ((gpio >= 8) && (gpio <= 15)) | ||
106 | return MAKE_IRQ(0, 29); /* shared GPIO208_215 */ | ||
107 | } | ||
108 | |||
109 | #ifdef CONFIG_SOC_AU1100 | ||
110 | static inline int au1100_irq_to_gpio(int irq) | ||
111 | { | ||
112 | switch (irq) { | ||
113 | case AU1000_GPIO_0 ... AU1000_GPIO_31: | ||
114 | return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; | ||
115 | case AU1100_GPIO_208_215: | ||
116 | return ALCHEMY_GPIO2_BASE + 8; | ||
117 | } | ||
118 | |||
119 | return -ENXIO; | ||
120 | } | ||
121 | #endif | ||
122 | |||
123 | static inline int au1550_gpio1_to_irq(int gpio) | ||
124 | { | ||
125 | gpio -= ALCHEMY_GPIO1_BASE; | ||
126 | |||
127 | switch (gpio) { | ||
128 | case 0 ... 15: | ||
129 | case 20 ... 28: return MAKE_IRQ(1, gpio); | ||
130 | case 16 ... 17: return MAKE_IRQ(1, 18 + gpio - 16); | ||
131 | } | ||
132 | |||
133 | return -ENXIO; | ||
134 | } | ||
135 | |||
136 | static inline int au1550_gpio2_to_irq(int gpio) | ||
137 | { | ||
138 | gpio -= ALCHEMY_GPIO2_BASE; | ||
139 | |||
140 | switch (gpio) { | ||
141 | case 0: return MAKE_IRQ(1, 16); | ||
142 | case 1 ... 5: return MAKE_IRQ(1, 17); /* shared GPIO201_205 */ | ||
143 | case 6 ... 7: return MAKE_IRQ(1, 29 + gpio - 6); | ||
144 | case 8 ... 15: return MAKE_IRQ(1, 31); /* shared GPIO208_215 */ | ||
145 | } | ||
146 | |||
147 | return -ENXIO; | ||
148 | } | ||
149 | |||
150 | #ifdef CONFIG_SOC_AU1550 | ||
151 | static inline int au1550_irq_to_gpio(int irq) | ||
152 | { | ||
153 | switch (irq) { | ||
154 | case AU1000_GPIO_0 ... AU1000_GPIO_15: | ||
155 | return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; | ||
156 | case AU1550_GPIO_200: | ||
157 | case AU1500_GPIO_201_205: | ||
158 | return ALCHEMY_GPIO2_BASE + (irq - AU1550_GPIO_200) + 0; | ||
159 | case AU1500_GPIO_16 ... AU1500_GPIO_28: | ||
160 | return ALCHEMY_GPIO1_BASE + (irq - AU1500_GPIO_16) + 16; | ||
161 | case AU1500_GPIO_206 ... AU1500_GPIO_208_218: | ||
162 | return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_206) + 6; | ||
163 | } | ||
164 | |||
165 | return -ENXIO; | ||
166 | } | ||
167 | #endif | ||
168 | |||
169 | static inline int au1200_gpio1_to_irq(int gpio) | ||
170 | { | ||
171 | return MAKE_IRQ(1, gpio - ALCHEMY_GPIO1_BASE); | ||
172 | } | ||
173 | |||
174 | static inline int au1200_gpio2_to_irq(int gpio) | ||
175 | { | ||
176 | gpio -= ALCHEMY_GPIO2_BASE; | ||
177 | |||
178 | switch (gpio) { | ||
179 | case 0 ... 2: return MAKE_IRQ(0, 5 + gpio - 0); | ||
180 | case 3: return MAKE_IRQ(0, 22); | ||
181 | case 4 ... 7: return MAKE_IRQ(0, 24 + gpio - 4); | ||
182 | case 8 ... 15: return MAKE_IRQ(0, 28); /* shared GPIO208_215 */ | ||
183 | } | ||
184 | |||
185 | return -ENXIO; | ||
186 | } | ||
187 | |||
188 | #ifdef CONFIG_SOC_AU1200 | ||
189 | static inline int au1200_irq_to_gpio(int irq) | ||
190 | { | ||
191 | switch (irq) { | ||
192 | case AU1000_GPIO_0 ... AU1000_GPIO_31: | ||
193 | return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0; | ||
194 | case AU1200_GPIO_200 ... AU1200_GPIO_202: | ||
195 | return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO_200) + 0; | ||
196 | case AU1200_GPIO_203: | ||
197 | return ALCHEMY_GPIO2_BASE + 3; | ||
198 | case AU1200_GPIO_204 ... AU1200_GPIO_208_215: | ||
199 | return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO_204) + 4; | ||
200 | } | ||
201 | |||
202 | return -ENXIO; | ||
203 | } | ||
204 | #endif | ||
205 | |||
206 | /* | ||
207 | * GPIO1 block macros for common linux gpio functions. | ||
208 | */ | ||
209 | static inline void alchemy_gpio1_set_value(int gpio, int v) | ||
210 | { | ||
211 | unsigned long mask = 1 << (gpio - ALCHEMY_GPIO1_BASE); | ||
212 | unsigned long r = v ? SYS_OUTPUTSET : SYS_OUTPUTCLR; | ||
213 | au_writel(mask, r); | ||
214 | au_sync(); | ||
215 | } | ||
216 | |||
217 | static inline int alchemy_gpio1_get_value(int gpio) | ||
218 | { | ||
219 | unsigned long mask = 1 << (gpio - ALCHEMY_GPIO1_BASE); | ||
220 | return au_readl(SYS_PINSTATERD) & mask; | ||
221 | } | ||
222 | |||
223 | static inline int alchemy_gpio1_direction_input(int gpio) | ||
224 | { | ||
225 | unsigned long mask = 1 << (gpio - ALCHEMY_GPIO1_BASE); | ||
226 | au_writel(mask, SYS_TRIOUTCLR); | ||
227 | au_sync(); | ||
228 | return 0; | ||
229 | } | ||
230 | |||
231 | static inline int alchemy_gpio1_direction_output(int gpio, int v) | ||
232 | { | ||
233 | /* hardware switches to "output" mode when one of the two | ||
234 | * "set_value" registers is accessed. | ||
235 | */ | ||
236 | alchemy_gpio1_set_value(gpio, v); | ||
237 | return 0; | ||
238 | } | ||
239 | |||
240 | static inline int alchemy_gpio1_is_valid(int gpio) | ||
241 | { | ||
242 | return ((gpio >= ALCHEMY_GPIO1_BASE) && (gpio <= ALCHEMY_GPIO1_MAX)); | ||
243 | } | ||
244 | |||
245 | static inline int alchemy_gpio1_to_irq(int gpio) | ||
246 | { | ||
247 | #if defined(CONFIG_SOC_AU1000) | ||
248 | return au1000_gpio1_to_irq(gpio); | ||
249 | #elif defined(CONFIG_SOC_AU1100) | ||
250 | return au1100_gpio1_to_irq(gpio); | ||
251 | #elif defined(CONFIG_SOC_AU1500) | ||
252 | return au1500_gpio1_to_irq(gpio); | ||
253 | #elif defined(CONFIG_SOC_AU1550) | ||
254 | return au1550_gpio1_to_irq(gpio); | ||
255 | #elif defined(CONFIG_SOC_AU1200) | ||
256 | return au1200_gpio1_to_irq(gpio); | ||
257 | #else | ||
258 | return -ENXIO; | ||
259 | #endif | ||
260 | } | ||
261 | |||
262 | /* | ||
263 | * GPIO2 block macros for common linux GPIO functions. The 'gpio' | ||
264 | * parameter must be in range of ALCHEMY_GPIO2_BASE..ALCHEMY_GPIO2_MAX. | ||
265 | */ | ||
266 | static inline void __alchemy_gpio2_mod_dir(int gpio, int to_out) | ||
267 | { | ||
268 | unsigned long mask = 1 << (gpio - ALCHEMY_GPIO2_BASE); | ||
269 | unsigned long d = au_readl(GPIO2_DIR); | ||
270 | if (to_out) | ||
271 | d |= mask; | ||
272 | else | ||
273 | d &= ~mask; | ||
274 | au_writel(d, GPIO2_DIR); | ||
275 | au_sync(); | ||
276 | } | ||
277 | |||
278 | static inline void alchemy_gpio2_set_value(int gpio, int v) | ||
279 | { | ||
280 | unsigned long mask; | ||
281 | mask = ((v) ? 0x00010001 : 0x00010000) << (gpio - ALCHEMY_GPIO2_BASE); | ||
282 | au_writel(mask, GPIO2_OUTPUT); | ||
283 | au_sync(); | ||
284 | } | ||
285 | |||
286 | static inline int alchemy_gpio2_get_value(int gpio) | ||
287 | { | ||
288 | return au_readl(GPIO2_PINSTATE) & (1 << (gpio - ALCHEMY_GPIO2_BASE)); | ||
289 | } | ||
290 | |||
291 | static inline int alchemy_gpio2_direction_input(int gpio) | ||
292 | { | ||
293 | unsigned long flags; | ||
294 | local_irq_save(flags); | ||
295 | __alchemy_gpio2_mod_dir(gpio, 0); | ||
296 | local_irq_restore(flags); | ||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline int alchemy_gpio2_direction_output(int gpio, int v) | ||
301 | { | ||
302 | unsigned long flags; | ||
303 | alchemy_gpio2_set_value(gpio, v); | ||
304 | local_irq_save(flags); | ||
305 | __alchemy_gpio2_mod_dir(gpio, 1); | ||
306 | local_irq_restore(flags); | ||
307 | return 0; | ||
308 | } | ||
309 | |||
310 | static inline int alchemy_gpio2_is_valid(int gpio) | ||
311 | { | ||
312 | return ((gpio >= ALCHEMY_GPIO2_BASE) && (gpio <= ALCHEMY_GPIO2_MAX)); | ||
313 | } | ||
314 | |||
315 | static inline int alchemy_gpio2_to_irq(int gpio) | ||
316 | { | ||
317 | #if defined(CONFIG_SOC_AU1000) | ||
318 | return au1000_gpio2_to_irq(gpio); | ||
319 | #elif defined(CONFIG_SOC_AU1100) | ||
320 | return au1100_gpio2_to_irq(gpio); | ||
321 | #elif defined(CONFIG_SOC_AU1500) | ||
322 | return au1500_gpio2_to_irq(gpio); | ||
323 | #elif defined(CONFIG_SOC_AU1550) | ||
324 | return au1550_gpio2_to_irq(gpio); | ||
325 | #elif defined(CONFIG_SOC_AU1200) | ||
326 | return au1200_gpio2_to_irq(gpio); | ||
327 | #else | ||
328 | return -ENXIO; | ||
329 | #endif | ||
330 | } | ||
331 | |||
332 | /**********************************************************************/ | ||
333 | |||
334 | /* On Au1000, Au1500 and Au1100 GPIOs won't work as inputs before | ||
335 | * SYS_PININPUTEN is written to at least once. On Au1550/Au1200 this | ||
336 | * register enables use of GPIOs as wake source. | ||
337 | */ | ||
338 | static inline void alchemy_gpio1_input_enable(void) | ||
339 | { | ||
340 | au_writel(0, SYS_PININPUTEN); /* the write op is key */ | ||
341 | au_sync(); | ||
342 | } | ||
343 | |||
344 | /* GPIO2 shared interrupts and control */ | ||
345 | |||
346 | static inline void __alchemy_gpio2_mod_int(int gpio2, int en) | ||
347 | { | ||
348 | unsigned long r = au_readl(GPIO2_INTENABLE); | ||
349 | if (en) | ||
350 | r |= 1 << gpio2; | ||
351 | else | ||
352 | r &= ~(1 << gpio2); | ||
353 | au_writel(r, GPIO2_INTENABLE); | ||
354 | au_sync(); | ||
355 | } | ||
356 | |||
357 | /** | ||
358 | * alchemy_gpio2_enable_int - Enable a GPIO2 pins' shared irq contribution. | ||
359 | * @gpio2: The GPIO2 pin to activate (200...215). | ||
360 | * | ||
361 | * GPIO208-215 have one shared interrupt line to the INTC. They are | ||
362 | * and'ed with a per-pin enable bit and finally or'ed together to form | ||
363 | * a single irq request (useful for active-high sources). | ||
364 | * With this function, a pins' individual contribution to the int request | ||
365 | * can be enabled. As with all other GPIO-based interrupts, the INTC | ||
366 | * must be programmed to accept the GPIO208_215 interrupt as well. | ||
367 | * | ||
368 | * NOTE: Calling this macro is only necessary for GPIO208-215; all other | ||
369 | * GPIO2-based interrupts have their own request to the INTC. Please | ||
370 | * consult your Alchemy databook for more information! | ||
371 | * | ||
372 | * NOTE: On the Au1550, GPIOs 201-205 also have a shared interrupt request | ||
373 | * line to the INTC, GPIO201_205. This function can be used for those | ||
374 | * as well. | ||
375 | * | ||
376 | * NOTE: 'gpio2' parameter must be in range of the GPIO2 numberspace | ||
377 | * (200-215 by default). No sanity checks are made, | ||
378 | */ | ||
379 | static inline void alchemy_gpio2_enable_int(int gpio2) | ||
380 | { | ||
381 | unsigned long flags; | ||
382 | |||
383 | gpio2 -= ALCHEMY_GPIO2_BASE; | ||
384 | |||
385 | #if defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500) | ||
386 | /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */ | ||
387 | gpio2 -= 8; | ||
388 | #endif | ||
389 | local_irq_save(flags); | ||
390 | __alchemy_gpio2_mod_int(gpio2, 1); | ||
391 | local_irq_restore(flags); | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * alchemy_gpio2_disable_int - Disable a GPIO2 pins' shared irq contribution. | ||
396 | * @gpio2: The GPIO2 pin to activate (200...215). | ||
397 | * | ||
398 | * see function alchemy_gpio2_enable_int() for more information. | ||
399 | */ | ||
400 | static inline void alchemy_gpio2_disable_int(int gpio2) | ||
401 | { | ||
402 | unsigned long flags; | ||
403 | |||
404 | gpio2 -= ALCHEMY_GPIO2_BASE; | ||
405 | |||
406 | #if defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500) | ||
407 | /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */ | ||
408 | gpio2 -= 8; | ||
409 | #endif | ||
410 | local_irq_save(flags); | ||
411 | __alchemy_gpio2_mod_int(gpio2, 0); | ||
412 | local_irq_restore(flags); | ||
413 | } | ||
414 | |||
415 | /** | ||
416 | * alchemy_gpio2_enable - Activate GPIO2 block. | ||
417 | * | ||
418 | * The GPIO2 block must be enabled excplicitly to work. On systems | ||
419 | * where this isn't done by the bootloader, this macro can be used. | ||
420 | */ | ||
421 | static inline void alchemy_gpio2_enable(void) | ||
422 | { | ||
423 | au_writel(3, GPIO2_ENABLE); /* reset, clock enabled */ | ||
424 | au_sync(); | ||
425 | au_writel(1, GPIO2_ENABLE); /* clock enabled */ | ||
426 | au_sync(); | ||
427 | } | ||
428 | |||
429 | /** | ||
430 | * alchemy_gpio2_disable - disable GPIO2 block. | ||
431 | * | ||
432 | * Disable and put GPIO2 block in low-power mode. | ||
433 | */ | ||
434 | static inline void alchemy_gpio2_disable(void) | ||
435 | { | ||
436 | au_writel(2, GPIO2_ENABLE); /* reset, clock disabled */ | ||
437 | au_sync(); | ||
438 | } | ||
439 | |||
440 | /**********************************************************************/ | ||
441 | |||
442 | /* wrappers for on-chip gpios; can be used before gpio chips have been | ||
443 | * registered with gpiolib. | ||
444 | */ | ||
445 | static inline int alchemy_gpio_direction_input(int gpio) | ||
446 | { | ||
447 | return (gpio >= ALCHEMY_GPIO2_BASE) ? | ||
448 | alchemy_gpio2_direction_input(gpio) : | ||
449 | alchemy_gpio1_direction_input(gpio); | ||
450 | } | ||
451 | |||
452 | static inline int alchemy_gpio_direction_output(int gpio, int v) | ||
453 | { | ||
454 | return (gpio >= ALCHEMY_GPIO2_BASE) ? | ||
455 | alchemy_gpio2_direction_output(gpio, v) : | ||
456 | alchemy_gpio1_direction_output(gpio, v); | ||
457 | } | ||
458 | |||
459 | static inline int alchemy_gpio_get_value(int gpio) | ||
460 | { | ||
461 | return (gpio >= ALCHEMY_GPIO2_BASE) ? | ||
462 | alchemy_gpio2_get_value(gpio) : | ||
463 | alchemy_gpio1_get_value(gpio); | ||
464 | } | ||
465 | |||
466 | static inline void alchemy_gpio_set_value(int gpio, int v) | ||
467 | { | ||
468 | if (gpio >= ALCHEMY_GPIO2_BASE) | ||
469 | alchemy_gpio2_set_value(gpio, v); | ||
470 | else | ||
471 | alchemy_gpio1_set_value(gpio, v); | ||
472 | } | ||
473 | |||
474 | static inline int alchemy_gpio_is_valid(int gpio) | ||
475 | { | ||
476 | return (gpio >= ALCHEMY_GPIO2_BASE) ? | ||
477 | alchemy_gpio2_is_valid(gpio) : | ||
478 | alchemy_gpio1_is_valid(gpio); | ||
479 | } | ||
480 | |||
481 | static inline int alchemy_gpio_cansleep(int gpio) | ||
482 | { | ||
483 | return 0; /* Alchemy never gets tired */ | ||
484 | } | ||
485 | |||
486 | static inline int alchemy_gpio_to_irq(int gpio) | ||
487 | { | ||
488 | return (gpio >= ALCHEMY_GPIO2_BASE) ? | ||
489 | alchemy_gpio2_to_irq(gpio) : | ||
490 | alchemy_gpio1_to_irq(gpio); | ||
491 | } | ||
492 | |||
493 | static inline int alchemy_irq_to_gpio(int irq) | ||
494 | { | ||
495 | #if defined(CONFIG_SOC_AU1000) | ||
496 | return au1000_irq_to_gpio(irq); | ||
497 | #elif defined(CONFIG_SOC_AU1100) | ||
498 | return au1100_irq_to_gpio(irq); | ||
499 | #elif defined(CONFIG_SOC_AU1500) | ||
500 | return au1500_irq_to_gpio(irq); | ||
501 | #elif defined(CONFIG_SOC_AU1550) | ||
502 | return au1550_irq_to_gpio(irq); | ||
503 | #elif defined(CONFIG_SOC_AU1200) | ||
504 | return au1200_irq_to_gpio(irq); | ||
505 | #else | ||
506 | return -ENXIO; | ||
507 | #endif | ||
508 | } | ||
509 | |||
510 | /**********************************************************************/ | ||
511 | |||
512 | /* Linux gpio framework integration. | ||
513 | * | ||
514 | * 4 use cases of Au1000-Au1200 GPIOS: | ||
515 | *(1) GPIOLIB=y, ALCHEMY_GPIO_INDIRECT=y: | ||
516 | * Board must register gpiochips. | ||
517 | *(2) GPIOLIB=y, ALCHEMY_GPIO_INDIRECT=n: | ||
518 | * 2 (1 for Au1000) gpio_chips are registered. | ||
519 | * | ||
520 | *(3) GPIOLIB=n, ALCHEMY_GPIO_INDIRECT=y: | ||
521 | * the boards' gpio.h must provide the linux gpio wrapper functions, | ||
522 | * | ||
523 | *(4) GPIOLIB=n, ALCHEMY_GPIO_INDIRECT=n: | ||
524 | * inlinable gpio functions are provided which enable access to the | ||
525 | * Au1000 gpios only by using the numbers straight out of the data- | ||
526 | * sheets. | ||
527 | |||
528 | * Cases 1 and 3 are intended for boards which want to provide their own | ||
529 | * GPIO namespace and -operations (i.e. for example you have 8 GPIOs | ||
530 | * which are in part provided by spare Au1000 GPIO pins and in part by | ||
531 | * an external FPGA but you still want them to be accssible in linux | ||
532 | * as gpio0-7. The board can of course use the alchemy_gpioX_* functions | ||
533 | * as required). | ||
534 | */ | ||
535 | |||
536 | #ifndef CONFIG_GPIOLIB | ||
537 | |||
538 | |||
539 | #ifndef CONFIG_ALCHEMY_GPIO_INDIRECT /* case (4) */ | ||
540 | |||
541 | static inline int gpio_direction_input(int gpio) | ||
542 | { | ||
543 | return alchemy_gpio_direction_input(gpio); | ||
544 | } | ||
545 | |||
546 | static inline int gpio_direction_output(int gpio, int v) | ||
547 | { | ||
548 | return alchemy_gpio_direction_output(gpio, v); | ||
549 | } | ||
550 | |||
551 | static inline int gpio_get_value(int gpio) | ||
552 | { | ||
553 | return alchemy_gpio_get_value(gpio); | ||
554 | } | ||
555 | |||
556 | static inline void gpio_set_value(int gpio, int v) | ||
557 | { | ||
558 | alchemy_gpio_set_value(gpio, v); | ||
559 | } | ||
560 | |||
561 | static inline int gpio_is_valid(int gpio) | ||
562 | { | ||
563 | return alchemy_gpio_is_valid(gpio); | ||
564 | } | ||
565 | |||
566 | static inline int gpio_cansleep(int gpio) | ||
567 | { | ||
568 | return alchemy_gpio_cansleep(gpio); | ||
569 | } | ||
570 | |||
571 | static inline int gpio_to_irq(int gpio) | ||
572 | { | ||
573 | return alchemy_gpio_to_irq(gpio); | ||
574 | } | ||
575 | |||
576 | static inline int irq_to_gpio(int irq) | ||
577 | { | ||
578 | return alchemy_irq_to_gpio(irq); | ||
579 | } | ||
580 | |||
581 | #endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */ | ||
582 | |||
583 | |||
584 | #else /* CONFIG GPIOLIB */ | ||
585 | |||
586 | |||
587 | /* using gpiolib to provide up to 2 gpio_chips for on-chip gpios */ | ||
588 | #ifndef CONFIG_ALCHEMY_GPIO_INDIRECT /* case (2) */ | ||
589 | |||
590 | /* get everything through gpiolib */ | ||
591 | #define gpio_to_irq __gpio_to_irq | ||
592 | #define gpio_get_value __gpio_get_value | ||
593 | #define gpio_set_value __gpio_set_value | ||
594 | #define gpio_cansleep __gpio_cansleep | ||
595 | #define irq_to_gpio alchemy_irq_to_gpio | ||
596 | |||
597 | #include <asm-generic/gpio.h> | ||
598 | |||
599 | #endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */ | ||
600 | |||
601 | |||
602 | #endif /* !CONFIG_GPIOLIB */ | ||
603 | |||
604 | #endif /* _ALCHEMY_GPIO_AU1000_H_ */ | ||
diff --git a/arch/mips/include/asm/mach-au1x00/gpio.h b/arch/mips/include/asm/mach-au1x00/gpio.h index 34d9b7279024..f9b7d41c659a 100644 --- a/arch/mips/include/asm/mach-au1x00/gpio.h +++ b/arch/mips/include/asm/mach-au1x00/gpio.h | |||
@@ -1,33 +1,10 @@ | |||
1 | #ifndef _AU1XXX_GPIO_H_ | 1 | #ifndef _ALCHEMY_GPIO_H_ |
2 | #define _AU1XXX_GPIO_H_ | 2 | #define _ALCHEMY_GPIO_H_ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #if defined(CONFIG_ALCHEMY_GPIO_AU1000) |
5 | 5 | ||
6 | #define AU1XXX_GPIO_BASE 200 | 6 | #include <asm/mach-au1x00/gpio-au1000.h> |
7 | 7 | ||
8 | /* GPIO bank 1 offsets */ | 8 | #endif |
9 | #define AU1000_GPIO1_TRI_OUT 0x0100 | ||
10 | #define AU1000_GPIO1_OUT 0x0108 | ||
11 | #define AU1000_GPIO1_ST 0x0110 | ||
12 | #define AU1000_GPIO1_CLR 0x010C | ||
13 | 9 | ||
14 | /* GPIO bank 2 offsets */ | 10 | #endif /* _ALCHEMY_GPIO_H_ */ |
15 | #define AU1000_GPIO2_DIR 0x00 | ||
16 | #define AU1000_GPIO2_RSVD 0x04 | ||
17 | #define AU1000_GPIO2_OUT 0x08 | ||
18 | #define AU1000_GPIO2_ST 0x0C | ||
19 | #define AU1000_GPIO2_INT 0x10 | ||
20 | #define AU1000_GPIO2_EN 0x14 | ||
21 | |||
22 | #define GPIO2_OUT_EN_MASK 0x00010000 | ||
23 | |||
24 | #define gpio_to_irq(gpio) NULL | ||
25 | |||
26 | #define gpio_get_value __gpio_get_value | ||
27 | #define gpio_set_value __gpio_set_value | ||
28 | |||
29 | #define gpio_cansleep __gpio_cansleep | ||
30 | |||
31 | #include <asm-generic/gpio.h> | ||
32 | |||
33 | #endif /* _AU1XXX_GPIO_H_ */ | ||
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h index 1784fde2e28f..98504142124e 100644 --- a/arch/mips/include/asm/mach-bcm47xx/gpio.h +++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h | |||
@@ -37,6 +37,9 @@ static inline int gpio_direction_input(unsigned gpio) | |||
37 | 37 | ||
38 | static inline int gpio_direction_output(unsigned gpio, int value) | 38 | static inline int gpio_direction_output(unsigned gpio, int value) |
39 | { | 39 | { |
40 | /* first set the gpio out value */ | ||
41 | ssb_gpio_out(&ssb_bcm47xx, 1 << gpio, value ? 1 << gpio : 0); | ||
42 | /* then set the gpio mode */ | ||
40 | ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1 << gpio); | 43 | ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1 << gpio); |
41 | return 0; | 44 | return 0; |
42 | } | 45 | } |
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h index 04ce6e6569da..3d830756b13a 100644 --- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h | |||
@@ -47,11 +47,13 @@ | |||
47 | #define cpu_has_mips32r2 0 | 47 | #define cpu_has_mips32r2 0 |
48 | #define cpu_has_mips64r1 0 | 48 | #define cpu_has_mips64r1 0 |
49 | #define cpu_has_mips64r2 1 | 49 | #define cpu_has_mips64r2 1 |
50 | #define cpu_has_mips_r2_exec_hazard 0 | ||
50 | #define cpu_has_dsp 0 | 51 | #define cpu_has_dsp 0 |
51 | #define cpu_has_mipsmt 0 | 52 | #define cpu_has_mipsmt 0 |
52 | #define cpu_has_userlocal 0 | 53 | #define cpu_has_userlocal 0 |
53 | #define cpu_has_vint 0 | 54 | #define cpu_has_vint 0 |
54 | #define cpu_has_veic 0 | 55 | #define cpu_has_veic 0 |
56 | #define cpu_hwrena_impl_bits 0xc0000000 | ||
55 | #define ARCH_HAS_READ_CURRENT_TIMER 1 | 57 | #define ARCH_HAS_READ_CURRENT_TIMER 1 |
56 | #define ARCH_HAS_IRQ_PER_CPU 1 | 58 | #define ARCH_HAS_IRQ_PER_CPU 1 |
57 | #define ARCH_HAS_SPINLOCK_PREFETCH 1 | 59 | #define ARCH_HAS_SPINLOCK_PREFETCH 1 |
diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h index f30fce92aabb..17d579471ec4 100644 --- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h +++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h | |||
@@ -30,12 +30,14 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | |||
30 | return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE); | 30 | return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE); |
31 | } | 31 | } |
32 | 32 | ||
33 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | 33 | static inline unsigned long plat_dma_addr_to_phys(struct device *dev, |
34 | dma_addr_t dma_addr) | ||
34 | { | 35 | { |
35 | return dma_addr; | 36 | return dma_addr; |
36 | } | 37 | } |
37 | 38 | ||
38 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 39 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, |
40 | size_t size, enum dma_data_direction direction) | ||
39 | { | 41 | { |
40 | octeon_unmap_dma_mem(dev, dma_addr); | 42 | octeon_unmap_dma_mem(dev, dma_addr); |
41 | } | 43 | } |
diff --git a/arch/mips/include/asm/mach-cobalt/irq.h b/arch/mips/include/asm/mach-cobalt/irq.h index 57c8c9ac5851..9da9acf5dcba 100644 --- a/arch/mips/include/asm/mach-cobalt/irq.h +++ b/arch/mips/include/asm/mach-cobalt/irq.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * Copyright (C) 1997 Cobalt Microserver | 8 | * Copyright (C) 1997 Cobalt Microserver |
9 | * Copyright (C) 1997, 2003 Ralf Baechle | 9 | * Copyright (C) 1997, 2003 Ralf Baechle |
10 | * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv) | 10 | * Copyright (C) 2001-2003 Liam Davies (ldavies@agile.tv) |
11 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 11 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
12 | */ | 12 | */ |
13 | #ifndef _ASM_COBALT_IRQ_H | 13 | #ifndef _ASM_COBALT_IRQ_H |
14 | #define _ASM_COBALT_IRQ_H | 14 | #define _ASM_COBALT_IRQ_H |
diff --git a/arch/mips/include/asm/mach-cobalt/mach-gt64120.h b/arch/mips/include/asm/mach-cobalt/mach-gt64120.h index ae9c5523c7ef..f8afec3f2943 100644 --- a/arch/mips/include/asm/mach-cobalt/mach-gt64120.h +++ b/arch/mips/include/asm/mach-cobalt/mach-gt64120.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 2 | * Copyright (C) 2006 Yoichi Yuasa <yuasa@linux-mips.org> |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h index 36c611b6c597..8da98073e952 100644 --- a/arch/mips/include/asm/mach-generic/dma-coherence.h +++ b/arch/mips/include/asm/mach-generic/dma-coherence.h | |||
@@ -23,12 +23,14 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | |||
23 | return page_to_phys(page); | 23 | return page_to_phys(page); |
24 | } | 24 | } |
25 | 25 | ||
26 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | 26 | static inline unsigned long plat_dma_addr_to_phys(struct device *dev, |
27 | dma_addr_t dma_addr) | ||
27 | { | 28 | { |
28 | return dma_addr; | 29 | return dma_addr; |
29 | } | 30 | } |
30 | 31 | ||
31 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 32 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, |
33 | size_t size, enum dma_data_direction direction) | ||
32 | { | 34 | { |
33 | } | 35 | } |
34 | 36 | ||
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h index 4c21bfca10c3..d3d04018a858 100644 --- a/arch/mips/include/asm/mach-ip27/dma-coherence.h +++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h | |||
@@ -33,12 +33,14 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) | |||
33 | return pa; | 33 | return pa; |
34 | } | 34 | } |
35 | 35 | ||
36 | static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | 36 | static unsigned long plat_dma_addr_to_phys(struct device *dev, |
37 | dma_addr_t dma_addr) | ||
37 | { | 38 | { |
38 | return dma_addr & ~(0xffUL << 56); | 39 | return dma_addr & ~(0xffUL << 56); |
39 | } | 40 | } |
40 | 41 | ||
41 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 42 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, |
43 | size_t size, enum dma_data_direction direction) | ||
42 | { | 44 | { |
43 | } | 45 | } |
44 | 46 | ||
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h index 7ae40f4b1c80..37855955b313 100644 --- a/arch/mips/include/asm/mach-ip32/dma-coherence.h +++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h | |||
@@ -50,7 +50,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | /* This is almost certainly wrong but it's what dma-ip32.c used to use */ | 52 | /* This is almost certainly wrong but it's what dma-ip32.c used to use */ |
53 | static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | 53 | static unsigned long plat_dma_addr_to_phys(struct device *dev, |
54 | dma_addr_t dma_addr) | ||
54 | { | 55 | { |
55 | unsigned long addr = dma_addr & RAM_OFFSET_MASK; | 56 | unsigned long addr = dma_addr & RAM_OFFSET_MASK; |
56 | 57 | ||
@@ -60,7 +61,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
60 | return addr; | 61 | return addr; |
61 | } | 62 | } |
62 | 63 | ||
63 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 64 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, |
65 | size_t size, enum dma_data_direction direction) | ||
64 | { | 66 | { |
65 | } | 67 | } |
66 | 68 | ||
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h index 1c7cd27efa7b..f93aee59454a 100644 --- a/arch/mips/include/asm/mach-jazz/dma-coherence.h +++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h | |||
@@ -22,12 +22,14 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page) | |||
22 | return vdma_alloc(page_to_phys(page), PAGE_SIZE); | 22 | return vdma_alloc(page_to_phys(page), PAGE_SIZE); |
23 | } | 23 | } |
24 | 24 | ||
25 | static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | 25 | static unsigned long plat_dma_addr_to_phys(struct device *dev, |
26 | dma_addr_t dma_addr) | ||
26 | { | 27 | { |
27 | return vdma_log2phys(dma_addr); | 28 | return vdma_log2phys(dma_addr); |
28 | } | 29 | } |
29 | 30 | ||
30 | static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 31 | static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, |
32 | size_t size, enum dma_data_direction direction) | ||
31 | { | 33 | { |
32 | vdma_free(dma_addr); | 34 | vdma_free(dma_addr); |
33 | } | 35 | } |
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-lemote/dma-coherence.h index 38fad7dfe7da..c8de5e750777 100644 --- a/arch/mips/include/asm/mach-lemote/dma-coherence.h +++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h | |||
@@ -25,12 +25,14 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev, | |||
25 | return page_to_phys(page) | 0x80000000; | 25 | return page_to_phys(page) | 0x80000000; |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | 28 | static inline unsigned long plat_dma_addr_to_phys(struct device *dev, |
29 | dma_addr_t dma_addr) | ||
29 | { | 30 | { |
30 | return dma_addr & 0x7fffffff; | 31 | return dma_addr & 0x7fffffff; |
31 | } | 32 | } |
32 | 33 | ||
33 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) | 34 | static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr, |
35 | size_t size, enum dma_data_direction direction) | ||
34 | { | 36 | { |
35 | } | 37 | } |
36 | 38 | ||
diff --git a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h index f3bc7efa2608..c3e4d3a4c95d 100644 --- a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h +++ b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h | |||
@@ -53,11 +53,6 @@ | |||
53 | #define cpu_has_smartmips 0 | 53 | #define cpu_has_smartmips 0 |
54 | 54 | ||
55 | #define cpu_has_vtag_icache 0 | 55 | #define cpu_has_vtag_icache 0 |
56 | /* #define cpu_has_dc_aliases ? */ | ||
57 | /* #define cpu_has_ic_fills_f_dc ? */ | ||
58 | /* #define cpu_has_pindexed_dcache ? */ | ||
59 | |||
60 | /* #define cpu_icache_snoops_remote_store ? */ | ||
61 | 56 | ||
62 | #define cpu_has_mips32r1 1 | 57 | #define cpu_has_mips32r1 1 |
63 | #define cpu_has_mips32r2 0 | 58 | #define cpu_has_mips32r2 0 |
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 32ef8bec5c85..a581d60cbcc2 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -220,6 +220,22 @@ | |||
220 | #error Bad page size configuration! | 220 | #error Bad page size configuration! |
221 | #endif | 221 | #endif |
222 | 222 | ||
223 | /* | ||
224 | * Default huge tlb size for a given kernel configuration | ||
225 | */ | ||
226 | #ifdef CONFIG_PAGE_SIZE_4KB | ||
227 | #define PM_HUGE_MASK PM_1M | ||
228 | #elif defined(CONFIG_PAGE_SIZE_8KB) | ||
229 | #define PM_HUGE_MASK PM_4M | ||
230 | #elif defined(CONFIG_PAGE_SIZE_16KB) | ||
231 | #define PM_HUGE_MASK PM_16M | ||
232 | #elif defined(CONFIG_PAGE_SIZE_32KB) | ||
233 | #define PM_HUGE_MASK PM_64M | ||
234 | #elif defined(CONFIG_PAGE_SIZE_64KB) | ||
235 | #define PM_HUGE_MASK PM_256M | ||
236 | #elif defined(CONFIG_HUGETLB_PAGE) | ||
237 | #error Bad page size configuration for hugetlbfs! | ||
238 | #endif | ||
223 | 239 | ||
224 | /* | 240 | /* |
225 | * Values used for computation of new tlb entries | 241 | * Values used for computation of new tlb entries |
diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index d7f3eb03ad12..d3bea88d8744 100644 --- a/arch/mips/include/asm/mmu_context.h +++ b/arch/mips/include/asm/mmu_context.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/smp.h> | ||
16 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
17 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
18 | #include <asm/tlbflush.h> | 19 | #include <asm/tlbflush.h> |
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h index 692989acd8a9..f3c23a43f845 100644 --- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h +++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h | |||
@@ -157,6 +157,13 @@ enum cvmx_board_types_enum { | |||
157 | CVMX_BOARD_TYPE_NIC_XLE_4G = 21, | 157 | CVMX_BOARD_TYPE_NIC_XLE_4G = 21, |
158 | CVMX_BOARD_TYPE_EBT5600 = 22, | 158 | CVMX_BOARD_TYPE_EBT5600 = 22, |
159 | CVMX_BOARD_TYPE_EBH5201 = 23, | 159 | CVMX_BOARD_TYPE_EBH5201 = 23, |
160 | CVMX_BOARD_TYPE_EBT5200 = 24, | ||
161 | CVMX_BOARD_TYPE_CB5600 = 25, | ||
162 | CVMX_BOARD_TYPE_CB5601 = 26, | ||
163 | CVMX_BOARD_TYPE_CB5200 = 27, | ||
164 | /* Special 'generic' board type, supports many boards */ | ||
165 | CVMX_BOARD_TYPE_GENERIC = 28, | ||
166 | CVMX_BOARD_TYPE_EBH5610 = 29, | ||
160 | CVMX_BOARD_TYPE_MAX, | 167 | CVMX_BOARD_TYPE_MAX, |
161 | 168 | ||
162 | /* | 169 | /* |
@@ -228,6 +235,12 @@ static inline const char *cvmx_board_type_to_string(enum | |||
228 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G) | 235 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G) |
229 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600) | 236 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600) |
230 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201) | 237 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201) |
238 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5200) | ||
239 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5600) | ||
240 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5601) | ||
241 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5200) | ||
242 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_GENERIC) | ||
243 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5610) | ||
231 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX) | 244 | ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX) |
232 | 245 | ||
233 | /* Customer boards listed here */ | 246 | /* Customer boards listed here */ |
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h index 1cbe4b55889d..8e708bdb43f7 100644 --- a/arch/mips/include/asm/octeon/cvmx-bootmem.h +++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h | |||
@@ -183,6 +183,64 @@ extern void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment, | |||
183 | * Returns 0 on failure, | 183 | * Returns 0 on failure, |
184 | * !0 on success | 184 | * !0 on success |
185 | */ | 185 | */ |
186 | |||
187 | |||
188 | /** | ||
189 | * Allocate a block of memory from the free list that was passed | ||
190 | * to the application by the bootloader, and assign it a name in the | ||
191 | * global named block table. (part of the cvmx_bootmem_descriptor_t structure) | ||
192 | * Named blocks can later be freed. | ||
193 | * | ||
194 | * @size: Size in bytes of block to allocate | ||
195 | * @alignment: Alignment required - must be power of 2 | ||
196 | * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes | ||
197 | * | ||
198 | * Returns a pointer to block of memory, NULL on error | ||
199 | */ | ||
200 | extern void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment, | ||
201 | char *name); | ||
202 | |||
203 | |||
204 | |||
205 | /** | ||
206 | * Allocate a block of memory from the free list that was passed | ||
207 | * to the application by the bootloader, and assign it a name in the | ||
208 | * global named block table. (part of the cvmx_bootmem_descriptor_t structure) | ||
209 | * Named blocks can later be freed. | ||
210 | * | ||
211 | * @size: Size in bytes of block to allocate | ||
212 | * @address: Physical address to allocate memory at. If this | ||
213 | * memory is not available, the allocation fails. | ||
214 | * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN | ||
215 | * bytes | ||
216 | * | ||
217 | * Returns a pointer to block of memory, NULL on error | ||
218 | */ | ||
219 | extern void *cvmx_bootmem_alloc_named_address(uint64_t size, uint64_t address, | ||
220 | char *name); | ||
221 | |||
222 | |||
223 | |||
224 | /** | ||
225 | * Allocate a block of memory from a specific range of the free list | ||
226 | * that was passed to the application by the bootloader, and assign it | ||
227 | * a name in the global named block table. (part of the | ||
228 | * cvmx_bootmem_descriptor_t structure) Named blocks can later be | ||
229 | * freed. If request cannot be satisfied within the address range | ||
230 | * specified, NULL is returned | ||
231 | * | ||
232 | * @size: Size in bytes of block to allocate | ||
233 | * @min_addr: minimum address of range | ||
234 | * @max_addr: maximum address of range | ||
235 | * @align: Alignment of memory to be allocated. (must be a power of 2) | ||
236 | * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes | ||
237 | * | ||
238 | * Returns a pointer to block of memory, NULL on error | ||
239 | */ | ||
240 | extern void *cvmx_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr, | ||
241 | uint64_t max_addr, uint64_t align, | ||
242 | char *name); | ||
243 | |||
186 | extern int cvmx_bootmem_free_named(char *name); | 244 | extern int cvmx_bootmem_free_named(char *name); |
187 | 245 | ||
188 | /** | 246 | /** |
@@ -224,6 +282,33 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min, | |||
224 | uint32_t flags); | 282 | uint32_t flags); |
225 | 283 | ||
226 | /** | 284 | /** |
285 | * Allocates a named block of physical memory from the free list, at | ||
286 | * (optional) requested address and alignment. | ||
287 | * | ||
288 | * @param size size of region to allocate. All requests are rounded | ||
289 | * up to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE | ||
290 | * bytes size | ||
291 | * @param min_addr Minimum address that block can occupy. | ||
292 | * @param max_addr Specifies the maximum address_min (inclusive) that | ||
293 | * the allocation can use. | ||
294 | * @param alignment Requested alignment of the block. If this | ||
295 | * alignment cannot be met, the allocation fails. | ||
296 | * This must be a power of 2. (Note: Alignment of | ||
297 | * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and | ||
298 | * internally enforced. Requested alignments of less | ||
299 | * than CVMX_BOOTMEM_ALIGNMENT_SIZE are set to | ||
300 | * CVMX_BOOTMEM_ALIGNMENT_SIZE.) | ||
301 | * @param name name to assign to named block | ||
302 | * @param flags Flags to control options for the allocation. | ||
303 | * | ||
304 | * @return physical address of block allocated, or -1 on failure | ||
305 | */ | ||
306 | int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr, | ||
307 | uint64_t max_addr, | ||
308 | uint64_t alignment, | ||
309 | char *name, uint32_t flags); | ||
310 | |||
311 | /** | ||
227 | * Finds a named memory block by name. | 312 | * Finds a named memory block by name. |
228 | * Also used for finding an unused entry in the named block table. | 313 | * Also used for finding an unused entry in the named block table. |
229 | * | 314 | * |
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-errata.h b/arch/mips/include/asm/octeon/cvmx-helper-errata.h new file mode 100644 index 000000000000..5fc99189ff58 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-helper-errata.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_HELPER_ERRATA_H__ | ||
29 | #define __CVMX_HELPER_ERRATA_H__ | ||
30 | |||
31 | extern void __cvmx_helper_errata_qlm_disable_2nd_order_cdr(int qlm); | ||
32 | |||
33 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-jtag.h b/arch/mips/include/asm/octeon/cvmx-helper-jtag.h new file mode 100644 index 000000000000..29f016ddb895 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-helper-jtag.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /** | ||
29 | * @file | ||
30 | * | ||
31 | * Helper utilities for qlm_jtag. | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | #ifndef __CVMX_HELPER_JTAG_H__ | ||
36 | #define __CVMX_HELPER_JTAG_H__ | ||
37 | |||
38 | extern void cvmx_helper_qlm_jtag_init(void); | ||
39 | extern uint32_t cvmx_helper_qlm_jtag_shift(int qlm, int bits, uint32_t data); | ||
40 | extern void cvmx_helper_qlm_jtag_shift_zeros(int qlm, int bits); | ||
41 | extern void cvmx_helper_qlm_jtag_update(int qlm); | ||
42 | |||
43 | #endif /* __CVMX_HELPER_JTAG_H__ */ | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-npei-defs.h b/arch/mips/include/asm/octeon/cvmx-npei-defs.h new file mode 100644 index 000000000000..4b347bb8ce80 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-npei-defs.h | |||
@@ -0,0 +1,2560 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_NPEI_DEFS_H__ | ||
29 | #define __CVMX_NPEI_DEFS_H__ | ||
30 | |||
31 | #define CVMX_NPEI_BAR1_INDEXX(offset) \ | ||
32 | (0x0000000000000000ull + (((offset) & 31) * 16)) | ||
33 | #define CVMX_NPEI_BIST_STATUS \ | ||
34 | (0x0000000000000580ull) | ||
35 | #define CVMX_NPEI_BIST_STATUS2 \ | ||
36 | (0x0000000000000680ull) | ||
37 | #define CVMX_NPEI_CTL_PORT0 \ | ||
38 | (0x0000000000000250ull) | ||
39 | #define CVMX_NPEI_CTL_PORT1 \ | ||
40 | (0x0000000000000260ull) | ||
41 | #define CVMX_NPEI_CTL_STATUS \ | ||
42 | (0x0000000000000570ull) | ||
43 | #define CVMX_NPEI_CTL_STATUS2 \ | ||
44 | (0x0000000000003C00ull) | ||
45 | #define CVMX_NPEI_DATA_OUT_CNT \ | ||
46 | (0x00000000000005F0ull) | ||
47 | #define CVMX_NPEI_DBG_DATA \ | ||
48 | (0x0000000000000510ull) | ||
49 | #define CVMX_NPEI_DBG_SELECT \ | ||
50 | (0x0000000000000500ull) | ||
51 | #define CVMX_NPEI_DMA0_INT_LEVEL \ | ||
52 | (0x00000000000005C0ull) | ||
53 | #define CVMX_NPEI_DMA1_INT_LEVEL \ | ||
54 | (0x00000000000005D0ull) | ||
55 | #define CVMX_NPEI_DMAX_COUNTS(offset) \ | ||
56 | (0x0000000000000450ull + (((offset) & 7) * 16)) | ||
57 | #define CVMX_NPEI_DMAX_DBELL(offset) \ | ||
58 | (0x00000000000003B0ull + (((offset) & 7) * 16)) | ||
59 | #define CVMX_NPEI_DMAX_IBUFF_SADDR(offset) \ | ||
60 | (0x0000000000000400ull + (((offset) & 7) * 16)) | ||
61 | #define CVMX_NPEI_DMAX_NADDR(offset) \ | ||
62 | (0x00000000000004A0ull + (((offset) & 7) * 16)) | ||
63 | #define CVMX_NPEI_DMA_CNTS \ | ||
64 | (0x00000000000005E0ull) | ||
65 | #define CVMX_NPEI_DMA_CONTROL \ | ||
66 | (0x00000000000003A0ull) | ||
67 | #define CVMX_NPEI_INT_A_ENB \ | ||
68 | (0x0000000000000560ull) | ||
69 | #define CVMX_NPEI_INT_A_ENB2 \ | ||
70 | (0x0000000000003CE0ull) | ||
71 | #define CVMX_NPEI_INT_A_SUM \ | ||
72 | (0x0000000000000550ull) | ||
73 | #define CVMX_NPEI_INT_ENB \ | ||
74 | (0x0000000000000540ull) | ||
75 | #define CVMX_NPEI_INT_ENB2 \ | ||
76 | (0x0000000000003CD0ull) | ||
77 | #define CVMX_NPEI_INT_INFO \ | ||
78 | (0x0000000000000590ull) | ||
79 | #define CVMX_NPEI_INT_SUM \ | ||
80 | (0x0000000000000530ull) | ||
81 | #define CVMX_NPEI_INT_SUM2 \ | ||
82 | (0x0000000000003CC0ull) | ||
83 | #define CVMX_NPEI_LAST_WIN_RDATA0 \ | ||
84 | (0x0000000000000600ull) | ||
85 | #define CVMX_NPEI_LAST_WIN_RDATA1 \ | ||
86 | (0x0000000000000610ull) | ||
87 | #define CVMX_NPEI_MEM_ACCESS_CTL \ | ||
88 | (0x00000000000004F0ull) | ||
89 | #define CVMX_NPEI_MEM_ACCESS_SUBIDX(offset) \ | ||
90 | (0x0000000000000340ull + (((offset) & 31) * 16) - 16 * 12) | ||
91 | #define CVMX_NPEI_MSI_ENB0 \ | ||
92 | (0x0000000000003C50ull) | ||
93 | #define CVMX_NPEI_MSI_ENB1 \ | ||
94 | (0x0000000000003C60ull) | ||
95 | #define CVMX_NPEI_MSI_ENB2 \ | ||
96 | (0x0000000000003C70ull) | ||
97 | #define CVMX_NPEI_MSI_ENB3 \ | ||
98 | (0x0000000000003C80ull) | ||
99 | #define CVMX_NPEI_MSI_RCV0 \ | ||
100 | (0x0000000000003C10ull) | ||
101 | #define CVMX_NPEI_MSI_RCV1 \ | ||
102 | (0x0000000000003C20ull) | ||
103 | #define CVMX_NPEI_MSI_RCV2 \ | ||
104 | (0x0000000000003C30ull) | ||
105 | #define CVMX_NPEI_MSI_RCV3 \ | ||
106 | (0x0000000000003C40ull) | ||
107 | #define CVMX_NPEI_MSI_RD_MAP \ | ||
108 | (0x0000000000003CA0ull) | ||
109 | #define CVMX_NPEI_MSI_W1C_ENB0 \ | ||
110 | (0x0000000000003CF0ull) | ||
111 | #define CVMX_NPEI_MSI_W1C_ENB1 \ | ||
112 | (0x0000000000003D00ull) | ||
113 | #define CVMX_NPEI_MSI_W1C_ENB2 \ | ||
114 | (0x0000000000003D10ull) | ||
115 | #define CVMX_NPEI_MSI_W1C_ENB3 \ | ||
116 | (0x0000000000003D20ull) | ||
117 | #define CVMX_NPEI_MSI_W1S_ENB0 \ | ||
118 | (0x0000000000003D30ull) | ||
119 | #define CVMX_NPEI_MSI_W1S_ENB1 \ | ||
120 | (0x0000000000003D40ull) | ||
121 | #define CVMX_NPEI_MSI_W1S_ENB2 \ | ||
122 | (0x0000000000003D50ull) | ||
123 | #define CVMX_NPEI_MSI_W1S_ENB3 \ | ||
124 | (0x0000000000003D60ull) | ||
125 | #define CVMX_NPEI_MSI_WR_MAP \ | ||
126 | (0x0000000000003C90ull) | ||
127 | #define CVMX_NPEI_PCIE_CREDIT_CNT \ | ||
128 | (0x0000000000003D70ull) | ||
129 | #define CVMX_NPEI_PCIE_MSI_RCV \ | ||
130 | (0x0000000000003CB0ull) | ||
131 | #define CVMX_NPEI_PCIE_MSI_RCV_B1 \ | ||
132 | (0x0000000000000650ull) | ||
133 | #define CVMX_NPEI_PCIE_MSI_RCV_B2 \ | ||
134 | (0x0000000000000660ull) | ||
135 | #define CVMX_NPEI_PCIE_MSI_RCV_B3 \ | ||
136 | (0x0000000000000670ull) | ||
137 | #define CVMX_NPEI_PKTX_CNTS(offset) \ | ||
138 | (0x0000000000002400ull + (((offset) & 31) * 16)) | ||
139 | #define CVMX_NPEI_PKTX_INSTR_BADDR(offset) \ | ||
140 | (0x0000000000002800ull + (((offset) & 31) * 16)) | ||
141 | #define CVMX_NPEI_PKTX_INSTR_BAOFF_DBELL(offset) \ | ||
142 | (0x0000000000002C00ull + (((offset) & 31) * 16)) | ||
143 | #define CVMX_NPEI_PKTX_INSTR_FIFO_RSIZE(offset) \ | ||
144 | (0x0000000000003000ull + (((offset) & 31) * 16)) | ||
145 | #define CVMX_NPEI_PKTX_INSTR_HEADER(offset) \ | ||
146 | (0x0000000000003400ull + (((offset) & 31) * 16)) | ||
147 | #define CVMX_NPEI_PKTX_IN_BP(offset) \ | ||
148 | (0x0000000000003800ull + (((offset) & 31) * 16)) | ||
149 | #define CVMX_NPEI_PKTX_SLIST_BADDR(offset) \ | ||
150 | (0x0000000000001400ull + (((offset) & 31) * 16)) | ||
151 | #define CVMX_NPEI_PKTX_SLIST_BAOFF_DBELL(offset) \ | ||
152 | (0x0000000000001800ull + (((offset) & 31) * 16)) | ||
153 | #define CVMX_NPEI_PKTX_SLIST_FIFO_RSIZE(offset) \ | ||
154 | (0x0000000000001C00ull + (((offset) & 31) * 16)) | ||
155 | #define CVMX_NPEI_PKT_CNT_INT \ | ||
156 | (0x0000000000001110ull) | ||
157 | #define CVMX_NPEI_PKT_CNT_INT_ENB \ | ||
158 | (0x0000000000001130ull) | ||
159 | #define CVMX_NPEI_PKT_DATA_OUT_ES \ | ||
160 | (0x00000000000010B0ull) | ||
161 | #define CVMX_NPEI_PKT_DATA_OUT_NS \ | ||
162 | (0x00000000000010A0ull) | ||
163 | #define CVMX_NPEI_PKT_DATA_OUT_ROR \ | ||
164 | (0x0000000000001090ull) | ||
165 | #define CVMX_NPEI_PKT_DPADDR \ | ||
166 | (0x0000000000001080ull) | ||
167 | #define CVMX_NPEI_PKT_INPUT_CONTROL \ | ||
168 | (0x0000000000001150ull) | ||
169 | #define CVMX_NPEI_PKT_INSTR_ENB \ | ||
170 | (0x0000000000001000ull) | ||
171 | #define CVMX_NPEI_PKT_INSTR_RD_SIZE \ | ||
172 | (0x0000000000001190ull) | ||
173 | #define CVMX_NPEI_PKT_INSTR_SIZE \ | ||
174 | (0x0000000000001020ull) | ||
175 | #define CVMX_NPEI_PKT_INT_LEVELS \ | ||
176 | (0x0000000000001100ull) | ||
177 | #define CVMX_NPEI_PKT_IN_BP \ | ||
178 | (0x00000000000006B0ull) | ||
179 | #define CVMX_NPEI_PKT_IN_DONEX_CNTS(offset) \ | ||
180 | (0x0000000000002000ull + (((offset) & 31) * 16)) | ||
181 | #define CVMX_NPEI_PKT_IN_INSTR_COUNTS \ | ||
182 | (0x00000000000006A0ull) | ||
183 | #define CVMX_NPEI_PKT_IN_PCIE_PORT \ | ||
184 | (0x00000000000011A0ull) | ||
185 | #define CVMX_NPEI_PKT_IPTR \ | ||
186 | (0x0000000000001070ull) | ||
187 | #define CVMX_NPEI_PKT_OUTPUT_WMARK \ | ||
188 | (0x0000000000001160ull) | ||
189 | #define CVMX_NPEI_PKT_OUT_BMODE \ | ||
190 | (0x00000000000010D0ull) | ||
191 | #define CVMX_NPEI_PKT_OUT_ENB \ | ||
192 | (0x0000000000001010ull) | ||
193 | #define CVMX_NPEI_PKT_PCIE_PORT \ | ||
194 | (0x00000000000010E0ull) | ||
195 | #define CVMX_NPEI_PKT_PORT_IN_RST \ | ||
196 | (0x0000000000000690ull) | ||
197 | #define CVMX_NPEI_PKT_SLIST_ES \ | ||
198 | (0x0000000000001050ull) | ||
199 | #define CVMX_NPEI_PKT_SLIST_ID_SIZE \ | ||
200 | (0x0000000000001180ull) | ||
201 | #define CVMX_NPEI_PKT_SLIST_NS \ | ||
202 | (0x0000000000001040ull) | ||
203 | #define CVMX_NPEI_PKT_SLIST_ROR \ | ||
204 | (0x0000000000001030ull) | ||
205 | #define CVMX_NPEI_PKT_TIME_INT \ | ||
206 | (0x0000000000001120ull) | ||
207 | #define CVMX_NPEI_PKT_TIME_INT_ENB \ | ||
208 | (0x0000000000001140ull) | ||
209 | #define CVMX_NPEI_RSL_INT_BLOCKS \ | ||
210 | (0x0000000000000520ull) | ||
211 | #define CVMX_NPEI_SCRATCH_1 \ | ||
212 | (0x0000000000000270ull) | ||
213 | #define CVMX_NPEI_STATE1 \ | ||
214 | (0x0000000000000620ull) | ||
215 | #define CVMX_NPEI_STATE2 \ | ||
216 | (0x0000000000000630ull) | ||
217 | #define CVMX_NPEI_STATE3 \ | ||
218 | (0x0000000000000640ull) | ||
219 | #define CVMX_NPEI_WINDOW_CTL \ | ||
220 | (0x0000000000000380ull) | ||
221 | #define CVMX_NPEI_WIN_RD_ADDR \ | ||
222 | (0x0000000000000210ull) | ||
223 | #define CVMX_NPEI_WIN_RD_DATA \ | ||
224 | (0x0000000000000240ull) | ||
225 | #define CVMX_NPEI_WIN_WR_ADDR \ | ||
226 | (0x0000000000000200ull) | ||
227 | #define CVMX_NPEI_WIN_WR_DATA \ | ||
228 | (0x0000000000000220ull) | ||
229 | #define CVMX_NPEI_WIN_WR_MASK \ | ||
230 | (0x0000000000000230ull) | ||
231 | |||
232 | union cvmx_npei_bar1_indexx { | ||
233 | uint32_t u32; | ||
234 | struct cvmx_npei_bar1_indexx_s { | ||
235 | uint32_t reserved_18_31:14; | ||
236 | uint32_t addr_idx:14; | ||
237 | uint32_t ca:1; | ||
238 | uint32_t end_swp:2; | ||
239 | uint32_t addr_v:1; | ||
240 | } s; | ||
241 | struct cvmx_npei_bar1_indexx_s cn52xx; | ||
242 | struct cvmx_npei_bar1_indexx_s cn52xxp1; | ||
243 | struct cvmx_npei_bar1_indexx_s cn56xx; | ||
244 | struct cvmx_npei_bar1_indexx_s cn56xxp1; | ||
245 | }; | ||
246 | |||
247 | union cvmx_npei_bist_status { | ||
248 | uint64_t u64; | ||
249 | struct cvmx_npei_bist_status_s { | ||
250 | uint64_t pkt_rdf:1; | ||
251 | uint64_t pkt_pmem:1; | ||
252 | uint64_t pkt_p1:1; | ||
253 | uint64_t reserved_60_60:1; | ||
254 | uint64_t pcr_gim:1; | ||
255 | uint64_t pkt_pif:1; | ||
256 | uint64_t pcsr_int:1; | ||
257 | uint64_t pcsr_im:1; | ||
258 | uint64_t pcsr_cnt:1; | ||
259 | uint64_t pcsr_id:1; | ||
260 | uint64_t pcsr_sl:1; | ||
261 | uint64_t reserved_50_52:3; | ||
262 | uint64_t pkt_ind:1; | ||
263 | uint64_t pkt_slm:1; | ||
264 | uint64_t reserved_36_47:12; | ||
265 | uint64_t d0_pst:1; | ||
266 | uint64_t d1_pst:1; | ||
267 | uint64_t d2_pst:1; | ||
268 | uint64_t d3_pst:1; | ||
269 | uint64_t reserved_31_31:1; | ||
270 | uint64_t n2p0_c:1; | ||
271 | uint64_t n2p0_o:1; | ||
272 | uint64_t n2p1_c:1; | ||
273 | uint64_t n2p1_o:1; | ||
274 | uint64_t cpl_p0:1; | ||
275 | uint64_t cpl_p1:1; | ||
276 | uint64_t p2n1_po:1; | ||
277 | uint64_t p2n1_no:1; | ||
278 | uint64_t p2n1_co:1; | ||
279 | uint64_t p2n0_po:1; | ||
280 | uint64_t p2n0_no:1; | ||
281 | uint64_t p2n0_co:1; | ||
282 | uint64_t p2n0_c0:1; | ||
283 | uint64_t p2n0_c1:1; | ||
284 | uint64_t p2n0_n:1; | ||
285 | uint64_t p2n0_p0:1; | ||
286 | uint64_t p2n0_p1:1; | ||
287 | uint64_t p2n1_c0:1; | ||
288 | uint64_t p2n1_c1:1; | ||
289 | uint64_t p2n1_n:1; | ||
290 | uint64_t p2n1_p0:1; | ||
291 | uint64_t p2n1_p1:1; | ||
292 | uint64_t csm0:1; | ||
293 | uint64_t csm1:1; | ||
294 | uint64_t dif0:1; | ||
295 | uint64_t dif1:1; | ||
296 | uint64_t dif2:1; | ||
297 | uint64_t dif3:1; | ||
298 | uint64_t reserved_2_2:1; | ||
299 | uint64_t msi:1; | ||
300 | uint64_t ncb_cmd:1; | ||
301 | } s; | ||
302 | struct cvmx_npei_bist_status_cn52xx { | ||
303 | uint64_t pkt_rdf:1; | ||
304 | uint64_t pkt_pmem:1; | ||
305 | uint64_t pkt_p1:1; | ||
306 | uint64_t reserved_60_60:1; | ||
307 | uint64_t pcr_gim:1; | ||
308 | uint64_t pkt_pif:1; | ||
309 | uint64_t pcsr_int:1; | ||
310 | uint64_t pcsr_im:1; | ||
311 | uint64_t pcsr_cnt:1; | ||
312 | uint64_t pcsr_id:1; | ||
313 | uint64_t pcsr_sl:1; | ||
314 | uint64_t pkt_imem:1; | ||
315 | uint64_t pkt_pfm:1; | ||
316 | uint64_t pkt_pof:1; | ||
317 | uint64_t reserved_48_49:2; | ||
318 | uint64_t pkt_pop0:1; | ||
319 | uint64_t pkt_pop1:1; | ||
320 | uint64_t d0_mem:1; | ||
321 | uint64_t d1_mem:1; | ||
322 | uint64_t d2_mem:1; | ||
323 | uint64_t d3_mem:1; | ||
324 | uint64_t d4_mem:1; | ||
325 | uint64_t ds_mem:1; | ||
326 | uint64_t reserved_36_39:4; | ||
327 | uint64_t d0_pst:1; | ||
328 | uint64_t d1_pst:1; | ||
329 | uint64_t d2_pst:1; | ||
330 | uint64_t d3_pst:1; | ||
331 | uint64_t d4_pst:1; | ||
332 | uint64_t n2p0_c:1; | ||
333 | uint64_t n2p0_o:1; | ||
334 | uint64_t n2p1_c:1; | ||
335 | uint64_t n2p1_o:1; | ||
336 | uint64_t cpl_p0:1; | ||
337 | uint64_t cpl_p1:1; | ||
338 | uint64_t p2n1_po:1; | ||
339 | uint64_t p2n1_no:1; | ||
340 | uint64_t p2n1_co:1; | ||
341 | uint64_t p2n0_po:1; | ||
342 | uint64_t p2n0_no:1; | ||
343 | uint64_t p2n0_co:1; | ||
344 | uint64_t p2n0_c0:1; | ||
345 | uint64_t p2n0_c1:1; | ||
346 | uint64_t p2n0_n:1; | ||
347 | uint64_t p2n0_p0:1; | ||
348 | uint64_t p2n0_p1:1; | ||
349 | uint64_t p2n1_c0:1; | ||
350 | uint64_t p2n1_c1:1; | ||
351 | uint64_t p2n1_n:1; | ||
352 | uint64_t p2n1_p0:1; | ||
353 | uint64_t p2n1_p1:1; | ||
354 | uint64_t csm0:1; | ||
355 | uint64_t csm1:1; | ||
356 | uint64_t dif0:1; | ||
357 | uint64_t dif1:1; | ||
358 | uint64_t dif2:1; | ||
359 | uint64_t dif3:1; | ||
360 | uint64_t dif4:1; | ||
361 | uint64_t msi:1; | ||
362 | uint64_t ncb_cmd:1; | ||
363 | } cn52xx; | ||
364 | struct cvmx_npei_bist_status_cn52xxp1 { | ||
365 | uint64_t reserved_46_63:18; | ||
366 | uint64_t d0_mem0:1; | ||
367 | uint64_t d1_mem1:1; | ||
368 | uint64_t d2_mem2:1; | ||
369 | uint64_t d3_mem3:1; | ||
370 | uint64_t dr0_mem:1; | ||
371 | uint64_t d0_mem:1; | ||
372 | uint64_t d1_mem:1; | ||
373 | uint64_t d2_mem:1; | ||
374 | uint64_t d3_mem:1; | ||
375 | uint64_t dr1_mem:1; | ||
376 | uint64_t d0_pst:1; | ||
377 | uint64_t d1_pst:1; | ||
378 | uint64_t d2_pst:1; | ||
379 | uint64_t d3_pst:1; | ||
380 | uint64_t dr2_mem:1; | ||
381 | uint64_t n2p0_c:1; | ||
382 | uint64_t n2p0_o:1; | ||
383 | uint64_t n2p1_c:1; | ||
384 | uint64_t n2p1_o:1; | ||
385 | uint64_t cpl_p0:1; | ||
386 | uint64_t cpl_p1:1; | ||
387 | uint64_t p2n1_po:1; | ||
388 | uint64_t p2n1_no:1; | ||
389 | uint64_t p2n1_co:1; | ||
390 | uint64_t p2n0_po:1; | ||
391 | uint64_t p2n0_no:1; | ||
392 | uint64_t p2n0_co:1; | ||
393 | uint64_t p2n0_c0:1; | ||
394 | uint64_t p2n0_c1:1; | ||
395 | uint64_t p2n0_n:1; | ||
396 | uint64_t p2n0_p0:1; | ||
397 | uint64_t p2n0_p1:1; | ||
398 | uint64_t p2n1_c0:1; | ||
399 | uint64_t p2n1_c1:1; | ||
400 | uint64_t p2n1_n:1; | ||
401 | uint64_t p2n1_p0:1; | ||
402 | uint64_t p2n1_p1:1; | ||
403 | uint64_t csm0:1; | ||
404 | uint64_t csm1:1; | ||
405 | uint64_t dif0:1; | ||
406 | uint64_t dif1:1; | ||
407 | uint64_t dif2:1; | ||
408 | uint64_t dif3:1; | ||
409 | uint64_t dr3_mem:1; | ||
410 | uint64_t msi:1; | ||
411 | uint64_t ncb_cmd:1; | ||
412 | } cn52xxp1; | ||
413 | struct cvmx_npei_bist_status_cn56xx { | ||
414 | uint64_t pkt_rdf:1; | ||
415 | uint64_t reserved_60_62:3; | ||
416 | uint64_t pcr_gim:1; | ||
417 | uint64_t pkt_pif:1; | ||
418 | uint64_t pcsr_int:1; | ||
419 | uint64_t pcsr_im:1; | ||
420 | uint64_t pcsr_cnt:1; | ||
421 | uint64_t pcsr_id:1; | ||
422 | uint64_t pcsr_sl:1; | ||
423 | uint64_t pkt_imem:1; | ||
424 | uint64_t pkt_pfm:1; | ||
425 | uint64_t pkt_pof:1; | ||
426 | uint64_t reserved_48_49:2; | ||
427 | uint64_t pkt_pop0:1; | ||
428 | uint64_t pkt_pop1:1; | ||
429 | uint64_t d0_mem:1; | ||
430 | uint64_t d1_mem:1; | ||
431 | uint64_t d2_mem:1; | ||
432 | uint64_t d3_mem:1; | ||
433 | uint64_t d4_mem:1; | ||
434 | uint64_t ds_mem:1; | ||
435 | uint64_t reserved_36_39:4; | ||
436 | uint64_t d0_pst:1; | ||
437 | uint64_t d1_pst:1; | ||
438 | uint64_t d2_pst:1; | ||
439 | uint64_t d3_pst:1; | ||
440 | uint64_t d4_pst:1; | ||
441 | uint64_t n2p0_c:1; | ||
442 | uint64_t n2p0_o:1; | ||
443 | uint64_t n2p1_c:1; | ||
444 | uint64_t n2p1_o:1; | ||
445 | uint64_t cpl_p0:1; | ||
446 | uint64_t cpl_p1:1; | ||
447 | uint64_t p2n1_po:1; | ||
448 | uint64_t p2n1_no:1; | ||
449 | uint64_t p2n1_co:1; | ||
450 | uint64_t p2n0_po:1; | ||
451 | uint64_t p2n0_no:1; | ||
452 | uint64_t p2n0_co:1; | ||
453 | uint64_t p2n0_c0:1; | ||
454 | uint64_t p2n0_c1:1; | ||
455 | uint64_t p2n0_n:1; | ||
456 | uint64_t p2n0_p0:1; | ||
457 | uint64_t p2n0_p1:1; | ||
458 | uint64_t p2n1_c0:1; | ||
459 | uint64_t p2n1_c1:1; | ||
460 | uint64_t p2n1_n:1; | ||
461 | uint64_t p2n1_p0:1; | ||
462 | uint64_t p2n1_p1:1; | ||
463 | uint64_t csm0:1; | ||
464 | uint64_t csm1:1; | ||
465 | uint64_t dif0:1; | ||
466 | uint64_t dif1:1; | ||
467 | uint64_t dif2:1; | ||
468 | uint64_t dif3:1; | ||
469 | uint64_t dif4:1; | ||
470 | uint64_t msi:1; | ||
471 | uint64_t ncb_cmd:1; | ||
472 | } cn56xx; | ||
473 | struct cvmx_npei_bist_status_cn56xxp1 { | ||
474 | uint64_t reserved_58_63:6; | ||
475 | uint64_t pcsr_int:1; | ||
476 | uint64_t pcsr_im:1; | ||
477 | uint64_t pcsr_cnt:1; | ||
478 | uint64_t pcsr_id:1; | ||
479 | uint64_t pcsr_sl:1; | ||
480 | uint64_t pkt_pout:1; | ||
481 | uint64_t pkt_imem:1; | ||
482 | uint64_t pkt_cntm:1; | ||
483 | uint64_t pkt_ind:1; | ||
484 | uint64_t pkt_slm:1; | ||
485 | uint64_t pkt_odf:1; | ||
486 | uint64_t pkt_oif:1; | ||
487 | uint64_t pkt_out:1; | ||
488 | uint64_t pkt_i0:1; | ||
489 | uint64_t pkt_i1:1; | ||
490 | uint64_t pkt_s0:1; | ||
491 | uint64_t pkt_s1:1; | ||
492 | uint64_t d0_mem:1; | ||
493 | uint64_t d1_mem:1; | ||
494 | uint64_t d2_mem:1; | ||
495 | uint64_t d3_mem:1; | ||
496 | uint64_t d4_mem:1; | ||
497 | uint64_t d0_pst:1; | ||
498 | uint64_t d1_pst:1; | ||
499 | uint64_t d2_pst:1; | ||
500 | uint64_t d3_pst:1; | ||
501 | uint64_t d4_pst:1; | ||
502 | uint64_t n2p0_c:1; | ||
503 | uint64_t n2p0_o:1; | ||
504 | uint64_t n2p1_c:1; | ||
505 | uint64_t n2p1_o:1; | ||
506 | uint64_t cpl_p0:1; | ||
507 | uint64_t cpl_p1:1; | ||
508 | uint64_t p2n1_po:1; | ||
509 | uint64_t p2n1_no:1; | ||
510 | uint64_t p2n1_co:1; | ||
511 | uint64_t p2n0_po:1; | ||
512 | uint64_t p2n0_no:1; | ||
513 | uint64_t p2n0_co:1; | ||
514 | uint64_t p2n0_c0:1; | ||
515 | uint64_t p2n0_c1:1; | ||
516 | uint64_t p2n0_n:1; | ||
517 | uint64_t p2n0_p0:1; | ||
518 | uint64_t p2n0_p1:1; | ||
519 | uint64_t p2n1_c0:1; | ||
520 | uint64_t p2n1_c1:1; | ||
521 | uint64_t p2n1_n:1; | ||
522 | uint64_t p2n1_p0:1; | ||
523 | uint64_t p2n1_p1:1; | ||
524 | uint64_t csm0:1; | ||
525 | uint64_t csm1:1; | ||
526 | uint64_t dif0:1; | ||
527 | uint64_t dif1:1; | ||
528 | uint64_t dif2:1; | ||
529 | uint64_t dif3:1; | ||
530 | uint64_t dif4:1; | ||
531 | uint64_t msi:1; | ||
532 | uint64_t ncb_cmd:1; | ||
533 | } cn56xxp1; | ||
534 | }; | ||
535 | |||
536 | union cvmx_npei_bist_status2 { | ||
537 | uint64_t u64; | ||
538 | struct cvmx_npei_bist_status2_s { | ||
539 | uint64_t reserved_5_63:59; | ||
540 | uint64_t psc_p0:1; | ||
541 | uint64_t psc_p1:1; | ||
542 | uint64_t pkt_gd:1; | ||
543 | uint64_t pkt_gl:1; | ||
544 | uint64_t pkt_blk:1; | ||
545 | } s; | ||
546 | struct cvmx_npei_bist_status2_s cn52xx; | ||
547 | struct cvmx_npei_bist_status2_s cn56xx; | ||
548 | }; | ||
549 | |||
550 | union cvmx_npei_ctl_port0 { | ||
551 | uint64_t u64; | ||
552 | struct cvmx_npei_ctl_port0_s { | ||
553 | uint64_t reserved_21_63:43; | ||
554 | uint64_t waitl_com:1; | ||
555 | uint64_t intd:1; | ||
556 | uint64_t intc:1; | ||
557 | uint64_t intb:1; | ||
558 | uint64_t inta:1; | ||
559 | uint64_t intd_map:2; | ||
560 | uint64_t intc_map:2; | ||
561 | uint64_t intb_map:2; | ||
562 | uint64_t inta_map:2; | ||
563 | uint64_t ctlp_ro:1; | ||
564 | uint64_t reserved_6_6:1; | ||
565 | uint64_t ptlp_ro:1; | ||
566 | uint64_t bar2_enb:1; | ||
567 | uint64_t bar2_esx:2; | ||
568 | uint64_t bar2_cax:1; | ||
569 | uint64_t wait_com:1; | ||
570 | } s; | ||
571 | struct cvmx_npei_ctl_port0_s cn52xx; | ||
572 | struct cvmx_npei_ctl_port0_s cn52xxp1; | ||
573 | struct cvmx_npei_ctl_port0_s cn56xx; | ||
574 | struct cvmx_npei_ctl_port0_s cn56xxp1; | ||
575 | }; | ||
576 | |||
577 | union cvmx_npei_ctl_port1 { | ||
578 | uint64_t u64; | ||
579 | struct cvmx_npei_ctl_port1_s { | ||
580 | uint64_t reserved_21_63:43; | ||
581 | uint64_t waitl_com:1; | ||
582 | uint64_t intd:1; | ||
583 | uint64_t intc:1; | ||
584 | uint64_t intb:1; | ||
585 | uint64_t inta:1; | ||
586 | uint64_t intd_map:2; | ||
587 | uint64_t intc_map:2; | ||
588 | uint64_t intb_map:2; | ||
589 | uint64_t inta_map:2; | ||
590 | uint64_t ctlp_ro:1; | ||
591 | uint64_t reserved_6_6:1; | ||
592 | uint64_t ptlp_ro:1; | ||
593 | uint64_t bar2_enb:1; | ||
594 | uint64_t bar2_esx:2; | ||
595 | uint64_t bar2_cax:1; | ||
596 | uint64_t wait_com:1; | ||
597 | } s; | ||
598 | struct cvmx_npei_ctl_port1_s cn52xx; | ||
599 | struct cvmx_npei_ctl_port1_s cn52xxp1; | ||
600 | struct cvmx_npei_ctl_port1_s cn56xx; | ||
601 | struct cvmx_npei_ctl_port1_s cn56xxp1; | ||
602 | }; | ||
603 | |||
604 | union cvmx_npei_ctl_status { | ||
605 | uint64_t u64; | ||
606 | struct cvmx_npei_ctl_status_s { | ||
607 | uint64_t reserved_44_63:20; | ||
608 | uint64_t p1_ntags:6; | ||
609 | uint64_t p0_ntags:6; | ||
610 | uint64_t cfg_rtry:16; | ||
611 | uint64_t ring_en:1; | ||
612 | uint64_t lnk_rst:1; | ||
613 | uint64_t arb:1; | ||
614 | uint64_t pkt_bp:4; | ||
615 | uint64_t host_mode:1; | ||
616 | uint64_t chip_rev:8; | ||
617 | } s; | ||
618 | struct cvmx_npei_ctl_status_s cn52xx; | ||
619 | struct cvmx_npei_ctl_status_cn52xxp1 { | ||
620 | uint64_t reserved_44_63:20; | ||
621 | uint64_t p1_ntags:6; | ||
622 | uint64_t p0_ntags:6; | ||
623 | uint64_t cfg_rtry:16; | ||
624 | uint64_t reserved_15_15:1; | ||
625 | uint64_t lnk_rst:1; | ||
626 | uint64_t arb:1; | ||
627 | uint64_t reserved_9_12:4; | ||
628 | uint64_t host_mode:1; | ||
629 | uint64_t chip_rev:8; | ||
630 | } cn52xxp1; | ||
631 | struct cvmx_npei_ctl_status_s cn56xx; | ||
632 | struct cvmx_npei_ctl_status_cn56xxp1 { | ||
633 | uint64_t reserved_16_63:48; | ||
634 | uint64_t ring_en:1; | ||
635 | uint64_t lnk_rst:1; | ||
636 | uint64_t arb:1; | ||
637 | uint64_t pkt_bp:4; | ||
638 | uint64_t host_mode:1; | ||
639 | uint64_t chip_rev:8; | ||
640 | } cn56xxp1; | ||
641 | }; | ||
642 | |||
643 | union cvmx_npei_ctl_status2 { | ||
644 | uint64_t u64; | ||
645 | struct cvmx_npei_ctl_status2_s { | ||
646 | uint64_t reserved_16_63:48; | ||
647 | uint64_t mps:1; | ||
648 | uint64_t mrrs:3; | ||
649 | uint64_t c1_w_flt:1; | ||
650 | uint64_t c0_w_flt:1; | ||
651 | uint64_t c1_b1_s:3; | ||
652 | uint64_t c0_b1_s:3; | ||
653 | uint64_t c1_wi_d:1; | ||
654 | uint64_t c1_b0_d:1; | ||
655 | uint64_t c0_wi_d:1; | ||
656 | uint64_t c0_b0_d:1; | ||
657 | } s; | ||
658 | struct cvmx_npei_ctl_status2_s cn52xx; | ||
659 | struct cvmx_npei_ctl_status2_s cn52xxp1; | ||
660 | struct cvmx_npei_ctl_status2_s cn56xx; | ||
661 | struct cvmx_npei_ctl_status2_s cn56xxp1; | ||
662 | }; | ||
663 | |||
664 | union cvmx_npei_data_out_cnt { | ||
665 | uint64_t u64; | ||
666 | struct cvmx_npei_data_out_cnt_s { | ||
667 | uint64_t reserved_44_63:20; | ||
668 | uint64_t p1_ucnt:16; | ||
669 | uint64_t p1_fcnt:6; | ||
670 | uint64_t p0_ucnt:16; | ||
671 | uint64_t p0_fcnt:6; | ||
672 | } s; | ||
673 | struct cvmx_npei_data_out_cnt_s cn52xx; | ||
674 | struct cvmx_npei_data_out_cnt_s cn52xxp1; | ||
675 | struct cvmx_npei_data_out_cnt_s cn56xx; | ||
676 | struct cvmx_npei_data_out_cnt_s cn56xxp1; | ||
677 | }; | ||
678 | |||
679 | union cvmx_npei_dbg_data { | ||
680 | uint64_t u64; | ||
681 | struct cvmx_npei_dbg_data_s { | ||
682 | uint64_t reserved_28_63:36; | ||
683 | uint64_t qlm0_rev_lanes:1; | ||
684 | uint64_t reserved_25_26:2; | ||
685 | uint64_t qlm1_spd:2; | ||
686 | uint64_t c_mul:5; | ||
687 | uint64_t dsel_ext:1; | ||
688 | uint64_t data:17; | ||
689 | } s; | ||
690 | struct cvmx_npei_dbg_data_cn52xx { | ||
691 | uint64_t reserved_29_63:35; | ||
692 | uint64_t qlm0_link_width:1; | ||
693 | uint64_t qlm0_rev_lanes:1; | ||
694 | uint64_t qlm1_mode:2; | ||
695 | uint64_t qlm1_spd:2; | ||
696 | uint64_t c_mul:5; | ||
697 | uint64_t dsel_ext:1; | ||
698 | uint64_t data:17; | ||
699 | } cn52xx; | ||
700 | struct cvmx_npei_dbg_data_cn52xx cn52xxp1; | ||
701 | struct cvmx_npei_dbg_data_cn56xx { | ||
702 | uint64_t reserved_29_63:35; | ||
703 | uint64_t qlm2_rev_lanes:1; | ||
704 | uint64_t qlm0_rev_lanes:1; | ||
705 | uint64_t qlm3_spd:2; | ||
706 | uint64_t qlm1_spd:2; | ||
707 | uint64_t c_mul:5; | ||
708 | uint64_t dsel_ext:1; | ||
709 | uint64_t data:17; | ||
710 | } cn56xx; | ||
711 | struct cvmx_npei_dbg_data_cn56xx cn56xxp1; | ||
712 | }; | ||
713 | |||
714 | union cvmx_npei_dbg_select { | ||
715 | uint64_t u64; | ||
716 | struct cvmx_npei_dbg_select_s { | ||
717 | uint64_t reserved_16_63:48; | ||
718 | uint64_t dbg_sel:16; | ||
719 | } s; | ||
720 | struct cvmx_npei_dbg_select_s cn52xx; | ||
721 | struct cvmx_npei_dbg_select_s cn52xxp1; | ||
722 | struct cvmx_npei_dbg_select_s cn56xx; | ||
723 | struct cvmx_npei_dbg_select_s cn56xxp1; | ||
724 | }; | ||
725 | |||
726 | union cvmx_npei_dmax_counts { | ||
727 | uint64_t u64; | ||
728 | struct cvmx_npei_dmax_counts_s { | ||
729 | uint64_t reserved_39_63:25; | ||
730 | uint64_t fcnt:7; | ||
731 | uint64_t dbell:32; | ||
732 | } s; | ||
733 | struct cvmx_npei_dmax_counts_s cn52xx; | ||
734 | struct cvmx_npei_dmax_counts_s cn52xxp1; | ||
735 | struct cvmx_npei_dmax_counts_s cn56xx; | ||
736 | struct cvmx_npei_dmax_counts_s cn56xxp1; | ||
737 | }; | ||
738 | |||
739 | union cvmx_npei_dmax_dbell { | ||
740 | uint32_t u32; | ||
741 | struct cvmx_npei_dmax_dbell_s { | ||
742 | uint32_t reserved_16_31:16; | ||
743 | uint32_t dbell:16; | ||
744 | } s; | ||
745 | struct cvmx_npei_dmax_dbell_s cn52xx; | ||
746 | struct cvmx_npei_dmax_dbell_s cn52xxp1; | ||
747 | struct cvmx_npei_dmax_dbell_s cn56xx; | ||
748 | struct cvmx_npei_dmax_dbell_s cn56xxp1; | ||
749 | }; | ||
750 | |||
751 | union cvmx_npei_dmax_ibuff_saddr { | ||
752 | uint64_t u64; | ||
753 | struct cvmx_npei_dmax_ibuff_saddr_s { | ||
754 | uint64_t reserved_37_63:27; | ||
755 | uint64_t idle:1; | ||
756 | uint64_t saddr:29; | ||
757 | uint64_t reserved_0_6:7; | ||
758 | } s; | ||
759 | struct cvmx_npei_dmax_ibuff_saddr_cn52xx { | ||
760 | uint64_t reserved_36_63:28; | ||
761 | uint64_t saddr:29; | ||
762 | uint64_t reserved_0_6:7; | ||
763 | } cn52xx; | ||
764 | struct cvmx_npei_dmax_ibuff_saddr_cn52xx cn52xxp1; | ||
765 | struct cvmx_npei_dmax_ibuff_saddr_s cn56xx; | ||
766 | struct cvmx_npei_dmax_ibuff_saddr_cn52xx cn56xxp1; | ||
767 | }; | ||
768 | |||
769 | union cvmx_npei_dmax_naddr { | ||
770 | uint64_t u64; | ||
771 | struct cvmx_npei_dmax_naddr_s { | ||
772 | uint64_t reserved_36_63:28; | ||
773 | uint64_t addr:36; | ||
774 | } s; | ||
775 | struct cvmx_npei_dmax_naddr_s cn52xx; | ||
776 | struct cvmx_npei_dmax_naddr_s cn52xxp1; | ||
777 | struct cvmx_npei_dmax_naddr_s cn56xx; | ||
778 | struct cvmx_npei_dmax_naddr_s cn56xxp1; | ||
779 | }; | ||
780 | |||
781 | union cvmx_npei_dma0_int_level { | ||
782 | uint64_t u64; | ||
783 | struct cvmx_npei_dma0_int_level_s { | ||
784 | uint64_t time:32; | ||
785 | uint64_t cnt:32; | ||
786 | } s; | ||
787 | struct cvmx_npei_dma0_int_level_s cn52xx; | ||
788 | struct cvmx_npei_dma0_int_level_s cn52xxp1; | ||
789 | struct cvmx_npei_dma0_int_level_s cn56xx; | ||
790 | struct cvmx_npei_dma0_int_level_s cn56xxp1; | ||
791 | }; | ||
792 | |||
793 | union cvmx_npei_dma1_int_level { | ||
794 | uint64_t u64; | ||
795 | struct cvmx_npei_dma1_int_level_s { | ||
796 | uint64_t time:32; | ||
797 | uint64_t cnt:32; | ||
798 | } s; | ||
799 | struct cvmx_npei_dma1_int_level_s cn52xx; | ||
800 | struct cvmx_npei_dma1_int_level_s cn52xxp1; | ||
801 | struct cvmx_npei_dma1_int_level_s cn56xx; | ||
802 | struct cvmx_npei_dma1_int_level_s cn56xxp1; | ||
803 | }; | ||
804 | |||
805 | union cvmx_npei_dma_cnts { | ||
806 | uint64_t u64; | ||
807 | struct cvmx_npei_dma_cnts_s { | ||
808 | uint64_t dma1:32; | ||
809 | uint64_t dma0:32; | ||
810 | } s; | ||
811 | struct cvmx_npei_dma_cnts_s cn52xx; | ||
812 | struct cvmx_npei_dma_cnts_s cn52xxp1; | ||
813 | struct cvmx_npei_dma_cnts_s cn56xx; | ||
814 | struct cvmx_npei_dma_cnts_s cn56xxp1; | ||
815 | }; | ||
816 | |||
817 | union cvmx_npei_dma_control { | ||
818 | uint64_t u64; | ||
819 | struct cvmx_npei_dma_control_s { | ||
820 | uint64_t reserved_39_63:25; | ||
821 | uint64_t dma4_enb:1; | ||
822 | uint64_t dma3_enb:1; | ||
823 | uint64_t dma2_enb:1; | ||
824 | uint64_t dma1_enb:1; | ||
825 | uint64_t dma0_enb:1; | ||
826 | uint64_t b0_lend:1; | ||
827 | uint64_t dwb_denb:1; | ||
828 | uint64_t dwb_ichk:9; | ||
829 | uint64_t fpa_que:3; | ||
830 | uint64_t o_add1:1; | ||
831 | uint64_t o_ro:1; | ||
832 | uint64_t o_ns:1; | ||
833 | uint64_t o_es:2; | ||
834 | uint64_t o_mode:1; | ||
835 | uint64_t csize:14; | ||
836 | } s; | ||
837 | struct cvmx_npei_dma_control_s cn52xx; | ||
838 | struct cvmx_npei_dma_control_cn52xxp1 { | ||
839 | uint64_t reserved_38_63:26; | ||
840 | uint64_t dma3_enb:1; | ||
841 | uint64_t dma2_enb:1; | ||
842 | uint64_t dma1_enb:1; | ||
843 | uint64_t dma0_enb:1; | ||
844 | uint64_t b0_lend:1; | ||
845 | uint64_t dwb_denb:1; | ||
846 | uint64_t dwb_ichk:9; | ||
847 | uint64_t fpa_que:3; | ||
848 | uint64_t o_add1:1; | ||
849 | uint64_t o_ro:1; | ||
850 | uint64_t o_ns:1; | ||
851 | uint64_t o_es:2; | ||
852 | uint64_t o_mode:1; | ||
853 | uint64_t csize:14; | ||
854 | } cn52xxp1; | ||
855 | struct cvmx_npei_dma_control_s cn56xx; | ||
856 | struct cvmx_npei_dma_control_s cn56xxp1; | ||
857 | }; | ||
858 | |||
859 | union cvmx_npei_int_a_enb { | ||
860 | uint64_t u64; | ||
861 | struct cvmx_npei_int_a_enb_s { | ||
862 | uint64_t reserved_10_63:54; | ||
863 | uint64_t pout_err:1; | ||
864 | uint64_t pin_bp:1; | ||
865 | uint64_t p1_rdlk:1; | ||
866 | uint64_t p0_rdlk:1; | ||
867 | uint64_t pgl_err:1; | ||
868 | uint64_t pdi_err:1; | ||
869 | uint64_t pop_err:1; | ||
870 | uint64_t pins_err:1; | ||
871 | uint64_t dma1_cpl:1; | ||
872 | uint64_t dma0_cpl:1; | ||
873 | } s; | ||
874 | struct cvmx_npei_int_a_enb_cn52xx { | ||
875 | uint64_t reserved_8_63:56; | ||
876 | uint64_t p1_rdlk:1; | ||
877 | uint64_t p0_rdlk:1; | ||
878 | uint64_t pgl_err:1; | ||
879 | uint64_t pdi_err:1; | ||
880 | uint64_t pop_err:1; | ||
881 | uint64_t pins_err:1; | ||
882 | uint64_t dma1_cpl:1; | ||
883 | uint64_t dma0_cpl:1; | ||
884 | } cn52xx; | ||
885 | struct cvmx_npei_int_a_enb_cn52xxp1 { | ||
886 | uint64_t reserved_2_63:62; | ||
887 | uint64_t dma1_cpl:1; | ||
888 | uint64_t dma0_cpl:1; | ||
889 | } cn52xxp1; | ||
890 | struct cvmx_npei_int_a_enb_s cn56xx; | ||
891 | }; | ||
892 | |||
893 | union cvmx_npei_int_a_enb2 { | ||
894 | uint64_t u64; | ||
895 | struct cvmx_npei_int_a_enb2_s { | ||
896 | uint64_t reserved_10_63:54; | ||
897 | uint64_t pout_err:1; | ||
898 | uint64_t pin_bp:1; | ||
899 | uint64_t p1_rdlk:1; | ||
900 | uint64_t p0_rdlk:1; | ||
901 | uint64_t pgl_err:1; | ||
902 | uint64_t pdi_err:1; | ||
903 | uint64_t pop_err:1; | ||
904 | uint64_t pins_err:1; | ||
905 | uint64_t dma1_cpl:1; | ||
906 | uint64_t dma0_cpl:1; | ||
907 | } s; | ||
908 | struct cvmx_npei_int_a_enb2_cn52xx { | ||
909 | uint64_t reserved_8_63:56; | ||
910 | uint64_t p1_rdlk:1; | ||
911 | uint64_t p0_rdlk:1; | ||
912 | uint64_t pgl_err:1; | ||
913 | uint64_t pdi_err:1; | ||
914 | uint64_t pop_err:1; | ||
915 | uint64_t pins_err:1; | ||
916 | uint64_t reserved_0_1:2; | ||
917 | } cn52xx; | ||
918 | struct cvmx_npei_int_a_enb2_cn52xxp1 { | ||
919 | uint64_t reserved_2_63:62; | ||
920 | uint64_t dma1_cpl:1; | ||
921 | uint64_t dma0_cpl:1; | ||
922 | } cn52xxp1; | ||
923 | struct cvmx_npei_int_a_enb2_s cn56xx; | ||
924 | }; | ||
925 | |||
926 | union cvmx_npei_int_a_sum { | ||
927 | uint64_t u64; | ||
928 | struct cvmx_npei_int_a_sum_s { | ||
929 | uint64_t reserved_10_63:54; | ||
930 | uint64_t pout_err:1; | ||
931 | uint64_t pin_bp:1; | ||
932 | uint64_t p1_rdlk:1; | ||
933 | uint64_t p0_rdlk:1; | ||
934 | uint64_t pgl_err:1; | ||
935 | uint64_t pdi_err:1; | ||
936 | uint64_t pop_err:1; | ||
937 | uint64_t pins_err:1; | ||
938 | uint64_t dma1_cpl:1; | ||
939 | uint64_t dma0_cpl:1; | ||
940 | } s; | ||
941 | struct cvmx_npei_int_a_sum_cn52xx { | ||
942 | uint64_t reserved_8_63:56; | ||
943 | uint64_t p1_rdlk:1; | ||
944 | uint64_t p0_rdlk:1; | ||
945 | uint64_t pgl_err:1; | ||
946 | uint64_t pdi_err:1; | ||
947 | uint64_t pop_err:1; | ||
948 | uint64_t pins_err:1; | ||
949 | uint64_t dma1_cpl:1; | ||
950 | uint64_t dma0_cpl:1; | ||
951 | } cn52xx; | ||
952 | struct cvmx_npei_int_a_sum_cn52xxp1 { | ||
953 | uint64_t reserved_2_63:62; | ||
954 | uint64_t dma1_cpl:1; | ||
955 | uint64_t dma0_cpl:1; | ||
956 | } cn52xxp1; | ||
957 | struct cvmx_npei_int_a_sum_s cn56xx; | ||
958 | }; | ||
959 | |||
960 | union cvmx_npei_int_enb { | ||
961 | uint64_t u64; | ||
962 | struct cvmx_npei_int_enb_s { | ||
963 | uint64_t mio_inta:1; | ||
964 | uint64_t reserved_62_62:1; | ||
965 | uint64_t int_a:1; | ||
966 | uint64_t c1_ldwn:1; | ||
967 | uint64_t c0_ldwn:1; | ||
968 | uint64_t c1_exc:1; | ||
969 | uint64_t c0_exc:1; | ||
970 | uint64_t c1_up_wf:1; | ||
971 | uint64_t c0_up_wf:1; | ||
972 | uint64_t c1_un_wf:1; | ||
973 | uint64_t c0_un_wf:1; | ||
974 | uint64_t c1_un_bx:1; | ||
975 | uint64_t c1_un_wi:1; | ||
976 | uint64_t c1_un_b2:1; | ||
977 | uint64_t c1_un_b1:1; | ||
978 | uint64_t c1_un_b0:1; | ||
979 | uint64_t c1_up_bx:1; | ||
980 | uint64_t c1_up_wi:1; | ||
981 | uint64_t c1_up_b2:1; | ||
982 | uint64_t c1_up_b1:1; | ||
983 | uint64_t c1_up_b0:1; | ||
984 | uint64_t c0_un_bx:1; | ||
985 | uint64_t c0_un_wi:1; | ||
986 | uint64_t c0_un_b2:1; | ||
987 | uint64_t c0_un_b1:1; | ||
988 | uint64_t c0_un_b0:1; | ||
989 | uint64_t c0_up_bx:1; | ||
990 | uint64_t c0_up_wi:1; | ||
991 | uint64_t c0_up_b2:1; | ||
992 | uint64_t c0_up_b1:1; | ||
993 | uint64_t c0_up_b0:1; | ||
994 | uint64_t c1_hpint:1; | ||
995 | uint64_t c1_pmei:1; | ||
996 | uint64_t c1_wake:1; | ||
997 | uint64_t crs1_dr:1; | ||
998 | uint64_t c1_se:1; | ||
999 | uint64_t crs1_er:1; | ||
1000 | uint64_t c1_aeri:1; | ||
1001 | uint64_t c0_hpint:1; | ||
1002 | uint64_t c0_pmei:1; | ||
1003 | uint64_t c0_wake:1; | ||
1004 | uint64_t crs0_dr:1; | ||
1005 | uint64_t c0_se:1; | ||
1006 | uint64_t crs0_er:1; | ||
1007 | uint64_t c0_aeri:1; | ||
1008 | uint64_t ptime:1; | ||
1009 | uint64_t pcnt:1; | ||
1010 | uint64_t pidbof:1; | ||
1011 | uint64_t psldbof:1; | ||
1012 | uint64_t dtime1:1; | ||
1013 | uint64_t dtime0:1; | ||
1014 | uint64_t dcnt1:1; | ||
1015 | uint64_t dcnt0:1; | ||
1016 | uint64_t dma1fi:1; | ||
1017 | uint64_t dma0fi:1; | ||
1018 | uint64_t dma4dbo:1; | ||
1019 | uint64_t dma3dbo:1; | ||
1020 | uint64_t dma2dbo:1; | ||
1021 | uint64_t dma1dbo:1; | ||
1022 | uint64_t dma0dbo:1; | ||
1023 | uint64_t iob2big:1; | ||
1024 | uint64_t bar0_to:1; | ||
1025 | uint64_t rml_wto:1; | ||
1026 | uint64_t rml_rto:1; | ||
1027 | } s; | ||
1028 | struct cvmx_npei_int_enb_s cn52xx; | ||
1029 | struct cvmx_npei_int_enb_cn52xxp1 { | ||
1030 | uint64_t mio_inta:1; | ||
1031 | uint64_t reserved_62_62:1; | ||
1032 | uint64_t int_a:1; | ||
1033 | uint64_t c1_ldwn:1; | ||
1034 | uint64_t c0_ldwn:1; | ||
1035 | uint64_t c1_exc:1; | ||
1036 | uint64_t c0_exc:1; | ||
1037 | uint64_t c1_up_wf:1; | ||
1038 | uint64_t c0_up_wf:1; | ||
1039 | uint64_t c1_un_wf:1; | ||
1040 | uint64_t c0_un_wf:1; | ||
1041 | uint64_t c1_un_bx:1; | ||
1042 | uint64_t c1_un_wi:1; | ||
1043 | uint64_t c1_un_b2:1; | ||
1044 | uint64_t c1_un_b1:1; | ||
1045 | uint64_t c1_un_b0:1; | ||
1046 | uint64_t c1_up_bx:1; | ||
1047 | uint64_t c1_up_wi:1; | ||
1048 | uint64_t c1_up_b2:1; | ||
1049 | uint64_t c1_up_b1:1; | ||
1050 | uint64_t c1_up_b0:1; | ||
1051 | uint64_t c0_un_bx:1; | ||
1052 | uint64_t c0_un_wi:1; | ||
1053 | uint64_t c0_un_b2:1; | ||
1054 | uint64_t c0_un_b1:1; | ||
1055 | uint64_t c0_un_b0:1; | ||
1056 | uint64_t c0_up_bx:1; | ||
1057 | uint64_t c0_up_wi:1; | ||
1058 | uint64_t c0_up_b2:1; | ||
1059 | uint64_t c0_up_b1:1; | ||
1060 | uint64_t c0_up_b0:1; | ||
1061 | uint64_t c1_hpint:1; | ||
1062 | uint64_t c1_pmei:1; | ||
1063 | uint64_t c1_wake:1; | ||
1064 | uint64_t crs1_dr:1; | ||
1065 | uint64_t c1_se:1; | ||
1066 | uint64_t crs1_er:1; | ||
1067 | uint64_t c1_aeri:1; | ||
1068 | uint64_t c0_hpint:1; | ||
1069 | uint64_t c0_pmei:1; | ||
1070 | uint64_t c0_wake:1; | ||
1071 | uint64_t crs0_dr:1; | ||
1072 | uint64_t c0_se:1; | ||
1073 | uint64_t crs0_er:1; | ||
1074 | uint64_t c0_aeri:1; | ||
1075 | uint64_t ptime:1; | ||
1076 | uint64_t pcnt:1; | ||
1077 | uint64_t pidbof:1; | ||
1078 | uint64_t psldbof:1; | ||
1079 | uint64_t dtime1:1; | ||
1080 | uint64_t dtime0:1; | ||
1081 | uint64_t dcnt1:1; | ||
1082 | uint64_t dcnt0:1; | ||
1083 | uint64_t dma1fi:1; | ||
1084 | uint64_t dma0fi:1; | ||
1085 | uint64_t reserved_8_8:1; | ||
1086 | uint64_t dma3dbo:1; | ||
1087 | uint64_t dma2dbo:1; | ||
1088 | uint64_t dma1dbo:1; | ||
1089 | uint64_t dma0dbo:1; | ||
1090 | uint64_t iob2big:1; | ||
1091 | uint64_t bar0_to:1; | ||
1092 | uint64_t rml_wto:1; | ||
1093 | uint64_t rml_rto:1; | ||
1094 | } cn52xxp1; | ||
1095 | struct cvmx_npei_int_enb_s cn56xx; | ||
1096 | struct cvmx_npei_int_enb_cn56xxp1 { | ||
1097 | uint64_t mio_inta:1; | ||
1098 | uint64_t reserved_61_62:2; | ||
1099 | uint64_t c1_ldwn:1; | ||
1100 | uint64_t c0_ldwn:1; | ||
1101 | uint64_t c1_exc:1; | ||
1102 | uint64_t c0_exc:1; | ||
1103 | uint64_t c1_up_wf:1; | ||
1104 | uint64_t c0_up_wf:1; | ||
1105 | uint64_t c1_un_wf:1; | ||
1106 | uint64_t c0_un_wf:1; | ||
1107 | uint64_t c1_un_bx:1; | ||
1108 | uint64_t c1_un_wi:1; | ||
1109 | uint64_t c1_un_b2:1; | ||
1110 | uint64_t c1_un_b1:1; | ||
1111 | uint64_t c1_un_b0:1; | ||
1112 | uint64_t c1_up_bx:1; | ||
1113 | uint64_t c1_up_wi:1; | ||
1114 | uint64_t c1_up_b2:1; | ||
1115 | uint64_t c1_up_b1:1; | ||
1116 | uint64_t c1_up_b0:1; | ||
1117 | uint64_t c0_un_bx:1; | ||
1118 | uint64_t c0_un_wi:1; | ||
1119 | uint64_t c0_un_b2:1; | ||
1120 | uint64_t c0_un_b1:1; | ||
1121 | uint64_t c0_un_b0:1; | ||
1122 | uint64_t c0_up_bx:1; | ||
1123 | uint64_t c0_up_wi:1; | ||
1124 | uint64_t c0_up_b2:1; | ||
1125 | uint64_t c0_up_b1:1; | ||
1126 | uint64_t c0_up_b0:1; | ||
1127 | uint64_t c1_hpint:1; | ||
1128 | uint64_t c1_pmei:1; | ||
1129 | uint64_t c1_wake:1; | ||
1130 | uint64_t reserved_29_29:1; | ||
1131 | uint64_t c1_se:1; | ||
1132 | uint64_t reserved_27_27:1; | ||
1133 | uint64_t c1_aeri:1; | ||
1134 | uint64_t c0_hpint:1; | ||
1135 | uint64_t c0_pmei:1; | ||
1136 | uint64_t c0_wake:1; | ||
1137 | uint64_t reserved_22_22:1; | ||
1138 | uint64_t c0_se:1; | ||
1139 | uint64_t reserved_20_20:1; | ||
1140 | uint64_t c0_aeri:1; | ||
1141 | uint64_t ptime:1; | ||
1142 | uint64_t pcnt:1; | ||
1143 | uint64_t pidbof:1; | ||
1144 | uint64_t psldbof:1; | ||
1145 | uint64_t dtime1:1; | ||
1146 | uint64_t dtime0:1; | ||
1147 | uint64_t dcnt1:1; | ||
1148 | uint64_t dcnt0:1; | ||
1149 | uint64_t dma1fi:1; | ||
1150 | uint64_t dma0fi:1; | ||
1151 | uint64_t dma4dbo:1; | ||
1152 | uint64_t dma3dbo:1; | ||
1153 | uint64_t dma2dbo:1; | ||
1154 | uint64_t dma1dbo:1; | ||
1155 | uint64_t dma0dbo:1; | ||
1156 | uint64_t iob2big:1; | ||
1157 | uint64_t bar0_to:1; | ||
1158 | uint64_t rml_wto:1; | ||
1159 | uint64_t rml_rto:1; | ||
1160 | } cn56xxp1; | ||
1161 | }; | ||
1162 | |||
1163 | union cvmx_npei_int_enb2 { | ||
1164 | uint64_t u64; | ||
1165 | struct cvmx_npei_int_enb2_s { | ||
1166 | uint64_t reserved_62_63:2; | ||
1167 | uint64_t int_a:1; | ||
1168 | uint64_t c1_ldwn:1; | ||
1169 | uint64_t c0_ldwn:1; | ||
1170 | uint64_t c1_exc:1; | ||
1171 | uint64_t c0_exc:1; | ||
1172 | uint64_t c1_up_wf:1; | ||
1173 | uint64_t c0_up_wf:1; | ||
1174 | uint64_t c1_un_wf:1; | ||
1175 | uint64_t c0_un_wf:1; | ||
1176 | uint64_t c1_un_bx:1; | ||
1177 | uint64_t c1_un_wi:1; | ||
1178 | uint64_t c1_un_b2:1; | ||
1179 | uint64_t c1_un_b1:1; | ||
1180 | uint64_t c1_un_b0:1; | ||
1181 | uint64_t c1_up_bx:1; | ||
1182 | uint64_t c1_up_wi:1; | ||
1183 | uint64_t c1_up_b2:1; | ||
1184 | uint64_t c1_up_b1:1; | ||
1185 | uint64_t c1_up_b0:1; | ||
1186 | uint64_t c0_un_bx:1; | ||
1187 | uint64_t c0_un_wi:1; | ||
1188 | uint64_t c0_un_b2:1; | ||
1189 | uint64_t c0_un_b1:1; | ||
1190 | uint64_t c0_un_b0:1; | ||
1191 | uint64_t c0_up_bx:1; | ||
1192 | uint64_t c0_up_wi:1; | ||
1193 | uint64_t c0_up_b2:1; | ||
1194 | uint64_t c0_up_b1:1; | ||
1195 | uint64_t c0_up_b0:1; | ||
1196 | uint64_t c1_hpint:1; | ||
1197 | uint64_t c1_pmei:1; | ||
1198 | uint64_t c1_wake:1; | ||
1199 | uint64_t crs1_dr:1; | ||
1200 | uint64_t c1_se:1; | ||
1201 | uint64_t crs1_er:1; | ||
1202 | uint64_t c1_aeri:1; | ||
1203 | uint64_t c0_hpint:1; | ||
1204 | uint64_t c0_pmei:1; | ||
1205 | uint64_t c0_wake:1; | ||
1206 | uint64_t crs0_dr:1; | ||
1207 | uint64_t c0_se:1; | ||
1208 | uint64_t crs0_er:1; | ||
1209 | uint64_t c0_aeri:1; | ||
1210 | uint64_t ptime:1; | ||
1211 | uint64_t pcnt:1; | ||
1212 | uint64_t pidbof:1; | ||
1213 | uint64_t psldbof:1; | ||
1214 | uint64_t dtime1:1; | ||
1215 | uint64_t dtime0:1; | ||
1216 | uint64_t dcnt1:1; | ||
1217 | uint64_t dcnt0:1; | ||
1218 | uint64_t dma1fi:1; | ||
1219 | uint64_t dma0fi:1; | ||
1220 | uint64_t dma4dbo:1; | ||
1221 | uint64_t dma3dbo:1; | ||
1222 | uint64_t dma2dbo:1; | ||
1223 | uint64_t dma1dbo:1; | ||
1224 | uint64_t dma0dbo:1; | ||
1225 | uint64_t iob2big:1; | ||
1226 | uint64_t bar0_to:1; | ||
1227 | uint64_t rml_wto:1; | ||
1228 | uint64_t rml_rto:1; | ||
1229 | } s; | ||
1230 | struct cvmx_npei_int_enb2_s cn52xx; | ||
1231 | struct cvmx_npei_int_enb2_cn52xxp1 { | ||
1232 | uint64_t reserved_62_63:2; | ||
1233 | uint64_t int_a:1; | ||
1234 | uint64_t c1_ldwn:1; | ||
1235 | uint64_t c0_ldwn:1; | ||
1236 | uint64_t c1_exc:1; | ||
1237 | uint64_t c0_exc:1; | ||
1238 | uint64_t c1_up_wf:1; | ||
1239 | uint64_t c0_up_wf:1; | ||
1240 | uint64_t c1_un_wf:1; | ||
1241 | uint64_t c0_un_wf:1; | ||
1242 | uint64_t c1_un_bx:1; | ||
1243 | uint64_t c1_un_wi:1; | ||
1244 | uint64_t c1_un_b2:1; | ||
1245 | uint64_t c1_un_b1:1; | ||
1246 | uint64_t c1_un_b0:1; | ||
1247 | uint64_t c1_up_bx:1; | ||
1248 | uint64_t c1_up_wi:1; | ||
1249 | uint64_t c1_up_b2:1; | ||
1250 | uint64_t c1_up_b1:1; | ||
1251 | uint64_t c1_up_b0:1; | ||
1252 | uint64_t c0_un_bx:1; | ||
1253 | uint64_t c0_un_wi:1; | ||
1254 | uint64_t c0_un_b2:1; | ||
1255 | uint64_t c0_un_b1:1; | ||
1256 | uint64_t c0_un_b0:1; | ||
1257 | uint64_t c0_up_bx:1; | ||
1258 | uint64_t c0_up_wi:1; | ||
1259 | uint64_t c0_up_b2:1; | ||
1260 | uint64_t c0_up_b1:1; | ||
1261 | uint64_t c0_up_b0:1; | ||
1262 | uint64_t c1_hpint:1; | ||
1263 | uint64_t c1_pmei:1; | ||
1264 | uint64_t c1_wake:1; | ||
1265 | uint64_t crs1_dr:1; | ||
1266 | uint64_t c1_se:1; | ||
1267 | uint64_t crs1_er:1; | ||
1268 | uint64_t c1_aeri:1; | ||
1269 | uint64_t c0_hpint:1; | ||
1270 | uint64_t c0_pmei:1; | ||
1271 | uint64_t c0_wake:1; | ||
1272 | uint64_t crs0_dr:1; | ||
1273 | uint64_t c0_se:1; | ||
1274 | uint64_t crs0_er:1; | ||
1275 | uint64_t c0_aeri:1; | ||
1276 | uint64_t ptime:1; | ||
1277 | uint64_t pcnt:1; | ||
1278 | uint64_t pidbof:1; | ||
1279 | uint64_t psldbof:1; | ||
1280 | uint64_t dtime1:1; | ||
1281 | uint64_t dtime0:1; | ||
1282 | uint64_t dcnt1:1; | ||
1283 | uint64_t dcnt0:1; | ||
1284 | uint64_t dma1fi:1; | ||
1285 | uint64_t dma0fi:1; | ||
1286 | uint64_t reserved_8_8:1; | ||
1287 | uint64_t dma3dbo:1; | ||
1288 | uint64_t dma2dbo:1; | ||
1289 | uint64_t dma1dbo:1; | ||
1290 | uint64_t dma0dbo:1; | ||
1291 | uint64_t iob2big:1; | ||
1292 | uint64_t bar0_to:1; | ||
1293 | uint64_t rml_wto:1; | ||
1294 | uint64_t rml_rto:1; | ||
1295 | } cn52xxp1; | ||
1296 | struct cvmx_npei_int_enb2_s cn56xx; | ||
1297 | struct cvmx_npei_int_enb2_cn56xxp1 { | ||
1298 | uint64_t reserved_61_63:3; | ||
1299 | uint64_t c1_ldwn:1; | ||
1300 | uint64_t c0_ldwn:1; | ||
1301 | uint64_t c1_exc:1; | ||
1302 | uint64_t c0_exc:1; | ||
1303 | uint64_t c1_up_wf:1; | ||
1304 | uint64_t c0_up_wf:1; | ||
1305 | uint64_t c1_un_wf:1; | ||
1306 | uint64_t c0_un_wf:1; | ||
1307 | uint64_t c1_un_bx:1; | ||
1308 | uint64_t c1_un_wi:1; | ||
1309 | uint64_t c1_un_b2:1; | ||
1310 | uint64_t c1_un_b1:1; | ||
1311 | uint64_t c1_un_b0:1; | ||
1312 | uint64_t c1_up_bx:1; | ||
1313 | uint64_t c1_up_wi:1; | ||
1314 | uint64_t c1_up_b2:1; | ||
1315 | uint64_t c1_up_b1:1; | ||
1316 | uint64_t c1_up_b0:1; | ||
1317 | uint64_t c0_un_bx:1; | ||
1318 | uint64_t c0_un_wi:1; | ||
1319 | uint64_t c0_un_b2:1; | ||
1320 | uint64_t c0_un_b1:1; | ||
1321 | uint64_t c0_un_b0:1; | ||
1322 | uint64_t c0_up_bx:1; | ||
1323 | uint64_t c0_up_wi:1; | ||
1324 | uint64_t c0_up_b2:1; | ||
1325 | uint64_t c0_up_b1:1; | ||
1326 | uint64_t c0_up_b0:1; | ||
1327 | uint64_t c1_hpint:1; | ||
1328 | uint64_t c1_pmei:1; | ||
1329 | uint64_t c1_wake:1; | ||
1330 | uint64_t reserved_29_29:1; | ||
1331 | uint64_t c1_se:1; | ||
1332 | uint64_t reserved_27_27:1; | ||
1333 | uint64_t c1_aeri:1; | ||
1334 | uint64_t c0_hpint:1; | ||
1335 | uint64_t c0_pmei:1; | ||
1336 | uint64_t c0_wake:1; | ||
1337 | uint64_t reserved_22_22:1; | ||
1338 | uint64_t c0_se:1; | ||
1339 | uint64_t reserved_20_20:1; | ||
1340 | uint64_t c0_aeri:1; | ||
1341 | uint64_t ptime:1; | ||
1342 | uint64_t pcnt:1; | ||
1343 | uint64_t pidbof:1; | ||
1344 | uint64_t psldbof:1; | ||
1345 | uint64_t dtime1:1; | ||
1346 | uint64_t dtime0:1; | ||
1347 | uint64_t dcnt1:1; | ||
1348 | uint64_t dcnt0:1; | ||
1349 | uint64_t dma1fi:1; | ||
1350 | uint64_t dma0fi:1; | ||
1351 | uint64_t dma4dbo:1; | ||
1352 | uint64_t dma3dbo:1; | ||
1353 | uint64_t dma2dbo:1; | ||
1354 | uint64_t dma1dbo:1; | ||
1355 | uint64_t dma0dbo:1; | ||
1356 | uint64_t iob2big:1; | ||
1357 | uint64_t bar0_to:1; | ||
1358 | uint64_t rml_wto:1; | ||
1359 | uint64_t rml_rto:1; | ||
1360 | } cn56xxp1; | ||
1361 | }; | ||
1362 | |||
1363 | union cvmx_npei_int_info { | ||
1364 | uint64_t u64; | ||
1365 | struct cvmx_npei_int_info_s { | ||
1366 | uint64_t reserved_12_63:52; | ||
1367 | uint64_t pidbof:6; | ||
1368 | uint64_t psldbof:6; | ||
1369 | } s; | ||
1370 | struct cvmx_npei_int_info_s cn52xx; | ||
1371 | struct cvmx_npei_int_info_s cn56xx; | ||
1372 | struct cvmx_npei_int_info_s cn56xxp1; | ||
1373 | }; | ||
1374 | |||
1375 | union cvmx_npei_int_sum { | ||
1376 | uint64_t u64; | ||
1377 | struct cvmx_npei_int_sum_s { | ||
1378 | uint64_t mio_inta:1; | ||
1379 | uint64_t reserved_62_62:1; | ||
1380 | uint64_t int_a:1; | ||
1381 | uint64_t c1_ldwn:1; | ||
1382 | uint64_t c0_ldwn:1; | ||
1383 | uint64_t c1_exc:1; | ||
1384 | uint64_t c0_exc:1; | ||
1385 | uint64_t c1_up_wf:1; | ||
1386 | uint64_t c0_up_wf:1; | ||
1387 | uint64_t c1_un_wf:1; | ||
1388 | uint64_t c0_un_wf:1; | ||
1389 | uint64_t c1_un_bx:1; | ||
1390 | uint64_t c1_un_wi:1; | ||
1391 | uint64_t c1_un_b2:1; | ||
1392 | uint64_t c1_un_b1:1; | ||
1393 | uint64_t c1_un_b0:1; | ||
1394 | uint64_t c1_up_bx:1; | ||
1395 | uint64_t c1_up_wi:1; | ||
1396 | uint64_t c1_up_b2:1; | ||
1397 | uint64_t c1_up_b1:1; | ||
1398 | uint64_t c1_up_b0:1; | ||
1399 | uint64_t c0_un_bx:1; | ||
1400 | uint64_t c0_un_wi:1; | ||
1401 | uint64_t c0_un_b2:1; | ||
1402 | uint64_t c0_un_b1:1; | ||
1403 | uint64_t c0_un_b0:1; | ||
1404 | uint64_t c0_up_bx:1; | ||
1405 | uint64_t c0_up_wi:1; | ||
1406 | uint64_t c0_up_b2:1; | ||
1407 | uint64_t c0_up_b1:1; | ||
1408 | uint64_t c0_up_b0:1; | ||
1409 | uint64_t c1_hpint:1; | ||
1410 | uint64_t c1_pmei:1; | ||
1411 | uint64_t c1_wake:1; | ||
1412 | uint64_t crs1_dr:1; | ||
1413 | uint64_t c1_se:1; | ||
1414 | uint64_t crs1_er:1; | ||
1415 | uint64_t c1_aeri:1; | ||
1416 | uint64_t c0_hpint:1; | ||
1417 | uint64_t c0_pmei:1; | ||
1418 | uint64_t c0_wake:1; | ||
1419 | uint64_t crs0_dr:1; | ||
1420 | uint64_t c0_se:1; | ||
1421 | uint64_t crs0_er:1; | ||
1422 | uint64_t c0_aeri:1; | ||
1423 | uint64_t ptime:1; | ||
1424 | uint64_t pcnt:1; | ||
1425 | uint64_t pidbof:1; | ||
1426 | uint64_t psldbof:1; | ||
1427 | uint64_t dtime1:1; | ||
1428 | uint64_t dtime0:1; | ||
1429 | uint64_t dcnt1:1; | ||
1430 | uint64_t dcnt0:1; | ||
1431 | uint64_t dma1fi:1; | ||
1432 | uint64_t dma0fi:1; | ||
1433 | uint64_t dma4dbo:1; | ||
1434 | uint64_t dma3dbo:1; | ||
1435 | uint64_t dma2dbo:1; | ||
1436 | uint64_t dma1dbo:1; | ||
1437 | uint64_t dma0dbo:1; | ||
1438 | uint64_t iob2big:1; | ||
1439 | uint64_t bar0_to:1; | ||
1440 | uint64_t rml_wto:1; | ||
1441 | uint64_t rml_rto:1; | ||
1442 | } s; | ||
1443 | struct cvmx_npei_int_sum_s cn52xx; | ||
1444 | struct cvmx_npei_int_sum_cn52xxp1 { | ||
1445 | uint64_t mio_inta:1; | ||
1446 | uint64_t reserved_62_62:1; | ||
1447 | uint64_t int_a:1; | ||
1448 | uint64_t c1_ldwn:1; | ||
1449 | uint64_t c0_ldwn:1; | ||
1450 | uint64_t c1_exc:1; | ||
1451 | uint64_t c0_exc:1; | ||
1452 | uint64_t c1_up_wf:1; | ||
1453 | uint64_t c0_up_wf:1; | ||
1454 | uint64_t c1_un_wf:1; | ||
1455 | uint64_t c0_un_wf:1; | ||
1456 | uint64_t c1_un_bx:1; | ||
1457 | uint64_t c1_un_wi:1; | ||
1458 | uint64_t c1_un_b2:1; | ||
1459 | uint64_t c1_un_b1:1; | ||
1460 | uint64_t c1_un_b0:1; | ||
1461 | uint64_t c1_up_bx:1; | ||
1462 | uint64_t c1_up_wi:1; | ||
1463 | uint64_t c1_up_b2:1; | ||
1464 | uint64_t c1_up_b1:1; | ||
1465 | uint64_t c1_up_b0:1; | ||
1466 | uint64_t c0_un_bx:1; | ||
1467 | uint64_t c0_un_wi:1; | ||
1468 | uint64_t c0_un_b2:1; | ||
1469 | uint64_t c0_un_b1:1; | ||
1470 | uint64_t c0_un_b0:1; | ||
1471 | uint64_t c0_up_bx:1; | ||
1472 | uint64_t c0_up_wi:1; | ||
1473 | uint64_t c0_up_b2:1; | ||
1474 | uint64_t c0_up_b1:1; | ||
1475 | uint64_t c0_up_b0:1; | ||
1476 | uint64_t c1_hpint:1; | ||
1477 | uint64_t c1_pmei:1; | ||
1478 | uint64_t c1_wake:1; | ||
1479 | uint64_t crs1_dr:1; | ||
1480 | uint64_t c1_se:1; | ||
1481 | uint64_t crs1_er:1; | ||
1482 | uint64_t c1_aeri:1; | ||
1483 | uint64_t c0_hpint:1; | ||
1484 | uint64_t c0_pmei:1; | ||
1485 | uint64_t c0_wake:1; | ||
1486 | uint64_t crs0_dr:1; | ||
1487 | uint64_t c0_se:1; | ||
1488 | uint64_t crs0_er:1; | ||
1489 | uint64_t c0_aeri:1; | ||
1490 | uint64_t reserved_15_18:4; | ||
1491 | uint64_t dtime1:1; | ||
1492 | uint64_t dtime0:1; | ||
1493 | uint64_t dcnt1:1; | ||
1494 | uint64_t dcnt0:1; | ||
1495 | uint64_t dma1fi:1; | ||
1496 | uint64_t dma0fi:1; | ||
1497 | uint64_t reserved_8_8:1; | ||
1498 | uint64_t dma3dbo:1; | ||
1499 | uint64_t dma2dbo:1; | ||
1500 | uint64_t dma1dbo:1; | ||
1501 | uint64_t dma0dbo:1; | ||
1502 | uint64_t iob2big:1; | ||
1503 | uint64_t bar0_to:1; | ||
1504 | uint64_t rml_wto:1; | ||
1505 | uint64_t rml_rto:1; | ||
1506 | } cn52xxp1; | ||
1507 | struct cvmx_npei_int_sum_s cn56xx; | ||
1508 | struct cvmx_npei_int_sum_cn56xxp1 { | ||
1509 | uint64_t mio_inta:1; | ||
1510 | uint64_t reserved_61_62:2; | ||
1511 | uint64_t c1_ldwn:1; | ||
1512 | uint64_t c0_ldwn:1; | ||
1513 | uint64_t c1_exc:1; | ||
1514 | uint64_t c0_exc:1; | ||
1515 | uint64_t c1_up_wf:1; | ||
1516 | uint64_t c0_up_wf:1; | ||
1517 | uint64_t c1_un_wf:1; | ||
1518 | uint64_t c0_un_wf:1; | ||
1519 | uint64_t c1_un_bx:1; | ||
1520 | uint64_t c1_un_wi:1; | ||
1521 | uint64_t c1_un_b2:1; | ||
1522 | uint64_t c1_un_b1:1; | ||
1523 | uint64_t c1_un_b0:1; | ||
1524 | uint64_t c1_up_bx:1; | ||
1525 | uint64_t c1_up_wi:1; | ||
1526 | uint64_t c1_up_b2:1; | ||
1527 | uint64_t c1_up_b1:1; | ||
1528 | uint64_t c1_up_b0:1; | ||
1529 | uint64_t c0_un_bx:1; | ||
1530 | uint64_t c0_un_wi:1; | ||
1531 | uint64_t c0_un_b2:1; | ||
1532 | uint64_t c0_un_b1:1; | ||
1533 | uint64_t c0_un_b0:1; | ||
1534 | uint64_t c0_up_bx:1; | ||
1535 | uint64_t c0_up_wi:1; | ||
1536 | uint64_t c0_up_b2:1; | ||
1537 | uint64_t c0_up_b1:1; | ||
1538 | uint64_t c0_up_b0:1; | ||
1539 | uint64_t c1_hpint:1; | ||
1540 | uint64_t c1_pmei:1; | ||
1541 | uint64_t c1_wake:1; | ||
1542 | uint64_t reserved_29_29:1; | ||
1543 | uint64_t c1_se:1; | ||
1544 | uint64_t reserved_27_27:1; | ||
1545 | uint64_t c1_aeri:1; | ||
1546 | uint64_t c0_hpint:1; | ||
1547 | uint64_t c0_pmei:1; | ||
1548 | uint64_t c0_wake:1; | ||
1549 | uint64_t reserved_22_22:1; | ||
1550 | uint64_t c0_se:1; | ||
1551 | uint64_t reserved_20_20:1; | ||
1552 | uint64_t c0_aeri:1; | ||
1553 | uint64_t ptime:1; | ||
1554 | uint64_t pcnt:1; | ||
1555 | uint64_t pidbof:1; | ||
1556 | uint64_t psldbof:1; | ||
1557 | uint64_t dtime1:1; | ||
1558 | uint64_t dtime0:1; | ||
1559 | uint64_t dcnt1:1; | ||
1560 | uint64_t dcnt0:1; | ||
1561 | uint64_t dma1fi:1; | ||
1562 | uint64_t dma0fi:1; | ||
1563 | uint64_t dma4dbo:1; | ||
1564 | uint64_t dma3dbo:1; | ||
1565 | uint64_t dma2dbo:1; | ||
1566 | uint64_t dma1dbo:1; | ||
1567 | uint64_t dma0dbo:1; | ||
1568 | uint64_t iob2big:1; | ||
1569 | uint64_t bar0_to:1; | ||
1570 | uint64_t rml_wto:1; | ||
1571 | uint64_t rml_rto:1; | ||
1572 | } cn56xxp1; | ||
1573 | }; | ||
1574 | |||
1575 | union cvmx_npei_int_sum2 { | ||
1576 | uint64_t u64; | ||
1577 | struct cvmx_npei_int_sum2_s { | ||
1578 | uint64_t mio_inta:1; | ||
1579 | uint64_t reserved_62_62:1; | ||
1580 | uint64_t int_a:1; | ||
1581 | uint64_t c1_ldwn:1; | ||
1582 | uint64_t c0_ldwn:1; | ||
1583 | uint64_t c1_exc:1; | ||
1584 | uint64_t c0_exc:1; | ||
1585 | uint64_t c1_up_wf:1; | ||
1586 | uint64_t c0_up_wf:1; | ||
1587 | uint64_t c1_un_wf:1; | ||
1588 | uint64_t c0_un_wf:1; | ||
1589 | uint64_t c1_un_bx:1; | ||
1590 | uint64_t c1_un_wi:1; | ||
1591 | uint64_t c1_un_b2:1; | ||
1592 | uint64_t c1_un_b1:1; | ||
1593 | uint64_t c1_un_b0:1; | ||
1594 | uint64_t c1_up_bx:1; | ||
1595 | uint64_t c1_up_wi:1; | ||
1596 | uint64_t c1_up_b2:1; | ||
1597 | uint64_t c1_up_b1:1; | ||
1598 | uint64_t c1_up_b0:1; | ||
1599 | uint64_t c0_un_bx:1; | ||
1600 | uint64_t c0_un_wi:1; | ||
1601 | uint64_t c0_un_b2:1; | ||
1602 | uint64_t c0_un_b1:1; | ||
1603 | uint64_t c0_un_b0:1; | ||
1604 | uint64_t c0_up_bx:1; | ||
1605 | uint64_t c0_up_wi:1; | ||
1606 | uint64_t c0_up_b2:1; | ||
1607 | uint64_t c0_up_b1:1; | ||
1608 | uint64_t c0_up_b0:1; | ||
1609 | uint64_t c1_hpint:1; | ||
1610 | uint64_t c1_pmei:1; | ||
1611 | uint64_t c1_wake:1; | ||
1612 | uint64_t crs1_dr:1; | ||
1613 | uint64_t c1_se:1; | ||
1614 | uint64_t crs1_er:1; | ||
1615 | uint64_t c1_aeri:1; | ||
1616 | uint64_t c0_hpint:1; | ||
1617 | uint64_t c0_pmei:1; | ||
1618 | uint64_t c0_wake:1; | ||
1619 | uint64_t crs0_dr:1; | ||
1620 | uint64_t c0_se:1; | ||
1621 | uint64_t crs0_er:1; | ||
1622 | uint64_t c0_aeri:1; | ||
1623 | uint64_t reserved_15_18:4; | ||
1624 | uint64_t dtime1:1; | ||
1625 | uint64_t dtime0:1; | ||
1626 | uint64_t dcnt1:1; | ||
1627 | uint64_t dcnt0:1; | ||
1628 | uint64_t dma1fi:1; | ||
1629 | uint64_t dma0fi:1; | ||
1630 | uint64_t reserved_8_8:1; | ||
1631 | uint64_t dma3dbo:1; | ||
1632 | uint64_t dma2dbo:1; | ||
1633 | uint64_t dma1dbo:1; | ||
1634 | uint64_t dma0dbo:1; | ||
1635 | uint64_t iob2big:1; | ||
1636 | uint64_t bar0_to:1; | ||
1637 | uint64_t rml_wto:1; | ||
1638 | uint64_t rml_rto:1; | ||
1639 | } s; | ||
1640 | struct cvmx_npei_int_sum2_s cn52xx; | ||
1641 | struct cvmx_npei_int_sum2_s cn52xxp1; | ||
1642 | struct cvmx_npei_int_sum2_s cn56xx; | ||
1643 | }; | ||
1644 | |||
1645 | union cvmx_npei_last_win_rdata0 { | ||
1646 | uint64_t u64; | ||
1647 | struct cvmx_npei_last_win_rdata0_s { | ||
1648 | uint64_t data:64; | ||
1649 | } s; | ||
1650 | struct cvmx_npei_last_win_rdata0_s cn52xx; | ||
1651 | struct cvmx_npei_last_win_rdata0_s cn52xxp1; | ||
1652 | struct cvmx_npei_last_win_rdata0_s cn56xx; | ||
1653 | struct cvmx_npei_last_win_rdata0_s cn56xxp1; | ||
1654 | }; | ||
1655 | |||
1656 | union cvmx_npei_last_win_rdata1 { | ||
1657 | uint64_t u64; | ||
1658 | struct cvmx_npei_last_win_rdata1_s { | ||
1659 | uint64_t data:64; | ||
1660 | } s; | ||
1661 | struct cvmx_npei_last_win_rdata1_s cn52xx; | ||
1662 | struct cvmx_npei_last_win_rdata1_s cn52xxp1; | ||
1663 | struct cvmx_npei_last_win_rdata1_s cn56xx; | ||
1664 | struct cvmx_npei_last_win_rdata1_s cn56xxp1; | ||
1665 | }; | ||
1666 | |||
1667 | union cvmx_npei_mem_access_ctl { | ||
1668 | uint64_t u64; | ||
1669 | struct cvmx_npei_mem_access_ctl_s { | ||
1670 | uint64_t reserved_14_63:50; | ||
1671 | uint64_t max_word:4; | ||
1672 | uint64_t timer:10; | ||
1673 | } s; | ||
1674 | struct cvmx_npei_mem_access_ctl_s cn52xx; | ||
1675 | struct cvmx_npei_mem_access_ctl_s cn52xxp1; | ||
1676 | struct cvmx_npei_mem_access_ctl_s cn56xx; | ||
1677 | struct cvmx_npei_mem_access_ctl_s cn56xxp1; | ||
1678 | }; | ||
1679 | |||
1680 | union cvmx_npei_mem_access_subidx { | ||
1681 | uint64_t u64; | ||
1682 | struct cvmx_npei_mem_access_subidx_s { | ||
1683 | uint64_t reserved_42_63:22; | ||
1684 | uint64_t zero:1; | ||
1685 | uint64_t port:2; | ||
1686 | uint64_t nmerge:1; | ||
1687 | uint64_t esr:2; | ||
1688 | uint64_t esw:2; | ||
1689 | uint64_t nsr:1; | ||
1690 | uint64_t nsw:1; | ||
1691 | uint64_t ror:1; | ||
1692 | uint64_t row:1; | ||
1693 | uint64_t ba:30; | ||
1694 | } s; | ||
1695 | struct cvmx_npei_mem_access_subidx_s cn52xx; | ||
1696 | struct cvmx_npei_mem_access_subidx_s cn52xxp1; | ||
1697 | struct cvmx_npei_mem_access_subidx_s cn56xx; | ||
1698 | struct cvmx_npei_mem_access_subidx_s cn56xxp1; | ||
1699 | }; | ||
1700 | |||
1701 | union cvmx_npei_msi_enb0 { | ||
1702 | uint64_t u64; | ||
1703 | struct cvmx_npei_msi_enb0_s { | ||
1704 | uint64_t enb:64; | ||
1705 | } s; | ||
1706 | struct cvmx_npei_msi_enb0_s cn52xx; | ||
1707 | struct cvmx_npei_msi_enb0_s cn52xxp1; | ||
1708 | struct cvmx_npei_msi_enb0_s cn56xx; | ||
1709 | struct cvmx_npei_msi_enb0_s cn56xxp1; | ||
1710 | }; | ||
1711 | |||
1712 | union cvmx_npei_msi_enb1 { | ||
1713 | uint64_t u64; | ||
1714 | struct cvmx_npei_msi_enb1_s { | ||
1715 | uint64_t enb:64; | ||
1716 | } s; | ||
1717 | struct cvmx_npei_msi_enb1_s cn52xx; | ||
1718 | struct cvmx_npei_msi_enb1_s cn52xxp1; | ||
1719 | struct cvmx_npei_msi_enb1_s cn56xx; | ||
1720 | struct cvmx_npei_msi_enb1_s cn56xxp1; | ||
1721 | }; | ||
1722 | |||
1723 | union cvmx_npei_msi_enb2 { | ||
1724 | uint64_t u64; | ||
1725 | struct cvmx_npei_msi_enb2_s { | ||
1726 | uint64_t enb:64; | ||
1727 | } s; | ||
1728 | struct cvmx_npei_msi_enb2_s cn52xx; | ||
1729 | struct cvmx_npei_msi_enb2_s cn52xxp1; | ||
1730 | struct cvmx_npei_msi_enb2_s cn56xx; | ||
1731 | struct cvmx_npei_msi_enb2_s cn56xxp1; | ||
1732 | }; | ||
1733 | |||
1734 | union cvmx_npei_msi_enb3 { | ||
1735 | uint64_t u64; | ||
1736 | struct cvmx_npei_msi_enb3_s { | ||
1737 | uint64_t enb:64; | ||
1738 | } s; | ||
1739 | struct cvmx_npei_msi_enb3_s cn52xx; | ||
1740 | struct cvmx_npei_msi_enb3_s cn52xxp1; | ||
1741 | struct cvmx_npei_msi_enb3_s cn56xx; | ||
1742 | struct cvmx_npei_msi_enb3_s cn56xxp1; | ||
1743 | }; | ||
1744 | |||
1745 | union cvmx_npei_msi_rcv0 { | ||
1746 | uint64_t u64; | ||
1747 | struct cvmx_npei_msi_rcv0_s { | ||
1748 | uint64_t intr:64; | ||
1749 | } s; | ||
1750 | struct cvmx_npei_msi_rcv0_s cn52xx; | ||
1751 | struct cvmx_npei_msi_rcv0_s cn52xxp1; | ||
1752 | struct cvmx_npei_msi_rcv0_s cn56xx; | ||
1753 | struct cvmx_npei_msi_rcv0_s cn56xxp1; | ||
1754 | }; | ||
1755 | |||
1756 | union cvmx_npei_msi_rcv1 { | ||
1757 | uint64_t u64; | ||
1758 | struct cvmx_npei_msi_rcv1_s { | ||
1759 | uint64_t intr:64; | ||
1760 | } s; | ||
1761 | struct cvmx_npei_msi_rcv1_s cn52xx; | ||
1762 | struct cvmx_npei_msi_rcv1_s cn52xxp1; | ||
1763 | struct cvmx_npei_msi_rcv1_s cn56xx; | ||
1764 | struct cvmx_npei_msi_rcv1_s cn56xxp1; | ||
1765 | }; | ||
1766 | |||
1767 | union cvmx_npei_msi_rcv2 { | ||
1768 | uint64_t u64; | ||
1769 | struct cvmx_npei_msi_rcv2_s { | ||
1770 | uint64_t intr:64; | ||
1771 | } s; | ||
1772 | struct cvmx_npei_msi_rcv2_s cn52xx; | ||
1773 | struct cvmx_npei_msi_rcv2_s cn52xxp1; | ||
1774 | struct cvmx_npei_msi_rcv2_s cn56xx; | ||
1775 | struct cvmx_npei_msi_rcv2_s cn56xxp1; | ||
1776 | }; | ||
1777 | |||
1778 | union cvmx_npei_msi_rcv3 { | ||
1779 | uint64_t u64; | ||
1780 | struct cvmx_npei_msi_rcv3_s { | ||
1781 | uint64_t intr:64; | ||
1782 | } s; | ||
1783 | struct cvmx_npei_msi_rcv3_s cn52xx; | ||
1784 | struct cvmx_npei_msi_rcv3_s cn52xxp1; | ||
1785 | struct cvmx_npei_msi_rcv3_s cn56xx; | ||
1786 | struct cvmx_npei_msi_rcv3_s cn56xxp1; | ||
1787 | }; | ||
1788 | |||
1789 | union cvmx_npei_msi_rd_map { | ||
1790 | uint64_t u64; | ||
1791 | struct cvmx_npei_msi_rd_map_s { | ||
1792 | uint64_t reserved_16_63:48; | ||
1793 | uint64_t rd_int:8; | ||
1794 | uint64_t msi_int:8; | ||
1795 | } s; | ||
1796 | struct cvmx_npei_msi_rd_map_s cn52xx; | ||
1797 | struct cvmx_npei_msi_rd_map_s cn52xxp1; | ||
1798 | struct cvmx_npei_msi_rd_map_s cn56xx; | ||
1799 | struct cvmx_npei_msi_rd_map_s cn56xxp1; | ||
1800 | }; | ||
1801 | |||
1802 | union cvmx_npei_msi_w1c_enb0 { | ||
1803 | uint64_t u64; | ||
1804 | struct cvmx_npei_msi_w1c_enb0_s { | ||
1805 | uint64_t clr:64; | ||
1806 | } s; | ||
1807 | struct cvmx_npei_msi_w1c_enb0_s cn52xx; | ||
1808 | struct cvmx_npei_msi_w1c_enb0_s cn56xx; | ||
1809 | }; | ||
1810 | |||
1811 | union cvmx_npei_msi_w1c_enb1 { | ||
1812 | uint64_t u64; | ||
1813 | struct cvmx_npei_msi_w1c_enb1_s { | ||
1814 | uint64_t clr:64; | ||
1815 | } s; | ||
1816 | struct cvmx_npei_msi_w1c_enb1_s cn52xx; | ||
1817 | struct cvmx_npei_msi_w1c_enb1_s cn56xx; | ||
1818 | }; | ||
1819 | |||
1820 | union cvmx_npei_msi_w1c_enb2 { | ||
1821 | uint64_t u64; | ||
1822 | struct cvmx_npei_msi_w1c_enb2_s { | ||
1823 | uint64_t clr:64; | ||
1824 | } s; | ||
1825 | struct cvmx_npei_msi_w1c_enb2_s cn52xx; | ||
1826 | struct cvmx_npei_msi_w1c_enb2_s cn56xx; | ||
1827 | }; | ||
1828 | |||
1829 | union cvmx_npei_msi_w1c_enb3 { | ||
1830 | uint64_t u64; | ||
1831 | struct cvmx_npei_msi_w1c_enb3_s { | ||
1832 | uint64_t clr:64; | ||
1833 | } s; | ||
1834 | struct cvmx_npei_msi_w1c_enb3_s cn52xx; | ||
1835 | struct cvmx_npei_msi_w1c_enb3_s cn56xx; | ||
1836 | }; | ||
1837 | |||
1838 | union cvmx_npei_msi_w1s_enb0 { | ||
1839 | uint64_t u64; | ||
1840 | struct cvmx_npei_msi_w1s_enb0_s { | ||
1841 | uint64_t set:64; | ||
1842 | } s; | ||
1843 | struct cvmx_npei_msi_w1s_enb0_s cn52xx; | ||
1844 | struct cvmx_npei_msi_w1s_enb0_s cn56xx; | ||
1845 | }; | ||
1846 | |||
1847 | union cvmx_npei_msi_w1s_enb1 { | ||
1848 | uint64_t u64; | ||
1849 | struct cvmx_npei_msi_w1s_enb1_s { | ||
1850 | uint64_t set:64; | ||
1851 | } s; | ||
1852 | struct cvmx_npei_msi_w1s_enb1_s cn52xx; | ||
1853 | struct cvmx_npei_msi_w1s_enb1_s cn56xx; | ||
1854 | }; | ||
1855 | |||
1856 | union cvmx_npei_msi_w1s_enb2 { | ||
1857 | uint64_t u64; | ||
1858 | struct cvmx_npei_msi_w1s_enb2_s { | ||
1859 | uint64_t set:64; | ||
1860 | } s; | ||
1861 | struct cvmx_npei_msi_w1s_enb2_s cn52xx; | ||
1862 | struct cvmx_npei_msi_w1s_enb2_s cn56xx; | ||
1863 | }; | ||
1864 | |||
1865 | union cvmx_npei_msi_w1s_enb3 { | ||
1866 | uint64_t u64; | ||
1867 | struct cvmx_npei_msi_w1s_enb3_s { | ||
1868 | uint64_t set:64; | ||
1869 | } s; | ||
1870 | struct cvmx_npei_msi_w1s_enb3_s cn52xx; | ||
1871 | struct cvmx_npei_msi_w1s_enb3_s cn56xx; | ||
1872 | }; | ||
1873 | |||
1874 | union cvmx_npei_msi_wr_map { | ||
1875 | uint64_t u64; | ||
1876 | struct cvmx_npei_msi_wr_map_s { | ||
1877 | uint64_t reserved_16_63:48; | ||
1878 | uint64_t ciu_int:8; | ||
1879 | uint64_t msi_int:8; | ||
1880 | } s; | ||
1881 | struct cvmx_npei_msi_wr_map_s cn52xx; | ||
1882 | struct cvmx_npei_msi_wr_map_s cn52xxp1; | ||
1883 | struct cvmx_npei_msi_wr_map_s cn56xx; | ||
1884 | struct cvmx_npei_msi_wr_map_s cn56xxp1; | ||
1885 | }; | ||
1886 | |||
1887 | union cvmx_npei_pcie_credit_cnt { | ||
1888 | uint64_t u64; | ||
1889 | struct cvmx_npei_pcie_credit_cnt_s { | ||
1890 | uint64_t reserved_48_63:16; | ||
1891 | uint64_t p1_ccnt:8; | ||
1892 | uint64_t p1_ncnt:8; | ||
1893 | uint64_t p1_pcnt:8; | ||
1894 | uint64_t p0_ccnt:8; | ||
1895 | uint64_t p0_ncnt:8; | ||
1896 | uint64_t p0_pcnt:8; | ||
1897 | } s; | ||
1898 | struct cvmx_npei_pcie_credit_cnt_s cn52xx; | ||
1899 | struct cvmx_npei_pcie_credit_cnt_s cn56xx; | ||
1900 | }; | ||
1901 | |||
1902 | union cvmx_npei_pcie_msi_rcv { | ||
1903 | uint64_t u64; | ||
1904 | struct cvmx_npei_pcie_msi_rcv_s { | ||
1905 | uint64_t reserved_8_63:56; | ||
1906 | uint64_t intr:8; | ||
1907 | } s; | ||
1908 | struct cvmx_npei_pcie_msi_rcv_s cn52xx; | ||
1909 | struct cvmx_npei_pcie_msi_rcv_s cn52xxp1; | ||
1910 | struct cvmx_npei_pcie_msi_rcv_s cn56xx; | ||
1911 | struct cvmx_npei_pcie_msi_rcv_s cn56xxp1; | ||
1912 | }; | ||
1913 | |||
1914 | union cvmx_npei_pcie_msi_rcv_b1 { | ||
1915 | uint64_t u64; | ||
1916 | struct cvmx_npei_pcie_msi_rcv_b1_s { | ||
1917 | uint64_t reserved_16_63:48; | ||
1918 | uint64_t intr:8; | ||
1919 | uint64_t reserved_0_7:8; | ||
1920 | } s; | ||
1921 | struct cvmx_npei_pcie_msi_rcv_b1_s cn52xx; | ||
1922 | struct cvmx_npei_pcie_msi_rcv_b1_s cn52xxp1; | ||
1923 | struct cvmx_npei_pcie_msi_rcv_b1_s cn56xx; | ||
1924 | struct cvmx_npei_pcie_msi_rcv_b1_s cn56xxp1; | ||
1925 | }; | ||
1926 | |||
1927 | union cvmx_npei_pcie_msi_rcv_b2 { | ||
1928 | uint64_t u64; | ||
1929 | struct cvmx_npei_pcie_msi_rcv_b2_s { | ||
1930 | uint64_t reserved_24_63:40; | ||
1931 | uint64_t intr:8; | ||
1932 | uint64_t reserved_0_15:16; | ||
1933 | } s; | ||
1934 | struct cvmx_npei_pcie_msi_rcv_b2_s cn52xx; | ||
1935 | struct cvmx_npei_pcie_msi_rcv_b2_s cn52xxp1; | ||
1936 | struct cvmx_npei_pcie_msi_rcv_b2_s cn56xx; | ||
1937 | struct cvmx_npei_pcie_msi_rcv_b2_s cn56xxp1; | ||
1938 | }; | ||
1939 | |||
1940 | union cvmx_npei_pcie_msi_rcv_b3 { | ||
1941 | uint64_t u64; | ||
1942 | struct cvmx_npei_pcie_msi_rcv_b3_s { | ||
1943 | uint64_t reserved_32_63:32; | ||
1944 | uint64_t intr:8; | ||
1945 | uint64_t reserved_0_23:24; | ||
1946 | } s; | ||
1947 | struct cvmx_npei_pcie_msi_rcv_b3_s cn52xx; | ||
1948 | struct cvmx_npei_pcie_msi_rcv_b3_s cn52xxp1; | ||
1949 | struct cvmx_npei_pcie_msi_rcv_b3_s cn56xx; | ||
1950 | struct cvmx_npei_pcie_msi_rcv_b3_s cn56xxp1; | ||
1951 | }; | ||
1952 | |||
1953 | union cvmx_npei_pktx_cnts { | ||
1954 | uint64_t u64; | ||
1955 | struct cvmx_npei_pktx_cnts_s { | ||
1956 | uint64_t reserved_54_63:10; | ||
1957 | uint64_t timer:22; | ||
1958 | uint64_t cnt:32; | ||
1959 | } s; | ||
1960 | struct cvmx_npei_pktx_cnts_s cn52xx; | ||
1961 | struct cvmx_npei_pktx_cnts_s cn56xx; | ||
1962 | struct cvmx_npei_pktx_cnts_s cn56xxp1; | ||
1963 | }; | ||
1964 | |||
1965 | union cvmx_npei_pktx_in_bp { | ||
1966 | uint64_t u64; | ||
1967 | struct cvmx_npei_pktx_in_bp_s { | ||
1968 | uint64_t wmark:32; | ||
1969 | uint64_t cnt:32; | ||
1970 | } s; | ||
1971 | struct cvmx_npei_pktx_in_bp_s cn52xx; | ||
1972 | struct cvmx_npei_pktx_in_bp_s cn56xx; | ||
1973 | struct cvmx_npei_pktx_in_bp_s cn56xxp1; | ||
1974 | }; | ||
1975 | |||
1976 | union cvmx_npei_pktx_instr_baddr { | ||
1977 | uint64_t u64; | ||
1978 | struct cvmx_npei_pktx_instr_baddr_s { | ||
1979 | uint64_t addr:61; | ||
1980 | uint64_t reserved_0_2:3; | ||
1981 | } s; | ||
1982 | struct cvmx_npei_pktx_instr_baddr_s cn52xx; | ||
1983 | struct cvmx_npei_pktx_instr_baddr_s cn56xx; | ||
1984 | struct cvmx_npei_pktx_instr_baddr_s cn56xxp1; | ||
1985 | }; | ||
1986 | |||
1987 | union cvmx_npei_pktx_instr_baoff_dbell { | ||
1988 | uint64_t u64; | ||
1989 | struct cvmx_npei_pktx_instr_baoff_dbell_s { | ||
1990 | uint64_t aoff:32; | ||
1991 | uint64_t dbell:32; | ||
1992 | } s; | ||
1993 | struct cvmx_npei_pktx_instr_baoff_dbell_s cn52xx; | ||
1994 | struct cvmx_npei_pktx_instr_baoff_dbell_s cn56xx; | ||
1995 | struct cvmx_npei_pktx_instr_baoff_dbell_s cn56xxp1; | ||
1996 | }; | ||
1997 | |||
1998 | union cvmx_npei_pktx_instr_fifo_rsize { | ||
1999 | uint64_t u64; | ||
2000 | struct cvmx_npei_pktx_instr_fifo_rsize_s { | ||
2001 | uint64_t max:9; | ||
2002 | uint64_t rrp:9; | ||
2003 | uint64_t wrp:9; | ||
2004 | uint64_t fcnt:5; | ||
2005 | uint64_t rsize:32; | ||
2006 | } s; | ||
2007 | struct cvmx_npei_pktx_instr_fifo_rsize_s cn52xx; | ||
2008 | struct cvmx_npei_pktx_instr_fifo_rsize_s cn56xx; | ||
2009 | struct cvmx_npei_pktx_instr_fifo_rsize_s cn56xxp1; | ||
2010 | }; | ||
2011 | |||
2012 | union cvmx_npei_pktx_instr_header { | ||
2013 | uint64_t u64; | ||
2014 | struct cvmx_npei_pktx_instr_header_s { | ||
2015 | uint64_t reserved_44_63:20; | ||
2016 | uint64_t pbp:1; | ||
2017 | uint64_t rsv_f:5; | ||
2018 | uint64_t rparmode:2; | ||
2019 | uint64_t rsv_e:1; | ||
2020 | uint64_t rskp_len:7; | ||
2021 | uint64_t rsv_d:6; | ||
2022 | uint64_t use_ihdr:1; | ||
2023 | uint64_t rsv_c:5; | ||
2024 | uint64_t par_mode:2; | ||
2025 | uint64_t rsv_b:1; | ||
2026 | uint64_t skp_len:7; | ||
2027 | uint64_t rsv_a:6; | ||
2028 | } s; | ||
2029 | struct cvmx_npei_pktx_instr_header_s cn52xx; | ||
2030 | struct cvmx_npei_pktx_instr_header_s cn56xx; | ||
2031 | struct cvmx_npei_pktx_instr_header_s cn56xxp1; | ||
2032 | }; | ||
2033 | |||
2034 | union cvmx_npei_pktx_slist_baddr { | ||
2035 | uint64_t u64; | ||
2036 | struct cvmx_npei_pktx_slist_baddr_s { | ||
2037 | uint64_t addr:60; | ||
2038 | uint64_t reserved_0_3:4; | ||
2039 | } s; | ||
2040 | struct cvmx_npei_pktx_slist_baddr_s cn52xx; | ||
2041 | struct cvmx_npei_pktx_slist_baddr_s cn56xx; | ||
2042 | struct cvmx_npei_pktx_slist_baddr_s cn56xxp1; | ||
2043 | }; | ||
2044 | |||
2045 | union cvmx_npei_pktx_slist_baoff_dbell { | ||
2046 | uint64_t u64; | ||
2047 | struct cvmx_npei_pktx_slist_baoff_dbell_s { | ||
2048 | uint64_t aoff:32; | ||
2049 | uint64_t dbell:32; | ||
2050 | } s; | ||
2051 | struct cvmx_npei_pktx_slist_baoff_dbell_s cn52xx; | ||
2052 | struct cvmx_npei_pktx_slist_baoff_dbell_s cn56xx; | ||
2053 | struct cvmx_npei_pktx_slist_baoff_dbell_s cn56xxp1; | ||
2054 | }; | ||
2055 | |||
2056 | union cvmx_npei_pktx_slist_fifo_rsize { | ||
2057 | uint64_t u64; | ||
2058 | struct cvmx_npei_pktx_slist_fifo_rsize_s { | ||
2059 | uint64_t reserved_32_63:32; | ||
2060 | uint64_t rsize:32; | ||
2061 | } s; | ||
2062 | struct cvmx_npei_pktx_slist_fifo_rsize_s cn52xx; | ||
2063 | struct cvmx_npei_pktx_slist_fifo_rsize_s cn56xx; | ||
2064 | struct cvmx_npei_pktx_slist_fifo_rsize_s cn56xxp1; | ||
2065 | }; | ||
2066 | |||
2067 | union cvmx_npei_pkt_cnt_int { | ||
2068 | uint64_t u64; | ||
2069 | struct cvmx_npei_pkt_cnt_int_s { | ||
2070 | uint64_t reserved_32_63:32; | ||
2071 | uint64_t port:32; | ||
2072 | } s; | ||
2073 | struct cvmx_npei_pkt_cnt_int_s cn52xx; | ||
2074 | struct cvmx_npei_pkt_cnt_int_s cn56xx; | ||
2075 | struct cvmx_npei_pkt_cnt_int_s cn56xxp1; | ||
2076 | }; | ||
2077 | |||
2078 | union cvmx_npei_pkt_cnt_int_enb { | ||
2079 | uint64_t u64; | ||
2080 | struct cvmx_npei_pkt_cnt_int_enb_s { | ||
2081 | uint64_t reserved_32_63:32; | ||
2082 | uint64_t port:32; | ||
2083 | } s; | ||
2084 | struct cvmx_npei_pkt_cnt_int_enb_s cn52xx; | ||
2085 | struct cvmx_npei_pkt_cnt_int_enb_s cn56xx; | ||
2086 | struct cvmx_npei_pkt_cnt_int_enb_s cn56xxp1; | ||
2087 | }; | ||
2088 | |||
2089 | union cvmx_npei_pkt_data_out_es { | ||
2090 | uint64_t u64; | ||
2091 | struct cvmx_npei_pkt_data_out_es_s { | ||
2092 | uint64_t es:64; | ||
2093 | } s; | ||
2094 | struct cvmx_npei_pkt_data_out_es_s cn52xx; | ||
2095 | struct cvmx_npei_pkt_data_out_es_s cn56xx; | ||
2096 | struct cvmx_npei_pkt_data_out_es_s cn56xxp1; | ||
2097 | }; | ||
2098 | |||
2099 | union cvmx_npei_pkt_data_out_ns { | ||
2100 | uint64_t u64; | ||
2101 | struct cvmx_npei_pkt_data_out_ns_s { | ||
2102 | uint64_t reserved_32_63:32; | ||
2103 | uint64_t nsr:32; | ||
2104 | } s; | ||
2105 | struct cvmx_npei_pkt_data_out_ns_s cn52xx; | ||
2106 | struct cvmx_npei_pkt_data_out_ns_s cn56xx; | ||
2107 | struct cvmx_npei_pkt_data_out_ns_s cn56xxp1; | ||
2108 | }; | ||
2109 | |||
2110 | union cvmx_npei_pkt_data_out_ror { | ||
2111 | uint64_t u64; | ||
2112 | struct cvmx_npei_pkt_data_out_ror_s { | ||
2113 | uint64_t reserved_32_63:32; | ||
2114 | uint64_t ror:32; | ||
2115 | } s; | ||
2116 | struct cvmx_npei_pkt_data_out_ror_s cn52xx; | ||
2117 | struct cvmx_npei_pkt_data_out_ror_s cn56xx; | ||
2118 | struct cvmx_npei_pkt_data_out_ror_s cn56xxp1; | ||
2119 | }; | ||
2120 | |||
2121 | union cvmx_npei_pkt_dpaddr { | ||
2122 | uint64_t u64; | ||
2123 | struct cvmx_npei_pkt_dpaddr_s { | ||
2124 | uint64_t reserved_32_63:32; | ||
2125 | uint64_t dptr:32; | ||
2126 | } s; | ||
2127 | struct cvmx_npei_pkt_dpaddr_s cn52xx; | ||
2128 | struct cvmx_npei_pkt_dpaddr_s cn56xx; | ||
2129 | struct cvmx_npei_pkt_dpaddr_s cn56xxp1; | ||
2130 | }; | ||
2131 | |||
2132 | union cvmx_npei_pkt_in_bp { | ||
2133 | uint64_t u64; | ||
2134 | struct cvmx_npei_pkt_in_bp_s { | ||
2135 | uint64_t reserved_32_63:32; | ||
2136 | uint64_t bp:32; | ||
2137 | } s; | ||
2138 | struct cvmx_npei_pkt_in_bp_s cn56xx; | ||
2139 | }; | ||
2140 | |||
2141 | union cvmx_npei_pkt_in_donex_cnts { | ||
2142 | uint64_t u64; | ||
2143 | struct cvmx_npei_pkt_in_donex_cnts_s { | ||
2144 | uint64_t reserved_32_63:32; | ||
2145 | uint64_t cnt:32; | ||
2146 | } s; | ||
2147 | struct cvmx_npei_pkt_in_donex_cnts_s cn52xx; | ||
2148 | struct cvmx_npei_pkt_in_donex_cnts_s cn56xx; | ||
2149 | struct cvmx_npei_pkt_in_donex_cnts_s cn56xxp1; | ||
2150 | }; | ||
2151 | |||
2152 | union cvmx_npei_pkt_in_instr_counts { | ||
2153 | uint64_t u64; | ||
2154 | struct cvmx_npei_pkt_in_instr_counts_s { | ||
2155 | uint64_t wr_cnt:32; | ||
2156 | uint64_t rd_cnt:32; | ||
2157 | } s; | ||
2158 | struct cvmx_npei_pkt_in_instr_counts_s cn52xx; | ||
2159 | struct cvmx_npei_pkt_in_instr_counts_s cn56xx; | ||
2160 | }; | ||
2161 | |||
2162 | union cvmx_npei_pkt_in_pcie_port { | ||
2163 | uint64_t u64; | ||
2164 | struct cvmx_npei_pkt_in_pcie_port_s { | ||
2165 | uint64_t pp:64; | ||
2166 | } s; | ||
2167 | struct cvmx_npei_pkt_in_pcie_port_s cn52xx; | ||
2168 | struct cvmx_npei_pkt_in_pcie_port_s cn56xx; | ||
2169 | }; | ||
2170 | |||
2171 | union cvmx_npei_pkt_input_control { | ||
2172 | uint64_t u64; | ||
2173 | struct cvmx_npei_pkt_input_control_s { | ||
2174 | uint64_t reserved_23_63:41; | ||
2175 | uint64_t pkt_rr:1; | ||
2176 | uint64_t pbp_dhi:13; | ||
2177 | uint64_t d_nsr:1; | ||
2178 | uint64_t d_esr:2; | ||
2179 | uint64_t d_ror:1; | ||
2180 | uint64_t use_csr:1; | ||
2181 | uint64_t nsr:1; | ||
2182 | uint64_t esr:2; | ||
2183 | uint64_t ror:1; | ||
2184 | } s; | ||
2185 | struct cvmx_npei_pkt_input_control_s cn52xx; | ||
2186 | struct cvmx_npei_pkt_input_control_s cn56xx; | ||
2187 | struct cvmx_npei_pkt_input_control_s cn56xxp1; | ||
2188 | }; | ||
2189 | |||
2190 | union cvmx_npei_pkt_instr_enb { | ||
2191 | uint64_t u64; | ||
2192 | struct cvmx_npei_pkt_instr_enb_s { | ||
2193 | uint64_t reserved_32_63:32; | ||
2194 | uint64_t enb:32; | ||
2195 | } s; | ||
2196 | struct cvmx_npei_pkt_instr_enb_s cn52xx; | ||
2197 | struct cvmx_npei_pkt_instr_enb_s cn56xx; | ||
2198 | struct cvmx_npei_pkt_instr_enb_s cn56xxp1; | ||
2199 | }; | ||
2200 | |||
2201 | union cvmx_npei_pkt_instr_rd_size { | ||
2202 | uint64_t u64; | ||
2203 | struct cvmx_npei_pkt_instr_rd_size_s { | ||
2204 | uint64_t rdsize:64; | ||
2205 | } s; | ||
2206 | struct cvmx_npei_pkt_instr_rd_size_s cn52xx; | ||
2207 | struct cvmx_npei_pkt_instr_rd_size_s cn56xx; | ||
2208 | }; | ||
2209 | |||
2210 | union cvmx_npei_pkt_instr_size { | ||
2211 | uint64_t u64; | ||
2212 | struct cvmx_npei_pkt_instr_size_s { | ||
2213 | uint64_t reserved_32_63:32; | ||
2214 | uint64_t is_64b:32; | ||
2215 | } s; | ||
2216 | struct cvmx_npei_pkt_instr_size_s cn52xx; | ||
2217 | struct cvmx_npei_pkt_instr_size_s cn56xx; | ||
2218 | struct cvmx_npei_pkt_instr_size_s cn56xxp1; | ||
2219 | }; | ||
2220 | |||
2221 | union cvmx_npei_pkt_int_levels { | ||
2222 | uint64_t u64; | ||
2223 | struct cvmx_npei_pkt_int_levels_s { | ||
2224 | uint64_t reserved_54_63:10; | ||
2225 | uint64_t time:22; | ||
2226 | uint64_t cnt:32; | ||
2227 | } s; | ||
2228 | struct cvmx_npei_pkt_int_levels_s cn52xx; | ||
2229 | struct cvmx_npei_pkt_int_levels_s cn56xx; | ||
2230 | struct cvmx_npei_pkt_int_levels_s cn56xxp1; | ||
2231 | }; | ||
2232 | |||
2233 | union cvmx_npei_pkt_iptr { | ||
2234 | uint64_t u64; | ||
2235 | struct cvmx_npei_pkt_iptr_s { | ||
2236 | uint64_t reserved_32_63:32; | ||
2237 | uint64_t iptr:32; | ||
2238 | } s; | ||
2239 | struct cvmx_npei_pkt_iptr_s cn52xx; | ||
2240 | struct cvmx_npei_pkt_iptr_s cn56xx; | ||
2241 | struct cvmx_npei_pkt_iptr_s cn56xxp1; | ||
2242 | }; | ||
2243 | |||
2244 | union cvmx_npei_pkt_out_bmode { | ||
2245 | uint64_t u64; | ||
2246 | struct cvmx_npei_pkt_out_bmode_s { | ||
2247 | uint64_t reserved_32_63:32; | ||
2248 | uint64_t bmode:32; | ||
2249 | } s; | ||
2250 | struct cvmx_npei_pkt_out_bmode_s cn52xx; | ||
2251 | struct cvmx_npei_pkt_out_bmode_s cn56xx; | ||
2252 | struct cvmx_npei_pkt_out_bmode_s cn56xxp1; | ||
2253 | }; | ||
2254 | |||
2255 | union cvmx_npei_pkt_out_enb { | ||
2256 | uint64_t u64; | ||
2257 | struct cvmx_npei_pkt_out_enb_s { | ||
2258 | uint64_t reserved_32_63:32; | ||
2259 | uint64_t enb:32; | ||
2260 | } s; | ||
2261 | struct cvmx_npei_pkt_out_enb_s cn52xx; | ||
2262 | struct cvmx_npei_pkt_out_enb_s cn56xx; | ||
2263 | struct cvmx_npei_pkt_out_enb_s cn56xxp1; | ||
2264 | }; | ||
2265 | |||
2266 | union cvmx_npei_pkt_output_wmark { | ||
2267 | uint64_t u64; | ||
2268 | struct cvmx_npei_pkt_output_wmark_s { | ||
2269 | uint64_t reserved_32_63:32; | ||
2270 | uint64_t wmark:32; | ||
2271 | } s; | ||
2272 | struct cvmx_npei_pkt_output_wmark_s cn52xx; | ||
2273 | struct cvmx_npei_pkt_output_wmark_s cn56xx; | ||
2274 | }; | ||
2275 | |||
2276 | union cvmx_npei_pkt_pcie_port { | ||
2277 | uint64_t u64; | ||
2278 | struct cvmx_npei_pkt_pcie_port_s { | ||
2279 | uint64_t pp:64; | ||
2280 | } s; | ||
2281 | struct cvmx_npei_pkt_pcie_port_s cn52xx; | ||
2282 | struct cvmx_npei_pkt_pcie_port_s cn56xx; | ||
2283 | struct cvmx_npei_pkt_pcie_port_s cn56xxp1; | ||
2284 | }; | ||
2285 | |||
2286 | union cvmx_npei_pkt_port_in_rst { | ||
2287 | uint64_t u64; | ||
2288 | struct cvmx_npei_pkt_port_in_rst_s { | ||
2289 | uint64_t in_rst:32; | ||
2290 | uint64_t out_rst:32; | ||
2291 | } s; | ||
2292 | struct cvmx_npei_pkt_port_in_rst_s cn52xx; | ||
2293 | struct cvmx_npei_pkt_port_in_rst_s cn56xx; | ||
2294 | }; | ||
2295 | |||
2296 | union cvmx_npei_pkt_slist_es { | ||
2297 | uint64_t u64; | ||
2298 | struct cvmx_npei_pkt_slist_es_s { | ||
2299 | uint64_t es:64; | ||
2300 | } s; | ||
2301 | struct cvmx_npei_pkt_slist_es_s cn52xx; | ||
2302 | struct cvmx_npei_pkt_slist_es_s cn56xx; | ||
2303 | struct cvmx_npei_pkt_slist_es_s cn56xxp1; | ||
2304 | }; | ||
2305 | |||
2306 | union cvmx_npei_pkt_slist_id_size { | ||
2307 | uint64_t u64; | ||
2308 | struct cvmx_npei_pkt_slist_id_size_s { | ||
2309 | uint64_t reserved_23_63:41; | ||
2310 | uint64_t isize:7; | ||
2311 | uint64_t bsize:16; | ||
2312 | } s; | ||
2313 | struct cvmx_npei_pkt_slist_id_size_s cn52xx; | ||
2314 | struct cvmx_npei_pkt_slist_id_size_s cn56xx; | ||
2315 | struct cvmx_npei_pkt_slist_id_size_s cn56xxp1; | ||
2316 | }; | ||
2317 | |||
2318 | union cvmx_npei_pkt_slist_ns { | ||
2319 | uint64_t u64; | ||
2320 | struct cvmx_npei_pkt_slist_ns_s { | ||
2321 | uint64_t reserved_32_63:32; | ||
2322 | uint64_t nsr:32; | ||
2323 | } s; | ||
2324 | struct cvmx_npei_pkt_slist_ns_s cn52xx; | ||
2325 | struct cvmx_npei_pkt_slist_ns_s cn56xx; | ||
2326 | struct cvmx_npei_pkt_slist_ns_s cn56xxp1; | ||
2327 | }; | ||
2328 | |||
2329 | union cvmx_npei_pkt_slist_ror { | ||
2330 | uint64_t u64; | ||
2331 | struct cvmx_npei_pkt_slist_ror_s { | ||
2332 | uint64_t reserved_32_63:32; | ||
2333 | uint64_t ror:32; | ||
2334 | } s; | ||
2335 | struct cvmx_npei_pkt_slist_ror_s cn52xx; | ||
2336 | struct cvmx_npei_pkt_slist_ror_s cn56xx; | ||
2337 | struct cvmx_npei_pkt_slist_ror_s cn56xxp1; | ||
2338 | }; | ||
2339 | |||
2340 | union cvmx_npei_pkt_time_int { | ||
2341 | uint64_t u64; | ||
2342 | struct cvmx_npei_pkt_time_int_s { | ||
2343 | uint64_t reserved_32_63:32; | ||
2344 | uint64_t port:32; | ||
2345 | } s; | ||
2346 | struct cvmx_npei_pkt_time_int_s cn52xx; | ||
2347 | struct cvmx_npei_pkt_time_int_s cn56xx; | ||
2348 | struct cvmx_npei_pkt_time_int_s cn56xxp1; | ||
2349 | }; | ||
2350 | |||
2351 | union cvmx_npei_pkt_time_int_enb { | ||
2352 | uint64_t u64; | ||
2353 | struct cvmx_npei_pkt_time_int_enb_s { | ||
2354 | uint64_t reserved_32_63:32; | ||
2355 | uint64_t port:32; | ||
2356 | } s; | ||
2357 | struct cvmx_npei_pkt_time_int_enb_s cn52xx; | ||
2358 | struct cvmx_npei_pkt_time_int_enb_s cn56xx; | ||
2359 | struct cvmx_npei_pkt_time_int_enb_s cn56xxp1; | ||
2360 | }; | ||
2361 | |||
2362 | union cvmx_npei_rsl_int_blocks { | ||
2363 | uint64_t u64; | ||
2364 | struct cvmx_npei_rsl_int_blocks_s { | ||
2365 | uint64_t reserved_31_63:33; | ||
2366 | uint64_t iob:1; | ||
2367 | uint64_t lmc1:1; | ||
2368 | uint64_t agl:1; | ||
2369 | uint64_t reserved_24_27:4; | ||
2370 | uint64_t asxpcs1:1; | ||
2371 | uint64_t asxpcs0:1; | ||
2372 | uint64_t reserved_21_21:1; | ||
2373 | uint64_t pip:1; | ||
2374 | uint64_t reserved_18_19:2; | ||
2375 | uint64_t lmc0:1; | ||
2376 | uint64_t l2c:1; | ||
2377 | uint64_t usb1:1; | ||
2378 | uint64_t rad:1; | ||
2379 | uint64_t usb:1; | ||
2380 | uint64_t pow:1; | ||
2381 | uint64_t tim:1; | ||
2382 | uint64_t pko:1; | ||
2383 | uint64_t ipd:1; | ||
2384 | uint64_t reserved_8_8:1; | ||
2385 | uint64_t zip:1; | ||
2386 | uint64_t reserved_6_6:1; | ||
2387 | uint64_t fpa:1; | ||
2388 | uint64_t key:1; | ||
2389 | uint64_t npei:1; | ||
2390 | uint64_t gmx1:1; | ||
2391 | uint64_t gmx0:1; | ||
2392 | uint64_t mio:1; | ||
2393 | } s; | ||
2394 | struct cvmx_npei_rsl_int_blocks_s cn52xx; | ||
2395 | struct cvmx_npei_rsl_int_blocks_s cn52xxp1; | ||
2396 | struct cvmx_npei_rsl_int_blocks_cn56xx { | ||
2397 | uint64_t reserved_31_63:33; | ||
2398 | uint64_t iob:1; | ||
2399 | uint64_t lmc1:1; | ||
2400 | uint64_t agl:1; | ||
2401 | uint64_t reserved_24_27:4; | ||
2402 | uint64_t asxpcs1:1; | ||
2403 | uint64_t asxpcs0:1; | ||
2404 | uint64_t reserved_21_21:1; | ||
2405 | uint64_t pip:1; | ||
2406 | uint64_t reserved_18_19:2; | ||
2407 | uint64_t lmc0:1; | ||
2408 | uint64_t l2c:1; | ||
2409 | uint64_t reserved_15_15:1; | ||
2410 | uint64_t rad:1; | ||
2411 | uint64_t usb:1; | ||
2412 | uint64_t pow:1; | ||
2413 | uint64_t tim:1; | ||
2414 | uint64_t pko:1; | ||
2415 | uint64_t ipd:1; | ||
2416 | uint64_t reserved_8_8:1; | ||
2417 | uint64_t zip:1; | ||
2418 | uint64_t reserved_6_6:1; | ||
2419 | uint64_t fpa:1; | ||
2420 | uint64_t key:1; | ||
2421 | uint64_t npei:1; | ||
2422 | uint64_t gmx1:1; | ||
2423 | uint64_t gmx0:1; | ||
2424 | uint64_t mio:1; | ||
2425 | } cn56xx; | ||
2426 | struct cvmx_npei_rsl_int_blocks_cn56xx cn56xxp1; | ||
2427 | }; | ||
2428 | |||
2429 | union cvmx_npei_scratch_1 { | ||
2430 | uint64_t u64; | ||
2431 | struct cvmx_npei_scratch_1_s { | ||
2432 | uint64_t data:64; | ||
2433 | } s; | ||
2434 | struct cvmx_npei_scratch_1_s cn52xx; | ||
2435 | struct cvmx_npei_scratch_1_s cn52xxp1; | ||
2436 | struct cvmx_npei_scratch_1_s cn56xx; | ||
2437 | struct cvmx_npei_scratch_1_s cn56xxp1; | ||
2438 | }; | ||
2439 | |||
2440 | union cvmx_npei_state1 { | ||
2441 | uint64_t u64; | ||
2442 | struct cvmx_npei_state1_s { | ||
2443 | uint64_t cpl1:12; | ||
2444 | uint64_t cpl0:12; | ||
2445 | uint64_t arb:1; | ||
2446 | uint64_t csr:39; | ||
2447 | } s; | ||
2448 | struct cvmx_npei_state1_s cn52xx; | ||
2449 | struct cvmx_npei_state1_s cn52xxp1; | ||
2450 | struct cvmx_npei_state1_s cn56xx; | ||
2451 | struct cvmx_npei_state1_s cn56xxp1; | ||
2452 | }; | ||
2453 | |||
2454 | union cvmx_npei_state2 { | ||
2455 | uint64_t u64; | ||
2456 | struct cvmx_npei_state2_s { | ||
2457 | uint64_t reserved_48_63:16; | ||
2458 | uint64_t npei:1; | ||
2459 | uint64_t rac:1; | ||
2460 | uint64_t csm1:15; | ||
2461 | uint64_t csm0:15; | ||
2462 | uint64_t nnp0:8; | ||
2463 | uint64_t nnd:8; | ||
2464 | } s; | ||
2465 | struct cvmx_npei_state2_s cn52xx; | ||
2466 | struct cvmx_npei_state2_s cn52xxp1; | ||
2467 | struct cvmx_npei_state2_s cn56xx; | ||
2468 | struct cvmx_npei_state2_s cn56xxp1; | ||
2469 | }; | ||
2470 | |||
2471 | union cvmx_npei_state3 { | ||
2472 | uint64_t u64; | ||
2473 | struct cvmx_npei_state3_s { | ||
2474 | uint64_t reserved_56_63:8; | ||
2475 | uint64_t psm1:15; | ||
2476 | uint64_t psm0:15; | ||
2477 | uint64_t nsm1:13; | ||
2478 | uint64_t nsm0:13; | ||
2479 | } s; | ||
2480 | struct cvmx_npei_state3_s cn52xx; | ||
2481 | struct cvmx_npei_state3_s cn52xxp1; | ||
2482 | struct cvmx_npei_state3_s cn56xx; | ||
2483 | struct cvmx_npei_state3_s cn56xxp1; | ||
2484 | }; | ||
2485 | |||
2486 | union cvmx_npei_win_rd_addr { | ||
2487 | uint64_t u64; | ||
2488 | struct cvmx_npei_win_rd_addr_s { | ||
2489 | uint64_t reserved_51_63:13; | ||
2490 | uint64_t ld_cmd:2; | ||
2491 | uint64_t iobit:1; | ||
2492 | uint64_t rd_addr:48; | ||
2493 | } s; | ||
2494 | struct cvmx_npei_win_rd_addr_s cn52xx; | ||
2495 | struct cvmx_npei_win_rd_addr_s cn52xxp1; | ||
2496 | struct cvmx_npei_win_rd_addr_s cn56xx; | ||
2497 | struct cvmx_npei_win_rd_addr_s cn56xxp1; | ||
2498 | }; | ||
2499 | |||
2500 | union cvmx_npei_win_rd_data { | ||
2501 | uint64_t u64; | ||
2502 | struct cvmx_npei_win_rd_data_s { | ||
2503 | uint64_t rd_data:64; | ||
2504 | } s; | ||
2505 | struct cvmx_npei_win_rd_data_s cn52xx; | ||
2506 | struct cvmx_npei_win_rd_data_s cn52xxp1; | ||
2507 | struct cvmx_npei_win_rd_data_s cn56xx; | ||
2508 | struct cvmx_npei_win_rd_data_s cn56xxp1; | ||
2509 | }; | ||
2510 | |||
2511 | union cvmx_npei_win_wr_addr { | ||
2512 | uint64_t u64; | ||
2513 | struct cvmx_npei_win_wr_addr_s { | ||
2514 | uint64_t reserved_49_63:15; | ||
2515 | uint64_t iobit:1; | ||
2516 | uint64_t wr_addr:46; | ||
2517 | uint64_t reserved_0_1:2; | ||
2518 | } s; | ||
2519 | struct cvmx_npei_win_wr_addr_s cn52xx; | ||
2520 | struct cvmx_npei_win_wr_addr_s cn52xxp1; | ||
2521 | struct cvmx_npei_win_wr_addr_s cn56xx; | ||
2522 | struct cvmx_npei_win_wr_addr_s cn56xxp1; | ||
2523 | }; | ||
2524 | |||
2525 | union cvmx_npei_win_wr_data { | ||
2526 | uint64_t u64; | ||
2527 | struct cvmx_npei_win_wr_data_s { | ||
2528 | uint64_t wr_data:64; | ||
2529 | } s; | ||
2530 | struct cvmx_npei_win_wr_data_s cn52xx; | ||
2531 | struct cvmx_npei_win_wr_data_s cn52xxp1; | ||
2532 | struct cvmx_npei_win_wr_data_s cn56xx; | ||
2533 | struct cvmx_npei_win_wr_data_s cn56xxp1; | ||
2534 | }; | ||
2535 | |||
2536 | union cvmx_npei_win_wr_mask { | ||
2537 | uint64_t u64; | ||
2538 | struct cvmx_npei_win_wr_mask_s { | ||
2539 | uint64_t reserved_8_63:56; | ||
2540 | uint64_t wr_mask:8; | ||
2541 | } s; | ||
2542 | struct cvmx_npei_win_wr_mask_s cn52xx; | ||
2543 | struct cvmx_npei_win_wr_mask_s cn52xxp1; | ||
2544 | struct cvmx_npei_win_wr_mask_s cn56xx; | ||
2545 | struct cvmx_npei_win_wr_mask_s cn56xxp1; | ||
2546 | }; | ||
2547 | |||
2548 | union cvmx_npei_window_ctl { | ||
2549 | uint64_t u64; | ||
2550 | struct cvmx_npei_window_ctl_s { | ||
2551 | uint64_t reserved_32_63:32; | ||
2552 | uint64_t time:32; | ||
2553 | } s; | ||
2554 | struct cvmx_npei_window_ctl_s cn52xx; | ||
2555 | struct cvmx_npei_window_ctl_s cn52xxp1; | ||
2556 | struct cvmx_npei_window_ctl_s cn56xx; | ||
2557 | struct cvmx_npei_window_ctl_s cn56xxp1; | ||
2558 | }; | ||
2559 | |||
2560 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-npi-defs.h b/arch/mips/include/asm/octeon/cvmx-npi-defs.h new file mode 100644 index 000000000000..4e03cd8561e3 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-npi-defs.h | |||
@@ -0,0 +1,1735 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_NPI_DEFS_H__ | ||
29 | #define __CVMX_NPI_DEFS_H__ | ||
30 | |||
31 | #define CVMX_NPI_BASE_ADDR_INPUT0 \ | ||
32 | CVMX_ADD_IO_SEG(0x00011F0000000070ull) | ||
33 | #define CVMX_NPI_BASE_ADDR_INPUT1 \ | ||
34 | CVMX_ADD_IO_SEG(0x00011F0000000080ull) | ||
35 | #define CVMX_NPI_BASE_ADDR_INPUT2 \ | ||
36 | CVMX_ADD_IO_SEG(0x00011F0000000090ull) | ||
37 | #define CVMX_NPI_BASE_ADDR_INPUT3 \ | ||
38 | CVMX_ADD_IO_SEG(0x00011F00000000A0ull) | ||
39 | #define CVMX_NPI_BASE_ADDR_INPUTX(offset) \ | ||
40 | CVMX_ADD_IO_SEG(0x00011F0000000070ull + (((offset) & 3) * 16)) | ||
41 | #define CVMX_NPI_BASE_ADDR_OUTPUT0 \ | ||
42 | CVMX_ADD_IO_SEG(0x00011F00000000B8ull) | ||
43 | #define CVMX_NPI_BASE_ADDR_OUTPUT1 \ | ||
44 | CVMX_ADD_IO_SEG(0x00011F00000000C0ull) | ||
45 | #define CVMX_NPI_BASE_ADDR_OUTPUT2 \ | ||
46 | CVMX_ADD_IO_SEG(0x00011F00000000C8ull) | ||
47 | #define CVMX_NPI_BASE_ADDR_OUTPUT3 \ | ||
48 | CVMX_ADD_IO_SEG(0x00011F00000000D0ull) | ||
49 | #define CVMX_NPI_BASE_ADDR_OUTPUTX(offset) \ | ||
50 | CVMX_ADD_IO_SEG(0x00011F00000000B8ull + (((offset) & 3) * 8)) | ||
51 | #define CVMX_NPI_BIST_STATUS \ | ||
52 | CVMX_ADD_IO_SEG(0x00011F00000003F8ull) | ||
53 | #define CVMX_NPI_BUFF_SIZE_OUTPUT0 \ | ||
54 | CVMX_ADD_IO_SEG(0x00011F00000000E0ull) | ||
55 | #define CVMX_NPI_BUFF_SIZE_OUTPUT1 \ | ||
56 | CVMX_ADD_IO_SEG(0x00011F00000000E8ull) | ||
57 | #define CVMX_NPI_BUFF_SIZE_OUTPUT2 \ | ||
58 | CVMX_ADD_IO_SEG(0x00011F00000000F0ull) | ||
59 | #define CVMX_NPI_BUFF_SIZE_OUTPUT3 \ | ||
60 | CVMX_ADD_IO_SEG(0x00011F00000000F8ull) | ||
61 | #define CVMX_NPI_BUFF_SIZE_OUTPUTX(offset) \ | ||
62 | CVMX_ADD_IO_SEG(0x00011F00000000E0ull + (((offset) & 3) * 8)) | ||
63 | #define CVMX_NPI_COMP_CTL \ | ||
64 | CVMX_ADD_IO_SEG(0x00011F0000000218ull) | ||
65 | #define CVMX_NPI_CTL_STATUS \ | ||
66 | CVMX_ADD_IO_SEG(0x00011F0000000010ull) | ||
67 | #define CVMX_NPI_DBG_SELECT \ | ||
68 | CVMX_ADD_IO_SEG(0x00011F0000000008ull) | ||
69 | #define CVMX_NPI_DMA_CONTROL \ | ||
70 | CVMX_ADD_IO_SEG(0x00011F0000000128ull) | ||
71 | #define CVMX_NPI_DMA_HIGHP_COUNTS \ | ||
72 | CVMX_ADD_IO_SEG(0x00011F0000000148ull) | ||
73 | #define CVMX_NPI_DMA_HIGHP_NADDR \ | ||
74 | CVMX_ADD_IO_SEG(0x00011F0000000158ull) | ||
75 | #define CVMX_NPI_DMA_LOWP_COUNTS \ | ||
76 | CVMX_ADD_IO_SEG(0x00011F0000000140ull) | ||
77 | #define CVMX_NPI_DMA_LOWP_NADDR \ | ||
78 | CVMX_ADD_IO_SEG(0x00011F0000000150ull) | ||
79 | #define CVMX_NPI_HIGHP_DBELL \ | ||
80 | CVMX_ADD_IO_SEG(0x00011F0000000120ull) | ||
81 | #define CVMX_NPI_HIGHP_IBUFF_SADDR \ | ||
82 | CVMX_ADD_IO_SEG(0x00011F0000000110ull) | ||
83 | #define CVMX_NPI_INPUT_CONTROL \ | ||
84 | CVMX_ADD_IO_SEG(0x00011F0000000138ull) | ||
85 | #define CVMX_NPI_INT_ENB \ | ||
86 | CVMX_ADD_IO_SEG(0x00011F0000000020ull) | ||
87 | #define CVMX_NPI_INT_SUM \ | ||
88 | CVMX_ADD_IO_SEG(0x00011F0000000018ull) | ||
89 | #define CVMX_NPI_LOWP_DBELL \ | ||
90 | CVMX_ADD_IO_SEG(0x00011F0000000118ull) | ||
91 | #define CVMX_NPI_LOWP_IBUFF_SADDR \ | ||
92 | CVMX_ADD_IO_SEG(0x00011F0000000108ull) | ||
93 | #define CVMX_NPI_MEM_ACCESS_SUBID3 \ | ||
94 | CVMX_ADD_IO_SEG(0x00011F0000000028ull) | ||
95 | #define CVMX_NPI_MEM_ACCESS_SUBID4 \ | ||
96 | CVMX_ADD_IO_SEG(0x00011F0000000030ull) | ||
97 | #define CVMX_NPI_MEM_ACCESS_SUBID5 \ | ||
98 | CVMX_ADD_IO_SEG(0x00011F0000000038ull) | ||
99 | #define CVMX_NPI_MEM_ACCESS_SUBID6 \ | ||
100 | CVMX_ADD_IO_SEG(0x00011F0000000040ull) | ||
101 | #define CVMX_NPI_MEM_ACCESS_SUBIDX(offset) \ | ||
102 | CVMX_ADD_IO_SEG(0x00011F0000000028ull + (((offset) & 7) * 8) - 8 * 3) | ||
103 | #define CVMX_NPI_MSI_RCV \ | ||
104 | (0x0000000000000190ull) | ||
105 | #define CVMX_NPI_NPI_MSI_RCV \ | ||
106 | CVMX_ADD_IO_SEG(0x00011F0000001190ull) | ||
107 | #define CVMX_NPI_NUM_DESC_OUTPUT0 \ | ||
108 | CVMX_ADD_IO_SEG(0x00011F0000000050ull) | ||
109 | #define CVMX_NPI_NUM_DESC_OUTPUT1 \ | ||
110 | CVMX_ADD_IO_SEG(0x00011F0000000058ull) | ||
111 | #define CVMX_NPI_NUM_DESC_OUTPUT2 \ | ||
112 | CVMX_ADD_IO_SEG(0x00011F0000000060ull) | ||
113 | #define CVMX_NPI_NUM_DESC_OUTPUT3 \ | ||
114 | CVMX_ADD_IO_SEG(0x00011F0000000068ull) | ||
115 | #define CVMX_NPI_NUM_DESC_OUTPUTX(offset) \ | ||
116 | CVMX_ADD_IO_SEG(0x00011F0000000050ull + (((offset) & 3) * 8)) | ||
117 | #define CVMX_NPI_OUTPUT_CONTROL \ | ||
118 | CVMX_ADD_IO_SEG(0x00011F0000000100ull) | ||
119 | #define CVMX_NPI_P0_DBPAIR_ADDR \ | ||
120 | CVMX_ADD_IO_SEG(0x00011F0000000180ull) | ||
121 | #define CVMX_NPI_P0_INSTR_ADDR \ | ||
122 | CVMX_ADD_IO_SEG(0x00011F00000001C0ull) | ||
123 | #define CVMX_NPI_P0_INSTR_CNTS \ | ||
124 | CVMX_ADD_IO_SEG(0x00011F00000001A0ull) | ||
125 | #define CVMX_NPI_P0_PAIR_CNTS \ | ||
126 | CVMX_ADD_IO_SEG(0x00011F0000000160ull) | ||
127 | #define CVMX_NPI_P1_DBPAIR_ADDR \ | ||
128 | CVMX_ADD_IO_SEG(0x00011F0000000188ull) | ||
129 | #define CVMX_NPI_P1_INSTR_ADDR \ | ||
130 | CVMX_ADD_IO_SEG(0x00011F00000001C8ull) | ||
131 | #define CVMX_NPI_P1_INSTR_CNTS \ | ||
132 | CVMX_ADD_IO_SEG(0x00011F00000001A8ull) | ||
133 | #define CVMX_NPI_P1_PAIR_CNTS \ | ||
134 | CVMX_ADD_IO_SEG(0x00011F0000000168ull) | ||
135 | #define CVMX_NPI_P2_DBPAIR_ADDR \ | ||
136 | CVMX_ADD_IO_SEG(0x00011F0000000190ull) | ||
137 | #define CVMX_NPI_P2_INSTR_ADDR \ | ||
138 | CVMX_ADD_IO_SEG(0x00011F00000001D0ull) | ||
139 | #define CVMX_NPI_P2_INSTR_CNTS \ | ||
140 | CVMX_ADD_IO_SEG(0x00011F00000001B0ull) | ||
141 | #define CVMX_NPI_P2_PAIR_CNTS \ | ||
142 | CVMX_ADD_IO_SEG(0x00011F0000000170ull) | ||
143 | #define CVMX_NPI_P3_DBPAIR_ADDR \ | ||
144 | CVMX_ADD_IO_SEG(0x00011F0000000198ull) | ||
145 | #define CVMX_NPI_P3_INSTR_ADDR \ | ||
146 | CVMX_ADD_IO_SEG(0x00011F00000001D8ull) | ||
147 | #define CVMX_NPI_P3_INSTR_CNTS \ | ||
148 | CVMX_ADD_IO_SEG(0x00011F00000001B8ull) | ||
149 | #define CVMX_NPI_P3_PAIR_CNTS \ | ||
150 | CVMX_ADD_IO_SEG(0x00011F0000000178ull) | ||
151 | #define CVMX_NPI_PCI_BAR1_INDEXX(offset) \ | ||
152 | CVMX_ADD_IO_SEG(0x00011F0000001100ull + (((offset) & 31) * 4)) | ||
153 | #define CVMX_NPI_PCI_BIST_REG \ | ||
154 | CVMX_ADD_IO_SEG(0x00011F00000011C0ull) | ||
155 | #define CVMX_NPI_PCI_BURST_SIZE \ | ||
156 | CVMX_ADD_IO_SEG(0x00011F00000000D8ull) | ||
157 | #define CVMX_NPI_PCI_CFG00 \ | ||
158 | CVMX_ADD_IO_SEG(0x00011F0000001800ull) | ||
159 | #define CVMX_NPI_PCI_CFG01 \ | ||
160 | CVMX_ADD_IO_SEG(0x00011F0000001804ull) | ||
161 | #define CVMX_NPI_PCI_CFG02 \ | ||
162 | CVMX_ADD_IO_SEG(0x00011F0000001808ull) | ||
163 | #define CVMX_NPI_PCI_CFG03 \ | ||
164 | CVMX_ADD_IO_SEG(0x00011F000000180Cull) | ||
165 | #define CVMX_NPI_PCI_CFG04 \ | ||
166 | CVMX_ADD_IO_SEG(0x00011F0000001810ull) | ||
167 | #define CVMX_NPI_PCI_CFG05 \ | ||
168 | CVMX_ADD_IO_SEG(0x00011F0000001814ull) | ||
169 | #define CVMX_NPI_PCI_CFG06 \ | ||
170 | CVMX_ADD_IO_SEG(0x00011F0000001818ull) | ||
171 | #define CVMX_NPI_PCI_CFG07 \ | ||
172 | CVMX_ADD_IO_SEG(0x00011F000000181Cull) | ||
173 | #define CVMX_NPI_PCI_CFG08 \ | ||
174 | CVMX_ADD_IO_SEG(0x00011F0000001820ull) | ||
175 | #define CVMX_NPI_PCI_CFG09 \ | ||
176 | CVMX_ADD_IO_SEG(0x00011F0000001824ull) | ||
177 | #define CVMX_NPI_PCI_CFG10 \ | ||
178 | CVMX_ADD_IO_SEG(0x00011F0000001828ull) | ||
179 | #define CVMX_NPI_PCI_CFG11 \ | ||
180 | CVMX_ADD_IO_SEG(0x00011F000000182Cull) | ||
181 | #define CVMX_NPI_PCI_CFG12 \ | ||
182 | CVMX_ADD_IO_SEG(0x00011F0000001830ull) | ||
183 | #define CVMX_NPI_PCI_CFG13 \ | ||
184 | CVMX_ADD_IO_SEG(0x00011F0000001834ull) | ||
185 | #define CVMX_NPI_PCI_CFG15 \ | ||
186 | CVMX_ADD_IO_SEG(0x00011F000000183Cull) | ||
187 | #define CVMX_NPI_PCI_CFG16 \ | ||
188 | CVMX_ADD_IO_SEG(0x00011F0000001840ull) | ||
189 | #define CVMX_NPI_PCI_CFG17 \ | ||
190 | CVMX_ADD_IO_SEG(0x00011F0000001844ull) | ||
191 | #define CVMX_NPI_PCI_CFG18 \ | ||
192 | CVMX_ADD_IO_SEG(0x00011F0000001848ull) | ||
193 | #define CVMX_NPI_PCI_CFG19 \ | ||
194 | CVMX_ADD_IO_SEG(0x00011F000000184Cull) | ||
195 | #define CVMX_NPI_PCI_CFG20 \ | ||
196 | CVMX_ADD_IO_SEG(0x00011F0000001850ull) | ||
197 | #define CVMX_NPI_PCI_CFG21 \ | ||
198 | CVMX_ADD_IO_SEG(0x00011F0000001854ull) | ||
199 | #define CVMX_NPI_PCI_CFG22 \ | ||
200 | CVMX_ADD_IO_SEG(0x00011F0000001858ull) | ||
201 | #define CVMX_NPI_PCI_CFG56 \ | ||
202 | CVMX_ADD_IO_SEG(0x00011F00000018E0ull) | ||
203 | #define CVMX_NPI_PCI_CFG57 \ | ||
204 | CVMX_ADD_IO_SEG(0x00011F00000018E4ull) | ||
205 | #define CVMX_NPI_PCI_CFG58 \ | ||
206 | CVMX_ADD_IO_SEG(0x00011F00000018E8ull) | ||
207 | #define CVMX_NPI_PCI_CFG59 \ | ||
208 | CVMX_ADD_IO_SEG(0x00011F00000018ECull) | ||
209 | #define CVMX_NPI_PCI_CFG60 \ | ||
210 | CVMX_ADD_IO_SEG(0x00011F00000018F0ull) | ||
211 | #define CVMX_NPI_PCI_CFG61 \ | ||
212 | CVMX_ADD_IO_SEG(0x00011F00000018F4ull) | ||
213 | #define CVMX_NPI_PCI_CFG62 \ | ||
214 | CVMX_ADD_IO_SEG(0x00011F00000018F8ull) | ||
215 | #define CVMX_NPI_PCI_CFG63 \ | ||
216 | CVMX_ADD_IO_SEG(0x00011F00000018FCull) | ||
217 | #define CVMX_NPI_PCI_CNT_REG \ | ||
218 | CVMX_ADD_IO_SEG(0x00011F00000011B8ull) | ||
219 | #define CVMX_NPI_PCI_CTL_STATUS_2 \ | ||
220 | CVMX_ADD_IO_SEG(0x00011F000000118Cull) | ||
221 | #define CVMX_NPI_PCI_INT_ARB_CFG \ | ||
222 | CVMX_ADD_IO_SEG(0x00011F0000000130ull) | ||
223 | #define CVMX_NPI_PCI_INT_ENB2 \ | ||
224 | CVMX_ADD_IO_SEG(0x00011F00000011A0ull) | ||
225 | #define CVMX_NPI_PCI_INT_SUM2 \ | ||
226 | CVMX_ADD_IO_SEG(0x00011F0000001198ull) | ||
227 | #define CVMX_NPI_PCI_READ_CMD \ | ||
228 | CVMX_ADD_IO_SEG(0x00011F0000000048ull) | ||
229 | #define CVMX_NPI_PCI_READ_CMD_6 \ | ||
230 | CVMX_ADD_IO_SEG(0x00011F0000001180ull) | ||
231 | #define CVMX_NPI_PCI_READ_CMD_C \ | ||
232 | CVMX_ADD_IO_SEG(0x00011F0000001184ull) | ||
233 | #define CVMX_NPI_PCI_READ_CMD_E \ | ||
234 | CVMX_ADD_IO_SEG(0x00011F0000001188ull) | ||
235 | #define CVMX_NPI_PCI_SCM_REG \ | ||
236 | CVMX_ADD_IO_SEG(0x00011F00000011A8ull) | ||
237 | #define CVMX_NPI_PCI_TSR_REG \ | ||
238 | CVMX_ADD_IO_SEG(0x00011F00000011B0ull) | ||
239 | #define CVMX_NPI_PORT32_INSTR_HDR \ | ||
240 | CVMX_ADD_IO_SEG(0x00011F00000001F8ull) | ||
241 | #define CVMX_NPI_PORT33_INSTR_HDR \ | ||
242 | CVMX_ADD_IO_SEG(0x00011F0000000200ull) | ||
243 | #define CVMX_NPI_PORT34_INSTR_HDR \ | ||
244 | CVMX_ADD_IO_SEG(0x00011F0000000208ull) | ||
245 | #define CVMX_NPI_PORT35_INSTR_HDR \ | ||
246 | CVMX_ADD_IO_SEG(0x00011F0000000210ull) | ||
247 | #define CVMX_NPI_PORT_BP_CONTROL \ | ||
248 | CVMX_ADD_IO_SEG(0x00011F00000001F0ull) | ||
249 | #define CVMX_NPI_PX_DBPAIR_ADDR(offset) \ | ||
250 | CVMX_ADD_IO_SEG(0x00011F0000000180ull + (((offset) & 3) * 8)) | ||
251 | #define CVMX_NPI_PX_INSTR_ADDR(offset) \ | ||
252 | CVMX_ADD_IO_SEG(0x00011F00000001C0ull + (((offset) & 3) * 8)) | ||
253 | #define CVMX_NPI_PX_INSTR_CNTS(offset) \ | ||
254 | CVMX_ADD_IO_SEG(0x00011F00000001A0ull + (((offset) & 3) * 8)) | ||
255 | #define CVMX_NPI_PX_PAIR_CNTS(offset) \ | ||
256 | CVMX_ADD_IO_SEG(0x00011F0000000160ull + (((offset) & 3) * 8)) | ||
257 | #define CVMX_NPI_RSL_INT_BLOCKS \ | ||
258 | CVMX_ADD_IO_SEG(0x00011F0000000000ull) | ||
259 | #define CVMX_NPI_SIZE_INPUT0 \ | ||
260 | CVMX_ADD_IO_SEG(0x00011F0000000078ull) | ||
261 | #define CVMX_NPI_SIZE_INPUT1 \ | ||
262 | CVMX_ADD_IO_SEG(0x00011F0000000088ull) | ||
263 | #define CVMX_NPI_SIZE_INPUT2 \ | ||
264 | CVMX_ADD_IO_SEG(0x00011F0000000098ull) | ||
265 | #define CVMX_NPI_SIZE_INPUT3 \ | ||
266 | CVMX_ADD_IO_SEG(0x00011F00000000A8ull) | ||
267 | #define CVMX_NPI_SIZE_INPUTX(offset) \ | ||
268 | CVMX_ADD_IO_SEG(0x00011F0000000078ull + (((offset) & 3) * 16)) | ||
269 | #define CVMX_NPI_WIN_READ_TO \ | ||
270 | CVMX_ADD_IO_SEG(0x00011F00000001E0ull) | ||
271 | |||
272 | union cvmx_npi_base_addr_inputx { | ||
273 | uint64_t u64; | ||
274 | struct cvmx_npi_base_addr_inputx_s { | ||
275 | uint64_t baddr:61; | ||
276 | uint64_t reserved_0_2:3; | ||
277 | } s; | ||
278 | struct cvmx_npi_base_addr_inputx_s cn30xx; | ||
279 | struct cvmx_npi_base_addr_inputx_s cn31xx; | ||
280 | struct cvmx_npi_base_addr_inputx_s cn38xx; | ||
281 | struct cvmx_npi_base_addr_inputx_s cn38xxp2; | ||
282 | struct cvmx_npi_base_addr_inputx_s cn50xx; | ||
283 | struct cvmx_npi_base_addr_inputx_s cn58xx; | ||
284 | struct cvmx_npi_base_addr_inputx_s cn58xxp1; | ||
285 | }; | ||
286 | |||
287 | union cvmx_npi_base_addr_outputx { | ||
288 | uint64_t u64; | ||
289 | struct cvmx_npi_base_addr_outputx_s { | ||
290 | uint64_t baddr:61; | ||
291 | uint64_t reserved_0_2:3; | ||
292 | } s; | ||
293 | struct cvmx_npi_base_addr_outputx_s cn30xx; | ||
294 | struct cvmx_npi_base_addr_outputx_s cn31xx; | ||
295 | struct cvmx_npi_base_addr_outputx_s cn38xx; | ||
296 | struct cvmx_npi_base_addr_outputx_s cn38xxp2; | ||
297 | struct cvmx_npi_base_addr_outputx_s cn50xx; | ||
298 | struct cvmx_npi_base_addr_outputx_s cn58xx; | ||
299 | struct cvmx_npi_base_addr_outputx_s cn58xxp1; | ||
300 | }; | ||
301 | |||
302 | union cvmx_npi_bist_status { | ||
303 | uint64_t u64; | ||
304 | struct cvmx_npi_bist_status_s { | ||
305 | uint64_t reserved_20_63:44; | ||
306 | uint64_t csr_bs:1; | ||
307 | uint64_t dif_bs:1; | ||
308 | uint64_t rdp_bs:1; | ||
309 | uint64_t pcnc_bs:1; | ||
310 | uint64_t pcn_bs:1; | ||
311 | uint64_t rdn_bs:1; | ||
312 | uint64_t pcac_bs:1; | ||
313 | uint64_t pcad_bs:1; | ||
314 | uint64_t rdnl_bs:1; | ||
315 | uint64_t pgf_bs:1; | ||
316 | uint64_t pig_bs:1; | ||
317 | uint64_t pof0_bs:1; | ||
318 | uint64_t pof1_bs:1; | ||
319 | uint64_t pof2_bs:1; | ||
320 | uint64_t pof3_bs:1; | ||
321 | uint64_t pos_bs:1; | ||
322 | uint64_t nus_bs:1; | ||
323 | uint64_t dob_bs:1; | ||
324 | uint64_t pdf_bs:1; | ||
325 | uint64_t dpi_bs:1; | ||
326 | } s; | ||
327 | struct cvmx_npi_bist_status_cn30xx { | ||
328 | uint64_t reserved_20_63:44; | ||
329 | uint64_t csr_bs:1; | ||
330 | uint64_t dif_bs:1; | ||
331 | uint64_t rdp_bs:1; | ||
332 | uint64_t pcnc_bs:1; | ||
333 | uint64_t pcn_bs:1; | ||
334 | uint64_t rdn_bs:1; | ||
335 | uint64_t pcac_bs:1; | ||
336 | uint64_t pcad_bs:1; | ||
337 | uint64_t rdnl_bs:1; | ||
338 | uint64_t pgf_bs:1; | ||
339 | uint64_t pig_bs:1; | ||
340 | uint64_t pof0_bs:1; | ||
341 | uint64_t reserved_5_7:3; | ||
342 | uint64_t pos_bs:1; | ||
343 | uint64_t nus_bs:1; | ||
344 | uint64_t dob_bs:1; | ||
345 | uint64_t pdf_bs:1; | ||
346 | uint64_t dpi_bs:1; | ||
347 | } cn30xx; | ||
348 | struct cvmx_npi_bist_status_s cn31xx; | ||
349 | struct cvmx_npi_bist_status_s cn38xx; | ||
350 | struct cvmx_npi_bist_status_s cn38xxp2; | ||
351 | struct cvmx_npi_bist_status_cn50xx { | ||
352 | uint64_t reserved_20_63:44; | ||
353 | uint64_t csr_bs:1; | ||
354 | uint64_t dif_bs:1; | ||
355 | uint64_t rdp_bs:1; | ||
356 | uint64_t pcnc_bs:1; | ||
357 | uint64_t pcn_bs:1; | ||
358 | uint64_t rdn_bs:1; | ||
359 | uint64_t pcac_bs:1; | ||
360 | uint64_t pcad_bs:1; | ||
361 | uint64_t rdnl_bs:1; | ||
362 | uint64_t pgf_bs:1; | ||
363 | uint64_t pig_bs:1; | ||
364 | uint64_t pof0_bs:1; | ||
365 | uint64_t pof1_bs:1; | ||
366 | uint64_t reserved_5_6:2; | ||
367 | uint64_t pos_bs:1; | ||
368 | uint64_t nus_bs:1; | ||
369 | uint64_t dob_bs:1; | ||
370 | uint64_t pdf_bs:1; | ||
371 | uint64_t dpi_bs:1; | ||
372 | } cn50xx; | ||
373 | struct cvmx_npi_bist_status_s cn58xx; | ||
374 | struct cvmx_npi_bist_status_s cn58xxp1; | ||
375 | }; | ||
376 | |||
377 | union cvmx_npi_buff_size_outputx { | ||
378 | uint64_t u64; | ||
379 | struct cvmx_npi_buff_size_outputx_s { | ||
380 | uint64_t reserved_23_63:41; | ||
381 | uint64_t isize:7; | ||
382 | uint64_t bsize:16; | ||
383 | } s; | ||
384 | struct cvmx_npi_buff_size_outputx_s cn30xx; | ||
385 | struct cvmx_npi_buff_size_outputx_s cn31xx; | ||
386 | struct cvmx_npi_buff_size_outputx_s cn38xx; | ||
387 | struct cvmx_npi_buff_size_outputx_s cn38xxp2; | ||
388 | struct cvmx_npi_buff_size_outputx_s cn50xx; | ||
389 | struct cvmx_npi_buff_size_outputx_s cn58xx; | ||
390 | struct cvmx_npi_buff_size_outputx_s cn58xxp1; | ||
391 | }; | ||
392 | |||
393 | union cvmx_npi_comp_ctl { | ||
394 | uint64_t u64; | ||
395 | struct cvmx_npi_comp_ctl_s { | ||
396 | uint64_t reserved_10_63:54; | ||
397 | uint64_t pctl:5; | ||
398 | uint64_t nctl:5; | ||
399 | } s; | ||
400 | struct cvmx_npi_comp_ctl_s cn50xx; | ||
401 | struct cvmx_npi_comp_ctl_s cn58xx; | ||
402 | struct cvmx_npi_comp_ctl_s cn58xxp1; | ||
403 | }; | ||
404 | |||
405 | union cvmx_npi_ctl_status { | ||
406 | uint64_t u64; | ||
407 | struct cvmx_npi_ctl_status_s { | ||
408 | uint64_t reserved_63_63:1; | ||
409 | uint64_t chip_rev:8; | ||
410 | uint64_t dis_pniw:1; | ||
411 | uint64_t out3_enb:1; | ||
412 | uint64_t out2_enb:1; | ||
413 | uint64_t out1_enb:1; | ||
414 | uint64_t out0_enb:1; | ||
415 | uint64_t ins3_enb:1; | ||
416 | uint64_t ins2_enb:1; | ||
417 | uint64_t ins1_enb:1; | ||
418 | uint64_t ins0_enb:1; | ||
419 | uint64_t ins3_64b:1; | ||
420 | uint64_t ins2_64b:1; | ||
421 | uint64_t ins1_64b:1; | ||
422 | uint64_t ins0_64b:1; | ||
423 | uint64_t pci_wdis:1; | ||
424 | uint64_t wait_com:1; | ||
425 | uint64_t reserved_37_39:3; | ||
426 | uint64_t max_word:5; | ||
427 | uint64_t reserved_10_31:22; | ||
428 | uint64_t timer:10; | ||
429 | } s; | ||
430 | struct cvmx_npi_ctl_status_cn30xx { | ||
431 | uint64_t reserved_63_63:1; | ||
432 | uint64_t chip_rev:8; | ||
433 | uint64_t dis_pniw:1; | ||
434 | uint64_t reserved_51_53:3; | ||
435 | uint64_t out0_enb:1; | ||
436 | uint64_t reserved_47_49:3; | ||
437 | uint64_t ins0_enb:1; | ||
438 | uint64_t reserved_43_45:3; | ||
439 | uint64_t ins0_64b:1; | ||
440 | uint64_t pci_wdis:1; | ||
441 | uint64_t wait_com:1; | ||
442 | uint64_t reserved_37_39:3; | ||
443 | uint64_t max_word:5; | ||
444 | uint64_t reserved_10_31:22; | ||
445 | uint64_t timer:10; | ||
446 | } cn30xx; | ||
447 | struct cvmx_npi_ctl_status_cn31xx { | ||
448 | uint64_t reserved_63_63:1; | ||
449 | uint64_t chip_rev:8; | ||
450 | uint64_t dis_pniw:1; | ||
451 | uint64_t reserved_52_53:2; | ||
452 | uint64_t out1_enb:1; | ||
453 | uint64_t out0_enb:1; | ||
454 | uint64_t reserved_48_49:2; | ||
455 | uint64_t ins1_enb:1; | ||
456 | uint64_t ins0_enb:1; | ||
457 | uint64_t reserved_44_45:2; | ||
458 | uint64_t ins1_64b:1; | ||
459 | uint64_t ins0_64b:1; | ||
460 | uint64_t pci_wdis:1; | ||
461 | uint64_t wait_com:1; | ||
462 | uint64_t reserved_37_39:3; | ||
463 | uint64_t max_word:5; | ||
464 | uint64_t reserved_10_31:22; | ||
465 | uint64_t timer:10; | ||
466 | } cn31xx; | ||
467 | struct cvmx_npi_ctl_status_s cn38xx; | ||
468 | struct cvmx_npi_ctl_status_s cn38xxp2; | ||
469 | struct cvmx_npi_ctl_status_cn31xx cn50xx; | ||
470 | struct cvmx_npi_ctl_status_s cn58xx; | ||
471 | struct cvmx_npi_ctl_status_s cn58xxp1; | ||
472 | }; | ||
473 | |||
474 | union cvmx_npi_dbg_select { | ||
475 | uint64_t u64; | ||
476 | struct cvmx_npi_dbg_select_s { | ||
477 | uint64_t reserved_16_63:48; | ||
478 | uint64_t dbg_sel:16; | ||
479 | } s; | ||
480 | struct cvmx_npi_dbg_select_s cn30xx; | ||
481 | struct cvmx_npi_dbg_select_s cn31xx; | ||
482 | struct cvmx_npi_dbg_select_s cn38xx; | ||
483 | struct cvmx_npi_dbg_select_s cn38xxp2; | ||
484 | struct cvmx_npi_dbg_select_s cn50xx; | ||
485 | struct cvmx_npi_dbg_select_s cn58xx; | ||
486 | struct cvmx_npi_dbg_select_s cn58xxp1; | ||
487 | }; | ||
488 | |||
489 | union cvmx_npi_dma_control { | ||
490 | uint64_t u64; | ||
491 | struct cvmx_npi_dma_control_s { | ||
492 | uint64_t reserved_36_63:28; | ||
493 | uint64_t b0_lend:1; | ||
494 | uint64_t dwb_denb:1; | ||
495 | uint64_t dwb_ichk:9; | ||
496 | uint64_t fpa_que:3; | ||
497 | uint64_t o_add1:1; | ||
498 | uint64_t o_ro:1; | ||
499 | uint64_t o_ns:1; | ||
500 | uint64_t o_es:2; | ||
501 | uint64_t o_mode:1; | ||
502 | uint64_t hp_enb:1; | ||
503 | uint64_t lp_enb:1; | ||
504 | uint64_t csize:14; | ||
505 | } s; | ||
506 | struct cvmx_npi_dma_control_s cn30xx; | ||
507 | struct cvmx_npi_dma_control_s cn31xx; | ||
508 | struct cvmx_npi_dma_control_s cn38xx; | ||
509 | struct cvmx_npi_dma_control_s cn38xxp2; | ||
510 | struct cvmx_npi_dma_control_s cn50xx; | ||
511 | struct cvmx_npi_dma_control_s cn58xx; | ||
512 | struct cvmx_npi_dma_control_s cn58xxp1; | ||
513 | }; | ||
514 | |||
515 | union cvmx_npi_dma_highp_counts { | ||
516 | uint64_t u64; | ||
517 | struct cvmx_npi_dma_highp_counts_s { | ||
518 | uint64_t reserved_39_63:25; | ||
519 | uint64_t fcnt:7; | ||
520 | uint64_t dbell:32; | ||
521 | } s; | ||
522 | struct cvmx_npi_dma_highp_counts_s cn30xx; | ||
523 | struct cvmx_npi_dma_highp_counts_s cn31xx; | ||
524 | struct cvmx_npi_dma_highp_counts_s cn38xx; | ||
525 | struct cvmx_npi_dma_highp_counts_s cn38xxp2; | ||
526 | struct cvmx_npi_dma_highp_counts_s cn50xx; | ||
527 | struct cvmx_npi_dma_highp_counts_s cn58xx; | ||
528 | struct cvmx_npi_dma_highp_counts_s cn58xxp1; | ||
529 | }; | ||
530 | |||
531 | union cvmx_npi_dma_highp_naddr { | ||
532 | uint64_t u64; | ||
533 | struct cvmx_npi_dma_highp_naddr_s { | ||
534 | uint64_t reserved_40_63:24; | ||
535 | uint64_t state:4; | ||
536 | uint64_t addr:36; | ||
537 | } s; | ||
538 | struct cvmx_npi_dma_highp_naddr_s cn30xx; | ||
539 | struct cvmx_npi_dma_highp_naddr_s cn31xx; | ||
540 | struct cvmx_npi_dma_highp_naddr_s cn38xx; | ||
541 | struct cvmx_npi_dma_highp_naddr_s cn38xxp2; | ||
542 | struct cvmx_npi_dma_highp_naddr_s cn50xx; | ||
543 | struct cvmx_npi_dma_highp_naddr_s cn58xx; | ||
544 | struct cvmx_npi_dma_highp_naddr_s cn58xxp1; | ||
545 | }; | ||
546 | |||
547 | union cvmx_npi_dma_lowp_counts { | ||
548 | uint64_t u64; | ||
549 | struct cvmx_npi_dma_lowp_counts_s { | ||
550 | uint64_t reserved_39_63:25; | ||
551 | uint64_t fcnt:7; | ||
552 | uint64_t dbell:32; | ||
553 | } s; | ||
554 | struct cvmx_npi_dma_lowp_counts_s cn30xx; | ||
555 | struct cvmx_npi_dma_lowp_counts_s cn31xx; | ||
556 | struct cvmx_npi_dma_lowp_counts_s cn38xx; | ||
557 | struct cvmx_npi_dma_lowp_counts_s cn38xxp2; | ||
558 | struct cvmx_npi_dma_lowp_counts_s cn50xx; | ||
559 | struct cvmx_npi_dma_lowp_counts_s cn58xx; | ||
560 | struct cvmx_npi_dma_lowp_counts_s cn58xxp1; | ||
561 | }; | ||
562 | |||
563 | union cvmx_npi_dma_lowp_naddr { | ||
564 | uint64_t u64; | ||
565 | struct cvmx_npi_dma_lowp_naddr_s { | ||
566 | uint64_t reserved_40_63:24; | ||
567 | uint64_t state:4; | ||
568 | uint64_t addr:36; | ||
569 | } s; | ||
570 | struct cvmx_npi_dma_lowp_naddr_s cn30xx; | ||
571 | struct cvmx_npi_dma_lowp_naddr_s cn31xx; | ||
572 | struct cvmx_npi_dma_lowp_naddr_s cn38xx; | ||
573 | struct cvmx_npi_dma_lowp_naddr_s cn38xxp2; | ||
574 | struct cvmx_npi_dma_lowp_naddr_s cn50xx; | ||
575 | struct cvmx_npi_dma_lowp_naddr_s cn58xx; | ||
576 | struct cvmx_npi_dma_lowp_naddr_s cn58xxp1; | ||
577 | }; | ||
578 | |||
579 | union cvmx_npi_highp_dbell { | ||
580 | uint64_t u64; | ||
581 | struct cvmx_npi_highp_dbell_s { | ||
582 | uint64_t reserved_16_63:48; | ||
583 | uint64_t dbell:16; | ||
584 | } s; | ||
585 | struct cvmx_npi_highp_dbell_s cn30xx; | ||
586 | struct cvmx_npi_highp_dbell_s cn31xx; | ||
587 | struct cvmx_npi_highp_dbell_s cn38xx; | ||
588 | struct cvmx_npi_highp_dbell_s cn38xxp2; | ||
589 | struct cvmx_npi_highp_dbell_s cn50xx; | ||
590 | struct cvmx_npi_highp_dbell_s cn58xx; | ||
591 | struct cvmx_npi_highp_dbell_s cn58xxp1; | ||
592 | }; | ||
593 | |||
594 | union cvmx_npi_highp_ibuff_saddr { | ||
595 | uint64_t u64; | ||
596 | struct cvmx_npi_highp_ibuff_saddr_s { | ||
597 | uint64_t reserved_36_63:28; | ||
598 | uint64_t saddr:36; | ||
599 | } s; | ||
600 | struct cvmx_npi_highp_ibuff_saddr_s cn30xx; | ||
601 | struct cvmx_npi_highp_ibuff_saddr_s cn31xx; | ||
602 | struct cvmx_npi_highp_ibuff_saddr_s cn38xx; | ||
603 | struct cvmx_npi_highp_ibuff_saddr_s cn38xxp2; | ||
604 | struct cvmx_npi_highp_ibuff_saddr_s cn50xx; | ||
605 | struct cvmx_npi_highp_ibuff_saddr_s cn58xx; | ||
606 | struct cvmx_npi_highp_ibuff_saddr_s cn58xxp1; | ||
607 | }; | ||
608 | |||
609 | union cvmx_npi_input_control { | ||
610 | uint64_t u64; | ||
611 | struct cvmx_npi_input_control_s { | ||
612 | uint64_t reserved_23_63:41; | ||
613 | uint64_t pkt_rr:1; | ||
614 | uint64_t pbp_dhi:13; | ||
615 | uint64_t d_nsr:1; | ||
616 | uint64_t d_esr:2; | ||
617 | uint64_t d_ror:1; | ||
618 | uint64_t use_csr:1; | ||
619 | uint64_t nsr:1; | ||
620 | uint64_t esr:2; | ||
621 | uint64_t ror:1; | ||
622 | } s; | ||
623 | struct cvmx_npi_input_control_cn30xx { | ||
624 | uint64_t reserved_22_63:42; | ||
625 | uint64_t pbp_dhi:13; | ||
626 | uint64_t d_nsr:1; | ||
627 | uint64_t d_esr:2; | ||
628 | uint64_t d_ror:1; | ||
629 | uint64_t use_csr:1; | ||
630 | uint64_t nsr:1; | ||
631 | uint64_t esr:2; | ||
632 | uint64_t ror:1; | ||
633 | } cn30xx; | ||
634 | struct cvmx_npi_input_control_cn30xx cn31xx; | ||
635 | struct cvmx_npi_input_control_s cn38xx; | ||
636 | struct cvmx_npi_input_control_cn30xx cn38xxp2; | ||
637 | struct cvmx_npi_input_control_s cn50xx; | ||
638 | struct cvmx_npi_input_control_s cn58xx; | ||
639 | struct cvmx_npi_input_control_s cn58xxp1; | ||
640 | }; | ||
641 | |||
642 | union cvmx_npi_int_enb { | ||
643 | uint64_t u64; | ||
644 | struct cvmx_npi_int_enb_s { | ||
645 | uint64_t reserved_62_63:2; | ||
646 | uint64_t q1_a_f:1; | ||
647 | uint64_t q1_s_e:1; | ||
648 | uint64_t pdf_p_f:1; | ||
649 | uint64_t pdf_p_e:1; | ||
650 | uint64_t pcf_p_f:1; | ||
651 | uint64_t pcf_p_e:1; | ||
652 | uint64_t rdx_s_e:1; | ||
653 | uint64_t rwx_s_e:1; | ||
654 | uint64_t pnc_a_f:1; | ||
655 | uint64_t pnc_s_e:1; | ||
656 | uint64_t com_a_f:1; | ||
657 | uint64_t com_s_e:1; | ||
658 | uint64_t q3_a_f:1; | ||
659 | uint64_t q3_s_e:1; | ||
660 | uint64_t q2_a_f:1; | ||
661 | uint64_t q2_s_e:1; | ||
662 | uint64_t pcr_a_f:1; | ||
663 | uint64_t pcr_s_e:1; | ||
664 | uint64_t fcr_a_f:1; | ||
665 | uint64_t fcr_s_e:1; | ||
666 | uint64_t iobdma:1; | ||
667 | uint64_t p_dperr:1; | ||
668 | uint64_t win_rto:1; | ||
669 | uint64_t i3_pperr:1; | ||
670 | uint64_t i2_pperr:1; | ||
671 | uint64_t i1_pperr:1; | ||
672 | uint64_t i0_pperr:1; | ||
673 | uint64_t p3_ptout:1; | ||
674 | uint64_t p2_ptout:1; | ||
675 | uint64_t p1_ptout:1; | ||
676 | uint64_t p0_ptout:1; | ||
677 | uint64_t p3_pperr:1; | ||
678 | uint64_t p2_pperr:1; | ||
679 | uint64_t p1_pperr:1; | ||
680 | uint64_t p0_pperr:1; | ||
681 | uint64_t g3_rtout:1; | ||
682 | uint64_t g2_rtout:1; | ||
683 | uint64_t g1_rtout:1; | ||
684 | uint64_t g0_rtout:1; | ||
685 | uint64_t p3_perr:1; | ||
686 | uint64_t p2_perr:1; | ||
687 | uint64_t p1_perr:1; | ||
688 | uint64_t p0_perr:1; | ||
689 | uint64_t p3_rtout:1; | ||
690 | uint64_t p2_rtout:1; | ||
691 | uint64_t p1_rtout:1; | ||
692 | uint64_t p0_rtout:1; | ||
693 | uint64_t i3_overf:1; | ||
694 | uint64_t i2_overf:1; | ||
695 | uint64_t i1_overf:1; | ||
696 | uint64_t i0_overf:1; | ||
697 | uint64_t i3_rtout:1; | ||
698 | uint64_t i2_rtout:1; | ||
699 | uint64_t i1_rtout:1; | ||
700 | uint64_t i0_rtout:1; | ||
701 | uint64_t po3_2sml:1; | ||
702 | uint64_t po2_2sml:1; | ||
703 | uint64_t po1_2sml:1; | ||
704 | uint64_t po0_2sml:1; | ||
705 | uint64_t pci_rsl:1; | ||
706 | uint64_t rml_wto:1; | ||
707 | uint64_t rml_rto:1; | ||
708 | } s; | ||
709 | struct cvmx_npi_int_enb_cn30xx { | ||
710 | uint64_t reserved_62_63:2; | ||
711 | uint64_t q1_a_f:1; | ||
712 | uint64_t q1_s_e:1; | ||
713 | uint64_t pdf_p_f:1; | ||
714 | uint64_t pdf_p_e:1; | ||
715 | uint64_t pcf_p_f:1; | ||
716 | uint64_t pcf_p_e:1; | ||
717 | uint64_t rdx_s_e:1; | ||
718 | uint64_t rwx_s_e:1; | ||
719 | uint64_t pnc_a_f:1; | ||
720 | uint64_t pnc_s_e:1; | ||
721 | uint64_t com_a_f:1; | ||
722 | uint64_t com_s_e:1; | ||
723 | uint64_t q3_a_f:1; | ||
724 | uint64_t q3_s_e:1; | ||
725 | uint64_t q2_a_f:1; | ||
726 | uint64_t q2_s_e:1; | ||
727 | uint64_t pcr_a_f:1; | ||
728 | uint64_t pcr_s_e:1; | ||
729 | uint64_t fcr_a_f:1; | ||
730 | uint64_t fcr_s_e:1; | ||
731 | uint64_t iobdma:1; | ||
732 | uint64_t p_dperr:1; | ||
733 | uint64_t win_rto:1; | ||
734 | uint64_t reserved_36_38:3; | ||
735 | uint64_t i0_pperr:1; | ||
736 | uint64_t reserved_32_34:3; | ||
737 | uint64_t p0_ptout:1; | ||
738 | uint64_t reserved_28_30:3; | ||
739 | uint64_t p0_pperr:1; | ||
740 | uint64_t reserved_24_26:3; | ||
741 | uint64_t g0_rtout:1; | ||
742 | uint64_t reserved_20_22:3; | ||
743 | uint64_t p0_perr:1; | ||
744 | uint64_t reserved_16_18:3; | ||
745 | uint64_t p0_rtout:1; | ||
746 | uint64_t reserved_12_14:3; | ||
747 | uint64_t i0_overf:1; | ||
748 | uint64_t reserved_8_10:3; | ||
749 | uint64_t i0_rtout:1; | ||
750 | uint64_t reserved_4_6:3; | ||
751 | uint64_t po0_2sml:1; | ||
752 | uint64_t pci_rsl:1; | ||
753 | uint64_t rml_wto:1; | ||
754 | uint64_t rml_rto:1; | ||
755 | } cn30xx; | ||
756 | struct cvmx_npi_int_enb_cn31xx { | ||
757 | uint64_t reserved_62_63:2; | ||
758 | uint64_t q1_a_f:1; | ||
759 | uint64_t q1_s_e:1; | ||
760 | uint64_t pdf_p_f:1; | ||
761 | uint64_t pdf_p_e:1; | ||
762 | uint64_t pcf_p_f:1; | ||
763 | uint64_t pcf_p_e:1; | ||
764 | uint64_t rdx_s_e:1; | ||
765 | uint64_t rwx_s_e:1; | ||
766 | uint64_t pnc_a_f:1; | ||
767 | uint64_t pnc_s_e:1; | ||
768 | uint64_t com_a_f:1; | ||
769 | uint64_t com_s_e:1; | ||
770 | uint64_t q3_a_f:1; | ||
771 | uint64_t q3_s_e:1; | ||
772 | uint64_t q2_a_f:1; | ||
773 | uint64_t q2_s_e:1; | ||
774 | uint64_t pcr_a_f:1; | ||
775 | uint64_t pcr_s_e:1; | ||
776 | uint64_t fcr_a_f:1; | ||
777 | uint64_t fcr_s_e:1; | ||
778 | uint64_t iobdma:1; | ||
779 | uint64_t p_dperr:1; | ||
780 | uint64_t win_rto:1; | ||
781 | uint64_t reserved_37_38:2; | ||
782 | uint64_t i1_pperr:1; | ||
783 | uint64_t i0_pperr:1; | ||
784 | uint64_t reserved_33_34:2; | ||
785 | uint64_t p1_ptout:1; | ||
786 | uint64_t p0_ptout:1; | ||
787 | uint64_t reserved_29_30:2; | ||
788 | uint64_t p1_pperr:1; | ||
789 | uint64_t p0_pperr:1; | ||
790 | uint64_t reserved_25_26:2; | ||
791 | uint64_t g1_rtout:1; | ||
792 | uint64_t g0_rtout:1; | ||
793 | uint64_t reserved_21_22:2; | ||
794 | uint64_t p1_perr:1; | ||
795 | uint64_t p0_perr:1; | ||
796 | uint64_t reserved_17_18:2; | ||
797 | uint64_t p1_rtout:1; | ||
798 | uint64_t p0_rtout:1; | ||
799 | uint64_t reserved_13_14:2; | ||
800 | uint64_t i1_overf:1; | ||
801 | uint64_t i0_overf:1; | ||
802 | uint64_t reserved_9_10:2; | ||
803 | uint64_t i1_rtout:1; | ||
804 | uint64_t i0_rtout:1; | ||
805 | uint64_t reserved_5_6:2; | ||
806 | uint64_t po1_2sml:1; | ||
807 | uint64_t po0_2sml:1; | ||
808 | uint64_t pci_rsl:1; | ||
809 | uint64_t rml_wto:1; | ||
810 | uint64_t rml_rto:1; | ||
811 | } cn31xx; | ||
812 | struct cvmx_npi_int_enb_s cn38xx; | ||
813 | struct cvmx_npi_int_enb_cn38xxp2 { | ||
814 | uint64_t reserved_42_63:22; | ||
815 | uint64_t iobdma:1; | ||
816 | uint64_t p_dperr:1; | ||
817 | uint64_t win_rto:1; | ||
818 | uint64_t i3_pperr:1; | ||
819 | uint64_t i2_pperr:1; | ||
820 | uint64_t i1_pperr:1; | ||
821 | uint64_t i0_pperr:1; | ||
822 | uint64_t p3_ptout:1; | ||
823 | uint64_t p2_ptout:1; | ||
824 | uint64_t p1_ptout:1; | ||
825 | uint64_t p0_ptout:1; | ||
826 | uint64_t p3_pperr:1; | ||
827 | uint64_t p2_pperr:1; | ||
828 | uint64_t p1_pperr:1; | ||
829 | uint64_t p0_pperr:1; | ||
830 | uint64_t g3_rtout:1; | ||
831 | uint64_t g2_rtout:1; | ||
832 | uint64_t g1_rtout:1; | ||
833 | uint64_t g0_rtout:1; | ||
834 | uint64_t p3_perr:1; | ||
835 | uint64_t p2_perr:1; | ||
836 | uint64_t p1_perr:1; | ||
837 | uint64_t p0_perr:1; | ||
838 | uint64_t p3_rtout:1; | ||
839 | uint64_t p2_rtout:1; | ||
840 | uint64_t p1_rtout:1; | ||
841 | uint64_t p0_rtout:1; | ||
842 | uint64_t i3_overf:1; | ||
843 | uint64_t i2_overf:1; | ||
844 | uint64_t i1_overf:1; | ||
845 | uint64_t i0_overf:1; | ||
846 | uint64_t i3_rtout:1; | ||
847 | uint64_t i2_rtout:1; | ||
848 | uint64_t i1_rtout:1; | ||
849 | uint64_t i0_rtout:1; | ||
850 | uint64_t po3_2sml:1; | ||
851 | uint64_t po2_2sml:1; | ||
852 | uint64_t po1_2sml:1; | ||
853 | uint64_t po0_2sml:1; | ||
854 | uint64_t pci_rsl:1; | ||
855 | uint64_t rml_wto:1; | ||
856 | uint64_t rml_rto:1; | ||
857 | } cn38xxp2; | ||
858 | struct cvmx_npi_int_enb_cn31xx cn50xx; | ||
859 | struct cvmx_npi_int_enb_s cn58xx; | ||
860 | struct cvmx_npi_int_enb_s cn58xxp1; | ||
861 | }; | ||
862 | |||
863 | union cvmx_npi_int_sum { | ||
864 | uint64_t u64; | ||
865 | struct cvmx_npi_int_sum_s { | ||
866 | uint64_t reserved_62_63:2; | ||
867 | uint64_t q1_a_f:1; | ||
868 | uint64_t q1_s_e:1; | ||
869 | uint64_t pdf_p_f:1; | ||
870 | uint64_t pdf_p_e:1; | ||
871 | uint64_t pcf_p_f:1; | ||
872 | uint64_t pcf_p_e:1; | ||
873 | uint64_t rdx_s_e:1; | ||
874 | uint64_t rwx_s_e:1; | ||
875 | uint64_t pnc_a_f:1; | ||
876 | uint64_t pnc_s_e:1; | ||
877 | uint64_t com_a_f:1; | ||
878 | uint64_t com_s_e:1; | ||
879 | uint64_t q3_a_f:1; | ||
880 | uint64_t q3_s_e:1; | ||
881 | uint64_t q2_a_f:1; | ||
882 | uint64_t q2_s_e:1; | ||
883 | uint64_t pcr_a_f:1; | ||
884 | uint64_t pcr_s_e:1; | ||
885 | uint64_t fcr_a_f:1; | ||
886 | uint64_t fcr_s_e:1; | ||
887 | uint64_t iobdma:1; | ||
888 | uint64_t p_dperr:1; | ||
889 | uint64_t win_rto:1; | ||
890 | uint64_t i3_pperr:1; | ||
891 | uint64_t i2_pperr:1; | ||
892 | uint64_t i1_pperr:1; | ||
893 | uint64_t i0_pperr:1; | ||
894 | uint64_t p3_ptout:1; | ||
895 | uint64_t p2_ptout:1; | ||
896 | uint64_t p1_ptout:1; | ||
897 | uint64_t p0_ptout:1; | ||
898 | uint64_t p3_pperr:1; | ||
899 | uint64_t p2_pperr:1; | ||
900 | uint64_t p1_pperr:1; | ||
901 | uint64_t p0_pperr:1; | ||
902 | uint64_t g3_rtout:1; | ||
903 | uint64_t g2_rtout:1; | ||
904 | uint64_t g1_rtout:1; | ||
905 | uint64_t g0_rtout:1; | ||
906 | uint64_t p3_perr:1; | ||
907 | uint64_t p2_perr:1; | ||
908 | uint64_t p1_perr:1; | ||
909 | uint64_t p0_perr:1; | ||
910 | uint64_t p3_rtout:1; | ||
911 | uint64_t p2_rtout:1; | ||
912 | uint64_t p1_rtout:1; | ||
913 | uint64_t p0_rtout:1; | ||
914 | uint64_t i3_overf:1; | ||
915 | uint64_t i2_overf:1; | ||
916 | uint64_t i1_overf:1; | ||
917 | uint64_t i0_overf:1; | ||
918 | uint64_t i3_rtout:1; | ||
919 | uint64_t i2_rtout:1; | ||
920 | uint64_t i1_rtout:1; | ||
921 | uint64_t i0_rtout:1; | ||
922 | uint64_t po3_2sml:1; | ||
923 | uint64_t po2_2sml:1; | ||
924 | uint64_t po1_2sml:1; | ||
925 | uint64_t po0_2sml:1; | ||
926 | uint64_t pci_rsl:1; | ||
927 | uint64_t rml_wto:1; | ||
928 | uint64_t rml_rto:1; | ||
929 | } s; | ||
930 | struct cvmx_npi_int_sum_cn30xx { | ||
931 | uint64_t reserved_62_63:2; | ||
932 | uint64_t q1_a_f:1; | ||
933 | uint64_t q1_s_e:1; | ||
934 | uint64_t pdf_p_f:1; | ||
935 | uint64_t pdf_p_e:1; | ||
936 | uint64_t pcf_p_f:1; | ||
937 | uint64_t pcf_p_e:1; | ||
938 | uint64_t rdx_s_e:1; | ||
939 | uint64_t rwx_s_e:1; | ||
940 | uint64_t pnc_a_f:1; | ||
941 | uint64_t pnc_s_e:1; | ||
942 | uint64_t com_a_f:1; | ||
943 | uint64_t com_s_e:1; | ||
944 | uint64_t q3_a_f:1; | ||
945 | uint64_t q3_s_e:1; | ||
946 | uint64_t q2_a_f:1; | ||
947 | uint64_t q2_s_e:1; | ||
948 | uint64_t pcr_a_f:1; | ||
949 | uint64_t pcr_s_e:1; | ||
950 | uint64_t fcr_a_f:1; | ||
951 | uint64_t fcr_s_e:1; | ||
952 | uint64_t iobdma:1; | ||
953 | uint64_t p_dperr:1; | ||
954 | uint64_t win_rto:1; | ||
955 | uint64_t reserved_36_38:3; | ||
956 | uint64_t i0_pperr:1; | ||
957 | uint64_t reserved_32_34:3; | ||
958 | uint64_t p0_ptout:1; | ||
959 | uint64_t reserved_28_30:3; | ||
960 | uint64_t p0_pperr:1; | ||
961 | uint64_t reserved_24_26:3; | ||
962 | uint64_t g0_rtout:1; | ||
963 | uint64_t reserved_20_22:3; | ||
964 | uint64_t p0_perr:1; | ||
965 | uint64_t reserved_16_18:3; | ||
966 | uint64_t p0_rtout:1; | ||
967 | uint64_t reserved_12_14:3; | ||
968 | uint64_t i0_overf:1; | ||
969 | uint64_t reserved_8_10:3; | ||
970 | uint64_t i0_rtout:1; | ||
971 | uint64_t reserved_4_6:3; | ||
972 | uint64_t po0_2sml:1; | ||
973 | uint64_t pci_rsl:1; | ||
974 | uint64_t rml_wto:1; | ||
975 | uint64_t rml_rto:1; | ||
976 | } cn30xx; | ||
977 | struct cvmx_npi_int_sum_cn31xx { | ||
978 | uint64_t reserved_62_63:2; | ||
979 | uint64_t q1_a_f:1; | ||
980 | uint64_t q1_s_e:1; | ||
981 | uint64_t pdf_p_f:1; | ||
982 | uint64_t pdf_p_e:1; | ||
983 | uint64_t pcf_p_f:1; | ||
984 | uint64_t pcf_p_e:1; | ||
985 | uint64_t rdx_s_e:1; | ||
986 | uint64_t rwx_s_e:1; | ||
987 | uint64_t pnc_a_f:1; | ||
988 | uint64_t pnc_s_e:1; | ||
989 | uint64_t com_a_f:1; | ||
990 | uint64_t com_s_e:1; | ||
991 | uint64_t q3_a_f:1; | ||
992 | uint64_t q3_s_e:1; | ||
993 | uint64_t q2_a_f:1; | ||
994 | uint64_t q2_s_e:1; | ||
995 | uint64_t pcr_a_f:1; | ||
996 | uint64_t pcr_s_e:1; | ||
997 | uint64_t fcr_a_f:1; | ||
998 | uint64_t fcr_s_e:1; | ||
999 | uint64_t iobdma:1; | ||
1000 | uint64_t p_dperr:1; | ||
1001 | uint64_t win_rto:1; | ||
1002 | uint64_t reserved_37_38:2; | ||
1003 | uint64_t i1_pperr:1; | ||
1004 | uint64_t i0_pperr:1; | ||
1005 | uint64_t reserved_33_34:2; | ||
1006 | uint64_t p1_ptout:1; | ||
1007 | uint64_t p0_ptout:1; | ||
1008 | uint64_t reserved_29_30:2; | ||
1009 | uint64_t p1_pperr:1; | ||
1010 | uint64_t p0_pperr:1; | ||
1011 | uint64_t reserved_25_26:2; | ||
1012 | uint64_t g1_rtout:1; | ||
1013 | uint64_t g0_rtout:1; | ||
1014 | uint64_t reserved_21_22:2; | ||
1015 | uint64_t p1_perr:1; | ||
1016 | uint64_t p0_perr:1; | ||
1017 | uint64_t reserved_17_18:2; | ||
1018 | uint64_t p1_rtout:1; | ||
1019 | uint64_t p0_rtout:1; | ||
1020 | uint64_t reserved_13_14:2; | ||
1021 | uint64_t i1_overf:1; | ||
1022 | uint64_t i0_overf:1; | ||
1023 | uint64_t reserved_9_10:2; | ||
1024 | uint64_t i1_rtout:1; | ||
1025 | uint64_t i0_rtout:1; | ||
1026 | uint64_t reserved_5_6:2; | ||
1027 | uint64_t po1_2sml:1; | ||
1028 | uint64_t po0_2sml:1; | ||
1029 | uint64_t pci_rsl:1; | ||
1030 | uint64_t rml_wto:1; | ||
1031 | uint64_t rml_rto:1; | ||
1032 | } cn31xx; | ||
1033 | struct cvmx_npi_int_sum_s cn38xx; | ||
1034 | struct cvmx_npi_int_sum_cn38xxp2 { | ||
1035 | uint64_t reserved_42_63:22; | ||
1036 | uint64_t iobdma:1; | ||
1037 | uint64_t p_dperr:1; | ||
1038 | uint64_t win_rto:1; | ||
1039 | uint64_t i3_pperr:1; | ||
1040 | uint64_t i2_pperr:1; | ||
1041 | uint64_t i1_pperr:1; | ||
1042 | uint64_t i0_pperr:1; | ||
1043 | uint64_t p3_ptout:1; | ||
1044 | uint64_t p2_ptout:1; | ||
1045 | uint64_t p1_ptout:1; | ||
1046 | uint64_t p0_ptout:1; | ||
1047 | uint64_t p3_pperr:1; | ||
1048 | uint64_t p2_pperr:1; | ||
1049 | uint64_t p1_pperr:1; | ||
1050 | uint64_t p0_pperr:1; | ||
1051 | uint64_t g3_rtout:1; | ||
1052 | uint64_t g2_rtout:1; | ||
1053 | uint64_t g1_rtout:1; | ||
1054 | uint64_t g0_rtout:1; | ||
1055 | uint64_t p3_perr:1; | ||
1056 | uint64_t p2_perr:1; | ||
1057 | uint64_t p1_perr:1; | ||
1058 | uint64_t p0_perr:1; | ||
1059 | uint64_t p3_rtout:1; | ||
1060 | uint64_t p2_rtout:1; | ||
1061 | uint64_t p1_rtout:1; | ||
1062 | uint64_t p0_rtout:1; | ||
1063 | uint64_t i3_overf:1; | ||
1064 | uint64_t i2_overf:1; | ||
1065 | uint64_t i1_overf:1; | ||
1066 | uint64_t i0_overf:1; | ||
1067 | uint64_t i3_rtout:1; | ||
1068 | uint64_t i2_rtout:1; | ||
1069 | uint64_t i1_rtout:1; | ||
1070 | uint64_t i0_rtout:1; | ||
1071 | uint64_t po3_2sml:1; | ||
1072 | uint64_t po2_2sml:1; | ||
1073 | uint64_t po1_2sml:1; | ||
1074 | uint64_t po0_2sml:1; | ||
1075 | uint64_t pci_rsl:1; | ||
1076 | uint64_t rml_wto:1; | ||
1077 | uint64_t rml_rto:1; | ||
1078 | } cn38xxp2; | ||
1079 | struct cvmx_npi_int_sum_cn31xx cn50xx; | ||
1080 | struct cvmx_npi_int_sum_s cn58xx; | ||
1081 | struct cvmx_npi_int_sum_s cn58xxp1; | ||
1082 | }; | ||
1083 | |||
1084 | union cvmx_npi_lowp_dbell { | ||
1085 | uint64_t u64; | ||
1086 | struct cvmx_npi_lowp_dbell_s { | ||
1087 | uint64_t reserved_16_63:48; | ||
1088 | uint64_t dbell:16; | ||
1089 | } s; | ||
1090 | struct cvmx_npi_lowp_dbell_s cn30xx; | ||
1091 | struct cvmx_npi_lowp_dbell_s cn31xx; | ||
1092 | struct cvmx_npi_lowp_dbell_s cn38xx; | ||
1093 | struct cvmx_npi_lowp_dbell_s cn38xxp2; | ||
1094 | struct cvmx_npi_lowp_dbell_s cn50xx; | ||
1095 | struct cvmx_npi_lowp_dbell_s cn58xx; | ||
1096 | struct cvmx_npi_lowp_dbell_s cn58xxp1; | ||
1097 | }; | ||
1098 | |||
1099 | union cvmx_npi_lowp_ibuff_saddr { | ||
1100 | uint64_t u64; | ||
1101 | struct cvmx_npi_lowp_ibuff_saddr_s { | ||
1102 | uint64_t reserved_36_63:28; | ||
1103 | uint64_t saddr:36; | ||
1104 | } s; | ||
1105 | struct cvmx_npi_lowp_ibuff_saddr_s cn30xx; | ||
1106 | struct cvmx_npi_lowp_ibuff_saddr_s cn31xx; | ||
1107 | struct cvmx_npi_lowp_ibuff_saddr_s cn38xx; | ||
1108 | struct cvmx_npi_lowp_ibuff_saddr_s cn38xxp2; | ||
1109 | struct cvmx_npi_lowp_ibuff_saddr_s cn50xx; | ||
1110 | struct cvmx_npi_lowp_ibuff_saddr_s cn58xx; | ||
1111 | struct cvmx_npi_lowp_ibuff_saddr_s cn58xxp1; | ||
1112 | }; | ||
1113 | |||
1114 | union cvmx_npi_mem_access_subidx { | ||
1115 | uint64_t u64; | ||
1116 | struct cvmx_npi_mem_access_subidx_s { | ||
1117 | uint64_t reserved_38_63:26; | ||
1118 | uint64_t shortl:1; | ||
1119 | uint64_t nmerge:1; | ||
1120 | uint64_t esr:2; | ||
1121 | uint64_t esw:2; | ||
1122 | uint64_t nsr:1; | ||
1123 | uint64_t nsw:1; | ||
1124 | uint64_t ror:1; | ||
1125 | uint64_t row:1; | ||
1126 | uint64_t ba:28; | ||
1127 | } s; | ||
1128 | struct cvmx_npi_mem_access_subidx_s cn30xx; | ||
1129 | struct cvmx_npi_mem_access_subidx_cn31xx { | ||
1130 | uint64_t reserved_36_63:28; | ||
1131 | uint64_t esr:2; | ||
1132 | uint64_t esw:2; | ||
1133 | uint64_t nsr:1; | ||
1134 | uint64_t nsw:1; | ||
1135 | uint64_t ror:1; | ||
1136 | uint64_t row:1; | ||
1137 | uint64_t ba:28; | ||
1138 | } cn31xx; | ||
1139 | struct cvmx_npi_mem_access_subidx_s cn38xx; | ||
1140 | struct cvmx_npi_mem_access_subidx_cn31xx cn38xxp2; | ||
1141 | struct cvmx_npi_mem_access_subidx_s cn50xx; | ||
1142 | struct cvmx_npi_mem_access_subidx_s cn58xx; | ||
1143 | struct cvmx_npi_mem_access_subidx_s cn58xxp1; | ||
1144 | }; | ||
1145 | |||
1146 | union cvmx_npi_msi_rcv { | ||
1147 | uint64_t u64; | ||
1148 | struct cvmx_npi_msi_rcv_s { | ||
1149 | uint64_t int_vec:64; | ||
1150 | } s; | ||
1151 | struct cvmx_npi_msi_rcv_s cn30xx; | ||
1152 | struct cvmx_npi_msi_rcv_s cn31xx; | ||
1153 | struct cvmx_npi_msi_rcv_s cn38xx; | ||
1154 | struct cvmx_npi_msi_rcv_s cn38xxp2; | ||
1155 | struct cvmx_npi_msi_rcv_s cn50xx; | ||
1156 | struct cvmx_npi_msi_rcv_s cn58xx; | ||
1157 | struct cvmx_npi_msi_rcv_s cn58xxp1; | ||
1158 | }; | ||
1159 | |||
1160 | union cvmx_npi_num_desc_outputx { | ||
1161 | uint64_t u64; | ||
1162 | struct cvmx_npi_num_desc_outputx_s { | ||
1163 | uint64_t reserved_32_63:32; | ||
1164 | uint64_t size:32; | ||
1165 | } s; | ||
1166 | struct cvmx_npi_num_desc_outputx_s cn30xx; | ||
1167 | struct cvmx_npi_num_desc_outputx_s cn31xx; | ||
1168 | struct cvmx_npi_num_desc_outputx_s cn38xx; | ||
1169 | struct cvmx_npi_num_desc_outputx_s cn38xxp2; | ||
1170 | struct cvmx_npi_num_desc_outputx_s cn50xx; | ||
1171 | struct cvmx_npi_num_desc_outputx_s cn58xx; | ||
1172 | struct cvmx_npi_num_desc_outputx_s cn58xxp1; | ||
1173 | }; | ||
1174 | |||
1175 | union cvmx_npi_output_control { | ||
1176 | uint64_t u64; | ||
1177 | struct cvmx_npi_output_control_s { | ||
1178 | uint64_t reserved_49_63:15; | ||
1179 | uint64_t pkt_rr:1; | ||
1180 | uint64_t p3_bmode:1; | ||
1181 | uint64_t p2_bmode:1; | ||
1182 | uint64_t p1_bmode:1; | ||
1183 | uint64_t p0_bmode:1; | ||
1184 | uint64_t o3_es:2; | ||
1185 | uint64_t o3_ns:1; | ||
1186 | uint64_t o3_ro:1; | ||
1187 | uint64_t o2_es:2; | ||
1188 | uint64_t o2_ns:1; | ||
1189 | uint64_t o2_ro:1; | ||
1190 | uint64_t o1_es:2; | ||
1191 | uint64_t o1_ns:1; | ||
1192 | uint64_t o1_ro:1; | ||
1193 | uint64_t o0_es:2; | ||
1194 | uint64_t o0_ns:1; | ||
1195 | uint64_t o0_ro:1; | ||
1196 | uint64_t o3_csrm:1; | ||
1197 | uint64_t o2_csrm:1; | ||
1198 | uint64_t o1_csrm:1; | ||
1199 | uint64_t o0_csrm:1; | ||
1200 | uint64_t reserved_20_23:4; | ||
1201 | uint64_t iptr_o3:1; | ||
1202 | uint64_t iptr_o2:1; | ||
1203 | uint64_t iptr_o1:1; | ||
1204 | uint64_t iptr_o0:1; | ||
1205 | uint64_t esr_sl3:2; | ||
1206 | uint64_t nsr_sl3:1; | ||
1207 | uint64_t ror_sl3:1; | ||
1208 | uint64_t esr_sl2:2; | ||
1209 | uint64_t nsr_sl2:1; | ||
1210 | uint64_t ror_sl2:1; | ||
1211 | uint64_t esr_sl1:2; | ||
1212 | uint64_t nsr_sl1:1; | ||
1213 | uint64_t ror_sl1:1; | ||
1214 | uint64_t esr_sl0:2; | ||
1215 | uint64_t nsr_sl0:1; | ||
1216 | uint64_t ror_sl0:1; | ||
1217 | } s; | ||
1218 | struct cvmx_npi_output_control_cn30xx { | ||
1219 | uint64_t reserved_45_63:19; | ||
1220 | uint64_t p0_bmode:1; | ||
1221 | uint64_t reserved_32_43:12; | ||
1222 | uint64_t o0_es:2; | ||
1223 | uint64_t o0_ns:1; | ||
1224 | uint64_t o0_ro:1; | ||
1225 | uint64_t reserved_25_27:3; | ||
1226 | uint64_t o0_csrm:1; | ||
1227 | uint64_t reserved_17_23:7; | ||
1228 | uint64_t iptr_o0:1; | ||
1229 | uint64_t reserved_4_15:12; | ||
1230 | uint64_t esr_sl0:2; | ||
1231 | uint64_t nsr_sl0:1; | ||
1232 | uint64_t ror_sl0:1; | ||
1233 | } cn30xx; | ||
1234 | struct cvmx_npi_output_control_cn31xx { | ||
1235 | uint64_t reserved_46_63:18; | ||
1236 | uint64_t p1_bmode:1; | ||
1237 | uint64_t p0_bmode:1; | ||
1238 | uint64_t reserved_36_43:8; | ||
1239 | uint64_t o1_es:2; | ||
1240 | uint64_t o1_ns:1; | ||
1241 | uint64_t o1_ro:1; | ||
1242 | uint64_t o0_es:2; | ||
1243 | uint64_t o0_ns:1; | ||
1244 | uint64_t o0_ro:1; | ||
1245 | uint64_t reserved_26_27:2; | ||
1246 | uint64_t o1_csrm:1; | ||
1247 | uint64_t o0_csrm:1; | ||
1248 | uint64_t reserved_18_23:6; | ||
1249 | uint64_t iptr_o1:1; | ||
1250 | uint64_t iptr_o0:1; | ||
1251 | uint64_t reserved_8_15:8; | ||
1252 | uint64_t esr_sl1:2; | ||
1253 | uint64_t nsr_sl1:1; | ||
1254 | uint64_t ror_sl1:1; | ||
1255 | uint64_t esr_sl0:2; | ||
1256 | uint64_t nsr_sl0:1; | ||
1257 | uint64_t ror_sl0:1; | ||
1258 | } cn31xx; | ||
1259 | struct cvmx_npi_output_control_s cn38xx; | ||
1260 | struct cvmx_npi_output_control_cn38xxp2 { | ||
1261 | uint64_t reserved_48_63:16; | ||
1262 | uint64_t p3_bmode:1; | ||
1263 | uint64_t p2_bmode:1; | ||
1264 | uint64_t p1_bmode:1; | ||
1265 | uint64_t p0_bmode:1; | ||
1266 | uint64_t o3_es:2; | ||
1267 | uint64_t o3_ns:1; | ||
1268 | uint64_t o3_ro:1; | ||
1269 | uint64_t o2_es:2; | ||
1270 | uint64_t o2_ns:1; | ||
1271 | uint64_t o2_ro:1; | ||
1272 | uint64_t o1_es:2; | ||
1273 | uint64_t o1_ns:1; | ||
1274 | uint64_t o1_ro:1; | ||
1275 | uint64_t o0_es:2; | ||
1276 | uint64_t o0_ns:1; | ||
1277 | uint64_t o0_ro:1; | ||
1278 | uint64_t o3_csrm:1; | ||
1279 | uint64_t o2_csrm:1; | ||
1280 | uint64_t o1_csrm:1; | ||
1281 | uint64_t o0_csrm:1; | ||
1282 | uint64_t reserved_20_23:4; | ||
1283 | uint64_t iptr_o3:1; | ||
1284 | uint64_t iptr_o2:1; | ||
1285 | uint64_t iptr_o1:1; | ||
1286 | uint64_t iptr_o0:1; | ||
1287 | uint64_t esr_sl3:2; | ||
1288 | uint64_t nsr_sl3:1; | ||
1289 | uint64_t ror_sl3:1; | ||
1290 | uint64_t esr_sl2:2; | ||
1291 | uint64_t nsr_sl2:1; | ||
1292 | uint64_t ror_sl2:1; | ||
1293 | uint64_t esr_sl1:2; | ||
1294 | uint64_t nsr_sl1:1; | ||
1295 | uint64_t ror_sl1:1; | ||
1296 | uint64_t esr_sl0:2; | ||
1297 | uint64_t nsr_sl0:1; | ||
1298 | uint64_t ror_sl0:1; | ||
1299 | } cn38xxp2; | ||
1300 | struct cvmx_npi_output_control_cn50xx { | ||
1301 | uint64_t reserved_49_63:15; | ||
1302 | uint64_t pkt_rr:1; | ||
1303 | uint64_t reserved_46_47:2; | ||
1304 | uint64_t p1_bmode:1; | ||
1305 | uint64_t p0_bmode:1; | ||
1306 | uint64_t reserved_36_43:8; | ||
1307 | uint64_t o1_es:2; | ||
1308 | uint64_t o1_ns:1; | ||
1309 | uint64_t o1_ro:1; | ||
1310 | uint64_t o0_es:2; | ||
1311 | uint64_t o0_ns:1; | ||
1312 | uint64_t o0_ro:1; | ||
1313 | uint64_t reserved_26_27:2; | ||
1314 | uint64_t o1_csrm:1; | ||
1315 | uint64_t o0_csrm:1; | ||
1316 | uint64_t reserved_18_23:6; | ||
1317 | uint64_t iptr_o1:1; | ||
1318 | uint64_t iptr_o0:1; | ||
1319 | uint64_t reserved_8_15:8; | ||
1320 | uint64_t esr_sl1:2; | ||
1321 | uint64_t nsr_sl1:1; | ||
1322 | uint64_t ror_sl1:1; | ||
1323 | uint64_t esr_sl0:2; | ||
1324 | uint64_t nsr_sl0:1; | ||
1325 | uint64_t ror_sl0:1; | ||
1326 | } cn50xx; | ||
1327 | struct cvmx_npi_output_control_s cn58xx; | ||
1328 | struct cvmx_npi_output_control_s cn58xxp1; | ||
1329 | }; | ||
1330 | |||
1331 | union cvmx_npi_px_dbpair_addr { | ||
1332 | uint64_t u64; | ||
1333 | struct cvmx_npi_px_dbpair_addr_s { | ||
1334 | uint64_t reserved_63_63:1; | ||
1335 | uint64_t state:2; | ||
1336 | uint64_t naddr:61; | ||
1337 | } s; | ||
1338 | struct cvmx_npi_px_dbpair_addr_s cn30xx; | ||
1339 | struct cvmx_npi_px_dbpair_addr_s cn31xx; | ||
1340 | struct cvmx_npi_px_dbpair_addr_s cn38xx; | ||
1341 | struct cvmx_npi_px_dbpair_addr_s cn38xxp2; | ||
1342 | struct cvmx_npi_px_dbpair_addr_s cn50xx; | ||
1343 | struct cvmx_npi_px_dbpair_addr_s cn58xx; | ||
1344 | struct cvmx_npi_px_dbpair_addr_s cn58xxp1; | ||
1345 | }; | ||
1346 | |||
1347 | union cvmx_npi_px_instr_addr { | ||
1348 | uint64_t u64; | ||
1349 | struct cvmx_npi_px_instr_addr_s { | ||
1350 | uint64_t state:3; | ||
1351 | uint64_t naddr:61; | ||
1352 | } s; | ||
1353 | struct cvmx_npi_px_instr_addr_s cn30xx; | ||
1354 | struct cvmx_npi_px_instr_addr_s cn31xx; | ||
1355 | struct cvmx_npi_px_instr_addr_s cn38xx; | ||
1356 | struct cvmx_npi_px_instr_addr_s cn38xxp2; | ||
1357 | struct cvmx_npi_px_instr_addr_s cn50xx; | ||
1358 | struct cvmx_npi_px_instr_addr_s cn58xx; | ||
1359 | struct cvmx_npi_px_instr_addr_s cn58xxp1; | ||
1360 | }; | ||
1361 | |||
1362 | union cvmx_npi_px_instr_cnts { | ||
1363 | uint64_t u64; | ||
1364 | struct cvmx_npi_px_instr_cnts_s { | ||
1365 | uint64_t reserved_38_63:26; | ||
1366 | uint64_t fcnt:6; | ||
1367 | uint64_t avail:32; | ||
1368 | } s; | ||
1369 | struct cvmx_npi_px_instr_cnts_s cn30xx; | ||
1370 | struct cvmx_npi_px_instr_cnts_s cn31xx; | ||
1371 | struct cvmx_npi_px_instr_cnts_s cn38xx; | ||
1372 | struct cvmx_npi_px_instr_cnts_s cn38xxp2; | ||
1373 | struct cvmx_npi_px_instr_cnts_s cn50xx; | ||
1374 | struct cvmx_npi_px_instr_cnts_s cn58xx; | ||
1375 | struct cvmx_npi_px_instr_cnts_s cn58xxp1; | ||
1376 | }; | ||
1377 | |||
1378 | union cvmx_npi_px_pair_cnts { | ||
1379 | uint64_t u64; | ||
1380 | struct cvmx_npi_px_pair_cnts_s { | ||
1381 | uint64_t reserved_37_63:27; | ||
1382 | uint64_t fcnt:5; | ||
1383 | uint64_t avail:32; | ||
1384 | } s; | ||
1385 | struct cvmx_npi_px_pair_cnts_s cn30xx; | ||
1386 | struct cvmx_npi_px_pair_cnts_s cn31xx; | ||
1387 | struct cvmx_npi_px_pair_cnts_s cn38xx; | ||
1388 | struct cvmx_npi_px_pair_cnts_s cn38xxp2; | ||
1389 | struct cvmx_npi_px_pair_cnts_s cn50xx; | ||
1390 | struct cvmx_npi_px_pair_cnts_s cn58xx; | ||
1391 | struct cvmx_npi_px_pair_cnts_s cn58xxp1; | ||
1392 | }; | ||
1393 | |||
1394 | union cvmx_npi_pci_burst_size { | ||
1395 | uint64_t u64; | ||
1396 | struct cvmx_npi_pci_burst_size_s { | ||
1397 | uint64_t reserved_14_63:50; | ||
1398 | uint64_t wr_brst:7; | ||
1399 | uint64_t rd_brst:7; | ||
1400 | } s; | ||
1401 | struct cvmx_npi_pci_burst_size_s cn30xx; | ||
1402 | struct cvmx_npi_pci_burst_size_s cn31xx; | ||
1403 | struct cvmx_npi_pci_burst_size_s cn38xx; | ||
1404 | struct cvmx_npi_pci_burst_size_s cn38xxp2; | ||
1405 | struct cvmx_npi_pci_burst_size_s cn50xx; | ||
1406 | struct cvmx_npi_pci_burst_size_s cn58xx; | ||
1407 | struct cvmx_npi_pci_burst_size_s cn58xxp1; | ||
1408 | }; | ||
1409 | |||
1410 | union cvmx_npi_pci_int_arb_cfg { | ||
1411 | uint64_t u64; | ||
1412 | struct cvmx_npi_pci_int_arb_cfg_s { | ||
1413 | uint64_t reserved_13_63:51; | ||
1414 | uint64_t hostmode:1; | ||
1415 | uint64_t pci_ovr:4; | ||
1416 | uint64_t reserved_5_7:3; | ||
1417 | uint64_t en:1; | ||
1418 | uint64_t park_mod:1; | ||
1419 | uint64_t park_dev:3; | ||
1420 | } s; | ||
1421 | struct cvmx_npi_pci_int_arb_cfg_cn30xx { | ||
1422 | uint64_t reserved_5_63:59; | ||
1423 | uint64_t en:1; | ||
1424 | uint64_t park_mod:1; | ||
1425 | uint64_t park_dev:3; | ||
1426 | } cn30xx; | ||
1427 | struct cvmx_npi_pci_int_arb_cfg_cn30xx cn31xx; | ||
1428 | struct cvmx_npi_pci_int_arb_cfg_cn30xx cn38xx; | ||
1429 | struct cvmx_npi_pci_int_arb_cfg_cn30xx cn38xxp2; | ||
1430 | struct cvmx_npi_pci_int_arb_cfg_s cn50xx; | ||
1431 | struct cvmx_npi_pci_int_arb_cfg_s cn58xx; | ||
1432 | struct cvmx_npi_pci_int_arb_cfg_s cn58xxp1; | ||
1433 | }; | ||
1434 | |||
1435 | union cvmx_npi_pci_read_cmd { | ||
1436 | uint64_t u64; | ||
1437 | struct cvmx_npi_pci_read_cmd_s { | ||
1438 | uint64_t reserved_11_63:53; | ||
1439 | uint64_t cmd_size:11; | ||
1440 | } s; | ||
1441 | struct cvmx_npi_pci_read_cmd_s cn30xx; | ||
1442 | struct cvmx_npi_pci_read_cmd_s cn31xx; | ||
1443 | struct cvmx_npi_pci_read_cmd_s cn38xx; | ||
1444 | struct cvmx_npi_pci_read_cmd_s cn38xxp2; | ||
1445 | struct cvmx_npi_pci_read_cmd_s cn50xx; | ||
1446 | struct cvmx_npi_pci_read_cmd_s cn58xx; | ||
1447 | struct cvmx_npi_pci_read_cmd_s cn58xxp1; | ||
1448 | }; | ||
1449 | |||
1450 | union cvmx_npi_port32_instr_hdr { | ||
1451 | uint64_t u64; | ||
1452 | struct cvmx_npi_port32_instr_hdr_s { | ||
1453 | uint64_t reserved_44_63:20; | ||
1454 | uint64_t pbp:1; | ||
1455 | uint64_t rsv_f:5; | ||
1456 | uint64_t rparmode:2; | ||
1457 | uint64_t rsv_e:1; | ||
1458 | uint64_t rskp_len:7; | ||
1459 | uint64_t rsv_d:6; | ||
1460 | uint64_t use_ihdr:1; | ||
1461 | uint64_t rsv_c:5; | ||
1462 | uint64_t par_mode:2; | ||
1463 | uint64_t rsv_b:1; | ||
1464 | uint64_t skp_len:7; | ||
1465 | uint64_t rsv_a:6; | ||
1466 | } s; | ||
1467 | struct cvmx_npi_port32_instr_hdr_s cn30xx; | ||
1468 | struct cvmx_npi_port32_instr_hdr_s cn31xx; | ||
1469 | struct cvmx_npi_port32_instr_hdr_s cn38xx; | ||
1470 | struct cvmx_npi_port32_instr_hdr_s cn38xxp2; | ||
1471 | struct cvmx_npi_port32_instr_hdr_s cn50xx; | ||
1472 | struct cvmx_npi_port32_instr_hdr_s cn58xx; | ||
1473 | struct cvmx_npi_port32_instr_hdr_s cn58xxp1; | ||
1474 | }; | ||
1475 | |||
1476 | union cvmx_npi_port33_instr_hdr { | ||
1477 | uint64_t u64; | ||
1478 | struct cvmx_npi_port33_instr_hdr_s { | ||
1479 | uint64_t reserved_44_63:20; | ||
1480 | uint64_t pbp:1; | ||
1481 | uint64_t rsv_f:5; | ||
1482 | uint64_t rparmode:2; | ||
1483 | uint64_t rsv_e:1; | ||
1484 | uint64_t rskp_len:7; | ||
1485 | uint64_t rsv_d:6; | ||
1486 | uint64_t use_ihdr:1; | ||
1487 | uint64_t rsv_c:5; | ||
1488 | uint64_t par_mode:2; | ||
1489 | uint64_t rsv_b:1; | ||
1490 | uint64_t skp_len:7; | ||
1491 | uint64_t rsv_a:6; | ||
1492 | } s; | ||
1493 | struct cvmx_npi_port33_instr_hdr_s cn31xx; | ||
1494 | struct cvmx_npi_port33_instr_hdr_s cn38xx; | ||
1495 | struct cvmx_npi_port33_instr_hdr_s cn38xxp2; | ||
1496 | struct cvmx_npi_port33_instr_hdr_s cn50xx; | ||
1497 | struct cvmx_npi_port33_instr_hdr_s cn58xx; | ||
1498 | struct cvmx_npi_port33_instr_hdr_s cn58xxp1; | ||
1499 | }; | ||
1500 | |||
1501 | union cvmx_npi_port34_instr_hdr { | ||
1502 | uint64_t u64; | ||
1503 | struct cvmx_npi_port34_instr_hdr_s { | ||
1504 | uint64_t reserved_44_63:20; | ||
1505 | uint64_t pbp:1; | ||
1506 | uint64_t rsv_f:5; | ||
1507 | uint64_t rparmode:2; | ||
1508 | uint64_t rsv_e:1; | ||
1509 | uint64_t rskp_len:7; | ||
1510 | uint64_t rsv_d:6; | ||
1511 | uint64_t use_ihdr:1; | ||
1512 | uint64_t rsv_c:5; | ||
1513 | uint64_t par_mode:2; | ||
1514 | uint64_t rsv_b:1; | ||
1515 | uint64_t skp_len:7; | ||
1516 | uint64_t rsv_a:6; | ||
1517 | } s; | ||
1518 | struct cvmx_npi_port34_instr_hdr_s cn38xx; | ||
1519 | struct cvmx_npi_port34_instr_hdr_s cn38xxp2; | ||
1520 | struct cvmx_npi_port34_instr_hdr_s cn58xx; | ||
1521 | struct cvmx_npi_port34_instr_hdr_s cn58xxp1; | ||
1522 | }; | ||
1523 | |||
1524 | union cvmx_npi_port35_instr_hdr { | ||
1525 | uint64_t u64; | ||
1526 | struct cvmx_npi_port35_instr_hdr_s { | ||
1527 | uint64_t reserved_44_63:20; | ||
1528 | uint64_t pbp:1; | ||
1529 | uint64_t rsv_f:5; | ||
1530 | uint64_t rparmode:2; | ||
1531 | uint64_t rsv_e:1; | ||
1532 | uint64_t rskp_len:7; | ||
1533 | uint64_t rsv_d:6; | ||
1534 | uint64_t use_ihdr:1; | ||
1535 | uint64_t rsv_c:5; | ||
1536 | uint64_t par_mode:2; | ||
1537 | uint64_t rsv_b:1; | ||
1538 | uint64_t skp_len:7; | ||
1539 | uint64_t rsv_a:6; | ||
1540 | } s; | ||
1541 | struct cvmx_npi_port35_instr_hdr_s cn38xx; | ||
1542 | struct cvmx_npi_port35_instr_hdr_s cn38xxp2; | ||
1543 | struct cvmx_npi_port35_instr_hdr_s cn58xx; | ||
1544 | struct cvmx_npi_port35_instr_hdr_s cn58xxp1; | ||
1545 | }; | ||
1546 | |||
1547 | union cvmx_npi_port_bp_control { | ||
1548 | uint64_t u64; | ||
1549 | struct cvmx_npi_port_bp_control_s { | ||
1550 | uint64_t reserved_8_63:56; | ||
1551 | uint64_t bp_on:4; | ||
1552 | uint64_t enb:4; | ||
1553 | } s; | ||
1554 | struct cvmx_npi_port_bp_control_s cn30xx; | ||
1555 | struct cvmx_npi_port_bp_control_s cn31xx; | ||
1556 | struct cvmx_npi_port_bp_control_s cn38xx; | ||
1557 | struct cvmx_npi_port_bp_control_s cn38xxp2; | ||
1558 | struct cvmx_npi_port_bp_control_s cn50xx; | ||
1559 | struct cvmx_npi_port_bp_control_s cn58xx; | ||
1560 | struct cvmx_npi_port_bp_control_s cn58xxp1; | ||
1561 | }; | ||
1562 | |||
1563 | union cvmx_npi_rsl_int_blocks { | ||
1564 | uint64_t u64; | ||
1565 | struct cvmx_npi_rsl_int_blocks_s { | ||
1566 | uint64_t reserved_32_63:32; | ||
1567 | uint64_t rint_31:1; | ||
1568 | uint64_t iob:1; | ||
1569 | uint64_t reserved_28_29:2; | ||
1570 | uint64_t rint_27:1; | ||
1571 | uint64_t rint_26:1; | ||
1572 | uint64_t rint_25:1; | ||
1573 | uint64_t rint_24:1; | ||
1574 | uint64_t asx1:1; | ||
1575 | uint64_t asx0:1; | ||
1576 | uint64_t rint_21:1; | ||
1577 | uint64_t pip:1; | ||
1578 | uint64_t spx1:1; | ||
1579 | uint64_t spx0:1; | ||
1580 | uint64_t lmc:1; | ||
1581 | uint64_t l2c:1; | ||
1582 | uint64_t rint_15:1; | ||
1583 | uint64_t reserved_13_14:2; | ||
1584 | uint64_t pow:1; | ||
1585 | uint64_t tim:1; | ||
1586 | uint64_t pko:1; | ||
1587 | uint64_t ipd:1; | ||
1588 | uint64_t rint_8:1; | ||
1589 | uint64_t zip:1; | ||
1590 | uint64_t dfa:1; | ||
1591 | uint64_t fpa:1; | ||
1592 | uint64_t key:1; | ||
1593 | uint64_t npi:1; | ||
1594 | uint64_t gmx1:1; | ||
1595 | uint64_t gmx0:1; | ||
1596 | uint64_t mio:1; | ||
1597 | } s; | ||
1598 | struct cvmx_npi_rsl_int_blocks_cn30xx { | ||
1599 | uint64_t reserved_32_63:32; | ||
1600 | uint64_t rint_31:1; | ||
1601 | uint64_t iob:1; | ||
1602 | uint64_t rint_29:1; | ||
1603 | uint64_t rint_28:1; | ||
1604 | uint64_t rint_27:1; | ||
1605 | uint64_t rint_26:1; | ||
1606 | uint64_t rint_25:1; | ||
1607 | uint64_t rint_24:1; | ||
1608 | uint64_t asx1:1; | ||
1609 | uint64_t asx0:1; | ||
1610 | uint64_t rint_21:1; | ||
1611 | uint64_t pip:1; | ||
1612 | uint64_t spx1:1; | ||
1613 | uint64_t spx0:1; | ||
1614 | uint64_t lmc:1; | ||
1615 | uint64_t l2c:1; | ||
1616 | uint64_t rint_15:1; | ||
1617 | uint64_t rint_14:1; | ||
1618 | uint64_t usb:1; | ||
1619 | uint64_t pow:1; | ||
1620 | uint64_t tim:1; | ||
1621 | uint64_t pko:1; | ||
1622 | uint64_t ipd:1; | ||
1623 | uint64_t rint_8:1; | ||
1624 | uint64_t zip:1; | ||
1625 | uint64_t dfa:1; | ||
1626 | uint64_t fpa:1; | ||
1627 | uint64_t key:1; | ||
1628 | uint64_t npi:1; | ||
1629 | uint64_t gmx1:1; | ||
1630 | uint64_t gmx0:1; | ||
1631 | uint64_t mio:1; | ||
1632 | } cn30xx; | ||
1633 | struct cvmx_npi_rsl_int_blocks_cn30xx cn31xx; | ||
1634 | struct cvmx_npi_rsl_int_blocks_cn38xx { | ||
1635 | uint64_t reserved_32_63:32; | ||
1636 | uint64_t rint_31:1; | ||
1637 | uint64_t iob:1; | ||
1638 | uint64_t rint_29:1; | ||
1639 | uint64_t rint_28:1; | ||
1640 | uint64_t rint_27:1; | ||
1641 | uint64_t rint_26:1; | ||
1642 | uint64_t rint_25:1; | ||
1643 | uint64_t rint_24:1; | ||
1644 | uint64_t asx1:1; | ||
1645 | uint64_t asx0:1; | ||
1646 | uint64_t rint_21:1; | ||
1647 | uint64_t pip:1; | ||
1648 | uint64_t spx1:1; | ||
1649 | uint64_t spx0:1; | ||
1650 | uint64_t lmc:1; | ||
1651 | uint64_t l2c:1; | ||
1652 | uint64_t rint_15:1; | ||
1653 | uint64_t rint_14:1; | ||
1654 | uint64_t rint_13:1; | ||
1655 | uint64_t pow:1; | ||
1656 | uint64_t tim:1; | ||
1657 | uint64_t pko:1; | ||
1658 | uint64_t ipd:1; | ||
1659 | uint64_t rint_8:1; | ||
1660 | uint64_t zip:1; | ||
1661 | uint64_t dfa:1; | ||
1662 | uint64_t fpa:1; | ||
1663 | uint64_t key:1; | ||
1664 | uint64_t npi:1; | ||
1665 | uint64_t gmx1:1; | ||
1666 | uint64_t gmx0:1; | ||
1667 | uint64_t mio:1; | ||
1668 | } cn38xx; | ||
1669 | struct cvmx_npi_rsl_int_blocks_cn38xx cn38xxp2; | ||
1670 | struct cvmx_npi_rsl_int_blocks_cn50xx { | ||
1671 | uint64_t reserved_31_63:33; | ||
1672 | uint64_t iob:1; | ||
1673 | uint64_t lmc1:1; | ||
1674 | uint64_t agl:1; | ||
1675 | uint64_t reserved_24_27:4; | ||
1676 | uint64_t asx1:1; | ||
1677 | uint64_t asx0:1; | ||
1678 | uint64_t reserved_21_21:1; | ||
1679 | uint64_t pip:1; | ||
1680 | uint64_t spx1:1; | ||
1681 | uint64_t spx0:1; | ||
1682 | uint64_t lmc:1; | ||
1683 | uint64_t l2c:1; | ||
1684 | uint64_t reserved_15_15:1; | ||
1685 | uint64_t rad:1; | ||
1686 | uint64_t usb:1; | ||
1687 | uint64_t pow:1; | ||
1688 | uint64_t tim:1; | ||
1689 | uint64_t pko:1; | ||
1690 | uint64_t ipd:1; | ||
1691 | uint64_t reserved_8_8:1; | ||
1692 | uint64_t zip:1; | ||
1693 | uint64_t dfa:1; | ||
1694 | uint64_t fpa:1; | ||
1695 | uint64_t key:1; | ||
1696 | uint64_t npi:1; | ||
1697 | uint64_t gmx1:1; | ||
1698 | uint64_t gmx0:1; | ||
1699 | uint64_t mio:1; | ||
1700 | } cn50xx; | ||
1701 | struct cvmx_npi_rsl_int_blocks_cn38xx cn58xx; | ||
1702 | struct cvmx_npi_rsl_int_blocks_cn38xx cn58xxp1; | ||
1703 | }; | ||
1704 | |||
1705 | union cvmx_npi_size_inputx { | ||
1706 | uint64_t u64; | ||
1707 | struct cvmx_npi_size_inputx_s { | ||
1708 | uint64_t reserved_32_63:32; | ||
1709 | uint64_t size:32; | ||
1710 | } s; | ||
1711 | struct cvmx_npi_size_inputx_s cn30xx; | ||
1712 | struct cvmx_npi_size_inputx_s cn31xx; | ||
1713 | struct cvmx_npi_size_inputx_s cn38xx; | ||
1714 | struct cvmx_npi_size_inputx_s cn38xxp2; | ||
1715 | struct cvmx_npi_size_inputx_s cn50xx; | ||
1716 | struct cvmx_npi_size_inputx_s cn58xx; | ||
1717 | struct cvmx_npi_size_inputx_s cn58xxp1; | ||
1718 | }; | ||
1719 | |||
1720 | union cvmx_npi_win_read_to { | ||
1721 | uint64_t u64; | ||
1722 | struct cvmx_npi_win_read_to_s { | ||
1723 | uint64_t reserved_32_63:32; | ||
1724 | uint64_t time:32; | ||
1725 | } s; | ||
1726 | struct cvmx_npi_win_read_to_s cn30xx; | ||
1727 | struct cvmx_npi_win_read_to_s cn31xx; | ||
1728 | struct cvmx_npi_win_read_to_s cn38xx; | ||
1729 | struct cvmx_npi_win_read_to_s cn38xxp2; | ||
1730 | struct cvmx_npi_win_read_to_s cn50xx; | ||
1731 | struct cvmx_npi_win_read_to_s cn58xx; | ||
1732 | struct cvmx_npi_win_read_to_s cn58xxp1; | ||
1733 | }; | ||
1734 | |||
1735 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-pci-defs.h b/arch/mips/include/asm/octeon/cvmx-pci-defs.h new file mode 100644 index 000000000000..90f8d6535753 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-pci-defs.h | |||
@@ -0,0 +1,1645 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_PCI_DEFS_H__ | ||
29 | #define __CVMX_PCI_DEFS_H__ | ||
30 | |||
31 | #define CVMX_PCI_BAR1_INDEXX(offset) \ | ||
32 | (0x0000000000000100ull + (((offset) & 31) * 4)) | ||
33 | #define CVMX_PCI_BIST_REG \ | ||
34 | (0x00000000000001C0ull) | ||
35 | #define CVMX_PCI_CFG00 \ | ||
36 | (0x0000000000000000ull) | ||
37 | #define CVMX_PCI_CFG01 \ | ||
38 | (0x0000000000000004ull) | ||
39 | #define CVMX_PCI_CFG02 \ | ||
40 | (0x0000000000000008ull) | ||
41 | #define CVMX_PCI_CFG03 \ | ||
42 | (0x000000000000000Cull) | ||
43 | #define CVMX_PCI_CFG04 \ | ||
44 | (0x0000000000000010ull) | ||
45 | #define CVMX_PCI_CFG05 \ | ||
46 | (0x0000000000000014ull) | ||
47 | #define CVMX_PCI_CFG06 \ | ||
48 | (0x0000000000000018ull) | ||
49 | #define CVMX_PCI_CFG07 \ | ||
50 | (0x000000000000001Cull) | ||
51 | #define CVMX_PCI_CFG08 \ | ||
52 | (0x0000000000000020ull) | ||
53 | #define CVMX_PCI_CFG09 \ | ||
54 | (0x0000000000000024ull) | ||
55 | #define CVMX_PCI_CFG10 \ | ||
56 | (0x0000000000000028ull) | ||
57 | #define CVMX_PCI_CFG11 \ | ||
58 | (0x000000000000002Cull) | ||
59 | #define CVMX_PCI_CFG12 \ | ||
60 | (0x0000000000000030ull) | ||
61 | #define CVMX_PCI_CFG13 \ | ||
62 | (0x0000000000000034ull) | ||
63 | #define CVMX_PCI_CFG15 \ | ||
64 | (0x000000000000003Cull) | ||
65 | #define CVMX_PCI_CFG16 \ | ||
66 | (0x0000000000000040ull) | ||
67 | #define CVMX_PCI_CFG17 \ | ||
68 | (0x0000000000000044ull) | ||
69 | #define CVMX_PCI_CFG18 \ | ||
70 | (0x0000000000000048ull) | ||
71 | #define CVMX_PCI_CFG19 \ | ||
72 | (0x000000000000004Cull) | ||
73 | #define CVMX_PCI_CFG20 \ | ||
74 | (0x0000000000000050ull) | ||
75 | #define CVMX_PCI_CFG21 \ | ||
76 | (0x0000000000000054ull) | ||
77 | #define CVMX_PCI_CFG22 \ | ||
78 | (0x0000000000000058ull) | ||
79 | #define CVMX_PCI_CFG56 \ | ||
80 | (0x00000000000000E0ull) | ||
81 | #define CVMX_PCI_CFG57 \ | ||
82 | (0x00000000000000E4ull) | ||
83 | #define CVMX_PCI_CFG58 \ | ||
84 | (0x00000000000000E8ull) | ||
85 | #define CVMX_PCI_CFG59 \ | ||
86 | (0x00000000000000ECull) | ||
87 | #define CVMX_PCI_CFG60 \ | ||
88 | (0x00000000000000F0ull) | ||
89 | #define CVMX_PCI_CFG61 \ | ||
90 | (0x00000000000000F4ull) | ||
91 | #define CVMX_PCI_CFG62 \ | ||
92 | (0x00000000000000F8ull) | ||
93 | #define CVMX_PCI_CFG63 \ | ||
94 | (0x00000000000000FCull) | ||
95 | #define CVMX_PCI_CNT_REG \ | ||
96 | (0x00000000000001B8ull) | ||
97 | #define CVMX_PCI_CTL_STATUS_2 \ | ||
98 | (0x000000000000018Cull) | ||
99 | #define CVMX_PCI_DBELL_0 \ | ||
100 | (0x0000000000000080ull) | ||
101 | #define CVMX_PCI_DBELL_1 \ | ||
102 | (0x0000000000000088ull) | ||
103 | #define CVMX_PCI_DBELL_2 \ | ||
104 | (0x0000000000000090ull) | ||
105 | #define CVMX_PCI_DBELL_3 \ | ||
106 | (0x0000000000000098ull) | ||
107 | #define CVMX_PCI_DBELL_X(offset) \ | ||
108 | (0x0000000000000080ull + (((offset) & 3) * 8)) | ||
109 | #define CVMX_PCI_DMA_CNT0 \ | ||
110 | (0x00000000000000A0ull) | ||
111 | #define CVMX_PCI_DMA_CNT1 \ | ||
112 | (0x00000000000000A8ull) | ||
113 | #define CVMX_PCI_DMA_CNTX(offset) \ | ||
114 | (0x00000000000000A0ull + (((offset) & 1) * 8)) | ||
115 | #define CVMX_PCI_DMA_INT_LEV0 \ | ||
116 | (0x00000000000000A4ull) | ||
117 | #define CVMX_PCI_DMA_INT_LEV1 \ | ||
118 | (0x00000000000000ACull) | ||
119 | #define CVMX_PCI_DMA_INT_LEVX(offset) \ | ||
120 | (0x00000000000000A4ull + (((offset) & 1) * 8)) | ||
121 | #define CVMX_PCI_DMA_TIME0 \ | ||
122 | (0x00000000000000B0ull) | ||
123 | #define CVMX_PCI_DMA_TIME1 \ | ||
124 | (0x00000000000000B4ull) | ||
125 | #define CVMX_PCI_DMA_TIMEX(offset) \ | ||
126 | (0x00000000000000B0ull + (((offset) & 1) * 4)) | ||
127 | #define CVMX_PCI_INSTR_COUNT0 \ | ||
128 | (0x0000000000000084ull) | ||
129 | #define CVMX_PCI_INSTR_COUNT1 \ | ||
130 | (0x000000000000008Cull) | ||
131 | #define CVMX_PCI_INSTR_COUNT2 \ | ||
132 | (0x0000000000000094ull) | ||
133 | #define CVMX_PCI_INSTR_COUNT3 \ | ||
134 | (0x000000000000009Cull) | ||
135 | #define CVMX_PCI_INSTR_COUNTX(offset) \ | ||
136 | (0x0000000000000084ull + (((offset) & 3) * 8)) | ||
137 | #define CVMX_PCI_INT_ENB \ | ||
138 | (0x0000000000000038ull) | ||
139 | #define CVMX_PCI_INT_ENB2 \ | ||
140 | (0x00000000000001A0ull) | ||
141 | #define CVMX_PCI_INT_SUM \ | ||
142 | (0x0000000000000030ull) | ||
143 | #define CVMX_PCI_INT_SUM2 \ | ||
144 | (0x0000000000000198ull) | ||
145 | #define CVMX_PCI_MSI_RCV \ | ||
146 | (0x00000000000000F0ull) | ||
147 | #define CVMX_PCI_PKTS_SENT0 \ | ||
148 | (0x0000000000000040ull) | ||
149 | #define CVMX_PCI_PKTS_SENT1 \ | ||
150 | (0x0000000000000050ull) | ||
151 | #define CVMX_PCI_PKTS_SENT2 \ | ||
152 | (0x0000000000000060ull) | ||
153 | #define CVMX_PCI_PKTS_SENT3 \ | ||
154 | (0x0000000000000070ull) | ||
155 | #define CVMX_PCI_PKTS_SENTX(offset) \ | ||
156 | (0x0000000000000040ull + (((offset) & 3) * 16)) | ||
157 | #define CVMX_PCI_PKTS_SENT_INT_LEV0 \ | ||
158 | (0x0000000000000048ull) | ||
159 | #define CVMX_PCI_PKTS_SENT_INT_LEV1 \ | ||
160 | (0x0000000000000058ull) | ||
161 | #define CVMX_PCI_PKTS_SENT_INT_LEV2 \ | ||
162 | (0x0000000000000068ull) | ||
163 | #define CVMX_PCI_PKTS_SENT_INT_LEV3 \ | ||
164 | (0x0000000000000078ull) | ||
165 | #define CVMX_PCI_PKTS_SENT_INT_LEVX(offset) \ | ||
166 | (0x0000000000000048ull + (((offset) & 3) * 16)) | ||
167 | #define CVMX_PCI_PKTS_SENT_TIME0 \ | ||
168 | (0x000000000000004Cull) | ||
169 | #define CVMX_PCI_PKTS_SENT_TIME1 \ | ||
170 | (0x000000000000005Cull) | ||
171 | #define CVMX_PCI_PKTS_SENT_TIME2 \ | ||
172 | (0x000000000000006Cull) | ||
173 | #define CVMX_PCI_PKTS_SENT_TIME3 \ | ||
174 | (0x000000000000007Cull) | ||
175 | #define CVMX_PCI_PKTS_SENT_TIMEX(offset) \ | ||
176 | (0x000000000000004Cull + (((offset) & 3) * 16)) | ||
177 | #define CVMX_PCI_PKT_CREDITS0 \ | ||
178 | (0x0000000000000044ull) | ||
179 | #define CVMX_PCI_PKT_CREDITS1 \ | ||
180 | (0x0000000000000054ull) | ||
181 | #define CVMX_PCI_PKT_CREDITS2 \ | ||
182 | (0x0000000000000064ull) | ||
183 | #define CVMX_PCI_PKT_CREDITS3 \ | ||
184 | (0x0000000000000074ull) | ||
185 | #define CVMX_PCI_PKT_CREDITSX(offset) \ | ||
186 | (0x0000000000000044ull + (((offset) & 3) * 16)) | ||
187 | #define CVMX_PCI_READ_CMD_6 \ | ||
188 | (0x0000000000000180ull) | ||
189 | #define CVMX_PCI_READ_CMD_C \ | ||
190 | (0x0000000000000184ull) | ||
191 | #define CVMX_PCI_READ_CMD_E \ | ||
192 | (0x0000000000000188ull) | ||
193 | #define CVMX_PCI_READ_TIMEOUT \ | ||
194 | CVMX_ADD_IO_SEG(0x00011F00000000B0ull) | ||
195 | #define CVMX_PCI_SCM_REG \ | ||
196 | (0x00000000000001A8ull) | ||
197 | #define CVMX_PCI_TSR_REG \ | ||
198 | (0x00000000000001B0ull) | ||
199 | #define CVMX_PCI_WIN_RD_ADDR \ | ||
200 | (0x0000000000000008ull) | ||
201 | #define CVMX_PCI_WIN_RD_DATA \ | ||
202 | (0x0000000000000020ull) | ||
203 | #define CVMX_PCI_WIN_WR_ADDR \ | ||
204 | (0x0000000000000000ull) | ||
205 | #define CVMX_PCI_WIN_WR_DATA \ | ||
206 | (0x0000000000000010ull) | ||
207 | #define CVMX_PCI_WIN_WR_MASK \ | ||
208 | (0x0000000000000018ull) | ||
209 | |||
210 | union cvmx_pci_bar1_indexx { | ||
211 | uint32_t u32; | ||
212 | struct cvmx_pci_bar1_indexx_s { | ||
213 | uint32_t reserved_18_31:14; | ||
214 | uint32_t addr_idx:14; | ||
215 | uint32_t ca:1; | ||
216 | uint32_t end_swp:2; | ||
217 | uint32_t addr_v:1; | ||
218 | } s; | ||
219 | struct cvmx_pci_bar1_indexx_s cn30xx; | ||
220 | struct cvmx_pci_bar1_indexx_s cn31xx; | ||
221 | struct cvmx_pci_bar1_indexx_s cn38xx; | ||
222 | struct cvmx_pci_bar1_indexx_s cn38xxp2; | ||
223 | struct cvmx_pci_bar1_indexx_s cn50xx; | ||
224 | struct cvmx_pci_bar1_indexx_s cn58xx; | ||
225 | struct cvmx_pci_bar1_indexx_s cn58xxp1; | ||
226 | }; | ||
227 | |||
228 | union cvmx_pci_bist_reg { | ||
229 | uint64_t u64; | ||
230 | struct cvmx_pci_bist_reg_s { | ||
231 | uint64_t reserved_10_63:54; | ||
232 | uint64_t rsp_bs:1; | ||
233 | uint64_t dma0_bs:1; | ||
234 | uint64_t cmd0_bs:1; | ||
235 | uint64_t cmd_bs:1; | ||
236 | uint64_t csr2p_bs:1; | ||
237 | uint64_t csrr_bs:1; | ||
238 | uint64_t rsp2p_bs:1; | ||
239 | uint64_t csr2n_bs:1; | ||
240 | uint64_t dat2n_bs:1; | ||
241 | uint64_t dbg2n_bs:1; | ||
242 | } s; | ||
243 | struct cvmx_pci_bist_reg_s cn50xx; | ||
244 | }; | ||
245 | |||
246 | union cvmx_pci_cfg00 { | ||
247 | uint32_t u32; | ||
248 | struct cvmx_pci_cfg00_s { | ||
249 | uint32_t devid:16; | ||
250 | uint32_t vendid:16; | ||
251 | } s; | ||
252 | struct cvmx_pci_cfg00_s cn30xx; | ||
253 | struct cvmx_pci_cfg00_s cn31xx; | ||
254 | struct cvmx_pci_cfg00_s cn38xx; | ||
255 | struct cvmx_pci_cfg00_s cn38xxp2; | ||
256 | struct cvmx_pci_cfg00_s cn50xx; | ||
257 | struct cvmx_pci_cfg00_s cn58xx; | ||
258 | struct cvmx_pci_cfg00_s cn58xxp1; | ||
259 | }; | ||
260 | |||
261 | union cvmx_pci_cfg01 { | ||
262 | uint32_t u32; | ||
263 | struct cvmx_pci_cfg01_s { | ||
264 | uint32_t dpe:1; | ||
265 | uint32_t sse:1; | ||
266 | uint32_t rma:1; | ||
267 | uint32_t rta:1; | ||
268 | uint32_t sta:1; | ||
269 | uint32_t devt:2; | ||
270 | uint32_t mdpe:1; | ||
271 | uint32_t fbb:1; | ||
272 | uint32_t reserved_22_22:1; | ||
273 | uint32_t m66:1; | ||
274 | uint32_t cle:1; | ||
275 | uint32_t i_stat:1; | ||
276 | uint32_t reserved_11_18:8; | ||
277 | uint32_t i_dis:1; | ||
278 | uint32_t fbbe:1; | ||
279 | uint32_t see:1; | ||
280 | uint32_t ads:1; | ||
281 | uint32_t pee:1; | ||
282 | uint32_t vps:1; | ||
283 | uint32_t mwice:1; | ||
284 | uint32_t scse:1; | ||
285 | uint32_t me:1; | ||
286 | uint32_t msae:1; | ||
287 | uint32_t isae:1; | ||
288 | } s; | ||
289 | struct cvmx_pci_cfg01_s cn30xx; | ||
290 | struct cvmx_pci_cfg01_s cn31xx; | ||
291 | struct cvmx_pci_cfg01_s cn38xx; | ||
292 | struct cvmx_pci_cfg01_s cn38xxp2; | ||
293 | struct cvmx_pci_cfg01_s cn50xx; | ||
294 | struct cvmx_pci_cfg01_s cn58xx; | ||
295 | struct cvmx_pci_cfg01_s cn58xxp1; | ||
296 | }; | ||
297 | |||
298 | union cvmx_pci_cfg02 { | ||
299 | uint32_t u32; | ||
300 | struct cvmx_pci_cfg02_s { | ||
301 | uint32_t cc:24; | ||
302 | uint32_t rid:8; | ||
303 | } s; | ||
304 | struct cvmx_pci_cfg02_s cn30xx; | ||
305 | struct cvmx_pci_cfg02_s cn31xx; | ||
306 | struct cvmx_pci_cfg02_s cn38xx; | ||
307 | struct cvmx_pci_cfg02_s cn38xxp2; | ||
308 | struct cvmx_pci_cfg02_s cn50xx; | ||
309 | struct cvmx_pci_cfg02_s cn58xx; | ||
310 | struct cvmx_pci_cfg02_s cn58xxp1; | ||
311 | }; | ||
312 | |||
313 | union cvmx_pci_cfg03 { | ||
314 | uint32_t u32; | ||
315 | struct cvmx_pci_cfg03_s { | ||
316 | uint32_t bcap:1; | ||
317 | uint32_t brb:1; | ||
318 | uint32_t reserved_28_29:2; | ||
319 | uint32_t bcod:4; | ||
320 | uint32_t ht:8; | ||
321 | uint32_t lt:8; | ||
322 | uint32_t cls:8; | ||
323 | } s; | ||
324 | struct cvmx_pci_cfg03_s cn30xx; | ||
325 | struct cvmx_pci_cfg03_s cn31xx; | ||
326 | struct cvmx_pci_cfg03_s cn38xx; | ||
327 | struct cvmx_pci_cfg03_s cn38xxp2; | ||
328 | struct cvmx_pci_cfg03_s cn50xx; | ||
329 | struct cvmx_pci_cfg03_s cn58xx; | ||
330 | struct cvmx_pci_cfg03_s cn58xxp1; | ||
331 | }; | ||
332 | |||
333 | union cvmx_pci_cfg04 { | ||
334 | uint32_t u32; | ||
335 | struct cvmx_pci_cfg04_s { | ||
336 | uint32_t lbase:20; | ||
337 | uint32_t lbasez:8; | ||
338 | uint32_t pf:1; | ||
339 | uint32_t typ:2; | ||
340 | uint32_t mspc:1; | ||
341 | } s; | ||
342 | struct cvmx_pci_cfg04_s cn30xx; | ||
343 | struct cvmx_pci_cfg04_s cn31xx; | ||
344 | struct cvmx_pci_cfg04_s cn38xx; | ||
345 | struct cvmx_pci_cfg04_s cn38xxp2; | ||
346 | struct cvmx_pci_cfg04_s cn50xx; | ||
347 | struct cvmx_pci_cfg04_s cn58xx; | ||
348 | struct cvmx_pci_cfg04_s cn58xxp1; | ||
349 | }; | ||
350 | |||
351 | union cvmx_pci_cfg05 { | ||
352 | uint32_t u32; | ||
353 | struct cvmx_pci_cfg05_s { | ||
354 | uint32_t hbase:32; | ||
355 | } s; | ||
356 | struct cvmx_pci_cfg05_s cn30xx; | ||
357 | struct cvmx_pci_cfg05_s cn31xx; | ||
358 | struct cvmx_pci_cfg05_s cn38xx; | ||
359 | struct cvmx_pci_cfg05_s cn38xxp2; | ||
360 | struct cvmx_pci_cfg05_s cn50xx; | ||
361 | struct cvmx_pci_cfg05_s cn58xx; | ||
362 | struct cvmx_pci_cfg05_s cn58xxp1; | ||
363 | }; | ||
364 | |||
365 | union cvmx_pci_cfg06 { | ||
366 | uint32_t u32; | ||
367 | struct cvmx_pci_cfg06_s { | ||
368 | uint32_t lbase:5; | ||
369 | uint32_t lbasez:23; | ||
370 | uint32_t pf:1; | ||
371 | uint32_t typ:2; | ||
372 | uint32_t mspc:1; | ||
373 | } s; | ||
374 | struct cvmx_pci_cfg06_s cn30xx; | ||
375 | struct cvmx_pci_cfg06_s cn31xx; | ||
376 | struct cvmx_pci_cfg06_s cn38xx; | ||
377 | struct cvmx_pci_cfg06_s cn38xxp2; | ||
378 | struct cvmx_pci_cfg06_s cn50xx; | ||
379 | struct cvmx_pci_cfg06_s cn58xx; | ||
380 | struct cvmx_pci_cfg06_s cn58xxp1; | ||
381 | }; | ||
382 | |||
383 | union cvmx_pci_cfg07 { | ||
384 | uint32_t u32; | ||
385 | struct cvmx_pci_cfg07_s { | ||
386 | uint32_t hbase:32; | ||
387 | } s; | ||
388 | struct cvmx_pci_cfg07_s cn30xx; | ||
389 | struct cvmx_pci_cfg07_s cn31xx; | ||
390 | struct cvmx_pci_cfg07_s cn38xx; | ||
391 | struct cvmx_pci_cfg07_s cn38xxp2; | ||
392 | struct cvmx_pci_cfg07_s cn50xx; | ||
393 | struct cvmx_pci_cfg07_s cn58xx; | ||
394 | struct cvmx_pci_cfg07_s cn58xxp1; | ||
395 | }; | ||
396 | |||
397 | union cvmx_pci_cfg08 { | ||
398 | uint32_t u32; | ||
399 | struct cvmx_pci_cfg08_s { | ||
400 | uint32_t lbasez:28; | ||
401 | uint32_t pf:1; | ||
402 | uint32_t typ:2; | ||
403 | uint32_t mspc:1; | ||
404 | } s; | ||
405 | struct cvmx_pci_cfg08_s cn30xx; | ||
406 | struct cvmx_pci_cfg08_s cn31xx; | ||
407 | struct cvmx_pci_cfg08_s cn38xx; | ||
408 | struct cvmx_pci_cfg08_s cn38xxp2; | ||
409 | struct cvmx_pci_cfg08_s cn50xx; | ||
410 | struct cvmx_pci_cfg08_s cn58xx; | ||
411 | struct cvmx_pci_cfg08_s cn58xxp1; | ||
412 | }; | ||
413 | |||
414 | union cvmx_pci_cfg09 { | ||
415 | uint32_t u32; | ||
416 | struct cvmx_pci_cfg09_s { | ||
417 | uint32_t hbase:25; | ||
418 | uint32_t hbasez:7; | ||
419 | } s; | ||
420 | struct cvmx_pci_cfg09_s cn30xx; | ||
421 | struct cvmx_pci_cfg09_s cn31xx; | ||
422 | struct cvmx_pci_cfg09_s cn38xx; | ||
423 | struct cvmx_pci_cfg09_s cn38xxp2; | ||
424 | struct cvmx_pci_cfg09_s cn50xx; | ||
425 | struct cvmx_pci_cfg09_s cn58xx; | ||
426 | struct cvmx_pci_cfg09_s cn58xxp1; | ||
427 | }; | ||
428 | |||
429 | union cvmx_pci_cfg10 { | ||
430 | uint32_t u32; | ||
431 | struct cvmx_pci_cfg10_s { | ||
432 | uint32_t cisp:32; | ||
433 | } s; | ||
434 | struct cvmx_pci_cfg10_s cn30xx; | ||
435 | struct cvmx_pci_cfg10_s cn31xx; | ||
436 | struct cvmx_pci_cfg10_s cn38xx; | ||
437 | struct cvmx_pci_cfg10_s cn38xxp2; | ||
438 | struct cvmx_pci_cfg10_s cn50xx; | ||
439 | struct cvmx_pci_cfg10_s cn58xx; | ||
440 | struct cvmx_pci_cfg10_s cn58xxp1; | ||
441 | }; | ||
442 | |||
443 | union cvmx_pci_cfg11 { | ||
444 | uint32_t u32; | ||
445 | struct cvmx_pci_cfg11_s { | ||
446 | uint32_t ssid:16; | ||
447 | uint32_t ssvid:16; | ||
448 | } s; | ||
449 | struct cvmx_pci_cfg11_s cn30xx; | ||
450 | struct cvmx_pci_cfg11_s cn31xx; | ||
451 | struct cvmx_pci_cfg11_s cn38xx; | ||
452 | struct cvmx_pci_cfg11_s cn38xxp2; | ||
453 | struct cvmx_pci_cfg11_s cn50xx; | ||
454 | struct cvmx_pci_cfg11_s cn58xx; | ||
455 | struct cvmx_pci_cfg11_s cn58xxp1; | ||
456 | }; | ||
457 | |||
458 | union cvmx_pci_cfg12 { | ||
459 | uint32_t u32; | ||
460 | struct cvmx_pci_cfg12_s { | ||
461 | uint32_t erbar:16; | ||
462 | uint32_t erbarz:5; | ||
463 | uint32_t reserved_1_10:10; | ||
464 | uint32_t erbar_en:1; | ||
465 | } s; | ||
466 | struct cvmx_pci_cfg12_s cn30xx; | ||
467 | struct cvmx_pci_cfg12_s cn31xx; | ||
468 | struct cvmx_pci_cfg12_s cn38xx; | ||
469 | struct cvmx_pci_cfg12_s cn38xxp2; | ||
470 | struct cvmx_pci_cfg12_s cn50xx; | ||
471 | struct cvmx_pci_cfg12_s cn58xx; | ||
472 | struct cvmx_pci_cfg12_s cn58xxp1; | ||
473 | }; | ||
474 | |||
475 | union cvmx_pci_cfg13 { | ||
476 | uint32_t u32; | ||
477 | struct cvmx_pci_cfg13_s { | ||
478 | uint32_t reserved_8_31:24; | ||
479 | uint32_t cp:8; | ||
480 | } s; | ||
481 | struct cvmx_pci_cfg13_s cn30xx; | ||
482 | struct cvmx_pci_cfg13_s cn31xx; | ||
483 | struct cvmx_pci_cfg13_s cn38xx; | ||
484 | struct cvmx_pci_cfg13_s cn38xxp2; | ||
485 | struct cvmx_pci_cfg13_s cn50xx; | ||
486 | struct cvmx_pci_cfg13_s cn58xx; | ||
487 | struct cvmx_pci_cfg13_s cn58xxp1; | ||
488 | }; | ||
489 | |||
490 | union cvmx_pci_cfg15 { | ||
491 | uint32_t u32; | ||
492 | struct cvmx_pci_cfg15_s { | ||
493 | uint32_t ml:8; | ||
494 | uint32_t mg:8; | ||
495 | uint32_t inta:8; | ||
496 | uint32_t il:8; | ||
497 | } s; | ||
498 | struct cvmx_pci_cfg15_s cn30xx; | ||
499 | struct cvmx_pci_cfg15_s cn31xx; | ||
500 | struct cvmx_pci_cfg15_s cn38xx; | ||
501 | struct cvmx_pci_cfg15_s cn38xxp2; | ||
502 | struct cvmx_pci_cfg15_s cn50xx; | ||
503 | struct cvmx_pci_cfg15_s cn58xx; | ||
504 | struct cvmx_pci_cfg15_s cn58xxp1; | ||
505 | }; | ||
506 | |||
507 | union cvmx_pci_cfg16 { | ||
508 | uint32_t u32; | ||
509 | struct cvmx_pci_cfg16_s { | ||
510 | uint32_t trdnpr:1; | ||
511 | uint32_t trdard:1; | ||
512 | uint32_t rdsati:1; | ||
513 | uint32_t trdrs:1; | ||
514 | uint32_t trtae:1; | ||
515 | uint32_t twsei:1; | ||
516 | uint32_t twsen:1; | ||
517 | uint32_t twtae:1; | ||
518 | uint32_t tmae:1; | ||
519 | uint32_t tslte:3; | ||
520 | uint32_t tilt:4; | ||
521 | uint32_t pbe:12; | ||
522 | uint32_t dppmr:1; | ||
523 | uint32_t reserved_2_2:1; | ||
524 | uint32_t tswc:1; | ||
525 | uint32_t mltd:1; | ||
526 | } s; | ||
527 | struct cvmx_pci_cfg16_s cn30xx; | ||
528 | struct cvmx_pci_cfg16_s cn31xx; | ||
529 | struct cvmx_pci_cfg16_s cn38xx; | ||
530 | struct cvmx_pci_cfg16_s cn38xxp2; | ||
531 | struct cvmx_pci_cfg16_s cn50xx; | ||
532 | struct cvmx_pci_cfg16_s cn58xx; | ||
533 | struct cvmx_pci_cfg16_s cn58xxp1; | ||
534 | }; | ||
535 | |||
536 | union cvmx_pci_cfg17 { | ||
537 | uint32_t u32; | ||
538 | struct cvmx_pci_cfg17_s { | ||
539 | uint32_t tscme:32; | ||
540 | } s; | ||
541 | struct cvmx_pci_cfg17_s cn30xx; | ||
542 | struct cvmx_pci_cfg17_s cn31xx; | ||
543 | struct cvmx_pci_cfg17_s cn38xx; | ||
544 | struct cvmx_pci_cfg17_s cn38xxp2; | ||
545 | struct cvmx_pci_cfg17_s cn50xx; | ||
546 | struct cvmx_pci_cfg17_s cn58xx; | ||
547 | struct cvmx_pci_cfg17_s cn58xxp1; | ||
548 | }; | ||
549 | |||
550 | union cvmx_pci_cfg18 { | ||
551 | uint32_t u32; | ||
552 | struct cvmx_pci_cfg18_s { | ||
553 | uint32_t tdsrps:32; | ||
554 | } s; | ||
555 | struct cvmx_pci_cfg18_s cn30xx; | ||
556 | struct cvmx_pci_cfg18_s cn31xx; | ||
557 | struct cvmx_pci_cfg18_s cn38xx; | ||
558 | struct cvmx_pci_cfg18_s cn38xxp2; | ||
559 | struct cvmx_pci_cfg18_s cn50xx; | ||
560 | struct cvmx_pci_cfg18_s cn58xx; | ||
561 | struct cvmx_pci_cfg18_s cn58xxp1; | ||
562 | }; | ||
563 | |||
564 | union cvmx_pci_cfg19 { | ||
565 | uint32_t u32; | ||
566 | struct cvmx_pci_cfg19_s { | ||
567 | uint32_t mrbcm:1; | ||
568 | uint32_t mrbci:1; | ||
569 | uint32_t mdwe:1; | ||
570 | uint32_t mdre:1; | ||
571 | uint32_t mdrimc:1; | ||
572 | uint32_t mdrrmc:3; | ||
573 | uint32_t tmes:8; | ||
574 | uint32_t teci:1; | ||
575 | uint32_t tmei:1; | ||
576 | uint32_t tmse:1; | ||
577 | uint32_t tmdpes:1; | ||
578 | uint32_t tmapes:1; | ||
579 | uint32_t reserved_9_10:2; | ||
580 | uint32_t tibcd:1; | ||
581 | uint32_t tibde:1; | ||
582 | uint32_t reserved_6_6:1; | ||
583 | uint32_t tidomc:1; | ||
584 | uint32_t tdomc:5; | ||
585 | } s; | ||
586 | struct cvmx_pci_cfg19_s cn30xx; | ||
587 | struct cvmx_pci_cfg19_s cn31xx; | ||
588 | struct cvmx_pci_cfg19_s cn38xx; | ||
589 | struct cvmx_pci_cfg19_s cn38xxp2; | ||
590 | struct cvmx_pci_cfg19_s cn50xx; | ||
591 | struct cvmx_pci_cfg19_s cn58xx; | ||
592 | struct cvmx_pci_cfg19_s cn58xxp1; | ||
593 | }; | ||
594 | |||
595 | union cvmx_pci_cfg20 { | ||
596 | uint32_t u32; | ||
597 | struct cvmx_pci_cfg20_s { | ||
598 | uint32_t mdsp:32; | ||
599 | } s; | ||
600 | struct cvmx_pci_cfg20_s cn30xx; | ||
601 | struct cvmx_pci_cfg20_s cn31xx; | ||
602 | struct cvmx_pci_cfg20_s cn38xx; | ||
603 | struct cvmx_pci_cfg20_s cn38xxp2; | ||
604 | struct cvmx_pci_cfg20_s cn50xx; | ||
605 | struct cvmx_pci_cfg20_s cn58xx; | ||
606 | struct cvmx_pci_cfg20_s cn58xxp1; | ||
607 | }; | ||
608 | |||
609 | union cvmx_pci_cfg21 { | ||
610 | uint32_t u32; | ||
611 | struct cvmx_pci_cfg21_s { | ||
612 | uint32_t scmre:32; | ||
613 | } s; | ||
614 | struct cvmx_pci_cfg21_s cn30xx; | ||
615 | struct cvmx_pci_cfg21_s cn31xx; | ||
616 | struct cvmx_pci_cfg21_s cn38xx; | ||
617 | struct cvmx_pci_cfg21_s cn38xxp2; | ||
618 | struct cvmx_pci_cfg21_s cn50xx; | ||
619 | struct cvmx_pci_cfg21_s cn58xx; | ||
620 | struct cvmx_pci_cfg21_s cn58xxp1; | ||
621 | }; | ||
622 | |||
623 | union cvmx_pci_cfg22 { | ||
624 | uint32_t u32; | ||
625 | struct cvmx_pci_cfg22_s { | ||
626 | uint32_t mac:7; | ||
627 | uint32_t reserved_19_24:6; | ||
628 | uint32_t flush:1; | ||
629 | uint32_t mra:1; | ||
630 | uint32_t mtta:1; | ||
631 | uint32_t mrv:8; | ||
632 | uint32_t mttv:8; | ||
633 | } s; | ||
634 | struct cvmx_pci_cfg22_s cn30xx; | ||
635 | struct cvmx_pci_cfg22_s cn31xx; | ||
636 | struct cvmx_pci_cfg22_s cn38xx; | ||
637 | struct cvmx_pci_cfg22_s cn38xxp2; | ||
638 | struct cvmx_pci_cfg22_s cn50xx; | ||
639 | struct cvmx_pci_cfg22_s cn58xx; | ||
640 | struct cvmx_pci_cfg22_s cn58xxp1; | ||
641 | }; | ||
642 | |||
643 | union cvmx_pci_cfg56 { | ||
644 | uint32_t u32; | ||
645 | struct cvmx_pci_cfg56_s { | ||
646 | uint32_t reserved_23_31:9; | ||
647 | uint32_t most:3; | ||
648 | uint32_t mmbc:2; | ||
649 | uint32_t roe:1; | ||
650 | uint32_t dpere:1; | ||
651 | uint32_t ncp:8; | ||
652 | uint32_t pxcid:8; | ||
653 | } s; | ||
654 | struct cvmx_pci_cfg56_s cn30xx; | ||
655 | struct cvmx_pci_cfg56_s cn31xx; | ||
656 | struct cvmx_pci_cfg56_s cn38xx; | ||
657 | struct cvmx_pci_cfg56_s cn38xxp2; | ||
658 | struct cvmx_pci_cfg56_s cn50xx; | ||
659 | struct cvmx_pci_cfg56_s cn58xx; | ||
660 | struct cvmx_pci_cfg56_s cn58xxp1; | ||
661 | }; | ||
662 | |||
663 | union cvmx_pci_cfg57 { | ||
664 | uint32_t u32; | ||
665 | struct cvmx_pci_cfg57_s { | ||
666 | uint32_t reserved_30_31:2; | ||
667 | uint32_t scemr:1; | ||
668 | uint32_t mcrsd:3; | ||
669 | uint32_t mostd:3; | ||
670 | uint32_t mmrbcd:2; | ||
671 | uint32_t dc:1; | ||
672 | uint32_t usc:1; | ||
673 | uint32_t scd:1; | ||
674 | uint32_t m133:1; | ||
675 | uint32_t w64:1; | ||
676 | uint32_t bn:8; | ||
677 | uint32_t dn:5; | ||
678 | uint32_t fn:3; | ||
679 | } s; | ||
680 | struct cvmx_pci_cfg57_s cn30xx; | ||
681 | struct cvmx_pci_cfg57_s cn31xx; | ||
682 | struct cvmx_pci_cfg57_s cn38xx; | ||
683 | struct cvmx_pci_cfg57_s cn38xxp2; | ||
684 | struct cvmx_pci_cfg57_s cn50xx; | ||
685 | struct cvmx_pci_cfg57_s cn58xx; | ||
686 | struct cvmx_pci_cfg57_s cn58xxp1; | ||
687 | }; | ||
688 | |||
689 | union cvmx_pci_cfg58 { | ||
690 | uint32_t u32; | ||
691 | struct cvmx_pci_cfg58_s { | ||
692 | uint32_t pmes:5; | ||
693 | uint32_t d2s:1; | ||
694 | uint32_t d1s:1; | ||
695 | uint32_t auxc:3; | ||
696 | uint32_t dsi:1; | ||
697 | uint32_t reserved_20_20:1; | ||
698 | uint32_t pmec:1; | ||
699 | uint32_t pcimiv:3; | ||
700 | uint32_t ncp:8; | ||
701 | uint32_t pmcid:8; | ||
702 | } s; | ||
703 | struct cvmx_pci_cfg58_s cn30xx; | ||
704 | struct cvmx_pci_cfg58_s cn31xx; | ||
705 | struct cvmx_pci_cfg58_s cn38xx; | ||
706 | struct cvmx_pci_cfg58_s cn38xxp2; | ||
707 | struct cvmx_pci_cfg58_s cn50xx; | ||
708 | struct cvmx_pci_cfg58_s cn58xx; | ||
709 | struct cvmx_pci_cfg58_s cn58xxp1; | ||
710 | }; | ||
711 | |||
712 | union cvmx_pci_cfg59 { | ||
713 | uint32_t u32; | ||
714 | struct cvmx_pci_cfg59_s { | ||
715 | uint32_t pmdia:8; | ||
716 | uint32_t bpccen:1; | ||
717 | uint32_t bd3h:1; | ||
718 | uint32_t reserved_16_21:6; | ||
719 | uint32_t pmess:1; | ||
720 | uint32_t pmedsia:2; | ||
721 | uint32_t pmds:4; | ||
722 | uint32_t pmeens:1; | ||
723 | uint32_t reserved_2_7:6; | ||
724 | uint32_t ps:2; | ||
725 | } s; | ||
726 | struct cvmx_pci_cfg59_s cn30xx; | ||
727 | struct cvmx_pci_cfg59_s cn31xx; | ||
728 | struct cvmx_pci_cfg59_s cn38xx; | ||
729 | struct cvmx_pci_cfg59_s cn38xxp2; | ||
730 | struct cvmx_pci_cfg59_s cn50xx; | ||
731 | struct cvmx_pci_cfg59_s cn58xx; | ||
732 | struct cvmx_pci_cfg59_s cn58xxp1; | ||
733 | }; | ||
734 | |||
735 | union cvmx_pci_cfg60 { | ||
736 | uint32_t u32; | ||
737 | struct cvmx_pci_cfg60_s { | ||
738 | uint32_t reserved_24_31:8; | ||
739 | uint32_t m64:1; | ||
740 | uint32_t mme:3; | ||
741 | uint32_t mmc:3; | ||
742 | uint32_t msien:1; | ||
743 | uint32_t ncp:8; | ||
744 | uint32_t msicid:8; | ||
745 | } s; | ||
746 | struct cvmx_pci_cfg60_s cn30xx; | ||
747 | struct cvmx_pci_cfg60_s cn31xx; | ||
748 | struct cvmx_pci_cfg60_s cn38xx; | ||
749 | struct cvmx_pci_cfg60_s cn38xxp2; | ||
750 | struct cvmx_pci_cfg60_s cn50xx; | ||
751 | struct cvmx_pci_cfg60_s cn58xx; | ||
752 | struct cvmx_pci_cfg60_s cn58xxp1; | ||
753 | }; | ||
754 | |||
755 | union cvmx_pci_cfg61 { | ||
756 | uint32_t u32; | ||
757 | struct cvmx_pci_cfg61_s { | ||
758 | uint32_t msi31t2:30; | ||
759 | uint32_t reserved_0_1:2; | ||
760 | } s; | ||
761 | struct cvmx_pci_cfg61_s cn30xx; | ||
762 | struct cvmx_pci_cfg61_s cn31xx; | ||
763 | struct cvmx_pci_cfg61_s cn38xx; | ||
764 | struct cvmx_pci_cfg61_s cn38xxp2; | ||
765 | struct cvmx_pci_cfg61_s cn50xx; | ||
766 | struct cvmx_pci_cfg61_s cn58xx; | ||
767 | struct cvmx_pci_cfg61_s cn58xxp1; | ||
768 | }; | ||
769 | |||
770 | union cvmx_pci_cfg62 { | ||
771 | uint32_t u32; | ||
772 | struct cvmx_pci_cfg62_s { | ||
773 | uint32_t msi:32; | ||
774 | } s; | ||
775 | struct cvmx_pci_cfg62_s cn30xx; | ||
776 | struct cvmx_pci_cfg62_s cn31xx; | ||
777 | struct cvmx_pci_cfg62_s cn38xx; | ||
778 | struct cvmx_pci_cfg62_s cn38xxp2; | ||
779 | struct cvmx_pci_cfg62_s cn50xx; | ||
780 | struct cvmx_pci_cfg62_s cn58xx; | ||
781 | struct cvmx_pci_cfg62_s cn58xxp1; | ||
782 | }; | ||
783 | |||
784 | union cvmx_pci_cfg63 { | ||
785 | uint32_t u32; | ||
786 | struct cvmx_pci_cfg63_s { | ||
787 | uint32_t reserved_16_31:16; | ||
788 | uint32_t msimd:16; | ||
789 | } s; | ||
790 | struct cvmx_pci_cfg63_s cn30xx; | ||
791 | struct cvmx_pci_cfg63_s cn31xx; | ||
792 | struct cvmx_pci_cfg63_s cn38xx; | ||
793 | struct cvmx_pci_cfg63_s cn38xxp2; | ||
794 | struct cvmx_pci_cfg63_s cn50xx; | ||
795 | struct cvmx_pci_cfg63_s cn58xx; | ||
796 | struct cvmx_pci_cfg63_s cn58xxp1; | ||
797 | }; | ||
798 | |||
799 | union cvmx_pci_cnt_reg { | ||
800 | uint64_t u64; | ||
801 | struct cvmx_pci_cnt_reg_s { | ||
802 | uint64_t reserved_38_63:26; | ||
803 | uint64_t hm_pcix:1; | ||
804 | uint64_t hm_speed:2; | ||
805 | uint64_t ap_pcix:1; | ||
806 | uint64_t ap_speed:2; | ||
807 | uint64_t pcicnt:32; | ||
808 | } s; | ||
809 | struct cvmx_pci_cnt_reg_s cn50xx; | ||
810 | struct cvmx_pci_cnt_reg_s cn58xx; | ||
811 | struct cvmx_pci_cnt_reg_s cn58xxp1; | ||
812 | }; | ||
813 | |||
814 | union cvmx_pci_ctl_status_2 { | ||
815 | uint32_t u32; | ||
816 | struct cvmx_pci_ctl_status_2_s { | ||
817 | uint32_t reserved_29_31:3; | ||
818 | uint32_t bb1_hole:3; | ||
819 | uint32_t bb1_siz:1; | ||
820 | uint32_t bb_ca:1; | ||
821 | uint32_t bb_es:2; | ||
822 | uint32_t bb1:1; | ||
823 | uint32_t bb0:1; | ||
824 | uint32_t erst_n:1; | ||
825 | uint32_t bar2pres:1; | ||
826 | uint32_t scmtyp:1; | ||
827 | uint32_t scm:1; | ||
828 | uint32_t en_wfilt:1; | ||
829 | uint32_t reserved_14_14:1; | ||
830 | uint32_t ap_pcix:1; | ||
831 | uint32_t ap_64ad:1; | ||
832 | uint32_t b12_bist:1; | ||
833 | uint32_t pmo_amod:1; | ||
834 | uint32_t pmo_fpc:3; | ||
835 | uint32_t tsr_hwm:3; | ||
836 | uint32_t bar2_enb:1; | ||
837 | uint32_t bar2_esx:2; | ||
838 | uint32_t bar2_cax:1; | ||
839 | } s; | ||
840 | struct cvmx_pci_ctl_status_2_s cn30xx; | ||
841 | struct cvmx_pci_ctl_status_2_cn31xx { | ||
842 | uint32_t reserved_20_31:12; | ||
843 | uint32_t erst_n:1; | ||
844 | uint32_t bar2pres:1; | ||
845 | uint32_t scmtyp:1; | ||
846 | uint32_t scm:1; | ||
847 | uint32_t en_wfilt:1; | ||
848 | uint32_t reserved_14_14:1; | ||
849 | uint32_t ap_pcix:1; | ||
850 | uint32_t ap_64ad:1; | ||
851 | uint32_t b12_bist:1; | ||
852 | uint32_t pmo_amod:1; | ||
853 | uint32_t pmo_fpc:3; | ||
854 | uint32_t tsr_hwm:3; | ||
855 | uint32_t bar2_enb:1; | ||
856 | uint32_t bar2_esx:2; | ||
857 | uint32_t bar2_cax:1; | ||
858 | } cn31xx; | ||
859 | struct cvmx_pci_ctl_status_2_s cn38xx; | ||
860 | struct cvmx_pci_ctl_status_2_cn31xx cn38xxp2; | ||
861 | struct cvmx_pci_ctl_status_2_s cn50xx; | ||
862 | struct cvmx_pci_ctl_status_2_s cn58xx; | ||
863 | struct cvmx_pci_ctl_status_2_s cn58xxp1; | ||
864 | }; | ||
865 | |||
866 | union cvmx_pci_dbellx { | ||
867 | uint32_t u32; | ||
868 | struct cvmx_pci_dbellx_s { | ||
869 | uint32_t reserved_16_31:16; | ||
870 | uint32_t inc_val:16; | ||
871 | } s; | ||
872 | struct cvmx_pci_dbellx_s cn30xx; | ||
873 | struct cvmx_pci_dbellx_s cn31xx; | ||
874 | struct cvmx_pci_dbellx_s cn38xx; | ||
875 | struct cvmx_pci_dbellx_s cn38xxp2; | ||
876 | struct cvmx_pci_dbellx_s cn50xx; | ||
877 | struct cvmx_pci_dbellx_s cn58xx; | ||
878 | struct cvmx_pci_dbellx_s cn58xxp1; | ||
879 | }; | ||
880 | |||
881 | union cvmx_pci_dma_cntx { | ||
882 | uint32_t u32; | ||
883 | struct cvmx_pci_dma_cntx_s { | ||
884 | uint32_t dma_cnt:32; | ||
885 | } s; | ||
886 | struct cvmx_pci_dma_cntx_s cn30xx; | ||
887 | struct cvmx_pci_dma_cntx_s cn31xx; | ||
888 | struct cvmx_pci_dma_cntx_s cn38xx; | ||
889 | struct cvmx_pci_dma_cntx_s cn38xxp2; | ||
890 | struct cvmx_pci_dma_cntx_s cn50xx; | ||
891 | struct cvmx_pci_dma_cntx_s cn58xx; | ||
892 | struct cvmx_pci_dma_cntx_s cn58xxp1; | ||
893 | }; | ||
894 | |||
895 | union cvmx_pci_dma_int_levx { | ||
896 | uint32_t u32; | ||
897 | struct cvmx_pci_dma_int_levx_s { | ||
898 | uint32_t pkt_cnt:32; | ||
899 | } s; | ||
900 | struct cvmx_pci_dma_int_levx_s cn30xx; | ||
901 | struct cvmx_pci_dma_int_levx_s cn31xx; | ||
902 | struct cvmx_pci_dma_int_levx_s cn38xx; | ||
903 | struct cvmx_pci_dma_int_levx_s cn38xxp2; | ||
904 | struct cvmx_pci_dma_int_levx_s cn50xx; | ||
905 | struct cvmx_pci_dma_int_levx_s cn58xx; | ||
906 | struct cvmx_pci_dma_int_levx_s cn58xxp1; | ||
907 | }; | ||
908 | |||
909 | union cvmx_pci_dma_timex { | ||
910 | uint32_t u32; | ||
911 | struct cvmx_pci_dma_timex_s { | ||
912 | uint32_t dma_time:32; | ||
913 | } s; | ||
914 | struct cvmx_pci_dma_timex_s cn30xx; | ||
915 | struct cvmx_pci_dma_timex_s cn31xx; | ||
916 | struct cvmx_pci_dma_timex_s cn38xx; | ||
917 | struct cvmx_pci_dma_timex_s cn38xxp2; | ||
918 | struct cvmx_pci_dma_timex_s cn50xx; | ||
919 | struct cvmx_pci_dma_timex_s cn58xx; | ||
920 | struct cvmx_pci_dma_timex_s cn58xxp1; | ||
921 | }; | ||
922 | |||
923 | union cvmx_pci_instr_countx { | ||
924 | uint32_t u32; | ||
925 | struct cvmx_pci_instr_countx_s { | ||
926 | uint32_t icnt:32; | ||
927 | } s; | ||
928 | struct cvmx_pci_instr_countx_s cn30xx; | ||
929 | struct cvmx_pci_instr_countx_s cn31xx; | ||
930 | struct cvmx_pci_instr_countx_s cn38xx; | ||
931 | struct cvmx_pci_instr_countx_s cn38xxp2; | ||
932 | struct cvmx_pci_instr_countx_s cn50xx; | ||
933 | struct cvmx_pci_instr_countx_s cn58xx; | ||
934 | struct cvmx_pci_instr_countx_s cn58xxp1; | ||
935 | }; | ||
936 | |||
937 | union cvmx_pci_int_enb { | ||
938 | uint64_t u64; | ||
939 | struct cvmx_pci_int_enb_s { | ||
940 | uint64_t reserved_34_63:30; | ||
941 | uint64_t ill_rd:1; | ||
942 | uint64_t ill_wr:1; | ||
943 | uint64_t win_wr:1; | ||
944 | uint64_t dma1_fi:1; | ||
945 | uint64_t dma0_fi:1; | ||
946 | uint64_t idtime1:1; | ||
947 | uint64_t idtime0:1; | ||
948 | uint64_t idcnt1:1; | ||
949 | uint64_t idcnt0:1; | ||
950 | uint64_t iptime3:1; | ||
951 | uint64_t iptime2:1; | ||
952 | uint64_t iptime1:1; | ||
953 | uint64_t iptime0:1; | ||
954 | uint64_t ipcnt3:1; | ||
955 | uint64_t ipcnt2:1; | ||
956 | uint64_t ipcnt1:1; | ||
957 | uint64_t ipcnt0:1; | ||
958 | uint64_t irsl_int:1; | ||
959 | uint64_t ill_rrd:1; | ||
960 | uint64_t ill_rwr:1; | ||
961 | uint64_t idperr:1; | ||
962 | uint64_t iaperr:1; | ||
963 | uint64_t iserr:1; | ||
964 | uint64_t itsr_abt:1; | ||
965 | uint64_t imsc_msg:1; | ||
966 | uint64_t imsi_mabt:1; | ||
967 | uint64_t imsi_tabt:1; | ||
968 | uint64_t imsi_per:1; | ||
969 | uint64_t imr_tto:1; | ||
970 | uint64_t imr_abt:1; | ||
971 | uint64_t itr_abt:1; | ||
972 | uint64_t imr_wtto:1; | ||
973 | uint64_t imr_wabt:1; | ||
974 | uint64_t itr_wabt:1; | ||
975 | } s; | ||
976 | struct cvmx_pci_int_enb_cn30xx { | ||
977 | uint64_t reserved_34_63:30; | ||
978 | uint64_t ill_rd:1; | ||
979 | uint64_t ill_wr:1; | ||
980 | uint64_t win_wr:1; | ||
981 | uint64_t dma1_fi:1; | ||
982 | uint64_t dma0_fi:1; | ||
983 | uint64_t idtime1:1; | ||
984 | uint64_t idtime0:1; | ||
985 | uint64_t idcnt1:1; | ||
986 | uint64_t idcnt0:1; | ||
987 | uint64_t reserved_22_24:3; | ||
988 | uint64_t iptime0:1; | ||
989 | uint64_t reserved_18_20:3; | ||
990 | uint64_t ipcnt0:1; | ||
991 | uint64_t irsl_int:1; | ||
992 | uint64_t ill_rrd:1; | ||
993 | uint64_t ill_rwr:1; | ||
994 | uint64_t idperr:1; | ||
995 | uint64_t iaperr:1; | ||
996 | uint64_t iserr:1; | ||
997 | uint64_t itsr_abt:1; | ||
998 | uint64_t imsc_msg:1; | ||
999 | uint64_t imsi_mabt:1; | ||
1000 | uint64_t imsi_tabt:1; | ||
1001 | uint64_t imsi_per:1; | ||
1002 | uint64_t imr_tto:1; | ||
1003 | uint64_t imr_abt:1; | ||
1004 | uint64_t itr_abt:1; | ||
1005 | uint64_t imr_wtto:1; | ||
1006 | uint64_t imr_wabt:1; | ||
1007 | uint64_t itr_wabt:1; | ||
1008 | } cn30xx; | ||
1009 | struct cvmx_pci_int_enb_cn31xx { | ||
1010 | uint64_t reserved_34_63:30; | ||
1011 | uint64_t ill_rd:1; | ||
1012 | uint64_t ill_wr:1; | ||
1013 | uint64_t win_wr:1; | ||
1014 | uint64_t dma1_fi:1; | ||
1015 | uint64_t dma0_fi:1; | ||
1016 | uint64_t idtime1:1; | ||
1017 | uint64_t idtime0:1; | ||
1018 | uint64_t idcnt1:1; | ||
1019 | uint64_t idcnt0:1; | ||
1020 | uint64_t reserved_23_24:2; | ||
1021 | uint64_t iptime1:1; | ||
1022 | uint64_t iptime0:1; | ||
1023 | uint64_t reserved_19_20:2; | ||
1024 | uint64_t ipcnt1:1; | ||
1025 | uint64_t ipcnt0:1; | ||
1026 | uint64_t irsl_int:1; | ||
1027 | uint64_t ill_rrd:1; | ||
1028 | uint64_t ill_rwr:1; | ||
1029 | uint64_t idperr:1; | ||
1030 | uint64_t iaperr:1; | ||
1031 | uint64_t iserr:1; | ||
1032 | uint64_t itsr_abt:1; | ||
1033 | uint64_t imsc_msg:1; | ||
1034 | uint64_t imsi_mabt:1; | ||
1035 | uint64_t imsi_tabt:1; | ||
1036 | uint64_t imsi_per:1; | ||
1037 | uint64_t imr_tto:1; | ||
1038 | uint64_t imr_abt:1; | ||
1039 | uint64_t itr_abt:1; | ||
1040 | uint64_t imr_wtto:1; | ||
1041 | uint64_t imr_wabt:1; | ||
1042 | uint64_t itr_wabt:1; | ||
1043 | } cn31xx; | ||
1044 | struct cvmx_pci_int_enb_s cn38xx; | ||
1045 | struct cvmx_pci_int_enb_s cn38xxp2; | ||
1046 | struct cvmx_pci_int_enb_cn31xx cn50xx; | ||
1047 | struct cvmx_pci_int_enb_s cn58xx; | ||
1048 | struct cvmx_pci_int_enb_s cn58xxp1; | ||
1049 | }; | ||
1050 | |||
1051 | union cvmx_pci_int_enb2 { | ||
1052 | uint64_t u64; | ||
1053 | struct cvmx_pci_int_enb2_s { | ||
1054 | uint64_t reserved_34_63:30; | ||
1055 | uint64_t ill_rd:1; | ||
1056 | uint64_t ill_wr:1; | ||
1057 | uint64_t win_wr:1; | ||
1058 | uint64_t dma1_fi:1; | ||
1059 | uint64_t dma0_fi:1; | ||
1060 | uint64_t rdtime1:1; | ||
1061 | uint64_t rdtime0:1; | ||
1062 | uint64_t rdcnt1:1; | ||
1063 | uint64_t rdcnt0:1; | ||
1064 | uint64_t rptime3:1; | ||
1065 | uint64_t rptime2:1; | ||
1066 | uint64_t rptime1:1; | ||
1067 | uint64_t rptime0:1; | ||
1068 | uint64_t rpcnt3:1; | ||
1069 | uint64_t rpcnt2:1; | ||
1070 | uint64_t rpcnt1:1; | ||
1071 | uint64_t rpcnt0:1; | ||
1072 | uint64_t rrsl_int:1; | ||
1073 | uint64_t ill_rrd:1; | ||
1074 | uint64_t ill_rwr:1; | ||
1075 | uint64_t rdperr:1; | ||
1076 | uint64_t raperr:1; | ||
1077 | uint64_t rserr:1; | ||
1078 | uint64_t rtsr_abt:1; | ||
1079 | uint64_t rmsc_msg:1; | ||
1080 | uint64_t rmsi_mabt:1; | ||
1081 | uint64_t rmsi_tabt:1; | ||
1082 | uint64_t rmsi_per:1; | ||
1083 | uint64_t rmr_tto:1; | ||
1084 | uint64_t rmr_abt:1; | ||
1085 | uint64_t rtr_abt:1; | ||
1086 | uint64_t rmr_wtto:1; | ||
1087 | uint64_t rmr_wabt:1; | ||
1088 | uint64_t rtr_wabt:1; | ||
1089 | } s; | ||
1090 | struct cvmx_pci_int_enb2_cn30xx { | ||
1091 | uint64_t reserved_34_63:30; | ||
1092 | uint64_t ill_rd:1; | ||
1093 | uint64_t ill_wr:1; | ||
1094 | uint64_t win_wr:1; | ||
1095 | uint64_t dma1_fi:1; | ||
1096 | uint64_t dma0_fi:1; | ||
1097 | uint64_t rdtime1:1; | ||
1098 | uint64_t rdtime0:1; | ||
1099 | uint64_t rdcnt1:1; | ||
1100 | uint64_t rdcnt0:1; | ||
1101 | uint64_t reserved_22_24:3; | ||
1102 | uint64_t rptime0:1; | ||
1103 | uint64_t reserved_18_20:3; | ||
1104 | uint64_t rpcnt0:1; | ||
1105 | uint64_t rrsl_int:1; | ||
1106 | uint64_t ill_rrd:1; | ||
1107 | uint64_t ill_rwr:1; | ||
1108 | uint64_t rdperr:1; | ||
1109 | uint64_t raperr:1; | ||
1110 | uint64_t rserr:1; | ||
1111 | uint64_t rtsr_abt:1; | ||
1112 | uint64_t rmsc_msg:1; | ||
1113 | uint64_t rmsi_mabt:1; | ||
1114 | uint64_t rmsi_tabt:1; | ||
1115 | uint64_t rmsi_per:1; | ||
1116 | uint64_t rmr_tto:1; | ||
1117 | uint64_t rmr_abt:1; | ||
1118 | uint64_t rtr_abt:1; | ||
1119 | uint64_t rmr_wtto:1; | ||
1120 | uint64_t rmr_wabt:1; | ||
1121 | uint64_t rtr_wabt:1; | ||
1122 | } cn30xx; | ||
1123 | struct cvmx_pci_int_enb2_cn31xx { | ||
1124 | uint64_t reserved_34_63:30; | ||
1125 | uint64_t ill_rd:1; | ||
1126 | uint64_t ill_wr:1; | ||
1127 | uint64_t win_wr:1; | ||
1128 | uint64_t dma1_fi:1; | ||
1129 | uint64_t dma0_fi:1; | ||
1130 | uint64_t rdtime1:1; | ||
1131 | uint64_t rdtime0:1; | ||
1132 | uint64_t rdcnt1:1; | ||
1133 | uint64_t rdcnt0:1; | ||
1134 | uint64_t reserved_23_24:2; | ||
1135 | uint64_t rptime1:1; | ||
1136 | uint64_t rptime0:1; | ||
1137 | uint64_t reserved_19_20:2; | ||
1138 | uint64_t rpcnt1:1; | ||
1139 | uint64_t rpcnt0:1; | ||
1140 | uint64_t rrsl_int:1; | ||
1141 | uint64_t ill_rrd:1; | ||
1142 | uint64_t ill_rwr:1; | ||
1143 | uint64_t rdperr:1; | ||
1144 | uint64_t raperr:1; | ||
1145 | uint64_t rserr:1; | ||
1146 | uint64_t rtsr_abt:1; | ||
1147 | uint64_t rmsc_msg:1; | ||
1148 | uint64_t rmsi_mabt:1; | ||
1149 | uint64_t rmsi_tabt:1; | ||
1150 | uint64_t rmsi_per:1; | ||
1151 | uint64_t rmr_tto:1; | ||
1152 | uint64_t rmr_abt:1; | ||
1153 | uint64_t rtr_abt:1; | ||
1154 | uint64_t rmr_wtto:1; | ||
1155 | uint64_t rmr_wabt:1; | ||
1156 | uint64_t rtr_wabt:1; | ||
1157 | } cn31xx; | ||
1158 | struct cvmx_pci_int_enb2_s cn38xx; | ||
1159 | struct cvmx_pci_int_enb2_s cn38xxp2; | ||
1160 | struct cvmx_pci_int_enb2_cn31xx cn50xx; | ||
1161 | struct cvmx_pci_int_enb2_s cn58xx; | ||
1162 | struct cvmx_pci_int_enb2_s cn58xxp1; | ||
1163 | }; | ||
1164 | |||
1165 | union cvmx_pci_int_sum { | ||
1166 | uint64_t u64; | ||
1167 | struct cvmx_pci_int_sum_s { | ||
1168 | uint64_t reserved_34_63:30; | ||
1169 | uint64_t ill_rd:1; | ||
1170 | uint64_t ill_wr:1; | ||
1171 | uint64_t win_wr:1; | ||
1172 | uint64_t dma1_fi:1; | ||
1173 | uint64_t dma0_fi:1; | ||
1174 | uint64_t dtime1:1; | ||
1175 | uint64_t dtime0:1; | ||
1176 | uint64_t dcnt1:1; | ||
1177 | uint64_t dcnt0:1; | ||
1178 | uint64_t ptime3:1; | ||
1179 | uint64_t ptime2:1; | ||
1180 | uint64_t ptime1:1; | ||
1181 | uint64_t ptime0:1; | ||
1182 | uint64_t pcnt3:1; | ||
1183 | uint64_t pcnt2:1; | ||
1184 | uint64_t pcnt1:1; | ||
1185 | uint64_t pcnt0:1; | ||
1186 | uint64_t rsl_int:1; | ||
1187 | uint64_t ill_rrd:1; | ||
1188 | uint64_t ill_rwr:1; | ||
1189 | uint64_t dperr:1; | ||
1190 | uint64_t aperr:1; | ||
1191 | uint64_t serr:1; | ||
1192 | uint64_t tsr_abt:1; | ||
1193 | uint64_t msc_msg:1; | ||
1194 | uint64_t msi_mabt:1; | ||
1195 | uint64_t msi_tabt:1; | ||
1196 | uint64_t msi_per:1; | ||
1197 | uint64_t mr_tto:1; | ||
1198 | uint64_t mr_abt:1; | ||
1199 | uint64_t tr_abt:1; | ||
1200 | uint64_t mr_wtto:1; | ||
1201 | uint64_t mr_wabt:1; | ||
1202 | uint64_t tr_wabt:1; | ||
1203 | } s; | ||
1204 | struct cvmx_pci_int_sum_cn30xx { | ||
1205 | uint64_t reserved_34_63:30; | ||
1206 | uint64_t ill_rd:1; | ||
1207 | uint64_t ill_wr:1; | ||
1208 | uint64_t win_wr:1; | ||
1209 | uint64_t dma1_fi:1; | ||
1210 | uint64_t dma0_fi:1; | ||
1211 | uint64_t dtime1:1; | ||
1212 | uint64_t dtime0:1; | ||
1213 | uint64_t dcnt1:1; | ||
1214 | uint64_t dcnt0:1; | ||
1215 | uint64_t reserved_22_24:3; | ||
1216 | uint64_t ptime0:1; | ||
1217 | uint64_t reserved_18_20:3; | ||
1218 | uint64_t pcnt0:1; | ||
1219 | uint64_t rsl_int:1; | ||
1220 | uint64_t ill_rrd:1; | ||
1221 | uint64_t ill_rwr:1; | ||
1222 | uint64_t dperr:1; | ||
1223 | uint64_t aperr:1; | ||
1224 | uint64_t serr:1; | ||
1225 | uint64_t tsr_abt:1; | ||
1226 | uint64_t msc_msg:1; | ||
1227 | uint64_t msi_mabt:1; | ||
1228 | uint64_t msi_tabt:1; | ||
1229 | uint64_t msi_per:1; | ||
1230 | uint64_t mr_tto:1; | ||
1231 | uint64_t mr_abt:1; | ||
1232 | uint64_t tr_abt:1; | ||
1233 | uint64_t mr_wtto:1; | ||
1234 | uint64_t mr_wabt:1; | ||
1235 | uint64_t tr_wabt:1; | ||
1236 | } cn30xx; | ||
1237 | struct cvmx_pci_int_sum_cn31xx { | ||
1238 | uint64_t reserved_34_63:30; | ||
1239 | uint64_t ill_rd:1; | ||
1240 | uint64_t ill_wr:1; | ||
1241 | uint64_t win_wr:1; | ||
1242 | uint64_t dma1_fi:1; | ||
1243 | uint64_t dma0_fi:1; | ||
1244 | uint64_t dtime1:1; | ||
1245 | uint64_t dtime0:1; | ||
1246 | uint64_t dcnt1:1; | ||
1247 | uint64_t dcnt0:1; | ||
1248 | uint64_t reserved_23_24:2; | ||
1249 | uint64_t ptime1:1; | ||
1250 | uint64_t ptime0:1; | ||
1251 | uint64_t reserved_19_20:2; | ||
1252 | uint64_t pcnt1:1; | ||
1253 | uint64_t pcnt0:1; | ||
1254 | uint64_t rsl_int:1; | ||
1255 | uint64_t ill_rrd:1; | ||
1256 | uint64_t ill_rwr:1; | ||
1257 | uint64_t dperr:1; | ||
1258 | uint64_t aperr:1; | ||
1259 | uint64_t serr:1; | ||
1260 | uint64_t tsr_abt:1; | ||
1261 | uint64_t msc_msg:1; | ||
1262 | uint64_t msi_mabt:1; | ||
1263 | uint64_t msi_tabt:1; | ||
1264 | uint64_t msi_per:1; | ||
1265 | uint64_t mr_tto:1; | ||
1266 | uint64_t mr_abt:1; | ||
1267 | uint64_t tr_abt:1; | ||
1268 | uint64_t mr_wtto:1; | ||
1269 | uint64_t mr_wabt:1; | ||
1270 | uint64_t tr_wabt:1; | ||
1271 | } cn31xx; | ||
1272 | struct cvmx_pci_int_sum_s cn38xx; | ||
1273 | struct cvmx_pci_int_sum_s cn38xxp2; | ||
1274 | struct cvmx_pci_int_sum_cn31xx cn50xx; | ||
1275 | struct cvmx_pci_int_sum_s cn58xx; | ||
1276 | struct cvmx_pci_int_sum_s cn58xxp1; | ||
1277 | }; | ||
1278 | |||
1279 | union cvmx_pci_int_sum2 { | ||
1280 | uint64_t u64; | ||
1281 | struct cvmx_pci_int_sum2_s { | ||
1282 | uint64_t reserved_34_63:30; | ||
1283 | uint64_t ill_rd:1; | ||
1284 | uint64_t ill_wr:1; | ||
1285 | uint64_t win_wr:1; | ||
1286 | uint64_t dma1_fi:1; | ||
1287 | uint64_t dma0_fi:1; | ||
1288 | uint64_t dtime1:1; | ||
1289 | uint64_t dtime0:1; | ||
1290 | uint64_t dcnt1:1; | ||
1291 | uint64_t dcnt0:1; | ||
1292 | uint64_t ptime3:1; | ||
1293 | uint64_t ptime2:1; | ||
1294 | uint64_t ptime1:1; | ||
1295 | uint64_t ptime0:1; | ||
1296 | uint64_t pcnt3:1; | ||
1297 | uint64_t pcnt2:1; | ||
1298 | uint64_t pcnt1:1; | ||
1299 | uint64_t pcnt0:1; | ||
1300 | uint64_t rsl_int:1; | ||
1301 | uint64_t ill_rrd:1; | ||
1302 | uint64_t ill_rwr:1; | ||
1303 | uint64_t dperr:1; | ||
1304 | uint64_t aperr:1; | ||
1305 | uint64_t serr:1; | ||
1306 | uint64_t tsr_abt:1; | ||
1307 | uint64_t msc_msg:1; | ||
1308 | uint64_t msi_mabt:1; | ||
1309 | uint64_t msi_tabt:1; | ||
1310 | uint64_t msi_per:1; | ||
1311 | uint64_t mr_tto:1; | ||
1312 | uint64_t mr_abt:1; | ||
1313 | uint64_t tr_abt:1; | ||
1314 | uint64_t mr_wtto:1; | ||
1315 | uint64_t mr_wabt:1; | ||
1316 | uint64_t tr_wabt:1; | ||
1317 | } s; | ||
1318 | struct cvmx_pci_int_sum2_cn30xx { | ||
1319 | uint64_t reserved_34_63:30; | ||
1320 | uint64_t ill_rd:1; | ||
1321 | uint64_t ill_wr:1; | ||
1322 | uint64_t win_wr:1; | ||
1323 | uint64_t dma1_fi:1; | ||
1324 | uint64_t dma0_fi:1; | ||
1325 | uint64_t dtime1:1; | ||
1326 | uint64_t dtime0:1; | ||
1327 | uint64_t dcnt1:1; | ||
1328 | uint64_t dcnt0:1; | ||
1329 | uint64_t reserved_22_24:3; | ||
1330 | uint64_t ptime0:1; | ||
1331 | uint64_t reserved_18_20:3; | ||
1332 | uint64_t pcnt0:1; | ||
1333 | uint64_t rsl_int:1; | ||
1334 | uint64_t ill_rrd:1; | ||
1335 | uint64_t ill_rwr:1; | ||
1336 | uint64_t dperr:1; | ||
1337 | uint64_t aperr:1; | ||
1338 | uint64_t serr:1; | ||
1339 | uint64_t tsr_abt:1; | ||
1340 | uint64_t msc_msg:1; | ||
1341 | uint64_t msi_mabt:1; | ||
1342 | uint64_t msi_tabt:1; | ||
1343 | uint64_t msi_per:1; | ||
1344 | uint64_t mr_tto:1; | ||
1345 | uint64_t mr_abt:1; | ||
1346 | uint64_t tr_abt:1; | ||
1347 | uint64_t mr_wtto:1; | ||
1348 | uint64_t mr_wabt:1; | ||
1349 | uint64_t tr_wabt:1; | ||
1350 | } cn30xx; | ||
1351 | struct cvmx_pci_int_sum2_cn31xx { | ||
1352 | uint64_t reserved_34_63:30; | ||
1353 | uint64_t ill_rd:1; | ||
1354 | uint64_t ill_wr:1; | ||
1355 | uint64_t win_wr:1; | ||
1356 | uint64_t dma1_fi:1; | ||
1357 | uint64_t dma0_fi:1; | ||
1358 | uint64_t dtime1:1; | ||
1359 | uint64_t dtime0:1; | ||
1360 | uint64_t dcnt1:1; | ||
1361 | uint64_t dcnt0:1; | ||
1362 | uint64_t reserved_23_24:2; | ||
1363 | uint64_t ptime1:1; | ||
1364 | uint64_t ptime0:1; | ||
1365 | uint64_t reserved_19_20:2; | ||
1366 | uint64_t pcnt1:1; | ||
1367 | uint64_t pcnt0:1; | ||
1368 | uint64_t rsl_int:1; | ||
1369 | uint64_t ill_rrd:1; | ||
1370 | uint64_t ill_rwr:1; | ||
1371 | uint64_t dperr:1; | ||
1372 | uint64_t aperr:1; | ||
1373 | uint64_t serr:1; | ||
1374 | uint64_t tsr_abt:1; | ||
1375 | uint64_t msc_msg:1; | ||
1376 | uint64_t msi_mabt:1; | ||
1377 | uint64_t msi_tabt:1; | ||
1378 | uint64_t msi_per:1; | ||
1379 | uint64_t mr_tto:1; | ||
1380 | uint64_t mr_abt:1; | ||
1381 | uint64_t tr_abt:1; | ||
1382 | uint64_t mr_wtto:1; | ||
1383 | uint64_t mr_wabt:1; | ||
1384 | uint64_t tr_wabt:1; | ||
1385 | } cn31xx; | ||
1386 | struct cvmx_pci_int_sum2_s cn38xx; | ||
1387 | struct cvmx_pci_int_sum2_s cn38xxp2; | ||
1388 | struct cvmx_pci_int_sum2_cn31xx cn50xx; | ||
1389 | struct cvmx_pci_int_sum2_s cn58xx; | ||
1390 | struct cvmx_pci_int_sum2_s cn58xxp1; | ||
1391 | }; | ||
1392 | |||
1393 | union cvmx_pci_msi_rcv { | ||
1394 | uint32_t u32; | ||
1395 | struct cvmx_pci_msi_rcv_s { | ||
1396 | uint32_t reserved_6_31:26; | ||
1397 | uint32_t intr:6; | ||
1398 | } s; | ||
1399 | struct cvmx_pci_msi_rcv_s cn30xx; | ||
1400 | struct cvmx_pci_msi_rcv_s cn31xx; | ||
1401 | struct cvmx_pci_msi_rcv_s cn38xx; | ||
1402 | struct cvmx_pci_msi_rcv_s cn38xxp2; | ||
1403 | struct cvmx_pci_msi_rcv_s cn50xx; | ||
1404 | struct cvmx_pci_msi_rcv_s cn58xx; | ||
1405 | struct cvmx_pci_msi_rcv_s cn58xxp1; | ||
1406 | }; | ||
1407 | |||
1408 | union cvmx_pci_pkt_creditsx { | ||
1409 | uint32_t u32; | ||
1410 | struct cvmx_pci_pkt_creditsx_s { | ||
1411 | uint32_t pkt_cnt:16; | ||
1412 | uint32_t ptr_cnt:16; | ||
1413 | } s; | ||
1414 | struct cvmx_pci_pkt_creditsx_s cn30xx; | ||
1415 | struct cvmx_pci_pkt_creditsx_s cn31xx; | ||
1416 | struct cvmx_pci_pkt_creditsx_s cn38xx; | ||
1417 | struct cvmx_pci_pkt_creditsx_s cn38xxp2; | ||
1418 | struct cvmx_pci_pkt_creditsx_s cn50xx; | ||
1419 | struct cvmx_pci_pkt_creditsx_s cn58xx; | ||
1420 | struct cvmx_pci_pkt_creditsx_s cn58xxp1; | ||
1421 | }; | ||
1422 | |||
1423 | union cvmx_pci_pkts_sentx { | ||
1424 | uint32_t u32; | ||
1425 | struct cvmx_pci_pkts_sentx_s { | ||
1426 | uint32_t pkt_cnt:32; | ||
1427 | } s; | ||
1428 | struct cvmx_pci_pkts_sentx_s cn30xx; | ||
1429 | struct cvmx_pci_pkts_sentx_s cn31xx; | ||
1430 | struct cvmx_pci_pkts_sentx_s cn38xx; | ||
1431 | struct cvmx_pci_pkts_sentx_s cn38xxp2; | ||
1432 | struct cvmx_pci_pkts_sentx_s cn50xx; | ||
1433 | struct cvmx_pci_pkts_sentx_s cn58xx; | ||
1434 | struct cvmx_pci_pkts_sentx_s cn58xxp1; | ||
1435 | }; | ||
1436 | |||
1437 | union cvmx_pci_pkts_sent_int_levx { | ||
1438 | uint32_t u32; | ||
1439 | struct cvmx_pci_pkts_sent_int_levx_s { | ||
1440 | uint32_t pkt_cnt:32; | ||
1441 | } s; | ||
1442 | struct cvmx_pci_pkts_sent_int_levx_s cn30xx; | ||
1443 | struct cvmx_pci_pkts_sent_int_levx_s cn31xx; | ||
1444 | struct cvmx_pci_pkts_sent_int_levx_s cn38xx; | ||
1445 | struct cvmx_pci_pkts_sent_int_levx_s cn38xxp2; | ||
1446 | struct cvmx_pci_pkts_sent_int_levx_s cn50xx; | ||
1447 | struct cvmx_pci_pkts_sent_int_levx_s cn58xx; | ||
1448 | struct cvmx_pci_pkts_sent_int_levx_s cn58xxp1; | ||
1449 | }; | ||
1450 | |||
1451 | union cvmx_pci_pkts_sent_timex { | ||
1452 | uint32_t u32; | ||
1453 | struct cvmx_pci_pkts_sent_timex_s { | ||
1454 | uint32_t pkt_time:32; | ||
1455 | } s; | ||
1456 | struct cvmx_pci_pkts_sent_timex_s cn30xx; | ||
1457 | struct cvmx_pci_pkts_sent_timex_s cn31xx; | ||
1458 | struct cvmx_pci_pkts_sent_timex_s cn38xx; | ||
1459 | struct cvmx_pci_pkts_sent_timex_s cn38xxp2; | ||
1460 | struct cvmx_pci_pkts_sent_timex_s cn50xx; | ||
1461 | struct cvmx_pci_pkts_sent_timex_s cn58xx; | ||
1462 | struct cvmx_pci_pkts_sent_timex_s cn58xxp1; | ||
1463 | }; | ||
1464 | |||
1465 | union cvmx_pci_read_cmd_6 { | ||
1466 | uint32_t u32; | ||
1467 | struct cvmx_pci_read_cmd_6_s { | ||
1468 | uint32_t reserved_9_31:23; | ||
1469 | uint32_t min_data:6; | ||
1470 | uint32_t prefetch:3; | ||
1471 | } s; | ||
1472 | struct cvmx_pci_read_cmd_6_s cn30xx; | ||
1473 | struct cvmx_pci_read_cmd_6_s cn31xx; | ||
1474 | struct cvmx_pci_read_cmd_6_s cn38xx; | ||
1475 | struct cvmx_pci_read_cmd_6_s cn38xxp2; | ||
1476 | struct cvmx_pci_read_cmd_6_s cn50xx; | ||
1477 | struct cvmx_pci_read_cmd_6_s cn58xx; | ||
1478 | struct cvmx_pci_read_cmd_6_s cn58xxp1; | ||
1479 | }; | ||
1480 | |||
1481 | union cvmx_pci_read_cmd_c { | ||
1482 | uint32_t u32; | ||
1483 | struct cvmx_pci_read_cmd_c_s { | ||
1484 | uint32_t reserved_9_31:23; | ||
1485 | uint32_t min_data:6; | ||
1486 | uint32_t prefetch:3; | ||
1487 | } s; | ||
1488 | struct cvmx_pci_read_cmd_c_s cn30xx; | ||
1489 | struct cvmx_pci_read_cmd_c_s cn31xx; | ||
1490 | struct cvmx_pci_read_cmd_c_s cn38xx; | ||
1491 | struct cvmx_pci_read_cmd_c_s cn38xxp2; | ||
1492 | struct cvmx_pci_read_cmd_c_s cn50xx; | ||
1493 | struct cvmx_pci_read_cmd_c_s cn58xx; | ||
1494 | struct cvmx_pci_read_cmd_c_s cn58xxp1; | ||
1495 | }; | ||
1496 | |||
1497 | union cvmx_pci_read_cmd_e { | ||
1498 | uint32_t u32; | ||
1499 | struct cvmx_pci_read_cmd_e_s { | ||
1500 | uint32_t reserved_9_31:23; | ||
1501 | uint32_t min_data:6; | ||
1502 | uint32_t prefetch:3; | ||
1503 | } s; | ||
1504 | struct cvmx_pci_read_cmd_e_s cn30xx; | ||
1505 | struct cvmx_pci_read_cmd_e_s cn31xx; | ||
1506 | struct cvmx_pci_read_cmd_e_s cn38xx; | ||
1507 | struct cvmx_pci_read_cmd_e_s cn38xxp2; | ||
1508 | struct cvmx_pci_read_cmd_e_s cn50xx; | ||
1509 | struct cvmx_pci_read_cmd_e_s cn58xx; | ||
1510 | struct cvmx_pci_read_cmd_e_s cn58xxp1; | ||
1511 | }; | ||
1512 | |||
1513 | union cvmx_pci_read_timeout { | ||
1514 | uint64_t u64; | ||
1515 | struct cvmx_pci_read_timeout_s { | ||
1516 | uint64_t reserved_32_63:32; | ||
1517 | uint64_t enb:1; | ||
1518 | uint64_t cnt:31; | ||
1519 | } s; | ||
1520 | struct cvmx_pci_read_timeout_s cn30xx; | ||
1521 | struct cvmx_pci_read_timeout_s cn31xx; | ||
1522 | struct cvmx_pci_read_timeout_s cn38xx; | ||
1523 | struct cvmx_pci_read_timeout_s cn38xxp2; | ||
1524 | struct cvmx_pci_read_timeout_s cn50xx; | ||
1525 | struct cvmx_pci_read_timeout_s cn58xx; | ||
1526 | struct cvmx_pci_read_timeout_s cn58xxp1; | ||
1527 | }; | ||
1528 | |||
1529 | union cvmx_pci_scm_reg { | ||
1530 | uint64_t u64; | ||
1531 | struct cvmx_pci_scm_reg_s { | ||
1532 | uint64_t reserved_32_63:32; | ||
1533 | uint64_t scm:32; | ||
1534 | } s; | ||
1535 | struct cvmx_pci_scm_reg_s cn30xx; | ||
1536 | struct cvmx_pci_scm_reg_s cn31xx; | ||
1537 | struct cvmx_pci_scm_reg_s cn38xx; | ||
1538 | struct cvmx_pci_scm_reg_s cn38xxp2; | ||
1539 | struct cvmx_pci_scm_reg_s cn50xx; | ||
1540 | struct cvmx_pci_scm_reg_s cn58xx; | ||
1541 | struct cvmx_pci_scm_reg_s cn58xxp1; | ||
1542 | }; | ||
1543 | |||
1544 | union cvmx_pci_tsr_reg { | ||
1545 | uint64_t u64; | ||
1546 | struct cvmx_pci_tsr_reg_s { | ||
1547 | uint64_t reserved_36_63:28; | ||
1548 | uint64_t tsr:36; | ||
1549 | } s; | ||
1550 | struct cvmx_pci_tsr_reg_s cn30xx; | ||
1551 | struct cvmx_pci_tsr_reg_s cn31xx; | ||
1552 | struct cvmx_pci_tsr_reg_s cn38xx; | ||
1553 | struct cvmx_pci_tsr_reg_s cn38xxp2; | ||
1554 | struct cvmx_pci_tsr_reg_s cn50xx; | ||
1555 | struct cvmx_pci_tsr_reg_s cn58xx; | ||
1556 | struct cvmx_pci_tsr_reg_s cn58xxp1; | ||
1557 | }; | ||
1558 | |||
1559 | union cvmx_pci_win_rd_addr { | ||
1560 | uint64_t u64; | ||
1561 | struct cvmx_pci_win_rd_addr_s { | ||
1562 | uint64_t reserved_49_63:15; | ||
1563 | uint64_t iobit:1; | ||
1564 | uint64_t reserved_0_47:48; | ||
1565 | } s; | ||
1566 | struct cvmx_pci_win_rd_addr_cn30xx { | ||
1567 | uint64_t reserved_49_63:15; | ||
1568 | uint64_t iobit:1; | ||
1569 | uint64_t rd_addr:46; | ||
1570 | uint64_t reserved_0_1:2; | ||
1571 | } cn30xx; | ||
1572 | struct cvmx_pci_win_rd_addr_cn30xx cn31xx; | ||
1573 | struct cvmx_pci_win_rd_addr_cn38xx { | ||
1574 | uint64_t reserved_49_63:15; | ||
1575 | uint64_t iobit:1; | ||
1576 | uint64_t rd_addr:45; | ||
1577 | uint64_t reserved_0_2:3; | ||
1578 | } cn38xx; | ||
1579 | struct cvmx_pci_win_rd_addr_cn38xx cn38xxp2; | ||
1580 | struct cvmx_pci_win_rd_addr_cn30xx cn50xx; | ||
1581 | struct cvmx_pci_win_rd_addr_cn38xx cn58xx; | ||
1582 | struct cvmx_pci_win_rd_addr_cn38xx cn58xxp1; | ||
1583 | }; | ||
1584 | |||
1585 | union cvmx_pci_win_rd_data { | ||
1586 | uint64_t u64; | ||
1587 | struct cvmx_pci_win_rd_data_s { | ||
1588 | uint64_t rd_data:64; | ||
1589 | } s; | ||
1590 | struct cvmx_pci_win_rd_data_s cn30xx; | ||
1591 | struct cvmx_pci_win_rd_data_s cn31xx; | ||
1592 | struct cvmx_pci_win_rd_data_s cn38xx; | ||
1593 | struct cvmx_pci_win_rd_data_s cn38xxp2; | ||
1594 | struct cvmx_pci_win_rd_data_s cn50xx; | ||
1595 | struct cvmx_pci_win_rd_data_s cn58xx; | ||
1596 | struct cvmx_pci_win_rd_data_s cn58xxp1; | ||
1597 | }; | ||
1598 | |||
1599 | union cvmx_pci_win_wr_addr { | ||
1600 | uint64_t u64; | ||
1601 | struct cvmx_pci_win_wr_addr_s { | ||
1602 | uint64_t reserved_49_63:15; | ||
1603 | uint64_t iobit:1; | ||
1604 | uint64_t wr_addr:45; | ||
1605 | uint64_t reserved_0_2:3; | ||
1606 | } s; | ||
1607 | struct cvmx_pci_win_wr_addr_s cn30xx; | ||
1608 | struct cvmx_pci_win_wr_addr_s cn31xx; | ||
1609 | struct cvmx_pci_win_wr_addr_s cn38xx; | ||
1610 | struct cvmx_pci_win_wr_addr_s cn38xxp2; | ||
1611 | struct cvmx_pci_win_wr_addr_s cn50xx; | ||
1612 | struct cvmx_pci_win_wr_addr_s cn58xx; | ||
1613 | struct cvmx_pci_win_wr_addr_s cn58xxp1; | ||
1614 | }; | ||
1615 | |||
1616 | union cvmx_pci_win_wr_data { | ||
1617 | uint64_t u64; | ||
1618 | struct cvmx_pci_win_wr_data_s { | ||
1619 | uint64_t wr_data:64; | ||
1620 | } s; | ||
1621 | struct cvmx_pci_win_wr_data_s cn30xx; | ||
1622 | struct cvmx_pci_win_wr_data_s cn31xx; | ||
1623 | struct cvmx_pci_win_wr_data_s cn38xx; | ||
1624 | struct cvmx_pci_win_wr_data_s cn38xxp2; | ||
1625 | struct cvmx_pci_win_wr_data_s cn50xx; | ||
1626 | struct cvmx_pci_win_wr_data_s cn58xx; | ||
1627 | struct cvmx_pci_win_wr_data_s cn58xxp1; | ||
1628 | }; | ||
1629 | |||
1630 | union cvmx_pci_win_wr_mask { | ||
1631 | uint64_t u64; | ||
1632 | struct cvmx_pci_win_wr_mask_s { | ||
1633 | uint64_t reserved_8_63:56; | ||
1634 | uint64_t wr_mask:8; | ||
1635 | } s; | ||
1636 | struct cvmx_pci_win_wr_mask_s cn30xx; | ||
1637 | struct cvmx_pci_win_wr_mask_s cn31xx; | ||
1638 | struct cvmx_pci_win_wr_mask_s cn38xx; | ||
1639 | struct cvmx_pci_win_wr_mask_s cn38xxp2; | ||
1640 | struct cvmx_pci_win_wr_mask_s cn50xx; | ||
1641 | struct cvmx_pci_win_wr_mask_s cn58xx; | ||
1642 | struct cvmx_pci_win_wr_mask_s cn58xxp1; | ||
1643 | }; | ||
1644 | |||
1645 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-pcieep-defs.h b/arch/mips/include/asm/octeon/cvmx-pcieep-defs.h new file mode 100644 index 000000000000..d553f8e88df6 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-pcieep-defs.h | |||
@@ -0,0 +1,1365 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_PCIEEP_DEFS_H__ | ||
29 | #define __CVMX_PCIEEP_DEFS_H__ | ||
30 | |||
31 | #define CVMX_PCIEEP_CFG000 \ | ||
32 | (0x0000000000000000ull) | ||
33 | #define CVMX_PCIEEP_CFG001 \ | ||
34 | (0x0000000000000004ull) | ||
35 | #define CVMX_PCIEEP_CFG002 \ | ||
36 | (0x0000000000000008ull) | ||
37 | #define CVMX_PCIEEP_CFG003 \ | ||
38 | (0x000000000000000Cull) | ||
39 | #define CVMX_PCIEEP_CFG004 \ | ||
40 | (0x0000000000000010ull) | ||
41 | #define CVMX_PCIEEP_CFG004_MASK \ | ||
42 | (0x0000000080000010ull) | ||
43 | #define CVMX_PCIEEP_CFG005 \ | ||
44 | (0x0000000000000014ull) | ||
45 | #define CVMX_PCIEEP_CFG005_MASK \ | ||
46 | (0x0000000080000014ull) | ||
47 | #define CVMX_PCIEEP_CFG006 \ | ||
48 | (0x0000000000000018ull) | ||
49 | #define CVMX_PCIEEP_CFG006_MASK \ | ||
50 | (0x0000000080000018ull) | ||
51 | #define CVMX_PCIEEP_CFG007 \ | ||
52 | (0x000000000000001Cull) | ||
53 | #define CVMX_PCIEEP_CFG007_MASK \ | ||
54 | (0x000000008000001Cull) | ||
55 | #define CVMX_PCIEEP_CFG008 \ | ||
56 | (0x0000000000000020ull) | ||
57 | #define CVMX_PCIEEP_CFG008_MASK \ | ||
58 | (0x0000000080000020ull) | ||
59 | #define CVMX_PCIEEP_CFG009 \ | ||
60 | (0x0000000000000024ull) | ||
61 | #define CVMX_PCIEEP_CFG009_MASK \ | ||
62 | (0x0000000080000024ull) | ||
63 | #define CVMX_PCIEEP_CFG010 \ | ||
64 | (0x0000000000000028ull) | ||
65 | #define CVMX_PCIEEP_CFG011 \ | ||
66 | (0x000000000000002Cull) | ||
67 | #define CVMX_PCIEEP_CFG012 \ | ||
68 | (0x0000000000000030ull) | ||
69 | #define CVMX_PCIEEP_CFG012_MASK \ | ||
70 | (0x0000000080000030ull) | ||
71 | #define CVMX_PCIEEP_CFG013 \ | ||
72 | (0x0000000000000034ull) | ||
73 | #define CVMX_PCIEEP_CFG015 \ | ||
74 | (0x000000000000003Cull) | ||
75 | #define CVMX_PCIEEP_CFG016 \ | ||
76 | (0x0000000000000040ull) | ||
77 | #define CVMX_PCIEEP_CFG017 \ | ||
78 | (0x0000000000000044ull) | ||
79 | #define CVMX_PCIEEP_CFG020 \ | ||
80 | (0x0000000000000050ull) | ||
81 | #define CVMX_PCIEEP_CFG021 \ | ||
82 | (0x0000000000000054ull) | ||
83 | #define CVMX_PCIEEP_CFG022 \ | ||
84 | (0x0000000000000058ull) | ||
85 | #define CVMX_PCIEEP_CFG023 \ | ||
86 | (0x000000000000005Cull) | ||
87 | #define CVMX_PCIEEP_CFG028 \ | ||
88 | (0x0000000000000070ull) | ||
89 | #define CVMX_PCIEEP_CFG029 \ | ||
90 | (0x0000000000000074ull) | ||
91 | #define CVMX_PCIEEP_CFG030 \ | ||
92 | (0x0000000000000078ull) | ||
93 | #define CVMX_PCIEEP_CFG031 \ | ||
94 | (0x000000000000007Cull) | ||
95 | #define CVMX_PCIEEP_CFG032 \ | ||
96 | (0x0000000000000080ull) | ||
97 | #define CVMX_PCIEEP_CFG033 \ | ||
98 | (0x0000000000000084ull) | ||
99 | #define CVMX_PCIEEP_CFG034 \ | ||
100 | (0x0000000000000088ull) | ||
101 | #define CVMX_PCIEEP_CFG037 \ | ||
102 | (0x0000000000000094ull) | ||
103 | #define CVMX_PCIEEP_CFG038 \ | ||
104 | (0x0000000000000098ull) | ||
105 | #define CVMX_PCIEEP_CFG039 \ | ||
106 | (0x000000000000009Cull) | ||
107 | #define CVMX_PCIEEP_CFG040 \ | ||
108 | (0x00000000000000A0ull) | ||
109 | #define CVMX_PCIEEP_CFG041 \ | ||
110 | (0x00000000000000A4ull) | ||
111 | #define CVMX_PCIEEP_CFG042 \ | ||
112 | (0x00000000000000A8ull) | ||
113 | #define CVMX_PCIEEP_CFG064 \ | ||
114 | (0x0000000000000100ull) | ||
115 | #define CVMX_PCIEEP_CFG065 \ | ||
116 | (0x0000000000000104ull) | ||
117 | #define CVMX_PCIEEP_CFG066 \ | ||
118 | (0x0000000000000108ull) | ||
119 | #define CVMX_PCIEEP_CFG067 \ | ||
120 | (0x000000000000010Cull) | ||
121 | #define CVMX_PCIEEP_CFG068 \ | ||
122 | (0x0000000000000110ull) | ||
123 | #define CVMX_PCIEEP_CFG069 \ | ||
124 | (0x0000000000000114ull) | ||
125 | #define CVMX_PCIEEP_CFG070 \ | ||
126 | (0x0000000000000118ull) | ||
127 | #define CVMX_PCIEEP_CFG071 \ | ||
128 | (0x000000000000011Cull) | ||
129 | #define CVMX_PCIEEP_CFG072 \ | ||
130 | (0x0000000000000120ull) | ||
131 | #define CVMX_PCIEEP_CFG073 \ | ||
132 | (0x0000000000000124ull) | ||
133 | #define CVMX_PCIEEP_CFG074 \ | ||
134 | (0x0000000000000128ull) | ||
135 | #define CVMX_PCIEEP_CFG448 \ | ||
136 | (0x0000000000000700ull) | ||
137 | #define CVMX_PCIEEP_CFG449 \ | ||
138 | (0x0000000000000704ull) | ||
139 | #define CVMX_PCIEEP_CFG450 \ | ||
140 | (0x0000000000000708ull) | ||
141 | #define CVMX_PCIEEP_CFG451 \ | ||
142 | (0x000000000000070Cull) | ||
143 | #define CVMX_PCIEEP_CFG452 \ | ||
144 | (0x0000000000000710ull) | ||
145 | #define CVMX_PCIEEP_CFG453 \ | ||
146 | (0x0000000000000714ull) | ||
147 | #define CVMX_PCIEEP_CFG454 \ | ||
148 | (0x0000000000000718ull) | ||
149 | #define CVMX_PCIEEP_CFG455 \ | ||
150 | (0x000000000000071Cull) | ||
151 | #define CVMX_PCIEEP_CFG456 \ | ||
152 | (0x0000000000000720ull) | ||
153 | #define CVMX_PCIEEP_CFG458 \ | ||
154 | (0x0000000000000728ull) | ||
155 | #define CVMX_PCIEEP_CFG459 \ | ||
156 | (0x000000000000072Cull) | ||
157 | #define CVMX_PCIEEP_CFG460 \ | ||
158 | (0x0000000000000730ull) | ||
159 | #define CVMX_PCIEEP_CFG461 \ | ||
160 | (0x0000000000000734ull) | ||
161 | #define CVMX_PCIEEP_CFG462 \ | ||
162 | (0x0000000000000738ull) | ||
163 | #define CVMX_PCIEEP_CFG463 \ | ||
164 | (0x000000000000073Cull) | ||
165 | #define CVMX_PCIEEP_CFG464 \ | ||
166 | (0x0000000000000740ull) | ||
167 | #define CVMX_PCIEEP_CFG465 \ | ||
168 | (0x0000000000000744ull) | ||
169 | #define CVMX_PCIEEP_CFG466 \ | ||
170 | (0x0000000000000748ull) | ||
171 | #define CVMX_PCIEEP_CFG467 \ | ||
172 | (0x000000000000074Cull) | ||
173 | #define CVMX_PCIEEP_CFG468 \ | ||
174 | (0x0000000000000750ull) | ||
175 | #define CVMX_PCIEEP_CFG490 \ | ||
176 | (0x00000000000007A8ull) | ||
177 | #define CVMX_PCIEEP_CFG491 \ | ||
178 | (0x00000000000007ACull) | ||
179 | #define CVMX_PCIEEP_CFG492 \ | ||
180 | (0x00000000000007B0ull) | ||
181 | #define CVMX_PCIEEP_CFG516 \ | ||
182 | (0x0000000000000810ull) | ||
183 | #define CVMX_PCIEEP_CFG517 \ | ||
184 | (0x0000000000000814ull) | ||
185 | |||
186 | union cvmx_pcieep_cfg000 { | ||
187 | uint32_t u32; | ||
188 | struct cvmx_pcieep_cfg000_s { | ||
189 | uint32_t devid:16; | ||
190 | uint32_t vendid:16; | ||
191 | } s; | ||
192 | struct cvmx_pcieep_cfg000_s cn52xx; | ||
193 | struct cvmx_pcieep_cfg000_s cn52xxp1; | ||
194 | struct cvmx_pcieep_cfg000_s cn56xx; | ||
195 | struct cvmx_pcieep_cfg000_s cn56xxp1; | ||
196 | }; | ||
197 | |||
198 | union cvmx_pcieep_cfg001 { | ||
199 | uint32_t u32; | ||
200 | struct cvmx_pcieep_cfg001_s { | ||
201 | uint32_t dpe:1; | ||
202 | uint32_t sse:1; | ||
203 | uint32_t rma:1; | ||
204 | uint32_t rta:1; | ||
205 | uint32_t sta:1; | ||
206 | uint32_t devt:2; | ||
207 | uint32_t mdpe:1; | ||
208 | uint32_t fbb:1; | ||
209 | uint32_t reserved_22_22:1; | ||
210 | uint32_t m66:1; | ||
211 | uint32_t cl:1; | ||
212 | uint32_t i_stat:1; | ||
213 | uint32_t reserved_11_18:8; | ||
214 | uint32_t i_dis:1; | ||
215 | uint32_t fbbe:1; | ||
216 | uint32_t see:1; | ||
217 | uint32_t ids_wcc:1; | ||
218 | uint32_t per:1; | ||
219 | uint32_t vps:1; | ||
220 | uint32_t mwice:1; | ||
221 | uint32_t scse:1; | ||
222 | uint32_t me:1; | ||
223 | uint32_t msae:1; | ||
224 | uint32_t isae:1; | ||
225 | } s; | ||
226 | struct cvmx_pcieep_cfg001_s cn52xx; | ||
227 | struct cvmx_pcieep_cfg001_s cn52xxp1; | ||
228 | struct cvmx_pcieep_cfg001_s cn56xx; | ||
229 | struct cvmx_pcieep_cfg001_s cn56xxp1; | ||
230 | }; | ||
231 | |||
232 | union cvmx_pcieep_cfg002 { | ||
233 | uint32_t u32; | ||
234 | struct cvmx_pcieep_cfg002_s { | ||
235 | uint32_t bcc:8; | ||
236 | uint32_t sc:8; | ||
237 | uint32_t pi:8; | ||
238 | uint32_t rid:8; | ||
239 | } s; | ||
240 | struct cvmx_pcieep_cfg002_s cn52xx; | ||
241 | struct cvmx_pcieep_cfg002_s cn52xxp1; | ||
242 | struct cvmx_pcieep_cfg002_s cn56xx; | ||
243 | struct cvmx_pcieep_cfg002_s cn56xxp1; | ||
244 | }; | ||
245 | |||
246 | union cvmx_pcieep_cfg003 { | ||
247 | uint32_t u32; | ||
248 | struct cvmx_pcieep_cfg003_s { | ||
249 | uint32_t bist:8; | ||
250 | uint32_t mfd:1; | ||
251 | uint32_t chf:7; | ||
252 | uint32_t lt:8; | ||
253 | uint32_t cls:8; | ||
254 | } s; | ||
255 | struct cvmx_pcieep_cfg003_s cn52xx; | ||
256 | struct cvmx_pcieep_cfg003_s cn52xxp1; | ||
257 | struct cvmx_pcieep_cfg003_s cn56xx; | ||
258 | struct cvmx_pcieep_cfg003_s cn56xxp1; | ||
259 | }; | ||
260 | |||
261 | union cvmx_pcieep_cfg004 { | ||
262 | uint32_t u32; | ||
263 | struct cvmx_pcieep_cfg004_s { | ||
264 | uint32_t lbab:18; | ||
265 | uint32_t reserved_4_13:10; | ||
266 | uint32_t pf:1; | ||
267 | uint32_t typ:2; | ||
268 | uint32_t mspc:1; | ||
269 | } s; | ||
270 | struct cvmx_pcieep_cfg004_s cn52xx; | ||
271 | struct cvmx_pcieep_cfg004_s cn52xxp1; | ||
272 | struct cvmx_pcieep_cfg004_s cn56xx; | ||
273 | struct cvmx_pcieep_cfg004_s cn56xxp1; | ||
274 | }; | ||
275 | |||
276 | union cvmx_pcieep_cfg004_mask { | ||
277 | uint32_t u32; | ||
278 | struct cvmx_pcieep_cfg004_mask_s { | ||
279 | uint32_t lmask:31; | ||
280 | uint32_t enb:1; | ||
281 | } s; | ||
282 | struct cvmx_pcieep_cfg004_mask_s cn52xx; | ||
283 | struct cvmx_pcieep_cfg004_mask_s cn52xxp1; | ||
284 | struct cvmx_pcieep_cfg004_mask_s cn56xx; | ||
285 | struct cvmx_pcieep_cfg004_mask_s cn56xxp1; | ||
286 | }; | ||
287 | |||
288 | union cvmx_pcieep_cfg005 { | ||
289 | uint32_t u32; | ||
290 | struct cvmx_pcieep_cfg005_s { | ||
291 | uint32_t ubab:32; | ||
292 | } s; | ||
293 | struct cvmx_pcieep_cfg005_s cn52xx; | ||
294 | struct cvmx_pcieep_cfg005_s cn52xxp1; | ||
295 | struct cvmx_pcieep_cfg005_s cn56xx; | ||
296 | struct cvmx_pcieep_cfg005_s cn56xxp1; | ||
297 | }; | ||
298 | |||
299 | union cvmx_pcieep_cfg005_mask { | ||
300 | uint32_t u32; | ||
301 | struct cvmx_pcieep_cfg005_mask_s { | ||
302 | uint32_t umask:32; | ||
303 | } s; | ||
304 | struct cvmx_pcieep_cfg005_mask_s cn52xx; | ||
305 | struct cvmx_pcieep_cfg005_mask_s cn52xxp1; | ||
306 | struct cvmx_pcieep_cfg005_mask_s cn56xx; | ||
307 | struct cvmx_pcieep_cfg005_mask_s cn56xxp1; | ||
308 | }; | ||
309 | |||
310 | union cvmx_pcieep_cfg006 { | ||
311 | uint32_t u32; | ||
312 | struct cvmx_pcieep_cfg006_s { | ||
313 | uint32_t lbab:6; | ||
314 | uint32_t reserved_4_25:22; | ||
315 | uint32_t pf:1; | ||
316 | uint32_t typ:2; | ||
317 | uint32_t mspc:1; | ||
318 | } s; | ||
319 | struct cvmx_pcieep_cfg006_s cn52xx; | ||
320 | struct cvmx_pcieep_cfg006_s cn52xxp1; | ||
321 | struct cvmx_pcieep_cfg006_s cn56xx; | ||
322 | struct cvmx_pcieep_cfg006_s cn56xxp1; | ||
323 | }; | ||
324 | |||
325 | union cvmx_pcieep_cfg006_mask { | ||
326 | uint32_t u32; | ||
327 | struct cvmx_pcieep_cfg006_mask_s { | ||
328 | uint32_t lmask:31; | ||
329 | uint32_t enb:1; | ||
330 | } s; | ||
331 | struct cvmx_pcieep_cfg006_mask_s cn52xx; | ||
332 | struct cvmx_pcieep_cfg006_mask_s cn52xxp1; | ||
333 | struct cvmx_pcieep_cfg006_mask_s cn56xx; | ||
334 | struct cvmx_pcieep_cfg006_mask_s cn56xxp1; | ||
335 | }; | ||
336 | |||
337 | union cvmx_pcieep_cfg007 { | ||
338 | uint32_t u32; | ||
339 | struct cvmx_pcieep_cfg007_s { | ||
340 | uint32_t ubab:32; | ||
341 | } s; | ||
342 | struct cvmx_pcieep_cfg007_s cn52xx; | ||
343 | struct cvmx_pcieep_cfg007_s cn52xxp1; | ||
344 | struct cvmx_pcieep_cfg007_s cn56xx; | ||
345 | struct cvmx_pcieep_cfg007_s cn56xxp1; | ||
346 | }; | ||
347 | |||
348 | union cvmx_pcieep_cfg007_mask { | ||
349 | uint32_t u32; | ||
350 | struct cvmx_pcieep_cfg007_mask_s { | ||
351 | uint32_t umask:32; | ||
352 | } s; | ||
353 | struct cvmx_pcieep_cfg007_mask_s cn52xx; | ||
354 | struct cvmx_pcieep_cfg007_mask_s cn52xxp1; | ||
355 | struct cvmx_pcieep_cfg007_mask_s cn56xx; | ||
356 | struct cvmx_pcieep_cfg007_mask_s cn56xxp1; | ||
357 | }; | ||
358 | |||
359 | union cvmx_pcieep_cfg008 { | ||
360 | uint32_t u32; | ||
361 | struct cvmx_pcieep_cfg008_s { | ||
362 | uint32_t reserved_4_31:28; | ||
363 | uint32_t pf:1; | ||
364 | uint32_t typ:2; | ||
365 | uint32_t mspc:1; | ||
366 | } s; | ||
367 | struct cvmx_pcieep_cfg008_s cn52xx; | ||
368 | struct cvmx_pcieep_cfg008_s cn52xxp1; | ||
369 | struct cvmx_pcieep_cfg008_s cn56xx; | ||
370 | struct cvmx_pcieep_cfg008_s cn56xxp1; | ||
371 | }; | ||
372 | |||
373 | union cvmx_pcieep_cfg008_mask { | ||
374 | uint32_t u32; | ||
375 | struct cvmx_pcieep_cfg008_mask_s { | ||
376 | uint32_t lmask:31; | ||
377 | uint32_t enb:1; | ||
378 | } s; | ||
379 | struct cvmx_pcieep_cfg008_mask_s cn52xx; | ||
380 | struct cvmx_pcieep_cfg008_mask_s cn52xxp1; | ||
381 | struct cvmx_pcieep_cfg008_mask_s cn56xx; | ||
382 | struct cvmx_pcieep_cfg008_mask_s cn56xxp1; | ||
383 | }; | ||
384 | |||
385 | union cvmx_pcieep_cfg009 { | ||
386 | uint32_t u32; | ||
387 | struct cvmx_pcieep_cfg009_s { | ||
388 | uint32_t ubab:25; | ||
389 | uint32_t reserved_0_6:7; | ||
390 | } s; | ||
391 | struct cvmx_pcieep_cfg009_s cn52xx; | ||
392 | struct cvmx_pcieep_cfg009_s cn52xxp1; | ||
393 | struct cvmx_pcieep_cfg009_s cn56xx; | ||
394 | struct cvmx_pcieep_cfg009_s cn56xxp1; | ||
395 | }; | ||
396 | |||
397 | union cvmx_pcieep_cfg009_mask { | ||
398 | uint32_t u32; | ||
399 | struct cvmx_pcieep_cfg009_mask_s { | ||
400 | uint32_t umask:32; | ||
401 | } s; | ||
402 | struct cvmx_pcieep_cfg009_mask_s cn52xx; | ||
403 | struct cvmx_pcieep_cfg009_mask_s cn52xxp1; | ||
404 | struct cvmx_pcieep_cfg009_mask_s cn56xx; | ||
405 | struct cvmx_pcieep_cfg009_mask_s cn56xxp1; | ||
406 | }; | ||
407 | |||
408 | union cvmx_pcieep_cfg010 { | ||
409 | uint32_t u32; | ||
410 | struct cvmx_pcieep_cfg010_s { | ||
411 | uint32_t cisp:32; | ||
412 | } s; | ||
413 | struct cvmx_pcieep_cfg010_s cn52xx; | ||
414 | struct cvmx_pcieep_cfg010_s cn52xxp1; | ||
415 | struct cvmx_pcieep_cfg010_s cn56xx; | ||
416 | struct cvmx_pcieep_cfg010_s cn56xxp1; | ||
417 | }; | ||
418 | |||
419 | union cvmx_pcieep_cfg011 { | ||
420 | uint32_t u32; | ||
421 | struct cvmx_pcieep_cfg011_s { | ||
422 | uint32_t ssid:16; | ||
423 | uint32_t ssvid:16; | ||
424 | } s; | ||
425 | struct cvmx_pcieep_cfg011_s cn52xx; | ||
426 | struct cvmx_pcieep_cfg011_s cn52xxp1; | ||
427 | struct cvmx_pcieep_cfg011_s cn56xx; | ||
428 | struct cvmx_pcieep_cfg011_s cn56xxp1; | ||
429 | }; | ||
430 | |||
431 | union cvmx_pcieep_cfg012 { | ||
432 | uint32_t u32; | ||
433 | struct cvmx_pcieep_cfg012_s { | ||
434 | uint32_t eraddr:16; | ||
435 | uint32_t reserved_1_15:15; | ||
436 | uint32_t er_en:1; | ||
437 | } s; | ||
438 | struct cvmx_pcieep_cfg012_s cn52xx; | ||
439 | struct cvmx_pcieep_cfg012_s cn52xxp1; | ||
440 | struct cvmx_pcieep_cfg012_s cn56xx; | ||
441 | struct cvmx_pcieep_cfg012_s cn56xxp1; | ||
442 | }; | ||
443 | |||
444 | union cvmx_pcieep_cfg012_mask { | ||
445 | uint32_t u32; | ||
446 | struct cvmx_pcieep_cfg012_mask_s { | ||
447 | uint32_t mask:31; | ||
448 | uint32_t enb:1; | ||
449 | } s; | ||
450 | struct cvmx_pcieep_cfg012_mask_s cn52xx; | ||
451 | struct cvmx_pcieep_cfg012_mask_s cn52xxp1; | ||
452 | struct cvmx_pcieep_cfg012_mask_s cn56xx; | ||
453 | struct cvmx_pcieep_cfg012_mask_s cn56xxp1; | ||
454 | }; | ||
455 | |||
456 | union cvmx_pcieep_cfg013 { | ||
457 | uint32_t u32; | ||
458 | struct cvmx_pcieep_cfg013_s { | ||
459 | uint32_t reserved_8_31:24; | ||
460 | uint32_t cp:8; | ||
461 | } s; | ||
462 | struct cvmx_pcieep_cfg013_s cn52xx; | ||
463 | struct cvmx_pcieep_cfg013_s cn52xxp1; | ||
464 | struct cvmx_pcieep_cfg013_s cn56xx; | ||
465 | struct cvmx_pcieep_cfg013_s cn56xxp1; | ||
466 | }; | ||
467 | |||
468 | union cvmx_pcieep_cfg015 { | ||
469 | uint32_t u32; | ||
470 | struct cvmx_pcieep_cfg015_s { | ||
471 | uint32_t ml:8; | ||
472 | uint32_t mg:8; | ||
473 | uint32_t inta:8; | ||
474 | uint32_t il:8; | ||
475 | } s; | ||
476 | struct cvmx_pcieep_cfg015_s cn52xx; | ||
477 | struct cvmx_pcieep_cfg015_s cn52xxp1; | ||
478 | struct cvmx_pcieep_cfg015_s cn56xx; | ||
479 | struct cvmx_pcieep_cfg015_s cn56xxp1; | ||
480 | }; | ||
481 | |||
482 | union cvmx_pcieep_cfg016 { | ||
483 | uint32_t u32; | ||
484 | struct cvmx_pcieep_cfg016_s { | ||
485 | uint32_t pmes:5; | ||
486 | uint32_t d2s:1; | ||
487 | uint32_t d1s:1; | ||
488 | uint32_t auxc:3; | ||
489 | uint32_t dsi:1; | ||
490 | uint32_t reserved_20_20:1; | ||
491 | uint32_t pme_clock:1; | ||
492 | uint32_t pmsv:3; | ||
493 | uint32_t ncp:8; | ||
494 | uint32_t pmcid:8; | ||
495 | } s; | ||
496 | struct cvmx_pcieep_cfg016_s cn52xx; | ||
497 | struct cvmx_pcieep_cfg016_s cn52xxp1; | ||
498 | struct cvmx_pcieep_cfg016_s cn56xx; | ||
499 | struct cvmx_pcieep_cfg016_s cn56xxp1; | ||
500 | }; | ||
501 | |||
502 | union cvmx_pcieep_cfg017 { | ||
503 | uint32_t u32; | ||
504 | struct cvmx_pcieep_cfg017_s { | ||
505 | uint32_t pmdia:8; | ||
506 | uint32_t bpccee:1; | ||
507 | uint32_t bd3h:1; | ||
508 | uint32_t reserved_16_21:6; | ||
509 | uint32_t pmess:1; | ||
510 | uint32_t pmedsia:2; | ||
511 | uint32_t pmds:4; | ||
512 | uint32_t pmeens:1; | ||
513 | uint32_t reserved_4_7:4; | ||
514 | uint32_t nsr:1; | ||
515 | uint32_t reserved_2_2:1; | ||
516 | uint32_t ps:2; | ||
517 | } s; | ||
518 | struct cvmx_pcieep_cfg017_s cn52xx; | ||
519 | struct cvmx_pcieep_cfg017_s cn52xxp1; | ||
520 | struct cvmx_pcieep_cfg017_s cn56xx; | ||
521 | struct cvmx_pcieep_cfg017_s cn56xxp1; | ||
522 | }; | ||
523 | |||
524 | union cvmx_pcieep_cfg020 { | ||
525 | uint32_t u32; | ||
526 | struct cvmx_pcieep_cfg020_s { | ||
527 | uint32_t reserved_24_31:8; | ||
528 | uint32_t m64:1; | ||
529 | uint32_t mme:3; | ||
530 | uint32_t mmc:3; | ||
531 | uint32_t msien:1; | ||
532 | uint32_t ncp:8; | ||
533 | uint32_t msicid:8; | ||
534 | } s; | ||
535 | struct cvmx_pcieep_cfg020_s cn52xx; | ||
536 | struct cvmx_pcieep_cfg020_s cn52xxp1; | ||
537 | struct cvmx_pcieep_cfg020_s cn56xx; | ||
538 | struct cvmx_pcieep_cfg020_s cn56xxp1; | ||
539 | }; | ||
540 | |||
541 | union cvmx_pcieep_cfg021 { | ||
542 | uint32_t u32; | ||
543 | struct cvmx_pcieep_cfg021_s { | ||
544 | uint32_t lmsi:30; | ||
545 | uint32_t reserved_0_1:2; | ||
546 | } s; | ||
547 | struct cvmx_pcieep_cfg021_s cn52xx; | ||
548 | struct cvmx_pcieep_cfg021_s cn52xxp1; | ||
549 | struct cvmx_pcieep_cfg021_s cn56xx; | ||
550 | struct cvmx_pcieep_cfg021_s cn56xxp1; | ||
551 | }; | ||
552 | |||
553 | union cvmx_pcieep_cfg022 { | ||
554 | uint32_t u32; | ||
555 | struct cvmx_pcieep_cfg022_s { | ||
556 | uint32_t umsi:32; | ||
557 | } s; | ||
558 | struct cvmx_pcieep_cfg022_s cn52xx; | ||
559 | struct cvmx_pcieep_cfg022_s cn52xxp1; | ||
560 | struct cvmx_pcieep_cfg022_s cn56xx; | ||
561 | struct cvmx_pcieep_cfg022_s cn56xxp1; | ||
562 | }; | ||
563 | |||
564 | union cvmx_pcieep_cfg023 { | ||
565 | uint32_t u32; | ||
566 | struct cvmx_pcieep_cfg023_s { | ||
567 | uint32_t reserved_16_31:16; | ||
568 | uint32_t msimd:16; | ||
569 | } s; | ||
570 | struct cvmx_pcieep_cfg023_s cn52xx; | ||
571 | struct cvmx_pcieep_cfg023_s cn52xxp1; | ||
572 | struct cvmx_pcieep_cfg023_s cn56xx; | ||
573 | struct cvmx_pcieep_cfg023_s cn56xxp1; | ||
574 | }; | ||
575 | |||
576 | union cvmx_pcieep_cfg028 { | ||
577 | uint32_t u32; | ||
578 | struct cvmx_pcieep_cfg028_s { | ||
579 | uint32_t reserved_30_31:2; | ||
580 | uint32_t imn:5; | ||
581 | uint32_t si:1; | ||
582 | uint32_t dpt:4; | ||
583 | uint32_t pciecv:4; | ||
584 | uint32_t ncp:8; | ||
585 | uint32_t pcieid:8; | ||
586 | } s; | ||
587 | struct cvmx_pcieep_cfg028_s cn52xx; | ||
588 | struct cvmx_pcieep_cfg028_s cn52xxp1; | ||
589 | struct cvmx_pcieep_cfg028_s cn56xx; | ||
590 | struct cvmx_pcieep_cfg028_s cn56xxp1; | ||
591 | }; | ||
592 | |||
593 | union cvmx_pcieep_cfg029 { | ||
594 | uint32_t u32; | ||
595 | struct cvmx_pcieep_cfg029_s { | ||
596 | uint32_t reserved_28_31:4; | ||
597 | uint32_t cspls:2; | ||
598 | uint32_t csplv:8; | ||
599 | uint32_t reserved_16_17:2; | ||
600 | uint32_t rber:1; | ||
601 | uint32_t reserved_12_14:3; | ||
602 | uint32_t el1al:3; | ||
603 | uint32_t el0al:3; | ||
604 | uint32_t etfs:1; | ||
605 | uint32_t pfs:2; | ||
606 | uint32_t mpss:3; | ||
607 | } s; | ||
608 | struct cvmx_pcieep_cfg029_s cn52xx; | ||
609 | struct cvmx_pcieep_cfg029_s cn52xxp1; | ||
610 | struct cvmx_pcieep_cfg029_s cn56xx; | ||
611 | struct cvmx_pcieep_cfg029_s cn56xxp1; | ||
612 | }; | ||
613 | |||
614 | union cvmx_pcieep_cfg030 { | ||
615 | uint32_t u32; | ||
616 | struct cvmx_pcieep_cfg030_s { | ||
617 | uint32_t reserved_22_31:10; | ||
618 | uint32_t tp:1; | ||
619 | uint32_t ap_d:1; | ||
620 | uint32_t ur_d:1; | ||
621 | uint32_t fe_d:1; | ||
622 | uint32_t nfe_d:1; | ||
623 | uint32_t ce_d:1; | ||
624 | uint32_t reserved_15_15:1; | ||
625 | uint32_t mrrs:3; | ||
626 | uint32_t ns_en:1; | ||
627 | uint32_t ap_en:1; | ||
628 | uint32_t pf_en:1; | ||
629 | uint32_t etf_en:1; | ||
630 | uint32_t mps:3; | ||
631 | uint32_t ro_en:1; | ||
632 | uint32_t ur_en:1; | ||
633 | uint32_t fe_en:1; | ||
634 | uint32_t nfe_en:1; | ||
635 | uint32_t ce_en:1; | ||
636 | } s; | ||
637 | struct cvmx_pcieep_cfg030_s cn52xx; | ||
638 | struct cvmx_pcieep_cfg030_s cn52xxp1; | ||
639 | struct cvmx_pcieep_cfg030_s cn56xx; | ||
640 | struct cvmx_pcieep_cfg030_s cn56xxp1; | ||
641 | }; | ||
642 | |||
643 | union cvmx_pcieep_cfg031 { | ||
644 | uint32_t u32; | ||
645 | struct cvmx_pcieep_cfg031_s { | ||
646 | uint32_t pnum:8; | ||
647 | uint32_t reserved_22_23:2; | ||
648 | uint32_t lbnc:1; | ||
649 | uint32_t dllarc:1; | ||
650 | uint32_t sderc:1; | ||
651 | uint32_t cpm:1; | ||
652 | uint32_t l1el:3; | ||
653 | uint32_t l0el:3; | ||
654 | uint32_t aslpms:2; | ||
655 | uint32_t mlw:6; | ||
656 | uint32_t mls:4; | ||
657 | } s; | ||
658 | struct cvmx_pcieep_cfg031_s cn52xx; | ||
659 | struct cvmx_pcieep_cfg031_s cn52xxp1; | ||
660 | struct cvmx_pcieep_cfg031_s cn56xx; | ||
661 | struct cvmx_pcieep_cfg031_s cn56xxp1; | ||
662 | }; | ||
663 | |||
664 | union cvmx_pcieep_cfg032 { | ||
665 | uint32_t u32; | ||
666 | struct cvmx_pcieep_cfg032_s { | ||
667 | uint32_t reserved_30_31:2; | ||
668 | uint32_t dlla:1; | ||
669 | uint32_t scc:1; | ||
670 | uint32_t lt:1; | ||
671 | uint32_t reserved_26_26:1; | ||
672 | uint32_t nlw:6; | ||
673 | uint32_t ls:4; | ||
674 | uint32_t reserved_10_15:6; | ||
675 | uint32_t hawd:1; | ||
676 | uint32_t ecpm:1; | ||
677 | uint32_t es:1; | ||
678 | uint32_t ccc:1; | ||
679 | uint32_t rl:1; | ||
680 | uint32_t ld:1; | ||
681 | uint32_t rcb:1; | ||
682 | uint32_t reserved_2_2:1; | ||
683 | uint32_t aslpc:2; | ||
684 | } s; | ||
685 | struct cvmx_pcieep_cfg032_s cn52xx; | ||
686 | struct cvmx_pcieep_cfg032_s cn52xxp1; | ||
687 | struct cvmx_pcieep_cfg032_s cn56xx; | ||
688 | struct cvmx_pcieep_cfg032_s cn56xxp1; | ||
689 | }; | ||
690 | |||
691 | union cvmx_pcieep_cfg033 { | ||
692 | uint32_t u32; | ||
693 | struct cvmx_pcieep_cfg033_s { | ||
694 | uint32_t ps_num:13; | ||
695 | uint32_t nccs:1; | ||
696 | uint32_t emip:1; | ||
697 | uint32_t sp_ls:2; | ||
698 | uint32_t sp_lv:8; | ||
699 | uint32_t hp_c:1; | ||
700 | uint32_t hp_s:1; | ||
701 | uint32_t pip:1; | ||
702 | uint32_t aip:1; | ||
703 | uint32_t mrlsp:1; | ||
704 | uint32_t pcp:1; | ||
705 | uint32_t abp:1; | ||
706 | } s; | ||
707 | struct cvmx_pcieep_cfg033_s cn52xx; | ||
708 | struct cvmx_pcieep_cfg033_s cn52xxp1; | ||
709 | struct cvmx_pcieep_cfg033_s cn56xx; | ||
710 | struct cvmx_pcieep_cfg033_s cn56xxp1; | ||
711 | }; | ||
712 | |||
713 | union cvmx_pcieep_cfg034 { | ||
714 | uint32_t u32; | ||
715 | struct cvmx_pcieep_cfg034_s { | ||
716 | uint32_t reserved_25_31:7; | ||
717 | uint32_t dlls_c:1; | ||
718 | uint32_t emis:1; | ||
719 | uint32_t pds:1; | ||
720 | uint32_t mrlss:1; | ||
721 | uint32_t ccint_d:1; | ||
722 | uint32_t pd_c:1; | ||
723 | uint32_t mrls_c:1; | ||
724 | uint32_t pf_d:1; | ||
725 | uint32_t abp_d:1; | ||
726 | uint32_t reserved_13_15:3; | ||
727 | uint32_t dlls_en:1; | ||
728 | uint32_t emic:1; | ||
729 | uint32_t pcc:1; | ||
730 | uint32_t pic:2; | ||
731 | uint32_t aic:2; | ||
732 | uint32_t hpint_en:1; | ||
733 | uint32_t ccint_en:1; | ||
734 | uint32_t pd_en:1; | ||
735 | uint32_t mrls_en:1; | ||
736 | uint32_t pf_en:1; | ||
737 | uint32_t abp_en:1; | ||
738 | } s; | ||
739 | struct cvmx_pcieep_cfg034_s cn52xx; | ||
740 | struct cvmx_pcieep_cfg034_s cn52xxp1; | ||
741 | struct cvmx_pcieep_cfg034_s cn56xx; | ||
742 | struct cvmx_pcieep_cfg034_s cn56xxp1; | ||
743 | }; | ||
744 | |||
745 | union cvmx_pcieep_cfg037 { | ||
746 | uint32_t u32; | ||
747 | struct cvmx_pcieep_cfg037_s { | ||
748 | uint32_t reserved_5_31:27; | ||
749 | uint32_t ctds:1; | ||
750 | uint32_t ctrs:4; | ||
751 | } s; | ||
752 | struct cvmx_pcieep_cfg037_s cn52xx; | ||
753 | struct cvmx_pcieep_cfg037_s cn52xxp1; | ||
754 | struct cvmx_pcieep_cfg037_s cn56xx; | ||
755 | struct cvmx_pcieep_cfg037_s cn56xxp1; | ||
756 | }; | ||
757 | |||
758 | union cvmx_pcieep_cfg038 { | ||
759 | uint32_t u32; | ||
760 | struct cvmx_pcieep_cfg038_s { | ||
761 | uint32_t reserved_5_31:27; | ||
762 | uint32_t ctd:1; | ||
763 | uint32_t ctv:4; | ||
764 | } s; | ||
765 | struct cvmx_pcieep_cfg038_s cn52xx; | ||
766 | struct cvmx_pcieep_cfg038_s cn52xxp1; | ||
767 | struct cvmx_pcieep_cfg038_s cn56xx; | ||
768 | struct cvmx_pcieep_cfg038_s cn56xxp1; | ||
769 | }; | ||
770 | |||
771 | union cvmx_pcieep_cfg039 { | ||
772 | uint32_t u32; | ||
773 | struct cvmx_pcieep_cfg039_s { | ||
774 | uint32_t reserved_0_31:32; | ||
775 | } s; | ||
776 | struct cvmx_pcieep_cfg039_s cn52xx; | ||
777 | struct cvmx_pcieep_cfg039_s cn52xxp1; | ||
778 | struct cvmx_pcieep_cfg039_s cn56xx; | ||
779 | struct cvmx_pcieep_cfg039_s cn56xxp1; | ||
780 | }; | ||
781 | |||
782 | union cvmx_pcieep_cfg040 { | ||
783 | uint32_t u32; | ||
784 | struct cvmx_pcieep_cfg040_s { | ||
785 | uint32_t reserved_0_31:32; | ||
786 | } s; | ||
787 | struct cvmx_pcieep_cfg040_s cn52xx; | ||
788 | struct cvmx_pcieep_cfg040_s cn52xxp1; | ||
789 | struct cvmx_pcieep_cfg040_s cn56xx; | ||
790 | struct cvmx_pcieep_cfg040_s cn56xxp1; | ||
791 | }; | ||
792 | |||
793 | union cvmx_pcieep_cfg041 { | ||
794 | uint32_t u32; | ||
795 | struct cvmx_pcieep_cfg041_s { | ||
796 | uint32_t reserved_0_31:32; | ||
797 | } s; | ||
798 | struct cvmx_pcieep_cfg041_s cn52xx; | ||
799 | struct cvmx_pcieep_cfg041_s cn52xxp1; | ||
800 | struct cvmx_pcieep_cfg041_s cn56xx; | ||
801 | struct cvmx_pcieep_cfg041_s cn56xxp1; | ||
802 | }; | ||
803 | |||
804 | union cvmx_pcieep_cfg042 { | ||
805 | uint32_t u32; | ||
806 | struct cvmx_pcieep_cfg042_s { | ||
807 | uint32_t reserved_0_31:32; | ||
808 | } s; | ||
809 | struct cvmx_pcieep_cfg042_s cn52xx; | ||
810 | struct cvmx_pcieep_cfg042_s cn52xxp1; | ||
811 | struct cvmx_pcieep_cfg042_s cn56xx; | ||
812 | struct cvmx_pcieep_cfg042_s cn56xxp1; | ||
813 | }; | ||
814 | |||
815 | union cvmx_pcieep_cfg064 { | ||
816 | uint32_t u32; | ||
817 | struct cvmx_pcieep_cfg064_s { | ||
818 | uint32_t nco:12; | ||
819 | uint32_t cv:4; | ||
820 | uint32_t pcieec:16; | ||
821 | } s; | ||
822 | struct cvmx_pcieep_cfg064_s cn52xx; | ||
823 | struct cvmx_pcieep_cfg064_s cn52xxp1; | ||
824 | struct cvmx_pcieep_cfg064_s cn56xx; | ||
825 | struct cvmx_pcieep_cfg064_s cn56xxp1; | ||
826 | }; | ||
827 | |||
828 | union cvmx_pcieep_cfg065 { | ||
829 | uint32_t u32; | ||
830 | struct cvmx_pcieep_cfg065_s { | ||
831 | uint32_t reserved_21_31:11; | ||
832 | uint32_t ures:1; | ||
833 | uint32_t ecrces:1; | ||
834 | uint32_t mtlps:1; | ||
835 | uint32_t ros:1; | ||
836 | uint32_t ucs:1; | ||
837 | uint32_t cas:1; | ||
838 | uint32_t cts:1; | ||
839 | uint32_t fcpes:1; | ||
840 | uint32_t ptlps:1; | ||
841 | uint32_t reserved_6_11:6; | ||
842 | uint32_t sdes:1; | ||
843 | uint32_t dlpes:1; | ||
844 | uint32_t reserved_0_3:4; | ||
845 | } s; | ||
846 | struct cvmx_pcieep_cfg065_s cn52xx; | ||
847 | struct cvmx_pcieep_cfg065_s cn52xxp1; | ||
848 | struct cvmx_pcieep_cfg065_s cn56xx; | ||
849 | struct cvmx_pcieep_cfg065_s cn56xxp1; | ||
850 | }; | ||
851 | |||
852 | union cvmx_pcieep_cfg066 { | ||
853 | uint32_t u32; | ||
854 | struct cvmx_pcieep_cfg066_s { | ||
855 | uint32_t reserved_21_31:11; | ||
856 | uint32_t urem:1; | ||
857 | uint32_t ecrcem:1; | ||
858 | uint32_t mtlpm:1; | ||
859 | uint32_t rom:1; | ||
860 | uint32_t ucm:1; | ||
861 | uint32_t cam:1; | ||
862 | uint32_t ctm:1; | ||
863 | uint32_t fcpem:1; | ||
864 | uint32_t ptlpm:1; | ||
865 | uint32_t reserved_6_11:6; | ||
866 | uint32_t sdem:1; | ||
867 | uint32_t dlpem:1; | ||
868 | uint32_t reserved_0_3:4; | ||
869 | } s; | ||
870 | struct cvmx_pcieep_cfg066_s cn52xx; | ||
871 | struct cvmx_pcieep_cfg066_s cn52xxp1; | ||
872 | struct cvmx_pcieep_cfg066_s cn56xx; | ||
873 | struct cvmx_pcieep_cfg066_s cn56xxp1; | ||
874 | }; | ||
875 | |||
876 | union cvmx_pcieep_cfg067 { | ||
877 | uint32_t u32; | ||
878 | struct cvmx_pcieep_cfg067_s { | ||
879 | uint32_t reserved_21_31:11; | ||
880 | uint32_t ures:1; | ||
881 | uint32_t ecrces:1; | ||
882 | uint32_t mtlps:1; | ||
883 | uint32_t ros:1; | ||
884 | uint32_t ucs:1; | ||
885 | uint32_t cas:1; | ||
886 | uint32_t cts:1; | ||
887 | uint32_t fcpes:1; | ||
888 | uint32_t ptlps:1; | ||
889 | uint32_t reserved_6_11:6; | ||
890 | uint32_t sdes:1; | ||
891 | uint32_t dlpes:1; | ||
892 | uint32_t reserved_0_3:4; | ||
893 | } s; | ||
894 | struct cvmx_pcieep_cfg067_s cn52xx; | ||
895 | struct cvmx_pcieep_cfg067_s cn52xxp1; | ||
896 | struct cvmx_pcieep_cfg067_s cn56xx; | ||
897 | struct cvmx_pcieep_cfg067_s cn56xxp1; | ||
898 | }; | ||
899 | |||
900 | union cvmx_pcieep_cfg068 { | ||
901 | uint32_t u32; | ||
902 | struct cvmx_pcieep_cfg068_s { | ||
903 | uint32_t reserved_14_31:18; | ||
904 | uint32_t anfes:1; | ||
905 | uint32_t rtts:1; | ||
906 | uint32_t reserved_9_11:3; | ||
907 | uint32_t rnrs:1; | ||
908 | uint32_t bdllps:1; | ||
909 | uint32_t btlps:1; | ||
910 | uint32_t reserved_1_5:5; | ||
911 | uint32_t res:1; | ||
912 | } s; | ||
913 | struct cvmx_pcieep_cfg068_s cn52xx; | ||
914 | struct cvmx_pcieep_cfg068_s cn52xxp1; | ||
915 | struct cvmx_pcieep_cfg068_s cn56xx; | ||
916 | struct cvmx_pcieep_cfg068_s cn56xxp1; | ||
917 | }; | ||
918 | |||
919 | union cvmx_pcieep_cfg069 { | ||
920 | uint32_t u32; | ||
921 | struct cvmx_pcieep_cfg069_s { | ||
922 | uint32_t reserved_14_31:18; | ||
923 | uint32_t anfem:1; | ||
924 | uint32_t rttm:1; | ||
925 | uint32_t reserved_9_11:3; | ||
926 | uint32_t rnrm:1; | ||
927 | uint32_t bdllpm:1; | ||
928 | uint32_t btlpm:1; | ||
929 | uint32_t reserved_1_5:5; | ||
930 | uint32_t rem:1; | ||
931 | } s; | ||
932 | struct cvmx_pcieep_cfg069_s cn52xx; | ||
933 | struct cvmx_pcieep_cfg069_s cn52xxp1; | ||
934 | struct cvmx_pcieep_cfg069_s cn56xx; | ||
935 | struct cvmx_pcieep_cfg069_s cn56xxp1; | ||
936 | }; | ||
937 | |||
938 | union cvmx_pcieep_cfg070 { | ||
939 | uint32_t u32; | ||
940 | struct cvmx_pcieep_cfg070_s { | ||
941 | uint32_t reserved_9_31:23; | ||
942 | uint32_t ce:1; | ||
943 | uint32_t cc:1; | ||
944 | uint32_t ge:1; | ||
945 | uint32_t gc:1; | ||
946 | uint32_t fep:5; | ||
947 | } s; | ||
948 | struct cvmx_pcieep_cfg070_s cn52xx; | ||
949 | struct cvmx_pcieep_cfg070_s cn52xxp1; | ||
950 | struct cvmx_pcieep_cfg070_s cn56xx; | ||
951 | struct cvmx_pcieep_cfg070_s cn56xxp1; | ||
952 | }; | ||
953 | |||
954 | union cvmx_pcieep_cfg071 { | ||
955 | uint32_t u32; | ||
956 | struct cvmx_pcieep_cfg071_s { | ||
957 | uint32_t dword1:32; | ||
958 | } s; | ||
959 | struct cvmx_pcieep_cfg071_s cn52xx; | ||
960 | struct cvmx_pcieep_cfg071_s cn52xxp1; | ||
961 | struct cvmx_pcieep_cfg071_s cn56xx; | ||
962 | struct cvmx_pcieep_cfg071_s cn56xxp1; | ||
963 | }; | ||
964 | |||
965 | union cvmx_pcieep_cfg072 { | ||
966 | uint32_t u32; | ||
967 | struct cvmx_pcieep_cfg072_s { | ||
968 | uint32_t dword2:32; | ||
969 | } s; | ||
970 | struct cvmx_pcieep_cfg072_s cn52xx; | ||
971 | struct cvmx_pcieep_cfg072_s cn52xxp1; | ||
972 | struct cvmx_pcieep_cfg072_s cn56xx; | ||
973 | struct cvmx_pcieep_cfg072_s cn56xxp1; | ||
974 | }; | ||
975 | |||
976 | union cvmx_pcieep_cfg073 { | ||
977 | uint32_t u32; | ||
978 | struct cvmx_pcieep_cfg073_s { | ||
979 | uint32_t dword3:32; | ||
980 | } s; | ||
981 | struct cvmx_pcieep_cfg073_s cn52xx; | ||
982 | struct cvmx_pcieep_cfg073_s cn52xxp1; | ||
983 | struct cvmx_pcieep_cfg073_s cn56xx; | ||
984 | struct cvmx_pcieep_cfg073_s cn56xxp1; | ||
985 | }; | ||
986 | |||
987 | union cvmx_pcieep_cfg074 { | ||
988 | uint32_t u32; | ||
989 | struct cvmx_pcieep_cfg074_s { | ||
990 | uint32_t dword4:32; | ||
991 | } s; | ||
992 | struct cvmx_pcieep_cfg074_s cn52xx; | ||
993 | struct cvmx_pcieep_cfg074_s cn52xxp1; | ||
994 | struct cvmx_pcieep_cfg074_s cn56xx; | ||
995 | struct cvmx_pcieep_cfg074_s cn56xxp1; | ||
996 | }; | ||
997 | |||
998 | union cvmx_pcieep_cfg448 { | ||
999 | uint32_t u32; | ||
1000 | struct cvmx_pcieep_cfg448_s { | ||
1001 | uint32_t rtl:16; | ||
1002 | uint32_t rtltl:16; | ||
1003 | } s; | ||
1004 | struct cvmx_pcieep_cfg448_s cn52xx; | ||
1005 | struct cvmx_pcieep_cfg448_s cn52xxp1; | ||
1006 | struct cvmx_pcieep_cfg448_s cn56xx; | ||
1007 | struct cvmx_pcieep_cfg448_s cn56xxp1; | ||
1008 | }; | ||
1009 | |||
1010 | union cvmx_pcieep_cfg449 { | ||
1011 | uint32_t u32; | ||
1012 | struct cvmx_pcieep_cfg449_s { | ||
1013 | uint32_t omr:32; | ||
1014 | } s; | ||
1015 | struct cvmx_pcieep_cfg449_s cn52xx; | ||
1016 | struct cvmx_pcieep_cfg449_s cn52xxp1; | ||
1017 | struct cvmx_pcieep_cfg449_s cn56xx; | ||
1018 | struct cvmx_pcieep_cfg449_s cn56xxp1; | ||
1019 | }; | ||
1020 | |||
1021 | union cvmx_pcieep_cfg450 { | ||
1022 | uint32_t u32; | ||
1023 | struct cvmx_pcieep_cfg450_s { | ||
1024 | uint32_t lpec:8; | ||
1025 | uint32_t reserved_22_23:2; | ||
1026 | uint32_t link_state:6; | ||
1027 | uint32_t force_link:1; | ||
1028 | uint32_t reserved_8_14:7; | ||
1029 | uint32_t link_num:8; | ||
1030 | } s; | ||
1031 | struct cvmx_pcieep_cfg450_s cn52xx; | ||
1032 | struct cvmx_pcieep_cfg450_s cn52xxp1; | ||
1033 | struct cvmx_pcieep_cfg450_s cn56xx; | ||
1034 | struct cvmx_pcieep_cfg450_s cn56xxp1; | ||
1035 | }; | ||
1036 | |||
1037 | union cvmx_pcieep_cfg451 { | ||
1038 | uint32_t u32; | ||
1039 | struct cvmx_pcieep_cfg451_s { | ||
1040 | uint32_t reserved_30_31:2; | ||
1041 | uint32_t l1el:3; | ||
1042 | uint32_t l0el:3; | ||
1043 | uint32_t n_fts_cc:8; | ||
1044 | uint32_t n_fts:8; | ||
1045 | uint32_t ack_freq:8; | ||
1046 | } s; | ||
1047 | struct cvmx_pcieep_cfg451_s cn52xx; | ||
1048 | struct cvmx_pcieep_cfg451_s cn52xxp1; | ||
1049 | struct cvmx_pcieep_cfg451_s cn56xx; | ||
1050 | struct cvmx_pcieep_cfg451_s cn56xxp1; | ||
1051 | }; | ||
1052 | |||
1053 | union cvmx_pcieep_cfg452 { | ||
1054 | uint32_t u32; | ||
1055 | struct cvmx_pcieep_cfg452_s { | ||
1056 | uint32_t reserved_26_31:6; | ||
1057 | uint32_t eccrc:1; | ||
1058 | uint32_t reserved_22_24:3; | ||
1059 | uint32_t lme:6; | ||
1060 | uint32_t reserved_8_15:8; | ||
1061 | uint32_t flm:1; | ||
1062 | uint32_t reserved_6_6:1; | ||
1063 | uint32_t dllle:1; | ||
1064 | uint32_t reserved_4_4:1; | ||
1065 | uint32_t ra:1; | ||
1066 | uint32_t le:1; | ||
1067 | uint32_t sd:1; | ||
1068 | uint32_t omr:1; | ||
1069 | } s; | ||
1070 | struct cvmx_pcieep_cfg452_s cn52xx; | ||
1071 | struct cvmx_pcieep_cfg452_s cn52xxp1; | ||
1072 | struct cvmx_pcieep_cfg452_s cn56xx; | ||
1073 | struct cvmx_pcieep_cfg452_s cn56xxp1; | ||
1074 | }; | ||
1075 | |||
1076 | union cvmx_pcieep_cfg453 { | ||
1077 | uint32_t u32; | ||
1078 | struct cvmx_pcieep_cfg453_s { | ||
1079 | uint32_t dlld:1; | ||
1080 | uint32_t reserved_26_30:5; | ||
1081 | uint32_t ack_nak:1; | ||
1082 | uint32_t fcd:1; | ||
1083 | uint32_t ilst:24; | ||
1084 | } s; | ||
1085 | struct cvmx_pcieep_cfg453_s cn52xx; | ||
1086 | struct cvmx_pcieep_cfg453_s cn52xxp1; | ||
1087 | struct cvmx_pcieep_cfg453_s cn56xx; | ||
1088 | struct cvmx_pcieep_cfg453_s cn56xxp1; | ||
1089 | }; | ||
1090 | |||
1091 | union cvmx_pcieep_cfg454 { | ||
1092 | uint32_t u32; | ||
1093 | struct cvmx_pcieep_cfg454_s { | ||
1094 | uint32_t reserved_29_31:3; | ||
1095 | uint32_t tmfcwt:5; | ||
1096 | uint32_t tmanlt:5; | ||
1097 | uint32_t tmrt:5; | ||
1098 | uint32_t reserved_11_13:3; | ||
1099 | uint32_t nskps:3; | ||
1100 | uint32_t reserved_4_7:4; | ||
1101 | uint32_t ntss:4; | ||
1102 | } s; | ||
1103 | struct cvmx_pcieep_cfg454_s cn52xx; | ||
1104 | struct cvmx_pcieep_cfg454_s cn52xxp1; | ||
1105 | struct cvmx_pcieep_cfg454_s cn56xx; | ||
1106 | struct cvmx_pcieep_cfg454_s cn56xxp1; | ||
1107 | }; | ||
1108 | |||
1109 | union cvmx_pcieep_cfg455 { | ||
1110 | uint32_t u32; | ||
1111 | struct cvmx_pcieep_cfg455_s { | ||
1112 | uint32_t m_cfg0_filt:1; | ||
1113 | uint32_t m_io_filt:1; | ||
1114 | uint32_t msg_ctrl:1; | ||
1115 | uint32_t m_cpl_ecrc_filt:1; | ||
1116 | uint32_t m_ecrc_filt:1; | ||
1117 | uint32_t m_cpl_len_err:1; | ||
1118 | uint32_t m_cpl_attr_err:1; | ||
1119 | uint32_t m_cpl_tc_err:1; | ||
1120 | uint32_t m_cpl_fun_err:1; | ||
1121 | uint32_t m_cpl_rid_err:1; | ||
1122 | uint32_t m_cpl_tag_err:1; | ||
1123 | uint32_t m_lk_filt:1; | ||
1124 | uint32_t m_cfg1_filt:1; | ||
1125 | uint32_t m_bar_match:1; | ||
1126 | uint32_t m_pois_filt:1; | ||
1127 | uint32_t m_fun:1; | ||
1128 | uint32_t dfcwt:1; | ||
1129 | uint32_t reserved_11_14:4; | ||
1130 | uint32_t skpiv:11; | ||
1131 | } s; | ||
1132 | struct cvmx_pcieep_cfg455_s cn52xx; | ||
1133 | struct cvmx_pcieep_cfg455_s cn52xxp1; | ||
1134 | struct cvmx_pcieep_cfg455_s cn56xx; | ||
1135 | struct cvmx_pcieep_cfg455_s cn56xxp1; | ||
1136 | }; | ||
1137 | |||
1138 | union cvmx_pcieep_cfg456 { | ||
1139 | uint32_t u32; | ||
1140 | struct cvmx_pcieep_cfg456_s { | ||
1141 | uint32_t reserved_2_31:30; | ||
1142 | uint32_t m_vend1_drp:1; | ||
1143 | uint32_t m_vend0_drp:1; | ||
1144 | } s; | ||
1145 | struct cvmx_pcieep_cfg456_s cn52xx; | ||
1146 | struct cvmx_pcieep_cfg456_s cn52xxp1; | ||
1147 | struct cvmx_pcieep_cfg456_s cn56xx; | ||
1148 | struct cvmx_pcieep_cfg456_s cn56xxp1; | ||
1149 | }; | ||
1150 | |||
1151 | union cvmx_pcieep_cfg458 { | ||
1152 | uint32_t u32; | ||
1153 | struct cvmx_pcieep_cfg458_s { | ||
1154 | uint32_t dbg_info_l32:32; | ||
1155 | } s; | ||
1156 | struct cvmx_pcieep_cfg458_s cn52xx; | ||
1157 | struct cvmx_pcieep_cfg458_s cn52xxp1; | ||
1158 | struct cvmx_pcieep_cfg458_s cn56xx; | ||
1159 | struct cvmx_pcieep_cfg458_s cn56xxp1; | ||
1160 | }; | ||
1161 | |||
1162 | union cvmx_pcieep_cfg459 { | ||
1163 | uint32_t u32; | ||
1164 | struct cvmx_pcieep_cfg459_s { | ||
1165 | uint32_t dbg_info_u32:32; | ||
1166 | } s; | ||
1167 | struct cvmx_pcieep_cfg459_s cn52xx; | ||
1168 | struct cvmx_pcieep_cfg459_s cn52xxp1; | ||
1169 | struct cvmx_pcieep_cfg459_s cn56xx; | ||
1170 | struct cvmx_pcieep_cfg459_s cn56xxp1; | ||
1171 | }; | ||
1172 | |||
1173 | union cvmx_pcieep_cfg460 { | ||
1174 | uint32_t u32; | ||
1175 | struct cvmx_pcieep_cfg460_s { | ||
1176 | uint32_t reserved_20_31:12; | ||
1177 | uint32_t tphfcc:8; | ||
1178 | uint32_t tpdfcc:12; | ||
1179 | } s; | ||
1180 | struct cvmx_pcieep_cfg460_s cn52xx; | ||
1181 | struct cvmx_pcieep_cfg460_s cn52xxp1; | ||
1182 | struct cvmx_pcieep_cfg460_s cn56xx; | ||
1183 | struct cvmx_pcieep_cfg460_s cn56xxp1; | ||
1184 | }; | ||
1185 | |||
1186 | union cvmx_pcieep_cfg461 { | ||
1187 | uint32_t u32; | ||
1188 | struct cvmx_pcieep_cfg461_s { | ||
1189 | uint32_t reserved_20_31:12; | ||
1190 | uint32_t tchfcc:8; | ||
1191 | uint32_t tcdfcc:12; | ||
1192 | } s; | ||
1193 | struct cvmx_pcieep_cfg461_s cn52xx; | ||
1194 | struct cvmx_pcieep_cfg461_s cn52xxp1; | ||
1195 | struct cvmx_pcieep_cfg461_s cn56xx; | ||
1196 | struct cvmx_pcieep_cfg461_s cn56xxp1; | ||
1197 | }; | ||
1198 | |||
1199 | union cvmx_pcieep_cfg462 { | ||
1200 | uint32_t u32; | ||
1201 | struct cvmx_pcieep_cfg462_s { | ||
1202 | uint32_t reserved_20_31:12; | ||
1203 | uint32_t tchfcc:8; | ||
1204 | uint32_t tcdfcc:12; | ||
1205 | } s; | ||
1206 | struct cvmx_pcieep_cfg462_s cn52xx; | ||
1207 | struct cvmx_pcieep_cfg462_s cn52xxp1; | ||
1208 | struct cvmx_pcieep_cfg462_s cn56xx; | ||
1209 | struct cvmx_pcieep_cfg462_s cn56xxp1; | ||
1210 | }; | ||
1211 | |||
1212 | union cvmx_pcieep_cfg463 { | ||
1213 | uint32_t u32; | ||
1214 | struct cvmx_pcieep_cfg463_s { | ||
1215 | uint32_t reserved_3_31:29; | ||
1216 | uint32_t rqne:1; | ||
1217 | uint32_t trbne:1; | ||
1218 | uint32_t rtlpfccnr:1; | ||
1219 | } s; | ||
1220 | struct cvmx_pcieep_cfg463_s cn52xx; | ||
1221 | struct cvmx_pcieep_cfg463_s cn52xxp1; | ||
1222 | struct cvmx_pcieep_cfg463_s cn56xx; | ||
1223 | struct cvmx_pcieep_cfg463_s cn56xxp1; | ||
1224 | }; | ||
1225 | |||
1226 | union cvmx_pcieep_cfg464 { | ||
1227 | uint32_t u32; | ||
1228 | struct cvmx_pcieep_cfg464_s { | ||
1229 | uint32_t wrr_vc3:8; | ||
1230 | uint32_t wrr_vc2:8; | ||
1231 | uint32_t wrr_vc1:8; | ||
1232 | uint32_t wrr_vc0:8; | ||
1233 | } s; | ||
1234 | struct cvmx_pcieep_cfg464_s cn52xx; | ||
1235 | struct cvmx_pcieep_cfg464_s cn52xxp1; | ||
1236 | struct cvmx_pcieep_cfg464_s cn56xx; | ||
1237 | struct cvmx_pcieep_cfg464_s cn56xxp1; | ||
1238 | }; | ||
1239 | |||
1240 | union cvmx_pcieep_cfg465 { | ||
1241 | uint32_t u32; | ||
1242 | struct cvmx_pcieep_cfg465_s { | ||
1243 | uint32_t wrr_vc7:8; | ||
1244 | uint32_t wrr_vc6:8; | ||
1245 | uint32_t wrr_vc5:8; | ||
1246 | uint32_t wrr_vc4:8; | ||
1247 | } s; | ||
1248 | struct cvmx_pcieep_cfg465_s cn52xx; | ||
1249 | struct cvmx_pcieep_cfg465_s cn52xxp1; | ||
1250 | struct cvmx_pcieep_cfg465_s cn56xx; | ||
1251 | struct cvmx_pcieep_cfg465_s cn56xxp1; | ||
1252 | }; | ||
1253 | |||
1254 | union cvmx_pcieep_cfg466 { | ||
1255 | uint32_t u32; | ||
1256 | struct cvmx_pcieep_cfg466_s { | ||
1257 | uint32_t rx_queue_order:1; | ||
1258 | uint32_t type_ordering:1; | ||
1259 | uint32_t reserved_24_29:6; | ||
1260 | uint32_t queue_mode:3; | ||
1261 | uint32_t reserved_20_20:1; | ||
1262 | uint32_t header_credits:8; | ||
1263 | uint32_t data_credits:12; | ||
1264 | } s; | ||
1265 | struct cvmx_pcieep_cfg466_s cn52xx; | ||
1266 | struct cvmx_pcieep_cfg466_s cn52xxp1; | ||
1267 | struct cvmx_pcieep_cfg466_s cn56xx; | ||
1268 | struct cvmx_pcieep_cfg466_s cn56xxp1; | ||
1269 | }; | ||
1270 | |||
1271 | union cvmx_pcieep_cfg467 { | ||
1272 | uint32_t u32; | ||
1273 | struct cvmx_pcieep_cfg467_s { | ||
1274 | uint32_t reserved_24_31:8; | ||
1275 | uint32_t queue_mode:3; | ||
1276 | uint32_t reserved_20_20:1; | ||
1277 | uint32_t header_credits:8; | ||
1278 | uint32_t data_credits:12; | ||
1279 | } s; | ||
1280 | struct cvmx_pcieep_cfg467_s cn52xx; | ||
1281 | struct cvmx_pcieep_cfg467_s cn52xxp1; | ||
1282 | struct cvmx_pcieep_cfg467_s cn56xx; | ||
1283 | struct cvmx_pcieep_cfg467_s cn56xxp1; | ||
1284 | }; | ||
1285 | |||
1286 | union cvmx_pcieep_cfg468 { | ||
1287 | uint32_t u32; | ||
1288 | struct cvmx_pcieep_cfg468_s { | ||
1289 | uint32_t reserved_24_31:8; | ||
1290 | uint32_t queue_mode:3; | ||
1291 | uint32_t reserved_20_20:1; | ||
1292 | uint32_t header_credits:8; | ||
1293 | uint32_t data_credits:12; | ||
1294 | } s; | ||
1295 | struct cvmx_pcieep_cfg468_s cn52xx; | ||
1296 | struct cvmx_pcieep_cfg468_s cn52xxp1; | ||
1297 | struct cvmx_pcieep_cfg468_s cn56xx; | ||
1298 | struct cvmx_pcieep_cfg468_s cn56xxp1; | ||
1299 | }; | ||
1300 | |||
1301 | union cvmx_pcieep_cfg490 { | ||
1302 | uint32_t u32; | ||
1303 | struct cvmx_pcieep_cfg490_s { | ||
1304 | uint32_t reserved_26_31:6; | ||
1305 | uint32_t header_depth:10; | ||
1306 | uint32_t reserved_14_15:2; | ||
1307 | uint32_t data_depth:14; | ||
1308 | } s; | ||
1309 | struct cvmx_pcieep_cfg490_s cn52xx; | ||
1310 | struct cvmx_pcieep_cfg490_s cn52xxp1; | ||
1311 | struct cvmx_pcieep_cfg490_s cn56xx; | ||
1312 | struct cvmx_pcieep_cfg490_s cn56xxp1; | ||
1313 | }; | ||
1314 | |||
1315 | union cvmx_pcieep_cfg491 { | ||
1316 | uint32_t u32; | ||
1317 | struct cvmx_pcieep_cfg491_s { | ||
1318 | uint32_t reserved_26_31:6; | ||
1319 | uint32_t header_depth:10; | ||
1320 | uint32_t reserved_14_15:2; | ||
1321 | uint32_t data_depth:14; | ||
1322 | } s; | ||
1323 | struct cvmx_pcieep_cfg491_s cn52xx; | ||
1324 | struct cvmx_pcieep_cfg491_s cn52xxp1; | ||
1325 | struct cvmx_pcieep_cfg491_s cn56xx; | ||
1326 | struct cvmx_pcieep_cfg491_s cn56xxp1; | ||
1327 | }; | ||
1328 | |||
1329 | union cvmx_pcieep_cfg492 { | ||
1330 | uint32_t u32; | ||
1331 | struct cvmx_pcieep_cfg492_s { | ||
1332 | uint32_t reserved_26_31:6; | ||
1333 | uint32_t header_depth:10; | ||
1334 | uint32_t reserved_14_15:2; | ||
1335 | uint32_t data_depth:14; | ||
1336 | } s; | ||
1337 | struct cvmx_pcieep_cfg492_s cn52xx; | ||
1338 | struct cvmx_pcieep_cfg492_s cn52xxp1; | ||
1339 | struct cvmx_pcieep_cfg492_s cn56xx; | ||
1340 | struct cvmx_pcieep_cfg492_s cn56xxp1; | ||
1341 | }; | ||
1342 | |||
1343 | union cvmx_pcieep_cfg516 { | ||
1344 | uint32_t u32; | ||
1345 | struct cvmx_pcieep_cfg516_s { | ||
1346 | uint32_t phy_stat:32; | ||
1347 | } s; | ||
1348 | struct cvmx_pcieep_cfg516_s cn52xx; | ||
1349 | struct cvmx_pcieep_cfg516_s cn52xxp1; | ||
1350 | struct cvmx_pcieep_cfg516_s cn56xx; | ||
1351 | struct cvmx_pcieep_cfg516_s cn56xxp1; | ||
1352 | }; | ||
1353 | |||
1354 | union cvmx_pcieep_cfg517 { | ||
1355 | uint32_t u32; | ||
1356 | struct cvmx_pcieep_cfg517_s { | ||
1357 | uint32_t phy_ctrl:32; | ||
1358 | } s; | ||
1359 | struct cvmx_pcieep_cfg517_s cn52xx; | ||
1360 | struct cvmx_pcieep_cfg517_s cn52xxp1; | ||
1361 | struct cvmx_pcieep_cfg517_s cn56xx; | ||
1362 | struct cvmx_pcieep_cfg517_s cn56xxp1; | ||
1363 | }; | ||
1364 | |||
1365 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-pciercx-defs.h b/arch/mips/include/asm/octeon/cvmx-pciercx-defs.h new file mode 100644 index 000000000000..75574c918942 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-pciercx-defs.h | |||
@@ -0,0 +1,1397 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_PCIERCX_DEFS_H__ | ||
29 | #define __CVMX_PCIERCX_DEFS_H__ | ||
30 | |||
31 | #define CVMX_PCIERCX_CFG000(offset) \ | ||
32 | (0x0000000000000000ull + (((offset) & 1) * 0)) | ||
33 | #define CVMX_PCIERCX_CFG001(offset) \ | ||
34 | (0x0000000000000004ull + (((offset) & 1) * 0)) | ||
35 | #define CVMX_PCIERCX_CFG002(offset) \ | ||
36 | (0x0000000000000008ull + (((offset) & 1) * 0)) | ||
37 | #define CVMX_PCIERCX_CFG003(offset) \ | ||
38 | (0x000000000000000Cull + (((offset) & 1) * 0)) | ||
39 | #define CVMX_PCIERCX_CFG004(offset) \ | ||
40 | (0x0000000000000010ull + (((offset) & 1) * 0)) | ||
41 | #define CVMX_PCIERCX_CFG005(offset) \ | ||
42 | (0x0000000000000014ull + (((offset) & 1) * 0)) | ||
43 | #define CVMX_PCIERCX_CFG006(offset) \ | ||
44 | (0x0000000000000018ull + (((offset) & 1) * 0)) | ||
45 | #define CVMX_PCIERCX_CFG007(offset) \ | ||
46 | (0x000000000000001Cull + (((offset) & 1) * 0)) | ||
47 | #define CVMX_PCIERCX_CFG008(offset) \ | ||
48 | (0x0000000000000020ull + (((offset) & 1) * 0)) | ||
49 | #define CVMX_PCIERCX_CFG009(offset) \ | ||
50 | (0x0000000000000024ull + (((offset) & 1) * 0)) | ||
51 | #define CVMX_PCIERCX_CFG010(offset) \ | ||
52 | (0x0000000000000028ull + (((offset) & 1) * 0)) | ||
53 | #define CVMX_PCIERCX_CFG011(offset) \ | ||
54 | (0x000000000000002Cull + (((offset) & 1) * 0)) | ||
55 | #define CVMX_PCIERCX_CFG012(offset) \ | ||
56 | (0x0000000000000030ull + (((offset) & 1) * 0)) | ||
57 | #define CVMX_PCIERCX_CFG013(offset) \ | ||
58 | (0x0000000000000034ull + (((offset) & 1) * 0)) | ||
59 | #define CVMX_PCIERCX_CFG014(offset) \ | ||
60 | (0x0000000000000038ull + (((offset) & 1) * 0)) | ||
61 | #define CVMX_PCIERCX_CFG015(offset) \ | ||
62 | (0x000000000000003Cull + (((offset) & 1) * 0)) | ||
63 | #define CVMX_PCIERCX_CFG016(offset) \ | ||
64 | (0x0000000000000040ull + (((offset) & 1) * 0)) | ||
65 | #define CVMX_PCIERCX_CFG017(offset) \ | ||
66 | (0x0000000000000044ull + (((offset) & 1) * 0)) | ||
67 | #define CVMX_PCIERCX_CFG020(offset) \ | ||
68 | (0x0000000000000050ull + (((offset) & 1) * 0)) | ||
69 | #define CVMX_PCIERCX_CFG021(offset) \ | ||
70 | (0x0000000000000054ull + (((offset) & 1) * 0)) | ||
71 | #define CVMX_PCIERCX_CFG022(offset) \ | ||
72 | (0x0000000000000058ull + (((offset) & 1) * 0)) | ||
73 | #define CVMX_PCIERCX_CFG023(offset) \ | ||
74 | (0x000000000000005Cull + (((offset) & 1) * 0)) | ||
75 | #define CVMX_PCIERCX_CFG028(offset) \ | ||
76 | (0x0000000000000070ull + (((offset) & 1) * 0)) | ||
77 | #define CVMX_PCIERCX_CFG029(offset) \ | ||
78 | (0x0000000000000074ull + (((offset) & 1) * 0)) | ||
79 | #define CVMX_PCIERCX_CFG030(offset) \ | ||
80 | (0x0000000000000078ull + (((offset) & 1) * 0)) | ||
81 | #define CVMX_PCIERCX_CFG031(offset) \ | ||
82 | (0x000000000000007Cull + (((offset) & 1) * 0)) | ||
83 | #define CVMX_PCIERCX_CFG032(offset) \ | ||
84 | (0x0000000000000080ull + (((offset) & 1) * 0)) | ||
85 | #define CVMX_PCIERCX_CFG033(offset) \ | ||
86 | (0x0000000000000084ull + (((offset) & 1) * 0)) | ||
87 | #define CVMX_PCIERCX_CFG034(offset) \ | ||
88 | (0x0000000000000088ull + (((offset) & 1) * 0)) | ||
89 | #define CVMX_PCIERCX_CFG035(offset) \ | ||
90 | (0x000000000000008Cull + (((offset) & 1) * 0)) | ||
91 | #define CVMX_PCIERCX_CFG036(offset) \ | ||
92 | (0x0000000000000090ull + (((offset) & 1) * 0)) | ||
93 | #define CVMX_PCIERCX_CFG037(offset) \ | ||
94 | (0x0000000000000094ull + (((offset) & 1) * 0)) | ||
95 | #define CVMX_PCIERCX_CFG038(offset) \ | ||
96 | (0x0000000000000098ull + (((offset) & 1) * 0)) | ||
97 | #define CVMX_PCIERCX_CFG039(offset) \ | ||
98 | (0x000000000000009Cull + (((offset) & 1) * 0)) | ||
99 | #define CVMX_PCIERCX_CFG040(offset) \ | ||
100 | (0x00000000000000A0ull + (((offset) & 1) * 0)) | ||
101 | #define CVMX_PCIERCX_CFG041(offset) \ | ||
102 | (0x00000000000000A4ull + (((offset) & 1) * 0)) | ||
103 | #define CVMX_PCIERCX_CFG042(offset) \ | ||
104 | (0x00000000000000A8ull + (((offset) & 1) * 0)) | ||
105 | #define CVMX_PCIERCX_CFG064(offset) \ | ||
106 | (0x0000000000000100ull + (((offset) & 1) * 0)) | ||
107 | #define CVMX_PCIERCX_CFG065(offset) \ | ||
108 | (0x0000000000000104ull + (((offset) & 1) * 0)) | ||
109 | #define CVMX_PCIERCX_CFG066(offset) \ | ||
110 | (0x0000000000000108ull + (((offset) & 1) * 0)) | ||
111 | #define CVMX_PCIERCX_CFG067(offset) \ | ||
112 | (0x000000000000010Cull + (((offset) & 1) * 0)) | ||
113 | #define CVMX_PCIERCX_CFG068(offset) \ | ||
114 | (0x0000000000000110ull + (((offset) & 1) * 0)) | ||
115 | #define CVMX_PCIERCX_CFG069(offset) \ | ||
116 | (0x0000000000000114ull + (((offset) & 1) * 0)) | ||
117 | #define CVMX_PCIERCX_CFG070(offset) \ | ||
118 | (0x0000000000000118ull + (((offset) & 1) * 0)) | ||
119 | #define CVMX_PCIERCX_CFG071(offset) \ | ||
120 | (0x000000000000011Cull + (((offset) & 1) * 0)) | ||
121 | #define CVMX_PCIERCX_CFG072(offset) \ | ||
122 | (0x0000000000000120ull + (((offset) & 1) * 0)) | ||
123 | #define CVMX_PCIERCX_CFG073(offset) \ | ||
124 | (0x0000000000000124ull + (((offset) & 1) * 0)) | ||
125 | #define CVMX_PCIERCX_CFG074(offset) \ | ||
126 | (0x0000000000000128ull + (((offset) & 1) * 0)) | ||
127 | #define CVMX_PCIERCX_CFG075(offset) \ | ||
128 | (0x000000000000012Cull + (((offset) & 1) * 0)) | ||
129 | #define CVMX_PCIERCX_CFG076(offset) \ | ||
130 | (0x0000000000000130ull + (((offset) & 1) * 0)) | ||
131 | #define CVMX_PCIERCX_CFG077(offset) \ | ||
132 | (0x0000000000000134ull + (((offset) & 1) * 0)) | ||
133 | #define CVMX_PCIERCX_CFG448(offset) \ | ||
134 | (0x0000000000000700ull + (((offset) & 1) * 0)) | ||
135 | #define CVMX_PCIERCX_CFG449(offset) \ | ||
136 | (0x0000000000000704ull + (((offset) & 1) * 0)) | ||
137 | #define CVMX_PCIERCX_CFG450(offset) \ | ||
138 | (0x0000000000000708ull + (((offset) & 1) * 0)) | ||
139 | #define CVMX_PCIERCX_CFG451(offset) \ | ||
140 | (0x000000000000070Cull + (((offset) & 1) * 0)) | ||
141 | #define CVMX_PCIERCX_CFG452(offset) \ | ||
142 | (0x0000000000000710ull + (((offset) & 1) * 0)) | ||
143 | #define CVMX_PCIERCX_CFG453(offset) \ | ||
144 | (0x0000000000000714ull + (((offset) & 1) * 0)) | ||
145 | #define CVMX_PCIERCX_CFG454(offset) \ | ||
146 | (0x0000000000000718ull + (((offset) & 1) * 0)) | ||
147 | #define CVMX_PCIERCX_CFG455(offset) \ | ||
148 | (0x000000000000071Cull + (((offset) & 1) * 0)) | ||
149 | #define CVMX_PCIERCX_CFG456(offset) \ | ||
150 | (0x0000000000000720ull + (((offset) & 1) * 0)) | ||
151 | #define CVMX_PCIERCX_CFG458(offset) \ | ||
152 | (0x0000000000000728ull + (((offset) & 1) * 0)) | ||
153 | #define CVMX_PCIERCX_CFG459(offset) \ | ||
154 | (0x000000000000072Cull + (((offset) & 1) * 0)) | ||
155 | #define CVMX_PCIERCX_CFG460(offset) \ | ||
156 | (0x0000000000000730ull + (((offset) & 1) * 0)) | ||
157 | #define CVMX_PCIERCX_CFG461(offset) \ | ||
158 | (0x0000000000000734ull + (((offset) & 1) * 0)) | ||
159 | #define CVMX_PCIERCX_CFG462(offset) \ | ||
160 | (0x0000000000000738ull + (((offset) & 1) * 0)) | ||
161 | #define CVMX_PCIERCX_CFG463(offset) \ | ||
162 | (0x000000000000073Cull + (((offset) & 1) * 0)) | ||
163 | #define CVMX_PCIERCX_CFG464(offset) \ | ||
164 | (0x0000000000000740ull + (((offset) & 1) * 0)) | ||
165 | #define CVMX_PCIERCX_CFG465(offset) \ | ||
166 | (0x0000000000000744ull + (((offset) & 1) * 0)) | ||
167 | #define CVMX_PCIERCX_CFG466(offset) \ | ||
168 | (0x0000000000000748ull + (((offset) & 1) * 0)) | ||
169 | #define CVMX_PCIERCX_CFG467(offset) \ | ||
170 | (0x000000000000074Cull + (((offset) & 1) * 0)) | ||
171 | #define CVMX_PCIERCX_CFG468(offset) \ | ||
172 | (0x0000000000000750ull + (((offset) & 1) * 0)) | ||
173 | #define CVMX_PCIERCX_CFG490(offset) \ | ||
174 | (0x00000000000007A8ull + (((offset) & 1) * 0)) | ||
175 | #define CVMX_PCIERCX_CFG491(offset) \ | ||
176 | (0x00000000000007ACull + (((offset) & 1) * 0)) | ||
177 | #define CVMX_PCIERCX_CFG492(offset) \ | ||
178 | (0x00000000000007B0ull + (((offset) & 1) * 0)) | ||
179 | #define CVMX_PCIERCX_CFG516(offset) \ | ||
180 | (0x0000000000000810ull + (((offset) & 1) * 0)) | ||
181 | #define CVMX_PCIERCX_CFG517(offset) \ | ||
182 | (0x0000000000000814ull + (((offset) & 1) * 0)) | ||
183 | |||
184 | union cvmx_pciercx_cfg000 { | ||
185 | uint32_t u32; | ||
186 | struct cvmx_pciercx_cfg000_s { | ||
187 | uint32_t devid:16; | ||
188 | uint32_t vendid:16; | ||
189 | } s; | ||
190 | struct cvmx_pciercx_cfg000_s cn52xx; | ||
191 | struct cvmx_pciercx_cfg000_s cn52xxp1; | ||
192 | struct cvmx_pciercx_cfg000_s cn56xx; | ||
193 | struct cvmx_pciercx_cfg000_s cn56xxp1; | ||
194 | }; | ||
195 | |||
196 | union cvmx_pciercx_cfg001 { | ||
197 | uint32_t u32; | ||
198 | struct cvmx_pciercx_cfg001_s { | ||
199 | uint32_t dpe:1; | ||
200 | uint32_t sse:1; | ||
201 | uint32_t rma:1; | ||
202 | uint32_t rta:1; | ||
203 | uint32_t sta:1; | ||
204 | uint32_t devt:2; | ||
205 | uint32_t mdpe:1; | ||
206 | uint32_t fbb:1; | ||
207 | uint32_t reserved_22_22:1; | ||
208 | uint32_t m66:1; | ||
209 | uint32_t cl:1; | ||
210 | uint32_t i_stat:1; | ||
211 | uint32_t reserved_11_18:8; | ||
212 | uint32_t i_dis:1; | ||
213 | uint32_t fbbe:1; | ||
214 | uint32_t see:1; | ||
215 | uint32_t ids_wcc:1; | ||
216 | uint32_t per:1; | ||
217 | uint32_t vps:1; | ||
218 | uint32_t mwice:1; | ||
219 | uint32_t scse:1; | ||
220 | uint32_t me:1; | ||
221 | uint32_t msae:1; | ||
222 | uint32_t isae:1; | ||
223 | } s; | ||
224 | struct cvmx_pciercx_cfg001_s cn52xx; | ||
225 | struct cvmx_pciercx_cfg001_s cn52xxp1; | ||
226 | struct cvmx_pciercx_cfg001_s cn56xx; | ||
227 | struct cvmx_pciercx_cfg001_s cn56xxp1; | ||
228 | }; | ||
229 | |||
230 | union cvmx_pciercx_cfg002 { | ||
231 | uint32_t u32; | ||
232 | struct cvmx_pciercx_cfg002_s { | ||
233 | uint32_t bcc:8; | ||
234 | uint32_t sc:8; | ||
235 | uint32_t pi:8; | ||
236 | uint32_t rid:8; | ||
237 | } s; | ||
238 | struct cvmx_pciercx_cfg002_s cn52xx; | ||
239 | struct cvmx_pciercx_cfg002_s cn52xxp1; | ||
240 | struct cvmx_pciercx_cfg002_s cn56xx; | ||
241 | struct cvmx_pciercx_cfg002_s cn56xxp1; | ||
242 | }; | ||
243 | |||
244 | union cvmx_pciercx_cfg003 { | ||
245 | uint32_t u32; | ||
246 | struct cvmx_pciercx_cfg003_s { | ||
247 | uint32_t bist:8; | ||
248 | uint32_t mfd:1; | ||
249 | uint32_t chf:7; | ||
250 | uint32_t lt:8; | ||
251 | uint32_t cls:8; | ||
252 | } s; | ||
253 | struct cvmx_pciercx_cfg003_s cn52xx; | ||
254 | struct cvmx_pciercx_cfg003_s cn52xxp1; | ||
255 | struct cvmx_pciercx_cfg003_s cn56xx; | ||
256 | struct cvmx_pciercx_cfg003_s cn56xxp1; | ||
257 | }; | ||
258 | |||
259 | union cvmx_pciercx_cfg004 { | ||
260 | uint32_t u32; | ||
261 | struct cvmx_pciercx_cfg004_s { | ||
262 | uint32_t reserved_0_31:32; | ||
263 | } s; | ||
264 | struct cvmx_pciercx_cfg004_s cn52xx; | ||
265 | struct cvmx_pciercx_cfg004_s cn52xxp1; | ||
266 | struct cvmx_pciercx_cfg004_s cn56xx; | ||
267 | struct cvmx_pciercx_cfg004_s cn56xxp1; | ||
268 | }; | ||
269 | |||
270 | union cvmx_pciercx_cfg005 { | ||
271 | uint32_t u32; | ||
272 | struct cvmx_pciercx_cfg005_s { | ||
273 | uint32_t reserved_0_31:32; | ||
274 | } s; | ||
275 | struct cvmx_pciercx_cfg005_s cn52xx; | ||
276 | struct cvmx_pciercx_cfg005_s cn52xxp1; | ||
277 | struct cvmx_pciercx_cfg005_s cn56xx; | ||
278 | struct cvmx_pciercx_cfg005_s cn56xxp1; | ||
279 | }; | ||
280 | |||
281 | union cvmx_pciercx_cfg006 { | ||
282 | uint32_t u32; | ||
283 | struct cvmx_pciercx_cfg006_s { | ||
284 | uint32_t slt:8; | ||
285 | uint32_t subbnum:8; | ||
286 | uint32_t sbnum:8; | ||
287 | uint32_t pbnum:8; | ||
288 | } s; | ||
289 | struct cvmx_pciercx_cfg006_s cn52xx; | ||
290 | struct cvmx_pciercx_cfg006_s cn52xxp1; | ||
291 | struct cvmx_pciercx_cfg006_s cn56xx; | ||
292 | struct cvmx_pciercx_cfg006_s cn56xxp1; | ||
293 | }; | ||
294 | |||
295 | union cvmx_pciercx_cfg007 { | ||
296 | uint32_t u32; | ||
297 | struct cvmx_pciercx_cfg007_s { | ||
298 | uint32_t dpe:1; | ||
299 | uint32_t sse:1; | ||
300 | uint32_t rma:1; | ||
301 | uint32_t rta:1; | ||
302 | uint32_t sta:1; | ||
303 | uint32_t devt:2; | ||
304 | uint32_t mdpe:1; | ||
305 | uint32_t fbb:1; | ||
306 | uint32_t reserved_22_22:1; | ||
307 | uint32_t m66:1; | ||
308 | uint32_t reserved_16_20:5; | ||
309 | uint32_t lio_limi:4; | ||
310 | uint32_t reserved_9_11:3; | ||
311 | uint32_t io32b:1; | ||
312 | uint32_t lio_base:4; | ||
313 | uint32_t reserved_1_3:3; | ||
314 | uint32_t io32a:1; | ||
315 | } s; | ||
316 | struct cvmx_pciercx_cfg007_s cn52xx; | ||
317 | struct cvmx_pciercx_cfg007_s cn52xxp1; | ||
318 | struct cvmx_pciercx_cfg007_s cn56xx; | ||
319 | struct cvmx_pciercx_cfg007_s cn56xxp1; | ||
320 | }; | ||
321 | |||
322 | union cvmx_pciercx_cfg008 { | ||
323 | uint32_t u32; | ||
324 | struct cvmx_pciercx_cfg008_s { | ||
325 | uint32_t ml_addr:12; | ||
326 | uint32_t reserved_16_19:4; | ||
327 | uint32_t mb_addr:12; | ||
328 | uint32_t reserved_0_3:4; | ||
329 | } s; | ||
330 | struct cvmx_pciercx_cfg008_s cn52xx; | ||
331 | struct cvmx_pciercx_cfg008_s cn52xxp1; | ||
332 | struct cvmx_pciercx_cfg008_s cn56xx; | ||
333 | struct cvmx_pciercx_cfg008_s cn56xxp1; | ||
334 | }; | ||
335 | |||
336 | union cvmx_pciercx_cfg009 { | ||
337 | uint32_t u32; | ||
338 | struct cvmx_pciercx_cfg009_s { | ||
339 | uint32_t lmem_limit:12; | ||
340 | uint32_t reserved_17_19:3; | ||
341 | uint32_t mem64b:1; | ||
342 | uint32_t lmem_base:12; | ||
343 | uint32_t reserved_1_3:3; | ||
344 | uint32_t mem64a:1; | ||
345 | } s; | ||
346 | struct cvmx_pciercx_cfg009_s cn52xx; | ||
347 | struct cvmx_pciercx_cfg009_s cn52xxp1; | ||
348 | struct cvmx_pciercx_cfg009_s cn56xx; | ||
349 | struct cvmx_pciercx_cfg009_s cn56xxp1; | ||
350 | }; | ||
351 | |||
352 | union cvmx_pciercx_cfg010 { | ||
353 | uint32_t u32; | ||
354 | struct cvmx_pciercx_cfg010_s { | ||
355 | uint32_t umem_base:32; | ||
356 | } s; | ||
357 | struct cvmx_pciercx_cfg010_s cn52xx; | ||
358 | struct cvmx_pciercx_cfg010_s cn52xxp1; | ||
359 | struct cvmx_pciercx_cfg010_s cn56xx; | ||
360 | struct cvmx_pciercx_cfg010_s cn56xxp1; | ||
361 | }; | ||
362 | |||
363 | union cvmx_pciercx_cfg011 { | ||
364 | uint32_t u32; | ||
365 | struct cvmx_pciercx_cfg011_s { | ||
366 | uint32_t umem_limit:32; | ||
367 | } s; | ||
368 | struct cvmx_pciercx_cfg011_s cn52xx; | ||
369 | struct cvmx_pciercx_cfg011_s cn52xxp1; | ||
370 | struct cvmx_pciercx_cfg011_s cn56xx; | ||
371 | struct cvmx_pciercx_cfg011_s cn56xxp1; | ||
372 | }; | ||
373 | |||
374 | union cvmx_pciercx_cfg012 { | ||
375 | uint32_t u32; | ||
376 | struct cvmx_pciercx_cfg012_s { | ||
377 | uint32_t uio_limit:16; | ||
378 | uint32_t uio_base:16; | ||
379 | } s; | ||
380 | struct cvmx_pciercx_cfg012_s cn52xx; | ||
381 | struct cvmx_pciercx_cfg012_s cn52xxp1; | ||
382 | struct cvmx_pciercx_cfg012_s cn56xx; | ||
383 | struct cvmx_pciercx_cfg012_s cn56xxp1; | ||
384 | }; | ||
385 | |||
386 | union cvmx_pciercx_cfg013 { | ||
387 | uint32_t u32; | ||
388 | struct cvmx_pciercx_cfg013_s { | ||
389 | uint32_t reserved_8_31:24; | ||
390 | uint32_t cp:8; | ||
391 | } s; | ||
392 | struct cvmx_pciercx_cfg013_s cn52xx; | ||
393 | struct cvmx_pciercx_cfg013_s cn52xxp1; | ||
394 | struct cvmx_pciercx_cfg013_s cn56xx; | ||
395 | struct cvmx_pciercx_cfg013_s cn56xxp1; | ||
396 | }; | ||
397 | |||
398 | union cvmx_pciercx_cfg014 { | ||
399 | uint32_t u32; | ||
400 | struct cvmx_pciercx_cfg014_s { | ||
401 | uint32_t reserved_0_31:32; | ||
402 | } s; | ||
403 | struct cvmx_pciercx_cfg014_s cn52xx; | ||
404 | struct cvmx_pciercx_cfg014_s cn52xxp1; | ||
405 | struct cvmx_pciercx_cfg014_s cn56xx; | ||
406 | struct cvmx_pciercx_cfg014_s cn56xxp1; | ||
407 | }; | ||
408 | |||
409 | union cvmx_pciercx_cfg015 { | ||
410 | uint32_t u32; | ||
411 | struct cvmx_pciercx_cfg015_s { | ||
412 | uint32_t reserved_28_31:4; | ||
413 | uint32_t dtsees:1; | ||
414 | uint32_t dts:1; | ||
415 | uint32_t sdt:1; | ||
416 | uint32_t pdt:1; | ||
417 | uint32_t fbbe:1; | ||
418 | uint32_t sbrst:1; | ||
419 | uint32_t mam:1; | ||
420 | uint32_t vga16d:1; | ||
421 | uint32_t vgae:1; | ||
422 | uint32_t isae:1; | ||
423 | uint32_t see:1; | ||
424 | uint32_t pere:1; | ||
425 | uint32_t inta:8; | ||
426 | uint32_t il:8; | ||
427 | } s; | ||
428 | struct cvmx_pciercx_cfg015_s cn52xx; | ||
429 | struct cvmx_pciercx_cfg015_s cn52xxp1; | ||
430 | struct cvmx_pciercx_cfg015_s cn56xx; | ||
431 | struct cvmx_pciercx_cfg015_s cn56xxp1; | ||
432 | }; | ||
433 | |||
434 | union cvmx_pciercx_cfg016 { | ||
435 | uint32_t u32; | ||
436 | struct cvmx_pciercx_cfg016_s { | ||
437 | uint32_t pmes:5; | ||
438 | uint32_t d2s:1; | ||
439 | uint32_t d1s:1; | ||
440 | uint32_t auxc:3; | ||
441 | uint32_t dsi:1; | ||
442 | uint32_t reserved_20_20:1; | ||
443 | uint32_t pme_clock:1; | ||
444 | uint32_t pmsv:3; | ||
445 | uint32_t ncp:8; | ||
446 | uint32_t pmcid:8; | ||
447 | } s; | ||
448 | struct cvmx_pciercx_cfg016_s cn52xx; | ||
449 | struct cvmx_pciercx_cfg016_s cn52xxp1; | ||
450 | struct cvmx_pciercx_cfg016_s cn56xx; | ||
451 | struct cvmx_pciercx_cfg016_s cn56xxp1; | ||
452 | }; | ||
453 | |||
454 | union cvmx_pciercx_cfg017 { | ||
455 | uint32_t u32; | ||
456 | struct cvmx_pciercx_cfg017_s { | ||
457 | uint32_t pmdia:8; | ||
458 | uint32_t bpccee:1; | ||
459 | uint32_t bd3h:1; | ||
460 | uint32_t reserved_16_21:6; | ||
461 | uint32_t pmess:1; | ||
462 | uint32_t pmedsia:2; | ||
463 | uint32_t pmds:4; | ||
464 | uint32_t pmeens:1; | ||
465 | uint32_t reserved_4_7:4; | ||
466 | uint32_t nsr:1; | ||
467 | uint32_t reserved_2_2:1; | ||
468 | uint32_t ps:2; | ||
469 | } s; | ||
470 | struct cvmx_pciercx_cfg017_s cn52xx; | ||
471 | struct cvmx_pciercx_cfg017_s cn52xxp1; | ||
472 | struct cvmx_pciercx_cfg017_s cn56xx; | ||
473 | struct cvmx_pciercx_cfg017_s cn56xxp1; | ||
474 | }; | ||
475 | |||
476 | union cvmx_pciercx_cfg020 { | ||
477 | uint32_t u32; | ||
478 | struct cvmx_pciercx_cfg020_s { | ||
479 | uint32_t reserved_24_31:8; | ||
480 | uint32_t m64:1; | ||
481 | uint32_t mme:3; | ||
482 | uint32_t mmc:3; | ||
483 | uint32_t msien:1; | ||
484 | uint32_t ncp:8; | ||
485 | uint32_t msicid:8; | ||
486 | } s; | ||
487 | struct cvmx_pciercx_cfg020_s cn52xx; | ||
488 | struct cvmx_pciercx_cfg020_s cn52xxp1; | ||
489 | struct cvmx_pciercx_cfg020_s cn56xx; | ||
490 | struct cvmx_pciercx_cfg020_s cn56xxp1; | ||
491 | }; | ||
492 | |||
493 | union cvmx_pciercx_cfg021 { | ||
494 | uint32_t u32; | ||
495 | struct cvmx_pciercx_cfg021_s { | ||
496 | uint32_t lmsi:30; | ||
497 | uint32_t reserved_0_1:2; | ||
498 | } s; | ||
499 | struct cvmx_pciercx_cfg021_s cn52xx; | ||
500 | struct cvmx_pciercx_cfg021_s cn52xxp1; | ||
501 | struct cvmx_pciercx_cfg021_s cn56xx; | ||
502 | struct cvmx_pciercx_cfg021_s cn56xxp1; | ||
503 | }; | ||
504 | |||
505 | union cvmx_pciercx_cfg022 { | ||
506 | uint32_t u32; | ||
507 | struct cvmx_pciercx_cfg022_s { | ||
508 | uint32_t umsi:32; | ||
509 | } s; | ||
510 | struct cvmx_pciercx_cfg022_s cn52xx; | ||
511 | struct cvmx_pciercx_cfg022_s cn52xxp1; | ||
512 | struct cvmx_pciercx_cfg022_s cn56xx; | ||
513 | struct cvmx_pciercx_cfg022_s cn56xxp1; | ||
514 | }; | ||
515 | |||
516 | union cvmx_pciercx_cfg023 { | ||
517 | uint32_t u32; | ||
518 | struct cvmx_pciercx_cfg023_s { | ||
519 | uint32_t reserved_16_31:16; | ||
520 | uint32_t msimd:16; | ||
521 | } s; | ||
522 | struct cvmx_pciercx_cfg023_s cn52xx; | ||
523 | struct cvmx_pciercx_cfg023_s cn52xxp1; | ||
524 | struct cvmx_pciercx_cfg023_s cn56xx; | ||
525 | struct cvmx_pciercx_cfg023_s cn56xxp1; | ||
526 | }; | ||
527 | |||
528 | union cvmx_pciercx_cfg028 { | ||
529 | uint32_t u32; | ||
530 | struct cvmx_pciercx_cfg028_s { | ||
531 | uint32_t reserved_30_31:2; | ||
532 | uint32_t imn:5; | ||
533 | uint32_t si:1; | ||
534 | uint32_t dpt:4; | ||
535 | uint32_t pciecv:4; | ||
536 | uint32_t ncp:8; | ||
537 | uint32_t pcieid:8; | ||
538 | } s; | ||
539 | struct cvmx_pciercx_cfg028_s cn52xx; | ||
540 | struct cvmx_pciercx_cfg028_s cn52xxp1; | ||
541 | struct cvmx_pciercx_cfg028_s cn56xx; | ||
542 | struct cvmx_pciercx_cfg028_s cn56xxp1; | ||
543 | }; | ||
544 | |||
545 | union cvmx_pciercx_cfg029 { | ||
546 | uint32_t u32; | ||
547 | struct cvmx_pciercx_cfg029_s { | ||
548 | uint32_t reserved_28_31:4; | ||
549 | uint32_t cspls:2; | ||
550 | uint32_t csplv:8; | ||
551 | uint32_t reserved_16_17:2; | ||
552 | uint32_t rber:1; | ||
553 | uint32_t reserved_12_14:3; | ||
554 | uint32_t el1al:3; | ||
555 | uint32_t el0al:3; | ||
556 | uint32_t etfs:1; | ||
557 | uint32_t pfs:2; | ||
558 | uint32_t mpss:3; | ||
559 | } s; | ||
560 | struct cvmx_pciercx_cfg029_s cn52xx; | ||
561 | struct cvmx_pciercx_cfg029_s cn52xxp1; | ||
562 | struct cvmx_pciercx_cfg029_s cn56xx; | ||
563 | struct cvmx_pciercx_cfg029_s cn56xxp1; | ||
564 | }; | ||
565 | |||
566 | union cvmx_pciercx_cfg030 { | ||
567 | uint32_t u32; | ||
568 | struct cvmx_pciercx_cfg030_s { | ||
569 | uint32_t reserved_22_31:10; | ||
570 | uint32_t tp:1; | ||
571 | uint32_t ap_d:1; | ||
572 | uint32_t ur_d:1; | ||
573 | uint32_t fe_d:1; | ||
574 | uint32_t nfe_d:1; | ||
575 | uint32_t ce_d:1; | ||
576 | uint32_t reserved_15_15:1; | ||
577 | uint32_t mrrs:3; | ||
578 | uint32_t ns_en:1; | ||
579 | uint32_t ap_en:1; | ||
580 | uint32_t pf_en:1; | ||
581 | uint32_t etf_en:1; | ||
582 | uint32_t mps:3; | ||
583 | uint32_t ro_en:1; | ||
584 | uint32_t ur_en:1; | ||
585 | uint32_t fe_en:1; | ||
586 | uint32_t nfe_en:1; | ||
587 | uint32_t ce_en:1; | ||
588 | } s; | ||
589 | struct cvmx_pciercx_cfg030_s cn52xx; | ||
590 | struct cvmx_pciercx_cfg030_s cn52xxp1; | ||
591 | struct cvmx_pciercx_cfg030_s cn56xx; | ||
592 | struct cvmx_pciercx_cfg030_s cn56xxp1; | ||
593 | }; | ||
594 | |||
595 | union cvmx_pciercx_cfg031 { | ||
596 | uint32_t u32; | ||
597 | struct cvmx_pciercx_cfg031_s { | ||
598 | uint32_t pnum:8; | ||
599 | uint32_t reserved_22_23:2; | ||
600 | uint32_t lbnc:1; | ||
601 | uint32_t dllarc:1; | ||
602 | uint32_t sderc:1; | ||
603 | uint32_t cpm:1; | ||
604 | uint32_t l1el:3; | ||
605 | uint32_t l0el:3; | ||
606 | uint32_t aslpms:2; | ||
607 | uint32_t mlw:6; | ||
608 | uint32_t mls:4; | ||
609 | } s; | ||
610 | struct cvmx_pciercx_cfg031_s cn52xx; | ||
611 | struct cvmx_pciercx_cfg031_s cn52xxp1; | ||
612 | struct cvmx_pciercx_cfg031_s cn56xx; | ||
613 | struct cvmx_pciercx_cfg031_s cn56xxp1; | ||
614 | }; | ||
615 | |||
616 | union cvmx_pciercx_cfg032 { | ||
617 | uint32_t u32; | ||
618 | struct cvmx_pciercx_cfg032_s { | ||
619 | uint32_t lab:1; | ||
620 | uint32_t lbm:1; | ||
621 | uint32_t dlla:1; | ||
622 | uint32_t scc:1; | ||
623 | uint32_t lt:1; | ||
624 | uint32_t reserved_26_26:1; | ||
625 | uint32_t nlw:6; | ||
626 | uint32_t ls:4; | ||
627 | uint32_t reserved_12_15:4; | ||
628 | uint32_t lab_int_enb:1; | ||
629 | uint32_t lbm_int_enb:1; | ||
630 | uint32_t hawd:1; | ||
631 | uint32_t ecpm:1; | ||
632 | uint32_t es:1; | ||
633 | uint32_t ccc:1; | ||
634 | uint32_t rl:1; | ||
635 | uint32_t ld:1; | ||
636 | uint32_t rcb:1; | ||
637 | uint32_t reserved_2_2:1; | ||
638 | uint32_t aslpc:2; | ||
639 | } s; | ||
640 | struct cvmx_pciercx_cfg032_s cn52xx; | ||
641 | struct cvmx_pciercx_cfg032_s cn52xxp1; | ||
642 | struct cvmx_pciercx_cfg032_s cn56xx; | ||
643 | struct cvmx_pciercx_cfg032_s cn56xxp1; | ||
644 | }; | ||
645 | |||
646 | union cvmx_pciercx_cfg033 { | ||
647 | uint32_t u32; | ||
648 | struct cvmx_pciercx_cfg033_s { | ||
649 | uint32_t ps_num:13; | ||
650 | uint32_t nccs:1; | ||
651 | uint32_t emip:1; | ||
652 | uint32_t sp_ls:2; | ||
653 | uint32_t sp_lv:8; | ||
654 | uint32_t hp_c:1; | ||
655 | uint32_t hp_s:1; | ||
656 | uint32_t pip:1; | ||
657 | uint32_t aip:1; | ||
658 | uint32_t mrlsp:1; | ||
659 | uint32_t pcp:1; | ||
660 | uint32_t abp:1; | ||
661 | } s; | ||
662 | struct cvmx_pciercx_cfg033_s cn52xx; | ||
663 | struct cvmx_pciercx_cfg033_s cn52xxp1; | ||
664 | struct cvmx_pciercx_cfg033_s cn56xx; | ||
665 | struct cvmx_pciercx_cfg033_s cn56xxp1; | ||
666 | }; | ||
667 | |||
668 | union cvmx_pciercx_cfg034 { | ||
669 | uint32_t u32; | ||
670 | struct cvmx_pciercx_cfg034_s { | ||
671 | uint32_t reserved_25_31:7; | ||
672 | uint32_t dlls_c:1; | ||
673 | uint32_t emis:1; | ||
674 | uint32_t pds:1; | ||
675 | uint32_t mrlss:1; | ||
676 | uint32_t ccint_d:1; | ||
677 | uint32_t pd_c:1; | ||
678 | uint32_t mrls_c:1; | ||
679 | uint32_t pf_d:1; | ||
680 | uint32_t abp_d:1; | ||
681 | uint32_t reserved_13_15:3; | ||
682 | uint32_t dlls_en:1; | ||
683 | uint32_t emic:1; | ||
684 | uint32_t pcc:1; | ||
685 | uint32_t pic:2; | ||
686 | uint32_t aic:2; | ||
687 | uint32_t hpint_en:1; | ||
688 | uint32_t ccint_en:1; | ||
689 | uint32_t pd_en:1; | ||
690 | uint32_t mrls_en:1; | ||
691 | uint32_t pf_en:1; | ||
692 | uint32_t abp_en:1; | ||
693 | } s; | ||
694 | struct cvmx_pciercx_cfg034_s cn52xx; | ||
695 | struct cvmx_pciercx_cfg034_s cn52xxp1; | ||
696 | struct cvmx_pciercx_cfg034_s cn56xx; | ||
697 | struct cvmx_pciercx_cfg034_s cn56xxp1; | ||
698 | }; | ||
699 | |||
700 | union cvmx_pciercx_cfg035 { | ||
701 | uint32_t u32; | ||
702 | struct cvmx_pciercx_cfg035_s { | ||
703 | uint32_t reserved_17_31:15; | ||
704 | uint32_t crssv:1; | ||
705 | uint32_t reserved_5_15:11; | ||
706 | uint32_t crssve:1; | ||
707 | uint32_t pmeie:1; | ||
708 | uint32_t sefee:1; | ||
709 | uint32_t senfee:1; | ||
710 | uint32_t secee:1; | ||
711 | } s; | ||
712 | struct cvmx_pciercx_cfg035_s cn52xx; | ||
713 | struct cvmx_pciercx_cfg035_s cn52xxp1; | ||
714 | struct cvmx_pciercx_cfg035_s cn56xx; | ||
715 | struct cvmx_pciercx_cfg035_s cn56xxp1; | ||
716 | }; | ||
717 | |||
718 | union cvmx_pciercx_cfg036 { | ||
719 | uint32_t u32; | ||
720 | struct cvmx_pciercx_cfg036_s { | ||
721 | uint32_t reserved_18_31:14; | ||
722 | uint32_t pme_pend:1; | ||
723 | uint32_t pme_stat:1; | ||
724 | uint32_t pme_rid:16; | ||
725 | } s; | ||
726 | struct cvmx_pciercx_cfg036_s cn52xx; | ||
727 | struct cvmx_pciercx_cfg036_s cn52xxp1; | ||
728 | struct cvmx_pciercx_cfg036_s cn56xx; | ||
729 | struct cvmx_pciercx_cfg036_s cn56xxp1; | ||
730 | }; | ||
731 | |||
732 | union cvmx_pciercx_cfg037 { | ||
733 | uint32_t u32; | ||
734 | struct cvmx_pciercx_cfg037_s { | ||
735 | uint32_t reserved_5_31:27; | ||
736 | uint32_t ctds:1; | ||
737 | uint32_t ctrs:4; | ||
738 | } s; | ||
739 | struct cvmx_pciercx_cfg037_s cn52xx; | ||
740 | struct cvmx_pciercx_cfg037_s cn52xxp1; | ||
741 | struct cvmx_pciercx_cfg037_s cn56xx; | ||
742 | struct cvmx_pciercx_cfg037_s cn56xxp1; | ||
743 | }; | ||
744 | |||
745 | union cvmx_pciercx_cfg038 { | ||
746 | uint32_t u32; | ||
747 | struct cvmx_pciercx_cfg038_s { | ||
748 | uint32_t reserved_5_31:27; | ||
749 | uint32_t ctd:1; | ||
750 | uint32_t ctv:4; | ||
751 | } s; | ||
752 | struct cvmx_pciercx_cfg038_s cn52xx; | ||
753 | struct cvmx_pciercx_cfg038_s cn52xxp1; | ||
754 | struct cvmx_pciercx_cfg038_s cn56xx; | ||
755 | struct cvmx_pciercx_cfg038_s cn56xxp1; | ||
756 | }; | ||
757 | |||
758 | union cvmx_pciercx_cfg039 { | ||
759 | uint32_t u32; | ||
760 | struct cvmx_pciercx_cfg039_s { | ||
761 | uint32_t reserved_0_31:32; | ||
762 | } s; | ||
763 | struct cvmx_pciercx_cfg039_s cn52xx; | ||
764 | struct cvmx_pciercx_cfg039_s cn52xxp1; | ||
765 | struct cvmx_pciercx_cfg039_s cn56xx; | ||
766 | struct cvmx_pciercx_cfg039_s cn56xxp1; | ||
767 | }; | ||
768 | |||
769 | union cvmx_pciercx_cfg040 { | ||
770 | uint32_t u32; | ||
771 | struct cvmx_pciercx_cfg040_s { | ||
772 | uint32_t reserved_0_31:32; | ||
773 | } s; | ||
774 | struct cvmx_pciercx_cfg040_s cn52xx; | ||
775 | struct cvmx_pciercx_cfg040_s cn52xxp1; | ||
776 | struct cvmx_pciercx_cfg040_s cn56xx; | ||
777 | struct cvmx_pciercx_cfg040_s cn56xxp1; | ||
778 | }; | ||
779 | |||
780 | union cvmx_pciercx_cfg041 { | ||
781 | uint32_t u32; | ||
782 | struct cvmx_pciercx_cfg041_s { | ||
783 | uint32_t reserved_0_31:32; | ||
784 | } s; | ||
785 | struct cvmx_pciercx_cfg041_s cn52xx; | ||
786 | struct cvmx_pciercx_cfg041_s cn52xxp1; | ||
787 | struct cvmx_pciercx_cfg041_s cn56xx; | ||
788 | struct cvmx_pciercx_cfg041_s cn56xxp1; | ||
789 | }; | ||
790 | |||
791 | union cvmx_pciercx_cfg042 { | ||
792 | uint32_t u32; | ||
793 | struct cvmx_pciercx_cfg042_s { | ||
794 | uint32_t reserved_0_31:32; | ||
795 | } s; | ||
796 | struct cvmx_pciercx_cfg042_s cn52xx; | ||
797 | struct cvmx_pciercx_cfg042_s cn52xxp1; | ||
798 | struct cvmx_pciercx_cfg042_s cn56xx; | ||
799 | struct cvmx_pciercx_cfg042_s cn56xxp1; | ||
800 | }; | ||
801 | |||
802 | union cvmx_pciercx_cfg064 { | ||
803 | uint32_t u32; | ||
804 | struct cvmx_pciercx_cfg064_s { | ||
805 | uint32_t nco:12; | ||
806 | uint32_t cv:4; | ||
807 | uint32_t pcieec:16; | ||
808 | } s; | ||
809 | struct cvmx_pciercx_cfg064_s cn52xx; | ||
810 | struct cvmx_pciercx_cfg064_s cn52xxp1; | ||
811 | struct cvmx_pciercx_cfg064_s cn56xx; | ||
812 | struct cvmx_pciercx_cfg064_s cn56xxp1; | ||
813 | }; | ||
814 | |||
815 | union cvmx_pciercx_cfg065 { | ||
816 | uint32_t u32; | ||
817 | struct cvmx_pciercx_cfg065_s { | ||
818 | uint32_t reserved_21_31:11; | ||
819 | uint32_t ures:1; | ||
820 | uint32_t ecrces:1; | ||
821 | uint32_t mtlps:1; | ||
822 | uint32_t ros:1; | ||
823 | uint32_t ucs:1; | ||
824 | uint32_t cas:1; | ||
825 | uint32_t cts:1; | ||
826 | uint32_t fcpes:1; | ||
827 | uint32_t ptlps:1; | ||
828 | uint32_t reserved_6_11:6; | ||
829 | uint32_t sdes:1; | ||
830 | uint32_t dlpes:1; | ||
831 | uint32_t reserved_0_3:4; | ||
832 | } s; | ||
833 | struct cvmx_pciercx_cfg065_s cn52xx; | ||
834 | struct cvmx_pciercx_cfg065_s cn52xxp1; | ||
835 | struct cvmx_pciercx_cfg065_s cn56xx; | ||
836 | struct cvmx_pciercx_cfg065_s cn56xxp1; | ||
837 | }; | ||
838 | |||
839 | union cvmx_pciercx_cfg066 { | ||
840 | uint32_t u32; | ||
841 | struct cvmx_pciercx_cfg066_s { | ||
842 | uint32_t reserved_21_31:11; | ||
843 | uint32_t urem:1; | ||
844 | uint32_t ecrcem:1; | ||
845 | uint32_t mtlpm:1; | ||
846 | uint32_t rom:1; | ||
847 | uint32_t ucm:1; | ||
848 | uint32_t cam:1; | ||
849 | uint32_t ctm:1; | ||
850 | uint32_t fcpem:1; | ||
851 | uint32_t ptlpm:1; | ||
852 | uint32_t reserved_6_11:6; | ||
853 | uint32_t sdem:1; | ||
854 | uint32_t dlpem:1; | ||
855 | uint32_t reserved_0_3:4; | ||
856 | } s; | ||
857 | struct cvmx_pciercx_cfg066_s cn52xx; | ||
858 | struct cvmx_pciercx_cfg066_s cn52xxp1; | ||
859 | struct cvmx_pciercx_cfg066_s cn56xx; | ||
860 | struct cvmx_pciercx_cfg066_s cn56xxp1; | ||
861 | }; | ||
862 | |||
863 | union cvmx_pciercx_cfg067 { | ||
864 | uint32_t u32; | ||
865 | struct cvmx_pciercx_cfg067_s { | ||
866 | uint32_t reserved_21_31:11; | ||
867 | uint32_t ures:1; | ||
868 | uint32_t ecrces:1; | ||
869 | uint32_t mtlps:1; | ||
870 | uint32_t ros:1; | ||
871 | uint32_t ucs:1; | ||
872 | uint32_t cas:1; | ||
873 | uint32_t cts:1; | ||
874 | uint32_t fcpes:1; | ||
875 | uint32_t ptlps:1; | ||
876 | uint32_t reserved_6_11:6; | ||
877 | uint32_t sdes:1; | ||
878 | uint32_t dlpes:1; | ||
879 | uint32_t reserved_0_3:4; | ||
880 | } s; | ||
881 | struct cvmx_pciercx_cfg067_s cn52xx; | ||
882 | struct cvmx_pciercx_cfg067_s cn52xxp1; | ||
883 | struct cvmx_pciercx_cfg067_s cn56xx; | ||
884 | struct cvmx_pciercx_cfg067_s cn56xxp1; | ||
885 | }; | ||
886 | |||
887 | union cvmx_pciercx_cfg068 { | ||
888 | uint32_t u32; | ||
889 | struct cvmx_pciercx_cfg068_s { | ||
890 | uint32_t reserved_14_31:18; | ||
891 | uint32_t anfes:1; | ||
892 | uint32_t rtts:1; | ||
893 | uint32_t reserved_9_11:3; | ||
894 | uint32_t rnrs:1; | ||
895 | uint32_t bdllps:1; | ||
896 | uint32_t btlps:1; | ||
897 | uint32_t reserved_1_5:5; | ||
898 | uint32_t res:1; | ||
899 | } s; | ||
900 | struct cvmx_pciercx_cfg068_s cn52xx; | ||
901 | struct cvmx_pciercx_cfg068_s cn52xxp1; | ||
902 | struct cvmx_pciercx_cfg068_s cn56xx; | ||
903 | struct cvmx_pciercx_cfg068_s cn56xxp1; | ||
904 | }; | ||
905 | |||
906 | union cvmx_pciercx_cfg069 { | ||
907 | uint32_t u32; | ||
908 | struct cvmx_pciercx_cfg069_s { | ||
909 | uint32_t reserved_14_31:18; | ||
910 | uint32_t anfem:1; | ||
911 | uint32_t rttm:1; | ||
912 | uint32_t reserved_9_11:3; | ||
913 | uint32_t rnrm:1; | ||
914 | uint32_t bdllpm:1; | ||
915 | uint32_t btlpm:1; | ||
916 | uint32_t reserved_1_5:5; | ||
917 | uint32_t rem:1; | ||
918 | } s; | ||
919 | struct cvmx_pciercx_cfg069_s cn52xx; | ||
920 | struct cvmx_pciercx_cfg069_s cn52xxp1; | ||
921 | struct cvmx_pciercx_cfg069_s cn56xx; | ||
922 | struct cvmx_pciercx_cfg069_s cn56xxp1; | ||
923 | }; | ||
924 | |||
925 | union cvmx_pciercx_cfg070 { | ||
926 | uint32_t u32; | ||
927 | struct cvmx_pciercx_cfg070_s { | ||
928 | uint32_t reserved_9_31:23; | ||
929 | uint32_t ce:1; | ||
930 | uint32_t cc:1; | ||
931 | uint32_t ge:1; | ||
932 | uint32_t gc:1; | ||
933 | uint32_t fep:5; | ||
934 | } s; | ||
935 | struct cvmx_pciercx_cfg070_s cn52xx; | ||
936 | struct cvmx_pciercx_cfg070_s cn52xxp1; | ||
937 | struct cvmx_pciercx_cfg070_s cn56xx; | ||
938 | struct cvmx_pciercx_cfg070_s cn56xxp1; | ||
939 | }; | ||
940 | |||
941 | union cvmx_pciercx_cfg071 { | ||
942 | uint32_t u32; | ||
943 | struct cvmx_pciercx_cfg071_s { | ||
944 | uint32_t dword1:32; | ||
945 | } s; | ||
946 | struct cvmx_pciercx_cfg071_s cn52xx; | ||
947 | struct cvmx_pciercx_cfg071_s cn52xxp1; | ||
948 | struct cvmx_pciercx_cfg071_s cn56xx; | ||
949 | struct cvmx_pciercx_cfg071_s cn56xxp1; | ||
950 | }; | ||
951 | |||
952 | union cvmx_pciercx_cfg072 { | ||
953 | uint32_t u32; | ||
954 | struct cvmx_pciercx_cfg072_s { | ||
955 | uint32_t dword2:32; | ||
956 | } s; | ||
957 | struct cvmx_pciercx_cfg072_s cn52xx; | ||
958 | struct cvmx_pciercx_cfg072_s cn52xxp1; | ||
959 | struct cvmx_pciercx_cfg072_s cn56xx; | ||
960 | struct cvmx_pciercx_cfg072_s cn56xxp1; | ||
961 | }; | ||
962 | |||
963 | union cvmx_pciercx_cfg073 { | ||
964 | uint32_t u32; | ||
965 | struct cvmx_pciercx_cfg073_s { | ||
966 | uint32_t dword3:32; | ||
967 | } s; | ||
968 | struct cvmx_pciercx_cfg073_s cn52xx; | ||
969 | struct cvmx_pciercx_cfg073_s cn52xxp1; | ||
970 | struct cvmx_pciercx_cfg073_s cn56xx; | ||
971 | struct cvmx_pciercx_cfg073_s cn56xxp1; | ||
972 | }; | ||
973 | |||
974 | union cvmx_pciercx_cfg074 { | ||
975 | uint32_t u32; | ||
976 | struct cvmx_pciercx_cfg074_s { | ||
977 | uint32_t dword4:32; | ||
978 | } s; | ||
979 | struct cvmx_pciercx_cfg074_s cn52xx; | ||
980 | struct cvmx_pciercx_cfg074_s cn52xxp1; | ||
981 | struct cvmx_pciercx_cfg074_s cn56xx; | ||
982 | struct cvmx_pciercx_cfg074_s cn56xxp1; | ||
983 | }; | ||
984 | |||
985 | union cvmx_pciercx_cfg075 { | ||
986 | uint32_t u32; | ||
987 | struct cvmx_pciercx_cfg075_s { | ||
988 | uint32_t reserved_3_31:29; | ||
989 | uint32_t fere:1; | ||
990 | uint32_t nfere:1; | ||
991 | uint32_t cere:1; | ||
992 | } s; | ||
993 | struct cvmx_pciercx_cfg075_s cn52xx; | ||
994 | struct cvmx_pciercx_cfg075_s cn52xxp1; | ||
995 | struct cvmx_pciercx_cfg075_s cn56xx; | ||
996 | struct cvmx_pciercx_cfg075_s cn56xxp1; | ||
997 | }; | ||
998 | |||
999 | union cvmx_pciercx_cfg076 { | ||
1000 | uint32_t u32; | ||
1001 | struct cvmx_pciercx_cfg076_s { | ||
1002 | uint32_t aeimn:5; | ||
1003 | uint32_t reserved_7_26:20; | ||
1004 | uint32_t femr:1; | ||
1005 | uint32_t nfemr:1; | ||
1006 | uint32_t fuf:1; | ||
1007 | uint32_t multi_efnfr:1; | ||
1008 | uint32_t efnfr:1; | ||
1009 | uint32_t multi_ecr:1; | ||
1010 | uint32_t ecr:1; | ||
1011 | } s; | ||
1012 | struct cvmx_pciercx_cfg076_s cn52xx; | ||
1013 | struct cvmx_pciercx_cfg076_s cn52xxp1; | ||
1014 | struct cvmx_pciercx_cfg076_s cn56xx; | ||
1015 | struct cvmx_pciercx_cfg076_s cn56xxp1; | ||
1016 | }; | ||
1017 | |||
1018 | union cvmx_pciercx_cfg077 { | ||
1019 | uint32_t u32; | ||
1020 | struct cvmx_pciercx_cfg077_s { | ||
1021 | uint32_t efnfsi:16; | ||
1022 | uint32_t ecsi:16; | ||
1023 | } s; | ||
1024 | struct cvmx_pciercx_cfg077_s cn52xx; | ||
1025 | struct cvmx_pciercx_cfg077_s cn52xxp1; | ||
1026 | struct cvmx_pciercx_cfg077_s cn56xx; | ||
1027 | struct cvmx_pciercx_cfg077_s cn56xxp1; | ||
1028 | }; | ||
1029 | |||
1030 | union cvmx_pciercx_cfg448 { | ||
1031 | uint32_t u32; | ||
1032 | struct cvmx_pciercx_cfg448_s { | ||
1033 | uint32_t rtl:16; | ||
1034 | uint32_t rtltl:16; | ||
1035 | } s; | ||
1036 | struct cvmx_pciercx_cfg448_s cn52xx; | ||
1037 | struct cvmx_pciercx_cfg448_s cn52xxp1; | ||
1038 | struct cvmx_pciercx_cfg448_s cn56xx; | ||
1039 | struct cvmx_pciercx_cfg448_s cn56xxp1; | ||
1040 | }; | ||
1041 | |||
1042 | union cvmx_pciercx_cfg449 { | ||
1043 | uint32_t u32; | ||
1044 | struct cvmx_pciercx_cfg449_s { | ||
1045 | uint32_t omr:32; | ||
1046 | } s; | ||
1047 | struct cvmx_pciercx_cfg449_s cn52xx; | ||
1048 | struct cvmx_pciercx_cfg449_s cn52xxp1; | ||
1049 | struct cvmx_pciercx_cfg449_s cn56xx; | ||
1050 | struct cvmx_pciercx_cfg449_s cn56xxp1; | ||
1051 | }; | ||
1052 | |||
1053 | union cvmx_pciercx_cfg450 { | ||
1054 | uint32_t u32; | ||
1055 | struct cvmx_pciercx_cfg450_s { | ||
1056 | uint32_t lpec:8; | ||
1057 | uint32_t reserved_22_23:2; | ||
1058 | uint32_t link_state:6; | ||
1059 | uint32_t force_link:1; | ||
1060 | uint32_t reserved_8_14:7; | ||
1061 | uint32_t link_num:8; | ||
1062 | } s; | ||
1063 | struct cvmx_pciercx_cfg450_s cn52xx; | ||
1064 | struct cvmx_pciercx_cfg450_s cn52xxp1; | ||
1065 | struct cvmx_pciercx_cfg450_s cn56xx; | ||
1066 | struct cvmx_pciercx_cfg450_s cn56xxp1; | ||
1067 | }; | ||
1068 | |||
1069 | union cvmx_pciercx_cfg451 { | ||
1070 | uint32_t u32; | ||
1071 | struct cvmx_pciercx_cfg451_s { | ||
1072 | uint32_t reserved_30_31:2; | ||
1073 | uint32_t l1el:3; | ||
1074 | uint32_t l0el:3; | ||
1075 | uint32_t n_fts_cc:8; | ||
1076 | uint32_t n_fts:8; | ||
1077 | uint32_t ack_freq:8; | ||
1078 | } s; | ||
1079 | struct cvmx_pciercx_cfg451_s cn52xx; | ||
1080 | struct cvmx_pciercx_cfg451_s cn52xxp1; | ||
1081 | struct cvmx_pciercx_cfg451_s cn56xx; | ||
1082 | struct cvmx_pciercx_cfg451_s cn56xxp1; | ||
1083 | }; | ||
1084 | |||
1085 | union cvmx_pciercx_cfg452 { | ||
1086 | uint32_t u32; | ||
1087 | struct cvmx_pciercx_cfg452_s { | ||
1088 | uint32_t reserved_26_31:6; | ||
1089 | uint32_t eccrc:1; | ||
1090 | uint32_t reserved_22_24:3; | ||
1091 | uint32_t lme:6; | ||
1092 | uint32_t reserved_8_15:8; | ||
1093 | uint32_t flm:1; | ||
1094 | uint32_t reserved_6_6:1; | ||
1095 | uint32_t dllle:1; | ||
1096 | uint32_t reserved_4_4:1; | ||
1097 | uint32_t ra:1; | ||
1098 | uint32_t le:1; | ||
1099 | uint32_t sd:1; | ||
1100 | uint32_t omr:1; | ||
1101 | } s; | ||
1102 | struct cvmx_pciercx_cfg452_s cn52xx; | ||
1103 | struct cvmx_pciercx_cfg452_s cn52xxp1; | ||
1104 | struct cvmx_pciercx_cfg452_s cn56xx; | ||
1105 | struct cvmx_pciercx_cfg452_s cn56xxp1; | ||
1106 | }; | ||
1107 | |||
1108 | union cvmx_pciercx_cfg453 { | ||
1109 | uint32_t u32; | ||
1110 | struct cvmx_pciercx_cfg453_s { | ||
1111 | uint32_t dlld:1; | ||
1112 | uint32_t reserved_26_30:5; | ||
1113 | uint32_t ack_nak:1; | ||
1114 | uint32_t fcd:1; | ||
1115 | uint32_t ilst:24; | ||
1116 | } s; | ||
1117 | struct cvmx_pciercx_cfg453_s cn52xx; | ||
1118 | struct cvmx_pciercx_cfg453_s cn52xxp1; | ||
1119 | struct cvmx_pciercx_cfg453_s cn56xx; | ||
1120 | struct cvmx_pciercx_cfg453_s cn56xxp1; | ||
1121 | }; | ||
1122 | |||
1123 | union cvmx_pciercx_cfg454 { | ||
1124 | uint32_t u32; | ||
1125 | struct cvmx_pciercx_cfg454_s { | ||
1126 | uint32_t reserved_29_31:3; | ||
1127 | uint32_t tmfcwt:5; | ||
1128 | uint32_t tmanlt:5; | ||
1129 | uint32_t tmrt:5; | ||
1130 | uint32_t reserved_11_13:3; | ||
1131 | uint32_t nskps:3; | ||
1132 | uint32_t reserved_4_7:4; | ||
1133 | uint32_t ntss:4; | ||
1134 | } s; | ||
1135 | struct cvmx_pciercx_cfg454_s cn52xx; | ||
1136 | struct cvmx_pciercx_cfg454_s cn52xxp1; | ||
1137 | struct cvmx_pciercx_cfg454_s cn56xx; | ||
1138 | struct cvmx_pciercx_cfg454_s cn56xxp1; | ||
1139 | }; | ||
1140 | |||
1141 | union cvmx_pciercx_cfg455 { | ||
1142 | uint32_t u32; | ||
1143 | struct cvmx_pciercx_cfg455_s { | ||
1144 | uint32_t m_cfg0_filt:1; | ||
1145 | uint32_t m_io_filt:1; | ||
1146 | uint32_t msg_ctrl:1; | ||
1147 | uint32_t m_cpl_ecrc_filt:1; | ||
1148 | uint32_t m_ecrc_filt:1; | ||
1149 | uint32_t m_cpl_len_err:1; | ||
1150 | uint32_t m_cpl_attr_err:1; | ||
1151 | uint32_t m_cpl_tc_err:1; | ||
1152 | uint32_t m_cpl_fun_err:1; | ||
1153 | uint32_t m_cpl_rid_err:1; | ||
1154 | uint32_t m_cpl_tag_err:1; | ||
1155 | uint32_t m_lk_filt:1; | ||
1156 | uint32_t m_cfg1_filt:1; | ||
1157 | uint32_t m_bar_match:1; | ||
1158 | uint32_t m_pois_filt:1; | ||
1159 | uint32_t m_fun:1; | ||
1160 | uint32_t dfcwt:1; | ||
1161 | uint32_t reserved_11_14:4; | ||
1162 | uint32_t skpiv:11; | ||
1163 | } s; | ||
1164 | struct cvmx_pciercx_cfg455_s cn52xx; | ||
1165 | struct cvmx_pciercx_cfg455_s cn52xxp1; | ||
1166 | struct cvmx_pciercx_cfg455_s cn56xx; | ||
1167 | struct cvmx_pciercx_cfg455_s cn56xxp1; | ||
1168 | }; | ||
1169 | |||
1170 | union cvmx_pciercx_cfg456 { | ||
1171 | uint32_t u32; | ||
1172 | struct cvmx_pciercx_cfg456_s { | ||
1173 | uint32_t reserved_2_31:30; | ||
1174 | uint32_t m_vend1_drp:1; | ||
1175 | uint32_t m_vend0_drp:1; | ||
1176 | } s; | ||
1177 | struct cvmx_pciercx_cfg456_s cn52xx; | ||
1178 | struct cvmx_pciercx_cfg456_s cn52xxp1; | ||
1179 | struct cvmx_pciercx_cfg456_s cn56xx; | ||
1180 | struct cvmx_pciercx_cfg456_s cn56xxp1; | ||
1181 | }; | ||
1182 | |||
1183 | union cvmx_pciercx_cfg458 { | ||
1184 | uint32_t u32; | ||
1185 | struct cvmx_pciercx_cfg458_s { | ||
1186 | uint32_t dbg_info_l32:32; | ||
1187 | } s; | ||
1188 | struct cvmx_pciercx_cfg458_s cn52xx; | ||
1189 | struct cvmx_pciercx_cfg458_s cn52xxp1; | ||
1190 | struct cvmx_pciercx_cfg458_s cn56xx; | ||
1191 | struct cvmx_pciercx_cfg458_s cn56xxp1; | ||
1192 | }; | ||
1193 | |||
1194 | union cvmx_pciercx_cfg459 { | ||
1195 | uint32_t u32; | ||
1196 | struct cvmx_pciercx_cfg459_s { | ||
1197 | uint32_t dbg_info_u32:32; | ||
1198 | } s; | ||
1199 | struct cvmx_pciercx_cfg459_s cn52xx; | ||
1200 | struct cvmx_pciercx_cfg459_s cn52xxp1; | ||
1201 | struct cvmx_pciercx_cfg459_s cn56xx; | ||
1202 | struct cvmx_pciercx_cfg459_s cn56xxp1; | ||
1203 | }; | ||
1204 | |||
1205 | union cvmx_pciercx_cfg460 { | ||
1206 | uint32_t u32; | ||
1207 | struct cvmx_pciercx_cfg460_s { | ||
1208 | uint32_t reserved_20_31:12; | ||
1209 | uint32_t tphfcc:8; | ||
1210 | uint32_t tpdfcc:12; | ||
1211 | } s; | ||
1212 | struct cvmx_pciercx_cfg460_s cn52xx; | ||
1213 | struct cvmx_pciercx_cfg460_s cn52xxp1; | ||
1214 | struct cvmx_pciercx_cfg460_s cn56xx; | ||
1215 | struct cvmx_pciercx_cfg460_s cn56xxp1; | ||
1216 | }; | ||
1217 | |||
1218 | union cvmx_pciercx_cfg461 { | ||
1219 | uint32_t u32; | ||
1220 | struct cvmx_pciercx_cfg461_s { | ||
1221 | uint32_t reserved_20_31:12; | ||
1222 | uint32_t tchfcc:8; | ||
1223 | uint32_t tcdfcc:12; | ||
1224 | } s; | ||
1225 | struct cvmx_pciercx_cfg461_s cn52xx; | ||
1226 | struct cvmx_pciercx_cfg461_s cn52xxp1; | ||
1227 | struct cvmx_pciercx_cfg461_s cn56xx; | ||
1228 | struct cvmx_pciercx_cfg461_s cn56xxp1; | ||
1229 | }; | ||
1230 | |||
1231 | union cvmx_pciercx_cfg462 { | ||
1232 | uint32_t u32; | ||
1233 | struct cvmx_pciercx_cfg462_s { | ||
1234 | uint32_t reserved_20_31:12; | ||
1235 | uint32_t tchfcc:8; | ||
1236 | uint32_t tcdfcc:12; | ||
1237 | } s; | ||
1238 | struct cvmx_pciercx_cfg462_s cn52xx; | ||
1239 | struct cvmx_pciercx_cfg462_s cn52xxp1; | ||
1240 | struct cvmx_pciercx_cfg462_s cn56xx; | ||
1241 | struct cvmx_pciercx_cfg462_s cn56xxp1; | ||
1242 | }; | ||
1243 | |||
1244 | union cvmx_pciercx_cfg463 { | ||
1245 | uint32_t u32; | ||
1246 | struct cvmx_pciercx_cfg463_s { | ||
1247 | uint32_t reserved_3_31:29; | ||
1248 | uint32_t rqne:1; | ||
1249 | uint32_t trbne:1; | ||
1250 | uint32_t rtlpfccnr:1; | ||
1251 | } s; | ||
1252 | struct cvmx_pciercx_cfg463_s cn52xx; | ||
1253 | struct cvmx_pciercx_cfg463_s cn52xxp1; | ||
1254 | struct cvmx_pciercx_cfg463_s cn56xx; | ||
1255 | struct cvmx_pciercx_cfg463_s cn56xxp1; | ||
1256 | }; | ||
1257 | |||
1258 | union cvmx_pciercx_cfg464 { | ||
1259 | uint32_t u32; | ||
1260 | struct cvmx_pciercx_cfg464_s { | ||
1261 | uint32_t wrr_vc3:8; | ||
1262 | uint32_t wrr_vc2:8; | ||
1263 | uint32_t wrr_vc1:8; | ||
1264 | uint32_t wrr_vc0:8; | ||
1265 | } s; | ||
1266 | struct cvmx_pciercx_cfg464_s cn52xx; | ||
1267 | struct cvmx_pciercx_cfg464_s cn52xxp1; | ||
1268 | struct cvmx_pciercx_cfg464_s cn56xx; | ||
1269 | struct cvmx_pciercx_cfg464_s cn56xxp1; | ||
1270 | }; | ||
1271 | |||
1272 | union cvmx_pciercx_cfg465 { | ||
1273 | uint32_t u32; | ||
1274 | struct cvmx_pciercx_cfg465_s { | ||
1275 | uint32_t wrr_vc7:8; | ||
1276 | uint32_t wrr_vc6:8; | ||
1277 | uint32_t wrr_vc5:8; | ||
1278 | uint32_t wrr_vc4:8; | ||
1279 | } s; | ||
1280 | struct cvmx_pciercx_cfg465_s cn52xx; | ||
1281 | struct cvmx_pciercx_cfg465_s cn52xxp1; | ||
1282 | struct cvmx_pciercx_cfg465_s cn56xx; | ||
1283 | struct cvmx_pciercx_cfg465_s cn56xxp1; | ||
1284 | }; | ||
1285 | |||
1286 | union cvmx_pciercx_cfg466 { | ||
1287 | uint32_t u32; | ||
1288 | struct cvmx_pciercx_cfg466_s { | ||
1289 | uint32_t rx_queue_order:1; | ||
1290 | uint32_t type_ordering:1; | ||
1291 | uint32_t reserved_24_29:6; | ||
1292 | uint32_t queue_mode:3; | ||
1293 | uint32_t reserved_20_20:1; | ||
1294 | uint32_t header_credits:8; | ||
1295 | uint32_t data_credits:12; | ||
1296 | } s; | ||
1297 | struct cvmx_pciercx_cfg466_s cn52xx; | ||
1298 | struct cvmx_pciercx_cfg466_s cn52xxp1; | ||
1299 | struct cvmx_pciercx_cfg466_s cn56xx; | ||
1300 | struct cvmx_pciercx_cfg466_s cn56xxp1; | ||
1301 | }; | ||
1302 | |||
1303 | union cvmx_pciercx_cfg467 { | ||
1304 | uint32_t u32; | ||
1305 | struct cvmx_pciercx_cfg467_s { | ||
1306 | uint32_t reserved_24_31:8; | ||
1307 | uint32_t queue_mode:3; | ||
1308 | uint32_t reserved_20_20:1; | ||
1309 | uint32_t header_credits:8; | ||
1310 | uint32_t data_credits:12; | ||
1311 | } s; | ||
1312 | struct cvmx_pciercx_cfg467_s cn52xx; | ||
1313 | struct cvmx_pciercx_cfg467_s cn52xxp1; | ||
1314 | struct cvmx_pciercx_cfg467_s cn56xx; | ||
1315 | struct cvmx_pciercx_cfg467_s cn56xxp1; | ||
1316 | }; | ||
1317 | |||
1318 | union cvmx_pciercx_cfg468 { | ||
1319 | uint32_t u32; | ||
1320 | struct cvmx_pciercx_cfg468_s { | ||
1321 | uint32_t reserved_24_31:8; | ||
1322 | uint32_t queue_mode:3; | ||
1323 | uint32_t reserved_20_20:1; | ||
1324 | uint32_t header_credits:8; | ||
1325 | uint32_t data_credits:12; | ||
1326 | } s; | ||
1327 | struct cvmx_pciercx_cfg468_s cn52xx; | ||
1328 | struct cvmx_pciercx_cfg468_s cn52xxp1; | ||
1329 | struct cvmx_pciercx_cfg468_s cn56xx; | ||
1330 | struct cvmx_pciercx_cfg468_s cn56xxp1; | ||
1331 | }; | ||
1332 | |||
1333 | union cvmx_pciercx_cfg490 { | ||
1334 | uint32_t u32; | ||
1335 | struct cvmx_pciercx_cfg490_s { | ||
1336 | uint32_t reserved_26_31:6; | ||
1337 | uint32_t header_depth:10; | ||
1338 | uint32_t reserved_14_15:2; | ||
1339 | uint32_t data_depth:14; | ||
1340 | } s; | ||
1341 | struct cvmx_pciercx_cfg490_s cn52xx; | ||
1342 | struct cvmx_pciercx_cfg490_s cn52xxp1; | ||
1343 | struct cvmx_pciercx_cfg490_s cn56xx; | ||
1344 | struct cvmx_pciercx_cfg490_s cn56xxp1; | ||
1345 | }; | ||
1346 | |||
1347 | union cvmx_pciercx_cfg491 { | ||
1348 | uint32_t u32; | ||
1349 | struct cvmx_pciercx_cfg491_s { | ||
1350 | uint32_t reserved_26_31:6; | ||
1351 | uint32_t header_depth:10; | ||
1352 | uint32_t reserved_14_15:2; | ||
1353 | uint32_t data_depth:14; | ||
1354 | } s; | ||
1355 | struct cvmx_pciercx_cfg491_s cn52xx; | ||
1356 | struct cvmx_pciercx_cfg491_s cn52xxp1; | ||
1357 | struct cvmx_pciercx_cfg491_s cn56xx; | ||
1358 | struct cvmx_pciercx_cfg491_s cn56xxp1; | ||
1359 | }; | ||
1360 | |||
1361 | union cvmx_pciercx_cfg492 { | ||
1362 | uint32_t u32; | ||
1363 | struct cvmx_pciercx_cfg492_s { | ||
1364 | uint32_t reserved_26_31:6; | ||
1365 | uint32_t header_depth:10; | ||
1366 | uint32_t reserved_14_15:2; | ||
1367 | uint32_t data_depth:14; | ||
1368 | } s; | ||
1369 | struct cvmx_pciercx_cfg492_s cn52xx; | ||
1370 | struct cvmx_pciercx_cfg492_s cn52xxp1; | ||
1371 | struct cvmx_pciercx_cfg492_s cn56xx; | ||
1372 | struct cvmx_pciercx_cfg492_s cn56xxp1; | ||
1373 | }; | ||
1374 | |||
1375 | union cvmx_pciercx_cfg516 { | ||
1376 | uint32_t u32; | ||
1377 | struct cvmx_pciercx_cfg516_s { | ||
1378 | uint32_t phy_stat:32; | ||
1379 | } s; | ||
1380 | struct cvmx_pciercx_cfg516_s cn52xx; | ||
1381 | struct cvmx_pciercx_cfg516_s cn52xxp1; | ||
1382 | struct cvmx_pciercx_cfg516_s cn56xx; | ||
1383 | struct cvmx_pciercx_cfg516_s cn56xxp1; | ||
1384 | }; | ||
1385 | |||
1386 | union cvmx_pciercx_cfg517 { | ||
1387 | uint32_t u32; | ||
1388 | struct cvmx_pciercx_cfg517_s { | ||
1389 | uint32_t phy_ctrl:32; | ||
1390 | } s; | ||
1391 | struct cvmx_pciercx_cfg517_s cn52xx; | ||
1392 | struct cvmx_pciercx_cfg517_s cn52xxp1; | ||
1393 | struct cvmx_pciercx_cfg517_s cn56xx; | ||
1394 | struct cvmx_pciercx_cfg517_s cn56xxp1; | ||
1395 | }; | ||
1396 | |||
1397 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-pescx-defs.h b/arch/mips/include/asm/octeon/cvmx-pescx-defs.h new file mode 100644 index 000000000000..f40cfaf84454 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-pescx-defs.h | |||
@@ -0,0 +1,410 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | #ifndef __CVMX_PESCX_DEFS_H__ | ||
29 | #define __CVMX_PESCX_DEFS_H__ | ||
30 | |||
31 | #define CVMX_PESCX_BIST_STATUS(block_id) \ | ||
32 | CVMX_ADD_IO_SEG(0x00011800C8000018ull + (((block_id) & 1) * 0x8000000ull)) | ||
33 | #define CVMX_PESCX_BIST_STATUS2(block_id) \ | ||
34 | CVMX_ADD_IO_SEG(0x00011800C8000418ull + (((block_id) & 1) * 0x8000000ull)) | ||
35 | #define CVMX_PESCX_CFG_RD(block_id) \ | ||
36 | CVMX_ADD_IO_SEG(0x00011800C8000030ull + (((block_id) & 1) * 0x8000000ull)) | ||
37 | #define CVMX_PESCX_CFG_WR(block_id) \ | ||
38 | CVMX_ADD_IO_SEG(0x00011800C8000028ull + (((block_id) & 1) * 0x8000000ull)) | ||
39 | #define CVMX_PESCX_CPL_LUT_VALID(block_id) \ | ||
40 | CVMX_ADD_IO_SEG(0x00011800C8000098ull + (((block_id) & 1) * 0x8000000ull)) | ||
41 | #define CVMX_PESCX_CTL_STATUS(block_id) \ | ||
42 | CVMX_ADD_IO_SEG(0x00011800C8000000ull + (((block_id) & 1) * 0x8000000ull)) | ||
43 | #define CVMX_PESCX_CTL_STATUS2(block_id) \ | ||
44 | CVMX_ADD_IO_SEG(0x00011800C8000400ull + (((block_id) & 1) * 0x8000000ull)) | ||
45 | #define CVMX_PESCX_DBG_INFO(block_id) \ | ||
46 | CVMX_ADD_IO_SEG(0x00011800C8000008ull + (((block_id) & 1) * 0x8000000ull)) | ||
47 | #define CVMX_PESCX_DBG_INFO_EN(block_id) \ | ||
48 | CVMX_ADD_IO_SEG(0x00011800C80000A0ull + (((block_id) & 1) * 0x8000000ull)) | ||
49 | #define CVMX_PESCX_DIAG_STATUS(block_id) \ | ||
50 | CVMX_ADD_IO_SEG(0x00011800C8000020ull + (((block_id) & 1) * 0x8000000ull)) | ||
51 | #define CVMX_PESCX_P2N_BAR0_START(block_id) \ | ||
52 | CVMX_ADD_IO_SEG(0x00011800C8000080ull + (((block_id) & 1) * 0x8000000ull)) | ||
53 | #define CVMX_PESCX_P2N_BAR1_START(block_id) \ | ||
54 | CVMX_ADD_IO_SEG(0x00011800C8000088ull + (((block_id) & 1) * 0x8000000ull)) | ||
55 | #define CVMX_PESCX_P2N_BAR2_START(block_id) \ | ||
56 | CVMX_ADD_IO_SEG(0x00011800C8000090ull + (((block_id) & 1) * 0x8000000ull)) | ||
57 | #define CVMX_PESCX_P2P_BARX_END(offset, block_id) \ | ||
58 | CVMX_ADD_IO_SEG(0x00011800C8000048ull + (((offset) & 3) * 16) + (((block_id) & 1) * 0x8000000ull)) | ||
59 | #define CVMX_PESCX_P2P_BARX_START(offset, block_id) \ | ||
60 | CVMX_ADD_IO_SEG(0x00011800C8000040ull + (((offset) & 3) * 16) + (((block_id) & 1) * 0x8000000ull)) | ||
61 | #define CVMX_PESCX_TLP_CREDITS(block_id) \ | ||
62 | CVMX_ADD_IO_SEG(0x00011800C8000038ull + (((block_id) & 1) * 0x8000000ull)) | ||
63 | |||
64 | union cvmx_pescx_bist_status { | ||
65 | uint64_t u64; | ||
66 | struct cvmx_pescx_bist_status_s { | ||
67 | uint64_t reserved_13_63:51; | ||
68 | uint64_t rqdata5:1; | ||
69 | uint64_t ctlp_or:1; | ||
70 | uint64_t ntlp_or:1; | ||
71 | uint64_t ptlp_or:1; | ||
72 | uint64_t retry:1; | ||
73 | uint64_t rqdata0:1; | ||
74 | uint64_t rqdata1:1; | ||
75 | uint64_t rqdata2:1; | ||
76 | uint64_t rqdata3:1; | ||
77 | uint64_t rqdata4:1; | ||
78 | uint64_t rqhdr1:1; | ||
79 | uint64_t rqhdr0:1; | ||
80 | uint64_t sot:1; | ||
81 | } s; | ||
82 | struct cvmx_pescx_bist_status_s cn52xx; | ||
83 | struct cvmx_pescx_bist_status_cn52xxp1 { | ||
84 | uint64_t reserved_12_63:52; | ||
85 | uint64_t ctlp_or:1; | ||
86 | uint64_t ntlp_or:1; | ||
87 | uint64_t ptlp_or:1; | ||
88 | uint64_t retry:1; | ||
89 | uint64_t rqdata0:1; | ||
90 | uint64_t rqdata1:1; | ||
91 | uint64_t rqdata2:1; | ||
92 | uint64_t rqdata3:1; | ||
93 | uint64_t rqdata4:1; | ||
94 | uint64_t rqhdr1:1; | ||
95 | uint64_t rqhdr0:1; | ||
96 | uint64_t sot:1; | ||
97 | } cn52xxp1; | ||
98 | struct cvmx_pescx_bist_status_s cn56xx; | ||
99 | struct cvmx_pescx_bist_status_cn52xxp1 cn56xxp1; | ||
100 | }; | ||
101 | |||
102 | union cvmx_pescx_bist_status2 { | ||
103 | uint64_t u64; | ||
104 | struct cvmx_pescx_bist_status2_s { | ||
105 | uint64_t reserved_14_63:50; | ||
106 | uint64_t cto_p2e:1; | ||
107 | uint64_t e2p_cpl:1; | ||
108 | uint64_t e2p_n:1; | ||
109 | uint64_t e2p_p:1; | ||
110 | uint64_t e2p_rsl:1; | ||
111 | uint64_t dbg_p2e:1; | ||
112 | uint64_t peai_p2e:1; | ||
113 | uint64_t rsl_p2e:1; | ||
114 | uint64_t pef_tpf1:1; | ||
115 | uint64_t pef_tpf0:1; | ||
116 | uint64_t pef_tnf:1; | ||
117 | uint64_t pef_tcf1:1; | ||
118 | uint64_t pef_tc0:1; | ||
119 | uint64_t ppf:1; | ||
120 | } s; | ||
121 | struct cvmx_pescx_bist_status2_s cn52xx; | ||
122 | struct cvmx_pescx_bist_status2_s cn52xxp1; | ||
123 | struct cvmx_pescx_bist_status2_s cn56xx; | ||
124 | struct cvmx_pescx_bist_status2_s cn56xxp1; | ||
125 | }; | ||
126 | |||
127 | union cvmx_pescx_cfg_rd { | ||
128 | uint64_t u64; | ||
129 | struct cvmx_pescx_cfg_rd_s { | ||
130 | uint64_t data:32; | ||
131 | uint64_t addr:32; | ||
132 | } s; | ||
133 | struct cvmx_pescx_cfg_rd_s cn52xx; | ||
134 | struct cvmx_pescx_cfg_rd_s cn52xxp1; | ||
135 | struct cvmx_pescx_cfg_rd_s cn56xx; | ||
136 | struct cvmx_pescx_cfg_rd_s cn56xxp1; | ||
137 | }; | ||
138 | |||
139 | union cvmx_pescx_cfg_wr { | ||
140 | uint64_t u64; | ||
141 | struct cvmx_pescx_cfg_wr_s { | ||
142 | uint64_t data:32; | ||
143 | uint64_t addr:32; | ||
144 | } s; | ||
145 | struct cvmx_pescx_cfg_wr_s cn52xx; | ||
146 | struct cvmx_pescx_cfg_wr_s cn52xxp1; | ||
147 | struct cvmx_pescx_cfg_wr_s cn56xx; | ||
148 | struct cvmx_pescx_cfg_wr_s cn56xxp1; | ||
149 | }; | ||
150 | |||
151 | union cvmx_pescx_cpl_lut_valid { | ||
152 | uint64_t u64; | ||
153 | struct cvmx_pescx_cpl_lut_valid_s { | ||
154 | uint64_t reserved_32_63:32; | ||
155 | uint64_t tag:32; | ||
156 | } s; | ||
157 | struct cvmx_pescx_cpl_lut_valid_s cn52xx; | ||
158 | struct cvmx_pescx_cpl_lut_valid_s cn52xxp1; | ||
159 | struct cvmx_pescx_cpl_lut_valid_s cn56xx; | ||
160 | struct cvmx_pescx_cpl_lut_valid_s cn56xxp1; | ||
161 | }; | ||
162 | |||
163 | union cvmx_pescx_ctl_status { | ||
164 | uint64_t u64; | ||
165 | struct cvmx_pescx_ctl_status_s { | ||
166 | uint64_t reserved_28_63:36; | ||
167 | uint64_t dnum:5; | ||
168 | uint64_t pbus:8; | ||
169 | uint64_t qlm_cfg:2; | ||
170 | uint64_t lane_swp:1; | ||
171 | uint64_t pm_xtoff:1; | ||
172 | uint64_t pm_xpme:1; | ||
173 | uint64_t ob_p_cmd:1; | ||
174 | uint64_t reserved_7_8:2; | ||
175 | uint64_t nf_ecrc:1; | ||
176 | uint64_t dly_one:1; | ||
177 | uint64_t lnk_enb:1; | ||
178 | uint64_t ro_ctlp:1; | ||
179 | uint64_t reserved_2_2:1; | ||
180 | uint64_t inv_ecrc:1; | ||
181 | uint64_t inv_lcrc:1; | ||
182 | } s; | ||
183 | struct cvmx_pescx_ctl_status_s cn52xx; | ||
184 | struct cvmx_pescx_ctl_status_s cn52xxp1; | ||
185 | struct cvmx_pescx_ctl_status_cn56xx { | ||
186 | uint64_t reserved_28_63:36; | ||
187 | uint64_t dnum:5; | ||
188 | uint64_t pbus:8; | ||
189 | uint64_t qlm_cfg:2; | ||
190 | uint64_t reserved_12_12:1; | ||
191 | uint64_t pm_xtoff:1; | ||
192 | uint64_t pm_xpme:1; | ||
193 | uint64_t ob_p_cmd:1; | ||
194 | uint64_t reserved_7_8:2; | ||
195 | uint64_t nf_ecrc:1; | ||
196 | uint64_t dly_one:1; | ||
197 | uint64_t lnk_enb:1; | ||
198 | uint64_t ro_ctlp:1; | ||
199 | uint64_t reserved_2_2:1; | ||
200 | uint64_t inv_ecrc:1; | ||
201 | uint64_t inv_lcrc:1; | ||
202 | } cn56xx; | ||
203 | struct cvmx_pescx_ctl_status_cn56xx cn56xxp1; | ||
204 | }; | ||
205 | |||
206 | union cvmx_pescx_ctl_status2 { | ||
207 | uint64_t u64; | ||
208 | struct cvmx_pescx_ctl_status2_s { | ||
209 | uint64_t reserved_2_63:62; | ||
210 | uint64_t pclk_run:1; | ||
211 | uint64_t pcierst:1; | ||
212 | } s; | ||
213 | struct cvmx_pescx_ctl_status2_s cn52xx; | ||
214 | struct cvmx_pescx_ctl_status2_cn52xxp1 { | ||
215 | uint64_t reserved_1_63:63; | ||
216 | uint64_t pcierst:1; | ||
217 | } cn52xxp1; | ||
218 | struct cvmx_pescx_ctl_status2_s cn56xx; | ||
219 | struct cvmx_pescx_ctl_status2_cn52xxp1 cn56xxp1; | ||
220 | }; | ||
221 | |||
222 | union cvmx_pescx_dbg_info { | ||
223 | uint64_t u64; | ||
224 | struct cvmx_pescx_dbg_info_s { | ||
225 | uint64_t reserved_31_63:33; | ||
226 | uint64_t ecrc_e:1; | ||
227 | uint64_t rawwpp:1; | ||
228 | uint64_t racpp:1; | ||
229 | uint64_t ramtlp:1; | ||
230 | uint64_t rarwdns:1; | ||
231 | uint64_t caar:1; | ||
232 | uint64_t racca:1; | ||
233 | uint64_t racur:1; | ||
234 | uint64_t rauc:1; | ||
235 | uint64_t rqo:1; | ||
236 | uint64_t fcuv:1; | ||
237 | uint64_t rpe:1; | ||
238 | uint64_t fcpvwt:1; | ||
239 | uint64_t dpeoosd:1; | ||
240 | uint64_t rtwdle:1; | ||
241 | uint64_t rdwdle:1; | ||
242 | uint64_t mre:1; | ||
243 | uint64_t rte:1; | ||
244 | uint64_t acto:1; | ||
245 | uint64_t rvdm:1; | ||
246 | uint64_t rumep:1; | ||
247 | uint64_t rptamrc:1; | ||
248 | uint64_t rpmerc:1; | ||
249 | uint64_t rfemrc:1; | ||
250 | uint64_t rnfemrc:1; | ||
251 | uint64_t rcemrc:1; | ||
252 | uint64_t rpoison:1; | ||
253 | uint64_t recrce:1; | ||
254 | uint64_t rtlplle:1; | ||
255 | uint64_t rtlpmal:1; | ||
256 | uint64_t spoison:1; | ||
257 | } s; | ||
258 | struct cvmx_pescx_dbg_info_s cn52xx; | ||
259 | struct cvmx_pescx_dbg_info_s cn52xxp1; | ||
260 | struct cvmx_pescx_dbg_info_s cn56xx; | ||
261 | struct cvmx_pescx_dbg_info_s cn56xxp1; | ||
262 | }; | ||
263 | |||
264 | union cvmx_pescx_dbg_info_en { | ||
265 | uint64_t u64; | ||
266 | struct cvmx_pescx_dbg_info_en_s { | ||
267 | uint64_t reserved_31_63:33; | ||
268 | uint64_t ecrc_e:1; | ||
269 | uint64_t rawwpp:1; | ||
270 | uint64_t racpp:1; | ||
271 | uint64_t ramtlp:1; | ||
272 | uint64_t rarwdns:1; | ||
273 | uint64_t caar:1; | ||
274 | uint64_t racca:1; | ||
275 | uint64_t racur:1; | ||
276 | uint64_t rauc:1; | ||
277 | uint64_t rqo:1; | ||
278 | uint64_t fcuv:1; | ||
279 | uint64_t rpe:1; | ||
280 | uint64_t fcpvwt:1; | ||
281 | uint64_t dpeoosd:1; | ||
282 | uint64_t rtwdle:1; | ||
283 | uint64_t rdwdle:1; | ||
284 | uint64_t mre:1; | ||
285 | uint64_t rte:1; | ||
286 | uint64_t acto:1; | ||
287 | uint64_t rvdm:1; | ||
288 | uint64_t rumep:1; | ||
289 | uint64_t rptamrc:1; | ||
290 | uint64_t rpmerc:1; | ||
291 | uint64_t rfemrc:1; | ||
292 | uint64_t rnfemrc:1; | ||
293 | uint64_t rcemrc:1; | ||
294 | uint64_t rpoison:1; | ||
295 | uint64_t recrce:1; | ||
296 | uint64_t rtlplle:1; | ||
297 | uint64_t rtlpmal:1; | ||
298 | uint64_t spoison:1; | ||
299 | } s; | ||
300 | struct cvmx_pescx_dbg_info_en_s cn52xx; | ||
301 | struct cvmx_pescx_dbg_info_en_s cn52xxp1; | ||
302 | struct cvmx_pescx_dbg_info_en_s cn56xx; | ||
303 | struct cvmx_pescx_dbg_info_en_s cn56xxp1; | ||
304 | }; | ||
305 | |||
306 | union cvmx_pescx_diag_status { | ||
307 | uint64_t u64; | ||
308 | struct cvmx_pescx_diag_status_s { | ||
309 | uint64_t reserved_4_63:60; | ||
310 | uint64_t pm_dst:1; | ||
311 | uint64_t pm_stat:1; | ||
312 | uint64_t pm_en:1; | ||
313 | uint64_t aux_en:1; | ||
314 | } s; | ||
315 | struct cvmx_pescx_diag_status_s cn52xx; | ||
316 | struct cvmx_pescx_diag_status_s cn52xxp1; | ||
317 | struct cvmx_pescx_diag_status_s cn56xx; | ||
318 | struct cvmx_pescx_diag_status_s cn56xxp1; | ||
319 | }; | ||
320 | |||
321 | union cvmx_pescx_p2n_bar0_start { | ||
322 | uint64_t u64; | ||
323 | struct cvmx_pescx_p2n_bar0_start_s { | ||
324 | uint64_t addr:50; | ||
325 | uint64_t reserved_0_13:14; | ||
326 | } s; | ||
327 | struct cvmx_pescx_p2n_bar0_start_s cn52xx; | ||
328 | struct cvmx_pescx_p2n_bar0_start_s cn52xxp1; | ||
329 | struct cvmx_pescx_p2n_bar0_start_s cn56xx; | ||
330 | struct cvmx_pescx_p2n_bar0_start_s cn56xxp1; | ||
331 | }; | ||
332 | |||
333 | union cvmx_pescx_p2n_bar1_start { | ||
334 | uint64_t u64; | ||
335 | struct cvmx_pescx_p2n_bar1_start_s { | ||
336 | uint64_t addr:38; | ||
337 | uint64_t reserved_0_25:26; | ||
338 | } s; | ||
339 | struct cvmx_pescx_p2n_bar1_start_s cn52xx; | ||
340 | struct cvmx_pescx_p2n_bar1_start_s cn52xxp1; | ||
341 | struct cvmx_pescx_p2n_bar1_start_s cn56xx; | ||
342 | struct cvmx_pescx_p2n_bar1_start_s cn56xxp1; | ||
343 | }; | ||
344 | |||
345 | union cvmx_pescx_p2n_bar2_start { | ||
346 | uint64_t u64; | ||
347 | struct cvmx_pescx_p2n_bar2_start_s { | ||
348 | uint64_t addr:25; | ||
349 | uint64_t reserved_0_38:39; | ||
350 | } s; | ||
351 | struct cvmx_pescx_p2n_bar2_start_s cn52xx; | ||
352 | struct cvmx_pescx_p2n_bar2_start_s cn52xxp1; | ||
353 | struct cvmx_pescx_p2n_bar2_start_s cn56xx; | ||
354 | struct cvmx_pescx_p2n_bar2_start_s cn56xxp1; | ||
355 | }; | ||
356 | |||
357 | union cvmx_pescx_p2p_barx_end { | ||
358 | uint64_t u64; | ||
359 | struct cvmx_pescx_p2p_barx_end_s { | ||
360 | uint64_t addr:52; | ||
361 | uint64_t reserved_0_11:12; | ||
362 | } s; | ||
363 | struct cvmx_pescx_p2p_barx_end_s cn52xx; | ||
364 | struct cvmx_pescx_p2p_barx_end_s cn52xxp1; | ||
365 | struct cvmx_pescx_p2p_barx_end_s cn56xx; | ||
366 | struct cvmx_pescx_p2p_barx_end_s cn56xxp1; | ||
367 | }; | ||
368 | |||
369 | union cvmx_pescx_p2p_barx_start { | ||
370 | uint64_t u64; | ||
371 | struct cvmx_pescx_p2p_barx_start_s { | ||
372 | uint64_t addr:52; | ||
373 | uint64_t reserved_0_11:12; | ||
374 | } s; | ||
375 | struct cvmx_pescx_p2p_barx_start_s cn52xx; | ||
376 | struct cvmx_pescx_p2p_barx_start_s cn52xxp1; | ||
377 | struct cvmx_pescx_p2p_barx_start_s cn56xx; | ||
378 | struct cvmx_pescx_p2p_barx_start_s cn56xxp1; | ||
379 | }; | ||
380 | |||
381 | union cvmx_pescx_tlp_credits { | ||
382 | uint64_t u64; | ||
383 | struct cvmx_pescx_tlp_credits_s { | ||
384 | uint64_t reserved_0_63:64; | ||
385 | } s; | ||
386 | struct cvmx_pescx_tlp_credits_cn52xx { | ||
387 | uint64_t reserved_56_63:8; | ||
388 | uint64_t peai_ppf:8; | ||
389 | uint64_t pesc_cpl:8; | ||
390 | uint64_t pesc_np:8; | ||
391 | uint64_t pesc_p:8; | ||
392 | uint64_t npei_cpl:8; | ||
393 | uint64_t npei_np:8; | ||
394 | uint64_t npei_p:8; | ||
395 | } cn52xx; | ||
396 | struct cvmx_pescx_tlp_credits_cn52xxp1 { | ||
397 | uint64_t reserved_38_63:26; | ||
398 | uint64_t peai_ppf:8; | ||
399 | uint64_t pesc_cpl:5; | ||
400 | uint64_t pesc_np:5; | ||
401 | uint64_t pesc_p:5; | ||
402 | uint64_t npei_cpl:5; | ||
403 | uint64_t npei_np:5; | ||
404 | uint64_t npei_p:5; | ||
405 | } cn52xxp1; | ||
406 | struct cvmx_pescx_tlp_credits_cn52xx cn56xx; | ||
407 | struct cvmx_pescx_tlp_credits_cn52xxp1 cn56xxp1; | ||
408 | }; | ||
409 | |||
410 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx-pexp-defs.h b/arch/mips/include/asm/octeon/cvmx-pexp-defs.h new file mode 100644 index 000000000000..5ea5dc571b54 --- /dev/null +++ b/arch/mips/include/asm/octeon/cvmx-pexp-defs.h | |||
@@ -0,0 +1,229 @@ | |||
1 | /***********************license start*************** | ||
2 | * Author: Cavium Networks | ||
3 | * | ||
4 | * Contact: support@caviumnetworks.com | ||
5 | * This file is part of the OCTEON SDK | ||
6 | * | ||
7 | * Copyright (c) 2003-2008 Cavium Networks | ||
8 | * | ||
9 | * This file is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License, Version 2, as | ||
11 | * published by the Free Software Foundation. | ||
12 | * | ||
13 | * This file is distributed in the hope that it will be useful, but | ||
14 | * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty | ||
15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or | ||
16 | * NONINFRINGEMENT. See the GNU General Public License for more | ||
17 | * details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this file; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | * or visit http://www.gnu.org/licenses/. | ||
23 | * | ||
24 | * This file may also be available under a different license from Cavium. | ||
25 | * Contact Cavium Networks for more information | ||
26 | ***********************license end**************************************/ | ||
27 | |||
28 | /** | ||
29 | * cvmx-pexp-defs.h | ||
30 | * | ||
31 | * Configuration and status register (CSR) definitions for | ||
32 | * OCTEON PEXP. | ||
33 | * | ||
34 | */ | ||
35 | #ifndef __CVMX_PEXP_DEFS_H__ | ||
36 | #define __CVMX_PEXP_DEFS_H__ | ||
37 | |||
38 | #define CVMX_PEXP_NPEI_BAR1_INDEXX(offset) \ | ||
39 | CVMX_ADD_IO_SEG(0x00011F0000008000ull + (((offset) & 31) * 16)) | ||
40 | #define CVMX_PEXP_NPEI_BIST_STATUS \ | ||
41 | CVMX_ADD_IO_SEG(0x00011F0000008580ull) | ||
42 | #define CVMX_PEXP_NPEI_BIST_STATUS2 \ | ||
43 | CVMX_ADD_IO_SEG(0x00011F0000008680ull) | ||
44 | #define CVMX_PEXP_NPEI_CTL_PORT0 \ | ||
45 | CVMX_ADD_IO_SEG(0x00011F0000008250ull) | ||
46 | #define CVMX_PEXP_NPEI_CTL_PORT1 \ | ||
47 | CVMX_ADD_IO_SEG(0x00011F0000008260ull) | ||
48 | #define CVMX_PEXP_NPEI_CTL_STATUS \ | ||
49 | CVMX_ADD_IO_SEG(0x00011F0000008570ull) | ||
50 | #define CVMX_PEXP_NPEI_CTL_STATUS2 \ | ||
51 | CVMX_ADD_IO_SEG(0x00011F000000BC00ull) | ||
52 | #define CVMX_PEXP_NPEI_DATA_OUT_CNT \ | ||
53 | CVMX_ADD_IO_SEG(0x00011F00000085F0ull) | ||
54 | #define CVMX_PEXP_NPEI_DBG_DATA \ | ||
55 | CVMX_ADD_IO_SEG(0x00011F0000008510ull) | ||
56 | #define CVMX_PEXP_NPEI_DBG_SELECT \ | ||
57 | CVMX_ADD_IO_SEG(0x00011F0000008500ull) | ||
58 | #define CVMX_PEXP_NPEI_DMA0_INT_LEVEL \ | ||
59 | CVMX_ADD_IO_SEG(0x00011F00000085C0ull) | ||
60 | #define CVMX_PEXP_NPEI_DMA1_INT_LEVEL \ | ||
61 | CVMX_ADD_IO_SEG(0x00011F00000085D0ull) | ||
62 | #define CVMX_PEXP_NPEI_DMAX_COUNTS(offset) \ | ||
63 | CVMX_ADD_IO_SEG(0x00011F0000008450ull + (((offset) & 7) * 16)) | ||
64 | #define CVMX_PEXP_NPEI_DMAX_DBELL(offset) \ | ||
65 | CVMX_ADD_IO_SEG(0x00011F00000083B0ull + (((offset) & 7) * 16)) | ||
66 | #define CVMX_PEXP_NPEI_DMAX_IBUFF_SADDR(offset) \ | ||
67 | CVMX_ADD_IO_SEG(0x00011F0000008400ull + (((offset) & 7) * 16)) | ||
68 | #define CVMX_PEXP_NPEI_DMAX_NADDR(offset) \ | ||
69 | CVMX_ADD_IO_SEG(0x00011F00000084A0ull + (((offset) & 7) * 16)) | ||
70 | #define CVMX_PEXP_NPEI_DMA_CNTS \ | ||
71 | CVMX_ADD_IO_SEG(0x00011F00000085E0ull) | ||
72 | #define CVMX_PEXP_NPEI_DMA_CONTROL \ | ||
73 | CVMX_ADD_IO_SEG(0x00011F00000083A0ull) | ||
74 | #define CVMX_PEXP_NPEI_INT_A_ENB \ | ||
75 | CVMX_ADD_IO_SEG(0x00011F0000008560ull) | ||
76 | #define CVMX_PEXP_NPEI_INT_A_ENB2 \ | ||
77 | CVMX_ADD_IO_SEG(0x00011F000000BCE0ull) | ||
78 | #define CVMX_PEXP_NPEI_INT_A_SUM \ | ||
79 | CVMX_ADD_IO_SEG(0x00011F0000008550ull) | ||
80 | #define CVMX_PEXP_NPEI_INT_ENB \ | ||
81 | CVMX_ADD_IO_SEG(0x00011F0000008540ull) | ||
82 | #define CVMX_PEXP_NPEI_INT_ENB2 \ | ||
83 | CVMX_ADD_IO_SEG(0x00011F000000BCD0ull) | ||
84 | #define CVMX_PEXP_NPEI_INT_INFO \ | ||
85 | CVMX_ADD_IO_SEG(0x00011F0000008590ull) | ||
86 | #define CVMX_PEXP_NPEI_INT_SUM \ | ||
87 | CVMX_ADD_IO_SEG(0x00011F0000008530ull) | ||
88 | #define CVMX_PEXP_NPEI_INT_SUM2 \ | ||
89 | CVMX_ADD_IO_SEG(0x00011F000000BCC0ull) | ||
90 | #define CVMX_PEXP_NPEI_LAST_WIN_RDATA0 \ | ||
91 | CVMX_ADD_IO_SEG(0x00011F0000008600ull) | ||
92 | #define CVMX_PEXP_NPEI_LAST_WIN_RDATA1 \ | ||
93 | CVMX_ADD_IO_SEG(0x00011F0000008610ull) | ||
94 | #define CVMX_PEXP_NPEI_MEM_ACCESS_CTL \ | ||
95 | CVMX_ADD_IO_SEG(0x00011F00000084F0ull) | ||
96 | #define CVMX_PEXP_NPEI_MEM_ACCESS_SUBIDX(offset) \ | ||
97 | CVMX_ADD_IO_SEG(0x00011F0000008280ull + (((offset) & 31) * 16) - 16 * 12) | ||
98 | #define CVMX_PEXP_NPEI_MSI_ENB0 \ | ||
99 | CVMX_ADD_IO_SEG(0x00011F000000BC50ull) | ||
100 | #define CVMX_PEXP_NPEI_MSI_ENB1 \ | ||
101 | CVMX_ADD_IO_SEG(0x00011F000000BC60ull) | ||
102 | #define CVMX_PEXP_NPEI_MSI_ENB2 \ | ||
103 | CVMX_ADD_IO_SEG(0x00011F000000BC70ull) | ||
104 | #define CVMX_PEXP_NPEI_MSI_ENB3 \ | ||
105 | CVMX_ADD_IO_SEG(0x00011F000000BC80ull) | ||
106 | #define CVMX_PEXP_NPEI_MSI_RCV0 \ | ||
107 | CVMX_ADD_IO_SEG(0x00011F000000BC10ull) | ||
108 | #define CVMX_PEXP_NPEI_MSI_RCV1 \ | ||
109 | CVMX_ADD_IO_SEG(0x00011F000000BC20ull) | ||
110 | #define CVMX_PEXP_NPEI_MSI_RCV2 \ | ||
111 | CVMX_ADD_IO_SEG(0x00011F000000BC30ull) | ||
112 | #define CVMX_PEXP_NPEI_MSI_RCV3 \ | ||
113 | CVMX_ADD_IO_SEG(0x00011F000000BC40ull) | ||
114 | #define CVMX_PEXP_NPEI_MSI_RD_MAP \ | ||
115 | CVMX_ADD_IO_SEG(0x00011F000000BCA0ull) | ||
116 | #define CVMX_PEXP_NPEI_MSI_W1C_ENB0 \ | ||
117 | CVMX_ADD_IO_SEG(0x00011F000000BCF0ull) | ||
118 | #define CVMX_PEXP_NPEI_MSI_W1C_ENB1 \ | ||
119 | CVMX_ADD_IO_SEG(0x00011F000000BD00ull) | ||
120 | #define CVMX_PEXP_NPEI_MSI_W1C_ENB2 \ | ||
121 | CVMX_ADD_IO_SEG(0x00011F000000BD10ull) | ||
122 | #define CVMX_PEXP_NPEI_MSI_W1C_ENB3 \ | ||
123 | CVMX_ADD_IO_SEG(0x00011F000000BD20ull) | ||
124 | #define CVMX_PEXP_NPEI_MSI_W1S_ENB0 \ | ||
125 | CVMX_ADD_IO_SEG(0x00011F000000BD30ull) | ||
126 | #define CVMX_PEXP_NPEI_MSI_W1S_ENB1 \ | ||
127 | CVMX_ADD_IO_SEG(0x00011F000000BD40ull) | ||
128 | #define CVMX_PEXP_NPEI_MSI_W1S_ENB2 \ | ||
129 | CVMX_ADD_IO_SEG(0x00011F000000BD50ull) | ||
130 | #define CVMX_PEXP_NPEI_MSI_W1S_ENB3 \ | ||
131 | CVMX_ADD_IO_SEG(0x00011F000000BD60ull) | ||
132 | #define CVMX_PEXP_NPEI_MSI_WR_MAP \ | ||
133 | CVMX_ADD_IO_SEG(0x00011F000000BC90ull) | ||
134 | #define CVMX_PEXP_NPEI_PCIE_CREDIT_CNT \ | ||
135 | CVMX_ADD_IO_SEG(0x00011F000000BD70ull) | ||
136 | #define CVMX_PEXP_NPEI_PCIE_MSI_RCV \ | ||
137 | CVMX_ADD_IO_SEG(0x00011F000000BCB0ull) | ||
138 | #define CVMX_PEXP_NPEI_PCIE_MSI_RCV_B1 \ | ||
139 | CVMX_ADD_IO_SEG(0x00011F0000008650ull) | ||
140 | #define CVMX_PEXP_NPEI_PCIE_MSI_RCV_B2 \ | ||
141 | CVMX_ADD_IO_SEG(0x00011F0000008660ull) | ||
142 | #define CVMX_PEXP_NPEI_PCIE_MSI_RCV_B3 \ | ||
143 | CVMX_ADD_IO_SEG(0x00011F0000008670ull) | ||
144 | #define CVMX_PEXP_NPEI_PKTX_CNTS(offset) \ | ||
145 | CVMX_ADD_IO_SEG(0x00011F000000A400ull + (((offset) & 31) * 16)) | ||
146 | #define CVMX_PEXP_NPEI_PKTX_INSTR_BADDR(offset) \ | ||
147 | CVMX_ADD_IO_SEG(0x00011F000000A800ull + (((offset) & 31) * 16)) | ||
148 | #define CVMX_PEXP_NPEI_PKTX_INSTR_BAOFF_DBELL(offset) \ | ||
149 | CVMX_ADD_IO_SEG(0x00011F000000AC00ull + (((offset) & 31) * 16)) | ||
150 | #define CVMX_PEXP_NPEI_PKTX_INSTR_FIFO_RSIZE(offset) \ | ||
151 | CVMX_ADD_IO_SEG(0x00011F000000B000ull + (((offset) & 31) * 16)) | ||
152 | #define CVMX_PEXP_NPEI_PKTX_INSTR_HEADER(offset) \ | ||
153 | CVMX_ADD_IO_SEG(0x00011F000000B400ull + (((offset) & 31) * 16)) | ||
154 | #define CVMX_PEXP_NPEI_PKTX_IN_BP(offset) \ | ||
155 | CVMX_ADD_IO_SEG(0x00011F000000B800ull + (((offset) & 31) * 16)) | ||
156 | #define CVMX_PEXP_NPEI_PKTX_SLIST_BADDR(offset) \ | ||
157 | CVMX_ADD_IO_SEG(0x00011F0000009400ull + (((offset) & 31) * 16)) | ||
158 | #define CVMX_PEXP_NPEI_PKTX_SLIST_BAOFF_DBELL(offset) \ | ||
159 | CVMX_ADD_IO_SEG(0x00011F0000009800ull + (((offset) & 31) * 16)) | ||
160 | #define CVMX_PEXP_NPEI_PKTX_SLIST_FIFO_RSIZE(offset) \ | ||
161 | CVMX_ADD_IO_SEG(0x00011F0000009C00ull + (((offset) & 31) * 16)) | ||
162 | #define CVMX_PEXP_NPEI_PKT_CNT_INT \ | ||
163 | CVMX_ADD_IO_SEG(0x00011F0000009110ull) | ||
164 | #define CVMX_PEXP_NPEI_PKT_CNT_INT_ENB \ | ||
165 | CVMX_ADD_IO_SEG(0x00011F0000009130ull) | ||
166 | #define CVMX_PEXP_NPEI_PKT_DATA_OUT_ES \ | ||
167 | CVMX_ADD_IO_SEG(0x00011F00000090B0ull) | ||
168 | #define CVMX_PEXP_NPEI_PKT_DATA_OUT_NS \ | ||
169 | CVMX_ADD_IO_SEG(0x00011F00000090A0ull) | ||
170 | #define CVMX_PEXP_NPEI_PKT_DATA_OUT_ROR \ | ||
171 | CVMX_ADD_IO_SEG(0x00011F0000009090ull) | ||
172 | #define CVMX_PEXP_NPEI_PKT_DPADDR \ | ||
173 | CVMX_ADD_IO_SEG(0x00011F0000009080ull) | ||
174 | #define CVMX_PEXP_NPEI_PKT_INPUT_CONTROL \ | ||
175 | CVMX_ADD_IO_SEG(0x00011F0000009150ull) | ||
176 | #define CVMX_PEXP_NPEI_PKT_INSTR_ENB \ | ||
177 | CVMX_ADD_IO_SEG(0x00011F0000009000ull) | ||
178 | #define CVMX_PEXP_NPEI_PKT_INSTR_RD_SIZE \ | ||
179 | CVMX_ADD_IO_SEG(0x00011F0000009190ull) | ||
180 | #define CVMX_PEXP_NPEI_PKT_INSTR_SIZE \ | ||
181 | CVMX_ADD_IO_SEG(0x00011F0000009020ull) | ||
182 | #define CVMX_PEXP_NPEI_PKT_INT_LEVELS \ | ||
183 | CVMX_ADD_IO_SEG(0x00011F0000009100ull) | ||
184 | #define CVMX_PEXP_NPEI_PKT_IN_BP \ | ||
185 | CVMX_ADD_IO_SEG(0x00011F00000086B0ull) | ||
186 | #define CVMX_PEXP_NPEI_PKT_IN_DONEX_CNTS(offset) \ | ||
187 | CVMX_ADD_IO_SEG(0x00011F000000A000ull + (((offset) & 31) * 16)) | ||
188 | #define CVMX_PEXP_NPEI_PKT_IN_INSTR_COUNTS \ | ||
189 | CVMX_ADD_IO_SEG(0x00011F00000086A0ull) | ||
190 | #define CVMX_PEXP_NPEI_PKT_IN_PCIE_PORT \ | ||
191 | CVMX_ADD_IO_SEG(0x00011F00000091A0ull) | ||
192 | #define CVMX_PEXP_NPEI_PKT_IPTR \ | ||
193 | CVMX_ADD_IO_SEG(0x00011F0000009070ull) | ||
194 | #define CVMX_PEXP_NPEI_PKT_OUTPUT_WMARK \ | ||
195 | CVMX_ADD_IO_SEG(0x00011F0000009160ull) | ||
196 | #define CVMX_PEXP_NPEI_PKT_OUT_BMODE \ | ||
197 | CVMX_ADD_IO_SEG(0x00011F00000090D0ull) | ||
198 | #define CVMX_PEXP_NPEI_PKT_OUT_ENB \ | ||
199 | CVMX_ADD_IO_SEG(0x00011F0000009010ull) | ||
200 | #define CVMX_PEXP_NPEI_PKT_PCIE_PORT \ | ||
201 | CVMX_ADD_IO_SEG(0x00011F00000090E0ull) | ||
202 | #define CVMX_PEXP_NPEI_PKT_PORT_IN_RST \ | ||
203 | CVMX_ADD_IO_SEG(0x00011F0000008690ull) | ||
204 | #define CVMX_PEXP_NPEI_PKT_SLIST_ES \ | ||
205 | CVMX_ADD_IO_SEG(0x00011F0000009050ull) | ||
206 | #define CVMX_PEXP_NPEI_PKT_SLIST_ID_SIZE \ | ||
207 | CVMX_ADD_IO_SEG(0x00011F0000009180ull) | ||
208 | #define CVMX_PEXP_NPEI_PKT_SLIST_NS \ | ||
209 | CVMX_ADD_IO_SEG(0x00011F0000009040ull) | ||
210 | #define CVMX_PEXP_NPEI_PKT_SLIST_ROR \ | ||
211 | CVMX_ADD_IO_SEG(0x00011F0000009030ull) | ||
212 | #define CVMX_PEXP_NPEI_PKT_TIME_INT \ | ||
213 | CVMX_ADD_IO_SEG(0x00011F0000009120ull) | ||
214 | #define CVMX_PEXP_NPEI_PKT_TIME_INT_ENB \ | ||
215 | CVMX_ADD_IO_SEG(0x00011F0000009140ull) | ||
216 | #define CVMX_PEXP_NPEI_RSL_INT_BLOCKS \ | ||
217 | CVMX_ADD_IO_SEG(0x00011F0000008520ull) | ||
218 | #define CVMX_PEXP_NPEI_SCRATCH_1 \ | ||
219 | CVMX_ADD_IO_SEG(0x00011F0000008270ull) | ||
220 | #define CVMX_PEXP_NPEI_STATE1 \ | ||
221 | CVMX_ADD_IO_SEG(0x00011F0000008620ull) | ||
222 | #define CVMX_PEXP_NPEI_STATE2 \ | ||
223 | CVMX_ADD_IO_SEG(0x00011F0000008630ull) | ||
224 | #define CVMX_PEXP_NPEI_STATE3 \ | ||
225 | CVMX_ADD_IO_SEG(0x00011F0000008640ull) | ||
226 | #define CVMX_PEXP_NPEI_WINDOW_CTL \ | ||
227 | CVMX_ADD_IO_SEG(0x00011F0000008380ull) | ||
228 | |||
229 | #endif | ||
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h index 03fddfa3e928..e31e3fe14f8a 100644 --- a/arch/mips/include/asm/octeon/cvmx.h +++ b/arch/mips/include/asm/octeon/cvmx.h | |||
@@ -376,6 +376,18 @@ static inline uint64_t cvmx_get_cycle(void) | |||
376 | } | 376 | } |
377 | 377 | ||
378 | /** | 378 | /** |
379 | * Wait for the specified number of cycle | ||
380 | * | ||
381 | */ | ||
382 | static inline void cvmx_wait(uint64_t cycles) | ||
383 | { | ||
384 | uint64_t done = cvmx_get_cycle() + cycles; | ||
385 | |||
386 | while (cvmx_get_cycle() < done) | ||
387 | ; /* Spin */ | ||
388 | } | ||
389 | |||
390 | /** | ||
379 | * Reads a chip global cycle counter. This counts CPU cycles since | 391 | * Reads a chip global cycle counter. This counts CPU cycles since |
380 | * chip reset. The counter is 64 bit. | 392 | * chip reset. The counter is 64 bit. |
381 | * This register does not exist on CN38XX pass 1 silicion | 393 | * This register does not exist on CN38XX pass 1 silicion |
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h index 04fac684069c..ef24a7b4ea57 100644 --- a/arch/mips/include/asm/octeon/octeon-feature.h +++ b/arch/mips/include/asm/octeon/octeon-feature.h | |||
@@ -57,6 +57,13 @@ enum octeon_feature { | |||
57 | OCTEON_FEATURE_RAID, | 57 | OCTEON_FEATURE_RAID, |
58 | /* Octeon has a builtin USB */ | 58 | /* Octeon has a builtin USB */ |
59 | OCTEON_FEATURE_USB, | 59 | OCTEON_FEATURE_USB, |
60 | /* Octeon IPD can run without using work queue entries */ | ||
61 | OCTEON_FEATURE_NO_WPTR, | ||
62 | /* Octeon has DFA state machines */ | ||
63 | OCTEON_FEATURE_DFA, | ||
64 | /* Octeon MDIO block supports clause 45 transactions for 10 | ||
65 | * Gig support */ | ||
66 | OCTEON_FEATURE_MDIO_CLAUSE_45, | ||
60 | }; | 67 | }; |
61 | 68 | ||
62 | static inline int cvmx_fuse_read(int fuse); | 69 | static inline int cvmx_fuse_read(int fuse); |
@@ -112,6 +119,26 @@ static inline int octeon_has_feature(enum octeon_feature feature) | |||
112 | case OCTEON_FEATURE_USB: | 119 | case OCTEON_FEATURE_USB: |
113 | return !(OCTEON_IS_MODEL(OCTEON_CN38XX) | 120 | return !(OCTEON_IS_MODEL(OCTEON_CN38XX) |
114 | || OCTEON_IS_MODEL(OCTEON_CN58XX)); | 121 | || OCTEON_IS_MODEL(OCTEON_CN58XX)); |
122 | case OCTEON_FEATURE_NO_WPTR: | ||
123 | return (OCTEON_IS_MODEL(OCTEON_CN56XX) | ||
124 | || OCTEON_IS_MODEL(OCTEON_CN52XX)) | ||
125 | && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X) | ||
126 | && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X); | ||
127 | case OCTEON_FEATURE_DFA: | ||
128 | if (!OCTEON_IS_MODEL(OCTEON_CN38XX) | ||
129 | && !OCTEON_IS_MODEL(OCTEON_CN31XX) | ||
130 | && !OCTEON_IS_MODEL(OCTEON_CN58XX)) | ||
131 | return 0; | ||
132 | else if (OCTEON_IS_MODEL(OCTEON_CN3020)) | ||
133 | return 0; | ||
134 | else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1)) | ||
135 | return 1; | ||
136 | else | ||
137 | return !cvmx_fuse_read(120); | ||
138 | case OCTEON_FEATURE_MDIO_CLAUSE_45: | ||
139 | return !(OCTEON_IS_MODEL(OCTEON_CN3XXX) | ||
140 | || OCTEON_IS_MODEL(OCTEON_CN58XX) | ||
141 | || OCTEON_IS_MODEL(OCTEON_CN50XX)); | ||
115 | } | 142 | } |
116 | return 0; | 143 | return 0; |
117 | } | 144 | } |
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h index edc676084cda..cac9b1a206fc 100644 --- a/arch/mips/include/asm/octeon/octeon.h +++ b/arch/mips/include/asm/octeon/octeon.h | |||
@@ -245,4 +245,6 @@ static inline uint32_t octeon_npi_read32(uint64_t address) | |||
245 | return cvmx_read64_uint32(address ^ 4); | 245 | return cvmx_read64_uint32(address ^ 4); |
246 | } | 246 | } |
247 | 247 | ||
248 | extern struct cvmx_bootinfo *octeon_bootinfo; | ||
249 | |||
248 | #endif /* __ASM_OCTEON_OCTEON_H */ | 250 | #endif /* __ASM_OCTEON_OCTEON_H */ |
diff --git a/arch/mips/include/asm/octeon/pci-octeon.h b/arch/mips/include/asm/octeon/pci-octeon.h new file mode 100644 index 000000000000..6ac5d3e3398e --- /dev/null +++ b/arch/mips/include/asm/octeon/pci-octeon.h | |||
@@ -0,0 +1,45 @@ | |||
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) 2005-2009 Cavium Networks | ||
7 | */ | ||
8 | |||
9 | #ifndef __PCI_OCTEON_H__ | ||
10 | #define __PCI_OCTEON_H__ | ||
11 | |||
12 | #include <linux/pci.h> | ||
13 | |||
14 | /* Some PCI cards require delays when accessing config space. */ | ||
15 | #define PCI_CONFIG_SPACE_DELAY 10000 | ||
16 | |||
17 | /* | ||
18 | * pcibios_map_irq() is defined inside pci-octeon.c. All it does is | ||
19 | * call the Octeon specific version pointed to by this variable. This | ||
20 | * function needs to change for PCI or PCIe based hosts. | ||
21 | */ | ||
22 | extern int (*octeon_pcibios_map_irq)(const struct pci_dev *dev, | ||
23 | u8 slot, u8 pin); | ||
24 | |||
25 | /* | ||
26 | * The following defines are used when octeon_dma_bar_type = | ||
27 | * OCTEON_DMA_BAR_TYPE_BIG | ||
28 | */ | ||
29 | #define OCTEON_PCI_BAR1_HOLE_BITS 5 | ||
30 | #define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3)) | ||
31 | |||
32 | enum octeon_dma_bar_type { | ||
33 | OCTEON_DMA_BAR_TYPE_INVALID, | ||
34 | OCTEON_DMA_BAR_TYPE_SMALL, | ||
35 | OCTEON_DMA_BAR_TYPE_BIG, | ||
36 | OCTEON_DMA_BAR_TYPE_PCIE | ||
37 | }; | ||
38 | |||
39 | /* | ||
40 | * This tells the DMA mapping system in dma-octeon.c how to map PCI | ||
41 | * DMA addresses. | ||
42 | */ | ||
43 | extern enum octeon_dma_bar_type octeon_dma_bar_type; | ||
44 | |||
45 | #endif | ||
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index 72c80d2034c2..4320239cf4ef 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h | |||
@@ -32,6 +32,13 @@ | |||
32 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | 32 | #define PAGE_SIZE (1UL << PAGE_SHIFT) |
33 | #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) | 33 | #define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) |
34 | 34 | ||
35 | #ifdef CONFIG_HUGETLB_PAGE | ||
36 | #define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3) | ||
37 | #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) | ||
38 | #define HPAGE_MASK (~(HPAGE_SIZE - 1)) | ||
39 | #define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) | ||
40 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
41 | |||
35 | #ifndef __ASSEMBLY__ | 42 | #ifndef __ASSEMBLY__ |
36 | 43 | ||
37 | #include <linux/pfn.h> | 44 | #include <linux/pfn.h> |
@@ -160,7 +167,14 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
160 | 167 | ||
161 | #ifdef CONFIG_FLATMEM | 168 | #ifdef CONFIG_FLATMEM |
162 | 169 | ||
163 | #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr) | 170 | #define pfn_valid(pfn) \ |
171 | ({ \ | ||
172 | unsigned long __pfn = (pfn); \ | ||
173 | /* avoid <linux/bootmem.h> include hell */ \ | ||
174 | extern unsigned long min_low_pfn; \ | ||
175 | \ | ||
176 | __pfn >= min_low_pfn && __pfn < max_mapnr; \ | ||
177 | }) | ||
164 | 178 | ||
165 | #elif defined(CONFIG_SPARSEMEM) | 179 | #elif defined(CONFIG_SPARSEMEM) |
166 | 180 | ||
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h index 053e4634acee..a68d111e55e9 100644 --- a/arch/mips/include/asm/pci.h +++ b/arch/mips/include/asm/pci.h | |||
@@ -142,19 +142,6 @@ extern void pcibios_resource_to_bus(struct pci_dev *dev, | |||
142 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 142 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, |
143 | struct pci_bus_region *region); | 143 | struct pci_bus_region *region); |
144 | 144 | ||
145 | static inline struct resource * | ||
146 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | ||
147 | { | ||
148 | struct resource *root = NULL; | ||
149 | |||
150 | if (res->flags & IORESOURCE_IO) | ||
151 | root = &ioport_resource; | ||
152 | if (res->flags & IORESOURCE_MEM) | ||
153 | root = &iomem_resource; | ||
154 | |||
155 | return root; | ||
156 | } | ||
157 | |||
158 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | 145 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index |
159 | 146 | ||
160 | static inline int pci_proc_domain(struct pci_bus *bus) | 147 | static inline int pci_proc_domain(struct pci_bus *bus) |
diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h index 1275831dda29..3738f4b48cbd 100644 --- a/arch/mips/include/asm/pgalloc.h +++ b/arch/mips/include/asm/pgalloc.h | |||
@@ -98,23 +98,12 @@ static inline void pte_free(struct mm_struct *mm, pgtable_t pte) | |||
98 | __free_pages(pte, PTE_ORDER); | 98 | __free_pages(pte, PTE_ORDER); |
99 | } | 99 | } |
100 | 100 | ||
101 | #define __pte_free_tlb(tlb,pte) \ | 101 | #define __pte_free_tlb(tlb,pte,address) \ |
102 | do { \ | 102 | do { \ |
103 | pgtable_page_dtor(pte); \ | 103 | pgtable_page_dtor(pte); \ |
104 | tlb_remove_page((tlb), pte); \ | 104 | tlb_remove_page((tlb), pte); \ |
105 | } while (0) | 105 | } while (0) |
106 | 106 | ||
107 | #ifdef CONFIG_32BIT | ||
108 | |||
109 | /* | ||
110 | * allocating and freeing a pmd is trivial: the 1-entry pmd is | ||
111 | * inside the pgd, so has no extra memory associated with it. | ||
112 | */ | ||
113 | #define pmd_free(mm, x) do { } while (0) | ||
114 | #define __pmd_free_tlb(tlb, x) do { } while (0) | ||
115 | |||
116 | #endif | ||
117 | |||
118 | #ifdef CONFIG_64BIT | 107 | #ifdef CONFIG_64BIT |
119 | 108 | ||
120 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) | 109 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
@@ -132,7 +121,7 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | |||
132 | free_pages((unsigned long)pmd, PMD_ORDER); | 121 | free_pages((unsigned long)pmd, PMD_ORDER); |
133 | } | 122 | } |
134 | 123 | ||
135 | #define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x) | 124 | #define __pmd_free_tlb(tlb, x, addr) pmd_free((tlb)->mm, x) |
136 | 125 | ||
137 | #endif | 126 | #endif |
138 | 127 | ||
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h index 51b34a48c84a..1073e6df8621 100644 --- a/arch/mips/include/asm/pgtable-bits.h +++ b/arch/mips/include/asm/pgtable-bits.h | |||
@@ -72,6 +72,7 @@ | |||
72 | #else | 72 | #else |
73 | 73 | ||
74 | #define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ | 74 | #define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ |
75 | #define _PAGE_HUGE (1<<5) /* huge tlb page */ | ||
75 | #define _PAGE_GLOBAL (1<<6) | 76 | #define _PAGE_GLOBAL (1<<6) |
76 | #define _PAGE_VALID (1<<7) | 77 | #define _PAGE_VALID (1<<7) |
77 | #define _PAGE_SILENT_READ (1<<7) /* synonym */ | 78 | #define _PAGE_SILENT_READ (1<<7) /* synonym */ |
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 6a0edf72ffbc..1a9f9b257551 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h | |||
@@ -292,6 +292,16 @@ static inline pte_t pte_mkyoung(pte_t pte) | |||
292 | pte_val(pte) |= _PAGE_SILENT_READ; | 292 | pte_val(pte) |= _PAGE_SILENT_READ; |
293 | return pte; | 293 | return pte; |
294 | } | 294 | } |
295 | |||
296 | #ifdef _PAGE_HUGE | ||
297 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; } | ||
298 | |||
299 | static inline pte_t pte_mkhuge(pte_t pte) | ||
300 | { | ||
301 | pte_val(pte) |= _PAGE_HUGE; | ||
302 | return pte; | ||
303 | } | ||
304 | #endif /* _PAGE_HUGE */ | ||
295 | #endif | 305 | #endif |
296 | static inline int pte_special(pte_t pte) { return 0; } | 306 | static inline int pte_special(pte_t pte) { return 0; } |
297 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | 307 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } |
diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/war.h b/arch/mips/include/asm/pmc-sierra/msp71xx/war.h index 0bf48fc1892b..9e2ee429c529 100644 --- a/arch/mips/include/asm/pmc-sierra/msp71xx/war.h +++ b/arch/mips/include/asm/pmc-sierra/msp71xx/war.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \ | 23 | #if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \ |
24 | defined(CONFIG_PMC_MSP7120_FPGA) | 24 | defined(CONFIG_PMC_MSP7120_FPGA) |
25 | #define MIPS34K_MISSED_ITLB_WAR 1 | 25 | #define MIPS34K_MISSED_ITLB_WAR 1 |
26 | #else | ||
27 | #define MIPS34K_MISSED_ITLB_WAR 0 | ||
26 | #endif | 28 | #endif |
27 | 29 | ||
28 | #endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */ | 30 | #endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */ |
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index 0f926aa0cb47..087a8884ef06 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h | |||
@@ -311,8 +311,9 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long | |||
311 | 311 | ||
312 | unsigned long get_wchan(struct task_struct *p); | 312 | unsigned long get_wchan(struct task_struct *p); |
313 | 313 | ||
314 | #define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32) | 314 | #define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + \ |
315 | #define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1) | 315 | THREAD_SIZE - 32 - sizeof(struct pt_regs)) |
316 | #define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk)) | ||
316 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc) | 317 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc) |
317 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) | 318 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29]) |
318 | #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) | 319 | #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status) |
diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h index 4c140db36786..387bf59f1e37 100644 --- a/arch/mips/include/asm/r4kcache.h +++ b/arch/mips/include/asm/r4kcache.h | |||
@@ -399,6 +399,7 @@ __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16) | |||
399 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32) | 399 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32) |
400 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32) | 400 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32) |
401 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32) | 401 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32) |
402 | __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64) | ||
402 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) | 403 | __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) |
403 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) | 404 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) |
404 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) | 405 | __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) |
diff --git a/arch/mips/include/asm/reg.h b/arch/mips/include/asm/reg.h index 634b55d7e7f6..910e71a12466 100644 --- a/arch/mips/include/asm/reg.h +++ b/arch/mips/include/asm/reg.h | |||
@@ -69,7 +69,7 @@ | |||
69 | 69 | ||
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #ifdef CONFIG_64BIT | 72 | #if defined(CONFIG_64BIT) && !defined(WANT_COMPAT_REG_H) |
73 | 73 | ||
74 | #define EF_R0 0 | 74 | #define EF_R0 0 |
75 | #define EF_R1 1 | 75 | #define EF_R1 1 |
diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h index 64ffc0290b84..fd545547b8aa 100644 --- a/arch/mips/include/asm/smp-ops.h +++ b/arch/mips/include/asm/smp-ops.h | |||
@@ -26,6 +26,10 @@ struct plat_smp_ops { | |||
26 | void (*boot_secondary)(int cpu, struct task_struct *idle); | 26 | void (*boot_secondary)(int cpu, struct task_struct *idle); |
27 | void (*smp_setup)(void); | 27 | void (*smp_setup)(void); |
28 | void (*prepare_cpus)(unsigned int max_cpus); | 28 | void (*prepare_cpus)(unsigned int max_cpus); |
29 | #ifdef CONFIG_HOTPLUG_CPU | ||
30 | int (*cpu_disable)(void); | ||
31 | void (*cpu_die)(unsigned int cpu); | ||
32 | #endif | ||
29 | }; | 33 | }; |
30 | 34 | ||
31 | extern void register_smp_ops(struct plat_smp_ops *ops); | 35 | extern void register_smp_ops(struct plat_smp_ops *ops); |
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index 40e5ef1d4d26..aaa2d4ab26dc 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/bitops.h> | 14 | #include <linux/bitops.h> |
15 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
16 | #include <linux/smp.h> | ||
16 | #include <linux/threads.h> | 17 | #include <linux/threads.h> |
17 | #include <linux/cpumask.h> | 18 | #include <linux/cpumask.h> |
18 | 19 | ||
@@ -40,6 +41,7 @@ extern int __cpu_logical_map[NR_CPUS]; | |||
40 | /* Octeon - Tell another core to flush its icache */ | 41 | /* Octeon - Tell another core to flush its icache */ |
41 | #define SMP_ICACHE_FLUSH 0x4 | 42 | #define SMP_ICACHE_FLUSH 0x4 |
42 | 43 | ||
44 | extern volatile cpumask_t cpu_callin_map; | ||
43 | 45 | ||
44 | extern void asmlinkage smp_bootstrap(void); | 46 | extern void asmlinkage smp_bootstrap(void); |
45 | 47 | ||
@@ -55,6 +57,24 @@ static inline void smp_send_reschedule(int cpu) | |||
55 | mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF); | 57 | mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF); |
56 | } | 58 | } |
57 | 59 | ||
60 | #ifdef CONFIG_HOTPLUG_CPU | ||
61 | static inline int __cpu_disable(void) | ||
62 | { | ||
63 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
64 | |||
65 | return mp_ops->cpu_disable(); | ||
66 | } | ||
67 | |||
68 | static inline void __cpu_die(unsigned int cpu) | ||
69 | { | ||
70 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
71 | |||
72 | mp_ops->cpu_die(cpu); | ||
73 | } | ||
74 | |||
75 | extern void play_dead(void); | ||
76 | #endif | ||
77 | |||
58 | extern asmlinkage void smp_call_function_interrupt(void); | 78 | extern asmlinkage void smp_call_function_interrupt(void); |
59 | 79 | ||
60 | extern void arch_send_call_function_single_ipi(int cpu); | 80 | extern void arch_send_call_function_single_ipi(int cpu); |
diff --git a/arch/mips/include/asm/sn/addrs.h b/arch/mips/include/asm/sn/addrs.h index 3a56d90abfa6..2367b56dcdef 100644 --- a/arch/mips/include/asm/sn/addrs.h +++ b/arch/mips/include/asm/sn/addrs.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
14 | #include <linux/smp.h> | ||
14 | #include <linux/types.h> | 15 | #include <linux/types.h> |
15 | #endif /* !__ASSEMBLY__ */ | 16 | #endif /* !__ASSEMBLY__ */ |
16 | 17 | ||
diff --git a/arch/mips/include/asm/suspend.h b/arch/mips/include/asm/suspend.h new file mode 100644 index 000000000000..294cdb66c5fc --- /dev/null +++ b/arch/mips/include/asm/suspend.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef __ASM_SUSPEND_H | ||
2 | #define __ASM_SUSPEND_H | ||
3 | |||
4 | static inline int arch_prepare_suspend(void) { return 0; } | ||
5 | |||
6 | /* References to section boundaries */ | ||
7 | extern const void __nosave_begin, __nosave_end; | ||
8 | |||
9 | #endif /* __ASM_SUSPEND_H */ | ||
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h index 99993c0d6c12..97c2f81b4b43 100644 --- a/arch/mips/include/asm/swab.h +++ b/arch/mips/include/asm/swab.h | |||
@@ -38,7 +38,11 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | |||
38 | } | 38 | } |
39 | #define __arch_swab32 __arch_swab32 | 39 | #define __arch_swab32 __arch_swab32 |
40 | 40 | ||
41 | #ifdef CONFIG_CPU_MIPS64_R2 | 41 | /* |
42 | * Having already checked for CONFIG_CPU_MIPSR2, enable the | ||
43 | * optimized version for 64-bit kernel on r2 CPUs. | ||
44 | */ | ||
45 | #ifdef CONFIG_64BIT | ||
42 | static inline __attribute_const__ __u64 __arch_swab64(__u64 x) | 46 | static inline __attribute_const__ __u64 __arch_swab64(__u64 x) |
43 | { | 47 | { |
44 | __asm__( | 48 | __asm__( |
@@ -50,6 +54,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 x) | |||
50 | return x; | 54 | return x; |
51 | } | 55 | } |
52 | #define __arch_swab64 __arch_swab64 | 56 | #define __arch_swab64 __arch_swab64 |
53 | #endif /* CONFIG_CPU_MIPS64_R2 */ | 57 | #endif /* CONFIG_64BIT */ |
54 | #endif /* CONFIG_CPU_MIPSR2 */ | 58 | #endif /* CONFIG_CPU_MIPSR2 */ |
55 | #endif /* _ASM_SWAB_H */ | 59 | #endif /* _ASM_SWAB_H */ |
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 143a48136a4b..f9df720d2e40 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h | |||
@@ -39,8 +39,6 @@ struct thread_info { | |||
39 | 39 | ||
40 | /* | 40 | /* |
41 | * macros/functions for gaining access to the thread information structure | 41 | * macros/functions for gaining access to the thread information structure |
42 | * | ||
43 | * preempt_count needs to be 1 initially, until the scheduler is functional. | ||
44 | */ | 42 | */ |
45 | #define INIT_THREAD_INFO(tsk) \ | 43 | #define INIT_THREAD_INFO(tsk) \ |
46 | { \ | 44 | { \ |
@@ -48,7 +46,7 @@ struct thread_info { | |||
48 | .exec_domain = &default_exec_domain, \ | 46 | .exec_domain = &default_exec_domain, \ |
49 | .flags = _TIF_FIXADE, \ | 47 | .flags = _TIF_FIXADE, \ |
50 | .cpu = 0, \ | 48 | .cpu = 0, \ |
51 | .preempt_count = 1, \ | 49 | .preempt_count = INIT_PREEMPT_COUNT, \ |
52 | .addr_limit = KERNEL_DS, \ | 50 | .addr_limit = KERNEL_DS, \ |
53 | .restart_block = { \ | 51 | .restart_block = { \ |
54 | .fn = do_no_restart_syscall, \ | 52 | .fn = do_no_restart_syscall, \ |
diff --git a/arch/mips/include/asm/txx9/dmac.h b/arch/mips/include/asm/txx9/dmac.h new file mode 100644 index 000000000000..5e9151fccbb4 --- /dev/null +++ b/arch/mips/include/asm/txx9/dmac.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * TXx9 SoC DMA Controller | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_TXX9_DMAC_H | ||
10 | #define __ASM_TXX9_DMAC_H | ||
11 | |||
12 | #include <linux/dmaengine.h> | ||
13 | |||
14 | #define TXX9_DMA_MAX_NR_CHANNELS 4 | ||
15 | |||
16 | /** | ||
17 | * struct txx9dmac_platform_data - Controller configuration parameters | ||
18 | * @memcpy_chan: Channel used for DMA_MEMCPY | ||
19 | * @have_64bit_regs: DMAC have 64 bit registers | ||
20 | */ | ||
21 | struct txx9dmac_platform_data { | ||
22 | int memcpy_chan; | ||
23 | bool have_64bit_regs; | ||
24 | }; | ||
25 | |||
26 | /** | ||
27 | * struct txx9dmac_chan_platform_data - Channel configuration parameters | ||
28 | * @dmac_dev: A platform device for DMAC | ||
29 | */ | ||
30 | struct txx9dmac_chan_platform_data { | ||
31 | struct platform_device *dmac_dev; | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct txx9dmac_slave - Controller-specific information about a slave | ||
36 | * @tx_reg: physical address of data register used for | ||
37 | * memory-to-peripheral transfers | ||
38 | * @rx_reg: physical address of data register used for | ||
39 | * peripheral-to-memory transfers | ||
40 | * @reg_width: peripheral register width | ||
41 | */ | ||
42 | struct txx9dmac_slave { | ||
43 | u64 tx_reg; | ||
44 | u64 rx_reg; | ||
45 | unsigned int reg_width; | ||
46 | }; | ||
47 | |||
48 | void txx9_dmac_init(int id, unsigned long baseaddr, int irq, | ||
49 | const struct txx9dmac_platform_data *pdata); | ||
50 | |||
51 | #endif /* __ASM_TXX9_DMAC_H */ | ||
diff --git a/arch/mips/include/asm/txx9/generic.h b/arch/mips/include/asm/txx9/generic.h index 9cde0090cbf6..827dc22be2ea 100644 --- a/arch/mips/include/asm/txx9/generic.h +++ b/arch/mips/include/asm/txx9/generic.h | |||
@@ -91,4 +91,10 @@ void txx9_7segled_init(unsigned int num, | |||
91 | void (*putc)(unsigned int pos, unsigned char val)); | 91 | void (*putc)(unsigned int pos, unsigned char val)); |
92 | int txx9_7segled_putc(unsigned int pos, char c); | 92 | int txx9_7segled_putc(unsigned int pos, char c); |
93 | 93 | ||
94 | void __init txx9_aclc_init(unsigned long baseaddr, int irq, | ||
95 | unsigned int dmac_id, | ||
96 | unsigned int dma_chan_out, | ||
97 | unsigned int dma_chan_in); | ||
98 | void __init txx9_sramc_init(struct resource *r); | ||
99 | |||
94 | #endif /* __ASM_TXX9_GENERIC_H */ | 100 | #endif /* __ASM_TXX9_GENERIC_H */ |
diff --git a/arch/mips/include/asm/txx9/tx4927.h b/arch/mips/include/asm/txx9/tx4927.h index 7d813f1cb98d..18c98c52afdb 100644 --- a/arch/mips/include/asm/txx9/tx4927.h +++ b/arch/mips/include/asm/txx9/tx4927.h | |||
@@ -41,6 +41,7 @@ | |||
41 | 41 | ||
42 | #define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000) | 42 | #define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000) |
43 | #define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000) | 43 | #define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000) |
44 | #define TX4927_DMA_REG (TX4927_REG_BASE + 0xb000) | ||
44 | #define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000) | 45 | #define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000) |
45 | #define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000) | 46 | #define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000) |
46 | #define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600) | 47 | #define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600) |
@@ -49,6 +50,7 @@ | |||
49 | #define TX4927_NR_SIO 2 | 50 | #define TX4927_NR_SIO 2 |
50 | #define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100) | 51 | #define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100) |
51 | #define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500) | 52 | #define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500) |
53 | #define TX4927_ACLC_REG (TX4927_REG_BASE + 0xf700) | ||
52 | 54 | ||
53 | #define TX4927_IR_ECCERR 0 | 55 | #define TX4927_IR_ECCERR 0 |
54 | #define TX4927_IR_WTOERR 1 | 56 | #define TX4927_IR_WTOERR 1 |
@@ -265,5 +267,7 @@ int tx4927_pciclk66_setup(void); | |||
265 | void tx4927_setup_pcierr_irq(void); | 267 | void tx4927_setup_pcierr_irq(void); |
266 | void tx4927_irq_init(void); | 268 | void tx4927_irq_init(void); |
267 | void tx4927_mtd_init(int ch); | 269 | void tx4927_mtd_init(int ch); |
270 | void tx4927_dmac_init(int memcpy_chan); | ||
271 | void tx4927_aclc_init(unsigned int dma_chan_out, unsigned int dma_chan_in); | ||
268 | 272 | ||
269 | #endif /* __ASM_TXX9_TX4927_H */ | 273 | #endif /* __ASM_TXX9_TX4927_H */ |
diff --git a/arch/mips/include/asm/txx9/tx4938.h b/arch/mips/include/asm/txx9/tx4938.h index cd8bc2021755..8a178f186f7d 100644 --- a/arch/mips/include/asm/txx9/tx4938.h +++ b/arch/mips/include/asm/txx9/tx4938.h | |||
@@ -305,5 +305,8 @@ struct tx4938ide_platform_info { | |||
305 | }; | 305 | }; |
306 | 306 | ||
307 | void tx4938_ata_init(unsigned int irq, unsigned int shift, int tune); | 307 | void tx4938_ata_init(unsigned int irq, unsigned int shift, int tune); |
308 | void tx4938_dmac_init(int memcpy_chan0, int memcpy_chan1); | ||
309 | void tx4938_aclc_init(void); | ||
310 | void tx4938_sramc_init(void); | ||
308 | 311 | ||
309 | #endif | 312 | #endif |
diff --git a/arch/mips/include/asm/txx9/tx4939.h b/arch/mips/include/asm/txx9/tx4939.h index f02c50b3abfb..d4f342cd5939 100644 --- a/arch/mips/include/asm/txx9/tx4939.h +++ b/arch/mips/include/asm/txx9/tx4939.h | |||
@@ -45,6 +45,8 @@ | |||
45 | #define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) | 45 | #define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) |
46 | #define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) | 46 | #define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) |
47 | 47 | ||
48 | #define TX4939_RNG_REG (TX4939_CRYPTO_REG + 0xb0) | ||
49 | |||
48 | struct tx4939_le_reg { | 50 | struct tx4939_le_reg { |
49 | __u32 r; | 51 | __u32 r; |
50 | __u32 unused; | 52 | __u32 unused; |
@@ -544,5 +546,9 @@ void tx4939_ata_init(void); | |||
544 | void tx4939_rtc_init(void); | 546 | void tx4939_rtc_init(void); |
545 | void tx4939_ndfmc_init(unsigned int hold, unsigned int spw, | 547 | void tx4939_ndfmc_init(unsigned int hold, unsigned int spw, |
546 | unsigned char ch_mask, unsigned char wide_mask); | 548 | unsigned char ch_mask, unsigned char wide_mask); |
549 | void tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1); | ||
550 | void tx4939_aclc_init(void); | ||
551 | void tx4939_sramc_init(void); | ||
552 | void tx4939_rng_init(void); | ||
547 | 553 | ||
548 | #endif /* __ASM_TXX9_TX4939_H */ | 554 | #endif /* __ASM_TXX9_TX4939_H */ |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 40005010827c..e753a777949b 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
@@ -352,16 +352,19 @@ | |||
352 | #define __NR_inotify_init1 (__NR_Linux + 329) | 352 | #define __NR_inotify_init1 (__NR_Linux + 329) |
353 | #define __NR_preadv (__NR_Linux + 330) | 353 | #define __NR_preadv (__NR_Linux + 330) |
354 | #define __NR_pwritev (__NR_Linux + 331) | 354 | #define __NR_pwritev (__NR_Linux + 331) |
355 | #define __NR_rt_tgsigqueueinfo (__NR_Linux + 332) | ||
356 | #define __NR_perf_counter_open (__NR_Linux + 333) | ||
357 | #define __NR_accept4 (__NR_Linux + 334) | ||
355 | 358 | ||
356 | /* | 359 | /* |
357 | * Offset of the last Linux o32 flavoured syscall | 360 | * Offset of the last Linux o32 flavoured syscall |
358 | */ | 361 | */ |
359 | #define __NR_Linux_syscalls 331 | 362 | #define __NR_Linux_syscalls 334 |
360 | 363 | ||
361 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 364 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
362 | 365 | ||
363 | #define __NR_O32_Linux 4000 | 366 | #define __NR_O32_Linux 4000 |
364 | #define __NR_O32_Linux_syscalls 331 | 367 | #define __NR_O32_Linux_syscalls 334 |
365 | 368 | ||
366 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 369 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
367 | 370 | ||
@@ -660,16 +663,19 @@ | |||
660 | #define __NR_inotify_init1 (__NR_Linux + 288) | 663 | #define __NR_inotify_init1 (__NR_Linux + 288) |
661 | #define __NR_preadv (__NR_Linux + 289) | 664 | #define __NR_preadv (__NR_Linux + 289) |
662 | #define __NR_pwritev (__NR_Linux + 290) | 665 | #define __NR_pwritev (__NR_Linux + 290) |
666 | #define __NR_rt_tgsigqueueinfo (__NR_Linux + 291) | ||
667 | #define __NR_perf_counter_open (__NR_Linux + 292) | ||
668 | #define __NR_accept4 (__NR_Linux + 293) | ||
663 | 669 | ||
664 | /* | 670 | /* |
665 | * Offset of the last Linux 64-bit flavoured syscall | 671 | * Offset of the last Linux 64-bit flavoured syscall |
666 | */ | 672 | */ |
667 | #define __NR_Linux_syscalls 290 | 673 | #define __NR_Linux_syscalls 293 |
668 | 674 | ||
669 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 675 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
670 | 676 | ||
671 | #define __NR_64_Linux 5000 | 677 | #define __NR_64_Linux 5000 |
672 | #define __NR_64_Linux_syscalls 290 | 678 | #define __NR_64_Linux_syscalls 293 |
673 | 679 | ||
674 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 680 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
675 | 681 | ||
@@ -972,16 +978,19 @@ | |||
972 | #define __NR_inotify_init1 (__NR_Linux + 292) | 978 | #define __NR_inotify_init1 (__NR_Linux + 292) |
973 | #define __NR_preadv (__NR_Linux + 293) | 979 | #define __NR_preadv (__NR_Linux + 293) |
974 | #define __NR_pwritev (__NR_Linux + 294) | 980 | #define __NR_pwritev (__NR_Linux + 294) |
981 | #define __NR_rt_tgsigqueueinfo (__NR_Linux + 295) | ||
982 | #define __NR_perf_counter_open (__NR_Linux + 296) | ||
983 | #define __NR_accept4 (__NR_Linux + 297) | ||
975 | 984 | ||
976 | /* | 985 | /* |
977 | * Offset of the last N32 flavoured syscall | 986 | * Offset of the last N32 flavoured syscall |
978 | */ | 987 | */ |
979 | #define __NR_Linux_syscalls 294 | 988 | #define __NR_Linux_syscalls 297 |
980 | 989 | ||
981 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 990 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
982 | 991 | ||
983 | #define __NR_N32_Linux 6000 | 992 | #define __NR_N32_Linux 6000 |
984 | #define __NR_N32_Linux_syscalls 294 | 993 | #define __NR_N32_Linux_syscalls 297 |
985 | 994 | ||
986 | #ifdef __KERNEL__ | 995 | #ifdef __KERNEL__ |
987 | 996 | ||
diff --git a/arch/mips/include/asm/vr41xx/capcella.h b/arch/mips/include/asm/vr41xx/capcella.h index e0ee05a3dfcc..fcc6569414fa 100644 --- a/arch/mips/include/asm/vr41xx/capcella.h +++ b/arch/mips/include/asm/vr41xx/capcella.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * capcella.h, Include file for ZAO Networks Capcella. | 2 | * capcella.h, Include file for ZAO Networks Capcella. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/vr41xx/giu.h b/arch/mips/include/asm/vr41xx/giu.h index 0bcdd3a5c256..6a90bc1d916b 100644 --- a/arch/mips/include/asm/vr41xx/giu.h +++ b/arch/mips/include/asm/vr41xx/giu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Include file for NEC VR4100 series General-purpose I/O Unit. | 2 | * Include file for NEC VR4100 series General-purpose I/O Unit. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2005-2009 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
@@ -41,7 +41,8 @@ typedef enum { | |||
41 | IRQ_SIGNAL_HOLD, | 41 | IRQ_SIGNAL_HOLD, |
42 | } irq_signal_t; | 42 | } irq_signal_t; |
43 | 43 | ||
44 | extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, irq_signal_t signal); | 44 | extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, |
45 | irq_signal_t signal); | ||
45 | 46 | ||
46 | typedef enum { | 47 | typedef enum { |
47 | IRQ_LEVEL_LOW, | 48 | IRQ_LEVEL_LOW, |
@@ -51,23 +52,6 @@ typedef enum { | |||
51 | extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); | 52 | extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); |
52 | 53 | ||
53 | typedef enum { | 54 | typedef enum { |
54 | GPIO_DATA_LOW, | ||
55 | GPIO_DATA_HIGH, | ||
56 | GPIO_DATA_INVAL, | ||
57 | } gpio_data_t; | ||
58 | |||
59 | extern gpio_data_t vr41xx_gpio_get_pin(unsigned int pin); | ||
60 | extern int vr41xx_gpio_set_pin(unsigned int pin, gpio_data_t data); | ||
61 | |||
62 | typedef enum { | ||
63 | GPIO_INPUT, | ||
64 | GPIO_OUTPUT, | ||
65 | GPIO_OUTPUT_DISABLE, | ||
66 | } gpio_direction_t; | ||
67 | |||
68 | extern int vr41xx_gpio_set_direction(unsigned int pin, gpio_direction_t dir); | ||
69 | |||
70 | typedef enum { | ||
71 | GPIO_PULL_DOWN, | 55 | GPIO_PULL_DOWN, |
72 | GPIO_PULL_UP, | 56 | GPIO_PULL_UP, |
73 | GPIO_PULL_DISABLE, | 57 | GPIO_PULL_DISABLE, |
diff --git a/arch/mips/include/asm/vr41xx/irq.h b/arch/mips/include/asm/vr41xx/irq.h index d315dfbc08f2..b07f7321751d 100644 --- a/arch/mips/include/asm/vr41xx/irq.h +++ b/arch/mips/include/asm/vr41xx/irq.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Copyright (C) 2001, 2002 Paul Mundt | 7 | * Copyright (C) 2001, 2002 Paul Mundt |
8 | * Copyright (C) 2002 MontaVista Software, Inc. | 8 | * Copyright (C) 2002 MontaVista Software, Inc. |
9 | * Copyright (C) 2002 TimeSys Corp. | 9 | * Copyright (C) 2002 TimeSys Corp. |
10 | * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 10 | * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org> |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 13 | * under the terms of the GNU General Public License as published by the |
diff --git a/arch/mips/include/asm/vr41xx/mpc30x.h b/arch/mips/include/asm/vr41xx/mpc30x.h index 1d67df843dc3..130d09d8c8cb 100644 --- a/arch/mips/include/asm/vr41xx/mpc30x.h +++ b/arch/mips/include/asm/vr41xx/mpc30x.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * mpc30x.h, Include file for Victor MP-C303/304. | 2 | * mpc30x.h, Include file for Victor MP-C303/304. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/vr41xx/pci.h b/arch/mips/include/asm/vr41xx/pci.h index 6fc01ce19777..c231a3d6cfd8 100644 --- a/arch/mips/include/asm/vr41xx/pci.h +++ b/arch/mips/include/asm/vr41xx/pci.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Include file for NEC VR4100 series PCI Control Unit. | 2 | * Include file for NEC VR4100 series PCI Control Unit. |
3 | * | 3 | * |
4 | * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/vr41xx/siu.h b/arch/mips/include/asm/vr41xx/siu.h index da9f6e373409..ca806bc4ddc8 100644 --- a/arch/mips/include/asm/vr41xx/siu.h +++ b/arch/mips/include/asm/vr41xx/siu.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Include file for NEC VR4100 series Serial Interface Unit. | 2 | * Include file for NEC VR4100 series Serial Interface Unit. |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2005-2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/vr41xx/tb0219.h b/arch/mips/include/asm/vr41xx/tb0219.h index dc981b4be0a4..c78e8243b447 100644 --- a/arch/mips/include/asm/vr41xx/tb0219.h +++ b/arch/mips/include/asm/vr41xx/tb0219.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * tb0219.h, Include file for TANBAC TB0219. | 2 | * tb0219.h, Include file for TANBAC TB0219. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * Modified for TANBAC TB0219: | 6 | * Modified for TANBAC TB0219: |
7 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> | 7 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> |
diff --git a/arch/mips/include/asm/vr41xx/tb0226.h b/arch/mips/include/asm/vr41xx/tb0226.h index de527dcfa5f3..36f5f798e416 100644 --- a/arch/mips/include/asm/vr41xx/tb0226.h +++ b/arch/mips/include/asm/vr41xx/tb0226.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * tb0226.h, Include file for TANBAC TB0226. | 2 | * tb0226.h, Include file for TANBAC TB0226. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/include/asm/vr41xx/vr41xx.h b/arch/mips/include/asm/vr41xx/vr41xx.h index 22be64971cc6..7b96a43b72ba 100644 --- a/arch/mips/include/asm/vr41xx/vr41xx.h +++ b/arch/mips/include/asm/vr41xx/vr41xx.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Copyright (C) 2001, 2002 Paul Mundt | 7 | * Copyright (C) 2001, 2002 Paul Mundt |
8 | * Copyright (C) 2002 MontaVista Software, Inc. | 8 | * Copyright (C) 2002 MontaVista Software, Inc. |
9 | * Copyright (C) 2002 TimeSys Corp. | 9 | * Copyright (C) 2002 TimeSys Corp. |
10 | * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 10 | * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org> |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or modify it | 12 | * This program is free software; you can redistribute it and/or modify it |
13 | * under the terms of the GNU General Public License as published by the | 13 | * under the terms of the GNU General Public License as published by the |
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c index d9b6a5b5399d..7fd170d007e7 100644 --- a/arch/mips/jazz/irq.c +++ b/arch/mips/jazz/irq.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/smp.h> | ||
13 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
14 | 15 | ||
15 | #include <asm/irq_cpu.h> | 16 | #include <asm/irq_cpu.h> |
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c index f0fd636723be..0d64d0f46418 100644 --- a/arch/mips/jazz/jazzdma.c +++ b/arch/mips/jazz/jazzdma.c | |||
@@ -190,7 +190,7 @@ int vdma_free(unsigned long laddr) | |||
190 | return -1; | 190 | return -1; |
191 | } | 191 | } |
192 | 192 | ||
193 | while (pgtbl[i].owner == laddr && i < VDMA_PGTBL_ENTRIES) { | 193 | while (i < VDMA_PGTBL_ENTRIES && pgtbl[i].owner == laddr) { |
194 | pgtbl[i].owner = VDMA_PAGE_EMPTY; | 194 | pgtbl[i].owner = VDMA_PAGE_EMPTY; |
195 | i++; | 195 | i++; |
196 | } | 196 | } |
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index c901c22d7ad0..8d006ec65677 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <linux/kbuild.h> | 16 | #include <linux/kbuild.h> |
17 | #include <linux/suspend.h> | ||
17 | #include <asm/ptrace.h> | 18 | #include <asm/ptrace.h> |
18 | #include <asm/processor.h> | 19 | #include <asm/processor.h> |
19 | 20 | ||
@@ -326,3 +327,15 @@ void output_octeon_cop2_state_defines(void) | |||
326 | BLANK(); | 327 | BLANK(); |
327 | } | 328 | } |
328 | #endif | 329 | #endif |
330 | |||
331 | #ifdef CONFIG_HIBERNATION | ||
332 | void output_pbe_defines(void) | ||
333 | { | ||
334 | COMMENT(" Linux struct pbe offsets. "); | ||
335 | OFFSET(PBE_ADDRESS, pbe, address); | ||
336 | OFFSET(PBE_ORIG_ADDRESS, pbe, orig_address); | ||
337 | OFFSET(PBE_NEXT, pbe, next); | ||
338 | DEFINE(PBE_SIZE, sizeof(struct pbe)); | ||
339 | BLANK(); | ||
340 | } | ||
341 | #endif | ||
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c index e1333d7319e2..ff448233dab5 100644 --- a/arch/mips/kernel/binfmt_elfo32.c +++ b/arch/mips/kernel/binfmt_elfo32.c | |||
@@ -53,6 +53,23 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |||
53 | #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) | 53 | #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) |
54 | 54 | ||
55 | #include <asm/processor.h> | 55 | #include <asm/processor.h> |
56 | |||
57 | /* | ||
58 | * When this file is selected, we are definitely running a 64bit kernel. | ||
59 | * So using the right regs define in asm/reg.h | ||
60 | */ | ||
61 | #define WANT_COMPAT_REG_H | ||
62 | |||
63 | /* These MUST be defined before elf.h gets included */ | ||
64 | extern void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs); | ||
65 | #define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs); | ||
66 | #define ELF_CORE_COPY_TASK_REGS(_tsk, _dest) \ | ||
67 | ({ \ | ||
68 | int __res = 1; \ | ||
69 | elf32_core_copy_regs(*(_dest), task_pt_regs(_tsk)); \ | ||
70 | __res; \ | ||
71 | }) | ||
72 | |||
56 | #include <linux/module.h> | 73 | #include <linux/module.h> |
57 | #include <linux/elfcore.h> | 74 | #include <linux/elfcore.h> |
58 | #include <linux/compat.h> | 75 | #include <linux/compat.h> |
@@ -110,9 +127,6 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) | |||
110 | value->tv_usec = rem / NSEC_PER_USEC; | 127 | value->tv_usec = rem / NSEC_PER_USEC; |
111 | } | 128 | } |
112 | 129 | ||
113 | #undef ELF_CORE_COPY_REGS | ||
114 | #define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs); | ||
115 | |||
116 | void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs) | 130 | void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs) |
117 | { | 131 | { |
118 | int i; | 132 | int i; |
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c index a5182a207696..e02f79b1eb51 100644 --- a/arch/mips/kernel/cevt-bcm1480.c +++ b/arch/mips/kernel/cevt-bcm1480.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/clockchips.h> | 18 | #include <linux/clockchips.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/percpu.h> | 20 | #include <linux/percpu.h> |
21 | #include <linux/smp.h> | ||
21 | 22 | ||
22 | #include <asm/addrspace.h> | 23 | #include <asm/addrspace.h> |
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c index 1ada45ea0700..6996da4d74a2 100644 --- a/arch/mips/kernel/cevt-ds1287.c +++ b/arch/mips/kernel/cevt-ds1287.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * DS1287 clockevent driver | 2 | * DS1287 clockevent driver |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c index e9b787feedcb..92351e00ae0e 100644 --- a/arch/mips/kernel/cevt-gt641xx.c +++ b/arch/mips/kernel/cevt-gt641xx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GT641xx clockevent routines. | 2 | * GT641xx clockevent routines. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 0015e442572b..2652362ce047 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/clockchips.h> | 9 | #include <linux/clockchips.h> |
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/percpu.h> | 11 | #include <linux/percpu.h> |
12 | #include <linux/smp.h> | ||
12 | 13 | ||
13 | #include <asm/smtc_ipi.h> | 14 | #include <asm/smtc_ipi.h> |
14 | #include <asm/time.h> | 15 | #include <asm/time.h> |
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c index 340f53e5c6b1..ac5903d1b20e 100644 --- a/arch/mips/kernel/cevt-sb1250.c +++ b/arch/mips/kernel/cevt-sb1250.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/clockchips.h> | 18 | #include <linux/clockchips.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/percpu.h> | 20 | #include <linux/percpu.h> |
21 | #include <linux/smp.h> | ||
21 | 22 | ||
22 | #include <asm/addrspace.h> | 23 | #include <asm/addrspace.h> |
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
diff --git a/arch/mips/kernel/cevt-smtc.c b/arch/mips/kernel/cevt-smtc.c index df6f5bc60572..98bd7de75778 100644 --- a/arch/mips/kernel/cevt-smtc.c +++ b/arch/mips/kernel/cevt-smtc.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/clockchips.h> | 10 | #include <linux/clockchips.h> |
11 | #include <linux/interrupt.h> | 11 | #include <linux/interrupt.h> |
12 | #include <linux/percpu.h> | 12 | #include <linux/percpu.h> |
13 | #include <linux/smp.h> | ||
13 | 14 | ||
14 | #include <asm/smtc_ipi.h> | 15 | #include <asm/smtc_ipi.h> |
15 | #include <asm/time.h> | 16 | #include <asm/time.h> |
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c index 2e911e3da8d3..0037f21baf0d 100644 --- a/arch/mips/kernel/cevt-txx9.c +++ b/arch/mips/kernel/cevt-txx9.c | |||
@@ -20,22 +20,29 @@ | |||
20 | #define TIMER_CCD 0 /* 1/2 */ | 20 | #define TIMER_CCD 0 /* 1/2 */ |
21 | #define TIMER_CLK(imclk) ((imclk) / (2 << TIMER_CCD)) | 21 | #define TIMER_CLK(imclk) ((imclk) / (2 << TIMER_CCD)) |
22 | 22 | ||
23 | static struct txx9_tmr_reg __iomem *txx9_cs_tmrptr; | 23 | struct txx9_clocksource { |
24 | struct clocksource cs; | ||
25 | struct txx9_tmr_reg __iomem *tmrptr; | ||
26 | }; | ||
24 | 27 | ||
25 | static cycle_t txx9_cs_read(struct clocksource *cs) | 28 | static cycle_t txx9_cs_read(struct clocksource *cs) |
26 | { | 29 | { |
27 | return __raw_readl(&txx9_cs_tmrptr->trr); | 30 | struct txx9_clocksource *txx9_cs = |
31 | container_of(cs, struct txx9_clocksource, cs); | ||
32 | return __raw_readl(&txx9_cs->tmrptr->trr); | ||
28 | } | 33 | } |
29 | 34 | ||
30 | /* Use 1 bit smaller width to use full bits in that width */ | 35 | /* Use 1 bit smaller width to use full bits in that width */ |
31 | #define TXX9_CLOCKSOURCE_BITS (TXX9_TIMER_BITS - 1) | 36 | #define TXX9_CLOCKSOURCE_BITS (TXX9_TIMER_BITS - 1) |
32 | 37 | ||
33 | static struct clocksource txx9_clocksource = { | 38 | static struct txx9_clocksource txx9_clocksource = { |
34 | .name = "TXx9", | 39 | .cs = { |
35 | .rating = 200, | 40 | .name = "TXx9", |
36 | .read = txx9_cs_read, | 41 | .rating = 200, |
37 | .mask = CLOCKSOURCE_MASK(TXX9_CLOCKSOURCE_BITS), | 42 | .read = txx9_cs_read, |
38 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 43 | .mask = CLOCKSOURCE_MASK(TXX9_CLOCKSOURCE_BITS), |
44 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
45 | }, | ||
39 | }; | 46 | }; |
40 | 47 | ||
41 | void __init txx9_clocksource_init(unsigned long baseaddr, | 48 | void __init txx9_clocksource_init(unsigned long baseaddr, |
@@ -43,8 +50,8 @@ void __init txx9_clocksource_init(unsigned long baseaddr, | |||
43 | { | 50 | { |
44 | struct txx9_tmr_reg __iomem *tmrptr; | 51 | struct txx9_tmr_reg __iomem *tmrptr; |
45 | 52 | ||
46 | clocksource_set_clock(&txx9_clocksource, TIMER_CLK(imbusclk)); | 53 | clocksource_set_clock(&txx9_clocksource.cs, TIMER_CLK(imbusclk)); |
47 | clocksource_register(&txx9_clocksource); | 54 | clocksource_register(&txx9_clocksource.cs); |
48 | 55 | ||
49 | tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); | 56 | tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); |
50 | __raw_writel(TCR_BASE, &tmrptr->tcr); | 57 | __raw_writel(TCR_BASE, &tmrptr->tcr); |
@@ -53,10 +60,13 @@ void __init txx9_clocksource_init(unsigned long baseaddr, | |||
53 | __raw_writel(TXx9_TMITMR_TZCE, &tmrptr->itmr); | 60 | __raw_writel(TXx9_TMITMR_TZCE, &tmrptr->itmr); |
54 | __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra); | 61 | __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra); |
55 | __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr); | 62 | __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr); |
56 | txx9_cs_tmrptr = tmrptr; | 63 | txx9_clocksource.tmrptr = tmrptr; |
57 | } | 64 | } |
58 | 65 | ||
59 | static struct txx9_tmr_reg __iomem *txx9_tmrptr; | 66 | struct txx9_clock_event_device { |
67 | struct clock_event_device cd; | ||
68 | struct txx9_tmr_reg __iomem *tmrptr; | ||
69 | }; | ||
60 | 70 | ||
61 | static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr) | 71 | static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr) |
62 | { | 72 | { |
@@ -69,7 +79,9 @@ static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr) | |||
69 | static void txx9tmr_set_mode(enum clock_event_mode mode, | 79 | static void txx9tmr_set_mode(enum clock_event_mode mode, |
70 | struct clock_event_device *evt) | 80 | struct clock_event_device *evt) |
71 | { | 81 | { |
72 | struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr; | 82 | struct txx9_clock_event_device *txx9_cd = |
83 | container_of(evt, struct txx9_clock_event_device, cd); | ||
84 | struct txx9_tmr_reg __iomem *tmrptr = txx9_cd->tmrptr; | ||
73 | 85 | ||
74 | txx9tmr_stop_and_clear(tmrptr); | 86 | txx9tmr_stop_and_clear(tmrptr); |
75 | switch (mode) { | 87 | switch (mode) { |
@@ -99,7 +111,9 @@ static void txx9tmr_set_mode(enum clock_event_mode mode, | |||
99 | static int txx9tmr_set_next_event(unsigned long delta, | 111 | static int txx9tmr_set_next_event(unsigned long delta, |
100 | struct clock_event_device *evt) | 112 | struct clock_event_device *evt) |
101 | { | 113 | { |
102 | struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr; | 114 | struct txx9_clock_event_device *txx9_cd = |
115 | container_of(evt, struct txx9_clock_event_device, cd); | ||
116 | struct txx9_tmr_reg __iomem *tmrptr = txx9_cd->tmrptr; | ||
103 | 117 | ||
104 | txx9tmr_stop_and_clear(tmrptr); | 118 | txx9tmr_stop_and_clear(tmrptr); |
105 | /* start timer */ | 119 | /* start timer */ |
@@ -108,18 +122,22 @@ static int txx9tmr_set_next_event(unsigned long delta, | |||
108 | return 0; | 122 | return 0; |
109 | } | 123 | } |
110 | 124 | ||
111 | static struct clock_event_device txx9tmr_clock_event_device = { | 125 | static struct txx9_clock_event_device txx9_clock_event_device = { |
112 | .name = "TXx9", | 126 | .cd = { |
113 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | 127 | .name = "TXx9", |
114 | .rating = 200, | 128 | .features = CLOCK_EVT_FEAT_PERIODIC | |
115 | .set_mode = txx9tmr_set_mode, | 129 | CLOCK_EVT_FEAT_ONESHOT, |
116 | .set_next_event = txx9tmr_set_next_event, | 130 | .rating = 200, |
131 | .set_mode = txx9tmr_set_mode, | ||
132 | .set_next_event = txx9tmr_set_next_event, | ||
133 | }, | ||
117 | }; | 134 | }; |
118 | 135 | ||
119 | static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id) | 136 | static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id) |
120 | { | 137 | { |
121 | struct clock_event_device *cd = &txx9tmr_clock_event_device; | 138 | struct txx9_clock_event_device *txx9_cd = dev_id; |
122 | struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr; | 139 | struct clock_event_device *cd = &txx9_cd->cd; |
140 | struct txx9_tmr_reg __iomem *tmrptr = txx9_cd->tmrptr; | ||
123 | 141 | ||
124 | __raw_writel(0, &tmrptr->tisr); /* ack interrupt */ | 142 | __raw_writel(0, &tmrptr->tisr); /* ack interrupt */ |
125 | cd->event_handler(cd); | 143 | cd->event_handler(cd); |
@@ -130,19 +148,20 @@ static struct irqaction txx9tmr_irq = { | |||
130 | .handler = txx9tmr_interrupt, | 148 | .handler = txx9tmr_interrupt, |
131 | .flags = IRQF_DISABLED | IRQF_PERCPU, | 149 | .flags = IRQF_DISABLED | IRQF_PERCPU, |
132 | .name = "txx9tmr", | 150 | .name = "txx9tmr", |
151 | .dev_id = &txx9_clock_event_device, | ||
133 | }; | 152 | }; |
134 | 153 | ||
135 | void __init txx9_clockevent_init(unsigned long baseaddr, int irq, | 154 | void __init txx9_clockevent_init(unsigned long baseaddr, int irq, |
136 | unsigned int imbusclk) | 155 | unsigned int imbusclk) |
137 | { | 156 | { |
138 | struct clock_event_device *cd = &txx9tmr_clock_event_device; | 157 | struct clock_event_device *cd = &txx9_clock_event_device.cd; |
139 | struct txx9_tmr_reg __iomem *tmrptr; | 158 | struct txx9_tmr_reg __iomem *tmrptr; |
140 | 159 | ||
141 | tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); | 160 | tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); |
142 | txx9tmr_stop_and_clear(tmrptr); | 161 | txx9tmr_stop_and_clear(tmrptr); |
143 | __raw_writel(TIMER_CCD, &tmrptr->ccdr); | 162 | __raw_writel(TIMER_CCD, &tmrptr->ccdr); |
144 | __raw_writel(0, &tmrptr->itmr); | 163 | __raw_writel(0, &tmrptr->itmr); |
145 | txx9_tmrptr = tmrptr; | 164 | txx9_clock_event_device.tmrptr = tmrptr; |
146 | 165 | ||
147 | clockevent_set_clock(cd, TIMER_CLK(imbusclk)); | 166 | clockevent_set_clock(cd, TIMER_CLK(imbusclk)); |
148 | cd->max_delta_ns = | 167 | cd->max_delta_ns = |
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index b13b8eb30596..1abe9905c9c1 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/ptrace.h> | 16 | #include <linux/ptrace.h> |
17 | #include <linux/smp.h> | ||
17 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
18 | 19 | ||
19 | #include <asm/bugs.h> | 20 | #include <asm/bugs.h> |
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c index b551f48d3a07..23da108506b0 100644 --- a/arch/mips/kernel/csrc-ioasic.c +++ b/arch/mips/kernel/csrc-ioasic.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * DEC I/O ASIC's counter clocksource | 2 | * DEC I/O ASIC's counter clocksource |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S index 492a0a8d70fb..531ce7b16124 100644 --- a/arch/mips/kernel/head.S +++ b/arch/mips/kernel/head.S | |||
@@ -188,7 +188,8 @@ NESTED(kernel_entry, 16, sp) # kernel entry point | |||
188 | 188 | ||
189 | MTC0 zero, CP0_CONTEXT # clear context register | 189 | MTC0 zero, CP0_CONTEXT # clear context register |
190 | PTR_LA $28, init_thread_union | 190 | PTR_LA $28, init_thread_union |
191 | PTR_LI sp, _THREAD_SIZE - 32 | 191 | /* Set the SP after an empty pt_regs. */ |
192 | PTR_LI sp, _THREAD_SIZE - 32 - PT_SIZE | ||
192 | PTR_ADDU sp, $28 | 193 | PTR_ADDU sp, $28 |
193 | set_saved_sp sp, t0, t1 | 194 | set_saved_sp sp, t0, t1 |
194 | PTR_SUBU sp, 4 * SZREG # init stack pointer | 195 | PTR_SUBU sp, 4 * SZREG # init stack pointer |
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c index ed20e7fe65e3..f7d8d5d0ddbf 100644 --- a/arch/mips/kernel/i8253.c +++ b/arch/mips/kernel/i8253.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/interrupt.h> | 7 | #include <linux/interrupt.h> |
8 | #include <linux/jiffies.h> | 8 | #include <linux/jiffies.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/smp.h> | ||
10 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
11 | 12 | ||
12 | #include <asm/delay.h> | 13 | #include <asm/delay.h> |
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c index 3f43c2e3aa5a..d2072cd38592 100644 --- a/arch/mips/kernel/irq-gic.c +++ b/arch/mips/kernel/irq-gic.c | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | #include <linux/bitmap.h> | 3 | #include <linux/bitmap.h> |
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | #include <linux/smp.h> | ||
5 | 6 | ||
6 | #include <asm/io.h> | 7 | #include <asm/io.h> |
7 | #include <asm/gic.h> | 8 | #include <asm/gic.h> |
@@ -106,9 +107,7 @@ static unsigned int gic_irq_startup(unsigned int irq) | |||
106 | { | 107 | { |
107 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); | 108 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); |
108 | irq -= _irqbase; | 109 | irq -= _irqbase; |
109 | /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ | 110 | GIC_SET_INTR_MASK(irq, 1); |
110 | GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))), | ||
111 | 1 << (irq % 32)); | ||
112 | return 0; | 111 | return 0; |
113 | } | 112 | } |
114 | 113 | ||
@@ -119,8 +118,7 @@ static void gic_irq_ack(unsigned int irq) | |||
119 | #endif | 118 | #endif |
120 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); | 119 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); |
121 | irq -= _irqbase; | 120 | irq -= _irqbase; |
122 | GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))), | 121 | GIC_CLR_INTR_MASK(irq, 1); |
123 | 1 << (irq % 32)); | ||
124 | 122 | ||
125 | if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) { | 123 | if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) { |
126 | if (!gic_wedgeb2bok) | 124 | if (!gic_wedgeb2bok) |
@@ -137,18 +135,14 @@ static void gic_mask_irq(unsigned int irq) | |||
137 | { | 135 | { |
138 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); | 136 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); |
139 | irq -= _irqbase; | 137 | irq -= _irqbase; |
140 | /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ | 138 | GIC_CLR_INTR_MASK(irq, 1); |
141 | GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))), | ||
142 | 1 << (irq % 32)); | ||
143 | } | 139 | } |
144 | 140 | ||
145 | static void gic_unmask_irq(unsigned int irq) | 141 | static void gic_unmask_irq(unsigned int irq) |
146 | { | 142 | { |
147 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); | 143 | pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); |
148 | irq -= _irqbase; | 144 | irq -= _irqbase; |
149 | /* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ | 145 | GIC_SET_INTR_MASK(irq, 1); |
150 | GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))), | ||
151 | 1 << (irq % 32)); | ||
152 | } | 146 | } |
153 | 147 | ||
154 | #ifdef CONFIG_SMP | 148 | #ifdef CONFIG_SMP |
@@ -253,6 +247,10 @@ static void __init gic_basic_init(void) | |||
253 | if (cpu == X) | 247 | if (cpu == X) |
254 | continue; | 248 | continue; |
255 | 249 | ||
250 | if (cpu == 0 && i != 0 && _intrmap[i].intrnum == 0 && | ||
251 | _intrmap[i].ipiflag == 0) | ||
252 | continue; | ||
253 | |||
256 | setup_intr(_intrmap[i].intrnum, | 254 | setup_intr(_intrmap[i].intrnum, |
257 | _intrmap[i].cpunum, | 255 | _intrmap[i].cpunum, |
258 | _intrmap[i].pin, | 256 | _intrmap[i].pin, |
diff --git a/arch/mips/kernel/irq-gt641xx.c b/arch/mips/kernel/irq-gt641xx.c index 1b81b131f43c..ebcc5f7ad9c2 100644 --- a/arch/mips/kernel/irq-gt641xx.c +++ b/arch/mips/kernel/irq-gt641xx.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GT641xx IRQ routines. | 2 | * GT641xx IRQ routines. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/kernel/irq_txx9.c b/arch/mips/kernel/irq_txx9.c index a4d1462c27f7..9b78029bea70 100644 --- a/arch/mips/kernel/irq_txx9.c +++ b/arch/mips/kernel/irq_txx9.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/kernel/irq_txx9.c | ||
3 | * | ||
4 | * Based on linux/arch/mips/jmr3927/rbhma3100/irq.c, | 2 | * Based on linux/arch/mips/jmr3927/rbhma3100/irq.c, |
5 | * linux/arch/mips/tx4927/common/tx4927_irq.c, | 3 | * linux/arch/mips/tx4927/common/tx4927_irq.c, |
6 | * linux/arch/mips/tx4938/common/irq.c | 4 | * linux/arch/mips/tx4938/common/irq.c |
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c index 6e152c80cd4a..50c9bb880667 100644 --- a/arch/mips/kernel/kgdb.c +++ b/arch/mips/kernel/kgdb.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/kgdb.h> | 26 | #include <linux/kgdb.h> |
27 | #include <linux/kdebug.h> | 27 | #include <linux/kdebug.h> |
28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
29 | #include <linux/smp.h> | ||
29 | #include <asm/inst.h> | 30 | #include <asm/inst.h> |
30 | #include <asm/fpu.h> | 31 | #include <asm/fpu.h> |
31 | #include <asm/cacheflush.h> | 32 | #include <asm/cacheflush.h> |
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index 3e9100dcc12d..6f51dda87fce 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c | |||
@@ -98,7 +98,8 @@ static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v) | |||
98 | static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v) | 98 | static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v) |
99 | { | 99 | { |
100 | if (v % 4) { | 100 | if (v % 4) { |
101 | printk(KERN_ERR "module %s: dangerous relocation\n", me->name); | 101 | pr_err("module %s: dangerous R_MIPS_26 REL relocation\n", |
102 | me->name); | ||
102 | return -ENOEXEC; | 103 | return -ENOEXEC; |
103 | } | 104 | } |
104 | 105 | ||
@@ -118,7 +119,8 @@ static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v) | |||
118 | static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v) | 119 | static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v) |
119 | { | 120 | { |
120 | if (v % 4) { | 121 | if (v % 4) { |
121 | printk(KERN_ERR "module %s: dangerous relocation\n", me->name); | 122 | pr_err("module %s: dangerous R_MIPS_26 RELArelocation\n", |
123 | me->name); | ||
122 | return -ENOEXEC; | 124 | return -ENOEXEC; |
123 | } | 125 | } |
124 | 126 | ||
@@ -222,7 +224,7 @@ static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v) | |||
222 | return 0; | 224 | return 0; |
223 | 225 | ||
224 | out_danger: | 226 | out_danger: |
225 | printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name); | 227 | pr_err("module %s: dangerous R_MIPS_LO16 REL relocation\n", me->name); |
226 | 228 | ||
227 | return -ENOEXEC; | 229 | return -ENOEXEC; |
228 | } | 230 | } |
@@ -301,7 +303,7 @@ int apply_relocate(Elf_Shdr *sechdrs, const char *strtab, | |||
301 | /* This is the symbol it is referring to */ | 303 | /* This is the symbol it is referring to */ |
302 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr | 304 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr |
303 | + ELF_MIPS_R_SYM(rel[i]); | 305 | + ELF_MIPS_R_SYM(rel[i]); |
304 | if (!sym->st_value) { | 306 | if (IS_ERR_VALUE(sym->st_value)) { |
305 | /* Ignore unresolved weak symbol */ | 307 | /* Ignore unresolved weak symbol */ |
306 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) | 308 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) |
307 | continue; | 309 | continue; |
@@ -341,7 +343,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab, | |||
341 | /* This is the symbol it is referring to */ | 343 | /* This is the symbol it is referring to */ |
342 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr | 344 | sym = (Elf_Sym *)sechdrs[symindex].sh_addr |
343 | + ELF_MIPS_R_SYM(rel[i]); | 345 | + ELF_MIPS_R_SYM(rel[i]); |
344 | if (!sym->st_value) { | 346 | if (IS_ERR_VALUE(sym->st_value)) { |
345 | /* Ignore unresolved weak symbol */ | 347 | /* Ignore unresolved weak symbol */ |
346 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) | 348 | if (ELF_ST_BIND(sym->st_info) == STB_WEAK) |
347 | continue; | 349 | continue; |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index e0a4ac18fa07..26109c4d5170 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/kernel/proc.c | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996, 2001 Ralf Baechle | 2 | * Copyright (C) 1995, 1996, 2001 Ralf Baechle |
5 | * Copyright (C) 2001, 2004 MIPS Technologies, Inc. | 3 | * Copyright (C) 2001, 2004 MIPS Technologies, Inc. |
6 | * Copyright (C) 2004 Maciej W. Rozycki | 4 | * Copyright (C) 2004 Maciej W. Rozycki |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 1eaaa450e20c..f3d73e1831c1 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -50,10 +50,15 @@ | |||
50 | */ | 50 | */ |
51 | void __noreturn cpu_idle(void) | 51 | void __noreturn cpu_idle(void) |
52 | { | 52 | { |
53 | int cpu; | ||
54 | |||
55 | /* CPU is going idle. */ | ||
56 | cpu = smp_processor_id(); | ||
57 | |||
53 | /* endless idle loop with no priority at all */ | 58 | /* endless idle loop with no priority at all */ |
54 | while (1) { | 59 | while (1) { |
55 | tick_nohz_stop_sched_tick(1); | 60 | tick_nohz_stop_sched_tick(1); |
56 | while (!need_resched()) { | 61 | while (!need_resched() && cpu_online(cpu)) { |
57 | #ifdef CONFIG_MIPS_MT_SMTC | 62 | #ifdef CONFIG_MIPS_MT_SMTC |
58 | extern void smtc_idle_loop_hook(void); | 63 | extern void smtc_idle_loop_hook(void); |
59 | 64 | ||
@@ -62,6 +67,12 @@ void __noreturn cpu_idle(void) | |||
62 | if (cpu_wait) | 67 | if (cpu_wait) |
63 | (*cpu_wait)(); | 68 | (*cpu_wait)(); |
64 | } | 69 | } |
70 | #ifdef CONFIG_HOTPLUG_CPU | ||
71 | if (!cpu_online(cpu) && !cpu_isset(cpu, cpu_callin_map) && | ||
72 | (system_state == SYSTEM_RUNNING || | ||
73 | system_state == SYSTEM_BOOTING)) | ||
74 | play_dead(); | ||
75 | #endif | ||
65 | tick_nohz_restart_sched_tick(); | 76 | tick_nohz_restart_sched_tick(); |
66 | preempt_enable_no_resched(); | 77 | preempt_enable_no_resched(); |
67 | schedule(); | 78 | schedule(); |
@@ -104,7 +115,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
104 | { | 115 | { |
105 | struct thread_info *ti = task_thread_info(p); | 116 | struct thread_info *ti = task_thread_info(p); |
106 | struct pt_regs *childregs; | 117 | struct pt_regs *childregs; |
107 | long childksp; | 118 | unsigned long childksp; |
108 | p->set_child_tid = p->clear_child_tid = NULL; | 119 | p->set_child_tid = p->clear_child_tid = NULL; |
109 | 120 | ||
110 | childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32; | 121 | childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32; |
@@ -121,6 +132,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
121 | 132 | ||
122 | /* set up new TSS. */ | 133 | /* set up new TSS. */ |
123 | childregs = (struct pt_regs *) childksp - 1; | 134 | childregs = (struct pt_regs *) childksp - 1; |
135 | /* Put the stack after the struct pt_regs. */ | ||
136 | childksp = (unsigned long) childregs; | ||
124 | *childregs = *regs; | 137 | *childregs = *regs; |
125 | childregs->regs[7] = 0; /* Clear error flag */ | 138 | childregs->regs[7] = 0; /* Clear error flag */ |
126 | 139 | ||
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index c4f9ac17474a..32644b4a0714 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
23 | #include <linux/ptrace.h> | 23 | #include <linux/ptrace.h> |
24 | #include <linux/smp.h> | 24 | #include <linux/smp.h> |
25 | #include <linux/smp_lock.h> | ||
26 | #include <linux/user.h> | 25 | #include <linux/user.h> |
27 | #include <linux/security.h> | 26 | #include <linux/security.h> |
28 | 27 | ||
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 0b31b9bda048..b57082123536 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -652,6 +652,9 @@ einval: li v0, -ENOSYS | |||
652 | sys sys_inotify_init1 1 | 652 | sys sys_inotify_init1 1 |
653 | sys sys_preadv 6 /* 4330 */ | 653 | sys sys_preadv 6 /* 4330 */ |
654 | sys sys_pwritev 6 | 654 | sys sys_pwritev 6 |
655 | sys sys_rt_tgsigqueueinfo 4 | ||
656 | sys sys_perf_counter_open 5 | ||
657 | sys sys_accept4 4 | ||
655 | .endm | 658 | .endm |
656 | 659 | ||
657 | /* We pre-compute the number of _instruction_ bytes needed to | 660 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index c647fd6e722f..3d866f24e064 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -489,4 +489,7 @@ sys_call_table: | |||
489 | PTR sys_inotify_init1 | 489 | PTR sys_inotify_init1 |
490 | PTR sys_preadv | 490 | PTR sys_preadv |
491 | PTR sys_pwritev /* 5390 */ | 491 | PTR sys_pwritev /* 5390 */ |
492 | PTR sys_rt_tgsigqueueinfo | ||
493 | PTR sys_perf_counter_open | ||
494 | PTR sys_accept4 | ||
492 | .size sys_call_table,.-sys_call_table | 495 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 93cc672f4522..e855b118a079 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -415,4 +415,7 @@ EXPORT(sysn32_call_table) | |||
415 | PTR sys_inotify_init1 | 415 | PTR sys_inotify_init1 |
416 | PTR sys_preadv | 416 | PTR sys_preadv |
417 | PTR sys_pwritev | 417 | PTR sys_pwritev |
418 | PTR compat_sys_rt_tgsigqueueinfo /* 5295 */ | ||
419 | PTR sys_perf_counter_open | ||
420 | PTR sys_accept4 | ||
418 | .size sysn32_call_table,.-sysn32_call_table | 421 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index a5598b2339dd..0c49f1a660be 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -535,4 +535,7 @@ sys_call_table: | |||
535 | PTR sys_inotify_init1 | 535 | PTR sys_inotify_init1 |
536 | PTR compat_sys_preadv /* 4330 */ | 536 | PTR compat_sys_preadv /* 4330 */ |
537 | PTR compat_sys_pwritev | 537 | PTR compat_sys_pwritev |
538 | PTR compat_sys_rt_tgsigqueueinfo | ||
539 | PTR sys_perf_counter_open | ||
540 | PTR sys_accept4 | ||
538 | .size sys_call_table,.-sys_call_table | 541 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c index f27beca4b26d..ad0ff5dc4d59 100644 --- a/arch/mips/kernel/smp-cmp.c +++ b/arch/mips/kernel/smp-cmp.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/smp.h> | ||
23 | #include <linux/cpumask.h> | 24 | #include <linux/cpumask.h> |
24 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
25 | #include <linux/compiler.h> | 26 | #include <linux/compiler.h> |
@@ -36,80 +37,24 @@ | |||
36 | #include <asm/mipsregs.h> | 37 | #include <asm/mipsregs.h> |
37 | #include <asm/mipsmtregs.h> | 38 | #include <asm/mipsmtregs.h> |
38 | #include <asm/mips_mt.h> | 39 | #include <asm/mips_mt.h> |
39 | 40 | #include <asm/amon.h> | |
40 | /* | 41 | #include <asm/gic.h> |
41 | * Crude manipulation of the CPU masks to control which | ||
42 | * which CPU's are brought online during initialisation | ||
43 | * | ||
44 | * Beware... this needs to be called after CPU discovery | ||
45 | * but before CPU bringup | ||
46 | */ | ||
47 | static int __init allowcpus(char *str) | ||
48 | { | ||
49 | cpumask_t cpu_allow_map; | ||
50 | char buf[256]; | ||
51 | int len; | ||
52 | |||
53 | cpus_clear(cpu_allow_map); | ||
54 | if (cpulist_parse(str, &cpu_allow_map) == 0) { | ||
55 | cpu_set(0, cpu_allow_map); | ||
56 | cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map); | ||
57 | len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map); | ||
58 | buf[len] = '\0'; | ||
59 | pr_debug("Allowable CPUs: %s\n", buf); | ||
60 | return 1; | ||
61 | } else | ||
62 | return 0; | ||
63 | } | ||
64 | __setup("allowcpus=", allowcpus); | ||
65 | 42 | ||
66 | static void ipi_call_function(unsigned int cpu) | 43 | static void ipi_call_function(unsigned int cpu) |
67 | { | 44 | { |
68 | unsigned int action = 0; | ||
69 | |||
70 | pr_debug("CPU%d: %s cpu %d status %08x\n", | 45 | pr_debug("CPU%d: %s cpu %d status %08x\n", |
71 | smp_processor_id(), __func__, cpu, read_c0_status()); | 46 | smp_processor_id(), __func__, cpu, read_c0_status()); |
72 | 47 | ||
73 | switch (cpu) { | 48 | gic_send_ipi(plat_ipi_call_int_xlate(cpu)); |
74 | case 0: | ||
75 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE0; | ||
76 | break; | ||
77 | case 1: | ||
78 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE1; | ||
79 | break; | ||
80 | case 2: | ||
81 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE2; | ||
82 | break; | ||
83 | case 3: | ||
84 | action = GIC_IPI_EXT_INTR_CALLFNC_VPE3; | ||
85 | break; | ||
86 | } | ||
87 | gic_send_ipi(action); | ||
88 | } | 49 | } |
89 | 50 | ||
90 | 51 | ||
91 | static void ipi_resched(unsigned int cpu) | 52 | static void ipi_resched(unsigned int cpu) |
92 | { | 53 | { |
93 | unsigned int action = 0; | ||
94 | |||
95 | pr_debug("CPU%d: %s cpu %d status %08x\n", | 54 | pr_debug("CPU%d: %s cpu %d status %08x\n", |
96 | smp_processor_id(), __func__, cpu, read_c0_status()); | 55 | smp_processor_id(), __func__, cpu, read_c0_status()); |
97 | 56 | ||
98 | switch (cpu) { | 57 | gic_send_ipi(plat_ipi_resched_int_xlate(cpu)); |
99 | case 0: | ||
100 | action = GIC_IPI_EXT_INTR_RESCHED_VPE0; | ||
101 | break; | ||
102 | case 1: | ||
103 | action = GIC_IPI_EXT_INTR_RESCHED_VPE1; | ||
104 | break; | ||
105 | case 2: | ||
106 | action = GIC_IPI_EXT_INTR_RESCHED_VPE2; | ||
107 | break; | ||
108 | case 3: | ||
109 | action = GIC_IPI_EXT_INTR_RESCHED_VPE3; | ||
110 | break; | ||
111 | } | ||
112 | gic_send_ipi(action); | ||
113 | } | 58 | } |
114 | 59 | ||
115 | /* | 60 | /* |
@@ -205,7 +150,7 @@ static void cmp_boot_secondary(int cpu, struct task_struct *idle) | |||
205 | (unsigned long)(gp + sizeof(struct thread_info))); | 150 | (unsigned long)(gp + sizeof(struct thread_info))); |
206 | #endif | 151 | #endif |
207 | 152 | ||
208 | amon_cpu_start(cpu, pc, sp, gp, a0); | 153 | amon_cpu_start(cpu, pc, sp, (unsigned long)gp, a0); |
209 | } | 154 | } |
210 | 155 | ||
211 | /* | 156 | /* |
diff --git a/arch/mips/kernel/smp-up.c b/arch/mips/kernel/smp-up.c index 878e3733bbb2..2508d55d68fd 100644 --- a/arch/mips/kernel/smp-up.c +++ b/arch/mips/kernel/smp-up.c | |||
@@ -55,6 +55,18 @@ static void __init up_prepare_cpus(unsigned int max_cpus) | |||
55 | { | 55 | { |
56 | } | 56 | } |
57 | 57 | ||
58 | #ifdef CONFIG_HOTPLUG_CPU | ||
59 | static int up_cpu_disable(void) | ||
60 | { | ||
61 | return -ENOSYS; | ||
62 | } | ||
63 | |||
64 | static void up_cpu_die(unsigned int cpu) | ||
65 | { | ||
66 | BUG(); | ||
67 | } | ||
68 | #endif | ||
69 | |||
58 | struct plat_smp_ops up_smp_ops = { | 70 | struct plat_smp_ops up_smp_ops = { |
59 | .send_ipi_single = up_send_ipi_single, | 71 | .send_ipi_single = up_send_ipi_single, |
60 | .send_ipi_mask = up_send_ipi_mask, | 72 | .send_ipi_mask = up_send_ipi_mask, |
@@ -64,4 +76,8 @@ struct plat_smp_ops up_smp_ops = { | |||
64 | .boot_secondary = up_boot_secondary, | 76 | .boot_secondary = up_boot_secondary, |
65 | .smp_setup = up_smp_setup, | 77 | .smp_setup = up_smp_setup, |
66 | .prepare_cpus = up_prepare_cpus, | 78 | .prepare_cpus = up_prepare_cpus, |
79 | #ifdef CONFIG_HOTPLUG_CPU | ||
80 | .cpu_disable = up_cpu_disable, | ||
81 | .cpu_die = up_cpu_die, | ||
82 | #endif | ||
67 | }; | 83 | }; |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index c937506a03aa..bc7d9b05e2f4 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/smp.h> | ||
25 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
26 | #include <linux/threads.h> | 27 | #include <linux/threads.h> |
27 | #include <linux/module.h> | 28 | #include <linux/module.h> |
@@ -44,7 +45,7 @@ | |||
44 | #include <asm/mipsmtregs.h> | 45 | #include <asm/mipsmtregs.h> |
45 | #endif /* CONFIG_MIPS_MT_SMTC */ | 46 | #endif /* CONFIG_MIPS_MT_SMTC */ |
46 | 47 | ||
47 | static volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ | 48 | volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ |
48 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ | 49 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ |
49 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ | 50 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ |
50 | 51 | ||
@@ -200,6 +201,8 @@ void __devinit smp_prepare_boot_cpu(void) | |||
200 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is | 201 | * and keep control until "cpu_online(cpu)" is set. Note: cpu is |
201 | * physical, not logical. | 202 | * physical, not logical. |
202 | */ | 203 | */ |
204 | static struct task_struct *cpu_idle_thread[NR_CPUS]; | ||
205 | |||
203 | int __cpuinit __cpu_up(unsigned int cpu) | 206 | int __cpuinit __cpu_up(unsigned int cpu) |
204 | { | 207 | { |
205 | struct task_struct *idle; | 208 | struct task_struct *idle; |
@@ -209,9 +212,16 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
209 | * The following code is purely to make sure | 212 | * The following code is purely to make sure |
210 | * Linux can schedule processes on this slave. | 213 | * Linux can schedule processes on this slave. |
211 | */ | 214 | */ |
212 | idle = fork_idle(cpu); | 215 | if (!cpu_idle_thread[cpu]) { |
213 | if (IS_ERR(idle)) | 216 | idle = fork_idle(cpu); |
214 | panic(KERN_ERR "Fork failed for CPU %d", cpu); | 217 | cpu_idle_thread[cpu] = idle; |
218 | |||
219 | if (IS_ERR(idle)) | ||
220 | panic(KERN_ERR "Fork failed for CPU %d", cpu); | ||
221 | } else { | ||
222 | idle = cpu_idle_thread[cpu]; | ||
223 | init_idle(idle, cpu); | ||
224 | } | ||
215 | 225 | ||
216 | mp_ops->boot_secondary(cpu, idle); | 226 | mp_ops->boot_secondary(cpu, idle); |
217 | 227 | ||
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 5f5af7d4c890..c16bb6d6c25c 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/clockchips.h> | 20 | #include <linux/clockchips.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | #include <linux/smp.h> | ||
23 | #include <linux/cpumask.h> | 24 | #include <linux/cpumask.h> |
24 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
25 | #include <linux/kernel_stat.h> | 26 | #include <linux/kernel_stat.h> |
@@ -464,11 +465,8 @@ void smtc_prepare_cpus(int cpus) | |||
464 | smtc_configure_tlb(); | 465 | smtc_configure_tlb(); |
465 | 466 | ||
466 | for (tc = 0, vpe = 0 ; (vpe < nvpe) && (tc < ntc) ; vpe++) { | 467 | for (tc = 0, vpe = 0 ; (vpe < nvpe) && (tc < ntc) ; vpe++) { |
467 | /* | 468 | if (tcpervpe[vpe] == 0) |
468 | * Set the MVP bits. | 469 | continue; |
469 | */ | ||
470 | settc(tc); | ||
471 | write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | VPECONF0_MVP); | ||
472 | if (vpe != 0) | 470 | if (vpe != 0) |
473 | printk(", "); | 471 | printk(", "); |
474 | printk("VPE %d: TC", vpe); | 472 | printk("VPE %d: TC", vpe); |
@@ -487,6 +485,12 @@ void smtc_prepare_cpus(int cpus) | |||
487 | } | 485 | } |
488 | if (vpe != 0) { | 486 | if (vpe != 0) { |
489 | /* | 487 | /* |
488 | * Allow this VPE to control others. | ||
489 | */ | ||
490 | write_vpe_c0_vpeconf0(read_vpe_c0_vpeconf0() | | ||
491 | VPECONF0_MVP); | ||
492 | |||
493 | /* | ||
490 | * Clear any stale software interrupts from VPE's Cause | 494 | * Clear any stale software interrupts from VPE's Cause |
491 | */ | 495 | */ |
492 | write_vpe_c0_cause(0); | 496 | write_vpe_c0_cause(0); |
@@ -924,6 +928,7 @@ void ipi_decode(struct smtc_ipi *pipi) | |||
924 | int irq = MIPS_CPU_IRQ_BASE + 1; | 928 | int irq = MIPS_CPU_IRQ_BASE + 1; |
925 | 929 | ||
926 | smtc_ipi_nq(&freeIPIq, pipi); | 930 | smtc_ipi_nq(&freeIPIq, pipi); |
931 | |||
927 | switch (type_copy) { | 932 | switch (type_copy) { |
928 | case SMTC_CLOCK_TICK: | 933 | case SMTC_CLOCK_TICK: |
929 | irq_enter(); | 934 | irq_enter(); |
diff --git a/arch/mips/kernel/stacktrace.c b/arch/mips/kernel/stacktrace.c index 58f5cd76c8c3..d52ff77baf3f 100644 --- a/arch/mips/kernel/stacktrace.c +++ b/arch/mips/kernel/stacktrace.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/kernel/stacktrace.c | ||
3 | * | ||
4 | * Stack trace management functions | 2 | * Stack trace management functions |
5 | * | 3 | * |
6 | * Copyright (C) 2006 Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 4 | * Copyright (C) 2006 Atsushi Nemoto <anemo@mba.ocn.ne.jp> |
diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c index 9021108eb9c1..05dd170a83f7 100644 --- a/arch/mips/kernel/sync-r4k.c +++ b/arch/mips/kernel/sync-r4k.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Count register synchronisation. | 2 | * Count register synchronisation. |
3 | * | 3 | * |
4 | * All CPUs will have their count registers synchronised to the CPU0 expirelo | 4 | * All CPUs will have their count registers synchronised to the CPU0 next time |
5 | * value. This can cause a small timewarp for CPU0. All other CPU's should | 5 | * value. This can cause a small timewarp for CPU0. All other CPU's should |
6 | * not have done anything significant (but they may have had interrupts | 6 | * not have done anything significant (but they may have had interrupts |
7 | * enabled briefly - prom_smp_finish() should not be responsible for enabling | 7 | * enabled briefly - prom_smp_finish() should not be responsible for enabling |
@@ -13,21 +13,22 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/irqflags.h> | 15 | #include <linux/irqflags.h> |
16 | #include <linux/r4k-timer.h> | 16 | #include <linux/cpumask.h> |
17 | 17 | ||
18 | #include <asm/r4k-timer.h> | ||
18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
19 | #include <asm/barrier.h> | 20 | #include <asm/barrier.h> |
20 | #include <asm/cpumask.h> | ||
21 | #include <asm/mipsregs.h> | 21 | #include <asm/mipsregs.h> |
22 | 22 | ||
23 | static atomic_t __initdata count_start_flag = ATOMIC_INIT(0); | 23 | static atomic_t __cpuinitdata count_start_flag = ATOMIC_INIT(0); |
24 | static atomic_t __initdata count_count_start = ATOMIC_INIT(0); | 24 | static atomic_t __cpuinitdata count_count_start = ATOMIC_INIT(0); |
25 | static atomic_t __initdata count_count_stop = ATOMIC_INIT(0); | 25 | static atomic_t __cpuinitdata count_count_stop = ATOMIC_INIT(0); |
26 | static atomic_t __cpuinitdata count_reference = ATOMIC_INIT(0); | ||
26 | 27 | ||
27 | #define COUNTON 100 | 28 | #define COUNTON 100 |
28 | #define NR_LOOPS 5 | 29 | #define NR_LOOPS 5 |
29 | 30 | ||
30 | void __init synchronise_count_master(void) | 31 | void __cpuinit synchronise_count_master(void) |
31 | { | 32 | { |
32 | int i; | 33 | int i; |
33 | unsigned long flags; | 34 | unsigned long flags; |
@@ -42,19 +43,20 @@ void __init synchronise_count_master(void) | |||
42 | return; | 43 | return; |
43 | #endif | 44 | #endif |
44 | 45 | ||
45 | pr_info("Checking COUNT synchronization across %u CPUs: ", | 46 | printk(KERN_INFO "Synchronize counters across %u CPUs: ", |
46 | num_online_cpus()); | 47 | num_online_cpus()); |
47 | 48 | ||
48 | local_irq_save(flags); | 49 | local_irq_save(flags); |
49 | 50 | ||
50 | /* | 51 | /* |
51 | * Notify the slaves that it's time to start | 52 | * Notify the slaves that it's time to start |
52 | */ | 53 | */ |
54 | atomic_set(&count_reference, read_c0_count()); | ||
53 | atomic_set(&count_start_flag, 1); | 55 | atomic_set(&count_start_flag, 1); |
54 | smp_wmb(); | 56 | smp_wmb(); |
55 | 57 | ||
56 | /* Count will be initialised to expirelo for all CPU's */ | 58 | /* Count will be initialised to current timer for all CPU's */ |
57 | initcount = expirelo; | 59 | initcount = read_c0_count(); |
58 | 60 | ||
59 | /* | 61 | /* |
60 | * We loop a few times to get a primed instruction cache, | 62 | * We loop a few times to get a primed instruction cache, |
@@ -106,7 +108,7 @@ void __init synchronise_count_master(void) | |||
106 | printk("done.\n"); | 108 | printk("done.\n"); |
107 | } | 109 | } |
108 | 110 | ||
109 | void __init synchronise_count_slave(void) | 111 | void __cpuinit synchronise_count_slave(void) |
110 | { | 112 | { |
111 | int i; | 113 | int i; |
112 | unsigned long flags; | 114 | unsigned long flags; |
@@ -131,8 +133,8 @@ void __init synchronise_count_slave(void) | |||
131 | while (!atomic_read(&count_start_flag)) | 133 | while (!atomic_read(&count_start_flag)) |
132 | mb(); | 134 | mb(); |
133 | 135 | ||
134 | /* Count will be initialised to expirelo for all CPU's */ | 136 | /* Count will be initialised to next expire for all CPU's */ |
135 | initcount = expirelo; | 137 | initcount = atomic_read(&count_reference); |
136 | 138 | ||
137 | ncpus = num_online_cpus(); | 139 | ncpus = num_online_cpus(); |
138 | for (i = 0; i < NR_LOOPS; i++) { | 140 | for (i = 0; i < NR_LOOPS; i++) { |
@@ -156,4 +158,3 @@ void __init synchronise_count_slave(void) | |||
156 | local_irq_restore(flags); | 158 | local_irq_restore(flags); |
157 | } | 159 | } |
158 | #undef NR_LOOPS | 160 | #undef NR_LOOPS |
159 | #endif | ||
diff --git a/arch/mips/kernel/topology.c b/arch/mips/kernel/topology.c index 660e44ed44d7..cf3eb61fad12 100644 --- a/arch/mips/kernel/topology.c +++ b/arch/mips/kernel/topology.c | |||
@@ -17,7 +17,10 @@ static int __init topology_init(void) | |||
17 | #endif /* CONFIG_NUMA */ | 17 | #endif /* CONFIG_NUMA */ |
18 | 18 | ||
19 | for_each_present_cpu(i) { | 19 | for_each_present_cpu(i) { |
20 | ret = register_cpu(&per_cpu(cpu_devices, i), i); | 20 | struct cpu *c = &per_cpu(cpu_devices, i); |
21 | |||
22 | c->hotpluggable = 1; | ||
23 | ret = register_cpu(c, i); | ||
21 | if (ret) | 24 | if (ret) |
22 | printk(KERN_WARNING "topology_init: register_cpu %d " | 25 | printk(KERN_WARNING "topology_init: register_cpu %d " |
23 | "failed (%d)\n", i, ret); | 26 | "failed (%d)\n", i, ret); |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index e83da174b533..08f1edf355e8 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1502,7 +1502,7 @@ void __cpuinit per_cpu_trap_init(void) | |||
1502 | status_set); | 1502 | status_set); |
1503 | 1503 | ||
1504 | if (cpu_has_mips_r2) { | 1504 | if (cpu_has_mips_r2) { |
1505 | unsigned int enable = 0x0000000f; | 1505 | unsigned int enable = 0x0000000f | cpu_hwrena_impl_bits; |
1506 | 1506 | ||
1507 | if (!noulri && cpu_has_userlocal) | 1507 | if (!noulri && cpu_has_userlocal) |
1508 | enable |= (1 << 29); | 1508 | enable |= (1 << 29); |
@@ -1510,10 +1510,6 @@ void __cpuinit per_cpu_trap_init(void) | |||
1510 | write_c0_hwrena(enable); | 1510 | write_c0_hwrena(enable); |
1511 | } | 1511 | } |
1512 | 1512 | ||
1513 | #ifdef CONFIG_CPU_CAVIUM_OCTEON | ||
1514 | write_c0_hwrena(0xc000000f); /* Octeon has register 30 and 31 */ | ||
1515 | #endif | ||
1516 | |||
1517 | #ifdef CONFIG_MIPS_MT_SMTC | 1513 | #ifdef CONFIG_MIPS_MT_SMTC |
1518 | if (!secondaryTC) { | 1514 | if (!secondaryTC) { |
1519 | #endif /* CONFIG_MIPS_MT_SMTC */ | 1515 | #endif /* CONFIG_MIPS_MT_SMTC */ |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 3ca5f42e819d..9a1ab7e87fd4 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -73,7 +73,7 @@ static int major; | |||
73 | static const int minor = 1; /* fixed for now */ | 73 | static const int minor = 1; /* fixed for now */ |
74 | 74 | ||
75 | #ifdef CONFIG_MIPS_APSP_KSPD | 75 | #ifdef CONFIG_MIPS_APSP_KSPD |
76 | static struct kspd_notifications kspd_events; | 76 | static struct kspd_notifications kspd_events; |
77 | static int kspd_events_reqd = 0; | 77 | static int kspd_events_reqd = 0; |
78 | #endif | 78 | #endif |
79 | 79 | ||
@@ -155,10 +155,9 @@ struct { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | static void release_progmem(void *ptr); | 157 | static void release_progmem(void *ptr); |
158 | extern void save_gp_address(unsigned int secbase, unsigned int rel); | ||
159 | 158 | ||
160 | /* get the vpe associated with this minor */ | 159 | /* get the vpe associated with this minor */ |
161 | struct vpe *get_vpe(int minor) | 160 | static struct vpe *get_vpe(int minor) |
162 | { | 161 | { |
163 | struct vpe *v; | 162 | struct vpe *v; |
164 | 163 | ||
@@ -174,7 +173,7 @@ struct vpe *get_vpe(int minor) | |||
174 | } | 173 | } |
175 | 174 | ||
176 | /* get the vpe associated with this minor */ | 175 | /* get the vpe associated with this minor */ |
177 | struct tc *get_tc(int index) | 176 | static struct tc *get_tc(int index) |
178 | { | 177 | { |
179 | struct tc *t; | 178 | struct tc *t; |
180 | 179 | ||
@@ -186,20 +185,8 @@ struct tc *get_tc(int index) | |||
186 | return NULL; | 185 | return NULL; |
187 | } | 186 | } |
188 | 187 | ||
189 | struct tc *get_tc_unused(void) | ||
190 | { | ||
191 | struct tc *t; | ||
192 | |||
193 | list_for_each_entry(t, &vpecontrol.tc_list, list) { | ||
194 | if (t->state == TC_STATE_UNUSED) | ||
195 | return t; | ||
196 | } | ||
197 | |||
198 | return NULL; | ||
199 | } | ||
200 | |||
201 | /* allocate a vpe and associate it with this minor (or index) */ | 188 | /* allocate a vpe and associate it with this minor (or index) */ |
202 | struct vpe *alloc_vpe(int minor) | 189 | static struct vpe *alloc_vpe(int minor) |
203 | { | 190 | { |
204 | struct vpe *v; | 191 | struct vpe *v; |
205 | 192 | ||
@@ -216,7 +203,7 @@ struct vpe *alloc_vpe(int minor) | |||
216 | } | 203 | } |
217 | 204 | ||
218 | /* allocate a tc. At startup only tc0 is running, all other can be halted. */ | 205 | /* allocate a tc. At startup only tc0 is running, all other can be halted. */ |
219 | struct tc *alloc_tc(int index) | 206 | static struct tc *alloc_tc(int index) |
220 | { | 207 | { |
221 | struct tc *tc; | 208 | struct tc *tc; |
222 | 209 | ||
@@ -232,7 +219,7 @@ out: | |||
232 | } | 219 | } |
233 | 220 | ||
234 | /* clean up and free everything */ | 221 | /* clean up and free everything */ |
235 | void release_vpe(struct vpe *v) | 222 | static void release_vpe(struct vpe *v) |
236 | { | 223 | { |
237 | list_del(&v->list); | 224 | list_del(&v->list); |
238 | if (v->load_addr) | 225 | if (v->load_addr) |
@@ -240,7 +227,7 @@ void release_vpe(struct vpe *v) | |||
240 | kfree(v); | 227 | kfree(v); |
241 | } | 228 | } |
242 | 229 | ||
243 | void dump_mtregs(void) | 230 | static void dump_mtregs(void) |
244 | { | 231 | { |
245 | unsigned long val; | 232 | unsigned long val; |
246 | 233 | ||
@@ -327,7 +314,8 @@ static void layout_sections(struct module *mod, const Elf_Ehdr * hdr, | |||
327 | || (s->sh_flags & masks[m][1]) | 314 | || (s->sh_flags & masks[m][1]) |
328 | || s->sh_entsize != ~0UL) | 315 | || s->sh_entsize != ~0UL) |
329 | continue; | 316 | continue; |
330 | s->sh_entsize = get_offset(&mod->core_size, s); | 317 | s->sh_entsize = |
318 | get_offset((unsigned long *)&mod->core_size, s); | ||
331 | } | 319 | } |
332 | 320 | ||
333 | if (m == 0) | 321 | if (m == 0) |
@@ -461,16 +449,15 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location, | |||
461 | { | 449 | { |
462 | unsigned long insnlo = *location; | 450 | unsigned long insnlo = *location; |
463 | Elf32_Addr val, vallo; | 451 | Elf32_Addr val, vallo; |
452 | struct mips_hi16 *l, *next; | ||
464 | 453 | ||
465 | /* Sign extend the addend we extract from the lo insn. */ | 454 | /* Sign extend the addend we extract from the lo insn. */ |
466 | vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000; | 455 | vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000; |
467 | 456 | ||
468 | if (mips_hi16_list != NULL) { | 457 | if (mips_hi16_list != NULL) { |
469 | struct mips_hi16 *l; | ||
470 | 458 | ||
471 | l = mips_hi16_list; | 459 | l = mips_hi16_list; |
472 | while (l != NULL) { | 460 | while (l != NULL) { |
473 | struct mips_hi16 *next; | ||
474 | unsigned long insn; | 461 | unsigned long insn; |
475 | 462 | ||
476 | /* | 463 | /* |
@@ -480,7 +467,7 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location, | |||
480 | printk(KERN_DEBUG "VPE loader: " | 467 | printk(KERN_DEBUG "VPE loader: " |
481 | "apply_r_mips_lo16/hi16: \t" | 468 | "apply_r_mips_lo16/hi16: \t" |
482 | "inconsistent value information\n"); | 469 | "inconsistent value information\n"); |
483 | return -ENOEXEC; | 470 | goto out_free; |
484 | } | 471 | } |
485 | 472 | ||
486 | /* | 473 | /* |
@@ -518,6 +505,16 @@ static int apply_r_mips_lo16(struct module *me, uint32_t *location, | |||
518 | *location = insnlo; | 505 | *location = insnlo; |
519 | 506 | ||
520 | return 0; | 507 | return 0; |
508 | |||
509 | out_free: | ||
510 | while (l != NULL) { | ||
511 | next = l->next; | ||
512 | kfree(l); | ||
513 | l = next; | ||
514 | } | ||
515 | mips_hi16_list = NULL; | ||
516 | |||
517 | return -ENOEXEC; | ||
521 | } | 518 | } |
522 | 519 | ||
523 | static int (*reloc_handlers[]) (struct module *me, uint32_t *location, | 520 | static int (*reloc_handlers[]) (struct module *me, uint32_t *location, |
@@ -541,7 +538,7 @@ static char *rstrs[] = { | |||
541 | [R_MIPS_PC16] = "MIPS_PC16" | 538 | [R_MIPS_PC16] = "MIPS_PC16" |
542 | }; | 539 | }; |
543 | 540 | ||
544 | int apply_relocations(Elf32_Shdr *sechdrs, | 541 | static int apply_relocations(Elf32_Shdr *sechdrs, |
545 | const char *strtab, | 542 | const char *strtab, |
546 | unsigned int symindex, | 543 | unsigned int symindex, |
547 | unsigned int relsec, | 544 | unsigned int relsec, |
@@ -586,7 +583,7 @@ int apply_relocations(Elf32_Shdr *sechdrs, | |||
586 | return 0; | 583 | return 0; |
587 | } | 584 | } |
588 | 585 | ||
589 | void save_gp_address(unsigned int secbase, unsigned int rel) | 586 | static inline void save_gp_address(unsigned int secbase, unsigned int rel) |
590 | { | 587 | { |
591 | gp_addr = secbase + rel; | 588 | gp_addr = secbase + rel; |
592 | gp_offs = gp_addr - (secbase & 0xffff0000); | 589 | gp_offs = gp_addr - (secbase & 0xffff0000); |
@@ -1387,7 +1384,7 @@ static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr, | |||
1387 | return len; | 1384 | return len; |
1388 | 1385 | ||
1389 | out_einval: | 1386 | out_einval: |
1390 | return -EINVAL;; | 1387 | return -EINVAL; |
1391 | } | 1388 | } |
1392 | 1389 | ||
1393 | static struct device_attribute vpe_class_attributes[] = { | 1390 | static struct device_attribute vpe_class_attributes[] = { |
diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c index f69c6b569eb3..6b3b1de9dcae 100644 --- a/arch/mips/lib/delay.c +++ b/arch/mips/lib/delay.c | |||
@@ -43,7 +43,7 @@ void __udelay(unsigned long us) | |||
43 | { | 43 | { |
44 | unsigned int lpj = current_cpu_data.udelay_val; | 44 | unsigned int lpj = current_cpu_data.udelay_val; |
45 | 45 | ||
46 | __delay((us * 0x000010c7 * HZ * lpj) >> 32); | 46 | __delay((us * 0x000010c7ull * HZ * lpj) >> 32); |
47 | } | 47 | } |
48 | EXPORT_SYMBOL(__udelay); | 48 | EXPORT_SYMBOL(__udelay); |
49 | 49 | ||
@@ -51,6 +51,6 @@ void __ndelay(unsigned long ns) | |||
51 | { | 51 | { |
52 | unsigned int lpj = current_cpu_data.udelay_val; | 52 | unsigned int lpj = current_cpu_data.udelay_val; |
53 | 53 | ||
54 | __delay((us * 0x00000005 * HZ * lpj) >> 32); | 54 | __delay((ns * 0x00000005ull * HZ * lpj) >> 32); |
55 | } | 55 | } |
56 | EXPORT_SYMBOL(__ndelay); | 56 | EXPORT_SYMBOL(__ndelay); |
diff --git a/arch/mips/mipssim/sim_time.c b/arch/mips/mipssim/sim_time.c index 881ecbc1fa23..5492c42f7650 100644 --- a/arch/mips/mipssim/sim_time.c +++ b/arch/mips/mipssim/sim_time.c | |||
@@ -89,12 +89,13 @@ unsigned __cpuinit get_c0_compare_int(void) | |||
89 | if (cpu_has_veic) { | 89 | if (cpu_has_veic) { |
90 | set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch); | 90 | set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch); |
91 | mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; | 91 | mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; |
92 | } else { | 92 | |
93 | #endif | 93 | return mips_cpu_timer_irq; |
94 | if (cpu_has_vint) | ||
95 | set_vi_handler(cp0_compare_irq, mips_timer_dispatch); | ||
96 | mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; | ||
97 | } | 94 | } |
95 | #endif | ||
96 | if (cpu_has_vint) | ||
97 | set_vi_handler(cp0_compare_irq, mips_timer_dispatch); | ||
98 | mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; | ||
98 | 99 | ||
99 | return mips_cpu_timer_irq; | 100 | return mips_cpu_timer_irq; |
100 | } | 101 | } |
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile index d7ec95522292..f0e435599707 100644 --- a/arch/mips/mm/Makefile +++ b/arch/mips/mm/Makefile | |||
@@ -8,6 +8,7 @@ obj-y += cache.o dma-default.o extable.o fault.o \ | |||
8 | obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o | 8 | obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o |
9 | obj-$(CONFIG_64BIT) += pgtable-64.o | 9 | obj-$(CONFIG_64BIT) += pgtable-64.o |
10 | obj-$(CONFIG_HIGHMEM) += highmem.o | 10 | obj-$(CONFIG_HIGHMEM) += highmem.o |
11 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | ||
11 | 12 | ||
12 | obj-$(CONFIG_CPU_LOONGSON2) += c-r4k.o cex-gen.o tlb-r4k.o | 13 | obj-$(CONFIG_CPU_LOONGSON2) += c-r4k.o cex-gen.o tlb-r4k.o |
13 | obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o tlb-r4k.o | 14 | obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o tlb-r4k.o |
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c index 44d01a0a8490..10ab69f7183f 100644 --- a/arch/mips/mm/c-octeon.c +++ b/arch/mips/mm/c-octeon.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/smp.h> | ||
11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
12 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
13 | #include <linux/cpu.h> | 14 | #include <linux/cpu.h> |
@@ -288,7 +289,7 @@ static void cache_parity_error_octeon(int non_recoverable) | |||
288 | } | 289 | } |
289 | 290 | ||
290 | /** | 291 | /** |
291 | * Called when the the exception is not recoverable | 292 | * Called when the the exception is recoverable |
292 | */ | 293 | */ |
293 | 294 | ||
294 | asmlinkage void cache_parity_error_octeon_recoverable(void) | 295 | asmlinkage void cache_parity_error_octeon_recoverable(void) |
@@ -297,7 +298,7 @@ asmlinkage void cache_parity_error_octeon_recoverable(void) | |||
297 | } | 298 | } |
298 | 299 | ||
299 | /** | 300 | /** |
300 | * Called when the the exception is recoverable | 301 | * Called when the the exception is not recoverable |
301 | */ | 302 | */ |
302 | 303 | ||
303 | asmlinkage void cache_parity_error_octeon_non_recoverable(void) | 304 | asmlinkage void cache_parity_error_octeon_non_recoverable(void) |
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c index 5500c20c79ae..54e5f7b9f440 100644 --- a/arch/mips/mm/c-r3k.c +++ b/arch/mips/mm/c-r3k.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
15 | #include <linux/smp.h> | ||
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
16 | 17 | ||
17 | #include <asm/page.h> | 18 | #include <asm/page.h> |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 171951d2305b..6721ee2b1e8b 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/smp.h> | ||
16 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
17 | #include <linux/module.h> | 18 | #include <linux/module.h> |
18 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
@@ -100,6 +101,12 @@ static inline void r4k_blast_dcache_page_dc32(unsigned long addr) | |||
100 | blast_dcache32_page(addr); | 101 | blast_dcache32_page(addr); |
101 | } | 102 | } |
102 | 103 | ||
104 | static inline void r4k_blast_dcache_page_dc64(unsigned long addr) | ||
105 | { | ||
106 | R4600_HIT_CACHEOP_WAR_IMPL; | ||
107 | blast_dcache64_page(addr); | ||
108 | } | ||
109 | |||
103 | static void __cpuinit r4k_blast_dcache_page_setup(void) | 110 | static void __cpuinit r4k_blast_dcache_page_setup(void) |
104 | { | 111 | { |
105 | unsigned long dc_lsize = cpu_dcache_line_size(); | 112 | unsigned long dc_lsize = cpu_dcache_line_size(); |
@@ -110,6 +117,8 @@ static void __cpuinit r4k_blast_dcache_page_setup(void) | |||
110 | r4k_blast_dcache_page = blast_dcache16_page; | 117 | r4k_blast_dcache_page = blast_dcache16_page; |
111 | else if (dc_lsize == 32) | 118 | else if (dc_lsize == 32) |
112 | r4k_blast_dcache_page = r4k_blast_dcache_page_dc32; | 119 | r4k_blast_dcache_page = r4k_blast_dcache_page_dc32; |
120 | else if (dc_lsize == 64) | ||
121 | r4k_blast_dcache_page = r4k_blast_dcache_page_dc64; | ||
113 | } | 122 | } |
114 | 123 | ||
115 | static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); | 124 | static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); |
@@ -124,6 +133,8 @@ static void __cpuinit r4k_blast_dcache_page_indexed_setup(void) | |||
124 | r4k_blast_dcache_page_indexed = blast_dcache16_page_indexed; | 133 | r4k_blast_dcache_page_indexed = blast_dcache16_page_indexed; |
125 | else if (dc_lsize == 32) | 134 | else if (dc_lsize == 32) |
126 | r4k_blast_dcache_page_indexed = blast_dcache32_page_indexed; | 135 | r4k_blast_dcache_page_indexed = blast_dcache32_page_indexed; |
136 | else if (dc_lsize == 64) | ||
137 | r4k_blast_dcache_page_indexed = blast_dcache64_page_indexed; | ||
127 | } | 138 | } |
128 | 139 | ||
129 | static void (* r4k_blast_dcache)(void); | 140 | static void (* r4k_blast_dcache)(void); |
@@ -138,6 +149,8 @@ static void __cpuinit r4k_blast_dcache_setup(void) | |||
138 | r4k_blast_dcache = blast_dcache16; | 149 | r4k_blast_dcache = blast_dcache16; |
139 | else if (dc_lsize == 32) | 150 | else if (dc_lsize == 32) |
140 | r4k_blast_dcache = blast_dcache32; | 151 | r4k_blast_dcache = blast_dcache32; |
152 | else if (dc_lsize == 64) | ||
153 | r4k_blast_dcache = blast_dcache64; | ||
141 | } | 154 | } |
142 | 155 | ||
143 | /* force code alignment (used for TX49XX_ICACHE_INDEX_INV_WAR) */ | 156 | /* force code alignment (used for TX49XX_ICACHE_INDEX_INV_WAR) */ |
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c index f7c8f9ce39c1..6515b4418714 100644 --- a/arch/mips/mm/c-tx39.c +++ b/arch/mips/mm/c-tx39.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/smp.h> | ||
14 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
15 | 16 | ||
16 | #include <asm/cacheops.h> | 17 | #include <asm/cacheops.h> |
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 4fdb7f5216b9..7e48e76148aa 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
@@ -20,9 +20,10 @@ | |||
20 | 20 | ||
21 | #include <dma-coherence.h> | 21 | #include <dma-coherence.h> |
22 | 22 | ||
23 | static inline unsigned long dma_addr_to_virt(dma_addr_t dma_addr) | 23 | static inline unsigned long dma_addr_to_virt(struct device *dev, |
24 | dma_addr_t dma_addr) | ||
24 | { | 25 | { |
25 | unsigned long addr = plat_dma_addr_to_phys(dma_addr); | 26 | unsigned long addr = plat_dma_addr_to_phys(dev, dma_addr); |
26 | 27 | ||
27 | return (unsigned long)phys_to_virt(addr); | 28 | return (unsigned long)phys_to_virt(addr); |
28 | } | 29 | } |
@@ -111,7 +112,7 @@ EXPORT_SYMBOL(dma_alloc_coherent); | |||
111 | void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, | 112 | void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, |
112 | dma_addr_t dma_handle) | 113 | dma_addr_t dma_handle) |
113 | { | 114 | { |
114 | plat_unmap_dma_mem(dev, dma_handle); | 115 | plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); |
115 | free_pages((unsigned long) vaddr, get_order(size)); | 116 | free_pages((unsigned long) vaddr, get_order(size)); |
116 | } | 117 | } |
117 | 118 | ||
@@ -122,7 +123,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
122 | { | 123 | { |
123 | unsigned long addr = (unsigned long) vaddr; | 124 | unsigned long addr = (unsigned long) vaddr; |
124 | 125 | ||
125 | plat_unmap_dma_mem(dev, dma_handle); | 126 | plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL); |
126 | 127 | ||
127 | if (!plat_device_is_coherent(dev)) | 128 | if (!plat_device_is_coherent(dev)) |
128 | addr = CAC_ADDR(addr); | 129 | addr = CAC_ADDR(addr); |
@@ -170,10 +171,10 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
170 | enum dma_data_direction direction) | 171 | enum dma_data_direction direction) |
171 | { | 172 | { |
172 | if (cpu_is_noncoherent_r10000(dev)) | 173 | if (cpu_is_noncoherent_r10000(dev)) |
173 | __dma_sync(dma_addr_to_virt(dma_addr), size, | 174 | __dma_sync(dma_addr_to_virt(dev, dma_addr), size, |
174 | direction); | 175 | direction); |
175 | 176 | ||
176 | plat_unmap_dma_mem(dev, dma_addr); | 177 | plat_unmap_dma_mem(dev, dma_addr, size, direction); |
177 | } | 178 | } |
178 | 179 | ||
179 | EXPORT_SYMBOL(dma_unmap_single); | 180 | EXPORT_SYMBOL(dma_unmap_single); |
@@ -232,7 +233,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | |||
232 | if (addr) | 233 | if (addr) |
233 | __dma_sync(addr, sg->length, direction); | 234 | __dma_sync(addr, sg->length, direction); |
234 | } | 235 | } |
235 | plat_unmap_dma_mem(dev, sg->dma_address); | 236 | plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction); |
236 | } | 237 | } |
237 | } | 238 | } |
238 | 239 | ||
@@ -246,7 +247,7 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, | |||
246 | if (cpu_is_noncoherent_r10000(dev)) { | 247 | if (cpu_is_noncoherent_r10000(dev)) { |
247 | unsigned long addr; | 248 | unsigned long addr; |
248 | 249 | ||
249 | addr = dma_addr_to_virt(dma_handle); | 250 | addr = dma_addr_to_virt(dev, dma_handle); |
250 | __dma_sync(addr, size, direction); | 251 | __dma_sync(addr, size, direction); |
251 | } | 252 | } |
252 | } | 253 | } |
@@ -262,7 +263,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, | |||
262 | if (!plat_device_is_coherent(dev)) { | 263 | if (!plat_device_is_coherent(dev)) { |
263 | unsigned long addr; | 264 | unsigned long addr; |
264 | 265 | ||
265 | addr = dma_addr_to_virt(dma_handle); | 266 | addr = dma_addr_to_virt(dev, dma_handle); |
266 | __dma_sync(addr, size, direction); | 267 | __dma_sync(addr, size, direction); |
267 | } | 268 | } |
268 | } | 269 | } |
@@ -277,7 +278,7 @@ void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, | |||
277 | if (cpu_is_noncoherent_r10000(dev)) { | 278 | if (cpu_is_noncoherent_r10000(dev)) { |
278 | unsigned long addr; | 279 | unsigned long addr; |
279 | 280 | ||
280 | addr = dma_addr_to_virt(dma_handle); | 281 | addr = dma_addr_to_virt(dev, dma_handle); |
281 | __dma_sync(addr + offset, size, direction); | 282 | __dma_sync(addr + offset, size, direction); |
282 | } | 283 | } |
283 | } | 284 | } |
@@ -293,7 +294,7 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, | |||
293 | if (!plat_device_is_coherent(dev)) { | 294 | if (!plat_device_is_coherent(dev)) { |
294 | unsigned long addr; | 295 | unsigned long addr; |
295 | 296 | ||
296 | addr = dma_addr_to_virt(dma_handle); | 297 | addr = dma_addr_to_virt(dev, dma_handle); |
297 | __dma_sync(addr + offset, size, direction); | 298 | __dma_sync(addr + offset, size, direction); |
298 | } | 299 | } |
299 | } | 300 | } |
diff --git a/arch/mips/mm/extable.c b/arch/mips/mm/extable.c index 297fb9f390dc..9d25d2ba4b9e 100644 --- a/arch/mips/mm/extable.c +++ b/arch/mips/mm/extable.c | |||
@@ -1,5 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/mm/extable.c | 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) 1997, 99, 2001 - 2004 Ralf Baechle <ralf@linux-mips.org> | ||
3 | */ | 7 | */ |
4 | #include <linux/module.h> | 8 | #include <linux/module.h> |
5 | #include <linux/spinlock.h> | 9 | #include <linux/spinlock.h> |
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 55767ad9f00e..f956ecbb8136 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c | |||
@@ -102,7 +102,7 @@ good_area: | |||
102 | * make sure we exit gracefully rather than endlessly redo | 102 | * make sure we exit gracefully rather than endlessly redo |
103 | * the fault. | 103 | * the fault. |
104 | */ | 104 | */ |
105 | fault = handle_mm_fault(mm, vma, address, write); | 105 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); |
106 | if (unlikely(fault & VM_FAULT_ERROR)) { | 106 | if (unlikely(fault & VM_FAULT_ERROR)) { |
107 | if (fault & VM_FAULT_OOM) | 107 | if (fault & VM_FAULT_OOM) |
108 | goto out_of_memory; | 108 | goto out_of_memory; |
@@ -171,6 +171,7 @@ out_of_memory: | |||
171 | * We ran out of memory, call the OOM killer, and return the userspace | 171 | * We ran out of memory, call the OOM killer, and return the userspace |
172 | * (which will retry the fault, or kill us if we got oom-killed). | 172 | * (which will retry the fault, or kill us if we got oom-killed). |
173 | */ | 173 | */ |
174 | up_read(&mm->mmap_sem); | ||
174 | pagefault_out_of_memory(); | 175 | pagefault_out_of_memory(); |
175 | return; | 176 | return; |
176 | 177 | ||
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c index 2b1309b2580a..e274fda329f4 100644 --- a/arch/mips/mm/highmem.c +++ b/arch/mips/mm/highmem.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/module.h> | 1 | #include <linux/module.h> |
2 | #include <linux/highmem.h> | 2 | #include <linux/highmem.h> |
3 | #include <linux/smp.h> | ||
3 | #include <asm/fixmap.h> | 4 | #include <asm/fixmap.h> |
4 | #include <asm/tlbflush.h> | 5 | #include <asm/tlbflush.h> |
5 | 6 | ||
diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c new file mode 100644 index 000000000000..8c2834f5919d --- /dev/null +++ b/arch/mips/mm/hugetlbpage.c | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * MIPS Huge TLB Page Support for Kernel. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com> | ||
9 | * Copyright 2005, Embedded Alley Solutions, Inc. | ||
10 | * Matt Porter <mporter@embeddedalley.com> | ||
11 | * Copyright (C) 2008, 2009 Cavium Networks, Inc. | ||
12 | */ | ||
13 | |||
14 | #include <linux/init.h> | ||
15 | #include <linux/fs.h> | ||
16 | #include <linux/mm.h> | ||
17 | #include <linux/hugetlb.h> | ||
18 | #include <linux/pagemap.h> | ||
19 | #include <linux/slab.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/sysctl.h> | ||
22 | #include <asm/mman.h> | ||
23 | #include <asm/tlb.h> | ||
24 | #include <asm/tlbflush.h> | ||
25 | |||
26 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, | ||
27 | unsigned long sz) | ||
28 | { | ||
29 | pgd_t *pgd; | ||
30 | pud_t *pud; | ||
31 | pte_t *pte = NULL; | ||
32 | |||
33 | pgd = pgd_offset(mm, addr); | ||
34 | pud = pud_alloc(mm, pgd, addr); | ||
35 | if (pud) | ||
36 | pte = (pte_t *)pmd_alloc(mm, pud, addr); | ||
37 | |||
38 | return pte; | ||
39 | } | ||
40 | |||
41 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr) | ||
42 | { | ||
43 | pgd_t *pgd; | ||
44 | pud_t *pud; | ||
45 | pmd_t *pmd = NULL; | ||
46 | |||
47 | pgd = pgd_offset(mm, addr); | ||
48 | if (pgd_present(*pgd)) { | ||
49 | pud = pud_offset(pgd, addr); | ||
50 | if (pud_present(*pud)) | ||
51 | pmd = pmd_offset(pud, addr); | ||
52 | } | ||
53 | return (pte_t *) pmd; | ||
54 | } | ||
55 | |||
56 | int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep) | ||
57 | { | ||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | /* | ||
62 | * This function checks for proper alignment of input addr and len parameters. | ||
63 | */ | ||
64 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len) | ||
65 | { | ||
66 | if (len & ~HPAGE_MASK) | ||
67 | return -EINVAL; | ||
68 | if (addr & ~HPAGE_MASK) | ||
69 | return -EINVAL; | ||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | struct page * | ||
74 | follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) | ||
75 | { | ||
76 | return ERR_PTR(-EINVAL); | ||
77 | } | ||
78 | |||
79 | int pmd_huge(pmd_t pmd) | ||
80 | { | ||
81 | return (pmd_val(pmd) & _PAGE_HUGE) != 0; | ||
82 | } | ||
83 | |||
84 | int pud_huge(pud_t pud) | ||
85 | { | ||
86 | return (pud_val(pud) & _PAGE_HUGE) != 0; | ||
87 | } | ||
88 | |||
89 | struct page * | ||
90 | follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
91 | pmd_t *pmd, int write) | ||
92 | { | ||
93 | struct page *page; | ||
94 | |||
95 | page = pte_page(*(pte_t *)pmd); | ||
96 | if (page) | ||
97 | page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT); | ||
98 | return page; | ||
99 | } | ||
100 | |||
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index c5511294a9ee..0e820508ff23 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/signal.h> | 14 | #include <linux/signal.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/smp.h> | ||
16 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
17 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
18 | #include <linux/string.h> | 19 | #include <linux/string.h> |
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c index 48060c635acd..f5c73754d664 100644 --- a/arch/mips/mm/page.c +++ b/arch/mips/mm/page.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/smp.h> | ||
13 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/proc_fs.h> | 16 | #include <linux/proc_fs.h> |
diff --git a/arch/mips/mm/tlb-r3k.c b/arch/mips/mm/tlb-r3k.c index 1c0048a6f5cf..0f5ab236ab69 100644 --- a/arch/mips/mm/tlb-r3k.c +++ b/arch/mips/mm/tlb-r3k.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/smp.h> | ||
16 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
17 | 18 | ||
18 | #include <asm/page.h> | 19 | #include <asm/page.h> |
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c index 892be426787c..cee502caf398 100644 --- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c | |||
@@ -10,7 +10,9 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/smp.h> | ||
13 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
15 | #include <linux/hugetlb.h> | ||
14 | 16 | ||
15 | #include <asm/cpu.h> | 17 | #include <asm/cpu.h> |
16 | #include <asm/bootinfo.h> | 18 | #include <asm/bootinfo.h> |
@@ -295,21 +297,41 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte) | |||
295 | pudp = pud_offset(pgdp, address); | 297 | pudp = pud_offset(pgdp, address); |
296 | pmdp = pmd_offset(pudp, address); | 298 | pmdp = pmd_offset(pudp, address); |
297 | idx = read_c0_index(); | 299 | idx = read_c0_index(); |
298 | ptep = pte_offset_map(pmdp, address); | 300 | #ifdef CONFIG_HUGETLB_PAGE |
301 | /* this could be a huge page */ | ||
302 | if (pmd_huge(*pmdp)) { | ||
303 | unsigned long lo; | ||
304 | write_c0_pagemask(PM_HUGE_MASK); | ||
305 | ptep = (pte_t *)pmdp; | ||
306 | lo = pte_val(*ptep) >> 6; | ||
307 | write_c0_entrylo0(lo); | ||
308 | write_c0_entrylo1(lo + (HPAGE_SIZE >> 7)); | ||
309 | |||
310 | mtc0_tlbw_hazard(); | ||
311 | if (idx < 0) | ||
312 | tlb_write_random(); | ||
313 | else | ||
314 | tlb_write_indexed(); | ||
315 | write_c0_pagemask(PM_DEFAULT_MASK); | ||
316 | } else | ||
317 | #endif | ||
318 | { | ||
319 | ptep = pte_offset_map(pmdp, address); | ||
299 | 320 | ||
300 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) | 321 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) |
301 | write_c0_entrylo0(ptep->pte_high); | 322 | write_c0_entrylo0(ptep->pte_high); |
302 | ptep++; | 323 | ptep++; |
303 | write_c0_entrylo1(ptep->pte_high); | 324 | write_c0_entrylo1(ptep->pte_high); |
304 | #else | 325 | #else |
305 | write_c0_entrylo0(pte_val(*ptep++) >> 6); | 326 | write_c0_entrylo0(pte_val(*ptep++) >> 6); |
306 | write_c0_entrylo1(pte_val(*ptep) >> 6); | 327 | write_c0_entrylo1(pte_val(*ptep) >> 6); |
307 | #endif | 328 | #endif |
308 | mtc0_tlbw_hazard(); | 329 | mtc0_tlbw_hazard(); |
309 | if (idx < 0) | 330 | if (idx < 0) |
310 | tlb_write_random(); | 331 | tlb_write_random(); |
311 | else | 332 | else |
312 | tlb_write_indexed(); | 333 | tlb_write_indexed(); |
334 | } | ||
313 | tlbw_use_hazard(); | 335 | tlbw_use_hazard(); |
314 | FLUSH_ITLB_VM(vma); | 336 | FLUSH_ITLB_VM(vma); |
315 | EXIT_CRITICAL(flags); | 337 | EXIT_CRITICAL(flags); |
diff --git a/arch/mips/mm/tlb-r8k.c b/arch/mips/mm/tlb-r8k.c index 4ec95cc2df2f..2b82f23df1a1 100644 --- a/arch/mips/mm/tlb-r8k.c +++ b/arch/mips/mm/tlb-r8k.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/smp.h> | ||
13 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
14 | 15 | ||
15 | #include <asm/cpu.h> | 16 | #include <asm/cpu.h> |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 0615b62efd6d..9a17bf8395df 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -6,8 +6,9 @@ | |||
6 | * Synthesize TLB refill handlers at runtime. | 6 | * Synthesize TLB refill handlers at runtime. |
7 | * | 7 | * |
8 | * Copyright (C) 2004, 2005, 2006, 2008 Thiemo Seufer | 8 | * Copyright (C) 2004, 2005, 2006, 2008 Thiemo Seufer |
9 | * Copyright (C) 2005, 2007 Maciej W. Rozycki | 9 | * Copyright (C) 2005, 2007, 2008, 2009 Maciej W. Rozycki |
10 | * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) | 10 | * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) |
11 | * Copyright (C) 2008, 2009 Cavium Networks, Inc. | ||
11 | * | 12 | * |
12 | * ... and the days got worse and worse and now you see | 13 | * ... and the days got worse and worse and now you see |
13 | * I've gone completly out of my mind. | 14 | * I've gone completly out of my mind. |
@@ -19,8 +20,10 @@ | |||
19 | * (Condolences to Napoleon XIV) | 20 | * (Condolences to Napoleon XIV) |
20 | */ | 21 | */ |
21 | 22 | ||
23 | #include <linux/bug.h> | ||
22 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
23 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/smp.h> | ||
24 | #include <linux/string.h> | 27 | #include <linux/string.h> |
25 | #include <linux/init.h> | 28 | #include <linux/init.h> |
26 | 29 | ||
@@ -82,6 +85,9 @@ enum label_id { | |||
82 | label_nopage_tlbm, | 85 | label_nopage_tlbm, |
83 | label_smp_pgtable_change, | 86 | label_smp_pgtable_change, |
84 | label_r3000_write_probe_fail, | 87 | label_r3000_write_probe_fail, |
88 | #ifdef CONFIG_HUGETLB_PAGE | ||
89 | label_tlb_huge_update, | ||
90 | #endif | ||
85 | }; | 91 | }; |
86 | 92 | ||
87 | UASM_L_LA(_second_part) | 93 | UASM_L_LA(_second_part) |
@@ -98,6 +104,9 @@ UASM_L_LA(_nopage_tlbs) | |||
98 | UASM_L_LA(_nopage_tlbm) | 104 | UASM_L_LA(_nopage_tlbm) |
99 | UASM_L_LA(_smp_pgtable_change) | 105 | UASM_L_LA(_smp_pgtable_change) |
100 | UASM_L_LA(_r3000_write_probe_fail) | 106 | UASM_L_LA(_r3000_write_probe_fail) |
107 | #ifdef CONFIG_HUGETLB_PAGE | ||
108 | UASM_L_LA(_tlb_huge_update) | ||
109 | #endif | ||
101 | 110 | ||
102 | /* | 111 | /* |
103 | * For debug purposes. | 112 | * For debug purposes. |
@@ -125,6 +134,7 @@ static inline void dump_handler(const u32 *handler, int count) | |||
125 | #define C0_TCBIND 2, 2 | 134 | #define C0_TCBIND 2, 2 |
126 | #define C0_ENTRYLO1 3, 0 | 135 | #define C0_ENTRYLO1 3, 0 |
127 | #define C0_CONTEXT 4, 0 | 136 | #define C0_CONTEXT 4, 0 |
137 | #define C0_PAGEMASK 5, 0 | ||
128 | #define C0_BADVADDR 8, 0 | 138 | #define C0_BADVADDR 8, 0 |
129 | #define C0_ENTRYHI 10, 0 | 139 | #define C0_ENTRYHI 10, 0 |
130 | #define C0_EPC 14, 0 | 140 | #define C0_EPC 14, 0 |
@@ -258,7 +268,8 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, | |||
258 | } | 268 | } |
259 | 269 | ||
260 | if (cpu_has_mips_r2) { | 270 | if (cpu_has_mips_r2) { |
261 | uasm_i_ehb(p); | 271 | if (cpu_has_mips_r2_exec_hazard) |
272 | uasm_i_ehb(p); | ||
262 | tlbw(p); | 273 | tlbw(p); |
263 | return; | 274 | return; |
264 | } | 275 | } |
@@ -310,7 +321,6 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, | |||
310 | case CPU_BCM3302: | 321 | case CPU_BCM3302: |
311 | case CPU_BCM4710: | 322 | case CPU_BCM4710: |
312 | case CPU_LOONGSON2: | 323 | case CPU_LOONGSON2: |
313 | case CPU_CAVIUM_OCTEON: | ||
314 | case CPU_R5500: | 324 | case CPU_R5500: |
315 | if (m4kc_tlbp_war()) | 325 | if (m4kc_tlbp_war()) |
316 | uasm_i_nop(p); | 326 | uasm_i_nop(p); |
@@ -382,6 +392,98 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l, | |||
382 | } | 392 | } |
383 | } | 393 | } |
384 | 394 | ||
395 | #ifdef CONFIG_HUGETLB_PAGE | ||
396 | static __cpuinit void build_huge_tlb_write_entry(u32 **p, | ||
397 | struct uasm_label **l, | ||
398 | struct uasm_reloc **r, | ||
399 | unsigned int tmp, | ||
400 | enum tlb_write_entry wmode) | ||
401 | { | ||
402 | /* Set huge page tlb entry size */ | ||
403 | uasm_i_lui(p, tmp, PM_HUGE_MASK >> 16); | ||
404 | uasm_i_ori(p, tmp, tmp, PM_HUGE_MASK & 0xffff); | ||
405 | uasm_i_mtc0(p, tmp, C0_PAGEMASK); | ||
406 | |||
407 | build_tlb_write_entry(p, l, r, wmode); | ||
408 | |||
409 | /* Reset default page size */ | ||
410 | if (PM_DEFAULT_MASK >> 16) { | ||
411 | uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16); | ||
412 | uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff); | ||
413 | uasm_il_b(p, r, label_leave); | ||
414 | uasm_i_mtc0(p, tmp, C0_PAGEMASK); | ||
415 | } else if (PM_DEFAULT_MASK) { | ||
416 | uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK); | ||
417 | uasm_il_b(p, r, label_leave); | ||
418 | uasm_i_mtc0(p, tmp, C0_PAGEMASK); | ||
419 | } else { | ||
420 | uasm_il_b(p, r, label_leave); | ||
421 | uasm_i_mtc0(p, 0, C0_PAGEMASK); | ||
422 | } | ||
423 | } | ||
424 | |||
425 | /* | ||
426 | * Check if Huge PTE is present, if so then jump to LABEL. | ||
427 | */ | ||
428 | static void __cpuinit | ||
429 | build_is_huge_pte(u32 **p, struct uasm_reloc **r, unsigned int tmp, | ||
430 | unsigned int pmd, int lid) | ||
431 | { | ||
432 | UASM_i_LW(p, tmp, 0, pmd); | ||
433 | uasm_i_andi(p, tmp, tmp, _PAGE_HUGE); | ||
434 | uasm_il_bnez(p, r, tmp, lid); | ||
435 | } | ||
436 | |||
437 | static __cpuinit void build_huge_update_entries(u32 **p, | ||
438 | unsigned int pte, | ||
439 | unsigned int tmp) | ||
440 | { | ||
441 | int small_sequence; | ||
442 | |||
443 | /* | ||
444 | * A huge PTE describes an area the size of the | ||
445 | * configured huge page size. This is twice the | ||
446 | * of the large TLB entry size we intend to use. | ||
447 | * A TLB entry half the size of the configured | ||
448 | * huge page size is configured into entrylo0 | ||
449 | * and entrylo1 to cover the contiguous huge PTE | ||
450 | * address space. | ||
451 | */ | ||
452 | small_sequence = (HPAGE_SIZE >> 7) < 0x10000; | ||
453 | |||
454 | /* We can clobber tmp. It isn't used after this.*/ | ||
455 | if (!small_sequence) | ||
456 | uasm_i_lui(p, tmp, HPAGE_SIZE >> (7 + 16)); | ||
457 | |||
458 | UASM_i_SRL(p, pte, pte, 6); /* convert to entrylo */ | ||
459 | uasm_i_mtc0(p, pte, C0_ENTRYLO0); /* load it */ | ||
460 | /* convert to entrylo1 */ | ||
461 | if (small_sequence) | ||
462 | UASM_i_ADDIU(p, pte, pte, HPAGE_SIZE >> 7); | ||
463 | else | ||
464 | UASM_i_ADDU(p, pte, pte, tmp); | ||
465 | |||
466 | uasm_i_mtc0(p, pte, C0_ENTRYLO1); /* load it */ | ||
467 | } | ||
468 | |||
469 | static __cpuinit void build_huge_handler_tail(u32 **p, | ||
470 | struct uasm_reloc **r, | ||
471 | struct uasm_label **l, | ||
472 | unsigned int pte, | ||
473 | unsigned int ptr) | ||
474 | { | ||
475 | #ifdef CONFIG_SMP | ||
476 | UASM_i_SC(p, pte, 0, ptr); | ||
477 | uasm_il_beqz(p, r, pte, label_tlb_huge_update); | ||
478 | UASM_i_LW(p, pte, 0, ptr); /* Needed because SC killed our PTE */ | ||
479 | #else | ||
480 | UASM_i_SW(p, pte, 0, ptr); | ||
481 | #endif | ||
482 | build_huge_update_entries(p, pte, ptr); | ||
483 | build_huge_tlb_write_entry(p, l, r, pte, tlb_indexed); | ||
484 | } | ||
485 | #endif /* CONFIG_HUGETLB_PAGE */ | ||
486 | |||
385 | #ifdef CONFIG_64BIT | 487 | #ifdef CONFIG_64BIT |
386 | /* | 488 | /* |
387 | * TMP and PTR are scratch. | 489 | * TMP and PTR are scratch. |
@@ -649,6 +751,14 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp, | |||
649 | #endif | 751 | #endif |
650 | } | 752 | } |
651 | 753 | ||
754 | /* | ||
755 | * For a 64-bit kernel, we are using the 64-bit XTLB refill exception | ||
756 | * because EXL == 0. If we wrap, we can also use the 32 instruction | ||
757 | * slots before the XTLB refill exception handler which belong to the | ||
758 | * unused TLB refill exception. | ||
759 | */ | ||
760 | #define MIPS64_REFILL_INSNS 32 | ||
761 | |||
652 | static void __cpuinit build_r4000_tlb_refill_handler(void) | 762 | static void __cpuinit build_r4000_tlb_refill_handler(void) |
653 | { | 763 | { |
654 | u32 *p = tlb_handler; | 764 | u32 *p = tlb_handler; |
@@ -680,12 +790,23 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) | |||
680 | build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ | 790 | build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ |
681 | #endif | 791 | #endif |
682 | 792 | ||
793 | #ifdef CONFIG_HUGETLB_PAGE | ||
794 | build_is_huge_pte(&p, &r, K0, K1, label_tlb_huge_update); | ||
795 | #endif | ||
796 | |||
683 | build_get_ptep(&p, K0, K1); | 797 | build_get_ptep(&p, K0, K1); |
684 | build_update_entries(&p, K0, K1); | 798 | build_update_entries(&p, K0, K1); |
685 | build_tlb_write_entry(&p, &l, &r, tlb_random); | 799 | build_tlb_write_entry(&p, &l, &r, tlb_random); |
686 | uasm_l_leave(&l, p); | 800 | uasm_l_leave(&l, p); |
687 | uasm_i_eret(&p); /* return from trap */ | 801 | uasm_i_eret(&p); /* return from trap */ |
688 | 802 | ||
803 | #ifdef CONFIG_HUGETLB_PAGE | ||
804 | uasm_l_tlb_huge_update(&l, p); | ||
805 | UASM_i_LW(&p, K0, 0, K1); | ||
806 | build_huge_update_entries(&p, K0, K1); | ||
807 | build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random); | ||
808 | #endif | ||
809 | |||
689 | #ifdef CONFIG_64BIT | 810 | #ifdef CONFIG_64BIT |
690 | build_get_pgd_vmalloc64(&p, &l, &r, K0, K1); | 811 | build_get_pgd_vmalloc64(&p, &l, &r, K0, K1); |
691 | #endif | 812 | #endif |
@@ -702,9 +823,10 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) | |||
702 | if ((p - tlb_handler) > 64) | 823 | if ((p - tlb_handler) > 64) |
703 | panic("TLB refill handler space exceeded"); | 824 | panic("TLB refill handler space exceeded"); |
704 | #else | 825 | #else |
705 | if (((p - tlb_handler) > 63) | 826 | if (((p - tlb_handler) > (MIPS64_REFILL_INSNS * 2) - 1) |
706 | || (((p - tlb_handler) > 61) | 827 | || (((p - tlb_handler) > (MIPS64_REFILL_INSNS * 2) - 3) |
707 | && uasm_insn_has_bdelay(relocs, tlb_handler + 29))) | 828 | && uasm_insn_has_bdelay(relocs, |
829 | tlb_handler + MIPS64_REFILL_INSNS - 3))) | ||
708 | panic("TLB refill handler space exceeded"); | 830 | panic("TLB refill handler space exceeded"); |
709 | #endif | 831 | #endif |
710 | 832 | ||
@@ -717,39 +839,74 @@ static void __cpuinit build_r4000_tlb_refill_handler(void) | |||
717 | uasm_copy_handler(relocs, labels, tlb_handler, p, f); | 839 | uasm_copy_handler(relocs, labels, tlb_handler, p, f); |
718 | final_len = p - tlb_handler; | 840 | final_len = p - tlb_handler; |
719 | #else /* CONFIG_64BIT */ | 841 | #else /* CONFIG_64BIT */ |
720 | f = final_handler + 32; | 842 | f = final_handler + MIPS64_REFILL_INSNS; |
721 | if ((p - tlb_handler) <= 32) { | 843 | if ((p - tlb_handler) <= MIPS64_REFILL_INSNS) { |
722 | /* Just copy the handler. */ | 844 | /* Just copy the handler. */ |
723 | uasm_copy_handler(relocs, labels, tlb_handler, p, f); | 845 | uasm_copy_handler(relocs, labels, tlb_handler, p, f); |
724 | final_len = p - tlb_handler; | 846 | final_len = p - tlb_handler; |
725 | } else { | 847 | } else { |
726 | u32 *split = tlb_handler + 30; | 848 | #if defined(CONFIG_HUGETLB_PAGE) |
849 | const enum label_id ls = label_tlb_huge_update; | ||
850 | #elif defined(MODULE_START) | ||
851 | const enum label_id ls = label_module_alloc; | ||
852 | #else | ||
853 | const enum label_id ls = label_vmalloc; | ||
854 | #endif | ||
855 | u32 *split; | ||
856 | int ov = 0; | ||
857 | int i; | ||
858 | |||
859 | for (i = 0; i < ARRAY_SIZE(labels) && labels[i].lab != ls; i++) | ||
860 | ; | ||
861 | BUG_ON(i == ARRAY_SIZE(labels)); | ||
862 | split = labels[i].addr; | ||
727 | 863 | ||
728 | /* | 864 | /* |
729 | * Find the split point. | 865 | * See if we have overflown one way or the other. |
730 | */ | 866 | */ |
731 | if (uasm_insn_has_bdelay(relocs, split - 1)) | 867 | if (split > tlb_handler + MIPS64_REFILL_INSNS || |
732 | split--; | 868 | split < p - MIPS64_REFILL_INSNS) |
733 | 869 | ov = 1; | |
870 | |||
871 | if (ov) { | ||
872 | /* | ||
873 | * Split two instructions before the end. One | ||
874 | * for the branch and one for the instruction | ||
875 | * in the delay slot. | ||
876 | */ | ||
877 | split = tlb_handler + MIPS64_REFILL_INSNS - 2; | ||
878 | |||
879 | /* | ||
880 | * If the branch would fall in a delay slot, | ||
881 | * we must back up an additional instruction | ||
882 | * so that it is no longer in a delay slot. | ||
883 | */ | ||
884 | if (uasm_insn_has_bdelay(relocs, split - 1)) | ||
885 | split--; | ||
886 | } | ||
734 | /* Copy first part of the handler. */ | 887 | /* Copy first part of the handler. */ |
735 | uasm_copy_handler(relocs, labels, tlb_handler, split, f); | 888 | uasm_copy_handler(relocs, labels, tlb_handler, split, f); |
736 | f += split - tlb_handler; | 889 | f += split - tlb_handler; |
737 | 890 | ||
738 | /* Insert branch. */ | 891 | if (ov) { |
739 | uasm_l_split(&l, final_handler); | 892 | /* Insert branch. */ |
740 | uasm_il_b(&f, &r, label_split); | 893 | uasm_l_split(&l, final_handler); |
741 | if (uasm_insn_has_bdelay(relocs, split)) | 894 | uasm_il_b(&f, &r, label_split); |
742 | uasm_i_nop(&f); | 895 | if (uasm_insn_has_bdelay(relocs, split)) |
743 | else { | 896 | uasm_i_nop(&f); |
744 | uasm_copy_handler(relocs, labels, split, split + 1, f); | 897 | else { |
745 | uasm_move_labels(labels, f, f + 1, -1); | 898 | uasm_copy_handler(relocs, labels, |
746 | f++; | 899 | split, split + 1, f); |
747 | split++; | 900 | uasm_move_labels(labels, f, f + 1, -1); |
901 | f++; | ||
902 | split++; | ||
903 | } | ||
748 | } | 904 | } |
749 | 905 | ||
750 | /* Copy the rest of the handler. */ | 906 | /* Copy the rest of the handler. */ |
751 | uasm_copy_handler(relocs, labels, split, p, final_handler); | 907 | uasm_copy_handler(relocs, labels, split, p, final_handler); |
752 | final_len = (f - (final_handler + 32)) + (p - split); | 908 | final_len = (f - (final_handler + MIPS64_REFILL_INSNS)) + |
909 | (p - split); | ||
753 | } | 910 | } |
754 | #endif /* CONFIG_64BIT */ | 911 | #endif /* CONFIG_64BIT */ |
755 | 912 | ||
@@ -782,7 +939,7 @@ u32 handle_tlbs[FASTPATH_SIZE] __cacheline_aligned; | |||
782 | u32 handle_tlbm[FASTPATH_SIZE] __cacheline_aligned; | 939 | u32 handle_tlbm[FASTPATH_SIZE] __cacheline_aligned; |
783 | 940 | ||
784 | static void __cpuinit | 941 | static void __cpuinit |
785 | iPTE_LW(u32 **p, struct uasm_label **l, unsigned int pte, unsigned int ptr) | 942 | iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr) |
786 | { | 943 | { |
787 | #ifdef CONFIG_SMP | 944 | #ifdef CONFIG_SMP |
788 | # ifdef CONFIG_64BIT_PHYS_ADDR | 945 | # ifdef CONFIG_64BIT_PHYS_ADDR |
@@ -862,13 +1019,13 @@ iPTE_SW(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr, | |||
862 | * with it's original value. | 1019 | * with it's original value. |
863 | */ | 1020 | */ |
864 | static void __cpuinit | 1021 | static void __cpuinit |
865 | build_pte_present(u32 **p, struct uasm_label **l, struct uasm_reloc **r, | 1022 | build_pte_present(u32 **p, struct uasm_reloc **r, |
866 | unsigned int pte, unsigned int ptr, enum label_id lid) | 1023 | unsigned int pte, unsigned int ptr, enum label_id lid) |
867 | { | 1024 | { |
868 | uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); | 1025 | uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); |
869 | uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); | 1026 | uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); |
870 | uasm_il_bnez(p, r, pte, lid); | 1027 | uasm_il_bnez(p, r, pte, lid); |
871 | iPTE_LW(p, l, pte, ptr); | 1028 | iPTE_LW(p, pte, ptr); |
872 | } | 1029 | } |
873 | 1030 | ||
874 | /* Make PTE valid, store result in PTR. */ | 1031 | /* Make PTE valid, store result in PTR. */ |
@@ -886,13 +1043,13 @@ build_make_valid(u32 **p, struct uasm_reloc **r, unsigned int pte, | |||
886 | * restore PTE with value from PTR when done. | 1043 | * restore PTE with value from PTR when done. |
887 | */ | 1044 | */ |
888 | static void __cpuinit | 1045 | static void __cpuinit |
889 | build_pte_writable(u32 **p, struct uasm_label **l, struct uasm_reloc **r, | 1046 | build_pte_writable(u32 **p, struct uasm_reloc **r, |
890 | unsigned int pte, unsigned int ptr, enum label_id lid) | 1047 | unsigned int pte, unsigned int ptr, enum label_id lid) |
891 | { | 1048 | { |
892 | uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); | 1049 | uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); |
893 | uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); | 1050 | uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); |
894 | uasm_il_bnez(p, r, pte, lid); | 1051 | uasm_il_bnez(p, r, pte, lid); |
895 | iPTE_LW(p, l, pte, ptr); | 1052 | iPTE_LW(p, pte, ptr); |
896 | } | 1053 | } |
897 | 1054 | ||
898 | /* Make PTE writable, update software status bits as well, then store | 1055 | /* Make PTE writable, update software status bits as well, then store |
@@ -913,12 +1070,12 @@ build_make_write(u32 **p, struct uasm_reloc **r, unsigned int pte, | |||
913 | * restore PTE with value from PTR when done. | 1070 | * restore PTE with value from PTR when done. |
914 | */ | 1071 | */ |
915 | static void __cpuinit | 1072 | static void __cpuinit |
916 | build_pte_modifiable(u32 **p, struct uasm_label **l, struct uasm_reloc **r, | 1073 | build_pte_modifiable(u32 **p, struct uasm_reloc **r, |
917 | unsigned int pte, unsigned int ptr, enum label_id lid) | 1074 | unsigned int pte, unsigned int ptr, enum label_id lid) |
918 | { | 1075 | { |
919 | uasm_i_andi(p, pte, pte, _PAGE_WRITE); | 1076 | uasm_i_andi(p, pte, pte, _PAGE_WRITE); |
920 | uasm_il_beqz(p, r, pte, lid); | 1077 | uasm_il_beqz(p, r, pte, lid); |
921 | iPTE_LW(p, l, pte, ptr); | 1078 | iPTE_LW(p, pte, ptr); |
922 | } | 1079 | } |
923 | 1080 | ||
924 | /* | 1081 | /* |
@@ -994,7 +1151,7 @@ static void __cpuinit build_r3000_tlb_load_handler(void) | |||
994 | memset(relocs, 0, sizeof(relocs)); | 1151 | memset(relocs, 0, sizeof(relocs)); |
995 | 1152 | ||
996 | build_r3000_tlbchange_handler_head(&p, K0, K1); | 1153 | build_r3000_tlbchange_handler_head(&p, K0, K1); |
997 | build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); | 1154 | build_pte_present(&p, &r, K0, K1, label_nopage_tlbl); |
998 | uasm_i_nop(&p); /* load delay */ | 1155 | uasm_i_nop(&p); /* load delay */ |
999 | build_make_valid(&p, &r, K0, K1); | 1156 | build_make_valid(&p, &r, K0, K1); |
1000 | build_r3000_tlb_reload_write(&p, &l, &r, K0, K1); | 1157 | build_r3000_tlb_reload_write(&p, &l, &r, K0, K1); |
@@ -1024,7 +1181,7 @@ static void __cpuinit build_r3000_tlb_store_handler(void) | |||
1024 | memset(relocs, 0, sizeof(relocs)); | 1181 | memset(relocs, 0, sizeof(relocs)); |
1025 | 1182 | ||
1026 | build_r3000_tlbchange_handler_head(&p, K0, K1); | 1183 | build_r3000_tlbchange_handler_head(&p, K0, K1); |
1027 | build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); | 1184 | build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs); |
1028 | uasm_i_nop(&p); /* load delay */ | 1185 | uasm_i_nop(&p); /* load delay */ |
1029 | build_make_write(&p, &r, K0, K1); | 1186 | build_make_write(&p, &r, K0, K1); |
1030 | build_r3000_tlb_reload_write(&p, &l, &r, K0, K1); | 1187 | build_r3000_tlb_reload_write(&p, &l, &r, K0, K1); |
@@ -1054,7 +1211,7 @@ static void __cpuinit build_r3000_tlb_modify_handler(void) | |||
1054 | memset(relocs, 0, sizeof(relocs)); | 1211 | memset(relocs, 0, sizeof(relocs)); |
1055 | 1212 | ||
1056 | build_r3000_tlbchange_handler_head(&p, K0, K1); | 1213 | build_r3000_tlbchange_handler_head(&p, K0, K1); |
1057 | build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); | 1214 | build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm); |
1058 | uasm_i_nop(&p); /* load delay */ | 1215 | uasm_i_nop(&p); /* load delay */ |
1059 | build_make_write(&p, &r, K0, K1); | 1216 | build_make_write(&p, &r, K0, K1); |
1060 | build_r3000_pte_reload_tlbwi(&p, K0, K1); | 1217 | build_r3000_pte_reload_tlbwi(&p, K0, K1); |
@@ -1087,6 +1244,15 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l, | |||
1087 | build_get_pgde32(p, pte, ptr); /* get pgd in ptr */ | 1244 | build_get_pgde32(p, pte, ptr); /* get pgd in ptr */ |
1088 | #endif | 1245 | #endif |
1089 | 1246 | ||
1247 | #ifdef CONFIG_HUGETLB_PAGE | ||
1248 | /* | ||
1249 | * For huge tlb entries, pmd doesn't contain an address but | ||
1250 | * instead contains the tlb pte. Check the PAGE_HUGE bit and | ||
1251 | * see if we need to jump to huge tlb processing. | ||
1252 | */ | ||
1253 | build_is_huge_pte(p, r, pte, ptr, label_tlb_huge_update); | ||
1254 | #endif | ||
1255 | |||
1090 | UASM_i_MFC0(p, pte, C0_BADVADDR); | 1256 | UASM_i_MFC0(p, pte, C0_BADVADDR); |
1091 | UASM_i_LW(p, ptr, 0, ptr); | 1257 | UASM_i_LW(p, ptr, 0, ptr); |
1092 | UASM_i_SRL(p, pte, pte, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2); | 1258 | UASM_i_SRL(p, pte, pte, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2); |
@@ -1096,7 +1262,7 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l, | |||
1096 | #ifdef CONFIG_SMP | 1262 | #ifdef CONFIG_SMP |
1097 | uasm_l_smp_pgtable_change(l, *p); | 1263 | uasm_l_smp_pgtable_change(l, *p); |
1098 | #endif | 1264 | #endif |
1099 | iPTE_LW(p, l, pte, ptr); /* get even pte */ | 1265 | iPTE_LW(p, pte, ptr); /* get even pte */ |
1100 | if (!m4kc_tlbp_war()) | 1266 | if (!m4kc_tlbp_war()) |
1101 | build_tlb_probe_entry(p); | 1267 | build_tlb_probe_entry(p); |
1102 | } | 1268 | } |
@@ -1138,12 +1304,25 @@ static void __cpuinit build_r4000_tlb_load_handler(void) | |||
1138 | } | 1304 | } |
1139 | 1305 | ||
1140 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); | 1306 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); |
1141 | build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); | 1307 | build_pte_present(&p, &r, K0, K1, label_nopage_tlbl); |
1142 | if (m4kc_tlbp_war()) | 1308 | if (m4kc_tlbp_war()) |
1143 | build_tlb_probe_entry(&p); | 1309 | build_tlb_probe_entry(&p); |
1144 | build_make_valid(&p, &r, K0, K1); | 1310 | build_make_valid(&p, &r, K0, K1); |
1145 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); | 1311 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); |
1146 | 1312 | ||
1313 | #ifdef CONFIG_HUGETLB_PAGE | ||
1314 | /* | ||
1315 | * This is the entry point when build_r4000_tlbchange_handler_head | ||
1316 | * spots a huge page. | ||
1317 | */ | ||
1318 | uasm_l_tlb_huge_update(&l, p); | ||
1319 | iPTE_LW(&p, K0, K1); | ||
1320 | build_pte_present(&p, &r, K0, K1, label_nopage_tlbl); | ||
1321 | build_tlb_probe_entry(&p); | ||
1322 | uasm_i_ori(&p, K0, K0, (_PAGE_ACCESSED | _PAGE_VALID)); | ||
1323 | build_huge_handler_tail(&p, &r, &l, K0, K1); | ||
1324 | #endif | ||
1325 | |||
1147 | uasm_l_nopage_tlbl(&l, p); | 1326 | uasm_l_nopage_tlbl(&l, p); |
1148 | uasm_i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); | 1327 | uasm_i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); |
1149 | uasm_i_nop(&p); | 1328 | uasm_i_nop(&p); |
@@ -1169,12 +1348,26 @@ static void __cpuinit build_r4000_tlb_store_handler(void) | |||
1169 | memset(relocs, 0, sizeof(relocs)); | 1348 | memset(relocs, 0, sizeof(relocs)); |
1170 | 1349 | ||
1171 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); | 1350 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); |
1172 | build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); | 1351 | build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs); |
1173 | if (m4kc_tlbp_war()) | 1352 | if (m4kc_tlbp_war()) |
1174 | build_tlb_probe_entry(&p); | 1353 | build_tlb_probe_entry(&p); |
1175 | build_make_write(&p, &r, K0, K1); | 1354 | build_make_write(&p, &r, K0, K1); |
1176 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); | 1355 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); |
1177 | 1356 | ||
1357 | #ifdef CONFIG_HUGETLB_PAGE | ||
1358 | /* | ||
1359 | * This is the entry point when | ||
1360 | * build_r4000_tlbchange_handler_head spots a huge page. | ||
1361 | */ | ||
1362 | uasm_l_tlb_huge_update(&l, p); | ||
1363 | iPTE_LW(&p, K0, K1); | ||
1364 | build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs); | ||
1365 | build_tlb_probe_entry(&p); | ||
1366 | uasm_i_ori(&p, K0, K0, | ||
1367 | _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY); | ||
1368 | build_huge_handler_tail(&p, &r, &l, K0, K1); | ||
1369 | #endif | ||
1370 | |||
1178 | uasm_l_nopage_tlbs(&l, p); | 1371 | uasm_l_nopage_tlbs(&l, p); |
1179 | uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); | 1372 | uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); |
1180 | uasm_i_nop(&p); | 1373 | uasm_i_nop(&p); |
@@ -1200,13 +1393,27 @@ static void __cpuinit build_r4000_tlb_modify_handler(void) | |||
1200 | memset(relocs, 0, sizeof(relocs)); | 1393 | memset(relocs, 0, sizeof(relocs)); |
1201 | 1394 | ||
1202 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); | 1395 | build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); |
1203 | build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); | 1396 | build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm); |
1204 | if (m4kc_tlbp_war()) | 1397 | if (m4kc_tlbp_war()) |
1205 | build_tlb_probe_entry(&p); | 1398 | build_tlb_probe_entry(&p); |
1206 | /* Present and writable bits set, set accessed and dirty bits. */ | 1399 | /* Present and writable bits set, set accessed and dirty bits. */ |
1207 | build_make_write(&p, &r, K0, K1); | 1400 | build_make_write(&p, &r, K0, K1); |
1208 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); | 1401 | build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); |
1209 | 1402 | ||
1403 | #ifdef CONFIG_HUGETLB_PAGE | ||
1404 | /* | ||
1405 | * This is the entry point when | ||
1406 | * build_r4000_tlbchange_handler_head spots a huge page. | ||
1407 | */ | ||
1408 | uasm_l_tlb_huge_update(&l, p); | ||
1409 | iPTE_LW(&p, K0, K1); | ||
1410 | build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm); | ||
1411 | build_tlb_probe_entry(&p); | ||
1412 | uasm_i_ori(&p, K0, K0, | ||
1413 | _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY); | ||
1414 | build_huge_handler_tail(&p, &r, &l, K0, K1); | ||
1415 | #endif | ||
1416 | |||
1210 | uasm_l_nopage_tlbm(&l, p); | 1417 | uasm_l_nopage_tlbm(&l, p); |
1211 | uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); | 1418 | uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); |
1212 | uasm_i_nop(&p); | 1419 | uasm_i_nop(&p); |
diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c index 475038a141a6..27c807b67fea 100644 --- a/arch/mips/mti-malta/malta-init.c +++ b/arch/mips/mti-malta/malta-init.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/cacheflush.h> | 30 | #include <asm/cacheflush.h> |
31 | #include <asm/traps.h> | 31 | #include <asm/traps.h> |
32 | 32 | ||
33 | #include <asm/gcmpregs.h> | ||
33 | #include <asm/mips-boards/prom.h> | 34 | #include <asm/mips-boards/prom.h> |
34 | #include <asm/mips-boards/generic.h> | 35 | #include <asm/mips-boards/generic.h> |
35 | #include <asm/mips-boards/bonito64.h> | 36 | #include <asm/mips-boards/bonito64.h> |
@@ -192,6 +193,8 @@ extern struct plat_smp_ops msmtc_smp_ops; | |||
192 | 193 | ||
193 | void __init prom_init(void) | 194 | void __init prom_init(void) |
194 | { | 195 | { |
196 | int result; | ||
197 | |||
195 | prom_argc = fw_arg0; | 198 | prom_argc = fw_arg0; |
196 | _prom_argv = (int *) fw_arg1; | 199 | _prom_argv = (int *) fw_arg1; |
197 | _prom_envp = (int *) fw_arg2; | 200 | _prom_envp = (int *) fw_arg2; |
@@ -358,12 +361,21 @@ void __init prom_init(void) | |||
358 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 361 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
359 | console_config(); | 362 | console_config(); |
360 | #endif | 363 | #endif |
364 | /* Early detection of CMP support */ | ||
365 | result = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ); | ||
366 | |||
361 | #ifdef CONFIG_MIPS_CMP | 367 | #ifdef CONFIG_MIPS_CMP |
362 | register_smp_ops(&cmp_smp_ops); | 368 | if (result) |
369 | register_smp_ops(&cmp_smp_ops); | ||
363 | #endif | 370 | #endif |
364 | #ifdef CONFIG_MIPS_MT_SMP | 371 | #ifdef CONFIG_MIPS_MT_SMP |
372 | #ifdef CONFIG_MIPS_CMP | ||
373 | if (!result) | ||
374 | register_smp_ops(&vsmp_smp_ops); | ||
375 | #else | ||
365 | register_smp_ops(&vsmp_smp_ops); | 376 | register_smp_ops(&vsmp_smp_ops); |
366 | #endif | 377 | #endif |
378 | #endif | ||
367 | #ifdef CONFIG_MIPS_MT_SMTC | 379 | #ifdef CONFIG_MIPS_MT_SMTC |
368 | register_smp_ops(&msmtc_smp_ops); | 380 | register_smp_ops(&msmtc_smp_ops); |
369 | #endif | 381 | #endif |
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index ea176113fea9..3e0a9b35ba5c 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/smp.h> | ||
27 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
29 | #include <linux/io.h> | 30 | #include <linux/io.h> |
@@ -332,6 +333,21 @@ static struct irqaction irq_call = { | |||
332 | }; | 333 | }; |
333 | #endif /* CONFIG_MIPS_MT_SMP */ | 334 | #endif /* CONFIG_MIPS_MT_SMP */ |
334 | 335 | ||
336 | static int gic_resched_int_base; | ||
337 | static int gic_call_int_base; | ||
338 | #define GIC_RESCHED_INT(cpu) (gic_resched_int_base+(cpu)) | ||
339 | #define GIC_CALL_INT(cpu) (gic_call_int_base+(cpu)) | ||
340 | |||
341 | unsigned int plat_ipi_call_int_xlate(unsigned int cpu) | ||
342 | { | ||
343 | return GIC_CALL_INT(cpu); | ||
344 | } | ||
345 | |||
346 | unsigned int plat_ipi_resched_int_xlate(unsigned int cpu) | ||
347 | { | ||
348 | return GIC_RESCHED_INT(cpu); | ||
349 | } | ||
350 | |||
335 | static struct irqaction i8259irq = { | 351 | static struct irqaction i8259irq = { |
336 | .handler = no_action, | 352 | .handler = no_action, |
337 | .name = "XT-PIC cascade" | 353 | .name = "XT-PIC cascade" |
@@ -369,7 +385,7 @@ static int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap); | |||
369 | * Interrupts and CPUs/Core Interrupts. The nature of the External | 385 | * Interrupts and CPUs/Core Interrupts. The nature of the External |
370 | * Interrupts is also defined here - polarity/trigger. | 386 | * Interrupts is also defined here - polarity/trigger. |
371 | */ | 387 | */ |
372 | static struct gic_intr_map gic_intr_map[] = { | 388 | static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { |
373 | { GIC_EXT_INTR(0), X, X, X, X, 0 }, | 389 | { GIC_EXT_INTR(0), X, X, X, X, 0 }, |
374 | { GIC_EXT_INTR(1), X, X, X, X, 0 }, | 390 | { GIC_EXT_INTR(1), X, X, X, X, 0 }, |
375 | { GIC_EXT_INTR(2), X, X, X, X, 0 }, | 391 | { GIC_EXT_INTR(2), X, X, X, X, 0 }, |
@@ -386,21 +402,14 @@ static struct gic_intr_map gic_intr_map[] = { | |||
386 | { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, | 402 | { GIC_EXT_INTR(13), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, |
387 | { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, | 403 | { GIC_EXT_INTR(14), 0, GIC_MAP_TO_NMI_MSK, GIC_POL_POS, GIC_TRIG_LEVEL, 0 }, |
388 | { GIC_EXT_INTR(15), X, X, X, X, 0 }, | 404 | { GIC_EXT_INTR(15), X, X, X, X, 0 }, |
389 | { GIC_EXT_INTR(16), 0, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | 405 | /* This is the end of the general interrupts now we do IPI ones */ |
390 | { GIC_EXT_INTR(17), 0, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
391 | { GIC_EXT_INTR(18), 1, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
392 | { GIC_EXT_INTR(19), 1, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
393 | { GIC_EXT_INTR(20), 2, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
394 | { GIC_EXT_INTR(21), 2, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
395 | { GIC_EXT_INTR(22), 3, GIC_CPU_INT1, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
396 | { GIC_EXT_INTR(23), 3, GIC_CPU_INT2, GIC_POL_POS, GIC_TRIG_EDGE, 1 }, | ||
397 | }; | 406 | }; |
398 | #endif | 407 | #endif |
399 | 408 | ||
400 | /* | 409 | /* |
401 | * GCMP needs to be detected before any SMP initialisation | 410 | * GCMP needs to be detected before any SMP initialisation |
402 | */ | 411 | */ |
403 | static int __init gcmp_probe(unsigned long addr, unsigned long size) | 412 | int __init gcmp_probe(unsigned long addr, unsigned long size) |
404 | { | 413 | { |
405 | if (gcmp_present >= 0) | 414 | if (gcmp_present >= 0) |
406 | return gcmp_present; | 415 | return gcmp_present; |
@@ -415,28 +424,36 @@ static int __init gcmp_probe(unsigned long addr, unsigned long size) | |||
415 | } | 424 | } |
416 | 425 | ||
417 | #if defined(CONFIG_MIPS_MT_SMP) | 426 | #if defined(CONFIG_MIPS_MT_SMP) |
427 | static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin) | ||
428 | { | ||
429 | int intr = baseintr + cpu; | ||
430 | gic_intr_map[intr].intrnum = GIC_EXT_INTR(intr); | ||
431 | gic_intr_map[intr].cpunum = cpu; | ||
432 | gic_intr_map[intr].pin = cpupin; | ||
433 | gic_intr_map[intr].polarity = GIC_POL_POS; | ||
434 | gic_intr_map[intr].trigtype = GIC_TRIG_EDGE; | ||
435 | gic_intr_map[intr].ipiflag = 1; | ||
436 | ipi_map[cpu] |= (1 << (cpupin + 2)); | ||
437 | } | ||
438 | |||
418 | static void __init fill_ipi_map(void) | 439 | static void __init fill_ipi_map(void) |
419 | { | 440 | { |
420 | int i; | 441 | int cpu; |
421 | 442 | ||
422 | for (i = 0; i < ARRAY_SIZE(gic_intr_map); i++) { | 443 | for (cpu = 0; cpu < NR_CPUS; cpu++) { |
423 | if (gic_intr_map[i].ipiflag && (gic_intr_map[i].cpunum != X)) | 444 | fill_ipi_map1(gic_resched_int_base, cpu, GIC_CPU_INT1); |
424 | ipi_map[gic_intr_map[i].cpunum] |= | 445 | fill_ipi_map1(gic_call_int_base, cpu, GIC_CPU_INT2); |
425 | (1 << (gic_intr_map[i].pin + 2)); | ||
426 | } | 446 | } |
427 | } | 447 | } |
428 | #endif | 448 | #endif |
429 | 449 | ||
430 | void __init arch_init_irq(void) | 450 | void __init arch_init_irq(void) |
431 | { | 451 | { |
432 | int gic_present, gcmp_present; | ||
433 | |||
434 | init_i8259_irqs(); | 452 | init_i8259_irqs(); |
435 | 453 | ||
436 | if (!cpu_has_veic) | 454 | if (!cpu_has_veic) |
437 | mips_cpu_irq_init(); | 455 | mips_cpu_irq_init(); |
438 | 456 | ||
439 | gcmp_present = gcmp_probe(GCMP_BASE_ADDR, GCMP_ADDRSPACE_SZ); | ||
440 | if (gcmp_present) { | 457 | if (gcmp_present) { |
441 | GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK; | 458 | GCMPGCB(GICBA) = GIC_BASE_ADDR | GCMP_GCB_GICBA_EN_MSK; |
442 | gic_present = 1; | 459 | gic_present = 1; |
@@ -513,24 +530,10 @@ void __init arch_init_irq(void) | |||
513 | if (gic_present) { | 530 | if (gic_present) { |
514 | /* FIXME */ | 531 | /* FIXME */ |
515 | int i; | 532 | int i; |
516 | struct { | 533 | |
517 | unsigned int resched; | 534 | gic_call_int_base = GIC_NUM_INTRS - NR_CPUS; |
518 | unsigned int call; | 535 | gic_resched_int_base = gic_call_int_base - NR_CPUS; |
519 | } ipiirq[] = { | 536 | |
520 | { | ||
521 | .resched = GIC_IPI_EXT_INTR_RESCHED_VPE0, | ||
522 | .call = GIC_IPI_EXT_INTR_CALLFNC_VPE0}, | ||
523 | { | ||
524 | .resched = GIC_IPI_EXT_INTR_RESCHED_VPE1, | ||
525 | .call = GIC_IPI_EXT_INTR_CALLFNC_VPE1 | ||
526 | }, { | ||
527 | .resched = GIC_IPI_EXT_INTR_RESCHED_VPE2, | ||
528 | .call = GIC_IPI_EXT_INTR_CALLFNC_VPE2 | ||
529 | }, { | ||
530 | .resched = GIC_IPI_EXT_INTR_RESCHED_VPE3, | ||
531 | .call = GIC_IPI_EXT_INTR_CALLFNC_VPE3 | ||
532 | } | ||
533 | }; | ||
534 | fill_ipi_map(); | 537 | fill_ipi_map(); |
535 | gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); | 538 | gic_init(GIC_BASE_ADDR, GIC_ADDRSPACE_SZ, gic_intr_map, ARRAY_SIZE(gic_intr_map), MIPS_GIC_IRQ_BASE); |
536 | if (!gcmp_present) { | 539 | if (!gcmp_present) { |
@@ -552,12 +555,15 @@ void __init arch_init_irq(void) | |||
552 | printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status()); | 555 | printk("CPU%d: status register now %08x\n", smp_processor_id(), read_c0_status()); |
553 | write_c0_status(0x1100dc00); | 556 | write_c0_status(0x1100dc00); |
554 | printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); | 557 | printk("CPU%d: status register frc %08x\n", smp_processor_id(), read_c0_status()); |
555 | for (i = 0; i < ARRAY_SIZE(ipiirq); i++) { | 558 | for (i = 0; i < NR_CPUS; i++) { |
556 | setup_irq(MIPS_GIC_IRQ_BASE + ipiirq[i].resched, &irq_resched); | 559 | setup_irq(MIPS_GIC_IRQ_BASE + |
557 | setup_irq(MIPS_GIC_IRQ_BASE + ipiirq[i].call, &irq_call); | 560 | GIC_RESCHED_INT(i), &irq_resched); |
558 | 561 | setup_irq(MIPS_GIC_IRQ_BASE + | |
559 | set_irq_handler(MIPS_GIC_IRQ_BASE + ipiirq[i].resched, handle_percpu_irq); | 562 | GIC_CALL_INT(i), &irq_call); |
560 | set_irq_handler(MIPS_GIC_IRQ_BASE + ipiirq[i].call, handle_percpu_irq); | 563 | set_irq_handler(MIPS_GIC_IRQ_BASE + |
564 | GIC_RESCHED_INT(i), handle_percpu_irq); | ||
565 | set_irq_handler(MIPS_GIC_IRQ_BASE + | ||
566 | GIC_CALL_INT(i), handle_percpu_irq); | ||
561 | } | 567 | } |
562 | } else { | 568 | } else { |
563 | /* set up ipi interrupts */ | 569 | /* set up ipi interrupts */ |
diff --git a/arch/mips/mti-malta/malta-reset.c b/arch/mips/mti-malta/malta-reset.c index 42dee4da37ba..f48d60e84290 100644 --- a/arch/mips/mti-malta/malta-reset.c +++ b/arch/mips/mti-malta/malta-reset.c | |||
@@ -28,9 +28,6 @@ | |||
28 | #include <asm/reboot.h> | 28 | #include <asm/reboot.h> |
29 | #include <asm/mips-boards/generic.h> | 29 | #include <asm/mips-boards/generic.h> |
30 | 30 | ||
31 | static void mips_machine_restart(char *command); | ||
32 | static void mips_machine_halt(void); | ||
33 | |||
34 | static void mips_machine_restart(char *command) | 31 | static void mips_machine_restart(char *command) |
35 | { | 32 | { |
36 | unsigned int __iomem *softres_reg = | 33 | unsigned int __iomem *softres_reg = |
diff --git a/arch/mips/nxp/pnx8550/common/time.c b/arch/mips/nxp/pnx8550/common/time.c index 8df43e9e4d90..18b192784877 100644 --- a/arch/mips/nxp/pnx8550/common/time.c +++ b/arch/mips/nxp/pnx8550/common/time.c | |||
@@ -138,7 +138,7 @@ __init void plat_time_init(void) | |||
138 | * HZ timer interrupts per second. | 138 | * HZ timer interrupts per second. |
139 | */ | 139 | */ |
140 | mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p)); | 140 | mips_hpt_frequency = 27UL * ((1000000UL * n)/(m * pow2p)); |
141 | cpj = (mips_hpt_frequency + HZ / 2) / HZ; | 141 | cpj = DIV_ROUND_CLOSEST(mips_hpt_frequency, HZ); |
142 | write_c0_count(0); | 142 | write_c0_count(0); |
143 | timer_ack(); | 143 | timer_ack(); |
144 | 144 | ||
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile index e8a97f59e066..63d8a297c58d 100644 --- a/arch/mips/pci/Makefile +++ b/arch/mips/pci/Makefile | |||
@@ -52,3 +52,8 @@ obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o | |||
52 | obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o | 52 | obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o |
53 | obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o | 53 | obj-$(CONFIG_WR_PPMC) += fixup-wrppmc.o |
54 | obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o | 54 | obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o |
55 | obj-$(CONFIG_CPU_CAVIUM_OCTEON) += pci-octeon.o pcie-octeon.o | ||
56 | |||
57 | ifdef CONFIG_PCI_MSI | ||
58 | obj-$(CONFIG_CPU_CAVIUM_OCTEON) += msi-octeon.o | ||
59 | endif | ||
diff --git a/arch/mips/pci/fixup-capcella.c b/arch/mips/pci/fixup-capcella.c index 1416bca6d1a3..1c02f5737367 100644 --- a/arch/mips/pci/fixup-capcella.c +++ b/arch/mips/pci/fixup-capcella.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups. | 2 | * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups. |
3 | * | 3 | * |
4 | * Copyright (C) 2002,2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/pci/fixup-emma2rh.c b/arch/mips/pci/fixup-emma2rh.c index fba5aad00d51..0d9ccf4dfc5a 100644 --- a/arch/mips/pci/fixup-emma2rh.c +++ b/arch/mips/pci/fixup-emma2rh.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/pci/fixup-emma2rh.c | ||
3 | * This file defines the PCI configration. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c | 4 | * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c |
diff --git a/arch/mips/pci/fixup-mpc30x.c b/arch/mips/pci/fixup-mpc30x.c index 591159625722..e08f49cb6875 100644 --- a/arch/mips/pci/fixup-mpc30x.c +++ b/arch/mips/pci/fixup-mpc30x.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups. | 2 | * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups. |
3 | * | 3 | * |
4 | * Copyright (C) 2002,2004 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/pci/fixup-sb1250.c b/arch/mips/pci/fixup-sb1250.c index 0ad39e53f7b1..f0bb9146e6c0 100644 --- a/arch/mips/pci/fixup-sb1250.c +++ b/arch/mips/pci/fixup-sb1250.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/pci/fixup-sb1250.c | ||
3 | * | ||
4 | * Copyright (C) 2004, 2006 MIPS Technologies, Inc. All rights reserved. | 2 | * Copyright (C) 2004, 2006 MIPS Technologies, Inc. All rights reserved. |
5 | * Author: Maciej W. Rozycki <macro@mips.com> | 3 | * Author: Maciej W. Rozycki <macro@mips.com> |
6 | * | 4 | * |
diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c index ed87733f6796..8084b17d4406 100644 --- a/arch/mips/pci/fixup-tb0219.c +++ b/arch/mips/pci/fixup-tb0219.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups. | 2 | * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups. |
3 | * | 3 | * |
4 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> | 4 | * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> |
5 | * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 5 | * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/pci/fixup-tb0226.c b/arch/mips/pci/fixup-tb0226.c index e3eedf4bf9bd..4196ccf3ea3d 100644 --- a/arch/mips/pci/fixup-tb0226.c +++ b/arch/mips/pci/fixup-tb0226.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups. | 2 | * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/pci/fixup-tb0287.c b/arch/mips/pci/fixup-tb0287.c index 267ab3dc3d42..2fe29db43725 100644 --- a/arch/mips/pci/fixup-tb0287.c +++ b/arch/mips/pci/fixup-tb0287.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups. | 2 | * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c new file mode 100644 index 000000000000..03742e647657 --- /dev/null +++ b/arch/mips/pci/msi-octeon.c | |||
@@ -0,0 +1,288 @@ | |||
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) 2005-2009 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/msi.h> | ||
11 | #include <linux/spinlock.h> | ||
12 | #include <linux/interrupt.h> | ||
13 | |||
14 | #include <asm/octeon/octeon.h> | ||
15 | #include <asm/octeon/cvmx-npi-defs.h> | ||
16 | #include <asm/octeon/cvmx-pci-defs.h> | ||
17 | #include <asm/octeon/cvmx-npei-defs.h> | ||
18 | #include <asm/octeon/cvmx-pexp-defs.h> | ||
19 | #include <asm/octeon/pci-octeon.h> | ||
20 | |||
21 | /* | ||
22 | * Each bit in msi_free_irq_bitmask represents a MSI interrupt that is | ||
23 | * in use. | ||
24 | */ | ||
25 | static uint64_t msi_free_irq_bitmask; | ||
26 | |||
27 | /* | ||
28 | * Each bit in msi_multiple_irq_bitmask tells that the device using | ||
29 | * this bit in msi_free_irq_bitmask is also using the next bit. This | ||
30 | * is used so we can disable all of the MSI interrupts when a device | ||
31 | * uses multiple. | ||
32 | */ | ||
33 | static uint64_t msi_multiple_irq_bitmask; | ||
34 | |||
35 | /* | ||
36 | * This lock controls updates to msi_free_irq_bitmask and | ||
37 | * msi_multiple_irq_bitmask. | ||
38 | */ | ||
39 | static DEFINE_SPINLOCK(msi_free_irq_bitmask_lock); | ||
40 | |||
41 | |||
42 | /** | ||
43 | * Called when a driver request MSI interrupts instead of the | ||
44 | * legacy INT A-D. This routine will allocate multiple interrupts | ||
45 | * for MSI devices that support them. A device can override this by | ||
46 | * programming the MSI control bits [6:4] before calling | ||
47 | * pci_enable_msi(). | ||
48 | * | ||
49 | * @dev: Device requesting MSI interrupts | ||
50 | * @desc: MSI descriptor | ||
51 | * | ||
52 | * Returns 0 on success. | ||
53 | */ | ||
54 | int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) | ||
55 | { | ||
56 | struct msi_msg msg; | ||
57 | uint16_t control; | ||
58 | int configured_private_bits; | ||
59 | int request_private_bits; | ||
60 | int irq; | ||
61 | int irq_step; | ||
62 | uint64_t search_mask; | ||
63 | |||
64 | /* | ||
65 | * Read the MSI config to figure out how many IRQs this device | ||
66 | * wants. Most devices only want 1, which will give | ||
67 | * configured_private_bits and request_private_bits equal 0. | ||
68 | */ | ||
69 | pci_read_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS, | ||
70 | &control); | ||
71 | |||
72 | /* | ||
73 | * If the number of private bits has been configured then use | ||
74 | * that value instead of the requested number. This gives the | ||
75 | * driver the chance to override the number of interrupts | ||
76 | * before calling pci_enable_msi(). | ||
77 | */ | ||
78 | configured_private_bits = (control & PCI_MSI_FLAGS_QSIZE) >> 4; | ||
79 | if (configured_private_bits == 0) { | ||
80 | /* Nothing is configured, so use the hardware requested size */ | ||
81 | request_private_bits = (control & PCI_MSI_FLAGS_QMASK) >> 1; | ||
82 | } else { | ||
83 | /* | ||
84 | * Use the number of configured bits, assuming the | ||
85 | * driver wanted to override the hardware request | ||
86 | * value. | ||
87 | */ | ||
88 | request_private_bits = configured_private_bits; | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * The PCI 2.3 spec mandates that there are at most 32 | ||
93 | * interrupts. If this device asks for more, only give it one. | ||
94 | */ | ||
95 | if (request_private_bits > 5) | ||
96 | request_private_bits = 0; | ||
97 | |||
98 | try_only_one: | ||
99 | /* | ||
100 | * The IRQs have to be aligned on a power of two based on the | ||
101 | * number being requested. | ||
102 | */ | ||
103 | irq_step = 1 << request_private_bits; | ||
104 | |||
105 | /* Mask with one bit for each IRQ */ | ||
106 | search_mask = (1 << irq_step) - 1; | ||
107 | |||
108 | /* | ||
109 | * We're going to search msi_free_irq_bitmask_lock for zero | ||
110 | * bits. This represents an MSI interrupt number that isn't in | ||
111 | * use. | ||
112 | */ | ||
113 | spin_lock(&msi_free_irq_bitmask_lock); | ||
114 | for (irq = 0; irq < 64; irq += irq_step) { | ||
115 | if ((msi_free_irq_bitmask & (search_mask << irq)) == 0) { | ||
116 | msi_free_irq_bitmask |= search_mask << irq; | ||
117 | msi_multiple_irq_bitmask |= (search_mask >> 1) << irq; | ||
118 | break; | ||
119 | } | ||
120 | } | ||
121 | spin_unlock(&msi_free_irq_bitmask_lock); | ||
122 | |||
123 | /* Make sure the search for available interrupts didn't fail */ | ||
124 | if (irq >= 64) { | ||
125 | if (request_private_bits) { | ||
126 | pr_err("arch_setup_msi_irq: Unable to find %d free " | ||
127 | "interrupts, trying just one", | ||
128 | 1 << request_private_bits); | ||
129 | request_private_bits = 0; | ||
130 | goto try_only_one; | ||
131 | } else | ||
132 | panic("arch_setup_msi_irq: Unable to find a free MSI " | ||
133 | "interrupt"); | ||
134 | } | ||
135 | |||
136 | /* MSI interrupts start at logical IRQ OCTEON_IRQ_MSI_BIT0 */ | ||
137 | irq += OCTEON_IRQ_MSI_BIT0; | ||
138 | |||
139 | switch (octeon_dma_bar_type) { | ||
140 | case OCTEON_DMA_BAR_TYPE_SMALL: | ||
141 | /* When not using big bar, Bar 0 is based at 128MB */ | ||
142 | msg.address_lo = | ||
143 | ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff; | ||
144 | msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32; | ||
145 | case OCTEON_DMA_BAR_TYPE_BIG: | ||
146 | /* When using big bar, Bar 0 is based at 0 */ | ||
147 | msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff; | ||
148 | msg.address_hi = (0 + CVMX_PCI_MSI_RCV) >> 32; | ||
149 | break; | ||
150 | case OCTEON_DMA_BAR_TYPE_PCIE: | ||
151 | /* When using PCIe, Bar 0 is based at 0 */ | ||
152 | /* FIXME CVMX_NPEI_MSI_RCV* other than 0? */ | ||
153 | msg.address_lo = (0 + CVMX_NPEI_PCIE_MSI_RCV) & 0xffffffff; | ||
154 | msg.address_hi = (0 + CVMX_NPEI_PCIE_MSI_RCV) >> 32; | ||
155 | break; | ||
156 | default: | ||
157 | panic("arch_setup_msi_irq: Invalid octeon_dma_bar_type\n"); | ||
158 | } | ||
159 | msg.data = irq - OCTEON_IRQ_MSI_BIT0; | ||
160 | |||
161 | /* Update the number of IRQs the device has available to it */ | ||
162 | control &= ~PCI_MSI_FLAGS_QSIZE; | ||
163 | control |= request_private_bits << 4; | ||
164 | pci_write_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS, | ||
165 | control); | ||
166 | |||
167 | set_irq_msi(irq, desc); | ||
168 | write_msi_msg(irq, &msg); | ||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | |||
173 | /** | ||
174 | * Called when a device no longer needs its MSI interrupts. All | ||
175 | * MSI interrupts for the device are freed. | ||
176 | * | ||
177 | * @irq: The devices first irq number. There may be multple in sequence. | ||
178 | */ | ||
179 | void arch_teardown_msi_irq(unsigned int irq) | ||
180 | { | ||
181 | int number_irqs; | ||
182 | uint64_t bitmask; | ||
183 | |||
184 | if ((irq < OCTEON_IRQ_MSI_BIT0) || (irq > OCTEON_IRQ_MSI_BIT63)) | ||
185 | panic("arch_teardown_msi_irq: Attempted to teardown illegal " | ||
186 | "MSI interrupt (%d)", irq); | ||
187 | irq -= OCTEON_IRQ_MSI_BIT0; | ||
188 | |||
189 | /* | ||
190 | * Count the number of IRQs we need to free by looking at the | ||
191 | * msi_multiple_irq_bitmask. Each bit set means that the next | ||
192 | * IRQ is also owned by this device. | ||
193 | */ | ||
194 | number_irqs = 0; | ||
195 | while ((irq+number_irqs < 64) && | ||
196 | (msi_multiple_irq_bitmask & (1ull << (irq + number_irqs)))) | ||
197 | number_irqs++; | ||
198 | number_irqs++; | ||
199 | /* Mask with one bit for each IRQ */ | ||
200 | bitmask = (1 << number_irqs) - 1; | ||
201 | /* Shift the mask to the correct bit location */ | ||
202 | bitmask <<= irq; | ||
203 | if ((msi_free_irq_bitmask & bitmask) != bitmask) | ||
204 | panic("arch_teardown_msi_irq: Attempted to teardown MSI " | ||
205 | "interrupt (%d) not in use", irq); | ||
206 | |||
207 | /* Checks are done, update the in use bitmask */ | ||
208 | spin_lock(&msi_free_irq_bitmask_lock); | ||
209 | msi_free_irq_bitmask &= ~bitmask; | ||
210 | msi_multiple_irq_bitmask &= ~bitmask; | ||
211 | spin_unlock(&msi_free_irq_bitmask_lock); | ||
212 | } | ||
213 | |||
214 | |||
215 | /* | ||
216 | * Called by the interrupt handling code when an MSI interrupt | ||
217 | * occurs. | ||
218 | */ | ||
219 | static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id) | ||
220 | { | ||
221 | uint64_t msi_bits; | ||
222 | int irq; | ||
223 | |||
224 | if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) | ||
225 | msi_bits = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_RCV0); | ||
226 | else | ||
227 | msi_bits = cvmx_read_csr(CVMX_NPI_NPI_MSI_RCV); | ||
228 | irq = fls64(msi_bits); | ||
229 | if (irq) { | ||
230 | irq += OCTEON_IRQ_MSI_BIT0 - 1; | ||
231 | if (irq_desc[irq].action) { | ||
232 | do_IRQ(irq); | ||
233 | return IRQ_HANDLED; | ||
234 | } else { | ||
235 | pr_err("Spurious MSI interrupt %d\n", irq); | ||
236 | if (octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
237 | /* These chips have PCIe */ | ||
238 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0, | ||
239 | 1ull << (irq - | ||
240 | OCTEON_IRQ_MSI_BIT0)); | ||
241 | } else { | ||
242 | /* These chips have PCI */ | ||
243 | cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV, | ||
244 | 1ull << (irq - | ||
245 | OCTEON_IRQ_MSI_BIT0)); | ||
246 | } | ||
247 | } | ||
248 | } | ||
249 | return IRQ_NONE; | ||
250 | } | ||
251 | |||
252 | |||
253 | /* | ||
254 | * Initializes the MSI interrupt handling code | ||
255 | */ | ||
256 | int octeon_msi_initialize(void) | ||
257 | { | ||
258 | if (octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
259 | if (request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt, | ||
260 | IRQF_SHARED, | ||
261 | "MSI[0:63]", octeon_msi_interrupt)) | ||
262 | panic("request_irq(OCTEON_IRQ_PCI_MSI0) failed"); | ||
263 | } else if (octeon_is_pci_host()) { | ||
264 | if (request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt, | ||
265 | IRQF_SHARED, | ||
266 | "MSI[0:15]", octeon_msi_interrupt)) | ||
267 | panic("request_irq(OCTEON_IRQ_PCI_MSI0) failed"); | ||
268 | |||
269 | if (request_irq(OCTEON_IRQ_PCI_MSI1, octeon_msi_interrupt, | ||
270 | IRQF_SHARED, | ||
271 | "MSI[16:31]", octeon_msi_interrupt)) | ||
272 | panic("request_irq(OCTEON_IRQ_PCI_MSI1) failed"); | ||
273 | |||
274 | if (request_irq(OCTEON_IRQ_PCI_MSI2, octeon_msi_interrupt, | ||
275 | IRQF_SHARED, | ||
276 | "MSI[32:47]", octeon_msi_interrupt)) | ||
277 | panic("request_irq(OCTEON_IRQ_PCI_MSI2) failed"); | ||
278 | |||
279 | if (request_irq(OCTEON_IRQ_PCI_MSI3, octeon_msi_interrupt, | ||
280 | IRQF_SHARED, | ||
281 | "MSI[48:63]", octeon_msi_interrupt)) | ||
282 | panic("request_irq(OCTEON_IRQ_PCI_MSI3) failed"); | ||
283 | |||
284 | } | ||
285 | return 0; | ||
286 | } | ||
287 | |||
288 | subsys_initcall(octeon_msi_initialize); | ||
diff --git a/arch/mips/pci/ops-emma2rh.c b/arch/mips/pci/ops-emma2rh.c index 5947a70b0b7f..710aef5c070e 100644 --- a/arch/mips/pci/ops-emma2rh.c +++ b/arch/mips/pci/ops-emma2rh.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/pci/ops-emma2rh.c | ||
3 | * This file defines the PCI operation for EMMA2RH. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This file is based on the arch/mips/pci/ops-vr41xx.c | 4 | * This file is based on the arch/mips/pci/ops-vr41xx.c |
diff --git a/arch/mips/pci/ops-vr41xx.c b/arch/mips/pci/ops-vr41xx.c index 900c6b32576c..28962a7c6606 100644 --- a/arch/mips/pci/ops-vr41xx.c +++ b/arch/mips/pci/ops-vr41xx.c | |||
@@ -2,8 +2,8 @@ | |||
2 | * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series. | 2 | * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2001-2003 MontaVista Software Inc. | 4 | * Copyright (C) 2001-2003 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> | 5 | * Author: Yoichi Yuasa <source@mvista.com> |
6 | * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -21,7 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | /* | 22 | /* |
23 | * Changes: | 23 | * Changes: |
24 | * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> | 24 | * MontaVista Software Inc. <source@mvista.com> |
25 | * - New creation, NEC VR4122 and VR4131 are supported. | 25 | * - New creation, NEC VR4122 and VR4131 are supported. |
26 | */ | 26 | */ |
27 | #include <linux/pci.h> | 27 | #include <linux/pci.h> |
diff --git a/arch/mips/pci/pci-emma2rh.c b/arch/mips/pci/pci-emma2rh.c index 2df4190232cd..773e34ff4d1c 100644 --- a/arch/mips/pci/pci-emma2rh.c +++ b/arch/mips/pci/pci-emma2rh.c | |||
@@ -1,7 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/pci/pci-emma2rh.c | ||
3 | * This file defines the PCI configration. | ||
4 | * | ||
5 | * Copyright (C) NEC Electronics Corporation 2004-2006 | 2 | * Copyright (C) NEC Electronics Corporation 2004-2006 |
6 | * | 3 | * |
7 | * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c | 4 | * This file is based on the arch/mips/ddb5xxx/ddb5477/pci.c |
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index dda6f2058665..a0e726eb039a 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/smp.h> | ||
13 | #include <asm/sn/arch.h> | 14 | #include <asm/sn/arch.h> |
14 | #include <asm/pci/bridge.h> | 15 | #include <asm/pci/bridge.h> |
15 | #include <asm/paccess.h> | 16 | #include <asm/paccess.h> |
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c new file mode 100644 index 000000000000..9cb0c807f564 --- /dev/null +++ b/arch/mips/pci/pci-octeon.c | |||
@@ -0,0 +1,675 @@ | |||
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) 2005-2009 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/pci.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/time.h> | ||
13 | #include <linux/delay.h> | ||
14 | |||
15 | #include <asm/time.h> | ||
16 | |||
17 | #include <asm/octeon/octeon.h> | ||
18 | #include <asm/octeon/cvmx-npi-defs.h> | ||
19 | #include <asm/octeon/cvmx-pci-defs.h> | ||
20 | #include <asm/octeon/pci-octeon.h> | ||
21 | |||
22 | #define USE_OCTEON_INTERNAL_ARBITER | ||
23 | |||
24 | /* | ||
25 | * Octeon's PCI controller uses did=3, subdid=2 for PCI IO | ||
26 | * addresses. Use PCI endian swapping 1 so no address swapping is | ||
27 | * necessary. The Linux io routines will endian swap the data. | ||
28 | */ | ||
29 | #define OCTEON_PCI_IOSPACE_BASE 0x80011a0400000000ull | ||
30 | #define OCTEON_PCI_IOSPACE_SIZE (1ull<<32) | ||
31 | |||
32 | /* Octeon't PCI controller uses did=3, subdid=3 for PCI memory. */ | ||
33 | #define OCTEON_PCI_MEMSPACE_OFFSET (0x00011b0000000000ull) | ||
34 | |||
35 | /** | ||
36 | * This is the bit decoding used for the Octeon PCI controller addresses | ||
37 | */ | ||
38 | union octeon_pci_address { | ||
39 | uint64_t u64; | ||
40 | struct { | ||
41 | uint64_t upper:2; | ||
42 | uint64_t reserved:13; | ||
43 | uint64_t io:1; | ||
44 | uint64_t did:5; | ||
45 | uint64_t subdid:3; | ||
46 | uint64_t reserved2:4; | ||
47 | uint64_t endian_swap:2; | ||
48 | uint64_t reserved3:10; | ||
49 | uint64_t bus:8; | ||
50 | uint64_t dev:5; | ||
51 | uint64_t func:3; | ||
52 | uint64_t reg:8; | ||
53 | } s; | ||
54 | }; | ||
55 | |||
56 | int __initdata (*octeon_pcibios_map_irq)(const struct pci_dev *dev, | ||
57 | u8 slot, u8 pin); | ||
58 | enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID; | ||
59 | |||
60 | /** | ||
61 | * Map a PCI device to the appropriate interrupt line | ||
62 | * | ||
63 | * @dev: The Linux PCI device structure for the device to map | ||
64 | * @slot: The slot number for this device on __BUS 0__. Linux | ||
65 | * enumerates through all the bridges and figures out the | ||
66 | * slot on Bus 0 where this device eventually hooks to. | ||
67 | * @pin: The PCI interrupt pin read from the device, then swizzled | ||
68 | * as it goes through each bridge. | ||
69 | * Returns Interrupt number for the device | ||
70 | */ | ||
71 | int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | ||
72 | { | ||
73 | if (octeon_pcibios_map_irq) | ||
74 | return octeon_pcibios_map_irq(dev, slot, pin); | ||
75 | else | ||
76 | panic("octeon_pcibios_map_irq not set."); | ||
77 | } | ||
78 | |||
79 | |||
80 | /* | ||
81 | * Called to perform platform specific PCI setup | ||
82 | */ | ||
83 | int pcibios_plat_dev_init(struct pci_dev *dev) | ||
84 | { | ||
85 | uint16_t config; | ||
86 | uint32_t dconfig; | ||
87 | int pos; | ||
88 | /* | ||
89 | * Force the Cache line setting to 64 bytes. The standard | ||
90 | * Linux bus scan doesn't seem to set it. Octeon really has | ||
91 | * 128 byte lines, but Intel bridges get really upset if you | ||
92 | * try and set values above 64 bytes. Value is specified in | ||
93 | * 32bit words. | ||
94 | */ | ||
95 | pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 64 / 4); | ||
96 | /* Set latency timers for all devices */ | ||
97 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 48); | ||
98 | |||
99 | /* Enable reporting System errors and parity errors on all devices */ | ||
100 | /* Enable parity checking and error reporting */ | ||
101 | pci_read_config_word(dev, PCI_COMMAND, &config); | ||
102 | config |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR; | ||
103 | pci_write_config_word(dev, PCI_COMMAND, config); | ||
104 | |||
105 | if (dev->subordinate) { | ||
106 | /* Set latency timers on sub bridges */ | ||
107 | pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 48); | ||
108 | /* More bridge error detection */ | ||
109 | pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &config); | ||
110 | config |= PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR; | ||
111 | pci_write_config_word(dev, PCI_BRIDGE_CONTROL, config); | ||
112 | } | ||
113 | |||
114 | /* Enable the PCIe normal error reporting */ | ||
115 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | ||
116 | if (pos) { | ||
117 | /* Update Device Control */ | ||
118 | pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config); | ||
119 | /* Correctable Error Reporting */ | ||
120 | config |= PCI_EXP_DEVCTL_CERE; | ||
121 | /* Non-Fatal Error Reporting */ | ||
122 | config |= PCI_EXP_DEVCTL_NFERE; | ||
123 | /* Fatal Error Reporting */ | ||
124 | config |= PCI_EXP_DEVCTL_FERE; | ||
125 | /* Unsupported Request */ | ||
126 | config |= PCI_EXP_DEVCTL_URRE; | ||
127 | pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config); | ||
128 | } | ||
129 | |||
130 | /* Find the Advanced Error Reporting capability */ | ||
131 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); | ||
132 | if (pos) { | ||
133 | /* Clear Uncorrectable Error Status */ | ||
134 | pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, | ||
135 | &dconfig); | ||
136 | pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, | ||
137 | dconfig); | ||
138 | /* Enable reporting of all uncorrectable errors */ | ||
139 | /* Uncorrectable Error Mask - turned on bits disable errors */ | ||
140 | pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, 0); | ||
141 | /* | ||
142 | * Leave severity at HW default. This only controls if | ||
143 | * errors are reported as uncorrectable or | ||
144 | * correctable, not if the error is reported. | ||
145 | */ | ||
146 | /* PCI_ERR_UNCOR_SEVER - Uncorrectable Error Severity */ | ||
147 | /* Clear Correctable Error Status */ | ||
148 | pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &dconfig); | ||
149 | pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, dconfig); | ||
150 | /* Enable reporting of all correctable errors */ | ||
151 | /* Correctable Error Mask - turned on bits disable errors */ | ||
152 | pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, 0); | ||
153 | /* Advanced Error Capabilities */ | ||
154 | pci_read_config_dword(dev, pos + PCI_ERR_CAP, &dconfig); | ||
155 | /* ECRC Generation Enable */ | ||
156 | if (config & PCI_ERR_CAP_ECRC_GENC) | ||
157 | config |= PCI_ERR_CAP_ECRC_GENE; | ||
158 | /* ECRC Check Enable */ | ||
159 | if (config & PCI_ERR_CAP_ECRC_CHKC) | ||
160 | config |= PCI_ERR_CAP_ECRC_CHKE; | ||
161 | pci_write_config_dword(dev, pos + PCI_ERR_CAP, dconfig); | ||
162 | /* PCI_ERR_HEADER_LOG - Header Log Register (16 bytes) */ | ||
163 | /* Report all errors to the root complex */ | ||
164 | pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND, | ||
165 | PCI_ERR_ROOT_CMD_COR_EN | | ||
166 | PCI_ERR_ROOT_CMD_NONFATAL_EN | | ||
167 | PCI_ERR_ROOT_CMD_FATAL_EN); | ||
168 | /* Clear the Root status register */ | ||
169 | pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &dconfig); | ||
170 | pci_write_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, dconfig); | ||
171 | } | ||
172 | |||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | /** | ||
177 | * Return the mapping of PCI device number to IRQ line. Each | ||
178 | * character in the return string represents the interrupt | ||
179 | * line for the device at that position. Device 1 maps to the | ||
180 | * first character, etc. The characters A-D are used for PCI | ||
181 | * interrupts. | ||
182 | * | ||
183 | * Returns PCI interrupt mapping | ||
184 | */ | ||
185 | const char *octeon_get_pci_interrupts(void) | ||
186 | { | ||
187 | /* | ||
188 | * Returning an empty string causes the interrupts to be | ||
189 | * routed based on the PCI specification. From the PCI spec: | ||
190 | * | ||
191 | * INTA# of Device Number 0 is connected to IRQW on the system | ||
192 | * board. (Device Number has no significance regarding being | ||
193 | * located on the system board or in a connector.) INTA# of | ||
194 | * Device Number 1 is connected to IRQX on the system | ||
195 | * board. INTA# of Device Number 2 is connected to IRQY on the | ||
196 | * system board. INTA# of Device Number 3 is connected to IRQZ | ||
197 | * on the system board. The table below describes how each | ||
198 | * agent's INTx# lines are connected to the system board | ||
199 | * interrupt lines. The following equation can be used to | ||
200 | * determine to which INTx# signal on the system board a given | ||
201 | * device's INTx# line(s) is connected. | ||
202 | * | ||
203 | * MB = (D + I) MOD 4 MB = System board Interrupt (IRQW = 0, | ||
204 | * IRQX = 1, IRQY = 2, and IRQZ = 3) D = Device Number I = | ||
205 | * Interrupt Number (INTA# = 0, INTB# = 1, INTC# = 2, and | ||
206 | * INTD# = 3) | ||
207 | */ | ||
208 | switch (octeon_bootinfo->board_type) { | ||
209 | case CVMX_BOARD_TYPE_NAO38: | ||
210 | /* This is really the NAC38 */ | ||
211 | return "AAAAADABAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
212 | case CVMX_BOARD_TYPE_THUNDER: | ||
213 | return ""; | ||
214 | case CVMX_BOARD_TYPE_EBH3000: | ||
215 | return ""; | ||
216 | case CVMX_BOARD_TYPE_EBH3100: | ||
217 | case CVMX_BOARD_TYPE_CN3010_EVB_HS5: | ||
218 | case CVMX_BOARD_TYPE_CN3005_EVB_HS5: | ||
219 | return "AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; | ||
220 | case CVMX_BOARD_TYPE_BBGW_REF: | ||
221 | return "AABCD"; | ||
222 | default: | ||
223 | return ""; | ||
224 | } | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * Map a PCI device to the appropriate interrupt line | ||
229 | * | ||
230 | * @dev: The Linux PCI device structure for the device to map | ||
231 | * @slot: The slot number for this device on __BUS 0__. Linux | ||
232 | * enumerates through all the bridges and figures out the | ||
233 | * slot on Bus 0 where this device eventually hooks to. | ||
234 | * @pin: The PCI interrupt pin read from the device, then swizzled | ||
235 | * as it goes through each bridge. | ||
236 | * Returns Interrupt number for the device | ||
237 | */ | ||
238 | int __init octeon_pci_pcibios_map_irq(const struct pci_dev *dev, | ||
239 | u8 slot, u8 pin) | ||
240 | { | ||
241 | int irq_num; | ||
242 | const char *interrupts; | ||
243 | int dev_num; | ||
244 | |||
245 | /* Get the board specific interrupt mapping */ | ||
246 | interrupts = octeon_get_pci_interrupts(); | ||
247 | |||
248 | dev_num = dev->devfn >> 3; | ||
249 | if (dev_num < strlen(interrupts)) | ||
250 | irq_num = ((interrupts[dev_num] - 'A' + pin - 1) & 3) + | ||
251 | OCTEON_IRQ_PCI_INT0; | ||
252 | else | ||
253 | irq_num = ((slot + pin - 3) & 3) + OCTEON_IRQ_PCI_INT0; | ||
254 | return irq_num; | ||
255 | } | ||
256 | |||
257 | |||
258 | /* | ||
259 | * Read a value from configuration space | ||
260 | */ | ||
261 | static int octeon_read_config(struct pci_bus *bus, unsigned int devfn, | ||
262 | int reg, int size, u32 *val) | ||
263 | { | ||
264 | union octeon_pci_address pci_addr; | ||
265 | |||
266 | pci_addr.u64 = 0; | ||
267 | pci_addr.s.upper = 2; | ||
268 | pci_addr.s.io = 1; | ||
269 | pci_addr.s.did = 3; | ||
270 | pci_addr.s.subdid = 1; | ||
271 | pci_addr.s.endian_swap = 1; | ||
272 | pci_addr.s.bus = bus->number; | ||
273 | pci_addr.s.dev = devfn >> 3; | ||
274 | pci_addr.s.func = devfn & 0x7; | ||
275 | pci_addr.s.reg = reg; | ||
276 | |||
277 | #if PCI_CONFIG_SPACE_DELAY | ||
278 | udelay(PCI_CONFIG_SPACE_DELAY); | ||
279 | #endif | ||
280 | switch (size) { | ||
281 | case 4: | ||
282 | *val = le32_to_cpu(cvmx_read64_uint32(pci_addr.u64)); | ||
283 | return PCIBIOS_SUCCESSFUL; | ||
284 | case 2: | ||
285 | *val = le16_to_cpu(cvmx_read64_uint16(pci_addr.u64)); | ||
286 | return PCIBIOS_SUCCESSFUL; | ||
287 | case 1: | ||
288 | *val = cvmx_read64_uint8(pci_addr.u64); | ||
289 | return PCIBIOS_SUCCESSFUL; | ||
290 | } | ||
291 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
292 | } | ||
293 | |||
294 | |||
295 | /* | ||
296 | * Write a value to PCI configuration space | ||
297 | */ | ||
298 | static int octeon_write_config(struct pci_bus *bus, unsigned int devfn, | ||
299 | int reg, int size, u32 val) | ||
300 | { | ||
301 | union octeon_pci_address pci_addr; | ||
302 | |||
303 | pci_addr.u64 = 0; | ||
304 | pci_addr.s.upper = 2; | ||
305 | pci_addr.s.io = 1; | ||
306 | pci_addr.s.did = 3; | ||
307 | pci_addr.s.subdid = 1; | ||
308 | pci_addr.s.endian_swap = 1; | ||
309 | pci_addr.s.bus = bus->number; | ||
310 | pci_addr.s.dev = devfn >> 3; | ||
311 | pci_addr.s.func = devfn & 0x7; | ||
312 | pci_addr.s.reg = reg; | ||
313 | |||
314 | #if PCI_CONFIG_SPACE_DELAY | ||
315 | udelay(PCI_CONFIG_SPACE_DELAY); | ||
316 | #endif | ||
317 | switch (size) { | ||
318 | case 4: | ||
319 | cvmx_write64_uint32(pci_addr.u64, cpu_to_le32(val)); | ||
320 | return PCIBIOS_SUCCESSFUL; | ||
321 | case 2: | ||
322 | cvmx_write64_uint16(pci_addr.u64, cpu_to_le16(val)); | ||
323 | return PCIBIOS_SUCCESSFUL; | ||
324 | case 1: | ||
325 | cvmx_write64_uint8(pci_addr.u64, val); | ||
326 | return PCIBIOS_SUCCESSFUL; | ||
327 | } | ||
328 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
329 | } | ||
330 | |||
331 | |||
332 | static struct pci_ops octeon_pci_ops = { | ||
333 | octeon_read_config, | ||
334 | octeon_write_config, | ||
335 | }; | ||
336 | |||
337 | static struct resource octeon_pci_mem_resource = { | ||
338 | .start = 0, | ||
339 | .end = 0, | ||
340 | .name = "Octeon PCI MEM", | ||
341 | .flags = IORESOURCE_MEM, | ||
342 | }; | ||
343 | |||
344 | /* | ||
345 | * PCI ports must be above 16KB so the ISA bus filtering in the PCI-X to PCI | ||
346 | * bridge | ||
347 | */ | ||
348 | static struct resource octeon_pci_io_resource = { | ||
349 | .start = 0x4000, | ||
350 | .end = OCTEON_PCI_IOSPACE_SIZE - 1, | ||
351 | .name = "Octeon PCI IO", | ||
352 | .flags = IORESOURCE_IO, | ||
353 | }; | ||
354 | |||
355 | static struct pci_controller octeon_pci_controller = { | ||
356 | .pci_ops = &octeon_pci_ops, | ||
357 | .mem_resource = &octeon_pci_mem_resource, | ||
358 | .mem_offset = OCTEON_PCI_MEMSPACE_OFFSET, | ||
359 | .io_resource = &octeon_pci_io_resource, | ||
360 | .io_offset = 0, | ||
361 | .io_map_base = OCTEON_PCI_IOSPACE_BASE, | ||
362 | }; | ||
363 | |||
364 | |||
365 | /* | ||
366 | * Low level initialize the Octeon PCI controller | ||
367 | */ | ||
368 | static void octeon_pci_initialize(void) | ||
369 | { | ||
370 | union cvmx_pci_cfg01 cfg01; | ||
371 | union cvmx_npi_ctl_status ctl_status; | ||
372 | union cvmx_pci_ctl_status_2 ctl_status_2; | ||
373 | union cvmx_pci_cfg19 cfg19; | ||
374 | union cvmx_pci_cfg16 cfg16; | ||
375 | union cvmx_pci_cfg22 cfg22; | ||
376 | union cvmx_pci_cfg56 cfg56; | ||
377 | |||
378 | /* Reset the PCI Bus */ | ||
379 | cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x1); | ||
380 | cvmx_read_csr(CVMX_CIU_SOFT_PRST); | ||
381 | |||
382 | udelay(2000); /* Hold PCI reset for 2 ms */ | ||
383 | |||
384 | ctl_status.u64 = 0; /* cvmx_read_csr(CVMX_NPI_CTL_STATUS); */ | ||
385 | ctl_status.s.max_word = 1; | ||
386 | ctl_status.s.timer = 1; | ||
387 | cvmx_write_csr(CVMX_NPI_CTL_STATUS, ctl_status.u64); | ||
388 | |||
389 | /* Deassert PCI reset and advertize PCX Host Mode Device Capability | ||
390 | (64b) */ | ||
391 | cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x4); | ||
392 | cvmx_read_csr(CVMX_CIU_SOFT_PRST); | ||
393 | |||
394 | udelay(2000); /* Wait 2 ms after deasserting PCI reset */ | ||
395 | |||
396 | ctl_status_2.u32 = 0; | ||
397 | ctl_status_2.s.tsr_hwm = 1; /* Initializes to 0. Must be set | ||
398 | before any PCI reads. */ | ||
399 | ctl_status_2.s.bar2pres = 1; /* Enable BAR2 */ | ||
400 | ctl_status_2.s.bar2_enb = 1; | ||
401 | ctl_status_2.s.bar2_cax = 1; /* Don't use L2 */ | ||
402 | ctl_status_2.s.bar2_esx = 1; | ||
403 | ctl_status_2.s.pmo_amod = 1; /* Round robin priority */ | ||
404 | if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) { | ||
405 | /* BAR1 hole */ | ||
406 | ctl_status_2.s.bb1_hole = OCTEON_PCI_BAR1_HOLE_BITS; | ||
407 | ctl_status_2.s.bb1_siz = 1; /* BAR1 is 2GB */ | ||
408 | ctl_status_2.s.bb_ca = 1; /* Don't use L2 with big bars */ | ||
409 | ctl_status_2.s.bb_es = 1; /* Big bar in byte swap mode */ | ||
410 | ctl_status_2.s.bb1 = 1; /* BAR1 is big */ | ||
411 | ctl_status_2.s.bb0 = 1; /* BAR0 is big */ | ||
412 | } | ||
413 | |||
414 | octeon_npi_write32(CVMX_NPI_PCI_CTL_STATUS_2, ctl_status_2.u32); | ||
415 | udelay(2000); /* Wait 2 ms before doing PCI reads */ | ||
416 | |||
417 | ctl_status_2.u32 = octeon_npi_read32(CVMX_NPI_PCI_CTL_STATUS_2); | ||
418 | pr_notice("PCI Status: %s %s-bit\n", | ||
419 | ctl_status_2.s.ap_pcix ? "PCI-X" : "PCI", | ||
420 | ctl_status_2.s.ap_64ad ? "64" : "32"); | ||
421 | |||
422 | if (OCTEON_IS_MODEL(OCTEON_CN58XX) || OCTEON_IS_MODEL(OCTEON_CN50XX)) { | ||
423 | union cvmx_pci_cnt_reg cnt_reg_start; | ||
424 | union cvmx_pci_cnt_reg cnt_reg_end; | ||
425 | unsigned long cycles, pci_clock; | ||
426 | |||
427 | cnt_reg_start.u64 = cvmx_read_csr(CVMX_NPI_PCI_CNT_REG); | ||
428 | cycles = read_c0_cvmcount(); | ||
429 | udelay(1000); | ||
430 | cnt_reg_end.u64 = cvmx_read_csr(CVMX_NPI_PCI_CNT_REG); | ||
431 | cycles = read_c0_cvmcount() - cycles; | ||
432 | pci_clock = (cnt_reg_end.s.pcicnt - cnt_reg_start.s.pcicnt) / | ||
433 | (cycles / (mips_hpt_frequency / 1000000)); | ||
434 | pr_notice("PCI Clock: %lu MHz\n", pci_clock); | ||
435 | } | ||
436 | |||
437 | /* | ||
438 | * TDOMC must be set to one in PCI mode. TDOMC should be set to 4 | ||
439 | * in PCI-X mode to allow four oustanding splits. Otherwise, | ||
440 | * should not change from its reset value. Don't write PCI_CFG19 | ||
441 | * in PCI mode (0x82000001 reset value), write it to 0x82000004 | ||
442 | * after PCI-X mode is known. MRBCI,MDWE,MDRE -> must be zero. | ||
443 | * MRBCM -> must be one. | ||
444 | */ | ||
445 | if (ctl_status_2.s.ap_pcix) { | ||
446 | cfg19.u32 = 0; | ||
447 | /* | ||
448 | * Target Delayed/Split request outstanding maximum | ||
449 | * count. [1..31] and 0=32. NOTE: If the user | ||
450 | * programs these bits beyond the Designed Maximum | ||
451 | * outstanding count, then the designed maximum table | ||
452 | * depth will be used instead. No additional | ||
453 | * Deferred/Split transactions will be accepted if | ||
454 | * this outstanding maximum count is | ||
455 | * reached. Furthermore, no additional deferred/split | ||
456 | * transactions will be accepted if the I/O delay/ I/O | ||
457 | * Split Request outstanding maximum is reached. | ||
458 | */ | ||
459 | cfg19.s.tdomc = 4; | ||
460 | /* | ||
461 | * Master Deferred Read Request Outstanding Max Count | ||
462 | * (PCI only). CR4C[26:24] Max SAC cycles MAX DAC | ||
463 | * cycles 000 8 4 001 1 0 010 2 1 011 3 1 100 4 2 101 | ||
464 | * 5 2 110 6 3 111 7 3 For example, if these bits are | ||
465 | * programmed to 100, the core can support 2 DAC | ||
466 | * cycles, 4 SAC cycles or a combination of 1 DAC and | ||
467 | * 2 SAC cycles. NOTE: For the PCI-X maximum | ||
468 | * outstanding split transactions, refer to | ||
469 | * CRE0[22:20]. | ||
470 | */ | ||
471 | cfg19.s.mdrrmc = 2; | ||
472 | /* | ||
473 | * Master Request (Memory Read) Byte Count/Byte Enable | ||
474 | * select. 0 = Byte Enables valid. In PCI mode, a | ||
475 | * burst transaction cannot be performed using Memory | ||
476 | * Read command=4?h6. 1 = DWORD Byte Count valid | ||
477 | * (default). In PCI Mode, the memory read byte | ||
478 | * enables are automatically generated by the | ||
479 | * core. Note: N3 Master Request transaction sizes are | ||
480 | * always determined through the | ||
481 | * am_attr[<35:32>|<7:0>] field. | ||
482 | */ | ||
483 | cfg19.s.mrbcm = 1; | ||
484 | octeon_npi_write32(CVMX_NPI_PCI_CFG19, cfg19.u32); | ||
485 | } | ||
486 | |||
487 | |||
488 | cfg01.u32 = 0; | ||
489 | cfg01.s.msae = 1; /* Memory Space Access Enable */ | ||
490 | cfg01.s.me = 1; /* Master Enable */ | ||
491 | cfg01.s.pee = 1; /* PERR# Enable */ | ||
492 | cfg01.s.see = 1; /* System Error Enable */ | ||
493 | cfg01.s.fbbe = 1; /* Fast Back to Back Transaction Enable */ | ||
494 | |||
495 | octeon_npi_write32(CVMX_NPI_PCI_CFG01, cfg01.u32); | ||
496 | |||
497 | #ifdef USE_OCTEON_INTERNAL_ARBITER | ||
498 | /* | ||
499 | * When OCTEON is a PCI host, most systems will use OCTEON's | ||
500 | * internal arbiter, so must enable it before any PCI/PCI-X | ||
501 | * traffic can occur. | ||
502 | */ | ||
503 | { | ||
504 | union cvmx_npi_pci_int_arb_cfg pci_int_arb_cfg; | ||
505 | |||
506 | pci_int_arb_cfg.u64 = 0; | ||
507 | pci_int_arb_cfg.s.en = 1; /* Internal arbiter enable */ | ||
508 | cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, pci_int_arb_cfg.u64); | ||
509 | } | ||
510 | #endif /* USE_OCTEON_INTERNAL_ARBITER */ | ||
511 | |||
512 | /* | ||
513 | * Preferrably written to 1 to set MLTD. [RDSATI,TRTAE, | ||
514 | * TWTAE,TMAE,DPPMR -> must be zero. TILT -> must not be set to | ||
515 | * 1..7. | ||
516 | */ | ||
517 | cfg16.u32 = 0; | ||
518 | cfg16.s.mltd = 1; /* Master Latency Timer Disable */ | ||
519 | octeon_npi_write32(CVMX_NPI_PCI_CFG16, cfg16.u32); | ||
520 | |||
521 | /* | ||
522 | * Should be written to 0x4ff00. MTTV -> must be zero. | ||
523 | * FLUSH -> must be 1. MRV -> should be 0xFF. | ||
524 | */ | ||
525 | cfg22.u32 = 0; | ||
526 | /* Master Retry Value [1..255] and 0=infinite */ | ||
527 | cfg22.s.mrv = 0xff; | ||
528 | /* | ||
529 | * AM_DO_FLUSH_I control NOTE: This bit MUST BE ONE for proper | ||
530 | * N3K operation. | ||
531 | */ | ||
532 | cfg22.s.flush = 1; | ||
533 | octeon_npi_write32(CVMX_NPI_PCI_CFG22, cfg22.u32); | ||
534 | |||
535 | /* | ||
536 | * MOST Indicates the maximum number of outstanding splits (in -1 | ||
537 | * notation) when OCTEON is in PCI-X mode. PCI-X performance is | ||
538 | * affected by the MOST selection. Should generally be written | ||
539 | * with one of 0x3be807, 0x2be807, 0x1be807, or 0x0be807, | ||
540 | * depending on the desired MOST of 3, 2, 1, or 0, respectively. | ||
541 | */ | ||
542 | cfg56.u32 = 0; | ||
543 | cfg56.s.pxcid = 7; /* RO - PCI-X Capability ID */ | ||
544 | cfg56.s.ncp = 0xe8; /* RO - Next Capability Pointer */ | ||
545 | cfg56.s.dpere = 1; /* Data Parity Error Recovery Enable */ | ||
546 | cfg56.s.roe = 1; /* Relaxed Ordering Enable */ | ||
547 | cfg56.s.mmbc = 1; /* Maximum Memory Byte Count | ||
548 | [0=512B,1=1024B,2=2048B,3=4096B] */ | ||
549 | cfg56.s.most = 3; /* Maximum outstanding Split transactions [0=1 | ||
550 | .. 7=32] */ | ||
551 | |||
552 | octeon_npi_write32(CVMX_NPI_PCI_CFG56, cfg56.u32); | ||
553 | |||
554 | /* | ||
555 | * Affects PCI performance when OCTEON services reads to its | ||
556 | * BAR1/BAR2. Refer to Section 10.6.1. The recommended values are | ||
557 | * 0x22, 0x33, and 0x33 for PCI_READ_CMD_6, PCI_READ_CMD_C, and | ||
558 | * PCI_READ_CMD_E, respectively. Unfortunately due to errata DDR-700, | ||
559 | * these values need to be changed so they won't possibly prefetch off | ||
560 | * of the end of memory if PCI is DMAing a buffer at the end of | ||
561 | * memory. Note that these values differ from their reset values. | ||
562 | */ | ||
563 | octeon_npi_write32(CVMX_NPI_PCI_READ_CMD_6, 0x21); | ||
564 | octeon_npi_write32(CVMX_NPI_PCI_READ_CMD_C, 0x31); | ||
565 | octeon_npi_write32(CVMX_NPI_PCI_READ_CMD_E, 0x31); | ||
566 | } | ||
567 | |||
568 | |||
569 | /* | ||
570 | * Initialize the Octeon PCI controller | ||
571 | */ | ||
572 | static int __init octeon_pci_setup(void) | ||
573 | { | ||
574 | union cvmx_npi_mem_access_subidx mem_access; | ||
575 | int index; | ||
576 | |||
577 | /* Only these chips have PCI */ | ||
578 | if (octeon_has_feature(OCTEON_FEATURE_PCIE)) | ||
579 | return 0; | ||
580 | |||
581 | /* Point pcibios_map_irq() to the PCI version of it */ | ||
582 | octeon_pcibios_map_irq = octeon_pci_pcibios_map_irq; | ||
583 | |||
584 | /* Only use the big bars on chips that support it */ | ||
585 | if (OCTEON_IS_MODEL(OCTEON_CN31XX) || | ||
586 | OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2) || | ||
587 | OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1)) | ||
588 | octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_SMALL; | ||
589 | else | ||
590 | octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG; | ||
591 | |||
592 | /* PCI I/O and PCI MEM values */ | ||
593 | set_io_port_base(OCTEON_PCI_IOSPACE_BASE); | ||
594 | ioport_resource.start = 0; | ||
595 | ioport_resource.end = OCTEON_PCI_IOSPACE_SIZE - 1; | ||
596 | if (!octeon_is_pci_host()) { | ||
597 | pr_notice("Not in host mode, PCI Controller not initialized\n"); | ||
598 | return 0; | ||
599 | } | ||
600 | |||
601 | pr_notice("%s Octeon big bar support\n", | ||
602 | (octeon_dma_bar_type == | ||
603 | OCTEON_DMA_BAR_TYPE_BIG) ? "Enabling" : "Disabling"); | ||
604 | |||
605 | octeon_pci_initialize(); | ||
606 | |||
607 | mem_access.u64 = 0; | ||
608 | mem_access.s.esr = 1; /* Endian-Swap on read. */ | ||
609 | mem_access.s.esw = 1; /* Endian-Swap on write. */ | ||
610 | mem_access.s.nsr = 0; /* No-Snoop on read. */ | ||
611 | mem_access.s.nsw = 0; /* No-Snoop on write. */ | ||
612 | mem_access.s.ror = 0; /* Relax Read on read. */ | ||
613 | mem_access.s.row = 0; /* Relax Order on write. */ | ||
614 | mem_access.s.ba = 0; /* PCI Address bits [63:36]. */ | ||
615 | cvmx_write_csr(CVMX_NPI_MEM_ACCESS_SUBID3, mem_access.u64); | ||
616 | |||
617 | /* | ||
618 | * Remap the Octeon BAR 2 above all 32 bit devices | ||
619 | * (0x8000000000ul). This is done here so it is remapped | ||
620 | * before the readl()'s below. We don't want BAR2 overlapping | ||
621 | * with BAR0/BAR1 during these reads. | ||
622 | */ | ||
623 | octeon_npi_write32(CVMX_NPI_PCI_CFG08, 0); | ||
624 | octeon_npi_write32(CVMX_NPI_PCI_CFG09, 0x80); | ||
625 | |||
626 | /* Disable the BAR1 movable mappings */ | ||
627 | for (index = 0; index < 32; index++) | ||
628 | octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), 0); | ||
629 | |||
630 | if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) { | ||
631 | /* Remap the Octeon BAR 0 to 0-2GB */ | ||
632 | octeon_npi_write32(CVMX_NPI_PCI_CFG04, 0); | ||
633 | octeon_npi_write32(CVMX_NPI_PCI_CFG05, 0); | ||
634 | |||
635 | /* | ||
636 | * Remap the Octeon BAR 1 to map 2GB-4GB (minus the | ||
637 | * BAR 1 hole). | ||
638 | */ | ||
639 | octeon_npi_write32(CVMX_NPI_PCI_CFG06, 2ul << 30); | ||
640 | octeon_npi_write32(CVMX_NPI_PCI_CFG07, 0); | ||
641 | |||
642 | /* Devices go after BAR1 */ | ||
643 | octeon_pci_mem_resource.start = | ||
644 | OCTEON_PCI_MEMSPACE_OFFSET + (4ul << 30) - | ||
645 | (OCTEON_PCI_BAR1_HOLE_SIZE << 20); | ||
646 | octeon_pci_mem_resource.end = | ||
647 | octeon_pci_mem_resource.start + (1ul << 30); | ||
648 | } else { | ||
649 | /* Remap the Octeon BAR 0 to map 128MB-(128MB+4KB) */ | ||
650 | octeon_npi_write32(CVMX_NPI_PCI_CFG04, 128ul << 20); | ||
651 | octeon_npi_write32(CVMX_NPI_PCI_CFG05, 0); | ||
652 | |||
653 | /* Remap the Octeon BAR 1 to map 0-128MB */ | ||
654 | octeon_npi_write32(CVMX_NPI_PCI_CFG06, 0); | ||
655 | octeon_npi_write32(CVMX_NPI_PCI_CFG07, 0); | ||
656 | |||
657 | /* Devices go after BAR0 */ | ||
658 | octeon_pci_mem_resource.start = | ||
659 | OCTEON_PCI_MEMSPACE_OFFSET + (128ul << 20) + | ||
660 | (4ul << 10); | ||
661 | octeon_pci_mem_resource.end = | ||
662 | octeon_pci_mem_resource.start + (1ul << 30); | ||
663 | } | ||
664 | |||
665 | register_pci_controller(&octeon_pci_controller); | ||
666 | |||
667 | /* | ||
668 | * Clear any errors that might be pending from before the bus | ||
669 | * was setup properly. | ||
670 | */ | ||
671 | cvmx_write_csr(CVMX_NPI_PCI_INT_SUM2, -1); | ||
672 | return 0; | ||
673 | } | ||
674 | |||
675 | arch_initcall(octeon_pci_setup); | ||
diff --git a/arch/mips/pci/pci-tx4927.c b/arch/mips/pci/pci-tx4927.c index aaa900596792..a5807406a7f1 100644 --- a/arch/mips/pci/pci-tx4927.c +++ b/arch/mips/pci/pci-tx4927.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/pci/pci-tx4927.c | ||
3 | * | ||
4 | * Based on linux/arch/mips/txx9/rbtx4938/setup.c, | 2 | * Based on linux/arch/mips/txx9/rbtx4938/setup.c, |
5 | * and RBTX49xx patch from CELF patch archive. | 3 | * and RBTX49xx patch from CELF patch archive. |
6 | * | 4 | * |
diff --git a/arch/mips/pci/pci-tx4938.c b/arch/mips/pci/pci-tx4938.c index 1ea257bc3b8f..20e45f30b2ef 100644 --- a/arch/mips/pci/pci-tx4938.c +++ b/arch/mips/pci/pci-tx4938.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/pci/pci-tx4938.c | ||
3 | * | ||
4 | * Based on linux/arch/mips/txx9/rbtx4938/setup.c, | 2 | * Based on linux/arch/mips/txx9/rbtx4938/setup.c, |
5 | * and RBTX49xx patch from CELF patch archive. | 3 | * and RBTX49xx patch from CELF patch archive. |
6 | * | 4 | * |
diff --git a/arch/mips/pci/pci-tx4939.c b/arch/mips/pci/pci-tx4939.c index 5fecf1cdc325..9ef840693baf 100644 --- a/arch/mips/pci/pci-tx4939.c +++ b/arch/mips/pci/pci-tx4939.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/pci/pci-tx4939.c | ||
3 | * | ||
4 | * Based on linux/arch/mips/txx9/rbtx4939/setup.c, | 2 | * Based on linux/arch/mips/txx9/rbtx4939/setup.c, |
5 | * and RBTX49xx patch from CELF patch archive. | 3 | * and RBTX49xx patch from CELF patch archive. |
6 | * | 4 | * |
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c index d1e049b55f34..56525711f8b7 100644 --- a/arch/mips/pci/pci-vr41xx.c +++ b/arch/mips/pci/pci-vr41xx.c | |||
@@ -2,8 +2,8 @@ | |||
2 | * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series. | 2 | * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2001-2003 MontaVista Software Inc. | 4 | * Copyright (C) 2001-2003 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> | 5 | * Author: Yoichi Yuasa <source@mvista.com> |
6 | * Copyright (C) 2004-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copyright (C) 2004-2008 Yoichi Yuasa <yuasa@linux-mips.org> |
7 | * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) | 7 | * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | /* | 23 | /* |
24 | * Changes: | 24 | * Changes: |
25 | * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> | 25 | * MontaVista Software Inc. <source@mvista.com> |
26 | * - New creation, NEC VR4122 and VR4131 are supported. | 26 | * - New creation, NEC VR4122 and VR4131 are supported. |
27 | */ | 27 | */ |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
diff --git a/arch/mips/pci/pci-vr41xx.h b/arch/mips/pci/pci-vr41xx.h index 8a35e32b8376..6b1ae2eb1c06 100644 --- a/arch/mips/pci/pci-vr41xx.h +++ b/arch/mips/pci/pci-vr41xx.h | |||
@@ -2,8 +2,8 @@ | |||
2 | * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series. | 2 | * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2002 MontaVista Software Inc. | 4 | * Copyright (C) 2002 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> | 5 | * Author: Yoichi Yuasa <source@mvista.com> |
6 | * Copyright (C) 2004-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/pci/pcie-octeon.c b/arch/mips/pci/pcie-octeon.c new file mode 100644 index 000000000000..6aa5c542d52d --- /dev/null +++ b/arch/mips/pci/pcie-octeon.c | |||
@@ -0,0 +1,1372 @@ | |||
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) 2007, 2008 Cavium Networks | ||
7 | */ | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/init.h> | ||
10 | #include <linux/pci.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/time.h> | ||
13 | #include <linux/delay.h> | ||
14 | |||
15 | #include <asm/octeon/octeon.h> | ||
16 | #include <asm/octeon/cvmx-npei-defs.h> | ||
17 | #include <asm/octeon/cvmx-pciercx-defs.h> | ||
18 | #include <asm/octeon/cvmx-pescx-defs.h> | ||
19 | #include <asm/octeon/cvmx-pexp-defs.h> | ||
20 | #include <asm/octeon/cvmx-helper-errata.h> | ||
21 | #include <asm/octeon/pci-octeon.h> | ||
22 | |||
23 | union cvmx_pcie_address { | ||
24 | uint64_t u64; | ||
25 | struct { | ||
26 | uint64_t upper:2; /* Normally 2 for XKPHYS */ | ||
27 | uint64_t reserved_49_61:13; /* Must be zero */ | ||
28 | uint64_t io:1; /* 1 for IO space access */ | ||
29 | uint64_t did:5; /* PCIe DID = 3 */ | ||
30 | uint64_t subdid:3; /* PCIe SubDID = 1 */ | ||
31 | uint64_t reserved_36_39:4; /* Must be zero */ | ||
32 | uint64_t es:2; /* Endian swap = 1 */ | ||
33 | uint64_t port:2; /* PCIe port 0,1 */ | ||
34 | uint64_t reserved_29_31:3; /* Must be zero */ | ||
35 | /* | ||
36 | * Selects the type of the configuration request (0 = type 0, | ||
37 | * 1 = type 1). | ||
38 | */ | ||
39 | uint64_t ty:1; | ||
40 | /* Target bus number sent in the ID in the request. */ | ||
41 | uint64_t bus:8; | ||
42 | /* | ||
43 | * Target device number sent in the ID in the | ||
44 | * request. Note that Dev must be zero for type 0 | ||
45 | * configuration requests. | ||
46 | */ | ||
47 | uint64_t dev:5; | ||
48 | /* Target function number sent in the ID in the request. */ | ||
49 | uint64_t func:3; | ||
50 | /* | ||
51 | * Selects a register in the configuration space of | ||
52 | * the target. | ||
53 | */ | ||
54 | uint64_t reg:12; | ||
55 | } config; | ||
56 | struct { | ||
57 | uint64_t upper:2; /* Normally 2 for XKPHYS */ | ||
58 | uint64_t reserved_49_61:13; /* Must be zero */ | ||
59 | uint64_t io:1; /* 1 for IO space access */ | ||
60 | uint64_t did:5; /* PCIe DID = 3 */ | ||
61 | uint64_t subdid:3; /* PCIe SubDID = 2 */ | ||
62 | uint64_t reserved_36_39:4; /* Must be zero */ | ||
63 | uint64_t es:2; /* Endian swap = 1 */ | ||
64 | uint64_t port:2; /* PCIe port 0,1 */ | ||
65 | uint64_t address:32; /* PCIe IO address */ | ||
66 | } io; | ||
67 | struct { | ||
68 | uint64_t upper:2; /* Normally 2 for XKPHYS */ | ||
69 | uint64_t reserved_49_61:13; /* Must be zero */ | ||
70 | uint64_t io:1; /* 1 for IO space access */ | ||
71 | uint64_t did:5; /* PCIe DID = 3 */ | ||
72 | uint64_t subdid:3; /* PCIe SubDID = 3-6 */ | ||
73 | uint64_t reserved_36_39:4; /* Must be zero */ | ||
74 | uint64_t address:36; /* PCIe Mem address */ | ||
75 | } mem; | ||
76 | }; | ||
77 | |||
78 | /** | ||
79 | * Return the Core virtual base address for PCIe IO access. IOs are | ||
80 | * read/written as an offset from this address. | ||
81 | * | ||
82 | * @pcie_port: PCIe port the IO is for | ||
83 | * | ||
84 | * Returns 64bit Octeon IO base address for read/write | ||
85 | */ | ||
86 | static inline uint64_t cvmx_pcie_get_io_base_address(int pcie_port) | ||
87 | { | ||
88 | union cvmx_pcie_address pcie_addr; | ||
89 | pcie_addr.u64 = 0; | ||
90 | pcie_addr.io.upper = 0; | ||
91 | pcie_addr.io.io = 1; | ||
92 | pcie_addr.io.did = 3; | ||
93 | pcie_addr.io.subdid = 2; | ||
94 | pcie_addr.io.es = 1; | ||
95 | pcie_addr.io.port = pcie_port; | ||
96 | return pcie_addr.u64; | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * Size of the IO address region returned at address | ||
101 | * cvmx_pcie_get_io_base_address() | ||
102 | * | ||
103 | * @pcie_port: PCIe port the IO is for | ||
104 | * | ||
105 | * Returns Size of the IO window | ||
106 | */ | ||
107 | static inline uint64_t cvmx_pcie_get_io_size(int pcie_port) | ||
108 | { | ||
109 | return 1ull << 32; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * Return the Core virtual base address for PCIe MEM access. Memory is | ||
114 | * read/written as an offset from this address. | ||
115 | * | ||
116 | * @pcie_port: PCIe port the IO is for | ||
117 | * | ||
118 | * Returns 64bit Octeon IO base address for read/write | ||
119 | */ | ||
120 | static inline uint64_t cvmx_pcie_get_mem_base_address(int pcie_port) | ||
121 | { | ||
122 | union cvmx_pcie_address pcie_addr; | ||
123 | pcie_addr.u64 = 0; | ||
124 | pcie_addr.mem.upper = 0; | ||
125 | pcie_addr.mem.io = 1; | ||
126 | pcie_addr.mem.did = 3; | ||
127 | pcie_addr.mem.subdid = 3 + pcie_port; | ||
128 | return pcie_addr.u64; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * Size of the Mem address region returned at address | ||
133 | * cvmx_pcie_get_mem_base_address() | ||
134 | * | ||
135 | * @pcie_port: PCIe port the IO is for | ||
136 | * | ||
137 | * Returns Size of the Mem window | ||
138 | */ | ||
139 | static inline uint64_t cvmx_pcie_get_mem_size(int pcie_port) | ||
140 | { | ||
141 | return 1ull << 36; | ||
142 | } | ||
143 | |||
144 | /** | ||
145 | * Read a PCIe config space register indirectly. This is used for | ||
146 | * registers of the form PCIEEP_CFG??? and PCIERC?_CFG???. | ||
147 | * | ||
148 | * @pcie_port: PCIe port to read from | ||
149 | * @cfg_offset: Address to read | ||
150 | * | ||
151 | * Returns Value read | ||
152 | */ | ||
153 | static uint32_t cvmx_pcie_cfgx_read(int pcie_port, uint32_t cfg_offset) | ||
154 | { | ||
155 | union cvmx_pescx_cfg_rd pescx_cfg_rd; | ||
156 | pescx_cfg_rd.u64 = 0; | ||
157 | pescx_cfg_rd.s.addr = cfg_offset; | ||
158 | cvmx_write_csr(CVMX_PESCX_CFG_RD(pcie_port), pescx_cfg_rd.u64); | ||
159 | pescx_cfg_rd.u64 = cvmx_read_csr(CVMX_PESCX_CFG_RD(pcie_port)); | ||
160 | return pescx_cfg_rd.s.data; | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * Write a PCIe config space register indirectly. This is used for | ||
165 | * registers of the form PCIEEP_CFG??? and PCIERC?_CFG???. | ||
166 | * | ||
167 | * @pcie_port: PCIe port to write to | ||
168 | * @cfg_offset: Address to write | ||
169 | * @val: Value to write | ||
170 | */ | ||
171 | static void cvmx_pcie_cfgx_write(int pcie_port, uint32_t cfg_offset, | ||
172 | uint32_t val) | ||
173 | { | ||
174 | union cvmx_pescx_cfg_wr pescx_cfg_wr; | ||
175 | pescx_cfg_wr.u64 = 0; | ||
176 | pescx_cfg_wr.s.addr = cfg_offset; | ||
177 | pescx_cfg_wr.s.data = val; | ||
178 | cvmx_write_csr(CVMX_PESCX_CFG_WR(pcie_port), pescx_cfg_wr.u64); | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * Build a PCIe config space request address for a device | ||
183 | * | ||
184 | * @pcie_port: PCIe port to access | ||
185 | * @bus: Sub bus | ||
186 | * @dev: Device ID | ||
187 | * @fn: Device sub function | ||
188 | * @reg: Register to access | ||
189 | * | ||
190 | * Returns 64bit Octeon IO address | ||
191 | */ | ||
192 | static inline uint64_t __cvmx_pcie_build_config_addr(int pcie_port, int bus, | ||
193 | int dev, int fn, int reg) | ||
194 | { | ||
195 | union cvmx_pcie_address pcie_addr; | ||
196 | union cvmx_pciercx_cfg006 pciercx_cfg006; | ||
197 | |||
198 | pciercx_cfg006.u32 = | ||
199 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG006(pcie_port)); | ||
200 | if ((bus <= pciercx_cfg006.s.pbnum) && (dev != 0)) | ||
201 | return 0; | ||
202 | |||
203 | pcie_addr.u64 = 0; | ||
204 | pcie_addr.config.upper = 2; | ||
205 | pcie_addr.config.io = 1; | ||
206 | pcie_addr.config.did = 3; | ||
207 | pcie_addr.config.subdid = 1; | ||
208 | pcie_addr.config.es = 1; | ||
209 | pcie_addr.config.port = pcie_port; | ||
210 | pcie_addr.config.ty = (bus > pciercx_cfg006.s.pbnum); | ||
211 | pcie_addr.config.bus = bus; | ||
212 | pcie_addr.config.dev = dev; | ||
213 | pcie_addr.config.func = fn; | ||
214 | pcie_addr.config.reg = reg; | ||
215 | return pcie_addr.u64; | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * Read 8bits from a Device's config space | ||
220 | * | ||
221 | * @pcie_port: PCIe port the device is on | ||
222 | * @bus: Sub bus | ||
223 | * @dev: Device ID | ||
224 | * @fn: Device sub function | ||
225 | * @reg: Register to access | ||
226 | * | ||
227 | * Returns Result of the read | ||
228 | */ | ||
229 | static uint8_t cvmx_pcie_config_read8(int pcie_port, int bus, int dev, | ||
230 | int fn, int reg) | ||
231 | { | ||
232 | uint64_t address = | ||
233 | __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); | ||
234 | if (address) | ||
235 | return cvmx_read64_uint8(address); | ||
236 | else | ||
237 | return 0xff; | ||
238 | } | ||
239 | |||
240 | /** | ||
241 | * Read 16bits from a Device's config space | ||
242 | * | ||
243 | * @pcie_port: PCIe port the device is on | ||
244 | * @bus: Sub bus | ||
245 | * @dev: Device ID | ||
246 | * @fn: Device sub function | ||
247 | * @reg: Register to access | ||
248 | * | ||
249 | * Returns Result of the read | ||
250 | */ | ||
251 | static uint16_t cvmx_pcie_config_read16(int pcie_port, int bus, int dev, | ||
252 | int fn, int reg) | ||
253 | { | ||
254 | uint64_t address = | ||
255 | __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); | ||
256 | if (address) | ||
257 | return le16_to_cpu(cvmx_read64_uint16(address)); | ||
258 | else | ||
259 | return 0xffff; | ||
260 | } | ||
261 | |||
262 | /** | ||
263 | * Read 32bits from a Device's config space | ||
264 | * | ||
265 | * @pcie_port: PCIe port the device is on | ||
266 | * @bus: Sub bus | ||
267 | * @dev: Device ID | ||
268 | * @fn: Device sub function | ||
269 | * @reg: Register to access | ||
270 | * | ||
271 | * Returns Result of the read | ||
272 | */ | ||
273 | static uint32_t cvmx_pcie_config_read32(int pcie_port, int bus, int dev, | ||
274 | int fn, int reg) | ||
275 | { | ||
276 | uint64_t address = | ||
277 | __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); | ||
278 | if (address) | ||
279 | return le32_to_cpu(cvmx_read64_uint32(address)); | ||
280 | else | ||
281 | return 0xffffffff; | ||
282 | } | ||
283 | |||
284 | /** | ||
285 | * Write 8bits to a Device's config space | ||
286 | * | ||
287 | * @pcie_port: PCIe port the device is on | ||
288 | * @bus: Sub bus | ||
289 | * @dev: Device ID | ||
290 | * @fn: Device sub function | ||
291 | * @reg: Register to access | ||
292 | * @val: Value to write | ||
293 | */ | ||
294 | static void cvmx_pcie_config_write8(int pcie_port, int bus, int dev, int fn, | ||
295 | int reg, uint8_t val) | ||
296 | { | ||
297 | uint64_t address = | ||
298 | __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); | ||
299 | if (address) | ||
300 | cvmx_write64_uint8(address, val); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Write 16bits to a Device's config space | ||
305 | * | ||
306 | * @pcie_port: PCIe port the device is on | ||
307 | * @bus: Sub bus | ||
308 | * @dev: Device ID | ||
309 | * @fn: Device sub function | ||
310 | * @reg: Register to access | ||
311 | * @val: Value to write | ||
312 | */ | ||
313 | static void cvmx_pcie_config_write16(int pcie_port, int bus, int dev, int fn, | ||
314 | int reg, uint16_t val) | ||
315 | { | ||
316 | uint64_t address = | ||
317 | __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); | ||
318 | if (address) | ||
319 | cvmx_write64_uint16(address, cpu_to_le16(val)); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Write 32bits to a Device's config space | ||
324 | * | ||
325 | * @pcie_port: PCIe port the device is on | ||
326 | * @bus: Sub bus | ||
327 | * @dev: Device ID | ||
328 | * @fn: Device sub function | ||
329 | * @reg: Register to access | ||
330 | * @val: Value to write | ||
331 | */ | ||
332 | static void cvmx_pcie_config_write32(int pcie_port, int bus, int dev, int fn, | ||
333 | int reg, uint32_t val) | ||
334 | { | ||
335 | uint64_t address = | ||
336 | __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); | ||
337 | if (address) | ||
338 | cvmx_write64_uint32(address, cpu_to_le32(val)); | ||
339 | } | ||
340 | |||
341 | /** | ||
342 | * Initialize the RC config space CSRs | ||
343 | * | ||
344 | * @pcie_port: PCIe port to initialize | ||
345 | */ | ||
346 | static void __cvmx_pcie_rc_initialize_config_space(int pcie_port) | ||
347 | { | ||
348 | union cvmx_pciercx_cfg030 pciercx_cfg030; | ||
349 | union cvmx_npei_ctl_status2 npei_ctl_status2; | ||
350 | union cvmx_pciercx_cfg070 pciercx_cfg070; | ||
351 | union cvmx_pciercx_cfg001 pciercx_cfg001; | ||
352 | union cvmx_pciercx_cfg032 pciercx_cfg032; | ||
353 | union cvmx_pciercx_cfg006 pciercx_cfg006; | ||
354 | union cvmx_pciercx_cfg008 pciercx_cfg008; | ||
355 | union cvmx_pciercx_cfg009 pciercx_cfg009; | ||
356 | union cvmx_pciercx_cfg010 pciercx_cfg010; | ||
357 | union cvmx_pciercx_cfg011 pciercx_cfg011; | ||
358 | union cvmx_pciercx_cfg035 pciercx_cfg035; | ||
359 | union cvmx_pciercx_cfg075 pciercx_cfg075; | ||
360 | union cvmx_pciercx_cfg034 pciercx_cfg034; | ||
361 | |||
362 | /* Max Payload Size (PCIE*_CFG030[MPS]) */ | ||
363 | /* Max Read Request Size (PCIE*_CFG030[MRRS]) */ | ||
364 | /* Relaxed-order, no-snoop enables (PCIE*_CFG030[RO_EN,NS_EN] */ | ||
365 | /* Error Message Enables (PCIE*_CFG030[CE_EN,NFE_EN,FE_EN,UR_EN]) */ | ||
366 | pciercx_cfg030.u32 = | ||
367 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG030(pcie_port)); | ||
368 | /* | ||
369 | * Max payload size = 128 bytes for best Octeon DMA | ||
370 | * performance. | ||
371 | */ | ||
372 | pciercx_cfg030.s.mps = 0; | ||
373 | /* | ||
374 | * Max read request size = 128 bytes for best Octeon DMA | ||
375 | * performance. | ||
376 | */ | ||
377 | pciercx_cfg030.s.mrrs = 0; | ||
378 | /* Enable relaxed ordering. */ | ||
379 | pciercx_cfg030.s.ro_en = 1; | ||
380 | /* Enable no snoop. */ | ||
381 | pciercx_cfg030.s.ns_en = 1; | ||
382 | /* Correctable error reporting enable. */ | ||
383 | pciercx_cfg030.s.ce_en = 1; | ||
384 | /* Non-fatal error reporting enable. */ | ||
385 | pciercx_cfg030.s.nfe_en = 1; | ||
386 | /* Fatal error reporting enable. */ | ||
387 | pciercx_cfg030.s.fe_en = 1; | ||
388 | /* Unsupported request reporting enable. */ | ||
389 | pciercx_cfg030.s.ur_en = 1; | ||
390 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG030(pcie_port), | ||
391 | pciercx_cfg030.u32); | ||
392 | |||
393 | /* | ||
394 | * Max Payload Size (NPEI_CTL_STATUS2[MPS]) must match | ||
395 | * PCIE*_CFG030[MPS] | ||
396 | * | ||
397 | * Max Read Request Size (NPEI_CTL_STATUS2[MRRS]) must not | ||
398 | * exceed PCIE*_CFG030[MRRS]. | ||
399 | */ | ||
400 | npei_ctl_status2.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS2); | ||
401 | /* Max payload size = 128 bytes for best Octeon DMA performance */ | ||
402 | npei_ctl_status2.s.mps = 0; | ||
403 | /* Max read request size = 128 bytes for best Octeon DMA performance */ | ||
404 | npei_ctl_status2.s.mrrs = 0; | ||
405 | cvmx_write_csr(CVMX_PEXP_NPEI_CTL_STATUS2, npei_ctl_status2.u64); | ||
406 | |||
407 | /* ECRC Generation (PCIE*_CFG070[GE,CE]) */ | ||
408 | pciercx_cfg070.u32 = | ||
409 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG070(pcie_port)); | ||
410 | pciercx_cfg070.s.ge = 1; /* ECRC generation enable. */ | ||
411 | pciercx_cfg070.s.ce = 1; /* ECRC check enable. */ | ||
412 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG070(pcie_port), | ||
413 | pciercx_cfg070.u32); | ||
414 | |||
415 | /* | ||
416 | * Access Enables (PCIE*_CFG001[MSAE,ME]) ME and MSAE should | ||
417 | * always be set. | ||
418 | * | ||
419 | * Interrupt Disable (PCIE*_CFG001[I_DIS]) System Error | ||
420 | * Message Enable (PCIE*_CFG001[SEE]) | ||
421 | */ | ||
422 | pciercx_cfg001.u32 = | ||
423 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG001(pcie_port)); | ||
424 | pciercx_cfg001.s.msae = 1; /* Memory space enable. */ | ||
425 | pciercx_cfg001.s.me = 1; /* Bus master enable. */ | ||
426 | pciercx_cfg001.s.i_dis = 1; /* INTx assertion disable. */ | ||
427 | pciercx_cfg001.s.see = 1; /* SERR# enable */ | ||
428 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG001(pcie_port), | ||
429 | pciercx_cfg001.u32); | ||
430 | |||
431 | /* Advanced Error Recovery Message Enables */ | ||
432 | /* (PCIE*_CFG066,PCIE*_CFG067,PCIE*_CFG069) */ | ||
433 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG066(pcie_port), 0); | ||
434 | /* Use CVMX_PCIERCX_CFG067 hardware default */ | ||
435 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG069(pcie_port), 0); | ||
436 | |||
437 | /* Active State Power Management (PCIE*_CFG032[ASLPC]) */ | ||
438 | pciercx_cfg032.u32 = | ||
439 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); | ||
440 | pciercx_cfg032.s.aslpc = 0; /* Active state Link PM control. */ | ||
441 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG032(pcie_port), | ||
442 | pciercx_cfg032.u32); | ||
443 | |||
444 | /* Entrance Latencies (PCIE*_CFG451[L0EL,L1EL]) */ | ||
445 | |||
446 | /* | ||
447 | * Link Width Mode (PCIERCn_CFG452[LME]) - Set during | ||
448 | * cvmx_pcie_rc_initialize_link() | ||
449 | * | ||
450 | * Primary Bus Number (PCIERCn_CFG006[PBNUM]) | ||
451 | * | ||
452 | * We set the primary bus number to 1 so IDT bridges are | ||
453 | * happy. They don't like zero. | ||
454 | */ | ||
455 | pciercx_cfg006.u32 = 0; | ||
456 | pciercx_cfg006.s.pbnum = 1; | ||
457 | pciercx_cfg006.s.sbnum = 1; | ||
458 | pciercx_cfg006.s.subbnum = 1; | ||
459 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG006(pcie_port), | ||
460 | pciercx_cfg006.u32); | ||
461 | |||
462 | /* | ||
463 | * Memory-mapped I/O BAR (PCIERCn_CFG008) | ||
464 | * Most applications should disable the memory-mapped I/O BAR by | ||
465 | * setting PCIERCn_CFG008[ML_ADDR] < PCIERCn_CFG008[MB_ADDR] | ||
466 | */ | ||
467 | pciercx_cfg008.u32 = 0; | ||
468 | pciercx_cfg008.s.mb_addr = 0x100; | ||
469 | pciercx_cfg008.s.ml_addr = 0; | ||
470 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG008(pcie_port), | ||
471 | pciercx_cfg008.u32); | ||
472 | |||
473 | /* | ||
474 | * Prefetchable BAR (PCIERCn_CFG009,PCIERCn_CFG010,PCIERCn_CFG011) | ||
475 | * Most applications should disable the prefetchable BAR by setting | ||
476 | * PCIERCn_CFG011[UMEM_LIMIT],PCIERCn_CFG009[LMEM_LIMIT] < | ||
477 | * PCIERCn_CFG010[UMEM_BASE],PCIERCn_CFG009[LMEM_BASE] | ||
478 | */ | ||
479 | pciercx_cfg009.u32 = | ||
480 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG009(pcie_port)); | ||
481 | pciercx_cfg010.u32 = | ||
482 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG010(pcie_port)); | ||
483 | pciercx_cfg011.u32 = | ||
484 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG011(pcie_port)); | ||
485 | pciercx_cfg009.s.lmem_base = 0x100; | ||
486 | pciercx_cfg009.s.lmem_limit = 0; | ||
487 | pciercx_cfg010.s.umem_base = 0x100; | ||
488 | pciercx_cfg011.s.umem_limit = 0; | ||
489 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG009(pcie_port), | ||
490 | pciercx_cfg009.u32); | ||
491 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG010(pcie_port), | ||
492 | pciercx_cfg010.u32); | ||
493 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG011(pcie_port), | ||
494 | pciercx_cfg011.u32); | ||
495 | |||
496 | /* | ||
497 | * System Error Interrupt Enables (PCIERCn_CFG035[SECEE,SEFEE,SENFEE]) | ||
498 | * PME Interrupt Enables (PCIERCn_CFG035[PMEIE]) | ||
499 | */ | ||
500 | pciercx_cfg035.u32 = | ||
501 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG035(pcie_port)); | ||
502 | /* System error on correctable error enable. */ | ||
503 | pciercx_cfg035.s.secee = 1; | ||
504 | /* System error on fatal error enable. */ | ||
505 | pciercx_cfg035.s.sefee = 1; | ||
506 | /* System error on non-fatal error enable. */ | ||
507 | pciercx_cfg035.s.senfee = 1; | ||
508 | /* PME interrupt enable. */ | ||
509 | pciercx_cfg035.s.pmeie = 1; | ||
510 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG035(pcie_port), | ||
511 | pciercx_cfg035.u32); | ||
512 | |||
513 | /* | ||
514 | * Advanced Error Recovery Interrupt Enables | ||
515 | * (PCIERCn_CFG075[CERE,NFERE,FERE]) | ||
516 | */ | ||
517 | pciercx_cfg075.u32 = | ||
518 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG075(pcie_port)); | ||
519 | /* Correctable error reporting enable. */ | ||
520 | pciercx_cfg075.s.cere = 1; | ||
521 | /* Non-fatal error reporting enable. */ | ||
522 | pciercx_cfg075.s.nfere = 1; | ||
523 | /* Fatal error reporting enable. */ | ||
524 | pciercx_cfg075.s.fere = 1; | ||
525 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG075(pcie_port), | ||
526 | pciercx_cfg075.u32); | ||
527 | |||
528 | /* HP Interrupt Enables (PCIERCn_CFG034[HPINT_EN], | ||
529 | * PCIERCn_CFG034[DLLS_EN,CCINT_EN]) | ||
530 | */ | ||
531 | pciercx_cfg034.u32 = | ||
532 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG034(pcie_port)); | ||
533 | /* Hot-plug interrupt enable. */ | ||
534 | pciercx_cfg034.s.hpint_en = 1; | ||
535 | /* Data Link Layer state changed enable */ | ||
536 | pciercx_cfg034.s.dlls_en = 1; | ||
537 | /* Command completed interrupt enable. */ | ||
538 | pciercx_cfg034.s.ccint_en = 1; | ||
539 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG034(pcie_port), | ||
540 | pciercx_cfg034.u32); | ||
541 | } | ||
542 | |||
543 | /** | ||
544 | * Initialize a host mode PCIe link. This function takes a PCIe | ||
545 | * port from reset to a link up state. Software can then begin | ||
546 | * configuring the rest of the link. | ||
547 | * | ||
548 | * @pcie_port: PCIe port to initialize | ||
549 | * | ||
550 | * Returns Zero on success | ||
551 | */ | ||
552 | static int __cvmx_pcie_rc_initialize_link(int pcie_port) | ||
553 | { | ||
554 | uint64_t start_cycle; | ||
555 | union cvmx_pescx_ctl_status pescx_ctl_status; | ||
556 | union cvmx_pciercx_cfg452 pciercx_cfg452; | ||
557 | union cvmx_pciercx_cfg032 pciercx_cfg032; | ||
558 | union cvmx_pciercx_cfg448 pciercx_cfg448; | ||
559 | |||
560 | /* Set the lane width */ | ||
561 | pciercx_cfg452.u32 = | ||
562 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG452(pcie_port)); | ||
563 | pescx_ctl_status.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS(pcie_port)); | ||
564 | if (pescx_ctl_status.s.qlm_cfg == 0) { | ||
565 | /* We're in 8 lane (56XX) or 4 lane (54XX) mode */ | ||
566 | pciercx_cfg452.s.lme = 0xf; | ||
567 | } else { | ||
568 | /* We're in 4 lane (56XX) or 2 lane (52XX) mode */ | ||
569 | pciercx_cfg452.s.lme = 0x7; | ||
570 | } | ||
571 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG452(pcie_port), | ||
572 | pciercx_cfg452.u32); | ||
573 | |||
574 | /* | ||
575 | * CN52XX pass 1.x has an errata where length mismatches on UR | ||
576 | * responses can cause bus errors on 64bit memory | ||
577 | * reads. Turning off length error checking fixes this. | ||
578 | */ | ||
579 | if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X)) { | ||
580 | union cvmx_pciercx_cfg455 pciercx_cfg455; | ||
581 | pciercx_cfg455.u32 = | ||
582 | cvmx_pcie_cfgx_read(pcie_port, | ||
583 | CVMX_PCIERCX_CFG455(pcie_port)); | ||
584 | pciercx_cfg455.s.m_cpl_len_err = 1; | ||
585 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG455(pcie_port), | ||
586 | pciercx_cfg455.u32); | ||
587 | } | ||
588 | |||
589 | /* Lane swap needs to be manually enabled for CN52XX */ | ||
590 | if (OCTEON_IS_MODEL(OCTEON_CN52XX) && (pcie_port == 1)) { | ||
591 | pescx_ctl_status.s.lane_swp = 1; | ||
592 | cvmx_write_csr(CVMX_PESCX_CTL_STATUS(pcie_port), | ||
593 | pescx_ctl_status.u64); | ||
594 | } | ||
595 | |||
596 | /* Bring up the link */ | ||
597 | pescx_ctl_status.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS(pcie_port)); | ||
598 | pescx_ctl_status.s.lnk_enb = 1; | ||
599 | cvmx_write_csr(CVMX_PESCX_CTL_STATUS(pcie_port), pescx_ctl_status.u64); | ||
600 | |||
601 | /* | ||
602 | * CN52XX pass 1.0: Due to a bug in 2nd order CDR, it needs to | ||
603 | * be disabled. | ||
604 | */ | ||
605 | if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_0)) | ||
606 | __cvmx_helper_errata_qlm_disable_2nd_order_cdr(0); | ||
607 | |||
608 | /* Wait for the link to come up */ | ||
609 | cvmx_dprintf("PCIe: Waiting for port %d link\n", pcie_port); | ||
610 | start_cycle = cvmx_get_cycle(); | ||
611 | do { | ||
612 | if (cvmx_get_cycle() - start_cycle > | ||
613 | 2 * cvmx_sysinfo_get()->cpu_clock_hz) { | ||
614 | cvmx_dprintf("PCIe: Port %d link timeout\n", | ||
615 | pcie_port); | ||
616 | return -1; | ||
617 | } | ||
618 | cvmx_wait(10000); | ||
619 | pciercx_cfg032.u32 = | ||
620 | cvmx_pcie_cfgx_read(pcie_port, | ||
621 | CVMX_PCIERCX_CFG032(pcie_port)); | ||
622 | } while (pciercx_cfg032.s.dlla == 0); | ||
623 | |||
624 | /* Display the link status */ | ||
625 | cvmx_dprintf("PCIe: Port %d link active, %d lanes\n", pcie_port, | ||
626 | pciercx_cfg032.s.nlw); | ||
627 | |||
628 | /* | ||
629 | * Update the Replay Time Limit. Empirically, some PCIe | ||
630 | * devices take a little longer to respond than expected under | ||
631 | * load. As a workaround for this we configure the Replay Time | ||
632 | * Limit to the value expected for a 512 byte MPS instead of | ||
633 | * our actual 256 byte MPS. The numbers below are directly | ||
634 | * from the PCIe spec table 3-4. | ||
635 | */ | ||
636 | pciercx_cfg448.u32 = | ||
637 | cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG448(pcie_port)); | ||
638 | switch (pciercx_cfg032.s.nlw) { | ||
639 | case 1: /* 1 lane */ | ||
640 | pciercx_cfg448.s.rtl = 1677; | ||
641 | break; | ||
642 | case 2: /* 2 lanes */ | ||
643 | pciercx_cfg448.s.rtl = 867; | ||
644 | break; | ||
645 | case 4: /* 4 lanes */ | ||
646 | pciercx_cfg448.s.rtl = 462; | ||
647 | break; | ||
648 | case 8: /* 8 lanes */ | ||
649 | pciercx_cfg448.s.rtl = 258; | ||
650 | break; | ||
651 | } | ||
652 | cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG448(pcie_port), | ||
653 | pciercx_cfg448.u32); | ||
654 | |||
655 | return 0; | ||
656 | } | ||
657 | |||
658 | /** | ||
659 | * Initialize a PCIe port for use in host(RC) mode. It doesn't | ||
660 | * enumerate the bus. | ||
661 | * | ||
662 | * @pcie_port: PCIe port to initialize | ||
663 | * | ||
664 | * Returns Zero on success | ||
665 | */ | ||
666 | static int cvmx_pcie_rc_initialize(int pcie_port) | ||
667 | { | ||
668 | int i; | ||
669 | union cvmx_ciu_soft_prst ciu_soft_prst; | ||
670 | union cvmx_pescx_bist_status pescx_bist_status; | ||
671 | union cvmx_pescx_bist_status2 pescx_bist_status2; | ||
672 | union cvmx_npei_ctl_status npei_ctl_status; | ||
673 | union cvmx_npei_mem_access_ctl npei_mem_access_ctl; | ||
674 | union cvmx_npei_mem_access_subidx mem_access_subid; | ||
675 | union cvmx_npei_dbg_data npei_dbg_data; | ||
676 | union cvmx_pescx_ctl_status2 pescx_ctl_status2; | ||
677 | |||
678 | /* | ||
679 | * Make sure we aren't trying to setup a target mode interface | ||
680 | * in host mode. | ||
681 | */ | ||
682 | npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS); | ||
683 | if ((pcie_port == 0) && !npei_ctl_status.s.host_mode) { | ||
684 | cvmx_dprintf("PCIe: ERROR: cvmx_pcie_rc_initialize() called " | ||
685 | "on port0, but port0 is not in host mode\n"); | ||
686 | return -1; | ||
687 | } | ||
688 | |||
689 | /* | ||
690 | * Make sure a CN52XX isn't trying to bring up port 1 when it | ||
691 | * is disabled. | ||
692 | */ | ||
693 | if (OCTEON_IS_MODEL(OCTEON_CN52XX)) { | ||
694 | npei_dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA); | ||
695 | if ((pcie_port == 1) && npei_dbg_data.cn52xx.qlm0_link_width) { | ||
696 | cvmx_dprintf("PCIe: ERROR: cvmx_pcie_rc_initialize() " | ||
697 | "called on port1, but port1 is " | ||
698 | "disabled\n"); | ||
699 | return -1; | ||
700 | } | ||
701 | } | ||
702 | |||
703 | /* | ||
704 | * PCIe switch arbitration mode. '0' == fixed priority NPEI, | ||
705 | * PCIe0, then PCIe1. '1' == round robin. | ||
706 | */ | ||
707 | npei_ctl_status.s.arb = 1; | ||
708 | /* Allow up to 0x20 config retries */ | ||
709 | npei_ctl_status.s.cfg_rtry = 0x20; | ||
710 | /* | ||
711 | * CN52XX pass1.x has an errata where P0_NTAGS and P1_NTAGS | ||
712 | * don't reset. | ||
713 | */ | ||
714 | if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X)) { | ||
715 | npei_ctl_status.s.p0_ntags = 0x20; | ||
716 | npei_ctl_status.s.p1_ntags = 0x20; | ||
717 | } | ||
718 | cvmx_write_csr(CVMX_PEXP_NPEI_CTL_STATUS, npei_ctl_status.u64); | ||
719 | |||
720 | /* Bring the PCIe out of reset */ | ||
721 | if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBH5200) { | ||
722 | /* | ||
723 | * The EBH5200 board swapped the PCIe reset lines on | ||
724 | * the board. As a workaround for this bug, we bring | ||
725 | * both PCIe ports out of reset at the same time | ||
726 | * instead of on separate calls. So for port 0, we | ||
727 | * bring both out of reset and do nothing on port 1. | ||
728 | */ | ||
729 | if (pcie_port == 0) { | ||
730 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST); | ||
731 | /* | ||
732 | * After a chip reset the PCIe will also be in | ||
733 | * reset. If it isn't, most likely someone is | ||
734 | * trying to init it again without a proper | ||
735 | * PCIe reset. | ||
736 | */ | ||
737 | if (ciu_soft_prst.s.soft_prst == 0) { | ||
738 | /* Reset the ports */ | ||
739 | ciu_soft_prst.s.soft_prst = 1; | ||
740 | cvmx_write_csr(CVMX_CIU_SOFT_PRST, | ||
741 | ciu_soft_prst.u64); | ||
742 | ciu_soft_prst.u64 = | ||
743 | cvmx_read_csr(CVMX_CIU_SOFT_PRST1); | ||
744 | ciu_soft_prst.s.soft_prst = 1; | ||
745 | cvmx_write_csr(CVMX_CIU_SOFT_PRST1, | ||
746 | ciu_soft_prst.u64); | ||
747 | /* Wait until pcie resets the ports. */ | ||
748 | udelay(2000); | ||
749 | } | ||
750 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1); | ||
751 | ciu_soft_prst.s.soft_prst = 0; | ||
752 | cvmx_write_csr(CVMX_CIU_SOFT_PRST1, ciu_soft_prst.u64); | ||
753 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST); | ||
754 | ciu_soft_prst.s.soft_prst = 0; | ||
755 | cvmx_write_csr(CVMX_CIU_SOFT_PRST, ciu_soft_prst.u64); | ||
756 | } | ||
757 | } else { | ||
758 | /* | ||
759 | * The normal case: The PCIe ports are completely | ||
760 | * separate and can be brought out of reset | ||
761 | * independently. | ||
762 | */ | ||
763 | if (pcie_port) | ||
764 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1); | ||
765 | else | ||
766 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST); | ||
767 | /* | ||
768 | * After a chip reset the PCIe will also be in | ||
769 | * reset. If it isn't, most likely someone is trying | ||
770 | * to init it again without a proper PCIe reset. | ||
771 | */ | ||
772 | if (ciu_soft_prst.s.soft_prst == 0) { | ||
773 | /* Reset the port */ | ||
774 | ciu_soft_prst.s.soft_prst = 1; | ||
775 | if (pcie_port) | ||
776 | cvmx_write_csr(CVMX_CIU_SOFT_PRST1, | ||
777 | ciu_soft_prst.u64); | ||
778 | else | ||
779 | cvmx_write_csr(CVMX_CIU_SOFT_PRST, | ||
780 | ciu_soft_prst.u64); | ||
781 | /* Wait until pcie resets the ports. */ | ||
782 | udelay(2000); | ||
783 | } | ||
784 | if (pcie_port) { | ||
785 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1); | ||
786 | ciu_soft_prst.s.soft_prst = 0; | ||
787 | cvmx_write_csr(CVMX_CIU_SOFT_PRST1, ciu_soft_prst.u64); | ||
788 | } else { | ||
789 | ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST); | ||
790 | ciu_soft_prst.s.soft_prst = 0; | ||
791 | cvmx_write_csr(CVMX_CIU_SOFT_PRST, ciu_soft_prst.u64); | ||
792 | } | ||
793 | } | ||
794 | |||
795 | /* | ||
796 | * Wait for PCIe reset to complete. Due to errata PCIE-700, we | ||
797 | * don't poll PESCX_CTL_STATUS2[PCIERST], but simply wait a | ||
798 | * fixed number of cycles. | ||
799 | */ | ||
800 | cvmx_wait(400000); | ||
801 | |||
802 | /* PESCX_BIST_STATUS2[PCLK_RUN] was missing on pass 1 of CN56XX and | ||
803 | CN52XX, so we only probe it on newer chips */ | ||
804 | if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X) | ||
805 | && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X)) { | ||
806 | /* Clear PCLK_RUN so we can check if the clock is running */ | ||
807 | pescx_ctl_status2.u64 = | ||
808 | cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(pcie_port)); | ||
809 | pescx_ctl_status2.s.pclk_run = 1; | ||
810 | cvmx_write_csr(CVMX_PESCX_CTL_STATUS2(pcie_port), | ||
811 | pescx_ctl_status2.u64); | ||
812 | /* | ||
813 | * Now that we cleared PCLK_RUN, wait for it to be set | ||
814 | * again telling us the clock is running. | ||
815 | */ | ||
816 | if (CVMX_WAIT_FOR_FIELD64(CVMX_PESCX_CTL_STATUS2(pcie_port), | ||
817 | union cvmx_pescx_ctl_status2, | ||
818 | pclk_run, ==, 1, 10000)) { | ||
819 | cvmx_dprintf("PCIe: Port %d isn't clocked, skipping.\n", | ||
820 | pcie_port); | ||
821 | return -1; | ||
822 | } | ||
823 | } | ||
824 | |||
825 | /* | ||
826 | * Check and make sure PCIe came out of reset. If it doesn't | ||
827 | * the board probably hasn't wired the clocks up and the | ||
828 | * interface should be skipped. | ||
829 | */ | ||
830 | pescx_ctl_status2.u64 = | ||
831 | cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(pcie_port)); | ||
832 | if (pescx_ctl_status2.s.pcierst) { | ||
833 | cvmx_dprintf("PCIe: Port %d stuck in reset, skipping.\n", | ||
834 | pcie_port); | ||
835 | return -1; | ||
836 | } | ||
837 | |||
838 | /* | ||
839 | * Check BIST2 status. If any bits are set skip this interface. This | ||
840 | * is an attempt to catch PCIE-813 on pass 1 parts. | ||
841 | */ | ||
842 | pescx_bist_status2.u64 = | ||
843 | cvmx_read_csr(CVMX_PESCX_BIST_STATUS2(pcie_port)); | ||
844 | if (pescx_bist_status2.u64) { | ||
845 | cvmx_dprintf("PCIe: Port %d BIST2 failed. Most likely this " | ||
846 | "port isn't hooked up, skipping.\n", | ||
847 | pcie_port); | ||
848 | return -1; | ||
849 | } | ||
850 | |||
851 | /* Check BIST status */ | ||
852 | pescx_bist_status.u64 = | ||
853 | cvmx_read_csr(CVMX_PESCX_BIST_STATUS(pcie_port)); | ||
854 | if (pescx_bist_status.u64) | ||
855 | cvmx_dprintf("PCIe: BIST FAILED for port %d (0x%016llx)\n", | ||
856 | pcie_port, CAST64(pescx_bist_status.u64)); | ||
857 | |||
858 | /* Initialize the config space CSRs */ | ||
859 | __cvmx_pcie_rc_initialize_config_space(pcie_port); | ||
860 | |||
861 | /* Bring the link up */ | ||
862 | if (__cvmx_pcie_rc_initialize_link(pcie_port)) { | ||
863 | cvmx_dprintf | ||
864 | ("PCIe: ERROR: cvmx_pcie_rc_initialize_link() failed\n"); | ||
865 | return -1; | ||
866 | } | ||
867 | |||
868 | /* Store merge control (NPEI_MEM_ACCESS_CTL[TIMER,MAX_WORD]) */ | ||
869 | npei_mem_access_ctl.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_MEM_ACCESS_CTL); | ||
870 | /* Allow 16 words to combine */ | ||
871 | npei_mem_access_ctl.s.max_word = 0; | ||
872 | /* Wait up to 127 cycles for more data */ | ||
873 | npei_mem_access_ctl.s.timer = 127; | ||
874 | cvmx_write_csr(CVMX_PEXP_NPEI_MEM_ACCESS_CTL, npei_mem_access_ctl.u64); | ||
875 | |||
876 | /* Setup Mem access SubDIDs */ | ||
877 | mem_access_subid.u64 = 0; | ||
878 | /* Port the request is sent to. */ | ||
879 | mem_access_subid.s.port = pcie_port; | ||
880 | /* Due to an errata on pass 1 chips, no merging is allowed. */ | ||
881 | mem_access_subid.s.nmerge = 1; | ||
882 | /* Endian-swap for Reads. */ | ||
883 | mem_access_subid.s.esr = 1; | ||
884 | /* Endian-swap for Writes. */ | ||
885 | mem_access_subid.s.esw = 1; | ||
886 | /* No Snoop for Reads. */ | ||
887 | mem_access_subid.s.nsr = 1; | ||
888 | /* No Snoop for Writes. */ | ||
889 | mem_access_subid.s.nsw = 1; | ||
890 | /* Disable Relaxed Ordering for Reads. */ | ||
891 | mem_access_subid.s.ror = 0; | ||
892 | /* Disable Relaxed Ordering for Writes. */ | ||
893 | mem_access_subid.s.row = 0; | ||
894 | /* PCIe Adddress Bits <63:34>. */ | ||
895 | mem_access_subid.s.ba = 0; | ||
896 | |||
897 | /* | ||
898 | * Setup mem access 12-15 for port 0, 16-19 for port 1, | ||
899 | * supplying 36 bits of address space. | ||
900 | */ | ||
901 | for (i = 12 + pcie_port * 4; i < 16 + pcie_port * 4; i++) { | ||
902 | cvmx_write_csr(CVMX_PEXP_NPEI_MEM_ACCESS_SUBIDX(i), | ||
903 | mem_access_subid.u64); | ||
904 | /* Set each SUBID to extend the addressable range */ | ||
905 | mem_access_subid.s.ba += 1; | ||
906 | } | ||
907 | |||
908 | /* | ||
909 | * Disable the peer to peer forwarding register. This must be | ||
910 | * setup by the OS after it enumerates the bus and assigns | ||
911 | * addresses to the PCIe busses. | ||
912 | */ | ||
913 | for (i = 0; i < 4; i++) { | ||
914 | cvmx_write_csr(CVMX_PESCX_P2P_BARX_START(i, pcie_port), -1); | ||
915 | cvmx_write_csr(CVMX_PESCX_P2P_BARX_END(i, pcie_port), -1); | ||
916 | } | ||
917 | |||
918 | /* Set Octeon's BAR0 to decode 0-16KB. It overlaps with Bar2 */ | ||
919 | cvmx_write_csr(CVMX_PESCX_P2N_BAR0_START(pcie_port), 0); | ||
920 | |||
921 | /* | ||
922 | * Disable Octeon's BAR1. It isn't needed in RC mode since | ||
923 | * BAR2 maps all of memory. BAR2 also maps 256MB-512MB into | ||
924 | * the 2nd 256MB of memory. | ||
925 | */ | ||
926 | cvmx_write_csr(CVMX_PESCX_P2N_BAR1_START(pcie_port), -1); | ||
927 | |||
928 | /* | ||
929 | * Set Octeon's BAR2 to decode 0-2^39. Bar0 and Bar1 take | ||
930 | * precedence where they overlap. It also overlaps with the | ||
931 | * device addresses, so make sure the peer to peer forwarding | ||
932 | * is set right. | ||
933 | */ | ||
934 | cvmx_write_csr(CVMX_PESCX_P2N_BAR2_START(pcie_port), 0); | ||
935 | |||
936 | /* | ||
937 | * Setup BAR2 attributes | ||
938 | * | ||
939 | * Relaxed Ordering (NPEI_CTL_PORTn[PTLP_RO,CTLP_RO, WAIT_COM]) | ||
940 | * - PTLP_RO,CTLP_RO should normally be set (except for debug). | ||
941 | * - WAIT_COM=0 will likely work for all applications. | ||
942 | * | ||
943 | * Load completion relaxed ordering (NPEI_CTL_PORTn[WAITL_COM]). | ||
944 | */ | ||
945 | if (pcie_port) { | ||
946 | union cvmx_npei_ctl_port1 npei_ctl_port; | ||
947 | npei_ctl_port.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_PORT1); | ||
948 | npei_ctl_port.s.bar2_enb = 1; | ||
949 | npei_ctl_port.s.bar2_esx = 1; | ||
950 | npei_ctl_port.s.bar2_cax = 0; | ||
951 | npei_ctl_port.s.ptlp_ro = 1; | ||
952 | npei_ctl_port.s.ctlp_ro = 1; | ||
953 | npei_ctl_port.s.wait_com = 0; | ||
954 | npei_ctl_port.s.waitl_com = 0; | ||
955 | cvmx_write_csr(CVMX_PEXP_NPEI_CTL_PORT1, npei_ctl_port.u64); | ||
956 | } else { | ||
957 | union cvmx_npei_ctl_port0 npei_ctl_port; | ||
958 | npei_ctl_port.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_PORT0); | ||
959 | npei_ctl_port.s.bar2_enb = 1; | ||
960 | npei_ctl_port.s.bar2_esx = 1; | ||
961 | npei_ctl_port.s.bar2_cax = 0; | ||
962 | npei_ctl_port.s.ptlp_ro = 1; | ||
963 | npei_ctl_port.s.ctlp_ro = 1; | ||
964 | npei_ctl_port.s.wait_com = 0; | ||
965 | npei_ctl_port.s.waitl_com = 0; | ||
966 | cvmx_write_csr(CVMX_PEXP_NPEI_CTL_PORT0, npei_ctl_port.u64); | ||
967 | } | ||
968 | return 0; | ||
969 | } | ||
970 | |||
971 | |||
972 | /* Above was cvmx-pcie.c, below original pcie.c */ | ||
973 | |||
974 | |||
975 | /** | ||
976 | * Map a PCI device to the appropriate interrupt line | ||
977 | * | ||
978 | * @dev: The Linux PCI device structure for the device to map | ||
979 | * @slot: The slot number for this device on __BUS 0__. Linux | ||
980 | * enumerates through all the bridges and figures out the | ||
981 | * slot on Bus 0 where this device eventually hooks to. | ||
982 | * @pin: The PCI interrupt pin read from the device, then swizzled | ||
983 | * as it goes through each bridge. | ||
984 | * Returns Interrupt number for the device | ||
985 | */ | ||
986 | int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev, | ||
987 | u8 slot, u8 pin) | ||
988 | { | ||
989 | /* | ||
990 | * The EBH5600 board with the PCI to PCIe bridge mistakenly | ||
991 | * wires the first slot for both device id 2 and interrupt | ||
992 | * A. According to the PCI spec, device id 2 should be C. The | ||
993 | * following kludge attempts to fix this. | ||
994 | */ | ||
995 | if (strstr(octeon_board_type_string(), "EBH5600") && | ||
996 | dev->bus && dev->bus->parent) { | ||
997 | /* | ||
998 | * Iterate all the way up the device chain and find | ||
999 | * the root bus. | ||
1000 | */ | ||
1001 | while (dev->bus && dev->bus->parent) | ||
1002 | dev = to_pci_dev(dev->bus->bridge); | ||
1003 | /* If the root bus is number 0 and the PEX 8114 is the | ||
1004 | * root, assume we are behind the miswired bus. We | ||
1005 | * need to correct the swizzle level by two. Yuck. | ||
1006 | */ | ||
1007 | if ((dev->bus->number == 0) && | ||
1008 | (dev->vendor == 0x10b5) && (dev->device == 0x8114)) { | ||
1009 | /* | ||
1010 | * The pin field is one based, not zero. We | ||
1011 | * need to swizzle it by minus two. | ||
1012 | */ | ||
1013 | pin = ((pin - 3) & 3) + 1; | ||
1014 | } | ||
1015 | } | ||
1016 | /* | ||
1017 | * The -1 is because pin starts with one, not zero. It might | ||
1018 | * be that this equation needs to include the slot number, but | ||
1019 | * I don't have hardware to check that against. | ||
1020 | */ | ||
1021 | return pin - 1 + OCTEON_IRQ_PCI_INT0; | ||
1022 | } | ||
1023 | |||
1024 | /** | ||
1025 | * Read a value from configuration space | ||
1026 | * | ||
1027 | * @bus: | ||
1028 | * @devfn: | ||
1029 | * @reg: | ||
1030 | * @size: | ||
1031 | * @val: | ||
1032 | * Returns | ||
1033 | */ | ||
1034 | static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus, | ||
1035 | unsigned int devfn, int reg, int size, | ||
1036 | u32 *val) | ||
1037 | { | ||
1038 | union octeon_cvmemctl cvmmemctl; | ||
1039 | union octeon_cvmemctl cvmmemctl_save; | ||
1040 | int bus_number = bus->number; | ||
1041 | |||
1042 | /* | ||
1043 | * For the top level bus make sure our hardware bus number | ||
1044 | * matches the software one. | ||
1045 | */ | ||
1046 | if (bus->parent == NULL) { | ||
1047 | union cvmx_pciercx_cfg006 pciercx_cfg006; | ||
1048 | pciercx_cfg006.u32 = cvmx_pcie_cfgx_read(pcie_port, | ||
1049 | CVMX_PCIERCX_CFG006(pcie_port)); | ||
1050 | if (pciercx_cfg006.s.pbnum != bus_number) { | ||
1051 | pciercx_cfg006.s.pbnum = bus_number; | ||
1052 | pciercx_cfg006.s.sbnum = bus_number; | ||
1053 | pciercx_cfg006.s.subbnum = bus_number; | ||
1054 | cvmx_pcie_cfgx_write(pcie_port, | ||
1055 | CVMX_PCIERCX_CFG006(pcie_port), | ||
1056 | pciercx_cfg006.u32); | ||
1057 | } | ||
1058 | } | ||
1059 | |||
1060 | /* | ||
1061 | * PCIe only has a single device connected to Octeon. It is | ||
1062 | * always device ID 0. Don't bother doing reads for other | ||
1063 | * device IDs on the first segment. | ||
1064 | */ | ||
1065 | if ((bus->parent == NULL) && (devfn >> 3 != 0)) | ||
1066 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1067 | |||
1068 | /* | ||
1069 | * The following is a workaround for the CN57XX, CN56XX, | ||
1070 | * CN55XX, and CN54XX errata with PCIe config reads from non | ||
1071 | * existent devices. These chips will hang the PCIe link if a | ||
1072 | * config read is performed that causes a UR response. | ||
1073 | */ | ||
1074 | if (OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1) || | ||
1075 | OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_1)) { | ||
1076 | /* | ||
1077 | * For our EBH5600 board, port 0 has a bridge with two | ||
1078 | * PCI-X slots. We need a new special checks to make | ||
1079 | * sure we only probe valid stuff. The PCIe->PCI-X | ||
1080 | * bridge only respondes to device ID 0, function | ||
1081 | * 0-1 | ||
1082 | */ | ||
1083 | if ((bus->parent == NULL) && (devfn >= 2)) | ||
1084 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1085 | /* | ||
1086 | * The PCI-X slots are device ID 2,3. Choose one of | ||
1087 | * the below "if" blocks based on what is plugged into | ||
1088 | * the board. | ||
1089 | */ | ||
1090 | #if 1 | ||
1091 | /* Use this option if you aren't using either slot */ | ||
1092 | if (bus_number == 1) | ||
1093 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1094 | #elif 0 | ||
1095 | /* | ||
1096 | * Use this option if you are using the first slot but | ||
1097 | * not the second. | ||
1098 | */ | ||
1099 | if ((bus_number == 1) && (devfn >> 3 != 2)) | ||
1100 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1101 | #elif 0 | ||
1102 | /* | ||
1103 | * Use this option if you are using the second slot | ||
1104 | * but not the first. | ||
1105 | */ | ||
1106 | if ((bus_number == 1) && (devfn >> 3 != 3)) | ||
1107 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1108 | #elif 0 | ||
1109 | /* Use this opion if you are using both slots */ | ||
1110 | if ((bus_number == 1) && | ||
1111 | !((devfn == (2 << 3)) || (devfn == (3 << 3)))) | ||
1112 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1113 | #endif | ||
1114 | |||
1115 | /* | ||
1116 | * Shorten the DID timeout so bus errors for PCIe | ||
1117 | * config reads from non existent devices happen | ||
1118 | * faster. This allows us to continue booting even if | ||
1119 | * the above "if" checks are wrong. Once one of these | ||
1120 | * errors happens, the PCIe port is dead. | ||
1121 | */ | ||
1122 | cvmmemctl_save.u64 = __read_64bit_c0_register($11, 7); | ||
1123 | cvmmemctl.u64 = cvmmemctl_save.u64; | ||
1124 | cvmmemctl.s.didtto = 2; | ||
1125 | __write_64bit_c0_register($11, 7, cvmmemctl.u64); | ||
1126 | } | ||
1127 | |||
1128 | switch (size) { | ||
1129 | case 4: | ||
1130 | *val = cvmx_pcie_config_read32(pcie_port, bus_number, | ||
1131 | devfn >> 3, devfn & 0x7, reg); | ||
1132 | break; | ||
1133 | case 2: | ||
1134 | *val = cvmx_pcie_config_read16(pcie_port, bus_number, | ||
1135 | devfn >> 3, devfn & 0x7, reg); | ||
1136 | break; | ||
1137 | case 1: | ||
1138 | *val = cvmx_pcie_config_read8(pcie_port, bus_number, devfn >> 3, | ||
1139 | devfn & 0x7, reg); | ||
1140 | break; | ||
1141 | default: | ||
1142 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1143 | } | ||
1144 | |||
1145 | if (OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1) || | ||
1146 | OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_1)) | ||
1147 | __write_64bit_c0_register($11, 7, cvmmemctl_save.u64); | ||
1148 | return PCIBIOS_SUCCESSFUL; | ||
1149 | } | ||
1150 | |||
1151 | static int octeon_pcie0_read_config(struct pci_bus *bus, unsigned int devfn, | ||
1152 | int reg, int size, u32 *val) | ||
1153 | { | ||
1154 | return octeon_pcie_read_config(0, bus, devfn, reg, size, val); | ||
1155 | } | ||
1156 | |||
1157 | static int octeon_pcie1_read_config(struct pci_bus *bus, unsigned int devfn, | ||
1158 | int reg, int size, u32 *val) | ||
1159 | { | ||
1160 | return octeon_pcie_read_config(1, bus, devfn, reg, size, val); | ||
1161 | } | ||
1162 | |||
1163 | |||
1164 | |||
1165 | /** | ||
1166 | * Write a value to PCI configuration space | ||
1167 | * | ||
1168 | * @bus: | ||
1169 | * @devfn: | ||
1170 | * @reg: | ||
1171 | * @size: | ||
1172 | * @val: | ||
1173 | * Returns | ||
1174 | */ | ||
1175 | static inline int octeon_pcie_write_config(int pcie_port, struct pci_bus *bus, | ||
1176 | unsigned int devfn, int reg, | ||
1177 | int size, u32 val) | ||
1178 | { | ||
1179 | int bus_number = bus->number; | ||
1180 | |||
1181 | switch (size) { | ||
1182 | case 4: | ||
1183 | cvmx_pcie_config_write32(pcie_port, bus_number, devfn >> 3, | ||
1184 | devfn & 0x7, reg, val); | ||
1185 | return PCIBIOS_SUCCESSFUL; | ||
1186 | case 2: | ||
1187 | cvmx_pcie_config_write16(pcie_port, bus_number, devfn >> 3, | ||
1188 | devfn & 0x7, reg, val); | ||
1189 | return PCIBIOS_SUCCESSFUL; | ||
1190 | case 1: | ||
1191 | cvmx_pcie_config_write8(pcie_port, bus_number, devfn >> 3, | ||
1192 | devfn & 0x7, reg, val); | ||
1193 | return PCIBIOS_SUCCESSFUL; | ||
1194 | } | ||
1195 | #if PCI_CONFIG_SPACE_DELAY | ||
1196 | udelay(PCI_CONFIG_SPACE_DELAY); | ||
1197 | #endif | ||
1198 | return PCIBIOS_FUNC_NOT_SUPPORTED; | ||
1199 | } | ||
1200 | |||
1201 | static int octeon_pcie0_write_config(struct pci_bus *bus, unsigned int devfn, | ||
1202 | int reg, int size, u32 val) | ||
1203 | { | ||
1204 | return octeon_pcie_write_config(0, bus, devfn, reg, size, val); | ||
1205 | } | ||
1206 | |||
1207 | static int octeon_pcie1_write_config(struct pci_bus *bus, unsigned int devfn, | ||
1208 | int reg, int size, u32 val) | ||
1209 | { | ||
1210 | return octeon_pcie_write_config(1, bus, devfn, reg, size, val); | ||
1211 | } | ||
1212 | |||
1213 | static struct pci_ops octeon_pcie0_ops = { | ||
1214 | octeon_pcie0_read_config, | ||
1215 | octeon_pcie0_write_config, | ||
1216 | }; | ||
1217 | |||
1218 | static struct resource octeon_pcie0_mem_resource = { | ||
1219 | .name = "Octeon PCIe0 MEM", | ||
1220 | .flags = IORESOURCE_MEM, | ||
1221 | }; | ||
1222 | |||
1223 | static struct resource octeon_pcie0_io_resource = { | ||
1224 | .name = "Octeon PCIe0 IO", | ||
1225 | .flags = IORESOURCE_IO, | ||
1226 | }; | ||
1227 | |||
1228 | static struct pci_controller octeon_pcie0_controller = { | ||
1229 | .pci_ops = &octeon_pcie0_ops, | ||
1230 | .mem_resource = &octeon_pcie0_mem_resource, | ||
1231 | .io_resource = &octeon_pcie0_io_resource, | ||
1232 | }; | ||
1233 | |||
1234 | static struct pci_ops octeon_pcie1_ops = { | ||
1235 | octeon_pcie1_read_config, | ||
1236 | octeon_pcie1_write_config, | ||
1237 | }; | ||
1238 | |||
1239 | static struct resource octeon_pcie1_mem_resource = { | ||
1240 | .name = "Octeon PCIe1 MEM", | ||
1241 | .flags = IORESOURCE_MEM, | ||
1242 | }; | ||
1243 | |||
1244 | static struct resource octeon_pcie1_io_resource = { | ||
1245 | .name = "Octeon PCIe1 IO", | ||
1246 | .flags = IORESOURCE_IO, | ||
1247 | }; | ||
1248 | |||
1249 | static struct pci_controller octeon_pcie1_controller = { | ||
1250 | .pci_ops = &octeon_pcie1_ops, | ||
1251 | .mem_resource = &octeon_pcie1_mem_resource, | ||
1252 | .io_resource = &octeon_pcie1_io_resource, | ||
1253 | }; | ||
1254 | |||
1255 | |||
1256 | /** | ||
1257 | * Initialize the Octeon PCIe controllers | ||
1258 | * | ||
1259 | * Returns | ||
1260 | */ | ||
1261 | static int __init octeon_pcie_setup(void) | ||
1262 | { | ||
1263 | union cvmx_npei_ctl_status npei_ctl_status; | ||
1264 | int result; | ||
1265 | |||
1266 | /* These chips don't have PCIe */ | ||
1267 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) | ||
1268 | return 0; | ||
1269 | |||
1270 | /* Point pcibios_map_irq() to the PCIe version of it */ | ||
1271 | octeon_pcibios_map_irq = octeon_pcie_pcibios_map_irq; | ||
1272 | |||
1273 | /* Use the PCIe based DMA mappings */ | ||
1274 | octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_PCIE; | ||
1275 | |||
1276 | /* | ||
1277 | * PCIe I/O range. It is based on port 0 but includes up until | ||
1278 | * port 1's end. | ||
1279 | */ | ||
1280 | set_io_port_base(CVMX_ADD_IO_SEG(cvmx_pcie_get_io_base_address(0))); | ||
1281 | ioport_resource.start = 0; | ||
1282 | ioport_resource.end = | ||
1283 | cvmx_pcie_get_io_base_address(1) - | ||
1284 | cvmx_pcie_get_io_base_address(0) + cvmx_pcie_get_io_size(1) - 1; | ||
1285 | |||
1286 | npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS); | ||
1287 | if (npei_ctl_status.s.host_mode) { | ||
1288 | pr_notice("PCIe: Initializing port 0\n"); | ||
1289 | result = cvmx_pcie_rc_initialize(0); | ||
1290 | if (result == 0) { | ||
1291 | /* Memory offsets are physical addresses */ | ||
1292 | octeon_pcie0_controller.mem_offset = | ||
1293 | cvmx_pcie_get_mem_base_address(0); | ||
1294 | /* IO offsets are Mips virtual addresses */ | ||
1295 | octeon_pcie0_controller.io_map_base = | ||
1296 | CVMX_ADD_IO_SEG(cvmx_pcie_get_io_base_address | ||
1297 | (0)); | ||
1298 | octeon_pcie0_controller.io_offset = 0; | ||
1299 | /* | ||
1300 | * To keep things similar to PCI, we start | ||
1301 | * device addresses at the same place as PCI | ||
1302 | * uisng big bar support. This normally | ||
1303 | * translates to 4GB-256MB, which is the same | ||
1304 | * as most x86 PCs. | ||
1305 | */ | ||
1306 | octeon_pcie0_controller.mem_resource->start = | ||
1307 | cvmx_pcie_get_mem_base_address(0) + | ||
1308 | (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20); | ||
1309 | octeon_pcie0_controller.mem_resource->end = | ||
1310 | cvmx_pcie_get_mem_base_address(0) + | ||
1311 | cvmx_pcie_get_mem_size(0) - 1; | ||
1312 | /* | ||
1313 | * Ports must be above 16KB for the ISA bus | ||
1314 | * filtering in the PCI-X to PCI bridge. | ||
1315 | */ | ||
1316 | octeon_pcie0_controller.io_resource->start = 4 << 10; | ||
1317 | octeon_pcie0_controller.io_resource->end = | ||
1318 | cvmx_pcie_get_io_size(0) - 1; | ||
1319 | register_pci_controller(&octeon_pcie0_controller); | ||
1320 | } | ||
1321 | } else { | ||
1322 | pr_notice("PCIe: Port 0 in endpoint mode, skipping.\n"); | ||
1323 | } | ||
1324 | |||
1325 | /* Skip the 2nd port on CN52XX if port 0 is in 4 lane mode */ | ||
1326 | if (OCTEON_IS_MODEL(OCTEON_CN52XX)) { | ||
1327 | union cvmx_npei_dbg_data npei_dbg_data; | ||
1328 | npei_dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA); | ||
1329 | if (npei_dbg_data.cn52xx.qlm0_link_width) | ||
1330 | return 0; | ||
1331 | } | ||
1332 | |||
1333 | pr_notice("PCIe: Initializing port 1\n"); | ||
1334 | result = cvmx_pcie_rc_initialize(1); | ||
1335 | if (result == 0) { | ||
1336 | /* Memory offsets are physical addresses */ | ||
1337 | octeon_pcie1_controller.mem_offset = | ||
1338 | cvmx_pcie_get_mem_base_address(1); | ||
1339 | /* IO offsets are Mips virtual addresses */ | ||
1340 | octeon_pcie1_controller.io_map_base = | ||
1341 | CVMX_ADD_IO_SEG(cvmx_pcie_get_io_base_address(1)); | ||
1342 | octeon_pcie1_controller.io_offset = | ||
1343 | cvmx_pcie_get_io_base_address(1) - | ||
1344 | cvmx_pcie_get_io_base_address(0); | ||
1345 | /* | ||
1346 | * To keep things similar to PCI, we start device | ||
1347 | * addresses at the same place as PCI uisng big bar | ||
1348 | * support. This normally translates to 4GB-256MB, | ||
1349 | * which is the same as most x86 PCs. | ||
1350 | */ | ||
1351 | octeon_pcie1_controller.mem_resource->start = | ||
1352 | cvmx_pcie_get_mem_base_address(1) + (4ul << 30) - | ||
1353 | (OCTEON_PCI_BAR1_HOLE_SIZE << 20); | ||
1354 | octeon_pcie1_controller.mem_resource->end = | ||
1355 | cvmx_pcie_get_mem_base_address(1) + | ||
1356 | cvmx_pcie_get_mem_size(1) - 1; | ||
1357 | /* | ||
1358 | * Ports must be above 16KB for the ISA bus filtering | ||
1359 | * in the PCI-X to PCI bridge. | ||
1360 | */ | ||
1361 | octeon_pcie1_controller.io_resource->start = | ||
1362 | cvmx_pcie_get_io_base_address(1) - | ||
1363 | cvmx_pcie_get_io_base_address(0); | ||
1364 | octeon_pcie1_controller.io_resource->end = | ||
1365 | octeon_pcie1_controller.io_resource->start + | ||
1366 | cvmx_pcie_get_io_size(1) - 1; | ||
1367 | register_pci_controller(&octeon_pcie1_controller); | ||
1368 | } | ||
1369 | return 0; | ||
1370 | } | ||
1371 | |||
1372 | arch_initcall(octeon_pcie_setup); | ||
diff --git a/arch/mips/pmc-sierra/msp71xx/gpio.c b/arch/mips/pmc-sierra/msp71xx/gpio.c index 69848c5813e2..aaccbe524386 100644 --- a/arch/mips/pmc-sierra/msp71xx/gpio.c +++ b/arch/mips/pmc-sierra/msp71xx/gpio.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * @file /arch/mips/pmc-sierra/msp71xx/gpio.c | ||
3 | * | ||
4 | * Generic PMC MSP71xx GPIO handling. These base gpio are controlled by two | 2 | * Generic PMC MSP71xx GPIO handling. These base gpio are controlled by two |
5 | * types of registers. The data register sets the output level when in output | 3 | * types of registers. The data register sets the output level when in output |
6 | * mode and when in input mode will contain the value at the input. The config | 4 | * mode and when in input mode will contain the value at the input. The config |
diff --git a/arch/mips/pmc-sierra/msp71xx/gpio_extended.c b/arch/mips/pmc-sierra/msp71xx/gpio_extended.c index fc6dbc6cf1c0..2a99f360fae4 100644 --- a/arch/mips/pmc-sierra/msp71xx/gpio_extended.c +++ b/arch/mips/pmc-sierra/msp71xx/gpio_extended.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * @file /arch/mips/pmc-sierra/msp71xx/gpio_extended.c | ||
3 | * | ||
4 | * Generic PMC MSP71xx EXTENDED (EXD) GPIO handling. The extended gpio is | 2 | * Generic PMC MSP71xx EXTENDED (EXD) GPIO handling. The extended gpio is |
5 | * a set of hardware registers that have no need for explicit locking as | 3 | * a set of hardware registers that have no need for explicit locking as |
6 | * it is handled by unique method of writing individual set/clr bits. | 4 | * it is handled by unique method of writing individual set/clr bits. |
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c b/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c index f5f1b8d2bb9a..61f390232346 100644 --- a/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c +++ b/arch/mips/pmc-sierra/msp71xx/msp_irq_slp.c | |||
@@ -45,13 +45,6 @@ static inline void mask_msp_slp_irq(unsigned int irq) | |||
45 | */ | 45 | */ |
46 | static inline void ack_msp_slp_irq(unsigned int irq) | 46 | static inline void ack_msp_slp_irq(unsigned int irq) |
47 | { | 47 | { |
48 | mask_slp_irq(irq); | ||
49 | |||
50 | /* | ||
51 | * only really necessary for 18, 16-14 and sometimes 3:0 (since | ||
52 | * these can be edge sensitive) but it doesn't hurt for the others. | ||
53 | */ | ||
54 | |||
55 | /* check for PER interrupt range */ | 48 | /* check for PER interrupt range */ |
56 | if (irq < MSP_PER_INTBASE) | 49 | if (irq < MSP_PER_INTBASE) |
57 | *SLP_INT_STS_REG = (1 << (irq - MSP_SLP_INTBASE)); | 50 | *SLP_INT_STS_REG = (1 << (irq - MSP_SLP_INTBASE)); |
@@ -62,8 +55,7 @@ static inline void ack_msp_slp_irq(unsigned int irq) | |||
62 | static struct irq_chip msp_slp_irq_controller = { | 55 | static struct irq_chip msp_slp_irq_controller = { |
63 | .name = "MSP_SLP", | 56 | .name = "MSP_SLP", |
64 | .ack = ack_msp_slp_irq, | 57 | .ack = ack_msp_slp_irq, |
65 | .mask = ack_msp_slp_irq, | 58 | .mask = mask_msp_slp_irq, |
66 | .mask_ack = ack_msp_slp_irq, | ||
67 | .unmask = unmask_msp_slp_irq, | 59 | .unmask = unmask_msp_slp_irq, |
68 | }; | 60 | }; |
69 | 61 | ||
@@ -79,7 +71,7 @@ void __init msp_slp_irq_init(void) | |||
79 | 71 | ||
80 | /* initialize all the IRQ descriptors */ | 72 | /* initialize all the IRQ descriptors */ |
81 | for (i = MSP_SLP_INTBASE; i < MSP_PER_INTBASE + 32; i++) | 73 | for (i = MSP_SLP_INTBASE; i < MSP_PER_INTBASE + 32; i++) |
82 | set_irq_chip_and_handler(i, &msp_slp_irq_controller | 74 | set_irq_chip_and_handler(i, &msp_slp_irq_controller, |
83 | handle_level_irq); | 75 | handle_level_irq); |
84 | } | 76 | } |
85 | 77 | ||
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c index caf5e9a0acc7..fc990cb31941 100644 --- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c +++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c | ||
3 | * | ||
4 | * Copyright (C) 2003 PMC-Sierra Inc. | 2 | * Copyright (C) 2003 PMC-Sierra Inc. |
5 | * Author: Manish Lachwani (lachwani@pmc-sierra.com) | 3 | * Author: Manish Lachwani (lachwani@pmc-sierra.com) |
6 | * | 4 | * |
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c index f78c29b68d77..8ace27716232 100644 --- a/arch/mips/pmc-sierra/yosemite/smp.c +++ b/arch/mips/pmc-sierra/yosemite/smp.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/linkage.h> | 1 | #include <linux/linkage.h> |
2 | #include <linux/sched.h> | 2 | #include <linux/sched.h> |
3 | #include <linux/smp.h> | ||
3 | 4 | ||
4 | #include <asm/pmon.h> | 5 | #include <asm/pmon.h> |
5 | #include <asm/titan_dep.h> | 6 | #include <asm/titan_dep.h> |
diff --git a/arch/mips/power/Makefile b/arch/mips/power/Makefile new file mode 100644 index 000000000000..73d56b87cb9b --- /dev/null +++ b/arch/mips/power/Makefile | |||
@@ -0,0 +1 @@ | |||
obj-$(CONFIG_HIBERNATION) += cpu.o hibernate.o | |||
diff --git a/arch/mips/power/cpu.c b/arch/mips/power/cpu.c new file mode 100644 index 000000000000..7995df45dc8d --- /dev/null +++ b/arch/mips/power/cpu.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | * Suspend support specific for mips. | ||
3 | * | ||
4 | * Licensed under the GPLv2 | ||
5 | * | ||
6 | * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology | ||
7 | * Author: Hu Hongbing <huhb@lemote.com> | ||
8 | * Wu Zhangjin <wuzj@lemote.com> | ||
9 | */ | ||
10 | #include <asm/suspend.h> | ||
11 | #include <asm/fpu.h> | ||
12 | #include <asm/dsp.h> | ||
13 | |||
14 | static u32 saved_status; | ||
15 | struct pt_regs saved_regs; | ||
16 | |||
17 | void save_processor_state(void) | ||
18 | { | ||
19 | saved_status = read_c0_status(); | ||
20 | |||
21 | if (is_fpu_owner()) | ||
22 | save_fp(current); | ||
23 | if (cpu_has_dsp) | ||
24 | save_dsp(current); | ||
25 | } | ||
26 | |||
27 | void restore_processor_state(void) | ||
28 | { | ||
29 | write_c0_status(saved_status); | ||
30 | |||
31 | if (is_fpu_owner()) | ||
32 | restore_fp(current); | ||
33 | if (cpu_has_dsp) | ||
34 | restore_dsp(current); | ||
35 | } | ||
36 | |||
37 | int pfn_is_nosave(unsigned long pfn) | ||
38 | { | ||
39 | unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin)); | ||
40 | unsigned long nosave_end_pfn = PFN_UP(__pa(&__nosave_end)); | ||
41 | |||
42 | return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn); | ||
43 | } | ||
diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S new file mode 100644 index 000000000000..4b8174b382d7 --- /dev/null +++ b/arch/mips/power/hibernate.S | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Hibernation support specific for mips - temporary page tables | ||
3 | * | ||
4 | * Licensed under the GPLv2 | ||
5 | * | ||
6 | * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology | ||
7 | * Author: Hu Hongbing <huhb@lemote.com> | ||
8 | * Wu Zhangjin <wuzj@lemote.com> | ||
9 | */ | ||
10 | #include <asm/asm-offsets.h> | ||
11 | #include <asm/regdef.h> | ||
12 | #include <asm/asm.h> | ||
13 | |||
14 | .text | ||
15 | LEAF(swsusp_arch_suspend) | ||
16 | PTR_LA t0, saved_regs | ||
17 | PTR_S ra, PT_R31(t0) | ||
18 | PTR_S sp, PT_R29(t0) | ||
19 | PTR_S fp, PT_R30(t0) | ||
20 | PTR_S gp, PT_R28(t0) | ||
21 | PTR_S s0, PT_R16(t0) | ||
22 | PTR_S s1, PT_R17(t0) | ||
23 | PTR_S s2, PT_R18(t0) | ||
24 | PTR_S s3, PT_R19(t0) | ||
25 | PTR_S s4, PT_R20(t0) | ||
26 | PTR_S s5, PT_R21(t0) | ||
27 | PTR_S s6, PT_R22(t0) | ||
28 | PTR_S s7, PT_R23(t0) | ||
29 | j swsusp_save | ||
30 | END(swsusp_arch_suspend) | ||
31 | |||
32 | LEAF(swsusp_arch_resume) | ||
33 | PTR_L t0, restore_pblist | ||
34 | 0: | ||
35 | PTR_L t1, PBE_ADDRESS(t0) /* source */ | ||
36 | PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */ | ||
37 | PTR_ADDIU t3, t1, _PAGE_SIZE | ||
38 | 1: | ||
39 | REG_L t8, (t1) | ||
40 | REG_S t8, (t2) | ||
41 | PTR_ADDIU t1, t1, SZREG | ||
42 | PTR_ADDIU t2, t2, SZREG | ||
43 | bne t1, t3, 1b | ||
44 | PTR_L t0, PBE_NEXT(t0) | ||
45 | bnez t0, 0b | ||
46 | PTR_LA t0, saved_regs | ||
47 | PTR_L ra, PT_R31(t0) | ||
48 | PTR_L sp, PT_R29(t0) | ||
49 | PTR_L fp, PT_R30(t0) | ||
50 | PTR_L gp, PT_R28(t0) | ||
51 | PTR_L s0, PT_R16(t0) | ||
52 | PTR_L s1, PT_R17(t0) | ||
53 | PTR_L s2, PT_R18(t0) | ||
54 | PTR_L s3, PT_R19(t0) | ||
55 | PTR_L s4, PT_R20(t0) | ||
56 | PTR_L s5, PT_R21(t0) | ||
57 | PTR_L s6, PT_R22(t0) | ||
58 | PTR_L s7, PT_R23(t0) | ||
59 | PTR_LI v0, 0x0 | ||
60 | jr ra | ||
61 | END(swsusp_arch_resume) | ||
diff --git a/arch/mips/rb532/irq.c b/arch/mips/rb532/irq.c index 53eeb5e7bc5b..f07882029a90 100644 --- a/arch/mips/rb532/irq.c +++ b/arch/mips/rb532/irq.c | |||
@@ -151,7 +151,8 @@ static void rb532_disable_irq(unsigned int irq_nr) | |||
151 | mask |= intr_bit; | 151 | mask |= intr_bit; |
152 | WRITE_MASK(addr, mask); | 152 | WRITE_MASK(addr, mask); |
153 | 153 | ||
154 | if (group == GPIO_MAPPED_IRQ_GROUP) | 154 | /* There is a maximum of 14 GPIO interrupts */ |
155 | if (group == GPIO_MAPPED_IRQ_GROUP && irq_nr <= (GROUP4_IRQ_BASE + 13)) | ||
155 | rb532_gpio_set_istat(0, irq_nr - GPIO_MAPPED_IRQ_BASE); | 156 | rb532_gpio_set_istat(0, irq_nr - GPIO_MAPPED_IRQ_BASE); |
156 | 157 | ||
157 | /* | 158 | /* |
@@ -174,7 +175,7 @@ static int rb532_set_type(unsigned int irq_nr, unsigned type) | |||
174 | int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE; | 175 | int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE; |
175 | int group = irq_to_group(irq_nr); | 176 | int group = irq_to_group(irq_nr); |
176 | 177 | ||
177 | if (group != GPIO_MAPPED_IRQ_GROUP) | 178 | if (group != GPIO_MAPPED_IRQ_GROUP || irq_nr > (GROUP4_IRQ_BASE + 13)) |
178 | return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL; | 179 | return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL; |
179 | 180 | ||
180 | switch (type) { | 181 | switch (type) { |
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c index 4a500e8cd3cc..51d3a4f2d7e1 100644 --- a/arch/mips/sgi-ip27/ip27-init.c +++ b/arch/mips/sgi-ip27/ip27-init.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/smp.h> | ||
12 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 1bb692a3b319..c1c8e40d65d6 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/ioport.h> | 18 | #include <linux/ioport.h> |
19 | #include <linux/timex.h> | 19 | #include <linux/timex.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/smp.h> | ||
21 | #include <linux/random.h> | 22 | #include <linux/random.h> |
22 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
23 | #include <linux/kernel_stat.h> | 24 | #include <linux/kernel_stat.h> |
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c index f10a7cd64f7e..6d0e59ffba2e 100644 --- a/arch/mips/sgi-ip27/ip27-timer.c +++ b/arch/mips/sgi-ip27/ip27-timer.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/kernel_stat.h> | 11 | #include <linux/kernel_stat.h> |
12 | #include <linux/param.h> | 12 | #include <linux/param.h> |
13 | #include <linux/smp.h> | ||
13 | #include <linux/time.h> | 14 | #include <linux/time.h> |
14 | #include <linux/timex.h> | 15 | #include <linux/timex.h> |
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
diff --git a/arch/mips/sgi-ip27/ip27-xtalk.c b/arch/mips/sgi-ip27/ip27-xtalk.c index 6ae64e8dfc40..5e871e75a8d9 100644 --- a/arch/mips/sgi-ip27/ip27-xtalk.c +++ b/arch/mips/sgi-ip27/ip27-xtalk.c | |||
@@ -9,6 +9,7 @@ | |||
9 | 9 | ||
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/smp.h> | ||
12 | #include <asm/sn/types.h> | 13 | #include <asm/sn/types.h> |
13 | #include <asm/sn/klconfig.h> | 14 | #include <asm/sn/klconfig.h> |
14 | #include <asm/sn/hub.h> | 15 | #include <asm/sn/hub.h> |
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig index 366b19d33f77..3e639bda43f7 100644 --- a/arch/mips/sibyte/Kconfig +++ b/arch/mips/sibyte/Kconfig | |||
@@ -75,6 +75,8 @@ config SIBYTE_SB1xxx_SOC | |||
75 | select SWAP_IO_SPACE | 75 | select SWAP_IO_SPACE |
76 | select SYS_SUPPORTS_32BIT_KERNEL | 76 | select SYS_SUPPORTS_32BIT_KERNEL |
77 | select SYS_SUPPORTS_64BIT_KERNEL | 77 | select SYS_SUPPORTS_64BIT_KERNEL |
78 | select CFE | ||
79 | select SYS_HAS_EARLY_PRINTK | ||
78 | 80 | ||
79 | choice | 81 | choice |
80 | prompt "SiByte SOC Stepping" | 82 | prompt "SiByte SOC Stepping" |
@@ -128,13 +130,6 @@ config SIBYTE_ENABLE_LDT_IF_PCI | |||
128 | bool | 130 | bool |
129 | select SIBYTE_HAS_LDT if PCI | 131 | select SIBYTE_HAS_LDT if PCI |
130 | 132 | ||
131 | config SIMULATION | ||
132 | bool "Running under simulation" | ||
133 | depends on SIBYTE_SB1xxx_SOC | ||
134 | help | ||
135 | Build a kernel suitable for running under the GDB simulator. | ||
136 | Primarily adjusts the kernel's notion of time. | ||
137 | |||
138 | config SB1_CEX_ALWAYS_FATAL | 133 | config SB1_CEX_ALWAYS_FATAL |
139 | bool "All cache exceptions considered fatal (no recovery attempted)" | 134 | bool "All cache exceptions considered fatal (no recovery attempted)" |
140 | depends on SIBYTE_SB1xxx_SOC | 135 | depends on SIBYTE_SB1xxx_SOC |
@@ -143,34 +138,14 @@ config SB1_CERR_STALL | |||
143 | bool "Stall (rather than panic) on fatal cache error" | 138 | bool "Stall (rather than panic) on fatal cache error" |
144 | depends on SIBYTE_SB1xxx_SOC | 139 | depends on SIBYTE_SB1xxx_SOC |
145 | 140 | ||
146 | config SIBYTE_CFE | ||
147 | bool "Booting from CFE" | ||
148 | depends on SIBYTE_SB1xxx_SOC | ||
149 | select CFE | ||
150 | select SYS_HAS_EARLY_PRINTK | ||
151 | help | ||
152 | Make use of the CFE API for enumerating available memory, | ||
153 | controlling secondary CPUs, and possibly console output. | ||
154 | |||
155 | config SIBYTE_CFE_CONSOLE | 141 | config SIBYTE_CFE_CONSOLE |
156 | bool "Use firmware console" | 142 | bool "Use firmware console" |
157 | depends on SIBYTE_CFE | 143 | depends on SIBYTE_SB1xxx_SOC |
158 | help | 144 | help |
159 | Use the CFE API's console write routines during boot. Other console | 145 | Use the CFE API's console write routines during boot. Other console |
160 | options (VT console, sb1250 duart console, etc.) should not be | 146 | options (VT console, sb1250 duart console, etc.) should not be |
161 | configured. | 147 | configured. |
162 | 148 | ||
163 | config SIBYTE_STANDALONE | ||
164 | bool | ||
165 | depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE | ||
166 | select SYS_HAS_EARLY_PRINTK | ||
167 | default y | ||
168 | |||
169 | config SIBYTE_STANDALONE_RAM_SIZE | ||
170 | int "Memory size (in megabytes)" | ||
171 | depends on SIBYTE_STANDALONE | ||
172 | default "32" | ||
173 | |||
174 | config SIBYTE_BUS_WATCHER | 149 | config SIBYTE_BUS_WATCHER |
175 | bool "Support for Bus Watcher statistics" | 150 | bool "Support for Bus Watcher statistics" |
176 | depends on SIBYTE_SB1xxx_SOC | 151 | depends on SIBYTE_SB1xxx_SOC |
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index 690de06bde90..ba59839a021e 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/linkage.h> | 20 | #include <linux/linkage.h> |
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
22 | #include <linux/smp.h> | ||
22 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
23 | #include <linux/mm.h> | 24 | #include <linux/mm.h> |
24 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
diff --git a/arch/mips/sibyte/cfe/Makefile b/arch/mips/sibyte/cfe/Makefile deleted file mode 100644 index 02b32e142adf..000000000000 --- a/arch/mips/sibyte/cfe/Makefile +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | lib-y = setup.o | ||
2 | lib-$(CONFIG_SIBYTE_CFE_CONSOLE) += console.o | ||
diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile index 48a91b9e5870..4f659837c7c6 100644 --- a/arch/mips/sibyte/common/Makefile +++ b/arch/mips/sibyte/common/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-y := | 1 | obj-y := cfe.o |
2 | 2 | obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o | |
3 | obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o | 3 | obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o |
4 | 4 | ||
5 | EXTRA_CFLAGS += -Werror | 5 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/common/cfe.c index eb5396cf81bb..eb5396cf81bb 100644 --- a/arch/mips/sibyte/cfe/setup.c +++ b/arch/mips/sibyte/common/cfe.c | |||
diff --git a/arch/mips/sibyte/cfe/console.c b/arch/mips/sibyte/common/cfe_console.c index 81e3d54376e9..1ad2da103fe9 100644 --- a/arch/mips/sibyte/cfe/console.c +++ b/arch/mips/sibyte/common/cfe_console.c | |||
@@ -51,12 +51,13 @@ static int cfe_console_setup(struct console *cons, char *str) | |||
51 | setleds("u0cn"); | 51 | setleds("u0cn"); |
52 | } else if (!strcmp(consdev, "uart1")) { | 52 | } else if (!strcmp(consdev, "uart1")) { |
53 | setleds("u1cn"); | 53 | setleds("u1cn"); |
54 | } else | ||
54 | #endif | 55 | #endif |
55 | #ifdef CONFIG_VGA_CONSOLE | 56 | #ifdef CONFIG_VGA_CONSOLE |
56 | } else if (!strcmp(consdev, "pcconsole0")) { | 57 | if (!strcmp(consdev, "pcconsole0")) { |
57 | setleds("pccn"); | 58 | setleds("pccn"); |
58 | #endif | ||
59 | } else | 59 | } else |
60 | #endif | ||
60 | return -ENODEV; | 61 | return -ENODEV; |
61 | } | 62 | } |
62 | return 0; | 63 | return 0; |
diff --git a/arch/mips/sibyte/sb1250/Makefile b/arch/mips/sibyte/sb1250/Makefile index 697793783a25..1896f4e77a30 100644 --- a/arch/mips/sibyte/sb1250/Makefile +++ b/arch/mips/sibyte/sb1250/Makefile | |||
@@ -1,7 +1,6 @@ | |||
1 | obj-y := setup.o irq.o time.o | 1 | obj-y := setup.o irq.o time.o |
2 | 2 | ||
3 | obj-$(CONFIG_SMP) += smp.o | 3 | obj-$(CONFIG_SMP) += smp.o |
4 | obj-$(CONFIG_SIBYTE_STANDALONE) += prom.o | ||
5 | obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o | 4 | obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o |
6 | 5 | ||
7 | EXTRA_CFLAGS += -Werror | 6 | EXTRA_CFLAGS += -Werror |
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index 409dec798863..5e7f2016cceb 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
@@ -111,11 +111,6 @@ static int sb1250_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
111 | 111 | ||
112 | i = cpumask_first(mask); | 112 | i = cpumask_first(mask); |
113 | 113 | ||
114 | if (cpumask_weight(mask) > 1) { | ||
115 | printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); | ||
116 | return -1; | ||
117 | } | ||
118 | |||
119 | /* Convert logical CPU to physical CPU */ | 114 | /* Convert logical CPU to physical CPU */ |
120 | cpu = cpu_logical_map(i); | 115 | cpu = cpu_logical_map(i); |
121 | 116 | ||
diff --git a/arch/mips/sibyte/sb1250/prom.c b/arch/mips/sibyte/sb1250/prom.c deleted file mode 100644 index 65b1af66b674..000000000000 --- a/arch/mips/sibyte/sb1250/prom.c +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001 Broadcom Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/init.h> | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/mm.h> | ||
22 | #include <linux/blkdev.h> | ||
23 | #include <linux/bootmem.h> | ||
24 | #include <linux/smp.h> | ||
25 | #include <linux/initrd.h> | ||
26 | #include <linux/pm.h> | ||
27 | |||
28 | #include <asm/bootinfo.h> | ||
29 | #include <asm/reboot.h> | ||
30 | |||
31 | #define MAX_RAM_SIZE ((CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - 1) | ||
32 | |||
33 | static __init void prom_meminit(void) | ||
34 | { | ||
35 | #ifdef CONFIG_BLK_DEV_INITRD | ||
36 | unsigned long initrd_pstart; | ||
37 | unsigned long initrd_pend; | ||
38 | |||
39 | initrd_pstart = __pa(initrd_start); | ||
40 | initrd_pend = __pa(initrd_end); | ||
41 | if (initrd_start && | ||
42 | ((initrd_pstart > MAX_RAM_SIZE) | ||
43 | || (initrd_pend > MAX_RAM_SIZE))) { | ||
44 | panic("initrd out of addressable memory"); | ||
45 | } | ||
46 | |||
47 | add_memory_region(0, initrd_pstart, | ||
48 | BOOT_MEM_RAM); | ||
49 | add_memory_region(initrd_pstart, initrd_pend - initrd_pstart, | ||
50 | BOOT_MEM_RESERVED); | ||
51 | add_memory_region(initrd_pend, | ||
52 | (CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - initrd_pend, | ||
53 | BOOT_MEM_RAM); | ||
54 | #else | ||
55 | add_memory_region(0, CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024, | ||
56 | BOOT_MEM_RAM); | ||
57 | #endif | ||
58 | } | ||
59 | |||
60 | void prom_cpu0_exit(void *unused) | ||
61 | { | ||
62 | while (1) ; | ||
63 | } | ||
64 | |||
65 | static void prom_linux_exit(void) | ||
66 | { | ||
67 | #ifdef CONFIG_SMP | ||
68 | if (smp_processor_id()) { | ||
69 | smp_call_function(prom_cpu0_exit, NULL, 1); | ||
70 | } | ||
71 | #endif | ||
72 | while(1); | ||
73 | } | ||
74 | |||
75 | /* | ||
76 | * prom_init is called just after the cpu type is determined, from setup_arch() | ||
77 | */ | ||
78 | void __init prom_init(void) | ||
79 | { | ||
80 | _machine_restart = (void (*)(char *))prom_linux_exit; | ||
81 | _machine_halt = prom_linux_exit; | ||
82 | pm_power_off = prom_linux_exit; | ||
83 | |||
84 | strcpy(arcs_cmdline, "root=/dev/ram0 "); | ||
85 | |||
86 | prom_meminit(); | ||
87 | } | ||
88 | |||
89 | void __init prom_free_prom_memory(void) | ||
90 | { | ||
91 | /* Not sure what I'm supposed to do here. Nothing, I think */ | ||
92 | } | ||
93 | |||
94 | void prom_putchar(char c) | ||
95 | { | ||
96 | } | ||
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c index 080c966263b7..672e45d495a9 100644 --- a/arch/mips/sibyte/swarm/setup.c +++ b/arch/mips/sibyte/swarm/setup.c | |||
@@ -136,20 +136,6 @@ void __init plat_mem_setup(void) | |||
136 | if (m41t81_probe()) | 136 | if (m41t81_probe()) |
137 | swarm_rtc_type = RTC_M4LT81; | 137 | swarm_rtc_type = RTC_M4LT81; |
138 | 138 | ||
139 | printk("This kernel optimized for " | ||
140 | #ifdef CONFIG_SIMULATION | ||
141 | "simulation" | ||
142 | #else | ||
143 | "board" | ||
144 | #endif | ||
145 | " runs " | ||
146 | #ifdef CONFIG_SIBYTE_CFE | ||
147 | "with" | ||
148 | #else | ||
149 | "without" | ||
150 | #endif | ||
151 | " CFE\n"); | ||
152 | |||
153 | #ifdef CONFIG_VT | 139 | #ifdef CONFIG_VT |
154 | screen_info = (struct screen_info) { | 140 | screen_info = (struct screen_info) { |
155 | 0, 0, /* orig-x, orig-y */ | 141 | 0, 0, /* orig-x, orig-y */ |
diff --git a/arch/mips/sibyte/swarm/swarm-i2c.c b/arch/mips/sibyte/swarm/swarm-i2c.c index 4282ac9d01d2..062505054d42 100644 --- a/arch/mips/sibyte/swarm/swarm-i2c.c +++ b/arch/mips/sibyte/swarm/swarm-i2c.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/mips/sibyte/swarm/swarm-i2c.c | ||
3 | * | ||
4 | * Broadcom BCM91250A (SWARM), etc. I2C platform setup. | 2 | * Broadcom BCM91250A (SWARM), etc. I2C platform setup. |
5 | * | 3 | * |
6 | * Copyright (c) 2008 Maciej W. Rozycki | 4 | * Copyright (c) 2008 Maciej W. Rozycki |
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c index 69f5f88711cc..0d9ec1a5c24a 100644 --- a/arch/mips/sni/time.c +++ b/arch/mips/sni/time.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
2 | #include <linux/interrupt.h> | 2 | #include <linux/interrupt.h> |
3 | #include <linux/smp.h> | ||
3 | #include <linux/time.h> | 4 | #include <linux/time.h> |
4 | #include <linux/clockchips.h> | 5 | #include <linux/clockchips.h> |
5 | 6 | ||
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig index 0db7cf38ed8b..852ae4bb7a85 100644 --- a/arch/mips/txx9/Kconfig +++ b/arch/mips/txx9/Kconfig | |||
@@ -69,6 +69,7 @@ config SOC_TX4927 | |||
69 | select IRQ_TXX9 | 69 | select IRQ_TXX9 |
70 | select PCI_TX4927 | 70 | select PCI_TX4927 |
71 | select GPIO_TXX9 | 71 | select GPIO_TXX9 |
72 | select HAS_TXX9_ACLC | ||
72 | 73 | ||
73 | config SOC_TX4938 | 74 | config SOC_TX4938 |
74 | bool | 75 | bool |
@@ -78,6 +79,7 @@ config SOC_TX4938 | |||
78 | select IRQ_TXX9 | 79 | select IRQ_TXX9 |
79 | select PCI_TX4927 | 80 | select PCI_TX4927 |
80 | select GPIO_TXX9 | 81 | select GPIO_TXX9 |
82 | select HAS_TXX9_ACLC | ||
81 | 83 | ||
82 | config SOC_TX4939 | 84 | config SOC_TX4939 |
83 | bool | 85 | bool |
@@ -85,6 +87,7 @@ config SOC_TX4939 | |||
85 | select HAS_TXX9_SERIAL | 87 | select HAS_TXX9_SERIAL |
86 | select HW_HAS_PCI | 88 | select HW_HAS_PCI |
87 | select PCI_TX4927 | 89 | select PCI_TX4927 |
90 | select HAS_TXX9_ACLC | ||
88 | 91 | ||
89 | config TXX9_7SEGLED | 92 | config TXX9_7SEGLED |
90 | bool | 93 | bool |
diff --git a/arch/mips/txx9/generic/mem_tx4927.c b/arch/mips/txx9/generic/mem_tx4927.c index ef6ea6e97873..70f9626f8227 100644 --- a/arch/mips/txx9/generic/mem_tx4927.c +++ b/arch/mips/txx9/generic/mem_tx4927.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/txx9/generic/mem_tx4927.c | ||
3 | * | ||
4 | * common tx4927 memory interface | 2 | * common tx4927 memory interface |
5 | * | 3 | * |
6 | * Author: MontaVista Software, Inc. | 4 | * Author: MontaVista Software, Inc. |
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 8a266c6a3f58..a205e2ba8e7b 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/mips/txx9/generic/setup.c | ||
3 | * | ||
4 | * Based on linux/arch/mips/txx9/rbtx4938/setup.c, | 2 | * Based on linux/arch/mips/txx9/rbtx4938/setup.c, |
5 | * and RBTX49xx patch from CELF patch archive. | 3 | * and RBTX49xx patch from CELF patch archive. |
6 | * | 4 | * |
@@ -24,6 +22,7 @@ | |||
24 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
25 | #include <linux/mtd/physmap.h> | 23 | #include <linux/mtd/physmap.h> |
26 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
25 | #include <linux/sysdev.h> | ||
27 | #include <asm/bootinfo.h> | 26 | #include <asm/bootinfo.h> |
28 | #include <asm/time.h> | 27 | #include <asm/time.h> |
29 | #include <asm/reboot.h> | 28 | #include <asm/reboot.h> |
@@ -33,6 +32,7 @@ | |||
33 | #include <asm/txx9/pci.h> | 32 | #include <asm/txx9/pci.h> |
34 | #include <asm/txx9tmr.h> | 33 | #include <asm/txx9tmr.h> |
35 | #include <asm/txx9/ndfmc.h> | 34 | #include <asm/txx9/ndfmc.h> |
35 | #include <asm/txx9/dmac.h> | ||
36 | #ifdef CONFIG_CPU_TX49XX | 36 | #ifdef CONFIG_CPU_TX49XX |
37 | #include <asm/txx9/tx4938.h> | 37 | #include <asm/txx9/tx4938.h> |
38 | #endif | 38 | #endif |
@@ -821,3 +821,176 @@ void __init txx9_iocled_init(unsigned long baseaddr, | |||
821 | { | 821 | { |
822 | } | 822 | } |
823 | #endif /* CONFIG_LEDS_GPIO */ | 823 | #endif /* CONFIG_LEDS_GPIO */ |
824 | |||
825 | void __init txx9_dmac_init(int id, unsigned long baseaddr, int irq, | ||
826 | const struct txx9dmac_platform_data *pdata) | ||
827 | { | ||
828 | #if defined(CONFIG_TXX9_DMAC) || defined(CONFIG_TXX9_DMAC_MODULE) | ||
829 | struct resource res[] = { | ||
830 | { | ||
831 | .start = baseaddr, | ||
832 | .end = baseaddr + 0x800 - 1, | ||
833 | .flags = IORESOURCE_MEM, | ||
834 | #ifndef CONFIG_MACH_TX49XX | ||
835 | }, { | ||
836 | .start = irq, | ||
837 | .flags = IORESOURCE_IRQ, | ||
838 | #endif | ||
839 | } | ||
840 | }; | ||
841 | #ifdef CONFIG_MACH_TX49XX | ||
842 | struct resource chan_res[] = { | ||
843 | { | ||
844 | .flags = IORESOURCE_IRQ, | ||
845 | } | ||
846 | }; | ||
847 | #endif | ||
848 | struct platform_device *pdev = platform_device_alloc("txx9dmac", id); | ||
849 | struct txx9dmac_chan_platform_data cpdata; | ||
850 | int i; | ||
851 | |||
852 | if (!pdev || | ||
853 | platform_device_add_resources(pdev, res, ARRAY_SIZE(res)) || | ||
854 | platform_device_add_data(pdev, pdata, sizeof(*pdata)) || | ||
855 | platform_device_add(pdev)) { | ||
856 | platform_device_put(pdev); | ||
857 | return; | ||
858 | } | ||
859 | memset(&cpdata, 0, sizeof(cpdata)); | ||
860 | cpdata.dmac_dev = pdev; | ||
861 | for (i = 0; i < TXX9_DMA_MAX_NR_CHANNELS; i++) { | ||
862 | #ifdef CONFIG_MACH_TX49XX | ||
863 | chan_res[0].start = irq + i; | ||
864 | #endif | ||
865 | pdev = platform_device_alloc("txx9dmac-chan", | ||
866 | id * TXX9_DMA_MAX_NR_CHANNELS + i); | ||
867 | if (!pdev || | ||
868 | #ifdef CONFIG_MACH_TX49XX | ||
869 | platform_device_add_resources(pdev, chan_res, | ||
870 | ARRAY_SIZE(chan_res)) || | ||
871 | #endif | ||
872 | platform_device_add_data(pdev, &cpdata, sizeof(cpdata)) || | ||
873 | platform_device_add(pdev)) | ||
874 | platform_device_put(pdev); | ||
875 | } | ||
876 | #endif | ||
877 | } | ||
878 | |||
879 | void __init txx9_aclc_init(unsigned long baseaddr, int irq, | ||
880 | unsigned int dmac_id, | ||
881 | unsigned int dma_chan_out, | ||
882 | unsigned int dma_chan_in) | ||
883 | { | ||
884 | #if defined(CONFIG_SND_SOC_TXX9ACLC) || \ | ||
885 | defined(CONFIG_SND_SOC_TXX9ACLC_MODULE) | ||
886 | unsigned int dma_base = dmac_id * TXX9_DMA_MAX_NR_CHANNELS; | ||
887 | struct resource res[] = { | ||
888 | { | ||
889 | .start = baseaddr, | ||
890 | .end = baseaddr + 0x100 - 1, | ||
891 | .flags = IORESOURCE_MEM, | ||
892 | }, { | ||
893 | .start = irq, | ||
894 | .flags = IORESOURCE_IRQ, | ||
895 | }, { | ||
896 | .name = "txx9dmac-chan", | ||
897 | .start = dma_base + dma_chan_out, | ||
898 | .flags = IORESOURCE_DMA, | ||
899 | }, { | ||
900 | .name = "txx9dmac-chan", | ||
901 | .start = dma_base + dma_chan_in, | ||
902 | .flags = IORESOURCE_DMA, | ||
903 | } | ||
904 | }; | ||
905 | struct platform_device *pdev = | ||
906 | platform_device_alloc("txx9aclc-ac97", -1); | ||
907 | |||
908 | if (!pdev || | ||
909 | platform_device_add_resources(pdev, res, ARRAY_SIZE(res)) || | ||
910 | platform_device_add(pdev)) | ||
911 | platform_device_put(pdev); | ||
912 | #endif | ||
913 | } | ||
914 | |||
915 | static struct sysdev_class txx9_sramc_sysdev_class; | ||
916 | |||
917 | struct txx9_sramc_sysdev { | ||
918 | struct sys_device dev; | ||
919 | struct bin_attribute bindata_attr; | ||
920 | void __iomem *base; | ||
921 | }; | ||
922 | |||
923 | static ssize_t txx9_sram_read(struct kobject *kobj, | ||
924 | struct bin_attribute *bin_attr, | ||
925 | char *buf, loff_t pos, size_t size) | ||
926 | { | ||
927 | struct txx9_sramc_sysdev *dev = bin_attr->private; | ||
928 | size_t ramsize = bin_attr->size; | ||
929 | |||
930 | if (pos >= ramsize) | ||
931 | return 0; | ||
932 | if (pos + size > ramsize) | ||
933 | size = ramsize - pos; | ||
934 | memcpy_fromio(buf, dev->base + pos, size); | ||
935 | return size; | ||
936 | } | ||
937 | |||
938 | static ssize_t txx9_sram_write(struct kobject *kobj, | ||
939 | struct bin_attribute *bin_attr, | ||
940 | char *buf, loff_t pos, size_t size) | ||
941 | { | ||
942 | struct txx9_sramc_sysdev *dev = bin_attr->private; | ||
943 | size_t ramsize = bin_attr->size; | ||
944 | |||
945 | if (pos >= ramsize) | ||
946 | return 0; | ||
947 | if (pos + size > ramsize) | ||
948 | size = ramsize - pos; | ||
949 | memcpy_toio(dev->base + pos, buf, size); | ||
950 | return size; | ||
951 | } | ||
952 | |||
953 | void __init txx9_sramc_init(struct resource *r) | ||
954 | { | ||
955 | struct txx9_sramc_sysdev *dev; | ||
956 | size_t size; | ||
957 | int err; | ||
958 | |||
959 | if (!txx9_sramc_sysdev_class.name) { | ||
960 | txx9_sramc_sysdev_class.name = "txx9_sram"; | ||
961 | err = sysdev_class_register(&txx9_sramc_sysdev_class); | ||
962 | if (err) { | ||
963 | txx9_sramc_sysdev_class.name = NULL; | ||
964 | return; | ||
965 | } | ||
966 | } | ||
967 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | ||
968 | if (!dev) | ||
969 | return; | ||
970 | size = resource_size(r); | ||
971 | dev->base = ioremap(r->start, size); | ||
972 | if (!dev->base) | ||
973 | goto exit; | ||
974 | dev->dev.cls = &txx9_sramc_sysdev_class; | ||
975 | dev->bindata_attr.attr.name = "bindata"; | ||
976 | dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; | ||
977 | dev->bindata_attr.read = txx9_sram_read; | ||
978 | dev->bindata_attr.write = txx9_sram_write; | ||
979 | dev->bindata_attr.size = size; | ||
980 | dev->bindata_attr.private = dev; | ||
981 | err = sysdev_register(&dev->dev); | ||
982 | if (err) | ||
983 | goto exit; | ||
984 | err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr); | ||
985 | if (err) { | ||
986 | sysdev_unregister(&dev->dev); | ||
987 | goto exit; | ||
988 | } | ||
989 | return; | ||
990 | exit: | ||
991 | if (dev) { | ||
992 | if (dev->base) | ||
993 | iounmap(dev->base); | ||
994 | kfree(dev); | ||
995 | } | ||
996 | } | ||
diff --git a/arch/mips/txx9/generic/setup_tx4927.c b/arch/mips/txx9/generic/setup_tx4927.c index 1093549df1a8..3418b2a90f7e 100644 --- a/arch/mips/txx9/generic/setup_tx4927.c +++ b/arch/mips/txx9/generic/setup_tx4927.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/txx9tmr.h> | 22 | #include <asm/txx9tmr.h> |
23 | #include <asm/txx9pio.h> | 23 | #include <asm/txx9pio.h> |
24 | #include <asm/txx9/generic.h> | 24 | #include <asm/txx9/generic.h> |
25 | #include <asm/txx9/dmac.h> | ||
25 | #include <asm/txx9/tx4927.h> | 26 | #include <asm/txx9/tx4927.h> |
26 | 27 | ||
27 | static void __init tx4927_wdr_init(void) | 28 | static void __init tx4927_wdr_init(void) |
@@ -253,6 +254,60 @@ void __init tx4927_mtd_init(int ch) | |||
253 | txx9_physmap_flash_init(ch, start, size, &pdata); | 254 | txx9_physmap_flash_init(ch, start, size, &pdata); |
254 | } | 255 | } |
255 | 256 | ||
257 | void __init tx4927_dmac_init(int memcpy_chan) | ||
258 | { | ||
259 | struct txx9dmac_platform_data plat_data = { | ||
260 | .memcpy_chan = memcpy_chan, | ||
261 | .have_64bit_regs = true, | ||
262 | }; | ||
263 | |||
264 | txx9_dmac_init(0, TX4927_DMA_REG & 0xfffffffffULL, | ||
265 | TXX9_IRQ_BASE + TX4927_IR_DMA(0), &plat_data); | ||
266 | } | ||
267 | |||
268 | void __init tx4927_aclc_init(unsigned int dma_chan_out, | ||
269 | unsigned int dma_chan_in) | ||
270 | { | ||
271 | u64 pcfg = __raw_readq(&tx4927_ccfgptr->pcfg); | ||
272 | __u64 dmasel_mask = 0, dmasel = 0; | ||
273 | unsigned long flags; | ||
274 | |||
275 | if (!(pcfg & TX4927_PCFG_SEL2)) | ||
276 | return; | ||
277 | /* setup DMASEL (playback:ACLC ch0, capture:ACLC ch1) */ | ||
278 | switch (dma_chan_out) { | ||
279 | case 0: | ||
280 | dmasel_mask |= TX4927_PCFG_DMASEL0_MASK; | ||
281 | dmasel |= TX4927_PCFG_DMASEL0_ACL0; | ||
282 | break; | ||
283 | case 2: | ||
284 | dmasel_mask |= TX4927_PCFG_DMASEL2_MASK; | ||
285 | dmasel |= TX4927_PCFG_DMASEL2_ACL0; | ||
286 | break; | ||
287 | default: | ||
288 | return; | ||
289 | } | ||
290 | switch (dma_chan_in) { | ||
291 | case 1: | ||
292 | dmasel_mask |= TX4927_PCFG_DMASEL1_MASK; | ||
293 | dmasel |= TX4927_PCFG_DMASEL1_ACL1; | ||
294 | break; | ||
295 | case 3: | ||
296 | dmasel_mask |= TX4927_PCFG_DMASEL3_MASK; | ||
297 | dmasel |= TX4927_PCFG_DMASEL3_ACL1; | ||
298 | break; | ||
299 | default: | ||
300 | return; | ||
301 | } | ||
302 | local_irq_save(flags); | ||
303 | txx9_clear64(&tx4927_ccfgptr->pcfg, dmasel_mask); | ||
304 | txx9_set64(&tx4927_ccfgptr->pcfg, dmasel); | ||
305 | local_irq_restore(flags); | ||
306 | txx9_aclc_init(TX4927_ACLC_REG & 0xfffffffffULL, | ||
307 | TXX9_IRQ_BASE + TX4927_IR_ACLC, | ||
308 | 0, dma_chan_out, dma_chan_in); | ||
309 | } | ||
310 | |||
256 | static void __init tx4927_stop_unused_modules(void) | 311 | static void __init tx4927_stop_unused_modules(void) |
257 | { | 312 | { |
258 | __u64 pcfg, rst = 0, ckd = 0; | 313 | __u64 pcfg, rst = 0, ckd = 0; |
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c index 3925219b8973..eb2080110239 100644 --- a/arch/mips/txx9/generic/setup_tx4938.c +++ b/arch/mips/txx9/generic/setup_tx4938.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/txx9pio.h> | 24 | #include <asm/txx9pio.h> |
25 | #include <asm/txx9/generic.h> | 25 | #include <asm/txx9/generic.h> |
26 | #include <asm/txx9/ndfmc.h> | 26 | #include <asm/txx9/ndfmc.h> |
27 | #include <asm/txx9/dmac.h> | ||
27 | #include <asm/txx9/tx4938.h> | 28 | #include <asm/txx9/tx4938.h> |
28 | 29 | ||
29 | static void __init tx4938_wdr_init(void) | 30 | static void __init tx4938_wdr_init(void) |
@@ -239,11 +240,6 @@ void __init tx4938_setup(void) | |||
239 | for (i = 0; i < TX4938_NR_TMR; i++) | 240 | for (i = 0; i < TX4938_NR_TMR; i++) |
240 | txx9_tmr_init(TX4938_TMR_REG(i) & 0xfffffffffULL); | 241 | txx9_tmr_init(TX4938_TMR_REG(i) & 0xfffffffffULL); |
241 | 242 | ||
242 | /* DMA */ | ||
243 | for (i = 0; i < 2; i++) | ||
244 | ____raw_writeq(TX4938_DMA_MCR_MSTEN, | ||
245 | (void __iomem *)(TX4938_DMA_REG(i) + 0x50)); | ||
246 | |||
247 | /* PIO */ | 243 | /* PIO */ |
248 | txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, TX4938_NUM_PIO); | 244 | txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, TX4938_NUM_PIO); |
249 | __raw_writel(0, &tx4938_pioptr->maskcpu); | 245 | __raw_writel(0, &tx4938_pioptr->maskcpu); |
@@ -403,6 +399,38 @@ void __init tx4938_ndfmc_init(unsigned int hold, unsigned int spw) | |||
403 | txx9_ndfmc_init(baseaddr, &plat_data); | 399 | txx9_ndfmc_init(baseaddr, &plat_data); |
404 | } | 400 | } |
405 | 401 | ||
402 | void __init tx4938_dmac_init(int memcpy_chan0, int memcpy_chan1) | ||
403 | { | ||
404 | struct txx9dmac_platform_data plat_data = { | ||
405 | .have_64bit_regs = true, | ||
406 | }; | ||
407 | int i; | ||
408 | |||
409 | for (i = 0; i < 2; i++) { | ||
410 | plat_data.memcpy_chan = i ? memcpy_chan1 : memcpy_chan0; | ||
411 | txx9_dmac_init(i, TX4938_DMA_REG(i) & 0xfffffffffULL, | ||
412 | TXX9_IRQ_BASE + TX4938_IR_DMA(i, 0), | ||
413 | &plat_data); | ||
414 | } | ||
415 | } | ||
416 | |||
417 | void __init tx4938_aclc_init(void) | ||
418 | { | ||
419 | u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg); | ||
420 | |||
421 | if ((pcfg & TX4938_PCFG_SEL2) && | ||
422 | !(pcfg & TX4938_PCFG_ETH0_SEL)) | ||
423 | txx9_aclc_init(TX4938_ACLC_REG & 0xfffffffffULL, | ||
424 | TXX9_IRQ_BASE + TX4938_IR_ACLC, | ||
425 | 1, 0, 1); | ||
426 | } | ||
427 | |||
428 | void __init tx4938_sramc_init(void) | ||
429 | { | ||
430 | if (tx4938_sram_resource.start) | ||
431 | txx9_sramc_init(&tx4938_sram_resource); | ||
432 | } | ||
433 | |||
406 | static void __init tx4938_stop_unused_modules(void) | 434 | static void __init tx4938_stop_unused_modules(void) |
407 | { | 435 | { |
408 | __u64 pcfg, rst = 0, ckd = 0; | 436 | __u64 pcfg, rst = 0, ckd = 0; |
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c index c2bf150c8838..3dc19f482959 100644 --- a/arch/mips/txx9/generic/setup_tx4939.c +++ b/arch/mips/txx9/generic/setup_tx4939.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/txx9tmr.h> | 28 | #include <asm/txx9tmr.h> |
29 | #include <asm/txx9/generic.h> | 29 | #include <asm/txx9/generic.h> |
30 | #include <asm/txx9/ndfmc.h> | 30 | #include <asm/txx9/ndfmc.h> |
31 | #include <asm/txx9/dmac.h> | ||
31 | #include <asm/txx9/tx4939.h> | 32 | #include <asm/txx9/tx4939.h> |
32 | 33 | ||
33 | static void __init tx4939_wdr_init(void) | 34 | static void __init tx4939_wdr_init(void) |
@@ -259,11 +260,6 @@ void __init tx4939_setup(void) | |||
259 | for (i = 0; i < TX4939_NR_TMR; i++) | 260 | for (i = 0; i < TX4939_NR_TMR; i++) |
260 | txx9_tmr_init(TX4939_TMR_REG(i) & 0xfffffffffULL); | 261 | txx9_tmr_init(TX4939_TMR_REG(i) & 0xfffffffffULL); |
261 | 262 | ||
262 | /* DMA */ | ||
263 | for (i = 0; i < 2; i++) | ||
264 | ____raw_writeq(TX4938_DMA_MCR_MSTEN, | ||
265 | (void __iomem *)(TX4939_DMA_REG(i) + 0x50)); | ||
266 | |||
267 | /* set PCIC1 reset (required to prevent hangup on BIST) */ | 263 | /* set PCIC1 reset (required to prevent hangup on BIST) */ |
268 | txx9_set64(&tx4939_ccfgptr->clkctr, TX4939_CLKCTR_PCI1RST); | 264 | txx9_set64(&tx4939_ccfgptr->clkctr, TX4939_CLKCTR_PCI1RST); |
269 | pcfg = ____raw_readq(&tx4939_ccfgptr->pcfg); | 265 | pcfg = ____raw_readq(&tx4939_ccfgptr->pcfg); |
@@ -474,6 +470,53 @@ void __init tx4939_ndfmc_init(unsigned int hold, unsigned int spw, | |||
474 | txx9_ndfmc_init(TX4939_NDFMC_REG & 0xfffffffffULL, &plat_data); | 470 | txx9_ndfmc_init(TX4939_NDFMC_REG & 0xfffffffffULL, &plat_data); |
475 | } | 471 | } |
476 | 472 | ||
473 | void __init tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1) | ||
474 | { | ||
475 | struct txx9dmac_platform_data plat_data = { | ||
476 | .have_64bit_regs = true, | ||
477 | }; | ||
478 | int i; | ||
479 | |||
480 | for (i = 0; i < 2; i++) { | ||
481 | plat_data.memcpy_chan = i ? memcpy_chan1 : memcpy_chan0; | ||
482 | txx9_dmac_init(i, TX4939_DMA_REG(i) & 0xfffffffffULL, | ||
483 | TXX9_IRQ_BASE + TX4939_IR_DMA(i, 0), | ||
484 | &plat_data); | ||
485 | } | ||
486 | } | ||
487 | |||
488 | void __init tx4939_aclc_init(void) | ||
489 | { | ||
490 | u64 pcfg = __raw_readq(&tx4939_ccfgptr->pcfg); | ||
491 | |||
492 | if ((pcfg & TX4939_PCFG_I2SMODE_MASK) == TX4939_PCFG_I2SMODE_ACLC) | ||
493 | txx9_aclc_init(TX4939_ACLC_REG & 0xfffffffffULL, | ||
494 | TXX9_IRQ_BASE + TX4939_IR_ACLC, 1, 0, 1); | ||
495 | } | ||
496 | |||
497 | void __init tx4939_sramc_init(void) | ||
498 | { | ||
499 | if (tx4939_sram_resource.start) | ||
500 | txx9_sramc_init(&tx4939_sram_resource); | ||
501 | } | ||
502 | |||
503 | void __init tx4939_rng_init(void) | ||
504 | { | ||
505 | static struct resource res = { | ||
506 | .start = TX4939_RNG_REG & 0xfffffffffULL, | ||
507 | .end = (TX4939_RNG_REG & 0xfffffffffULL) + 0x30 - 1, | ||
508 | .flags = IORESOURCE_MEM, | ||
509 | }; | ||
510 | static struct platform_device pdev = { | ||
511 | .name = "tx4939-rng", | ||
512 | .id = -1, | ||
513 | .num_resources = 1, | ||
514 | .resource = &res, | ||
515 | }; | ||
516 | |||
517 | platform_device_register(&pdev); | ||
518 | } | ||
519 | |||
477 | static void __init tx4939_stop_unused_modules(void) | 520 | static void __init tx4939_stop_unused_modules(void) |
478 | { | 521 | { |
479 | __u64 pcfg, rst = 0, ckd = 0; | 522 | __u64 pcfg, rst = 0, ckd = 0; |
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c index 01129a9d50fa..ee468eaee4f7 100644 --- a/arch/mips/txx9/rbtx4927/setup.c +++ b/arch/mips/txx9/rbtx4927/setup.c | |||
@@ -337,6 +337,14 @@ static void __init rbtx4927_device_init(void) | |||
337 | rbtx4927_ne_init(); | 337 | rbtx4927_ne_init(); |
338 | tx4927_wdt_init(); | 338 | tx4927_wdt_init(); |
339 | rbtx4927_mtd_init(); | 339 | rbtx4927_mtd_init(); |
340 | if (TX4927_REV_PCODE() == 0x4927) { | ||
341 | tx4927_dmac_init(2); | ||
342 | tx4927_aclc_init(0, 1); | ||
343 | } else { | ||
344 | tx4938_dmac_init(0, 2); | ||
345 | tx4938_aclc_init(); | ||
346 | } | ||
347 | platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); | ||
340 | txx9_iocled_init(RBTX4927_LED_ADDR - IO_BASE, -1, 3, 1, "green", NULL); | 348 | txx9_iocled_init(RBTX4927_LED_ADDR - IO_BASE, -1, 3, 1, "green", NULL); |
341 | rbtx4927_gpioled_init(); | 349 | rbtx4927_gpioled_init(); |
342 | } | 350 | } |
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c index 65d13df8878a..d66509b14284 100644 --- a/arch/mips/txx9/rbtx4938/setup.c +++ b/arch/mips/txx9/rbtx4938/setup.c | |||
@@ -355,6 +355,10 @@ static void __init rbtx4938_device_init(void) | |||
355 | /* TC58DVM82A1FT: tDH=10ns, tWP=tRP=tREADID=35ns */ | 355 | /* TC58DVM82A1FT: tDH=10ns, tWP=tRP=tREADID=35ns */ |
356 | tx4938_ndfmc_init(10, 35); | 356 | tx4938_ndfmc_init(10, 35); |
357 | tx4938_ata_init(RBTX4938_IRQ_IOC_ATA, 0, 1); | 357 | tx4938_ata_init(RBTX4938_IRQ_IOC_ATA, 0, 1); |
358 | tx4938_dmac_init(0, 2); | ||
359 | tx4938_aclc_init(); | ||
360 | platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); | ||
361 | tx4938_sramc_init(); | ||
358 | txx9_iocled_init(RBTX4938_LED_ADDR - IO_BASE, -1, 8, 1, "green", NULL); | 362 | txx9_iocled_init(RBTX4938_LED_ADDR - IO_BASE, -1, 8, 1, "green", NULL); |
359 | } | 363 | } |
360 | 364 | ||
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c index 4199c6fd4d1d..b0c241ecf603 100644 --- a/arch/mips/txx9/rbtx4939/setup.c +++ b/arch/mips/txx9/rbtx4939/setup.c | |||
@@ -498,6 +498,11 @@ static void __init rbtx4939_device_init(void) | |||
498 | tx4939_wdt_init(); | 498 | tx4939_wdt_init(); |
499 | tx4939_ata_init(); | 499 | tx4939_ata_init(); |
500 | tx4939_rtc_init(); | 500 | tx4939_rtc_init(); |
501 | tx4939_dmac_init(0, 2); | ||
502 | tx4939_aclc_init(); | ||
503 | platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); | ||
504 | tx4939_sramc_init(); | ||
505 | tx4939_rng_init(); | ||
501 | } | 506 | } |
502 | 507 | ||
503 | static void __init rbtx4939_setup(void) | 508 | static void __init rbtx4939_setup(void) |
@@ -507,10 +512,10 @@ static void __init rbtx4939_setup(void) | |||
507 | rbtx4939_ebusc_setup(); | 512 | rbtx4939_ebusc_setup(); |
508 | /* always enable ATA0 */ | 513 | /* always enable ATA0 */ |
509 | txx9_set64(&tx4939_ccfgptr->pcfg, TX4939_PCFG_ATA0MODE); | 514 | txx9_set64(&tx4939_ccfgptr->pcfg, TX4939_PCFG_ATA0MODE); |
510 | rbtx4939_update_ioc_pen(); | ||
511 | if (txx9_master_clock == 0) | 515 | if (txx9_master_clock == 0) |
512 | txx9_master_clock = 20000000; | 516 | txx9_master_clock = 20000000; |
513 | tx4939_setup(); | 517 | tx4939_setup(); |
518 | rbtx4939_update_ioc_pen(); | ||
514 | #ifdef HAVE_RBTX4939_IOSWAB | 519 | #ifdef HAVE_RBTX4939_IOSWAB |
515 | ioswabw = rbtx4939_ioswabw; | 520 | ioswabw = rbtx4939_ioswabw; |
516 | __mem_ioswabw = rbtx4939_mem_ioswabw; | 521 | __mem_ioswabw = rbtx4939_mem_ioswabw; |
diff --git a/arch/mips/vr41xx/casio-e55/setup.c b/arch/mips/vr41xx/casio-e55/setup.c index 6d9bab890587..719f4a5b9844 100644 --- a/arch/mips/vr41xx/casio-e55/setup.c +++ b/arch/mips/vr41xx/casio-e55/setup.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65. | 2 | * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c index d77c330a0d59..6346c59c9f9d 100644 --- a/arch/mips/vr41xx/common/bcu.c +++ b/arch/mips/vr41xx/common/bcu.c | |||
@@ -2,8 +2,8 @@ | |||
2 | * bcu.c, Bus Control Unit routines for the NEC VR4100 series. | 2 | * bcu.c, Bus Control Unit routines for the NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2002 MontaVista Software Inc. | 4 | * Copyright (C) 2002 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> | 5 | * Author: Yoichi Yuasa <source@mvista.com> |
6 | * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -21,11 +21,11 @@ | |||
21 | */ | 21 | */ |
22 | /* | 22 | /* |
23 | * Changes: | 23 | * Changes: |
24 | * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> | 24 | * MontaVista Software Inc. <source@mvista.com> |
25 | * - New creation, NEC VR4122 and VR4131 are supported. | 25 | * - New creation, NEC VR4122 and VR4131 are supported. |
26 | * - Added support for NEC VR4111 and VR4121. | 26 | * - Added support for NEC VR4111 and VR4121. |
27 | * | 27 | * |
28 | * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 28 | * Yoichi Yuasa <yuasa@linux-mips.org> |
29 | * - Added support for NEC VR4133. | 29 | * - Added support for NEC VR4133. |
30 | */ | 30 | */ |
31 | #include <linux/kernel.h> | 31 | #include <linux/kernel.h> |
diff --git a/arch/mips/vr41xx/common/cmu.c b/arch/mips/vr41xx/common/cmu.c index ad0e8e3409d9..8ba7d04a5ec5 100644 --- a/arch/mips/vr41xx/common/cmu.c +++ b/arch/mips/vr41xx/common/cmu.c | |||
@@ -2,8 +2,8 @@ | |||
2 | * cmu.c, Clock Mask Unit routines for the NEC VR4100 series. | 2 | * cmu.c, Clock Mask Unit routines for the NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2001-2002 MontaVista Software Inc. | 4 | * Copyright (C) 2001-2002 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> | 5 | * Author: Yoichi Yuasa <source@mvista.com> |
6 | * Copuright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copuright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -21,11 +21,11 @@ | |||
21 | */ | 21 | */ |
22 | /* | 22 | /* |
23 | * Changes: | 23 | * Changes: |
24 | * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> | 24 | * MontaVista Software Inc. <source@mvista.com> |
25 | * - New creation, NEC VR4122 and VR4131 are supported. | 25 | * - New creation, NEC VR4122 and VR4131 are supported. |
26 | * - Added support for NEC VR4111 and VR4121. | 26 | * - Added support for NEC VR4111 and VR4121. |
27 | * | 27 | * |
28 | * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 28 | * Yoichi Yuasa <yuasa@linux-mips.org> |
29 | * - Added support for NEC VR4133. | 29 | * - Added support for NEC VR4133. |
30 | */ | 30 | */ |
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c index 2b272f1496fe..22cc6f2100a1 100644 --- a/arch/mips/vr41xx/common/giu.c +++ b/arch/mips/vr41xx/common/giu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * NEC VR4100 series GIU platform device. | 2 | * NEC VR4100 series GIU platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c index 3f23d9fda662..6d39e222b170 100644 --- a/arch/mips/vr41xx/common/icu.c +++ b/arch/mips/vr41xx/common/icu.c | |||
@@ -2,8 +2,8 @@ | |||
2 | * icu.c, Interrupt Control Unit routines for the NEC VR4100 series. | 2 | * icu.c, Interrupt Control Unit routines for the NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2001-2002 MontaVista Software Inc. | 4 | * Copyright (C) 2001-2002 MontaVista Software Inc. |
5 | * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> | 5 | * Author: Yoichi Yuasa <source@mvista.com> |
6 | * Copyright (C) 2003-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 6 | * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -21,11 +21,11 @@ | |||
21 | */ | 21 | */ |
22 | /* | 22 | /* |
23 | * Changes: | 23 | * Changes: |
24 | * MontaVista Software Inc. <yyuasa@mvista.com> or <source@mvista.com> | 24 | * MontaVista Software Inc. <source@mvista.com> |
25 | * - New creation, NEC VR4122 and VR4131 are supported. | 25 | * - New creation, NEC VR4122 and VR4131 are supported. |
26 | * - Added support for NEC VR4111 and VR4121. | 26 | * - Added support for NEC VR4111 and VR4121. |
27 | * | 27 | * |
28 | * Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 28 | * Yoichi Yuasa <yuasa@linux-mips.org> |
29 | * - Coped with INTASSIGN of NEC VR4133. | 29 | * - Coped with INTASSIGN of NEC VR4133. |
30 | */ | 30 | */ |
31 | #include <linux/errno.h> | 31 | #include <linux/errno.h> |
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c index c64995342ba8..1386e6f081c8 100644 --- a/arch/mips/vr41xx/common/init.c +++ b/arch/mips/vr41xx/common/init.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * init.c, Common initialization routines for NEC VR4100 series. | 2 | * init.c, Common initialization routines for NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2003-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c index 9cc389109b19..bef06872f012 100644 --- a/arch/mips/vr41xx/common/irq.c +++ b/arch/mips/vr41xx/common/irq.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Interrupt handing routines for NEC VR4100 series. | 2 | * Interrupt handing routines for NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2005-2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c index 028aaf75eb21..692b4e85b7fc 100644 --- a/arch/mips/vr41xx/common/pmu.c +++ b/arch/mips/vr41xx/common/pmu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * pmu.c, Power Management Unit routines for NEC VR4100 series. | 2 | * pmu.c, Power Management Unit routines for NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2003-2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/rtc.c b/arch/mips/vr41xx/common/rtc.c index 9f26c14edcac..ebc5dcf0ed8e 100644 --- a/arch/mips/vr41xx/common/rtc.c +++ b/arch/mips/vr41xx/common/rtc.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * NEC VR4100 series RTC platform device. | 2 | * NEC VR4100 series RTC platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/siu.c b/arch/mips/vr41xx/common/siu.c index 654dee6208be..54eae56108fb 100644 --- a/arch/mips/vr41xx/common/siu.c +++ b/arch/mips/vr41xx/common/siu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * NEC VR4100 series SIU platform device. | 2 | * NEC VR4100 series SIU platform device. |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2007-2008 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/common/type.c b/arch/mips/vr41xx/common/type.c index e0c1ac5e988e..ff841422b638 100644 --- a/arch/mips/vr41xx/common/type.c +++ b/arch/mips/vr41xx/common/type.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * type.c, System type for NEC VR4100 series. | 2 | * type.c, System type for NEC VR4100 series. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
diff --git a/arch/mips/vr41xx/ibm-workpad/setup.c b/arch/mips/vr41xx/ibm-workpad/setup.c index 9eef297eca1a..3982f378a3e6 100644 --- a/arch/mips/vr41xx/ibm-workpad/setup.c +++ b/arch/mips/vr41xx/ibm-workpad/setup.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * setup.c, Setup for the IBM WorkPad z50. | 2 | * setup.c, Setup for the IBM WorkPad z50. |
3 | * | 3 | * |
4 | * Copyright (C) 2002-2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | 4 | * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org> |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |