diff options
Diffstat (limited to 'arch')
367 files changed, 5201 insertions, 5004 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e25419817791..ae5d6152d977 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -306,9 +306,12 @@ choice | |||
306 | config ARCH_MULTIPLATFORM | 306 | config ARCH_MULTIPLATFORM |
307 | bool "Allow multiple platforms to be selected" | 307 | bool "Allow multiple platforms to be selected" |
308 | depends on MMU | 308 | depends on MMU |
309 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
310 | select ARM_HAS_SG_CHAIN | ||
309 | select ARM_PATCH_PHYS_VIRT | 311 | select ARM_PATCH_PHYS_VIRT |
310 | select AUTO_ZRELADDR | 312 | select AUTO_ZRELADDR |
311 | select COMMON_CLK | 313 | select COMMON_CLK |
314 | select GENERIC_CLOCKEVENTS | ||
312 | select MULTI_IRQ_HANDLER | 315 | select MULTI_IRQ_HANDLER |
313 | select SPARSE_IRQ | 316 | select SPARSE_IRQ |
314 | select USE_OF | 317 | select USE_OF |
@@ -388,8 +391,6 @@ config ARCH_CLPS711X | |||
388 | select CPU_ARM720T | 391 | select CPU_ARM720T |
389 | select GENERIC_CLOCKEVENTS | 392 | select GENERIC_CLOCKEVENTS |
390 | select MFD_SYSCON | 393 | select MFD_SYSCON |
391 | select MULTI_IRQ_HANDLER | ||
392 | select SPARSE_IRQ | ||
393 | help | 394 | help |
394 | Support for Cirrus Logic 711x/721x/731x based boards. | 395 | Support for Cirrus Logic 711x/721x/731x based boards. |
395 | 396 | ||
@@ -657,9 +658,8 @@ config ARCH_PXA | |||
657 | help | 658 | help |
658 | Support for Intel/Marvell's PXA2xx/PXA3xx processor line. | 659 | Support for Intel/Marvell's PXA2xx/PXA3xx processor line. |
659 | 660 | ||
660 | config ARCH_MSM_NODT | 661 | config ARCH_MSM |
661 | bool "Qualcomm MSM" | 662 | bool "Qualcomm MSM (non-multiplatform)" |
662 | select ARCH_MSM | ||
663 | select ARCH_REQUIRE_GPIOLIB | 663 | select ARCH_REQUIRE_GPIOLIB |
664 | select COMMON_CLK | 664 | select COMMON_CLK |
665 | select GENERIC_CLOCKEVENTS | 665 | select GENERIC_CLOCKEVENTS |
@@ -898,7 +898,7 @@ config ARCH_MULTI_V5 | |||
898 | bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" | 898 | bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" |
899 | depends on !ARCH_MULTI_V6_V7 | 899 | depends on !ARCH_MULTI_V6_V7 |
900 | select ARCH_MULTI_V4_V5 | 900 | select ARCH_MULTI_V4_V5 |
901 | select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \ | 901 | select CPU_ARM926T if !(CPU_ARM946E || CPU_ARM1020 || \ |
902 | CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ | 902 | CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \ |
903 | CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) | 903 | CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_FEROCEON) |
904 | 904 | ||
@@ -908,16 +908,18 @@ config ARCH_MULTI_V4_V5 | |||
908 | config ARCH_MULTI_V6 | 908 | config ARCH_MULTI_V6 |
909 | bool "ARMv6 based platforms (ARM11)" | 909 | bool "ARMv6 based platforms (ARM11)" |
910 | select ARCH_MULTI_V6_V7 | 910 | select ARCH_MULTI_V6_V7 |
911 | select CPU_V6 | 911 | select CPU_V6K |
912 | 912 | ||
913 | config ARCH_MULTI_V7 | 913 | config ARCH_MULTI_V7 |
914 | bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)" | 914 | bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)" |
915 | default y | 915 | default y |
916 | select ARCH_MULTI_V6_V7 | 916 | select ARCH_MULTI_V6_V7 |
917 | select CPU_V7 | 917 | select CPU_V7 |
918 | select HAVE_SMP | ||
918 | 919 | ||
919 | config ARCH_MULTI_V6_V7 | 920 | config ARCH_MULTI_V6_V7 |
920 | bool | 921 | bool |
922 | select MIGHT_HAVE_CACHE_L2X0 | ||
921 | 923 | ||
922 | config ARCH_MULTI_CPU_AUTO | 924 | config ARCH_MULTI_CPU_AUTO |
923 | def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7) | 925 | def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7) |
@@ -925,6 +927,13 @@ config ARCH_MULTI_CPU_AUTO | |||
925 | 927 | ||
926 | endmenu | 928 | endmenu |
927 | 929 | ||
930 | config ARCH_VIRT | ||
931 | bool "Dummy Virtual Machine" if ARCH_MULTI_V7 | ||
932 | select ARM_AMBA | ||
933 | select ARM_GIC | ||
934 | select ARM_PSCI | ||
935 | select HAVE_ARM_ARCH_TIMER | ||
936 | |||
928 | # | 937 | # |
929 | # This is sorted alphabetically by mach-* pathname. However, plat-* | 938 | # This is sorted alphabetically by mach-* pathname. However, plat-* |
930 | # Kconfigs may be included either alphabetically (according to the | 939 | # Kconfigs may be included either alphabetically (according to the |
@@ -1005,6 +1014,8 @@ source "arch/arm/plat-pxa/Kconfig" | |||
1005 | 1014 | ||
1006 | source "arch/arm/mach-mmp/Kconfig" | 1015 | source "arch/arm/mach-mmp/Kconfig" |
1007 | 1016 | ||
1017 | source "arch/arm/mach-qcom/Kconfig" | ||
1018 | |||
1008 | source "arch/arm/mach-realview/Kconfig" | 1019 | source "arch/arm/mach-realview/Kconfig" |
1009 | 1020 | ||
1010 | source "arch/arm/mach-rockchip/Kconfig" | 1021 | source "arch/arm/mach-rockchip/Kconfig" |
@@ -1048,8 +1059,6 @@ source "arch/arm/mach-versatile/Kconfig" | |||
1048 | source "arch/arm/mach-vexpress/Kconfig" | 1059 | source "arch/arm/mach-vexpress/Kconfig" |
1049 | source "arch/arm/plat-versatile/Kconfig" | 1060 | source "arch/arm/plat-versatile/Kconfig" |
1050 | 1061 | ||
1051 | source "arch/arm/mach-virt/Kconfig" | ||
1052 | |||
1053 | source "arch/arm/mach-vt8500/Kconfig" | 1062 | source "arch/arm/mach-vt8500/Kconfig" |
1054 | 1063 | ||
1055 | source "arch/arm/mach-w90x900/Kconfig" | 1064 | source "arch/arm/mach-w90x900/Kconfig" |
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 0531da8e5216..ceecb66cb1e3 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -106,9 +106,14 @@ choice | |||
106 | depends on ARCH_BCM2835 | 106 | depends on ARCH_BCM2835 |
107 | select DEBUG_UART_PL01X | 107 | select DEBUG_UART_PL01X |
108 | 108 | ||
109 | config DEBUG_BCM_5301X | ||
110 | bool "Kernel low-level debugging on BCM5301X UART1" | ||
111 | depends on ARCH_BCM_5301X | ||
112 | select DEBUG_UART_PL01X | ||
113 | |||
109 | config DEBUG_BCM_KONA_UART | 114 | config DEBUG_BCM_KONA_UART |
110 | bool "Kernel low-level debugging messages via BCM KONA UART" | 115 | bool "Kernel low-level debugging messages via BCM KONA UART" |
111 | depends on ARCH_BCM | 116 | depends on ARCH_BCM_MOBILE |
112 | select DEBUG_UART_8250 | 117 | select DEBUG_UART_8250 |
113 | help | 118 | help |
114 | Say Y here if you want kernel low-level debugging support | 119 | Say Y here if you want kernel low-level debugging support |
@@ -171,15 +176,6 @@ choice | |||
171 | Say Y here if you want the debug print routines to direct | 176 | Say Y here if you want the debug print routines to direct |
172 | their output to UART0 serial port on DaVinci DMx devices. | 177 | their output to UART0 serial port on DaVinci DMx devices. |
173 | 178 | ||
174 | config DEBUG_DAVINCI_TNETV107X_UART1 | ||
175 | bool "Kernel low-level debugging on DaVinci TNETV107x using UART1" | ||
176 | depends on ARCH_DAVINCI_TNETV107X | ||
177 | select DEBUG_UART_8250 | ||
178 | help | ||
179 | Say Y here if you want the debug print routines to direct | ||
180 | their output to UART1 serial port on DaVinci TNETV107X | ||
181 | devices. | ||
182 | |||
183 | config DEBUG_ZYNQ_UART0 | 179 | config DEBUG_ZYNQ_UART0 |
184 | bool "Kernel low-level debugging on Xilinx Zynq using UART0" | 180 | bool "Kernel low-level debugging on Xilinx Zynq using UART0" |
185 | depends on ARCH_ZYNQ | 181 | depends on ARCH_ZYNQ |
@@ -956,7 +952,7 @@ config DEBUG_STI_UART | |||
956 | 952 | ||
957 | config DEBUG_MSM_UART | 953 | config DEBUG_MSM_UART |
958 | bool | 954 | bool |
959 | depends on ARCH_MSM | 955 | depends on ARCH_MSM || ARCH_QCOM |
960 | 956 | ||
961 | config DEBUG_LL_INCLUDE | 957 | config DEBUG_LL_INCLUDE |
962 | string | 958 | string |
@@ -1014,7 +1010,6 @@ config DEBUG_UART_PHYS | |||
1014 | default 0x02530c00 if DEBUG_KEYSTONE_UART0 | 1010 | default 0x02530c00 if DEBUG_KEYSTONE_UART0 |
1015 | default 0x02531000 if DEBUG_KEYSTONE_UART1 | 1011 | default 0x02531000 if DEBUG_KEYSTONE_UART1 |
1016 | default 0x03010fe0 if ARCH_RPC | 1012 | default 0x03010fe0 if ARCH_RPC |
1017 | default 0x08108300 if DEBUG_DAVINCI_TNETV107X_UART1 | ||
1018 | default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \ | 1013 | default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \ |
1019 | DEBUG_VEXPRESS_UART0_CA9 | 1014 | DEBUG_VEXPRESS_UART0_CA9 |
1020 | default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT | 1015 | default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT |
@@ -1023,6 +1018,7 @@ config DEBUG_UART_PHYS | |||
1023 | default 0x101f1000 if ARCH_VERSATILE | 1018 | default 0x101f1000 if ARCH_VERSATILE |
1024 | default 0x101fb000 if DEBUG_NOMADIK_UART | 1019 | default 0x101fb000 if DEBUG_NOMADIK_UART |
1025 | default 0x16000000 if ARCH_INTEGRATOR | 1020 | default 0x16000000 if ARCH_INTEGRATOR |
1021 | default 0x18000300 if DEBUG_BCM_5301X | ||
1026 | default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 | 1022 | default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 |
1027 | default 0x20060000 if DEBUG_RK29_UART0 | 1023 | default 0x20060000 if DEBUG_RK29_UART0 |
1028 | default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 | 1024 | default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 |
@@ -1071,6 +1067,7 @@ config DEBUG_UART_VIRT | |||
1071 | default 0xf0009000 if DEBUG_CNS3XXX | 1067 | default 0xf0009000 if DEBUG_CNS3XXX |
1072 | default 0xf01fb000 if DEBUG_NOMADIK_UART | 1068 | default 0xf01fb000 if DEBUG_NOMADIK_UART |
1073 | default 0xf0201000 if DEBUG_BCM2835 | 1069 | default 0xf0201000 if DEBUG_BCM2835 |
1070 | default 0xf1000300 if DEBUG_BCM_5301X | ||
1074 | default 0xf11f1000 if ARCH_VERSATILE | 1071 | default 0xf11f1000 if ARCH_VERSATILE |
1075 | default 0xf1600000 if ARCH_INTEGRATOR | 1072 | default 0xf1600000 if ARCH_INTEGRATOR |
1076 | default 0xf1c28000 if DEBUG_SUNXI_UART0 | 1073 | default 0xf1c28000 if DEBUG_SUNXI_UART0 |
@@ -1110,7 +1107,6 @@ config DEBUG_UART_VIRT | |||
1110 | default 0xfed12000 if ARCH_KIRKWOOD | 1107 | default 0xfed12000 if ARCH_KIRKWOOD |
1111 | default 0xfedc0000 if ARCH_EP93XX | 1108 | default 0xfedc0000 if ARCH_EP93XX |
1112 | default 0xfee003f8 if FOOTBRIDGE | 1109 | default 0xfee003f8 if FOOTBRIDGE |
1113 | default 0xfee08300 if DEBUG_DAVINCI_TNETV107X_UART1 | ||
1114 | default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART | 1110 | default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART |
1115 | default 0xfef36000 if DEBUG_HIGHBANK_UART | 1111 | default 0xfef36000 if DEBUG_HIGHBANK_UART |
1116 | default 0xfee82340 if ARCH_IOP13XX | 1112 | default 0xfee82340 if ARCH_IOP13XX |
@@ -1135,7 +1131,7 @@ config DEBUG_UART_8250_WORD | |||
1135 | default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \ | 1131 | default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \ |
1136 | ARCH_KEYSTONE || \ | 1132 | ARCH_KEYSTONE || \ |
1137 | DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \ | 1133 | DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \ |
1138 | DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_DAVINCI_TNETV107X_UART1 || \ | 1134 | DEBUG_DAVINCI_DA8XX_UART2 || \ |
1139 | DEBUG_BCM_KONA_UART | 1135 | DEBUG_BCM_KONA_UART |
1140 | 1136 | ||
1141 | config DEBUG_UART_8250_FLOW_CONTROL | 1137 | config DEBUG_UART_8250_FLOW_CONTROL |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 08a9ef58d9c3..dd1bd7ed77be 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -180,6 +180,7 @@ machine-$(CONFIG_ARCH_OMAP2PLUS) += omap2 | |||
180 | machine-$(CONFIG_ARCH_ORION5X) += orion5x | 180 | machine-$(CONFIG_ARCH_ORION5X) += orion5x |
181 | machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell | 181 | machine-$(CONFIG_ARCH_PICOXCELL) += picoxcell |
182 | machine-$(CONFIG_ARCH_PXA) += pxa | 182 | machine-$(CONFIG_ARCH_PXA) += pxa |
183 | machine-$(CONFIG_ARCH_QCOM) += qcom | ||
183 | machine-$(CONFIG_ARCH_REALVIEW) += realview | 184 | machine-$(CONFIG_ARCH_REALVIEW) += realview |
184 | machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip | 185 | machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip |
185 | machine-$(CONFIG_ARCH_RPC) += rpc | 186 | machine-$(CONFIG_ARCH_RPC) += rpc |
@@ -199,7 +200,6 @@ machine-$(CONFIG_ARCH_U300) += u300 | |||
199 | machine-$(CONFIG_ARCH_U8500) += ux500 | 200 | machine-$(CONFIG_ARCH_U8500) += ux500 |
200 | machine-$(CONFIG_ARCH_VERSATILE) += versatile | 201 | machine-$(CONFIG_ARCH_VERSATILE) += versatile |
201 | machine-$(CONFIG_ARCH_VEXPRESS) += vexpress | 202 | machine-$(CONFIG_ARCH_VEXPRESS) += vexpress |
202 | machine-$(CONFIG_ARCH_VIRT) += virt | ||
203 | machine-$(CONFIG_ARCH_VT8500) += vt8500 | 203 | machine-$(CONFIG_ARCH_VT8500) += vt8500 |
204 | machine-$(CONFIG_ARCH_W90X900) += w90x900 | 204 | machine-$(CONFIG_ARCH_W90X900) += w90x900 |
205 | machine-$(CONFIG_ARCH_ZYNQ) += zynq | 205 | machine-$(CONFIG_ARCH_ZYNQ) += zynq |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b9d6a8b485e0..f8581e49982c 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -38,6 +38,7 @@ dtb-$(CONFIG_ARCH_AT91) += at91sam9g35ek.dtb | |||
38 | dtb-$(CONFIG_ARCH_AT91) += at91sam9x25ek.dtb | 38 | dtb-$(CONFIG_ARCH_AT91) += at91sam9x25ek.dtb |
39 | dtb-$(CONFIG_ARCH_AT91) += at91sam9x35ek.dtb | 39 | dtb-$(CONFIG_ARCH_AT91) += at91sam9x35ek.dtb |
40 | # sama5d3 | 40 | # sama5d3 |
41 | dtb-$(CONFIG_ARCH_AT91) += at91-sama5d3_xplained.dtb | ||
41 | dtb-$(CONFIG_ARCH_AT91) += sama5d31ek.dtb | 42 | dtb-$(CONFIG_ARCH_AT91) += sama5d31ek.dtb |
42 | dtb-$(CONFIG_ARCH_AT91) += sama5d33ek.dtb | 43 | dtb-$(CONFIG_ARCH_AT91) += sama5d33ek.dtb |
43 | dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb | 44 | dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb |
@@ -54,7 +55,7 @@ dtb-$(CONFIG_ARCH_BERLIN) += \ | |||
54 | berlin2cd-google-chromecast.dtb | 55 | berlin2cd-google-chromecast.dtb |
55 | dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \ | 56 | dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \ |
56 | da850-evm.dtb | 57 | da850-evm.dtb |
57 | dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \ | 58 | dtb-$(CONFIG_MACH_DOVE) += dove-cm-a510.dtb \ |
58 | dove-cubox.dtb \ | 59 | dove-cubox.dtb \ |
59 | dove-d2plug.dtb \ | 60 | dove-d2plug.dtb \ |
60 | dove-d3plug.dtb \ | 61 | dove-d3plug.dtb \ |
@@ -81,8 +82,8 @@ dtb-$(CONFIG_ARCH_HIGHBANK) += highbank.dtb \ | |||
81 | ecx-2000.dtb | 82 | ecx-2000.dtb |
82 | dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ | 83 | dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \ |
83 | integratorcp.dtb | 84 | integratorcp.dtb |
84 | dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb | 85 | kirkwood := \ |
85 | dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ | 86 | kirkwood-cloudbox.dtb \ |
86 | kirkwood-db-88f6281.dtb \ | 87 | kirkwood-db-88f6281.dtb \ |
87 | kirkwood-db-88f6282.dtb \ | 88 | kirkwood-db-88f6282.dtb \ |
88 | kirkwood-dns320.dtb \ | 89 | kirkwood-dns320.dtb \ |
@@ -116,11 +117,11 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ | |||
116 | kirkwood-topkick.dtb \ | 117 | kirkwood-topkick.dtb \ |
117 | kirkwood-ts219-6281.dtb \ | 118 | kirkwood-ts219-6281.dtb \ |
118 | kirkwood-ts219-6282.dtb | 119 | kirkwood-ts219-6282.dtb |
120 | dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood) | ||
121 | dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood) | ||
122 | dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb | ||
119 | dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb | 123 | dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb |
120 | dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb | 124 | dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb |
121 | dtb-$(CONFIG_ARCH_MSM) += qcom-msm8660-surf.dtb \ | ||
122 | qcom-msm8960-cdp.dtb \ | ||
123 | qcom-apq8074-dragonboard.dtb | ||
124 | dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ | 125 | dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ |
125 | armada-370-mirabox.dtb \ | 126 | armada-370-mirabox.dtb \ |
126 | armada-370-netgear-rn102.dtb \ | 127 | armada-370-netgear-rn102.dtb \ |
@@ -208,7 +209,8 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ | |||
208 | omap3-n900.dtb \ | 209 | omap3-n900.dtb \ |
209 | omap3-n9.dtb \ | 210 | omap3-n9.dtb \ |
210 | omap3-n950.dtb \ | 211 | omap3-n950.dtb \ |
211 | omap3-tobi.dtb \ | 212 | omap3-overo-tobi.dtb \ |
213 | omap3-overo-storm-tobi.dtb \ | ||
212 | omap3-gta04.dtb \ | 214 | omap3-gta04.dtb \ |
213 | omap3-igep0020.dtb \ | 215 | omap3-igep0020.dtb \ |
214 | omap3-igep0030.dtb \ | 216 | omap3-igep0030.dtb \ |
@@ -232,6 +234,9 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ | |||
232 | dra7-evm.dtb | 234 | dra7-evm.dtb |
233 | dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb | 235 | dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb |
234 | dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb | 236 | dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb |
237 | dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \ | ||
238 | qcom-msm8960-cdp.dtb \ | ||
239 | qcom-apq8074-dragonboard.dtb | ||
235 | dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ | 240 | dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ |
236 | ste-hrefprev60-stuib.dtb \ | 241 | ste-hrefprev60-stuib.dtb \ |
237 | ste-hrefprev60-tvk.dtb \ | 242 | ste-hrefprev60-tvk.dtb \ |
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index 4718ec4a4dbf..486880b74831 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts | |||
@@ -121,7 +121,7 @@ | |||
121 | ti,model = "AM335x-EVMSK"; | 121 | ti,model = "AM335x-EVMSK"; |
122 | ti,audio-codec = <&tlv320aic3106>; | 122 | ti,audio-codec = <&tlv320aic3106>; |
123 | ti,mcasp-controller = <&mcasp1>; | 123 | ti,mcasp-controller = <&mcasp1>; |
124 | ti,codec-clock-rate = <24576000>; | 124 | ti,codec-clock-rate = <24000000>; |
125 | ti,audio-routing = | 125 | ti,audio-routing = |
126 | "Headphone Jack", "HPLOUT", | 126 | "Headphone Jack", "HPLOUT", |
127 | "Headphone Jack", "HPROUT"; | 127 | "Headphone Jack", "HPROUT"; |
@@ -256,6 +256,12 @@ | |||
256 | >; | 256 | >; |
257 | }; | 257 | }; |
258 | 258 | ||
259 | mmc1_pins: pinmux_mmc1_pins { | ||
260 | pinctrl-single,pins = < | ||
261 | 0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ | ||
262 | >; | ||
263 | }; | ||
264 | |||
259 | mcasp1_pins: mcasp1_pins { | 265 | mcasp1_pins: mcasp1_pins { |
260 | pinctrl-single,pins = < | 266 | pinctrl-single,pins = < |
261 | 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */ | 267 | 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */ |
@@ -456,6 +462,9 @@ | |||
456 | status = "okay"; | 462 | status = "okay"; |
457 | vmmc-supply = <&vmmc_reg>; | 463 | vmmc-supply = <&vmmc_reg>; |
458 | bus-width = <4>; | 464 | bus-width = <4>; |
465 | pinctrl-names = "default"; | ||
466 | pinctrl-0 = <&mmc1_pins>; | ||
467 | cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; | ||
459 | }; | 468 | }; |
460 | 469 | ||
461 | &sham { | 470 | &sham { |
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi index 66609684d41b..9480cf891f8c 100644 --- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi +++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi | |||
@@ -23,6 +23,7 @@ | |||
23 | gpio0 = &gpio0; | 23 | gpio0 = &gpio0; |
24 | gpio1 = &gpio1; | 24 | gpio1 = &gpio1; |
25 | gpio2 = &gpio2; | 25 | gpio2 = &gpio2; |
26 | eth3 = ð3; | ||
26 | }; | 27 | }; |
27 | 28 | ||
28 | cpus { | 29 | cpus { |
@@ -291,7 +292,7 @@ | |||
291 | interrupts = <91>; | 292 | interrupts = <91>; |
292 | }; | 293 | }; |
293 | 294 | ||
294 | ethernet@34000 { | 295 | eth3: ethernet@34000 { |
295 | compatible = "marvell,armada-370-neta"; | 296 | compatible = "marvell,armada-370-neta"; |
296 | reg = <0x34000 0x4000>; | 297 | reg = <0x34000 0x4000>; |
297 | interrupts = <14>; | 298 | interrupts = <14>; |
diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts new file mode 100644 index 000000000000..ce1375595e5f --- /dev/null +++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts | |||
@@ -0,0 +1,229 @@ | |||
1 | /* | ||
2 | * at91-sama5d3_xplained.dts - Device Tree file for the SAMA5D3 Xplained board | ||
3 | * | ||
4 | * Copyright (C) 2014 Atmel, | ||
5 | * 2014 Nicolas Ferre <nicolas.ferre@atmel.com> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later. | ||
8 | */ | ||
9 | /dts-v1/; | ||
10 | #include "sama5d36.dtsi" | ||
11 | |||
12 | / { | ||
13 | model = "SAMA5D3 Xplained"; | ||
14 | compatible = "atmel,sama5d3-xplained", "atmel,sama5d3", "atmel,sama5"; | ||
15 | |||
16 | chosen { | ||
17 | bootargs = "console=ttyS0,115200"; | ||
18 | }; | ||
19 | |||
20 | memory { | ||
21 | reg = <0x20000000 0x10000000>; | ||
22 | }; | ||
23 | |||
24 | ahb { | ||
25 | apb { | ||
26 | mmc0: mmc@f0000000 { | ||
27 | pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7 &pinctrl_mmc0_cd>; | ||
28 | status = "okay"; | ||
29 | slot@0 { | ||
30 | reg = <0>; | ||
31 | bus-width = <8>; | ||
32 | cd-gpios = <&pioE 0 GPIO_ACTIVE_LOW>; | ||
33 | }; | ||
34 | }; | ||
35 | |||
36 | spi0: spi@f0004000 { | ||
37 | cs-gpios = <&pioD 13 0>; | ||
38 | status = "okay"; | ||
39 | }; | ||
40 | |||
41 | can0: can@f000c000 { | ||
42 | status = "okay"; | ||
43 | }; | ||
44 | |||
45 | i2c0: i2c@f0014000 { | ||
46 | status = "okay"; | ||
47 | }; | ||
48 | |||
49 | i2c1: i2c@f0018000 { | ||
50 | status = "okay"; | ||
51 | }; | ||
52 | |||
53 | macb0: ethernet@f0028000 { | ||
54 | phy-mode = "rgmii"; | ||
55 | status = "okay"; | ||
56 | }; | ||
57 | |||
58 | usart0: serial@f001c000 { | ||
59 | status = "okay"; | ||
60 | }; | ||
61 | |||
62 | usart1: serial@f0020000 { | ||
63 | pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>; | ||
64 | status = "okay"; | ||
65 | }; | ||
66 | |||
67 | uart0: serial@f0024000 { | ||
68 | status = "okay"; | ||
69 | }; | ||
70 | |||
71 | mmc1: mmc@f8000000 { | ||
72 | pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3 &pinctrl_mmc1_cd>; | ||
73 | status = "okay"; | ||
74 | slot@0 { | ||
75 | reg = <0>; | ||
76 | bus-width = <4>; | ||
77 | cd-gpios = <&pioE 1 GPIO_ACTIVE_HIGH>; | ||
78 | }; | ||
79 | }; | ||
80 | |||
81 | spi1: spi@f8008000 { | ||
82 | cs-gpios = <&pioC 25 0>, <0>, <0>, <&pioD 16 0>; | ||
83 | status = "okay"; | ||
84 | }; | ||
85 | |||
86 | adc0: adc@f8018000 { | ||
87 | pinctrl-0 = < | ||
88 | &pinctrl_adc0_adtrg | ||
89 | &pinctrl_adc0_ad0 | ||
90 | &pinctrl_adc0_ad1 | ||
91 | &pinctrl_adc0_ad2 | ||
92 | &pinctrl_adc0_ad3 | ||
93 | &pinctrl_adc0_ad4 | ||
94 | &pinctrl_adc0_ad5 | ||
95 | &pinctrl_adc0_ad6 | ||
96 | &pinctrl_adc0_ad7 | ||
97 | &pinctrl_adc0_ad8 | ||
98 | &pinctrl_adc0_ad9 | ||
99 | >; | ||
100 | status = "okay"; | ||
101 | }; | ||
102 | |||
103 | i2c2: i2c@f801c000 { | ||
104 | dmas = <0>, <0>; /* Do not use DMA for i2c2 */ | ||
105 | status = "okay"; | ||
106 | }; | ||
107 | |||
108 | macb1: ethernet@f802c000 { | ||
109 | phy-mode = "rmii"; | ||
110 | status = "okay"; | ||
111 | }; | ||
112 | |||
113 | dbgu: serial@ffffee00 { | ||
114 | status = "okay"; | ||
115 | }; | ||
116 | |||
117 | pinctrl@fffff200 { | ||
118 | board { | ||
119 | pinctrl_mmc0_cd: mmc0_cd { | ||
120 | atmel,pins = | ||
121 | <AT91_PIOE 0 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; | ||
122 | }; | ||
123 | |||
124 | pinctrl_mmc1_cd: mmc1_cd { | ||
125 | atmel,pins = | ||
126 | <AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; | ||
127 | }; | ||
128 | |||
129 | pinctrl_usba_vbus: usba_vbus { | ||
130 | atmel,pins = | ||
131 | <AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */ | ||
132 | }; | ||
133 | }; | ||
134 | }; | ||
135 | |||
136 | pmc: pmc@fffffc00 { | ||
137 | main: mainck { | ||
138 | clock-frequency = <12000000>; | ||
139 | }; | ||
140 | }; | ||
141 | }; | ||
142 | |||
143 | nand0: nand@60000000 { | ||
144 | nand-bus-width = <8>; | ||
145 | nand-ecc-mode = "hw"; | ||
146 | atmel,has-pmecc; | ||
147 | atmel,pmecc-cap = <4>; | ||
148 | atmel,pmecc-sector-size = <512>; | ||
149 | nand-on-flash-bbt; | ||
150 | status = "okay"; | ||
151 | |||
152 | at91bootstrap@0 { | ||
153 | label = "at91bootstrap"; | ||
154 | reg = <0x0 0x40000>; | ||
155 | }; | ||
156 | |||
157 | bootloader@40000 { | ||
158 | label = "bootloader"; | ||
159 | reg = <0x40000 0x80000>; | ||
160 | }; | ||
161 | |||
162 | bootloaderenv@c0000 { | ||
163 | label = "bootloader env"; | ||
164 | reg = <0xc0000 0xc0000>; | ||
165 | }; | ||
166 | |||
167 | dtb@180000 { | ||
168 | label = "device tree"; | ||
169 | reg = <0x180000 0x80000>; | ||
170 | }; | ||
171 | |||
172 | kernel@200000 { | ||
173 | label = "kernel"; | ||
174 | reg = <0x200000 0x600000>; | ||
175 | }; | ||
176 | |||
177 | rootfs@800000 { | ||
178 | label = "rootfs"; | ||
179 | reg = <0x800000 0x0f800000>; | ||
180 | }; | ||
181 | }; | ||
182 | |||
183 | usb0: gadget@00500000 { | ||
184 | atmel,vbus-gpio = <&pioE 9 GPIO_ACTIVE_HIGH>; /* PE9, conflicts with A9 */ | ||
185 | pinctrl-names = "default"; | ||
186 | pinctrl-0 = <&pinctrl_usba_vbus>; | ||
187 | status = "okay"; | ||
188 | }; | ||
189 | |||
190 | usb1: ohci@00600000 { | ||
191 | num-ports = <3>; | ||
192 | atmel,vbus-gpio = <0 | ||
193 | &pioE 3 GPIO_ACTIVE_LOW | ||
194 | &pioE 4 GPIO_ACTIVE_LOW | ||
195 | >; | ||
196 | status = "okay"; | ||
197 | }; | ||
198 | |||
199 | usb2: ehci@00700000 { | ||
200 | status = "okay"; | ||
201 | }; | ||
202 | }; | ||
203 | |||
204 | gpio_keys { | ||
205 | compatible = "gpio-keys"; | ||
206 | |||
207 | bp3 { | ||
208 | label = "PB_USER"; | ||
209 | gpios = <&pioE 29 GPIO_ACTIVE_LOW>; | ||
210 | linux,code = <0x104>; | ||
211 | gpio-key,wakeup; | ||
212 | }; | ||
213 | }; | ||
214 | |||
215 | leds { | ||
216 | compatible = "gpio-leds"; | ||
217 | |||
218 | d2 { | ||
219 | label = "d2"; | ||
220 | gpios = <&pioE 23 GPIO_ACTIVE_LOW>; /* PE23, conflicts with A23, CTS2 */ | ||
221 | linux,default-trigger = "heartbeat"; | ||
222 | }; | ||
223 | |||
224 | d3 { | ||
225 | label = "d3"; | ||
226 | gpios = <&pioE 24 GPIO_ACTIVE_HIGH>; | ||
227 | }; | ||
228 | }; | ||
229 | }; | ||
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi index 0042f73068b0..fece8665fb63 100644 --- a/arch/arm/boot/dts/at91sam9263.dtsi +++ b/arch/arm/boot/dts/at91sam9263.dtsi | |||
@@ -523,7 +523,7 @@ | |||
523 | }; | 523 | }; |
524 | 524 | ||
525 | i2c0: i2c@fff88000 { | 525 | i2c0: i2c@fff88000 { |
526 | compatible = "atmel,at91sam9263-i2c"; | 526 | compatible = "atmel,at91sam9260-i2c"; |
527 | reg = <0xfff88000 0x100>; | 527 | reg = <0xfff88000 0x100>; |
528 | interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>; | 528 | interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>; |
529 | #address-cells = <1>; | 529 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index e9487f6f0166..924a6a6ffd0f 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts | |||
@@ -124,6 +124,10 @@ | |||
124 | nand-on-flash-bbt; | 124 | nand-on-flash-bbt; |
125 | status = "okay"; | 125 | status = "okay"; |
126 | }; | 126 | }; |
127 | |||
128 | usb0: ohci@00500000 { | ||
129 | status = "okay"; | ||
130 | }; | ||
127 | }; | 131 | }; |
128 | 132 | ||
129 | leds { | 133 | leds { |
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi index 2b76524f4aa7..187fd46b7b5e 100644 --- a/arch/arm/boot/dts/dove.dtsi +++ b/arch/arm/boot/dts/dove.dtsi | |||
@@ -379,15 +379,6 @@ | |||
379 | #clock-cells = <1>; | 379 | #clock-cells = <1>; |
380 | }; | 380 | }; |
381 | 381 | ||
382 | pmu_intc: pmu-interrupt-ctrl@d0050 { | ||
383 | compatible = "marvell,dove-pmu-intc"; | ||
384 | interrupt-controller; | ||
385 | #interrupt-cells = <1>; | ||
386 | reg = <0xd0050 0x8>; | ||
387 | interrupts = <33>; | ||
388 | marvell,#interrupts = <7>; | ||
389 | }; | ||
390 | |||
391 | pinctrl: pin-ctrl@d0200 { | 382 | pinctrl: pin-ctrl@d0200 { |
392 | compatible = "marvell,dove-pinctrl"; | 383 | compatible = "marvell,dove-pinctrl"; |
393 | reg = <0xd0200 0x10>; | 384 | reg = <0xd0200 0x10>; |
@@ -610,8 +601,6 @@ | |||
610 | rtc: real-time-clock@d8500 { | 601 | rtc: real-time-clock@d8500 { |
611 | compatible = "marvell,orion-rtc"; | 602 | compatible = "marvell,orion-rtc"; |
612 | reg = <0xd8500 0x20>; | 603 | reg = <0xd8500 0x20>; |
613 | interrupt-parent = <&pmu_intc>; | ||
614 | interrupts = <5>; | ||
615 | }; | 604 | }; |
616 | 605 | ||
617 | gpio2: gpio-ctrl@e8400 { | 606 | gpio2: gpio-ctrl@e8400 { |
diff --git a/arch/arm/boot/dts/imx6dl-hummingboard.dts b/arch/arm/boot/dts/imx6dl-hummingboard.dts index fd8fc7cd53f3..5bfae54fb780 100644 --- a/arch/arm/boot/dts/imx6dl-hummingboard.dts +++ b/arch/arm/boot/dts/imx6dl-hummingboard.dts | |||
@@ -52,12 +52,6 @@ | |||
52 | }; | 52 | }; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | codec: spdif-transmitter { | ||
56 | compatible = "linux,spdif-dit"; | ||
57 | pinctrl-names = "default"; | ||
58 | pinctrl-0 = <&pinctrl_hummingboard_spdif>; | ||
59 | }; | ||
60 | |||
61 | sound-spdif { | 55 | sound-spdif { |
62 | compatible = "fsl,imx-audio-spdif"; | 56 | compatible = "fsl,imx-audio-spdif"; |
63 | model = "imx-spdif"; | 57 | model = "imx-spdif"; |
@@ -111,7 +105,7 @@ | |||
111 | }; | 105 | }; |
112 | 106 | ||
113 | pinctrl_hummingboard_spdif: hummingboard-spdif { | 107 | pinctrl_hummingboard_spdif: hummingboard-spdif { |
114 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0>; | 108 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>; |
115 | }; | 109 | }; |
116 | 110 | ||
117 | pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus { | 111 | pinctrl_hummingboard_usbh1_vbus: hummingboard-usbh1-vbus { |
@@ -142,6 +136,8 @@ | |||
142 | }; | 136 | }; |
143 | 137 | ||
144 | &spdif { | 138 | &spdif { |
139 | pinctrl-names = "default"; | ||
140 | pinctrl-0 = <&pinctrl_hummingboard_spdif>; | ||
145 | status = "okay"; | 141 | status = "okay"; |
146 | }; | 142 | }; |
147 | 143 | ||
diff --git a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi index 64daa3b311f6..c2a24888a276 100644 --- a/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi +++ b/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi | |||
@@ -46,12 +46,6 @@ | |||
46 | }; | 46 | }; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | codec: spdif-transmitter { | ||
50 | compatible = "linux,spdif-dit"; | ||
51 | pinctrl-names = "default"; | ||
52 | pinctrl-0 = <&pinctrl_cubox_i_spdif>; | ||
53 | }; | ||
54 | |||
55 | sound-spdif { | 49 | sound-spdif { |
56 | compatible = "fsl,imx-audio-spdif"; | 50 | compatible = "fsl,imx-audio-spdif"; |
57 | model = "imx-spdif"; | 51 | model = "imx-spdif"; |
@@ -89,7 +83,7 @@ | |||
89 | }; | 83 | }; |
90 | 84 | ||
91 | pinctrl_cubox_i_spdif: cubox-i-spdif { | 85 | pinctrl_cubox_i_spdif: cubox-i-spdif { |
92 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0>; | 86 | fsl,pins = <MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x13091>; |
93 | }; | 87 | }; |
94 | 88 | ||
95 | pinctrl_cubox_i_usbh1_vbus: cubox-i-usbh1-vbus { | 89 | pinctrl_cubox_i_usbh1_vbus: cubox-i-usbh1-vbus { |
@@ -121,6 +115,8 @@ | |||
121 | }; | 115 | }; |
122 | 116 | ||
123 | &spdif { | 117 | &spdif { |
118 | pinctrl-names = "default"; | ||
119 | pinctrl-0 = <&pinctrl_cubox_i_spdif>; | ||
124 | status = "okay"; | 120 | status = "okay"; |
125 | }; | 121 | }; |
126 | 122 | ||
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts index dc86429756d7..2cb0dc529165 100644 --- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts +++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | |||
@@ -122,4 +122,66 @@ | |||
122 | gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; | 122 | gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; |
123 | }; | 123 | }; |
124 | }; | 124 | }; |
125 | |||
126 | dsa@0 { | ||
127 | compatible = "marvell,dsa"; | ||
128 | #address-cells = <2>; | ||
129 | #size-cells = <0>; | ||
130 | |||
131 | dsa,ethernet = <ð0>; | ||
132 | dsa,mii-bus = <ðphy0>; | ||
133 | |||
134 | switch@0 { | ||
135 | #address-cells = <1>; | ||
136 | #size-cells = <0>; | ||
137 | reg = <0 0>; /* MDIO address 0, switch 0 in tree */ | ||
138 | |||
139 | port@0 { | ||
140 | reg = <0>; | ||
141 | label = "lan1"; | ||
142 | }; | ||
143 | |||
144 | port@1 { | ||
145 | reg = <1>; | ||
146 | label = "lan2"; | ||
147 | }; | ||
148 | |||
149 | port@2 { | ||
150 | reg = <2>; | ||
151 | label = "lan3"; | ||
152 | }; | ||
153 | |||
154 | port@3 { | ||
155 | reg = <3>; | ||
156 | label = "lan4"; | ||
157 | }; | ||
158 | |||
159 | port@4 { | ||
160 | reg = <4>; | ||
161 | label = "wan"; | ||
162 | }; | ||
163 | |||
164 | port@5 { | ||
165 | reg = <5>; | ||
166 | label = "cpu"; | ||
167 | }; | ||
168 | }; | ||
169 | }; | ||
170 | }; | ||
171 | |||
172 | &mdio { | ||
173 | status = "okay"; | ||
174 | |||
175 | ethphy0: ethernet-phy@ff { | ||
176 | reg = <0xff>; /* No phy attached */ | ||
177 | speed = <1000>; | ||
178 | duplex = <1>; | ||
179 | }; | ||
180 | }; | ||
181 | |||
182 | ð0 { | ||
183 | status = "okay"; | ||
184 | ethernet0-port@0 { | ||
185 | phy-handle = <ðphy0>; | ||
186 | }; | ||
125 | }; | 187 | }; |
diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts index b9b55c95a566..c551e4af4d83 100644 --- a/arch/arm/boot/dts/omap3-gta04.dts +++ b/arch/arm/boot/dts/omap3-gta04.dts | |||
@@ -32,7 +32,7 @@ | |||
32 | aux-button { | 32 | aux-button { |
33 | label = "aux"; | 33 | label = "aux"; |
34 | linux,code = <169>; | 34 | linux,code = <169>; |
35 | gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; | 35 | gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; |
36 | gpio-key,wakeup; | 36 | gpio-key,wakeup; |
37 | }; | 37 | }; |
38 | }; | 38 | }; |
@@ -92,6 +92,8 @@ | |||
92 | bmp085@77 { | 92 | bmp085@77 { |
93 | compatible = "bosch,bmp085"; | 93 | compatible = "bosch,bmp085"; |
94 | reg = <0x77>; | 94 | reg = <0x77>; |
95 | interrupt-parent = <&gpio4>; | ||
96 | interrupts = <17 IRQ_TYPE_EDGE_RISING>; | ||
95 | }; | 97 | }; |
96 | 98 | ||
97 | /* leds */ | 99 | /* leds */ |
@@ -141,8 +143,8 @@ | |||
141 | pinctrl-names = "default"; | 143 | pinctrl-names = "default"; |
142 | pinctrl-0 = <&mmc1_pins>; | 144 | pinctrl-0 = <&mmc1_pins>; |
143 | vmmc-supply = <&vmmc1>; | 145 | vmmc-supply = <&vmmc1>; |
144 | vmmc_aux-supply = <&vsim>; | ||
145 | bus-width = <4>; | 146 | bus-width = <4>; |
147 | ti,non-removable; | ||
146 | }; | 148 | }; |
147 | 149 | ||
148 | &mmc2 { | 150 | &mmc2 { |
diff --git a/arch/arm/boot/dts/omap3-n9.dts b/arch/arm/boot/dts/omap3-n9.dts index 39828ce464ee..9938b5dc1909 100644 --- a/arch/arm/boot/dts/omap3-n9.dts +++ b/arch/arm/boot/dts/omap3-n9.dts | |||
@@ -14,5 +14,5 @@ | |||
14 | 14 | ||
15 | / { | 15 | / { |
16 | model = "Nokia N9"; | 16 | model = "Nokia N9"; |
17 | compatible = "nokia,omap3-n9", "ti,omap3"; | 17 | compatible = "nokia,omap3-n9", "ti,omap36xx", "ti,omap3"; |
18 | }; | 18 | }; |
diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts index 6fc85f963530..0bf40c90faba 100644 --- a/arch/arm/boot/dts/omap3-n900.dts +++ b/arch/arm/boot/dts/omap3-n900.dts | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2013 Pavel Machek <pavel@ucw.cz> | 2 | * Copyright (C) 2013 Pavel Machek <pavel@ucw.cz> |
3 | * Copyright 2013 Aaro Koskinen <aaro.koskinen@iki.fi> | 3 | * Copyright (C) 2013-2014 Aaro Koskinen <aaro.koskinen@iki.fi> |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License version 2 (or later) as | 6 | * it under the terms of the GNU General Public License version 2 (or later) as |
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | / { | 14 | / { |
15 | model = "Nokia N900"; | 15 | model = "Nokia N900"; |
16 | compatible = "nokia,omap3-n900", "ti,omap3"; | 16 | compatible = "nokia,omap3-n900", "ti,omap3430", "ti,omap3"; |
17 | 17 | ||
18 | cpus { | 18 | cpus { |
19 | cpu@0 { | 19 | cpu@0 { |
diff --git a/arch/arm/boot/dts/omap3-n950.dts b/arch/arm/boot/dts/omap3-n950.dts index b076a526b999..261c5589bfa3 100644 --- a/arch/arm/boot/dts/omap3-n950.dts +++ b/arch/arm/boot/dts/omap3-n950.dts | |||
@@ -14,5 +14,5 @@ | |||
14 | 14 | ||
15 | / { | 15 | / { |
16 | model = "Nokia N950"; | 16 | model = "Nokia N950"; |
17 | compatible = "nokia,omap3-n950", "ti,omap3"; | 17 | compatible = "nokia,omap3-n950", "ti,omap36xx", "ti,omap3"; |
18 | }; | 18 | }; |
diff --git a/arch/arm/boot/dts/omap3-overo-storm-tobi.dts b/arch/arm/boot/dts/omap3-overo-storm-tobi.dts new file mode 100644 index 000000000000..966b5c9cd96a --- /dev/null +++ b/arch/arm/boot/dts/omap3-overo-storm-tobi.dts | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group | ||
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 | /* | ||
10 | * Tobi expansion board is manufactured by Gumstix Inc. | ||
11 | */ | ||
12 | |||
13 | /dts-v1/; | ||
14 | |||
15 | #include "omap36xx.dtsi" | ||
16 | #include "omap3-overo-tobi-common.dtsi" | ||
17 | |||
18 | / { | ||
19 | model = "OMAP36xx/AM37xx/DM37xx Gumstix Overo on Tobi"; | ||
20 | compatible = "gumstix,omap3-overo-tobi", "gumstix,omap3-overo", "ti,omap36xx", "ti,omap3"; | ||
21 | }; | ||
22 | |||
diff --git a/arch/arm/boot/dts/omap3-tobi.dts b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi index 7e4ad2aec37a..4edc013a91c1 100644 --- a/arch/arm/boot/dts/omap3-tobi.dts +++ b/arch/arm/boot/dts/omap3-overo-tobi-common.dtsi | |||
@@ -13,9 +13,6 @@ | |||
13 | #include "omap3-overo.dtsi" | 13 | #include "omap3-overo.dtsi" |
14 | 14 | ||
15 | / { | 15 | / { |
16 | model = "TI OMAP3 Gumstix Overo on Tobi"; | ||
17 | compatible = "ti,omap3-tobi", "ti,omap3-overo", "ti,omap3"; | ||
18 | |||
19 | leds { | 16 | leds { |
20 | compatible = "gpio-leds"; | 17 | compatible = "gpio-leds"; |
21 | heartbeat { | 18 | heartbeat { |
diff --git a/arch/arm/boot/dts/omap3-overo-tobi.dts b/arch/arm/boot/dts/omap3-overo-tobi.dts new file mode 100644 index 000000000000..de5653e1b5ca --- /dev/null +++ b/arch/arm/boot/dts/omap3-overo-tobi.dts | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Florian Vaussard, EPFL Mobots group | ||
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 | /* | ||
10 | * Tobi expansion board is manufactured by Gumstix Inc. | ||
11 | */ | ||
12 | |||
13 | /dts-v1/; | ||
14 | |||
15 | #include "omap34xx.dtsi" | ||
16 | #include "omap3-overo-tobi-common.dtsi" | ||
17 | |||
18 | / { | ||
19 | model = "OMAP35xx Gumstix Overo on Tobi"; | ||
20 | compatible = "gumstix,omap3-overo-tobi", "gumstix,omap3-overo", "ti,omap3430", "ti,omap3"; | ||
21 | }; | ||
22 | |||
diff --git a/arch/arm/boot/dts/omap3-overo.dtsi b/arch/arm/boot/dts/omap3-overo.dtsi index a461d2fd1fb0..597099907f8e 100644 --- a/arch/arm/boot/dts/omap3-overo.dtsi +++ b/arch/arm/boot/dts/omap3-overo.dtsi | |||
@@ -9,9 +9,6 @@ | |||
9 | /* | 9 | /* |
10 | * The Gumstix Overo must be combined with an expansion board. | 10 | * The Gumstix Overo must be combined with an expansion board. |
11 | */ | 11 | */ |
12 | /dts-v1/; | ||
13 | |||
14 | #include "omap34xx.dtsi" | ||
15 | 12 | ||
16 | / { | 13 | / { |
17 | pwmleds { | 14 | pwmleds { |
diff --git a/arch/arm/boot/dts/qcom-msm8660-surf.dts b/arch/arm/boot/dts/qcom-msm8660-surf.dts index 68a72f5507b9..169bad90dac9 100644 --- a/arch/arm/boot/dts/qcom-msm8660-surf.dts +++ b/arch/arm/boot/dts/qcom-msm8660-surf.dts | |||
@@ -1,63 +1,6 @@ | |||
1 | /dts-v1/; | 1 | #include "qcom-msm8660.dtsi" |
2 | |||
3 | /include/ "skeleton.dtsi" | ||
4 | |||
5 | #include <dt-bindings/clock/qcom,gcc-msm8660.h> | ||
6 | 2 | ||
7 | / { | 3 | / { |
8 | model = "Qualcomm MSM8660 SURF"; | 4 | model = "Qualcomm MSM8660 SURF"; |
9 | compatible = "qcom,msm8660-surf", "qcom,msm8660"; | 5 | compatible = "qcom,msm8660-surf", "qcom,msm8660"; |
10 | interrupt-parent = <&intc>; | ||
11 | |||
12 | intc: interrupt-controller@2080000 { | ||
13 | compatible = "qcom,msm-8660-qgic"; | ||
14 | interrupt-controller; | ||
15 | #interrupt-cells = <3>; | ||
16 | reg = < 0x02080000 0x1000 >, | ||
17 | < 0x02081000 0x1000 >; | ||
18 | }; | ||
19 | |||
20 | timer@2000000 { | ||
21 | compatible = "qcom,scss-timer", "qcom,msm-timer"; | ||
22 | interrupts = <1 0 0x301>, | ||
23 | <1 1 0x301>, | ||
24 | <1 2 0x301>; | ||
25 | reg = <0x02000000 0x100>; | ||
26 | clock-frequency = <27000000>, | ||
27 | <32768>; | ||
28 | cpu-offset = <0x40000>; | ||
29 | }; | ||
30 | |||
31 | msmgpio: gpio@800000 { | ||
32 | compatible = "qcom,msm-gpio"; | ||
33 | reg = <0x00800000 0x4000>; | ||
34 | gpio-controller; | ||
35 | #gpio-cells = <2>; | ||
36 | ngpio = <173>; | ||
37 | interrupts = <0 16 0x4>; | ||
38 | interrupt-controller; | ||
39 | #interrupt-cells = <2>; | ||
40 | }; | ||
41 | |||
42 | gcc: clock-controller@900000 { | ||
43 | compatible = "qcom,gcc-msm8660"; | ||
44 | #clock-cells = <1>; | ||
45 | #reset-cells = <1>; | ||
46 | reg = <0x900000 0x4000>; | ||
47 | }; | ||
48 | |||
49 | serial@19c40000 { | ||
50 | compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; | ||
51 | reg = <0x19c40000 0x1000>, | ||
52 | <0x19c00000 0x1000>; | ||
53 | interrupts = <0 195 0x0>; | ||
54 | clocks = <&gcc GSBI12_UART_CLK>, <&gcc GSBI12_H_CLK>; | ||
55 | clock-names = "core", "iface"; | ||
56 | }; | ||
57 | |||
58 | qcom,ssbi@500000 { | ||
59 | compatible = "qcom,ssbi"; | ||
60 | reg = <0x500000 0x1000>; | ||
61 | qcom,controller-type = "pmic-arbiter"; | ||
62 | }; | ||
63 | }; | 6 | }; |
diff --git a/arch/arm/boot/dts/qcom-msm8660.dtsi b/arch/arm/boot/dts/qcom-msm8660.dtsi new file mode 100644 index 000000000000..69d6c4edea30 --- /dev/null +++ b/arch/arm/boot/dts/qcom-msm8660.dtsi | |||
@@ -0,0 +1,63 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "skeleton.dtsi" | ||
4 | |||
5 | #include <dt-bindings/clock/qcom,gcc-msm8660.h> | ||
6 | |||
7 | / { | ||
8 | model = "Qualcomm MSM8660"; | ||
9 | compatible = "qcom,msm8660"; | ||
10 | interrupt-parent = <&intc>; | ||
11 | |||
12 | intc: interrupt-controller@2080000 { | ||
13 | compatible = "qcom,msm-8660-qgic"; | ||
14 | interrupt-controller; | ||
15 | #interrupt-cells = <3>; | ||
16 | reg = < 0x02080000 0x1000 >, | ||
17 | < 0x02081000 0x1000 >; | ||
18 | }; | ||
19 | |||
20 | timer@2000000 { | ||
21 | compatible = "qcom,scss-timer", "qcom,msm-timer"; | ||
22 | interrupts = <1 0 0x301>, | ||
23 | <1 1 0x301>, | ||
24 | <1 2 0x301>; | ||
25 | reg = <0x02000000 0x100>; | ||
26 | clock-frequency = <27000000>, | ||
27 | <32768>; | ||
28 | cpu-offset = <0x40000>; | ||
29 | }; | ||
30 | |||
31 | msmgpio: gpio@800000 { | ||
32 | compatible = "qcom,msm-gpio"; | ||
33 | reg = <0x00800000 0x4000>; | ||
34 | gpio-controller; | ||
35 | #gpio-cells = <2>; | ||
36 | ngpio = <173>; | ||
37 | interrupts = <0 16 0x4>; | ||
38 | interrupt-controller; | ||
39 | #interrupt-cells = <2>; | ||
40 | }; | ||
41 | |||
42 | gcc: clock-controller@900000 { | ||
43 | compatible = "qcom,gcc-msm8660"; | ||
44 | #clock-cells = <1>; | ||
45 | #reset-cells = <1>; | ||
46 | reg = <0x900000 0x4000>; | ||
47 | }; | ||
48 | |||
49 | serial@19c40000 { | ||
50 | compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; | ||
51 | reg = <0x19c40000 0x1000>, | ||
52 | <0x19c00000 0x1000>; | ||
53 | interrupts = <0 195 0x0>; | ||
54 | clocks = <&gcc GSBI12_UART_CLK>, <&gcc GSBI12_H_CLK>; | ||
55 | clock-names = "core", "iface"; | ||
56 | }; | ||
57 | |||
58 | qcom,ssbi@500000 { | ||
59 | compatible = "qcom,ssbi"; | ||
60 | reg = <0x500000 0x1000>; | ||
61 | qcom,controller-type = "pmic-arbiter"; | ||
62 | }; | ||
63 | }; | ||
diff --git a/arch/arm/boot/dts/qcom-msm8960-cdp.dts b/arch/arm/boot/dts/qcom-msm8960-cdp.dts index 7c30de4fa302..a58fb88315f6 100644 --- a/arch/arm/boot/dts/qcom-msm8960-cdp.dts +++ b/arch/arm/boot/dts/qcom-msm8960-cdp.dts | |||
@@ -1,70 +1,6 @@ | |||
1 | /dts-v1/; | 1 | #include "qcom-msm8960.dtsi" |
2 | |||
3 | /include/ "skeleton.dtsi" | ||
4 | |||
5 | #include <dt-bindings/clock/qcom,gcc-msm8960.h> | ||
6 | 2 | ||
7 | / { | 3 | / { |
8 | model = "Qualcomm MSM8960 CDP"; | 4 | model = "Qualcomm MSM8960 CDP"; |
9 | compatible = "qcom,msm8960-cdp", "qcom,msm8960"; | 5 | compatible = "qcom,msm8960-cdp", "qcom,msm8960"; |
10 | interrupt-parent = <&intc>; | ||
11 | |||
12 | intc: interrupt-controller@2000000 { | ||
13 | compatible = "qcom,msm-qgic2"; | ||
14 | interrupt-controller; | ||
15 | #interrupt-cells = <3>; | ||
16 | reg = < 0x02000000 0x1000 >, | ||
17 | < 0x02002000 0x1000 >; | ||
18 | }; | ||
19 | |||
20 | timer@200a000 { | ||
21 | compatible = "qcom,kpss-timer", "qcom,msm-timer"; | ||
22 | interrupts = <1 1 0x301>, | ||
23 | <1 2 0x301>, | ||
24 | <1 3 0x301>; | ||
25 | reg = <0x0200a000 0x100>; | ||
26 | clock-frequency = <27000000>, | ||
27 | <32768>; | ||
28 | cpu-offset = <0x80000>; | ||
29 | }; | ||
30 | |||
31 | msmgpio: gpio@800000 { | ||
32 | compatible = "qcom,msm-gpio"; | ||
33 | gpio-controller; | ||
34 | #gpio-cells = <2>; | ||
35 | ngpio = <150>; | ||
36 | interrupts = <0 16 0x4>; | ||
37 | interrupt-controller; | ||
38 | #interrupt-cells = <2>; | ||
39 | reg = <0x800000 0x4000>; | ||
40 | }; | ||
41 | |||
42 | gcc: clock-controller@900000 { | ||
43 | compatible = "qcom,gcc-msm8960"; | ||
44 | #clock-cells = <1>; | ||
45 | #reset-cells = <1>; | ||
46 | reg = <0x900000 0x4000>; | ||
47 | }; | ||
48 | |||
49 | clock-controller@4000000 { | ||
50 | compatible = "qcom,mmcc-msm8960"; | ||
51 | reg = <0x4000000 0x1000>; | ||
52 | #clock-cells = <1>; | ||
53 | #reset-cells = <1>; | ||
54 | }; | ||
55 | |||
56 | serial@16440000 { | ||
57 | compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; | ||
58 | reg = <0x16440000 0x1000>, | ||
59 | <0x16400000 0x1000>; | ||
60 | interrupts = <0 154 0x0>; | ||
61 | clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>; | ||
62 | clock-names = "core", "iface"; | ||
63 | }; | ||
64 | |||
65 | qcom,ssbi@500000 { | ||
66 | compatible = "qcom,ssbi"; | ||
67 | reg = <0x500000 0x1000>; | ||
68 | qcom,controller-type = "pmic-arbiter"; | ||
69 | }; | ||
70 | }; | 6 | }; |
diff --git a/arch/arm/boot/dts/qcom-msm8960.dtsi b/arch/arm/boot/dts/qcom-msm8960.dtsi new file mode 100644 index 000000000000..3a9c3caa9aad --- /dev/null +++ b/arch/arm/boot/dts/qcom-msm8960.dtsi | |||
@@ -0,0 +1,76 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "skeleton.dtsi" | ||
4 | |||
5 | #include <dt-bindings/clock/qcom,gcc-msm8960.h> | ||
6 | |||
7 | / { | ||
8 | model = "Qualcomm MSM8960"; | ||
9 | compatible = "qcom,msm8960"; | ||
10 | interrupt-parent = <&intc>; | ||
11 | |||
12 | cpu-pmu { | ||
13 | compatible = "qcom,krait-pmu"; | ||
14 | interrupts = <1 10 0x304>; | ||
15 | qcom,no-pc-write; | ||
16 | }; | ||
17 | |||
18 | intc: interrupt-controller@2000000 { | ||
19 | compatible = "qcom,msm-qgic2"; | ||
20 | interrupt-controller; | ||
21 | #interrupt-cells = <3>; | ||
22 | reg = < 0x02000000 0x1000 >, | ||
23 | < 0x02002000 0x1000 >; | ||
24 | }; | ||
25 | |||
26 | timer@200a000 { | ||
27 | compatible = "qcom,kpss-timer", "qcom,msm-timer"; | ||
28 | interrupts = <1 1 0x301>, | ||
29 | <1 2 0x301>, | ||
30 | <1 3 0x301>; | ||
31 | reg = <0x0200a000 0x100>; | ||
32 | clock-frequency = <27000000>, | ||
33 | <32768>; | ||
34 | cpu-offset = <0x80000>; | ||
35 | }; | ||
36 | |||
37 | msmgpio: gpio@800000 { | ||
38 | compatible = "qcom,msm-gpio"; | ||
39 | gpio-controller; | ||
40 | #gpio-cells = <2>; | ||
41 | ngpio = <150>; | ||
42 | interrupts = <0 16 0x4>; | ||
43 | interrupt-controller; | ||
44 | #interrupt-cells = <2>; | ||
45 | reg = <0x800000 0x4000>; | ||
46 | }; | ||
47 | |||
48 | gcc: clock-controller@900000 { | ||
49 | compatible = "qcom,gcc-msm8960"; | ||
50 | #clock-cells = <1>; | ||
51 | #reset-cells = <1>; | ||
52 | reg = <0x900000 0x4000>; | ||
53 | }; | ||
54 | |||
55 | clock-controller@4000000 { | ||
56 | compatible = "qcom,mmcc-msm8960"; | ||
57 | reg = <0x4000000 0x1000>; | ||
58 | #clock-cells = <1>; | ||
59 | #reset-cells = <1>; | ||
60 | }; | ||
61 | |||
62 | serial@16440000 { | ||
63 | compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; | ||
64 | reg = <0x16440000 0x1000>, | ||
65 | <0x16400000 0x1000>; | ||
66 | interrupts = <0 154 0x0>; | ||
67 | clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>; | ||
68 | clock-names = "core", "iface"; | ||
69 | }; | ||
70 | |||
71 | qcom,ssbi@500000 { | ||
72 | compatible = "qcom,ssbi"; | ||
73 | reg = <0x500000 0x1000>; | ||
74 | qcom,controller-type = "pmic-arbiter"; | ||
75 | }; | ||
76 | }; | ||
diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi index 9e5dadb101eb..1eff4130cde0 100644 --- a/arch/arm/boot/dts/qcom-msm8974.dtsi +++ b/arch/arm/boot/dts/qcom-msm8974.dtsi | |||
@@ -9,6 +9,11 @@ | |||
9 | compatible = "qcom,msm8974"; | 9 | compatible = "qcom,msm8974"; |
10 | interrupt-parent = <&intc>; | 10 | interrupt-parent = <&intc>; |
11 | 11 | ||
12 | cpu-pmu { | ||
13 | compatible = "qcom,krait-pmu"; | ||
14 | interrupts = <1 7 0xf04>; | ||
15 | }; | ||
16 | |||
12 | soc: soc { | 17 | soc: soc { |
13 | #address-cells = <1>; | 18 | #address-cells = <1>; |
14 | #size-cells = <1>; | 19 | #size-cells = <1>; |
diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi index be5d2b09a363..4d4dfbb59f4b 100644 --- a/arch/arm/boot/dts/rk3066a.dtsi +++ b/arch/arm/boot/dts/rk3066a.dtsi | |||
@@ -64,6 +64,19 @@ | |||
64 | clock-names = "timer", "pclk"; | 64 | clock-names = "timer", "pclk"; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | sram: sram@10080000 { | ||
68 | compatible = "mmio-sram"; | ||
69 | reg = <0x10080000 0x10000>; | ||
70 | #address-cells = <1>; | ||
71 | #size-cells = <1>; | ||
72 | ranges = <0 0x10080000 0x10000>; | ||
73 | |||
74 | smp-sram@0 { | ||
75 | compatible = "rockchip,rk3066-smp-sram"; | ||
76 | reg = <0x0 0x50>; | ||
77 | }; | ||
78 | }; | ||
79 | |||
67 | pinctrl@20008000 { | 80 | pinctrl@20008000 { |
68 | compatible = "rockchip,rk3066a-pinctrl"; | 81 | compatible = "rockchip,rk3066a-pinctrl"; |
69 | reg = <0x20008000 0x150>; | 82 | reg = <0x20008000 0x150>; |
diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index 1a26b03b3649..bb36596ea205 100644 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi | |||
@@ -60,6 +60,19 @@ | |||
60 | interrupts = <GIC_PPI 13 0xf04>; | 60 | interrupts = <GIC_PPI 13 0xf04>; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | sram: sram@10080000 { | ||
64 | compatible = "mmio-sram"; | ||
65 | reg = <0x10080000 0x8000>; | ||
66 | #address-cells = <1>; | ||
67 | #size-cells = <1>; | ||
68 | ranges = <0 0x10080000 0x8000>; | ||
69 | |||
70 | smp-sram@0 { | ||
71 | compatible = "rockchip,rk3066-smp-sram"; | ||
72 | reg = <0x0 0x50>; | ||
73 | }; | ||
74 | }; | ||
75 | |||
63 | pinctrl@20008000 { | 76 | pinctrl@20008000 { |
64 | compatible = "rockchip,rk3188-pinctrl"; | 77 | compatible = "rockchip,rk3188-pinctrl"; |
65 | reg = <0x20008000 0xa0>, | 78 | reg = <0x20008000 0xa0>, |
diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi index 0fcbcfd67de2..26e5a968d49d 100644 --- a/arch/arm/boot/dts/rk3xxx.dtsi +++ b/arch/arm/boot/dts/rk3xxx.dtsi | |||
@@ -26,6 +26,16 @@ | |||
26 | compatible = "simple-bus"; | 26 | compatible = "simple-bus"; |
27 | ranges; | 27 | ranges; |
28 | 28 | ||
29 | scu@1013c000 { | ||
30 | compatible = "arm,cortex-a9-scu"; | ||
31 | reg = <0x1013c000 0x100>; | ||
32 | }; | ||
33 | |||
34 | pmu@20004000 { | ||
35 | compatible = "rockchip,rk3066-pmu"; | ||
36 | reg = <0x20004000 0x100>; | ||
37 | }; | ||
38 | |||
29 | gic: interrupt-controller@1013d000 { | 39 | gic: interrupt-controller@1013d000 { |
30 | compatible = "arm,cortex-a9-gic"; | 40 | compatible = "arm,cortex-a9-gic"; |
31 | interrupt-controller; | 41 | interrupt-controller; |
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index 52447c17537a..3d5faf85f51b 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi | |||
@@ -1228,7 +1228,7 @@ | |||
1228 | compatible = "atmel,at91rm9200-ohci", "usb-ohci"; | 1228 | compatible = "atmel,at91rm9200-ohci", "usb-ohci"; |
1229 | reg = <0x00600000 0x100000>; | 1229 | reg = <0x00600000 0x100000>; |
1230 | interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>; | 1230 | interrupts = <32 IRQ_TYPE_LEVEL_HIGH 2>; |
1231 | clocks = <&usb>, <&uhphs_clk>, <&udphs_clk>, | 1231 | clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, |
1232 | <&uhpck>; | 1232 | <&uhpck>; |
1233 | clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; | 1233 | clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; |
1234 | status = "disabled"; | 1234 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/ste-href.dtsi b/arch/arm/boot/dts/ste-href.dtsi index 0c1e8d871ed1..6cb9b68e2188 100644 --- a/arch/arm/boot/dts/ste-href.dtsi +++ b/arch/arm/boot/dts/ste-href.dtsi | |||
@@ -188,7 +188,6 @@ | |||
188 | msp2: msp@80117000 { | 188 | msp2: msp@80117000 { |
189 | pinctrl-names = "default"; | 189 | pinctrl-names = "default"; |
190 | pinctrl-0 = <&msp2_default_mode>; | 190 | pinctrl-0 = <&msp2_default_mode>; |
191 | status = "okay"; | ||
192 | }; | 191 | }; |
193 | 192 | ||
194 | msp3: msp@80125000 { | 193 | msp3: msp@80125000 { |
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index 040bb0eba152..10666ca8aee1 100644 --- a/arch/arm/boot/dts/sun4i-a10.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi | |||
@@ -315,7 +315,7 @@ | |||
315 | ranges; | 315 | ranges; |
316 | 316 | ||
317 | emac: ethernet@01c0b000 { | 317 | emac: ethernet@01c0b000 { |
318 | compatible = "allwinner,sun4i-emac"; | 318 | compatible = "allwinner,sun4i-a10-emac"; |
319 | reg = <0x01c0b000 0x1000>; | 319 | reg = <0x01c0b000 0x1000>; |
320 | interrupts = <55>; | 320 | interrupts = <55>; |
321 | clocks = <&ahb_gates 17>; | 321 | clocks = <&ahb_gates 17>; |
@@ -323,7 +323,7 @@ | |||
323 | }; | 323 | }; |
324 | 324 | ||
325 | mdio@01c0b080 { | 325 | mdio@01c0b080 { |
326 | compatible = "allwinner,sun4i-mdio"; | 326 | compatible = "allwinner,sun4i-a10-mdio"; |
327 | reg = <0x01c0b080 0x14>; | 327 | reg = <0x01c0b080 0x14>; |
328 | status = "disabled"; | 328 | status = "disabled"; |
329 | #address-cells = <1>; | 329 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi index ea16054857a4..64961595e8d6 100644 --- a/arch/arm/boot/dts/sun5i-a10s.dtsi +++ b/arch/arm/boot/dts/sun5i-a10s.dtsi | |||
@@ -278,7 +278,7 @@ | |||
278 | ranges; | 278 | ranges; |
279 | 279 | ||
280 | emac: ethernet@01c0b000 { | 280 | emac: ethernet@01c0b000 { |
281 | compatible = "allwinner,sun4i-emac"; | 281 | compatible = "allwinner,sun4i-a10-emac"; |
282 | reg = <0x01c0b000 0x1000>; | 282 | reg = <0x01c0b000 0x1000>; |
283 | interrupts = <55>; | 283 | interrupts = <55>; |
284 | clocks = <&ahb_gates 17>; | 284 | clocks = <&ahb_gates 17>; |
@@ -286,7 +286,7 @@ | |||
286 | }; | 286 | }; |
287 | 287 | ||
288 | mdio@01c0b080 { | 288 | mdio@01c0b080 { |
289 | compatible = "allwinner,sun4i-mdio"; | 289 | compatible = "allwinner,sun4i-a10-mdio"; |
290 | reg = <0x01c0b080 0x14>; | 290 | reg = <0x01c0b080 0x14>; |
291 | status = "disabled"; | 291 | status = "disabled"; |
292 | #address-cells = <1>; | 292 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index 119f066f0d98..9ff09484847b 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi | |||
@@ -340,7 +340,7 @@ | |||
340 | ranges; | 340 | ranges; |
341 | 341 | ||
342 | emac: ethernet@01c0b000 { | 342 | emac: ethernet@01c0b000 { |
343 | compatible = "allwinner,sun4i-emac"; | 343 | compatible = "allwinner,sun4i-a10-emac"; |
344 | reg = <0x01c0b000 0x1000>; | 344 | reg = <0x01c0b000 0x1000>; |
345 | interrupts = <0 55 4>; | 345 | interrupts = <0 55 4>; |
346 | clocks = <&ahb_gates 17>; | 346 | clocks = <&ahb_gates 17>; |
@@ -348,7 +348,7 @@ | |||
348 | }; | 348 | }; |
349 | 349 | ||
350 | mdio@01c0b080 { | 350 | mdio@01c0b080 { |
351 | compatible = "allwinner,sun4i-mdio"; | 351 | compatible = "allwinner,sun4i-a10-mdio"; |
352 | reg = <0x01c0b080 0x14>; | 352 | reg = <0x01c0b080 0x14>; |
353 | status = "disabled"; | 353 | status = "disabled"; |
354 | #address-cells = <1>; | 354 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi index 389e987ec281..44ec401ec366 100644 --- a/arch/arm/boot/dts/tegra114.dtsi +++ b/arch/arm/boot/dts/tegra114.dtsi | |||
@@ -57,6 +57,8 @@ | |||
57 | resets = <&tegra_car 27>; | 57 | resets = <&tegra_car 27>; |
58 | reset-names = "dc"; | 58 | reset-names = "dc"; |
59 | 59 | ||
60 | nvidia,head = <0>; | ||
61 | |||
60 | rgb { | 62 | rgb { |
61 | status = "disabled"; | 63 | status = "disabled"; |
62 | }; | 64 | }; |
@@ -72,6 +74,8 @@ | |||
72 | resets = <&tegra_car 26>; | 74 | resets = <&tegra_car 26>; |
73 | reset-names = "dc"; | 75 | reset-names = "dc"; |
74 | 76 | ||
77 | nvidia,head = <1>; | ||
78 | |||
75 | rgb { | 79 | rgb { |
76 | status = "disabled"; | 80 | status = "disabled"; |
77 | }; | 81 | }; |
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi index 480ecda3416b..48d2a7f4d0c0 100644 --- a/arch/arm/boot/dts/tegra20.dtsi +++ b/arch/arm/boot/dts/tegra20.dtsi | |||
@@ -94,6 +94,8 @@ | |||
94 | resets = <&tegra_car 27>; | 94 | resets = <&tegra_car 27>; |
95 | reset-names = "dc"; | 95 | reset-names = "dc"; |
96 | 96 | ||
97 | nvidia,head = <0>; | ||
98 | |||
97 | rgb { | 99 | rgb { |
98 | status = "disabled"; | 100 | status = "disabled"; |
99 | }; | 101 | }; |
@@ -109,6 +111,8 @@ | |||
109 | resets = <&tegra_car 26>; | 111 | resets = <&tegra_car 26>; |
110 | reset-names = "dc"; | 112 | reset-names = "dc"; |
111 | 113 | ||
114 | nvidia,head = <1>; | ||
115 | |||
112 | rgb { | 116 | rgb { |
113 | status = "disabled"; | 117 | status = "disabled"; |
114 | }; | 118 | }; |
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi index 9104224124ee..1e156d9d0506 100644 --- a/arch/arm/boot/dts/tegra30-cardhu.dtsi +++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi | |||
@@ -28,7 +28,7 @@ | |||
28 | compatible = "nvidia,cardhu", "nvidia,tegra30"; | 28 | compatible = "nvidia,cardhu", "nvidia,tegra30"; |
29 | 29 | ||
30 | aliases { | 30 | aliases { |
31 | rtc0 = "/i2c@7000d000/tps6586x@34"; | 31 | rtc0 = "/i2c@7000d000/tps65911@2d"; |
32 | rtc1 = "/rtc@7000e000"; | 32 | rtc1 = "/rtc@7000e000"; |
33 | }; | 33 | }; |
34 | 34 | ||
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi index ed8e7700b46d..19a84e933f4e 100644 --- a/arch/arm/boot/dts/tegra30.dtsi +++ b/arch/arm/boot/dts/tegra30.dtsi | |||
@@ -170,6 +170,8 @@ | |||
170 | resets = <&tegra_car 27>; | 170 | resets = <&tegra_car 27>; |
171 | reset-names = "dc"; | 171 | reset-names = "dc"; |
172 | 172 | ||
173 | nvidia,head = <0>; | ||
174 | |||
173 | rgb { | 175 | rgb { |
174 | status = "disabled"; | 176 | status = "disabled"; |
175 | }; | 177 | }; |
@@ -185,6 +187,8 @@ | |||
185 | resets = <&tegra_car 26>; | 187 | resets = <&tegra_car 26>; |
186 | reset-names = "dc"; | 188 | reset-names = "dc"; |
187 | 189 | ||
190 | nvidia,head = <1>; | ||
191 | |||
188 | rgb { | 192 | rgb { |
189 | status = "disabled"; | 193 | status = "disabled"; |
190 | }; | 194 | }; |
diff --git a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi b/arch/arm/boot/dts/testcases/tests-interrupts.dtsi deleted file mode 100644 index c843720bd3e5..000000000000 --- a/arch/arm/boot/dts/testcases/tests-interrupts.dtsi +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | |||
2 | / { | ||
3 | testcase-data { | ||
4 | interrupts { | ||
5 | #address-cells = <1>; | ||
6 | #size-cells = <1>; | ||
7 | test_intc0: intc0 { | ||
8 | interrupt-controller; | ||
9 | #interrupt-cells = <1>; | ||
10 | }; | ||
11 | |||
12 | test_intc1: intc1 { | ||
13 | interrupt-controller; | ||
14 | #interrupt-cells = <3>; | ||
15 | }; | ||
16 | |||
17 | test_intc2: intc2 { | ||
18 | interrupt-controller; | ||
19 | #interrupt-cells = <2>; | ||
20 | }; | ||
21 | |||
22 | test_intmap0: intmap0 { | ||
23 | #interrupt-cells = <1>; | ||
24 | #address-cells = <0>; | ||
25 | interrupt-map = <1 &test_intc0 9>, | ||
26 | <2 &test_intc1 10 11 12>, | ||
27 | <3 &test_intc2 13 14>, | ||
28 | <4 &test_intc2 15 16>; | ||
29 | }; | ||
30 | |||
31 | test_intmap1: intmap1 { | ||
32 | #interrupt-cells = <2>; | ||
33 | interrupt-map = <0x5000 1 2 &test_intc0 15>; | ||
34 | }; | ||
35 | |||
36 | interrupts0 { | ||
37 | interrupt-parent = <&test_intc0>; | ||
38 | interrupts = <1>, <2>, <3>, <4>; | ||
39 | }; | ||
40 | |||
41 | interrupts1 { | ||
42 | interrupt-parent = <&test_intmap0>; | ||
43 | interrupts = <1>, <2>, <3>, <4>; | ||
44 | }; | ||
45 | |||
46 | interrupts-extended0 { | ||
47 | reg = <0x5000 0x100>; | ||
48 | interrupts-extended = <&test_intc0 1>, | ||
49 | <&test_intc1 2 3 4>, | ||
50 | <&test_intc2 5 6>, | ||
51 | <&test_intmap0 1>, | ||
52 | <&test_intmap0 2>, | ||
53 | <&test_intmap0 3>, | ||
54 | <&test_intmap1 1 2>; | ||
55 | }; | ||
56 | }; | ||
57 | }; | ||
58 | }; | ||
diff --git a/arch/arm/boot/dts/testcases/tests-phandle.dtsi b/arch/arm/boot/dts/testcases/tests-phandle.dtsi deleted file mode 100644 index 0007d3cd7dc2..000000000000 --- a/arch/arm/boot/dts/testcases/tests-phandle.dtsi +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | |||
2 | / { | ||
3 | testcase-data { | ||
4 | phandle-tests { | ||
5 | provider0: provider0 { | ||
6 | #phandle-cells = <0>; | ||
7 | }; | ||
8 | |||
9 | provider1: provider1 { | ||
10 | #phandle-cells = <1>; | ||
11 | }; | ||
12 | |||
13 | provider2: provider2 { | ||
14 | #phandle-cells = <2>; | ||
15 | }; | ||
16 | |||
17 | provider3: provider3 { | ||
18 | #phandle-cells = <3>; | ||
19 | }; | ||
20 | |||
21 | consumer-a { | ||
22 | phandle-list = <&provider1 1>, | ||
23 | <&provider2 2 0>, | ||
24 | <0>, | ||
25 | <&provider3 4 4 3>, | ||
26 | <&provider2 5 100>, | ||
27 | <&provider0>, | ||
28 | <&provider1 7>; | ||
29 | phandle-list-names = "first", "second", "third"; | ||
30 | |||
31 | phandle-list-bad-phandle = <12345678 0 0>; | ||
32 | phandle-list-bad-args = <&provider2 1 0>, | ||
33 | <&provider3 0>; | ||
34 | empty-property; | ||
35 | unterminated-string = [40 41 42 43]; | ||
36 | }; | ||
37 | }; | ||
38 | }; | ||
39 | }; | ||
diff --git a/arch/arm/boot/dts/testcases/tests.dtsi b/arch/arm/boot/dts/testcases/tests.dtsi deleted file mode 100644 index 3f123ecc9dd7..000000000000 --- a/arch/arm/boot/dts/testcases/tests.dtsi +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | /include/ "tests-phandle.dtsi" | ||
2 | /include/ "tests-interrupts.dtsi" | ||
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts index f43907c40c93..65f657711323 100644 --- a/arch/arm/boot/dts/versatile-pb.dts +++ b/arch/arm/boot/dts/versatile-pb.dts | |||
@@ -1,4 +1,4 @@ | |||
1 | /include/ "versatile-ab.dts" | 1 | #include <versatile-ab.dts> |
2 | 2 | ||
3 | / { | 3 | / { |
4 | model = "ARM Versatile PB"; | 4 | model = "ARM Versatile PB"; |
@@ -47,4 +47,4 @@ | |||
47 | }; | 47 | }; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | /include/ "testcases/tests.dtsi" | 50 | #include <testcases.dtsi> |
diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6de0640..01004640ee4d 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig | |||
@@ -79,6 +79,13 @@ CONFIG_HW_RANDOM=y | |||
79 | CONFIG_I2C=y | 79 | CONFIG_I2C=y |
80 | CONFIG_I2C_CHARDEV=y | 80 | CONFIG_I2C_CHARDEV=y |
81 | # CONFIG_HWMON is not set | 81 | # CONFIG_HWMON is not set |
82 | CONFIG_MFD_BCM590XX=y | ||
83 | CONFIG_REGULATOR=y | ||
84 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
85 | CONFIG_REGULATOR_VIRTUAL_CONSUMER=y | ||
86 | CONFIG_REGULATOR_USERSPACE_CONSUMER=y | ||
87 | CONFIG_REGULATOR_BCM590XX=y | ||
88 | |||
82 | CONFIG_VIDEO_OUTPUT_CONTROL=y | 89 | CONFIG_VIDEO_OUTPUT_CONTROL=y |
83 | CONFIG_FB=y | 90 | CONFIG_FB=y |
84 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | 91 | CONFIG_BACKLIGHT_LCD_SUPPORT=y |
diff --git a/arch/arm/configs/da8xx_omapl_defconfig b/arch/arm/configs/da8xx_omapl_defconfig deleted file mode 100644 index 1571bea48bed..000000000000 --- a/arch/arm/configs/da8xx_omapl_defconfig +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | # CONFIG_SWAP is not set | ||
3 | CONFIG_SYSVIPC=y | ||
4 | CONFIG_POSIX_MQUEUE=y | ||
5 | CONFIG_IKCONFIG=y | ||
6 | CONFIG_IKCONFIG_PROC=y | ||
7 | CONFIG_LOG_BUF_SHIFT=14 | ||
8 | CONFIG_CGROUPS=y | ||
9 | CONFIG_BLK_DEV_INITRD=y | ||
10 | CONFIG_EXPERT=y | ||
11 | CONFIG_MODULES=y | ||
12 | CONFIG_MODULE_UNLOAD=y | ||
13 | CONFIG_MODULE_FORCE_UNLOAD=y | ||
14 | CONFIG_MODVERSIONS=y | ||
15 | # CONFIG_BLK_DEV_BSG is not set | ||
16 | # CONFIG_IOSCHED_DEADLINE is not set | ||
17 | # CONFIG_IOSCHED_CFQ is not set | ||
18 | CONFIG_ARCH_DAVINCI=y | ||
19 | CONFIG_ARCH_DAVINCI_DA830=y | ||
20 | CONFIG_ARCH_DAVINCI_DA850=y | ||
21 | CONFIG_MACH_DA8XX_DT=y | ||
22 | CONFIG_MACH_MITYOMAPL138=y | ||
23 | CONFIG_MACH_OMAPL138_HAWKBOARD=y | ||
24 | CONFIG_DAVINCI_RESET_CLOCKS=y | ||
25 | CONFIG_NO_HZ=y | ||
26 | CONFIG_HIGH_RES_TIMERS=y | ||
27 | CONFIG_PREEMPT=y | ||
28 | CONFIG_AEABI=y | ||
29 | # CONFIG_OABI_COMPAT is not set | ||
30 | CONFIG_LEDS=y | ||
31 | CONFIG_USE_OF=y | ||
32 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
33 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
34 | CONFIG_CPU_FREQ=y | ||
35 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y | ||
36 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=m | ||
37 | CONFIG_CPU_FREQ_GOV_POWERSAVE=m | ||
38 | CONFIG_CPU_FREQ_GOV_ONDEMAND=m | ||
39 | CONFIG_CPU_IDLE=y | ||
40 | CONFIG_PM_RUNTIME=y | ||
41 | CONFIG_NET=y | ||
42 | CONFIG_PACKET=y | ||
43 | CONFIG_UNIX=y | ||
44 | CONFIG_INET=y | ||
45 | CONFIG_IP_PNP=y | ||
46 | CONFIG_IP_PNP_DHCP=y | ||
47 | # CONFIG_INET_LRO is not set | ||
48 | CONFIG_NETFILTER=y | ||
49 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
50 | CONFIG_DEVTMPFS=y | ||
51 | CONFIG_DEVTMPFS_MOUNT=y | ||
52 | # CONFIG_FW_LOADER is not set | ||
53 | CONFIG_BLK_DEV_LOOP=m | ||
54 | CONFIG_BLK_DEV_RAM=y | ||
55 | CONFIG_BLK_DEV_RAM_COUNT=1 | ||
56 | CONFIG_BLK_DEV_RAM_SIZE=32768 | ||
57 | CONFIG_EEPROM_AT24=y | ||
58 | CONFIG_SCSI=m | ||
59 | CONFIG_BLK_DEV_SD=m | ||
60 | CONFIG_NETDEVICES=y | ||
61 | CONFIG_TUN=m | ||
62 | CONFIG_LXT_PHY=y | ||
63 | CONFIG_LSI_ET1011C_PHY=y | ||
64 | CONFIG_NET_ETHERNET=y | ||
65 | CONFIG_MII=y | ||
66 | CONFIG_TI_DAVINCI_EMAC=y | ||
67 | # CONFIG_NETDEV_1000 is not set | ||
68 | # CONFIG_NETDEV_10000 is not set | ||
69 | CONFIG_NETCONSOLE=y | ||
70 | CONFIG_NETPOLL_TRAP=y | ||
71 | CONFIG_INPUT_MOUSEDEV=m | ||
72 | CONFIG_INPUT_EVDEV=m | ||
73 | CONFIG_INPUT_EVBUG=m | ||
74 | CONFIG_KEYBOARD_ATKBD=m | ||
75 | CONFIG_KEYBOARD_GPIO=y | ||
76 | CONFIG_KEYBOARD_XTKBD=m | ||
77 | # CONFIG_INPUT_MOUSE is not set | ||
78 | CONFIG_INPUT_TOUCHSCREEN=y | ||
79 | CONFIG_SERIO_LIBPS2=y | ||
80 | # CONFIG_VT_CONSOLE is not set | ||
81 | CONFIG_SERIAL_8250=y | ||
82 | CONFIG_SERIAL_8250_CONSOLE=y | ||
83 | CONFIG_SERIAL_8250_NR_UARTS=3 | ||
84 | CONFIG_SERIAL_OF_PLATFORM=y | ||
85 | CONFIG_I2C=y | ||
86 | CONFIG_I2C_CHARDEV=y | ||
87 | CONFIG_I2C_DAVINCI=y | ||
88 | CONFIG_PINCTRL_SINGLE=y | ||
89 | # CONFIG_HWMON is not set | ||
90 | CONFIG_WATCHDOG=y | ||
91 | CONFIG_REGULATOR=y | ||
92 | CONFIG_REGULATOR_DUMMY=y | ||
93 | CONFIG_REGULATOR_TPS6507X=y | ||
94 | CONFIG_FB=y | ||
95 | CONFIG_FB_DA8XX=y | ||
96 | # CONFIG_VGA_CONSOLE is not set | ||
97 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
98 | CONFIG_LOGO=y | ||
99 | CONFIG_SOUND=m | ||
100 | CONFIG_SND=m | ||
101 | CONFIG_SND_SOC=m | ||
102 | CONFIG_SND_DAVINCI_SOC=m | ||
103 | # CONFIG_HID_SUPPORT is not set | ||
104 | # CONFIG_USB_SUPPORT is not set | ||
105 | CONFIG_DMADEVICES=y | ||
106 | CONFIG_TI_EDMA=y | ||
107 | CONFIG_EXT2_FS=y | ||
108 | CONFIG_EXT3_FS=y | ||
109 | CONFIG_XFS_FS=m | ||
110 | CONFIG_INOTIFY=y | ||
111 | CONFIG_AUTOFS4_FS=m | ||
112 | CONFIG_MSDOS_FS=y | ||
113 | CONFIG_VFAT_FS=y | ||
114 | CONFIG_TMPFS=y | ||
115 | CONFIG_CRAMFS=y | ||
116 | CONFIG_MINIX_FS=m | ||
117 | CONFIG_NFS_FS=y | ||
118 | CONFIG_NFS_V3=y | ||
119 | CONFIG_ROOT_NFS=y | ||
120 | CONFIG_NFSD=m | ||
121 | CONFIG_NFSD_V3=y | ||
122 | CONFIG_SMB_FS=m | ||
123 | CONFIG_PARTITION_ADVANCED=y | ||
124 | CONFIG_NLS_CODEPAGE_437=y | ||
125 | CONFIG_NLS_ASCII=m | ||
126 | CONFIG_NLS_ISO8859_1=y | ||
127 | CONFIG_NLS_UTF8=m | ||
128 | CONFIG_DEBUG_FS=y | ||
129 | CONFIG_DEBUG_KERNEL=y | ||
130 | CONFIG_TIMER_STATS=y | ||
131 | CONFIG_DEBUG_RT_MUTEXES=y | ||
132 | CONFIG_DEBUG_MUTEXES=y | ||
133 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
134 | CONFIG_DEBUG_USER=y | ||
135 | CONFIG_DEBUG_ERRORS=y | ||
136 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | ||
137 | # CONFIG_CRYPTO_HW is not set | ||
138 | CONFIG_CRC_CCITT=m | ||
139 | CONFIG_CRC_T10DIF=m | ||
diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig index ab2f7378352c..fff4eb6f62c2 100644 --- a/arch/arm/configs/davinci_all_defconfig +++ b/arch/arm/configs/davinci_all_defconfig | |||
@@ -20,9 +20,14 @@ CONFIG_ARCH_DAVINCI_DM644x=y | |||
20 | CONFIG_ARCH_DAVINCI_DM355=y | 20 | CONFIG_ARCH_DAVINCI_DM355=y |
21 | CONFIG_ARCH_DAVINCI_DM646x=y | 21 | CONFIG_ARCH_DAVINCI_DM646x=y |
22 | CONFIG_ARCH_DAVINCI_DM365=y | 22 | CONFIG_ARCH_DAVINCI_DM365=y |
23 | CONFIG_ARCH_DAVINCI_DA830=y | ||
24 | CONFIG_ARCH_DAVINCI_DA850=y | ||
25 | CONFIG_MACH_DA8XX_DT=y | ||
23 | CONFIG_MACH_SFFSDR=y | 26 | CONFIG_MACH_SFFSDR=y |
24 | CONFIG_MACH_NEUROS_OSD2=y | 27 | CONFIG_MACH_NEUROS_OSD2=y |
25 | CONFIG_MACH_DM355_LEOPARD=y | 28 | CONFIG_MACH_DM355_LEOPARD=y |
29 | CONFIG_MACH_MITYOMAPL138=y | ||
30 | CONFIG_MACH_OMAPL138_HAWKBOARD=y | ||
26 | CONFIG_DAVINCI_MUX_DEBUG=y | 31 | CONFIG_DAVINCI_MUX_DEBUG=y |
27 | CONFIG_DAVINCI_MUX_WARNINGS=y | 32 | CONFIG_DAVINCI_MUX_WARNINGS=y |
28 | CONFIG_DAVINCI_RESET_CLOCKS=y | 33 | CONFIG_DAVINCI_RESET_CLOCKS=y |
@@ -32,8 +37,16 @@ CONFIG_PREEMPT=y | |||
32 | CONFIG_AEABI=y | 37 | CONFIG_AEABI=y |
33 | # CONFIG_OABI_COMPAT is not set | 38 | # CONFIG_OABI_COMPAT is not set |
34 | CONFIG_LEDS=y | 39 | CONFIG_LEDS=y |
40 | CONFIG_USE_OF=y | ||
35 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 41 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
36 | CONFIG_ZBOOT_ROM_BSS=0x0 | 42 | CONFIG_ZBOOT_ROM_BSS=0x0 |
43 | CONFIG_AUTO_ZRELADDR=y | ||
44 | CONFIG_CPU_FREQ=y | ||
45 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y | ||
46 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=m | ||
47 | CONFIG_CPU_FREQ_GOV_POWERSAVE=m | ||
48 | CONFIG_CPU_FREQ_GOV_ONDEMAND=m | ||
49 | CONFIG_CPU_IDLE=y | ||
37 | CONFIG_PM_RUNTIME=y | 50 | CONFIG_PM_RUNTIME=y |
38 | CONFIG_NET=y | 51 | CONFIG_NET=y |
39 | CONFIG_PACKET=y | 52 | CONFIG_PACKET=y |
@@ -71,6 +84,7 @@ CONFIG_TUN=m | |||
71 | CONFIG_LXT_PHY=y | 84 | CONFIG_LXT_PHY=y |
72 | CONFIG_LSI_ET1011C_PHY=y | 85 | CONFIG_LSI_ET1011C_PHY=y |
73 | CONFIG_NET_ETHERNET=y | 86 | CONFIG_NET_ETHERNET=y |
87 | CONFIG_MII=y | ||
74 | CONFIG_TI_DAVINCI_EMAC=y | 88 | CONFIG_TI_DAVINCI_EMAC=y |
75 | CONFIG_DM9000=y | 89 | CONFIG_DM9000=y |
76 | # CONFIG_NETDEV_1000 is not set | 90 | # CONFIG_NETDEV_1000 is not set |
@@ -97,15 +111,21 @@ CONFIG_SERIAL_8250=y | |||
97 | CONFIG_SERIAL_8250_CONSOLE=y | 111 | CONFIG_SERIAL_8250_CONSOLE=y |
98 | CONFIG_SERIAL_8250_NR_UARTS=3 | 112 | CONFIG_SERIAL_8250_NR_UARTS=3 |
99 | # CONFIG_HW_RANDOM is not set | 113 | # CONFIG_HW_RANDOM is not set |
114 | CONFIG_SERIAL_OF_PLATFORM=y | ||
100 | CONFIG_I2C=y | 115 | CONFIG_I2C=y |
101 | CONFIG_I2C_CHARDEV=y | 116 | CONFIG_I2C_CHARDEV=y |
102 | CONFIG_I2C_DAVINCI=y | 117 | CONFIG_I2C_DAVINCI=y |
118 | CONFIG_PINCTRL_SINGLE=y | ||
103 | CONFIG_GPIO_PCF857X=y | 119 | CONFIG_GPIO_PCF857X=y |
104 | CONFIG_WATCHDOG=y | 120 | CONFIG_WATCHDOG=y |
105 | CONFIG_DAVINCI_WATCHDOG=m | 121 | CONFIG_DAVINCI_WATCHDOG=m |
106 | CONFIG_MFD_DM355EVM_MSP=y | 122 | CONFIG_MFD_DM355EVM_MSP=y |
123 | CONFIG_TPS6507X=y | ||
107 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 124 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
125 | CONFIG_REGULATOR=y | ||
126 | CONFIG_REGULATOR_TPS6507X=y | ||
108 | CONFIG_FB=y | 127 | CONFIG_FB=y |
128 | CONFIG_FB_DA8XX=y | ||
109 | CONFIG_FIRMWARE_EDID=y | 129 | CONFIG_FIRMWARE_EDID=y |
110 | # CONFIG_VGA_CONSOLE is not set | 130 | # CONFIG_VGA_CONSOLE is not set |
111 | CONFIG_FRAMEBUFFER_CONSOLE=y | 131 | CONFIG_FRAMEBUFFER_CONSOLE=y |
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig index 6309ee52ccfc..f1aeb7d72712 100644 --- a/arch/arm/configs/imx_v4_v5_defconfig +++ b/arch/arm/configs/imx_v4_v5_defconfig | |||
@@ -154,6 +154,7 @@ CONFIG_USB=y | |||
154 | CONFIG_USB_EHCI_HCD=y | 154 | CONFIG_USB_EHCI_HCD=y |
155 | CONFIG_USB_EHCI_MXC=y | 155 | CONFIG_USB_EHCI_MXC=y |
156 | CONFIG_MMC=y | 156 | CONFIG_MMC=y |
157 | CONFIG_MMC_UNSAFE_RESUME=y | ||
157 | CONFIG_MMC_SDHCI=y | 158 | CONFIG_MMC_SDHCI=y |
158 | CONFIG_MMC_SDHCI_PLTFM=y | 159 | CONFIG_MMC_SDHCI_PLTFM=y |
159 | CONFIG_MMC_SDHCI_ESDHC_IMX=y | 160 | CONFIG_MMC_SDHCI_ESDHC_IMX=y |
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 53e82c2523eb..09e974392fa1 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig | |||
@@ -39,6 +39,8 @@ CONFIG_SOC_IMX53=y | |||
39 | CONFIG_SOC_IMX6Q=y | 39 | CONFIG_SOC_IMX6Q=y |
40 | CONFIG_SOC_IMX6SL=y | 40 | CONFIG_SOC_IMX6SL=y |
41 | CONFIG_SOC_VF610=y | 41 | CONFIG_SOC_VF610=y |
42 | CONFIG_PCI=y | ||
43 | CONFIG_PCI_IMX6=y | ||
42 | CONFIG_SMP=y | 44 | CONFIG_SMP=y |
43 | CONFIG_VMSPLIT_2G=y | 45 | CONFIG_VMSPLIT_2G=y |
44 | CONFIG_PREEMPT_VOLUNTARY=y | 46 | CONFIG_PREEMPT_VOLUNTARY=y |
@@ -165,6 +167,7 @@ CONFIG_REGULATOR=y | |||
165 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | 167 | CONFIG_REGULATOR_FIXED_VOLTAGE=y |
166 | CONFIG_REGULATOR_ANATOP=y | 168 | CONFIG_REGULATOR_ANATOP=y |
167 | CONFIG_REGULATOR_DA9052=y | 169 | CONFIG_REGULATOR_DA9052=y |
170 | CONFIG_REGULATOR_GPIO=y | ||
168 | CONFIG_REGULATOR_MC13783=y | 171 | CONFIG_REGULATOR_MC13783=y |
169 | CONFIG_REGULATOR_MC13892=y | 172 | CONFIG_REGULATOR_MC13892=y |
170 | CONFIG_REGULATOR_PFUZE100=y | 173 | CONFIG_REGULATOR_PFUZE100=y |
@@ -186,6 +189,7 @@ CONFIG_LCD_L4F00242T03=y | |||
186 | CONFIG_LCD_PLATFORM=y | 189 | CONFIG_LCD_PLATFORM=y |
187 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | 190 | CONFIG_BACKLIGHT_CLASS_DEVICE=y |
188 | CONFIG_BACKLIGHT_PWM=y | 191 | CONFIG_BACKLIGHT_PWM=y |
192 | CONFIG_BACKLIGHT_GPIO=y | ||
189 | CONFIG_FRAMEBUFFER_CONSOLE=y | 193 | CONFIG_FRAMEBUFFER_CONSOLE=y |
190 | CONFIG_LOGO=y | 194 | CONFIG_LOGO=y |
191 | CONFIG_SOUND=y | 195 | CONFIG_SOUND=y |
@@ -211,6 +215,7 @@ CONFIG_USB_GADGET=y | |||
211 | CONFIG_USB_ETH=m | 215 | CONFIG_USB_ETH=m |
212 | CONFIG_USB_MASS_STORAGE=m | 216 | CONFIG_USB_MASS_STORAGE=m |
213 | CONFIG_MMC=y | 217 | CONFIG_MMC=y |
218 | CONFIG_MMC_UNSAFE_RESUME=y | ||
214 | CONFIG_MMC_SDHCI=y | 219 | CONFIG_MMC_SDHCI=y |
215 | CONFIG_MMC_SDHCI_PLTFM=y | 220 | CONFIG_MMC_SDHCI_PLTFM=y |
216 | CONFIG_MMC_SDHCI_ESDHC_IMX=y | 221 | CONFIG_MMC_SDHCI_ESDHC_IMX=y |
@@ -225,6 +230,7 @@ CONFIG_LEDS_TRIGGER_BACKLIGHT=y | |||
225 | CONFIG_LEDS_TRIGGER_GPIO=y | 230 | CONFIG_LEDS_TRIGGER_GPIO=y |
226 | CONFIG_RTC_CLASS=y | 231 | CONFIG_RTC_CLASS=y |
227 | CONFIG_RTC_INTF_DEV_UIE_EMUL=y | 232 | CONFIG_RTC_INTF_DEV_UIE_EMUL=y |
233 | CONFIG_RTC_DRV_PCF8563=y | ||
228 | CONFIG_RTC_DRV_MC13XXX=y | 234 | CONFIG_RTC_DRV_MC13XXX=y |
229 | CONFIG_RTC_DRV_MXC=y | 235 | CONFIG_RTC_DRV_MXC=y |
230 | CONFIG_RTC_DRV_SNVS=y | 236 | CONFIG_RTC_DRV_SNVS=y |
@@ -277,6 +283,7 @@ CONFIG_NLS_ASCII=y | |||
277 | CONFIG_NLS_ISO8859_1=y | 283 | CONFIG_NLS_ISO8859_1=y |
278 | CONFIG_NLS_ISO8859_15=m | 284 | CONFIG_NLS_ISO8859_15=m |
279 | CONFIG_NLS_UTF8=y | 285 | CONFIG_NLS_UTF8=y |
286 | CONFIG_DEBUG_FS=y | ||
280 | CONFIG_MAGIC_SYSRQ=y | 287 | CONFIG_MAGIC_SYSRQ=y |
281 | # CONFIG_SCHED_DEBUG is not set | 288 | # CONFIG_SCHED_DEBUG is not set |
282 | CONFIG_PROVE_LOCKING=y | 289 | CONFIG_PROVE_LOCKING=y |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 845bc745706b..1b4821bc5c7a 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -11,6 +11,7 @@ CONFIG_ARCH_MVEBU=y | |||
11 | CONFIG_MACH_ARMADA_370=y | 11 | CONFIG_MACH_ARMADA_370=y |
12 | CONFIG_MACH_ARMADA_XP=y | 12 | CONFIG_MACH_ARMADA_XP=y |
13 | CONFIG_ARCH_BCM=y | 13 | CONFIG_ARCH_BCM=y |
14 | CONFIG_ARCH_BCM_5301X=y | ||
14 | CONFIG_ARCH_BCM_MOBILE=y | 15 | CONFIG_ARCH_BCM_MOBILE=y |
15 | CONFIG_ARCH_BERLIN=y | 16 | CONFIG_ARCH_BERLIN=y |
16 | CONFIG_MACH_BERLIN_BG2=y | 17 | CONFIG_MACH_BERLIN_BG2=y |
@@ -29,6 +30,7 @@ CONFIG_ARCH_OMAP3=y | |||
29 | CONFIG_ARCH_OMAP4=y | 30 | CONFIG_ARCH_OMAP4=y |
30 | CONFIG_SOC_OMAP5=y | 31 | CONFIG_SOC_OMAP5=y |
31 | CONFIG_SOC_AM33XX=y | 32 | CONFIG_SOC_AM33XX=y |
33 | CONFIG_SOC_DRA7XX=y | ||
32 | CONFIG_SOC_AM43XX=y | 34 | CONFIG_SOC_AM43XX=y |
33 | CONFIG_ARCH_ROCKCHIP=y | 35 | CONFIG_ARCH_ROCKCHIP=y |
34 | CONFIG_ARCH_SOCFPGA=y | 36 | CONFIG_ARCH_SOCFPGA=y |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index 3a0b53d225e7..364ba38e40f3 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
@@ -28,6 +28,7 @@ CONFIG_ARCH_OMAP3=y | |||
28 | CONFIG_ARCH_OMAP4=y | 28 | CONFIG_ARCH_OMAP4=y |
29 | CONFIG_SOC_OMAP5=y | 29 | CONFIG_SOC_OMAP5=y |
30 | CONFIG_SOC_AM33XX=y | 30 | CONFIG_SOC_AM33XX=y |
31 | CONFIG_SOC_AM43XX=y | ||
31 | CONFIG_SOC_DRA7XX=y | 32 | CONFIG_SOC_DRA7XX=y |
32 | CONFIG_ARM_THUMBEE=y | 33 | CONFIG_ARM_THUMBEE=y |
33 | CONFIG_ARM_ERRATA_411920=y | 34 | CONFIG_ARM_ERRATA_411920=y |
diff --git a/arch/arm/firmware/Kconfig b/arch/arm/firmware/Kconfig index bb00ccf00d66..ad396af68e47 100644 --- a/arch/arm/firmware/Kconfig +++ b/arch/arm/firmware/Kconfig | |||
@@ -11,6 +11,7 @@ menu "Firmware options" | |||
11 | config TRUSTED_FOUNDATIONS | 11 | config TRUSTED_FOUNDATIONS |
12 | bool "Trusted Foundations secure monitor support" | 12 | bool "Trusted Foundations secure monitor support" |
13 | depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS | 13 | depends on ARCH_SUPPORTS_TRUSTED_FOUNDATIONS |
14 | default y | ||
14 | help | 15 | help |
15 | Some devices (including most Tegra-based consumer devices on the | 16 | Some devices (including most Tegra-based consumer devices on the |
16 | market) are booted with the Trusted Foundations secure monitor | 17 | market) are booted with the Trusted Foundations secure monitor |
@@ -20,7 +21,7 @@ config TRUSTED_FOUNDATIONS | |||
20 | This option allows the kernel to invoke the secure monitor whenever | 21 | This option allows the kernel to invoke the secure monitor whenever |
21 | required on devices using Trusted Foundations. See | 22 | required on devices using Trusted Foundations. See |
22 | arch/arm/include/asm/trusted_foundations.h or the | 23 | arch/arm/include/asm/trusted_foundations.h or the |
23 | tl,trusted-foundations device tree binding documentation for details | 24 | tlm,trusted-foundations device tree binding documentation for details |
24 | on how to use it. | 25 | on how to use it. |
25 | 26 | ||
26 | Say n if you don't know what this is about. | 27 | Say n if you don't know what this is about. |
diff --git a/arch/arm/firmware/trusted_foundations.c b/arch/arm/firmware/trusted_foundations.c index ef1e3d8f4af0..3fb1b5a1dce9 100644 --- a/arch/arm/firmware/trusted_foundations.c +++ b/arch/arm/firmware/trusted_foundations.c | |||
@@ -22,6 +22,15 @@ | |||
22 | 22 | ||
23 | #define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200 | 23 | #define TF_SET_CPU_BOOT_ADDR_SMC 0xfffff200 |
24 | 24 | ||
25 | #define TF_CPU_PM 0xfffffffc | ||
26 | #define TF_CPU_PM_S3 0xffffffe3 | ||
27 | #define TF_CPU_PM_S2 0xffffffe6 | ||
28 | #define TF_CPU_PM_S2_NO_MC_CLK 0xffffffe5 | ||
29 | #define TF_CPU_PM_S1 0xffffffe4 | ||
30 | #define TF_CPU_PM_S1_NOFLUSH_L2 0xffffffe7 | ||
31 | |||
32 | static unsigned long cpu_boot_addr; | ||
33 | |||
25 | static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2) | 34 | static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2) |
26 | { | 35 | { |
27 | asm volatile( | 36 | asm volatile( |
@@ -41,13 +50,22 @@ static void __naked tf_generic_smc(u32 type, u32 arg1, u32 arg2) | |||
41 | 50 | ||
42 | static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr) | 51 | static int tf_set_cpu_boot_addr(int cpu, unsigned long boot_addr) |
43 | { | 52 | { |
44 | tf_generic_smc(TF_SET_CPU_BOOT_ADDR_SMC, boot_addr, 0); | 53 | cpu_boot_addr = boot_addr; |
54 | tf_generic_smc(TF_SET_CPU_BOOT_ADDR_SMC, cpu_boot_addr, 0); | ||
55 | |||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static int tf_prepare_idle(void) | ||
60 | { | ||
61 | tf_generic_smc(TF_CPU_PM, TF_CPU_PM_S1_NOFLUSH_L2, cpu_boot_addr); | ||
45 | 62 | ||
46 | return 0; | 63 | return 0; |
47 | } | 64 | } |
48 | 65 | ||
49 | static const struct firmware_ops trusted_foundations_ops = { | 66 | static const struct firmware_ops trusted_foundations_ops = { |
50 | .set_cpu_boot_addr = tf_set_cpu_boot_addr, | 67 | .set_cpu_boot_addr = tf_set_cpu_boot_addr, |
68 | .prepare_idle = tf_prepare_idle, | ||
51 | }; | 69 | }; |
52 | 70 | ||
53 | void register_trusted_foundations(struct trusted_foundations_platform_data *pd) | 71 | void register_trusted_foundations(struct trusted_foundations_platform_data *pd) |
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index e9a49fe0284e..8b8b61685a34 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
@@ -212,6 +212,7 @@ extern void copy_to_user_page(struct vm_area_struct *, struct page *, | |||
212 | static inline void __flush_icache_all(void) | 212 | static inline void __flush_icache_all(void) |
213 | { | 213 | { |
214 | __flush_icache_preferred(); | 214 | __flush_icache_preferred(); |
215 | dsb(); | ||
215 | } | 216 | } |
216 | 217 | ||
217 | /* | 218 | /* |
diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h index 15631300c238..2c9f10df7568 100644 --- a/arch/arm/include/asm/firmware.h +++ b/arch/arm/include/asm/firmware.h | |||
@@ -22,6 +22,10 @@ | |||
22 | */ | 22 | */ |
23 | struct firmware_ops { | 23 | struct firmware_ops { |
24 | /* | 24 | /* |
25 | * Inform the firmware we intend to enter CPU idle mode | ||
26 | */ | ||
27 | int (*prepare_idle)(void); | ||
28 | /* | ||
25 | * Enters CPU idle mode | 29 | * Enters CPU idle mode |
26 | */ | 30 | */ |
27 | int (*do_idle)(void); | 31 | int (*do_idle)(void); |
diff --git a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h b/arch/arm/include/asm/hardware/cache-feroceon-l2.h index 06f982d55697..12e1588dc4f1 100644 --- a/arch/arm/plat-orion/include/plat/cache-feroceon-l2.h +++ b/arch/arm/include/asm/hardware/cache-feroceon-l2.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/plat-orion/include/plat/cache-feroceon-l2.h | 2 | * arch/arm/include/asm/hardware/cache-feroceon-l2.h |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Marvell Semiconductor | 4 | * Copyright (C) 2008 Marvell Semiconductor |
5 | * | 5 | * |
@@ -9,3 +9,5 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | extern void __init feroceon_l2_init(int l2_wt_override); | 11 | extern void __init feroceon_l2_init(int l2_wt_override); |
12 | extern int __init feroceon_of_init(void); | ||
13 | |||
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h index 03243f7eeddf..85c60adc8b60 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h | |||
@@ -120,13 +120,16 @@ | |||
120 | /* | 120 | /* |
121 | * 2nd stage PTE definitions for LPAE. | 121 | * 2nd stage PTE definitions for LPAE. |
122 | */ | 122 | */ |
123 | #define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x5) << 2) /* MemAttr[3:0] */ | 123 | #define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x0) << 2) /* strongly ordered */ |
124 | #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */ | 124 | #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* normal inner write-through */ |
125 | #define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */ | 125 | #define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* normal inner write-back */ |
126 | #define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */ | 126 | #define L_PTE_S2_MT_DEV_SHARED (_AT(pteval_t, 0x1) << 2) /* device */ |
127 | #define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ | 127 | #define L_PTE_S2_MT_MASK (_AT(pteval_t, 0xf) << 2) |
128 | 128 | ||
129 | #define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */ | 129 | #define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */ |
130 | #define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */ | ||
131 | |||
132 | #define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */ | ||
130 | 133 | ||
131 | /* | 134 | /* |
132 | * Hyp-mode PL2 PTE definitions for LPAE. | 135 | * Hyp-mode PL2 PTE definitions for LPAE. |
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 22a3b9b5d4a1..772435b08207 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -114,6 +114,15 @@ struct smp_operations { | |||
114 | #endif | 114 | #endif |
115 | }; | 115 | }; |
116 | 116 | ||
117 | struct of_cpu_method { | ||
118 | const char *method; | ||
119 | struct smp_operations *ops; | ||
120 | }; | ||
121 | |||
122 | #define CPU_METHOD_OF_DECLARE(name, _method, _ops) \ | ||
123 | static const struct of_cpu_method __cpu_method_of_table_##name \ | ||
124 | __used __section(__cpu_method_of_table) \ | ||
125 | = { .method = _method, .ops = _ops } | ||
117 | /* | 126 | /* |
118 | * set platform specific SMP operations | 127 | * set platform specific SMP operations |
119 | */ | 128 | */ |
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h index ef3c6072aa45..ac4bfae26702 100644 --- a/arch/arm/include/asm/spinlock.h +++ b/arch/arm/include/asm/spinlock.h | |||
@@ -37,18 +37,9 @@ | |||
37 | 37 | ||
38 | static inline void dsb_sev(void) | 38 | static inline void dsb_sev(void) |
39 | { | 39 | { |
40 | #if __LINUX_ARM_ARCH__ >= 7 | 40 | |
41 | __asm__ __volatile__ ( | 41 | dsb(ishst); |
42 | "dsb ishst\n" | 42 | __asm__(SEV); |
43 | SEV | ||
44 | ); | ||
45 | #else | ||
46 | __asm__ __volatile__ ( | ||
47 | "mcr p15, 0, %0, c7, c10, 4\n" | ||
48 | SEV | ||
49 | : : "r" (0) | ||
50 | ); | ||
51 | #endif | ||
52 | } | 43 | } |
53 | 44 | ||
54 | /* | 45 | /* |
diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h index 3bd36e2c5f2e..b5f7705abcb0 100644 --- a/arch/arm/include/asm/trusted_foundations.h +++ b/arch/arm/include/asm/trusted_foundations.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/printk.h> | 30 | #include <linux/printk.h> |
31 | #include <linux/bug.h> | 31 | #include <linux/bug.h> |
32 | #include <linux/of.h> | 32 | #include <linux/of.h> |
33 | #include <linux/cpu.h> | ||
34 | #include <linux/smp.h> | ||
33 | 35 | ||
34 | struct trusted_foundations_platform_data { | 36 | struct trusted_foundations_platform_data { |
35 | unsigned int version_major; | 37 | unsigned int version_major; |
@@ -47,10 +49,13 @@ static inline void register_trusted_foundations( | |||
47 | struct trusted_foundations_platform_data *pd) | 49 | struct trusted_foundations_platform_data *pd) |
48 | { | 50 | { |
49 | /* | 51 | /* |
50 | * If we try to register TF, this means the system needs it to continue. | 52 | * If the system requires TF and we cannot provide it, continue booting |
51 | * Its absence if thus a fatal error. | 53 | * but disable features that cannot be provided. |
52 | */ | 54 | */ |
53 | panic("No support for Trusted Foundations, stopping...\n"); | 55 | pr_err("No support for Trusted Foundations, continuing in degraded mode.\n"); |
56 | pr_err("Secondary processors as well as CPU PM will be disabled.\n"); | ||
57 | setup_max_cpus = 0; | ||
58 | cpu_idle_poll_ctrl(true); | ||
54 | } | 59 | } |
55 | 60 | ||
56 | static inline void of_register_trusted_foundations(void) | 61 | static inline void of_register_trusted_foundations(void) |
@@ -59,7 +64,7 @@ static inline void of_register_trusted_foundations(void) | |||
59 | * If we find the target should enable TF but does not support it, | 64 | * If we find the target should enable TF but does not support it, |
60 | * fail as the system won't be able to do much anyway | 65 | * fail as the system won't be able to do much anyway |
61 | */ | 66 | */ |
62 | if (of_find_compatible_node(NULL, NULL, "tl,trusted-foundations")) | 67 | if (of_find_compatible_node(NULL, NULL, "tlm,trusted-foundations")) |
63 | register_trusted_foundations(NULL); | 68 | register_trusted_foundations(NULL); |
64 | } | 69 | } |
65 | #endif /* CONFIG_TRUSTED_FOUNDATIONS */ | 70 | #endif /* CONFIG_TRUSTED_FOUNDATIONS */ |
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index f751714d52c1..c7419a585ddc 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/of_fdt.h> | 18 | #include <linux/of_fdt.h> |
19 | #include <linux/of_irq.h> | 19 | #include <linux/of_irq.h> |
20 | #include <linux/of_platform.h> | 20 | #include <linux/of_platform.h> |
21 | #include <linux/smp.h> | ||
21 | 22 | ||
22 | #include <asm/cputype.h> | 23 | #include <asm/cputype.h> |
23 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
@@ -63,6 +64,34 @@ void __init arm_dt_memblock_reserve(void) | |||
63 | } | 64 | } |
64 | } | 65 | } |
65 | 66 | ||
67 | #ifdef CONFIG_SMP | ||
68 | extern struct of_cpu_method __cpu_method_of_table_begin[]; | ||
69 | extern struct of_cpu_method __cpu_method_of_table_end[]; | ||
70 | |||
71 | static int __init set_smp_ops_by_method(struct device_node *node) | ||
72 | { | ||
73 | const char *method; | ||
74 | struct of_cpu_method *m = __cpu_method_of_table_begin; | ||
75 | |||
76 | if (of_property_read_string(node, "enable-method", &method)) | ||
77 | return 0; | ||
78 | |||
79 | for (; m < __cpu_method_of_table_end; m++) | ||
80 | if (!strcmp(m->method, method)) { | ||
81 | smp_set_ops(m->ops); | ||
82 | return 1; | ||
83 | } | ||
84 | |||
85 | return 0; | ||
86 | } | ||
87 | #else | ||
88 | static inline int set_smp_ops_by_method(struct device_node *node) | ||
89 | { | ||
90 | return 1; | ||
91 | } | ||
92 | #endif | ||
93 | |||
94 | |||
66 | /* | 95 | /* |
67 | * arm_dt_init_cpu_maps - Function retrieves cpu nodes from the device tree | 96 | * arm_dt_init_cpu_maps - Function retrieves cpu nodes from the device tree |
68 | * and builds the cpu logical map array containing MPIDR values related to | 97 | * and builds the cpu logical map array containing MPIDR values related to |
@@ -79,6 +108,7 @@ void __init arm_dt_init_cpu_maps(void) | |||
79 | * read as 0. | 108 | * read as 0. |
80 | */ | 109 | */ |
81 | struct device_node *cpu, *cpus; | 110 | struct device_node *cpu, *cpus; |
111 | int found_method = 0; | ||
82 | u32 i, j, cpuidx = 1; | 112 | u32 i, j, cpuidx = 1; |
83 | u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0; | 113 | u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0; |
84 | 114 | ||
@@ -150,8 +180,18 @@ void __init arm_dt_init_cpu_maps(void) | |||
150 | } | 180 | } |
151 | 181 | ||
152 | tmp_map[i] = hwid; | 182 | tmp_map[i] = hwid; |
183 | |||
184 | if (!found_method) | ||
185 | found_method = set_smp_ops_by_method(cpu); | ||
153 | } | 186 | } |
154 | 187 | ||
188 | /* | ||
189 | * Fallback to an enable-method in the cpus node if nothing found in | ||
190 | * a cpu node. | ||
191 | */ | ||
192 | if (!found_method) | ||
193 | set_smp_ops_by_method(cpus); | ||
194 | |||
155 | if (!bootcpu_valid) { | 195 | if (!bootcpu_valid) { |
156 | pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n"); | 196 | pr_warn("DT missing boot CPU MPIDR[23:0], fall back to default cpu_logical_map\n"); |
157 | return; | 197 | return; |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index b0df9761de6d..1e8b030dbefd 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -731,7 +731,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc) | |||
731 | kernel_data.end = virt_to_phys(_end - 1); | 731 | kernel_data.end = virt_to_phys(_end - 1); |
732 | 732 | ||
733 | for_each_memblock(memory, region) { | 733 | for_each_memblock(memory, region) { |
734 | res = memblock_virt_alloc_low(sizeof(*res), 0); | 734 | res = memblock_virt_alloc(sizeof(*res), 0); |
735 | res->name = "System RAM"; | 735 | res->name = "System RAM"; |
736 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); | 736 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); |
737 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; | 737 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; |
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index b1aa6a9b3bd1..21474458aa56 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig | |||
@@ -16,12 +16,7 @@ config ARCH_BCM_MOBILE | |||
16 | select ARM_ERRATA_754322 | 16 | select ARM_ERRATA_754322 |
17 | select ARM_ERRATA_764369 if SMP | 17 | select ARM_ERRATA_764369 if SMP |
18 | select ARM_GIC | 18 | select ARM_GIC |
19 | select CPU_V7 | ||
20 | select CLKSRC_OF | ||
21 | select GENERIC_CLOCKEVENTS | ||
22 | select GENERIC_TIME | ||
23 | select GPIO_BCM_KONA | 19 | select GPIO_BCM_KONA |
24 | select SPARSE_IRQ | ||
25 | select TICK_ONESHOT | 20 | select TICK_ONESHOT |
26 | select CACHE_L2X0 | 21 | select CACHE_L2X0 |
27 | select HAVE_ARM_ARCH_TIMER | 22 | select HAVE_ARM_ARCH_TIMER |
@@ -32,6 +27,32 @@ config ARCH_BCM_MOBILE | |||
32 | BCM11130, BCM11140, BCM11351, BCM28145 and | 27 | BCM11130, BCM11140, BCM11351, BCM28145 and |
33 | BCM28155 variants. | 28 | BCM28155 variants. |
34 | 29 | ||
30 | config ARCH_BCM_5301X | ||
31 | bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7 | ||
32 | depends on MMU | ||
33 | select ARM_GIC | ||
34 | select CACHE_L2X0 | ||
35 | select HAVE_ARM_SCU if SMP | ||
36 | select HAVE_ARM_TWD if SMP | ||
37 | select HAVE_SMP | ||
38 | select COMMON_CLK | ||
39 | select GENERIC_CLOCKEVENTS | ||
40 | select ARM_GLOBAL_TIMER | ||
41 | select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK | ||
42 | select MIGHT_HAVE_PCI | ||
43 | help | ||
44 | Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores. | ||
45 | |||
46 | This is a network SoC line mostly used in home routers and | ||
47 | wifi access points, it's internal name is Northstar. | ||
48 | This inclused the following SoC: BCM53010, BCM53011, BCM53012, | ||
49 | BCM53014, BCM53015, BCM53016, BCM53017, BCM53018, BCM4707, | ||
50 | BCM4708 and BCM4709. | ||
51 | |||
52 | Do not confuse this with the BCM4760 which is a totally | ||
53 | different SoC or with the older BCM47XX and BCM53XX based | ||
54 | network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx | ||
55 | |||
35 | endmenu | 56 | endmenu |
36 | 57 | ||
37 | endif | 58 | endif |
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile index c2ccd5a0f772..4e4a2ed6851e 100644 --- a/arch/arm/mach-bcm/Makefile +++ b/arch/arm/mach-bcm/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | # | 1 | # |
2 | # Copyright (C) 2012-2013 Broadcom Corporation | 2 | # Copyright (C) 2012-2014 Broadcom Corporation |
3 | # | 3 | # |
4 | # This program is free software; you can redistribute it and/or | 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 | 5 | # modify it under the terms of the GNU General Public License as |
@@ -10,6 +10,9 @@ | |||
10 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | # GNU General Public License for more details. | 11 | # GNU General Public License for more details. |
12 | 12 | ||
13 | obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o | 13 | obj-$(CONFIG_ARCH_BCM_MOBILE) := board_bcm281xx.o board_bcm21664.o \ |
14 | bcm_kona_smc.o bcm_kona_smc_asm.o kona.o | ||
15 | |||
14 | plus_sec := $(call as-instr,.arch_extension sec,+sec) | 16 | plus_sec := $(call as-instr,.arch_extension sec,+sec) |
15 | AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) | 17 | AFLAGS_bcm_kona_smc_asm.o :=-Wa,-march=armv7-a$(plus_sec) |
18 | obj-$(CONFIG_ARCH_BCM_5301X) += bcm_5301x.o | ||
diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c new file mode 100644 index 000000000000..edff69761e04 --- /dev/null +++ b/arch/arm/mach-bcm/bcm_5301x.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Broadcom BCM470X / BCM5301X ARM platform code. | ||
3 | * | ||
4 | * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de> | ||
5 | * | ||
6 | * Licensed under the GNU/GPL. See COPYING for details. | ||
7 | */ | ||
8 | #include <linux/of_platform.h> | ||
9 | #include <asm/hardware/cache-l2x0.h> | ||
10 | |||
11 | #include <asm/mach/arch.h> | ||
12 | #include <asm/siginfo.h> | ||
13 | #include <asm/signal.h> | ||
14 | |||
15 | |||
16 | static bool first_fault = true; | ||
17 | |||
18 | static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr, | ||
19 | struct pt_regs *regs) | ||
20 | { | ||
21 | if (fsr == 0x1c06 && first_fault) { | ||
22 | first_fault = false; | ||
23 | |||
24 | /* | ||
25 | * These faults with code 0x1c06 happens for no good reason, | ||
26 | * possibly left over from the CFE boot loader. | ||
27 | */ | ||
28 | pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n", | ||
29 | addr, fsr); | ||
30 | |||
31 | /* Returning non-zero causes fault display and panic */ | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | /* Others should cause a fault */ | ||
36 | return 1; | ||
37 | } | ||
38 | |||
39 | static void __init bcm5301x_init_early(void) | ||
40 | { | ||
41 | /* Install our hook */ | ||
42 | hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR, | ||
43 | "imprecise external abort"); | ||
44 | } | ||
45 | |||
46 | static void __init bcm5301x_dt_init(void) | ||
47 | { | ||
48 | l2x0_of_init(0, ~0UL); | ||
49 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
50 | } | ||
51 | |||
52 | static const char __initconst *bcm5301x_dt_compat[] = { | ||
53 | "brcm,bcm4708", | ||
54 | NULL, | ||
55 | }; | ||
56 | |||
57 | DT_MACHINE_START(BCM5301X, "BCM5301X") | ||
58 | .init_early = bcm5301x_init_early, | ||
59 | .init_machine = bcm5301x_dt_init, | ||
60 | .dt_compat = bcm5301x_dt_compat, | ||
61 | MACHINE_END | ||
diff --git a/arch/arm/mach-bcm/board_bcm21664.c b/arch/arm/mach-bcm/board_bcm21664.c new file mode 100644 index 000000000000..acc1573fd005 --- /dev/null +++ b/arch/arm/mach-bcm/board_bcm21664.c | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 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 as | ||
6 | * published by the Free Software Foundation version 2. | ||
7 | * | ||
8 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
9 | * kind, whether express or implied; without even the implied warranty | ||
10 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #include <linux/clocksource.h> | ||
15 | #include <linux/of_address.h> | ||
16 | #include <linux/of_platform.h> | ||
17 | |||
18 | #include <asm/mach/arch.h> | ||
19 | |||
20 | #include "bcm_kona_smc.h" | ||
21 | #include "kona.h" | ||
22 | |||
23 | #define RSTMGR_DT_STRING "brcm,bcm21664-resetmgr" | ||
24 | |||
25 | #define RSTMGR_REG_WR_ACCESS_OFFSET 0 | ||
26 | #define RSTMGR_REG_CHIP_SOFT_RST_OFFSET 4 | ||
27 | |||
28 | #define RSTMGR_WR_PASSWORD 0xa5a5 | ||
29 | #define RSTMGR_WR_PASSWORD_SHIFT 8 | ||
30 | #define RSTMGR_WR_ACCESS_ENABLE 1 | ||
31 | |||
32 | static void bcm21664_restart(enum reboot_mode mode, const char *cmd) | ||
33 | { | ||
34 | void __iomem *base; | ||
35 | struct device_node *resetmgr; | ||
36 | |||
37 | resetmgr = of_find_compatible_node(NULL, NULL, RSTMGR_DT_STRING); | ||
38 | if (!resetmgr) { | ||
39 | pr_emerg("Couldn't find " RSTMGR_DT_STRING "\n"); | ||
40 | return; | ||
41 | } | ||
42 | base = of_iomap(resetmgr, 0); | ||
43 | if (!base) { | ||
44 | pr_emerg("Couldn't map " RSTMGR_DT_STRING "\n"); | ||
45 | return; | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * A soft reset is triggered by writing a 0 to bit 0 of the soft reset | ||
50 | * register. To write to that register we must first write the password | ||
51 | * and the enable bit in the write access enable register. | ||
52 | */ | ||
53 | writel((RSTMGR_WR_PASSWORD << RSTMGR_WR_PASSWORD_SHIFT) | | ||
54 | RSTMGR_WR_ACCESS_ENABLE, | ||
55 | base + RSTMGR_REG_WR_ACCESS_OFFSET); | ||
56 | writel(0, base + RSTMGR_REG_CHIP_SOFT_RST_OFFSET); | ||
57 | |||
58 | /* Wait for reset */ | ||
59 | while (1); | ||
60 | } | ||
61 | |||
62 | static void __init bcm21664_init(void) | ||
63 | { | ||
64 | of_platform_populate(NULL, of_default_bus_match_table, NULL, | ||
65 | &platform_bus); | ||
66 | kona_l2_cache_init(); | ||
67 | } | ||
68 | |||
69 | static const char * const bcm21664_dt_compat[] = { | ||
70 | "brcm,bcm21664", | ||
71 | NULL, | ||
72 | }; | ||
73 | |||
74 | DT_MACHINE_START(BCM21664_DT, "BCM21664 Broadcom Application Processor") | ||
75 | .init_machine = bcm21664_init, | ||
76 | .restart = bcm21664_restart, | ||
77 | .dt_compat = bcm21664_dt_compat, | ||
78 | MACHINE_END | ||
diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c index cb3dc364405c..6be54c10f8cb 100644 --- a/arch/arm/mach-bcm/board_bcm281xx.c +++ b/arch/arm/mach-bcm/board_bcm281xx.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2012-2013 Broadcom Corporation | 2 | * Copyright (C) 2012-2014 Broadcom Corporation |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 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 | 5 | * modify it under the terms of the GNU General Public License as |
@@ -11,64 +11,65 @@ | |||
11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/of_platform.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/device.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/clocksource.h> | 14 | #include <linux/clocksource.h> |
15 | #include <linux/of_address.h> | ||
16 | #include <linux/of_platform.h> | ||
19 | 17 | ||
20 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
21 | #include <asm/mach/time.h> | ||
22 | #include <asm/hardware/cache-l2x0.h> | ||
23 | 19 | ||
24 | #include "bcm_kona_smc.h" | ||
25 | #include "kona.h" | 20 | #include "kona.h" |
26 | 21 | ||
27 | static int __init kona_l2_cache_init(void) | 22 | #define SECWDOG_OFFSET 0x00000000 |
23 | #define SECWDOG_RESERVED_MASK 0xe2000000 | ||
24 | #define SECWDOG_WD_LOAD_FLAG_MASK 0x10000000 | ||
25 | #define SECWDOG_EN_MASK 0x08000000 | ||
26 | #define SECWDOG_SRSTEN_MASK 0x04000000 | ||
27 | #define SECWDOG_CLKS_SHIFT 20 | ||
28 | #define SECWDOG_COUNT_SHIFT 0 | ||
29 | |||
30 | static void bcm281xx_restart(enum reboot_mode mode, const char *cmd) | ||
28 | { | 31 | { |
29 | if (!IS_ENABLED(CONFIG_CACHE_L2X0)) | 32 | uint32_t val; |
30 | return 0; | 33 | void __iomem *base; |
34 | struct device_node *np_wdog; | ||
31 | 35 | ||
32 | if (bcm_kona_smc_init() < 0) { | 36 | np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt"); |
33 | pr_info("Kona secure API not available. Skipping L2 init\n"); | 37 | if (!np_wdog) { |
34 | return 0; | 38 | pr_emerg("Couldn't find brcm,kona-wdt\n"); |
39 | return; | ||
40 | } | ||
41 | base = of_iomap(np_wdog, 0); | ||
42 | if (!base) { | ||
43 | pr_emerg("Couldn't map brcm,kona-wdt\n"); | ||
44 | return; | ||
35 | } | 45 | } |
36 | 46 | ||
37 | bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0); | 47 | /* Enable watchdog with short timeout (244us). */ |
38 | 48 | val = readl(base + SECWDOG_OFFSET); | |
39 | /* | 49 | val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK; |
40 | * The aux_val and aux_mask have no effect since L2 cache is already | 50 | val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK | |
41 | * enabled. Pass 0s for aux_val and 1s for aux_mask for default value. | 51 | (0x15 << SECWDOG_CLKS_SHIFT) | |
42 | */ | 52 | (0x8 << SECWDOG_COUNT_SHIFT); |
43 | return l2x0_of_init(0, ~0); | 53 | writel(val, base + SECWDOG_OFFSET); |
44 | } | ||
45 | |||
46 | static void bcm_board_setup_restart(void) | ||
47 | { | ||
48 | struct device_node *np; | ||
49 | 54 | ||
50 | np = of_find_compatible_node(NULL, NULL, "brcm,bcm11351"); | 55 | /* Wait for reset */ |
51 | if (np) { | 56 | while (1); |
52 | if (of_device_is_available(np)) | ||
53 | bcm_kona_setup_restart(); | ||
54 | of_node_put(np); | ||
55 | } | ||
56 | /* Restart setup for other boards goes here */ | ||
57 | } | 57 | } |
58 | 58 | ||
59 | static void __init board_init(void) | 59 | static void __init bcm281xx_init(void) |
60 | { | 60 | { |
61 | of_platform_populate(NULL, of_default_bus_match_table, NULL, | 61 | of_platform_populate(NULL, of_default_bus_match_table, NULL, |
62 | &platform_bus); | 62 | &platform_bus); |
63 | |||
64 | bcm_board_setup_restart(); | ||
65 | kona_l2_cache_init(); | 63 | kona_l2_cache_init(); |
66 | } | 64 | } |
67 | 65 | ||
68 | static const char * const bcm11351_dt_compat[] = { "brcm,bcm11351", NULL, }; | 66 | static const char * const bcm281xx_dt_compat[] = { |
67 | "brcm,bcm11351", /* Have to use the first number upstreamed */ | ||
68 | NULL, | ||
69 | }; | ||
69 | 70 | ||
70 | DT_MACHINE_START(BCM11351_DT, "BCM281xx Broadcom Application Processor") | 71 | DT_MACHINE_START(BCM281XX_DT, "BCM281xx Broadcom Application Processor") |
71 | .init_machine = board_init, | 72 | .init_machine = bcm281xx_init, |
72 | .restart = bcm_kona_restart, | 73 | .restart = bcm281xx_restart, |
73 | .dt_compat = bcm11351_dt_compat, | 74 | .dt_compat = bcm281xx_dt_compat, |
74 | MACHINE_END | 75 | MACHINE_END |
diff --git a/arch/arm/mach-bcm/kona.c b/arch/arm/mach-bcm/kona.c index 6939d9017f63..768bc2837bf5 100644 --- a/arch/arm/mach-bcm/kona.c +++ b/arch/arm/mach-bcm/kona.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2013 Broadcom Corporation | 2 | * Copyright (C) 2012-2014 Broadcom Corporation |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 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 | 5 | * modify it under the terms of the GNU General Public License as |
@@ -11,55 +11,33 @@ | |||
11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/of_address.h> | 14 | #include <linux/of_platform.h> |
15 | #include <asm/io.h> | 15 | #include <asm/hardware/cache-l2x0.h> |
16 | 16 | ||
17 | #include "bcm_kona_smc.h" | ||
17 | #include "kona.h" | 18 | #include "kona.h" |
18 | 19 | ||
19 | static void __iomem *watchdog_base; | 20 | void __init kona_l2_cache_init(void) |
20 | |||
21 | void bcm_kona_setup_restart(void) | ||
22 | { | 21 | { |
23 | struct device_node *np_wdog; | 22 | int ret; |
24 | 23 | ||
25 | /* | 24 | if (!IS_ENABLED(CONFIG_CACHE_L2X0)) |
26 | * The assumption is that whoever calls bcm_kona_setup_restart() | ||
27 | * also needs a Kona Watchdog Timer entry in Device Tree, i.e. we | ||
28 | * report an error if the DT entry is missing. | ||
29 | */ | ||
30 | np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt"); | ||
31 | if (!np_wdog) { | ||
32 | pr_err("brcm,kona-wdt not found in DT, reboot disabled\n"); | ||
33 | return; | 25 | return; |
34 | } | ||
35 | watchdog_base = of_iomap(np_wdog, 0); | ||
36 | WARN(!watchdog_base, "failed to map watchdog base"); | ||
37 | of_node_put(np_wdog); | ||
38 | } | ||
39 | |||
40 | #define SECWDOG_OFFSET 0x00000000 | ||
41 | #define SECWDOG_RESERVED_MASK 0xE2000000 | ||
42 | #define SECWDOG_WD_LOAD_FLAG_MASK 0x10000000 | ||
43 | #define SECWDOG_EN_MASK 0x08000000 | ||
44 | #define SECWDOG_SRSTEN_MASK 0x04000000 | ||
45 | #define SECWDOG_CLKS_SHIFT 20 | ||
46 | #define SECWDOG_LOCK_SHIFT 0 | ||
47 | 26 | ||
48 | void bcm_kona_restart(enum reboot_mode mode, const char *cmd) | 27 | ret = bcm_kona_smc_init(); |
49 | { | 28 | if (ret) { |
50 | uint32_t val; | 29 | pr_info("Secure API not available (%d). Skipping L2 init.\n", |
51 | 30 | ret); | |
52 | if (!watchdog_base) | 31 | return; |
53 | panic("Watchdog not mapped. Reboot failed.\n"); | 32 | } |
54 | 33 | ||
55 | /* Enable watchdog2 with very short timeout. */ | 34 | bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0); |
56 | val = readl(watchdog_base + SECWDOG_OFFSET); | ||
57 | val &= SECWDOG_RESERVED_MASK | SECWDOG_WD_LOAD_FLAG_MASK; | ||
58 | val |= SECWDOG_EN_MASK | SECWDOG_SRSTEN_MASK | | ||
59 | (0x8 << SECWDOG_CLKS_SHIFT) | | ||
60 | (0x8 << SECWDOG_LOCK_SHIFT); | ||
61 | writel(val, watchdog_base + SECWDOG_OFFSET); | ||
62 | 35 | ||
63 | while (1) | 36 | /* |
64 | ; | 37 | * The aux_val and aux_mask have no effect since L2 cache is already |
38 | * enabled. Pass 0s for aux_val and 1s for aux_mask for default value. | ||
39 | */ | ||
40 | ret = l2x0_of_init(0, ~0); | ||
41 | if (ret) | ||
42 | pr_err("Couldn't enable L2 cache: %d\n", ret); | ||
65 | } | 43 | } |
diff --git a/arch/arm/mach-bcm/kona.h b/arch/arm/mach-bcm/kona.h index 291eca3e06ff..3a7a017c29cd 100644 --- a/arch/arm/mach-bcm/kona.h +++ b/arch/arm/mach-bcm/kona.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2013 Broadcom Corporation | 2 | * Copyright (C) 2012-2014 Broadcom Corporation |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 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 | 5 | * modify it under the terms of the GNU General Public License as |
@@ -11,7 +11,4 @@ | |||
11 | * GNU General Public License for more details. | 11 | * GNU General Public License for more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/reboot.h> | 14 | void __init kona_l2_cache_init(void); |
15 | |||
16 | void bcm_kona_setup_restart(void); | ||
17 | void bcm_kona_restart(enum reboot_mode mode, const char *cmd); | ||
diff --git a/arch/arm/mach-bcm2835/Kconfig b/arch/arm/mach-bcm2835/Kconfig index d1f9612f8c15..3a369350a26f 100644 --- a/arch/arm/mach-bcm2835/Kconfig +++ b/arch/arm/mach-bcm2835/Kconfig | |||
@@ -4,10 +4,6 @@ config ARCH_BCM2835 | |||
4 | select ARM_AMBA | 4 | select ARM_AMBA |
5 | select ARM_ERRATA_411920 | 5 | select ARM_ERRATA_411920 |
6 | select ARM_TIMER_SP804 | 6 | select ARM_TIMER_SP804 |
7 | select CLKDEV_LOOKUP | ||
8 | select CLKSRC_OF | ||
9 | select CPU_V6 | ||
10 | select GENERIC_CLOCKEVENTS | ||
11 | select PINCTRL | 7 | select PINCTRL |
12 | select PINCTRL_BCM2835 | 8 | select PINCTRL_BCM2835 |
13 | help | 9 | help |
diff --git a/arch/arm/mach-berlin/Kconfig b/arch/arm/mach-berlin/Kconfig index 7a02d222c378..b0cb0722acd2 100644 --- a/arch/arm/mach-berlin/Kconfig +++ b/arch/arm/mach-berlin/Kconfig | |||
@@ -1,9 +1,7 @@ | |||
1 | config ARCH_BERLIN | 1 | config ARCH_BERLIN |
2 | bool "Marvell Berlin SoCs" if ARCH_MULTI_V7 | 2 | bool "Marvell Berlin SoCs" if ARCH_MULTI_V7 |
3 | select ARM_GIC | 3 | select ARM_GIC |
4 | select GENERIC_CLOCKEVENTS | ||
5 | select GENERIC_IRQ_CHIP | 4 | select GENERIC_IRQ_CHIP |
6 | select COMMON_CLK | ||
7 | select DW_APB_ICTL | 5 | select DW_APB_ICTL |
8 | select DW_APB_TIMER_OF | 6 | select DW_APB_TIMER_OF |
9 | 7 | ||
@@ -16,12 +14,10 @@ config MACH_BERLIN_BG2 | |||
16 | select CACHE_L2X0 | 14 | select CACHE_L2X0 |
17 | select CPU_PJ4B | 15 | select CPU_PJ4B |
18 | select HAVE_ARM_TWD if SMP | 16 | select HAVE_ARM_TWD if SMP |
19 | select HAVE_SMP | ||
20 | 17 | ||
21 | config MACH_BERLIN_BG2CD | 18 | config MACH_BERLIN_BG2CD |
22 | bool "Marvell Armada 1500-mini (BG2CD)" | 19 | bool "Marvell Armada 1500-mini (BG2CD)" |
23 | select CACHE_L2X0 | 20 | select CACHE_L2X0 |
24 | select CPU_V7 | ||
25 | select HAVE_ARM_TWD if SMP | 21 | select HAVE_ARM_TWD if SMP |
26 | 22 | ||
27 | endmenu | 23 | endmenu |
diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c index f8d71a89644a..eb945b2a0042 100644 --- a/arch/arm/mach-clps711x/board-autcpu12.c +++ b/arch/arm/mach-clps711x/board-autcpu12.c | |||
@@ -265,14 +265,12 @@ static void __init autcpu12_init_late(void) | |||
265 | MACHINE_START(AUTCPU12, "autronix autcpu12") | 265 | MACHINE_START(AUTCPU12, "autronix autcpu12") |
266 | /* Maintainer: Thomas Gleixner */ | 266 | /* Maintainer: Thomas Gleixner */ |
267 | .atag_offset = 0x20000, | 267 | .atag_offset = 0x20000, |
268 | .nr_irqs = CLPS711X_NR_IRQS, | ||
269 | .map_io = clps711x_map_io, | 268 | .map_io = clps711x_map_io, |
270 | .init_early = clps711x_init_early, | 269 | .init_early = clps711x_init_early, |
271 | .init_irq = clps711x_init_irq, | 270 | .init_irq = clps711x_init_irq, |
272 | .init_time = clps711x_timer_init, | 271 | .init_time = clps711x_timer_init, |
273 | .init_machine = autcpu12_init, | 272 | .init_machine = autcpu12_init, |
274 | .init_late = autcpu12_init_late, | 273 | .init_late = autcpu12_init_late, |
275 | .handle_irq = clps711x_handle_irq, | ||
276 | .restart = clps711x_restart, | 274 | .restart = clps711x_restart, |
277 | MACHINE_END | 275 | MACHINE_END |
278 | 276 | ||
diff --git a/arch/arm/mach-clps711x/board-cdb89712.c b/arch/arm/mach-clps711x/board-cdb89712.c index a9e38c6bcfb4..e261a47f2aff 100644 --- a/arch/arm/mach-clps711x/board-cdb89712.c +++ b/arch/arm/mach-clps711x/board-cdb89712.c | |||
@@ -139,12 +139,10 @@ static void __init cdb89712_init(void) | |||
139 | MACHINE_START(CDB89712, "Cirrus-CDB89712") | 139 | MACHINE_START(CDB89712, "Cirrus-CDB89712") |
140 | /* Maintainer: Ray Lehtiniemi */ | 140 | /* Maintainer: Ray Lehtiniemi */ |
141 | .atag_offset = 0x100, | 141 | .atag_offset = 0x100, |
142 | .nr_irqs = CLPS711X_NR_IRQS, | ||
143 | .map_io = clps711x_map_io, | 142 | .map_io = clps711x_map_io, |
144 | .init_early = clps711x_init_early, | 143 | .init_early = clps711x_init_early, |
145 | .init_irq = clps711x_init_irq, | 144 | .init_irq = clps711x_init_irq, |
146 | .init_time = clps711x_timer_init, | 145 | .init_time = clps711x_timer_init, |
147 | .init_machine = cdb89712_init, | 146 | .init_machine = cdb89712_init, |
148 | .handle_irq = clps711x_handle_irq, | ||
149 | .restart = clps711x_restart, | 147 | .restart = clps711x_restart, |
150 | MACHINE_END | 148 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/board-clep7312.c b/arch/arm/mach-clps711x/board-clep7312.c index b4764246d0f8..221b9de32dd6 100644 --- a/arch/arm/mach-clps711x/board-clep7312.c +++ b/arch/arm/mach-clps711x/board-clep7312.c | |||
@@ -36,12 +36,10 @@ fixup_clep7312(struct tag *tags, char **cmdline, struct meminfo *mi) | |||
36 | MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") | 36 | MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") |
37 | /* Maintainer: Nobody */ | 37 | /* Maintainer: Nobody */ |
38 | .atag_offset = 0x0100, | 38 | .atag_offset = 0x0100, |
39 | .nr_irqs = CLPS711X_NR_IRQS, | ||
40 | .fixup = fixup_clep7312, | 39 | .fixup = fixup_clep7312, |
41 | .map_io = clps711x_map_io, | 40 | .map_io = clps711x_map_io, |
42 | .init_early = clps711x_init_early, | 41 | .init_early = clps711x_init_early, |
43 | .init_irq = clps711x_init_irq, | 42 | .init_irq = clps711x_init_irq, |
44 | .init_time = clps711x_timer_init, | 43 | .init_time = clps711x_timer_init, |
45 | .handle_irq = clps711x_handle_irq, | ||
46 | .restart = clps711x_restart, | 44 | .restart = clps711x_restart, |
47 | MACHINE_END | 45 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c index fe6184ead896..077609841f14 100644 --- a/arch/arm/mach-clps711x/board-edb7211.c +++ b/arch/arm/mach-clps711x/board-edb7211.c | |||
@@ -177,7 +177,6 @@ static void __init edb7211_init_late(void) | |||
177 | MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") | 177 | MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") |
178 | /* Maintainer: Jon McClintock */ | 178 | /* Maintainer: Jon McClintock */ |
179 | .atag_offset = VIDEORAM_SIZE + 0x100, | 179 | .atag_offset = VIDEORAM_SIZE + 0x100, |
180 | .nr_irqs = CLPS711X_NR_IRQS, | ||
181 | .fixup = fixup_edb7211, | 180 | .fixup = fixup_edb7211, |
182 | .reserve = edb7211_reserve, | 181 | .reserve = edb7211_reserve, |
183 | .map_io = clps711x_map_io, | 182 | .map_io = clps711x_map_io, |
@@ -186,6 +185,5 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") | |||
186 | .init_time = clps711x_timer_init, | 185 | .init_time = clps711x_timer_init, |
187 | .init_machine = edb7211_init, | 186 | .init_machine = edb7211_init, |
188 | .init_late = edb7211_init_late, | 187 | .init_late = edb7211_init_late, |
189 | .handle_irq = clps711x_handle_irq, | ||
190 | .restart = clps711x_restart, | 188 | .restart = clps711x_restart, |
191 | MACHINE_END | 189 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c index dd81b06f68fe..67b733744ed7 100644 --- a/arch/arm/mach-clps711x/board-p720t.c +++ b/arch/arm/mach-clps711x/board-p720t.c | |||
@@ -363,7 +363,6 @@ static void __init p720t_init_late(void) | |||
363 | MACHINE_START(P720T, "ARM-Prospector720T") | 363 | MACHINE_START(P720T, "ARM-Prospector720T") |
364 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ | 364 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ |
365 | .atag_offset = 0x100, | 365 | .atag_offset = 0x100, |
366 | .nr_irqs = CLPS711X_NR_IRQS, | ||
367 | .fixup = fixup_p720t, | 366 | .fixup = fixup_p720t, |
368 | .map_io = clps711x_map_io, | 367 | .map_io = clps711x_map_io, |
369 | .init_early = clps711x_init_early, | 368 | .init_early = clps711x_init_early, |
@@ -371,6 +370,5 @@ MACHINE_START(P720T, "ARM-Prospector720T") | |||
371 | .init_time = clps711x_timer_init, | 370 | .init_time = clps711x_timer_init, |
372 | .init_machine = p720t_init, | 371 | .init_machine = p720t_init, |
373 | .init_late = p720t_init_late, | 372 | .init_late = p720t_init_late, |
374 | .handle_irq = clps711x_handle_irq, | ||
375 | .restart = clps711x_restart, | 373 | .restart = clps711x_restart, |
376 | MACHINE_END | 374 | MACHINE_END |
diff --git a/arch/arm/mach-clps711x/common.c b/arch/arm/mach-clps711x/common.c index a1935911e4f1..aee81fa46ccf 100644 --- a/arch/arm/mach-clps711x/common.c +++ b/arch/arm/mach-clps711x/common.c | |||
@@ -31,14 +31,14 @@ | |||
31 | #include <linux/clk-provider.h> | 31 | #include <linux/clk-provider.h> |
32 | #include <linux/sched_clock.h> | 32 | #include <linux/sched_clock.h> |
33 | 33 | ||
34 | #include <asm/exception.h> | ||
35 | #include <asm/mach/irq.h> | ||
36 | #include <asm/mach/map.h> | 34 | #include <asm/mach/map.h> |
37 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
38 | #include <asm/system_misc.h> | 36 | #include <asm/system_misc.h> |
39 | 37 | ||
40 | #include <mach/hardware.h> | 38 | #include <mach/hardware.h> |
41 | 39 | ||
40 | #include "common.h" | ||
41 | |||
42 | static struct clk *clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh, | 42 | static struct clk *clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh, |
43 | *clk_tint, *clk_spi; | 43 | *clk_tint, *clk_spi; |
44 | 44 | ||
@@ -59,204 +59,9 @@ void __init clps711x_map_io(void) | |||
59 | iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc)); | 59 | iotable_init(clps711x_io_desc, ARRAY_SIZE(clps711x_io_desc)); |
60 | } | 60 | } |
61 | 61 | ||
62 | static void int1_mask(struct irq_data *d) | ||
63 | { | ||
64 | u32 intmr1; | ||
65 | |||
66 | intmr1 = clps_readl(INTMR1); | ||
67 | intmr1 &= ~(1 << d->irq); | ||
68 | clps_writel(intmr1, INTMR1); | ||
69 | } | ||
70 | |||
71 | static void int1_eoi(struct irq_data *d) | ||
72 | { | ||
73 | switch (d->irq) { | ||
74 | case IRQ_CSINT: clps_writel(0, COEOI); break; | ||
75 | case IRQ_TC1OI: clps_writel(0, TC1EOI); break; | ||
76 | case IRQ_TC2OI: clps_writel(0, TC2EOI); break; | ||
77 | case IRQ_RTCMI: clps_writel(0, RTCEOI); break; | ||
78 | case IRQ_TINT: clps_writel(0, TEOI); break; | ||
79 | case IRQ_UMSINT: clps_writel(0, UMSEOI); break; | ||
80 | } | ||
81 | } | ||
82 | |||
83 | static void int1_unmask(struct irq_data *d) | ||
84 | { | ||
85 | u32 intmr1; | ||
86 | |||
87 | intmr1 = clps_readl(INTMR1); | ||
88 | intmr1 |= 1 << d->irq; | ||
89 | clps_writel(intmr1, INTMR1); | ||
90 | } | ||
91 | |||
92 | static struct irq_chip int1_chip = { | ||
93 | .name = "Interrupt Vector 1", | ||
94 | .irq_eoi = int1_eoi, | ||
95 | .irq_mask = int1_mask, | ||
96 | .irq_unmask = int1_unmask, | ||
97 | }; | ||
98 | |||
99 | static void int2_mask(struct irq_data *d) | ||
100 | { | ||
101 | u32 intmr2; | ||
102 | |||
103 | intmr2 = clps_readl(INTMR2); | ||
104 | intmr2 &= ~(1 << (d->irq - 16)); | ||
105 | clps_writel(intmr2, INTMR2); | ||
106 | } | ||
107 | |||
108 | static void int2_eoi(struct irq_data *d) | ||
109 | { | ||
110 | switch (d->irq) { | ||
111 | case IRQ_KBDINT: clps_writel(0, KBDEOI); break; | ||
112 | } | ||
113 | } | ||
114 | |||
115 | static void int2_unmask(struct irq_data *d) | ||
116 | { | ||
117 | u32 intmr2; | ||
118 | |||
119 | intmr2 = clps_readl(INTMR2); | ||
120 | intmr2 |= 1 << (d->irq - 16); | ||
121 | clps_writel(intmr2, INTMR2); | ||
122 | } | ||
123 | |||
124 | static struct irq_chip int2_chip = { | ||
125 | .name = "Interrupt Vector 2", | ||
126 | .irq_eoi = int2_eoi, | ||
127 | .irq_mask = int2_mask, | ||
128 | .irq_unmask = int2_unmask, | ||
129 | }; | ||
130 | |||
131 | static void int3_mask(struct irq_data *d) | ||
132 | { | ||
133 | u32 intmr3; | ||
134 | |||
135 | intmr3 = clps_readl(INTMR3); | ||
136 | intmr3 &= ~(1 << (d->irq - 32)); | ||
137 | clps_writel(intmr3, INTMR3); | ||
138 | } | ||
139 | |||
140 | static void int3_unmask(struct irq_data *d) | ||
141 | { | ||
142 | u32 intmr3; | ||
143 | |||
144 | intmr3 = clps_readl(INTMR3); | ||
145 | intmr3 |= 1 << (d->irq - 32); | ||
146 | clps_writel(intmr3, INTMR3); | ||
147 | } | ||
148 | |||
149 | static struct irq_chip int3_chip = { | ||
150 | .name = "Interrupt Vector 3", | ||
151 | .irq_mask = int3_mask, | ||
152 | .irq_unmask = int3_unmask, | ||
153 | }; | ||
154 | |||
155 | static struct { | ||
156 | int nr; | ||
157 | struct irq_chip *chip; | ||
158 | irq_flow_handler_t handle; | ||
159 | } clps711x_irqdescs[] __initdata = { | ||
160 | { IRQ_CSINT, &int1_chip, handle_fasteoi_irq, }, | ||
161 | { IRQ_EINT1, &int1_chip, handle_level_irq, }, | ||
162 | { IRQ_EINT2, &int1_chip, handle_level_irq, }, | ||
163 | { IRQ_EINT3, &int1_chip, handle_level_irq, }, | ||
164 | { IRQ_TC1OI, &int1_chip, handle_fasteoi_irq, }, | ||
165 | { IRQ_TC2OI, &int1_chip, handle_fasteoi_irq, }, | ||
166 | { IRQ_RTCMI, &int1_chip, handle_fasteoi_irq, }, | ||
167 | { IRQ_TINT, &int1_chip, handle_fasteoi_irq, }, | ||
168 | { IRQ_UTXINT1, &int1_chip, handle_level_irq, }, | ||
169 | { IRQ_URXINT1, &int1_chip, handle_level_irq, }, | ||
170 | { IRQ_UMSINT, &int1_chip, handle_fasteoi_irq, }, | ||
171 | { IRQ_SSEOTI, &int1_chip, handle_level_irq, }, | ||
172 | { IRQ_KBDINT, &int2_chip, handle_fasteoi_irq, }, | ||
173 | { IRQ_SS2RX, &int2_chip, handle_level_irq, }, | ||
174 | { IRQ_SS2TX, &int2_chip, handle_level_irq, }, | ||
175 | { IRQ_UTXINT2, &int2_chip, handle_level_irq, }, | ||
176 | { IRQ_URXINT2, &int2_chip, handle_level_irq, }, | ||
177 | }; | ||
178 | |||
179 | void __init clps711x_init_irq(void) | 62 | void __init clps711x_init_irq(void) |
180 | { | 63 | { |
181 | unsigned int i; | 64 | clps711x_intc_init(CLPS711X_PHYS_BASE, SZ_16K); |
182 | |||
183 | /* Disable interrupts */ | ||
184 | clps_writel(0, INTMR1); | ||
185 | clps_writel(0, INTMR2); | ||
186 | clps_writel(0, INTMR3); | ||
187 | |||
188 | /* Clear down any pending interrupts */ | ||
189 | clps_writel(0, BLEOI); | ||
190 | clps_writel(0, MCEOI); | ||
191 | clps_writel(0, COEOI); | ||
192 | clps_writel(0, TC1EOI); | ||
193 | clps_writel(0, TC2EOI); | ||
194 | clps_writel(0, RTCEOI); | ||
195 | clps_writel(0, TEOI); | ||
196 | clps_writel(0, UMSEOI); | ||
197 | clps_writel(0, KBDEOI); | ||
198 | clps_writel(0, SRXEOF); | ||
199 | clps_writel(0xffffffff, DAISR); | ||
200 | |||
201 | for (i = 0; i < ARRAY_SIZE(clps711x_irqdescs); i++) { | ||
202 | irq_set_chip_and_handler(clps711x_irqdescs[i].nr, | ||
203 | clps711x_irqdescs[i].chip, | ||
204 | clps711x_irqdescs[i].handle); | ||
205 | set_irq_flags(clps711x_irqdescs[i].nr, | ||
206 | IRQF_VALID | IRQF_PROBE); | ||
207 | } | ||
208 | |||
209 | if (IS_ENABLED(CONFIG_FIQ)) { | ||
210 | init_FIQ(0); | ||
211 | irq_set_chip_and_handler(IRQ_DAIINT, &int3_chip, | ||
212 | handle_bad_irq); | ||
213 | set_irq_flags(IRQ_DAIINT, | ||
214 | IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN); | ||
215 | } | ||
216 | } | ||
217 | |||
218 | static inline u32 fls16(u32 x) | ||
219 | { | ||
220 | u32 r = 15; | ||
221 | |||
222 | if (!(x & 0xff00)) { | ||
223 | x <<= 8; | ||
224 | r -= 8; | ||
225 | } | ||
226 | if (!(x & 0xf000)) { | ||
227 | x <<= 4; | ||
228 | r -= 4; | ||
229 | } | ||
230 | if (!(x & 0xc000)) { | ||
231 | x <<= 2; | ||
232 | r -= 2; | ||
233 | } | ||
234 | if (!(x & 0x8000)) | ||
235 | r--; | ||
236 | |||
237 | return r; | ||
238 | } | ||
239 | |||
240 | asmlinkage void __exception_irq_entry clps711x_handle_irq(struct pt_regs *regs) | ||
241 | { | ||
242 | do { | ||
243 | u32 irqstat; | ||
244 | void __iomem *base = CLPS711X_VIRT_BASE; | ||
245 | |||
246 | irqstat = readw_relaxed(base + INTSR1) & | ||
247 | readw_relaxed(base + INTMR1); | ||
248 | if (irqstat) | ||
249 | handle_IRQ(fls16(irqstat), regs); | ||
250 | |||
251 | irqstat = readw_relaxed(base + INTSR2) & | ||
252 | readw_relaxed(base + INTMR2); | ||
253 | if (irqstat) { | ||
254 | handle_IRQ(fls16(irqstat) + 16, regs); | ||
255 | continue; | ||
256 | } | ||
257 | |||
258 | break; | ||
259 | } while (1); | ||
260 | } | 65 | } |
261 | 66 | ||
262 | static u64 notrace clps711x_sched_clock_read(void) | 67 | static u64 notrace clps711x_sched_clock_read(void) |
diff --git a/arch/arm/mach-clps711x/common.h b/arch/arm/mach-clps711x/common.h index 9a6767bfdc47..7489139d5d63 100644 --- a/arch/arm/mach-clps711x/common.h +++ b/arch/arm/mach-clps711x/common.h | |||
@@ -6,13 +6,14 @@ | |||
6 | 6 | ||
7 | #include <linux/reboot.h> | 7 | #include <linux/reboot.h> |
8 | 8 | ||
9 | #define CLPS711X_NR_IRQS (33) | ||
10 | #define CLPS711X_NR_GPIO (4 * 8 + 3) | 9 | #define CLPS711X_NR_GPIO (4 * 8 + 3) |
11 | #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) | 10 | #define CLPS711X_GPIO(prt, bit) ((prt) * 8 + (bit)) |
12 | 11 | ||
13 | extern void clps711x_map_io(void); | 12 | extern void clps711x_map_io(void); |
14 | extern void clps711x_init_irq(void); | 13 | extern void clps711x_init_irq(void); |
15 | extern void clps711x_timer_init(void); | 14 | extern void clps711x_timer_init(void); |
16 | extern void clps711x_handle_irq(struct pt_regs *regs); | ||
17 | extern void clps711x_restart(enum reboot_mode mode, const char *cmd); | 15 | extern void clps711x_restart(enum reboot_mode mode, const char *cmd); |
18 | extern void clps711x_init_early(void); | 16 | extern void clps711x_init_early(void); |
17 | |||
18 | /* drivers/irqchip/irq-clps711x.c */ | ||
19 | void clps711x_intc_init(phys_addr_t, resource_size_t); | ||
diff --git a/arch/arm/mach-clps711x/include/mach/clps711x.h b/arch/arm/mach-clps711x/include/mach/clps711x.h index 0286f4bf9945..eb052a11aa9d 100644 --- a/arch/arm/mach-clps711x/include/mach/clps711x.h +++ b/arch/arm/mach-clps711x/include/mach/clps711x.h | |||
@@ -40,8 +40,6 @@ | |||
40 | #define MEMCFG1 (0x0180) | 40 | #define MEMCFG1 (0x0180) |
41 | #define MEMCFG2 (0x01c0) | 41 | #define MEMCFG2 (0x01c0) |
42 | #define DRFPR (0x0200) | 42 | #define DRFPR (0x0200) |
43 | #define INTSR1 (0x0240) | ||
44 | #define INTMR1 (0x0280) | ||
45 | #define LCDCON (0x02c0) | 43 | #define LCDCON (0x02c0) |
46 | #define TC1D (0x0300) | 44 | #define TC1D (0x0300) |
47 | #define TC2D (0x0340) | 45 | #define TC2D (0x0340) |
@@ -55,28 +53,16 @@ | |||
55 | #define PALLSW (0x0540) | 53 | #define PALLSW (0x0540) |
56 | #define PALMSW (0x0580) | 54 | #define PALMSW (0x0580) |
57 | #define STFCLR (0x05c0) | 55 | #define STFCLR (0x05c0) |
58 | #define BLEOI (0x0600) | ||
59 | #define MCEOI (0x0640) | ||
60 | #define TEOI (0x0680) | ||
61 | #define TC1EOI (0x06c0) | ||
62 | #define TC2EOI (0x0700) | ||
63 | #define RTCEOI (0x0740) | ||
64 | #define UMSEOI (0x0780) | ||
65 | #define COEOI (0x07c0) | ||
66 | #define HALT (0x0800) | 56 | #define HALT (0x0800) |
67 | #define STDBY (0x0840) | 57 | #define STDBY (0x0840) |
68 | 58 | ||
69 | #define FBADDR (0x1000) | 59 | #define FBADDR (0x1000) |
70 | #define SYSCON2 (0x1100) | 60 | #define SYSCON2 (0x1100) |
71 | #define SYSFLG2 (0x1140) | 61 | #define SYSFLG2 (0x1140) |
72 | #define INTSR2 (0x1240) | ||
73 | #define INTMR2 (0x1280) | ||
74 | #define UARTDR2 (0x1480) | 62 | #define UARTDR2 (0x1480) |
75 | #define UBRLCR2 (0x14c0) | 63 | #define UBRLCR2 (0x14c0) |
76 | #define SS2DR (0x1500) | 64 | #define SS2DR (0x1500) |
77 | #define SRXEOF (0x1600) | ||
78 | #define SS2POP (0x16c0) | 65 | #define SS2POP (0x16c0) |
79 | #define KBDEOI (0x1700) | ||
80 | 66 | ||
81 | #define DAIR (0x2000) | 67 | #define DAIR (0x2000) |
82 | #define DAIDR0 (0x2040) | 68 | #define DAIDR0 (0x2040) |
@@ -84,8 +70,6 @@ | |||
84 | #define DAIDR2 (0x20c0) | 70 | #define DAIDR2 (0x20c0) |
85 | #define DAISR (0x2100) | 71 | #define DAISR (0x2100) |
86 | #define SYSCON3 (0x2200) | 72 | #define SYSCON3 (0x2200) |
87 | #define INTSR3 (0x2240) | ||
88 | #define INTMR3 (0x2280) | ||
89 | #define LEDFLSH (0x22c0) | 73 | #define LEDFLSH (0x22c0) |
90 | #define SDCONF (0x2300) | 74 | #define SDCONF (0x2300) |
91 | #define SDRFPR (0x2340) | 75 | #define SDRFPR (0x2340) |
diff --git a/arch/arm/mach-cns3xxx/Kconfig b/arch/arm/mach-cns3xxx/Kconfig index dbf0df8bb0ac..dce8decd5d46 100644 --- a/arch/arm/mach-cns3xxx/Kconfig +++ b/arch/arm/mach-cns3xxx/Kconfig | |||
@@ -1,9 +1,6 @@ | |||
1 | config ARCH_CNS3XXX | 1 | config ARCH_CNS3XXX |
2 | bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6 | 2 | bool "Cavium Networks CNS3XXX family" if ARCH_MULTI_V6 |
3 | select ARM_GIC | 3 | select ARM_GIC |
4 | select CPU_V6K | ||
5 | select GENERIC_CLOCKEVENTS | ||
6 | select MIGHT_HAVE_CACHE_L2X0 | ||
7 | select MIGHT_HAVE_PCI | 4 | select MIGHT_HAVE_PCI |
8 | select PCI_DOMAINS if PCI | 5 | select PCI_DOMAINS if PCI |
9 | help | 6 | help |
diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig index a075b3e0c5c7..3b98e348d8d5 100644 --- a/arch/arm/mach-davinci/Kconfig +++ b/arch/arm/mach-davinci/Kconfig | |||
@@ -51,11 +51,6 @@ config ARCH_DAVINCI_DM365 | |||
51 | select AINTC | 51 | select AINTC |
52 | select ARCH_DAVINCI_DMx | 52 | select ARCH_DAVINCI_DMx |
53 | 53 | ||
54 | config ARCH_DAVINCI_TNETV107X | ||
55 | bool "TNETV107X based system" | ||
56 | select CPU_V6 | ||
57 | select CP_INTC | ||
58 | |||
59 | comment "DaVinci Board Type" | 54 | comment "DaVinci Board Type" |
60 | 55 | ||
61 | config MACH_DA8XX_DT | 56 | config MACH_DA8XX_DT |
@@ -220,13 +215,6 @@ config GPIO_PCA953X | |||
220 | config KEYBOARD_GPIO_POLLED | 215 | config KEYBOARD_GPIO_POLLED |
221 | default MACH_DAVINCI_DA850_EVM | 216 | default MACH_DAVINCI_DA850_EVM |
222 | 217 | ||
223 | config MACH_TNETV107X | ||
224 | bool "TI TNETV107X Reference Platform" | ||
225 | default ARCH_DAVINCI_TNETV107X | ||
226 | depends on ARCH_DAVINCI_TNETV107X | ||
227 | help | ||
228 | Say Y here to select the TI TNETV107X Evaluation Module. | ||
229 | |||
230 | config MACH_MITYOMAPL138 | 218 | config MACH_MITYOMAPL138 |
231 | bool "Critical Link MityDSP-L138/MityARM-1808 SoM" | 219 | bool "Critical Link MityDSP-L138/MityARM-1808 SoM" |
232 | depends on ARCH_DAVINCI_DA850 | 220 | depends on ARCH_DAVINCI_DA850 |
diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 63997a1128e6..2204239ed243 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile | |||
@@ -16,7 +16,6 @@ obj-$(CONFIG_ARCH_DAVINCI_DM646x) += dm646x.o devices.o | |||
16 | obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o | 16 | obj-$(CONFIG_ARCH_DAVINCI_DM365) += dm365.o devices.o |
17 | obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o | 17 | obj-$(CONFIG_ARCH_DAVINCI_DA830) += da830.o devices-da8xx.o |
18 | obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o | 18 | obj-$(CONFIG_ARCH_DAVINCI_DA850) += da850.o devices-da8xx.o |
19 | obj-$(CONFIG_ARCH_DAVINCI_TNETV107X) += tnetv107x.o devices-tnetv107x.o | ||
20 | 19 | ||
21 | obj-$(CONFIG_AINTC) += irq.o | 20 | obj-$(CONFIG_AINTC) += irq.o |
22 | obj-$(CONFIG_CP_INTC) += cp_intc.o | 21 | obj-$(CONFIG_CP_INTC) += cp_intc.o |
@@ -32,7 +31,6 @@ obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM) += board-dm646x-evm.o cdce949.o | |||
32 | obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o | 31 | obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o |
33 | obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o | 32 | obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o |
34 | obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o | 33 | obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o |
35 | obj-$(CONFIG_MACH_TNETV107X) += board-tnetv107x-evm.o | ||
36 | obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o | 34 | obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o |
37 | obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o | 35 | obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o |
38 | 36 | ||
diff --git a/arch/arm/mach-davinci/Makefile.boot b/arch/arm/mach-davinci/Makefile.boot index 04a6c4e67b14..4b81601754a2 100644 --- a/arch/arm/mach-davinci/Makefile.boot +++ b/arch/arm/mach-davinci/Makefile.boot | |||
@@ -1,13 +1,7 @@ | |||
1 | ifeq ($(CONFIG_ARCH_DAVINCI_DA8XX),y) | 1 | zreladdr-$(CONFIG_ARCH_DAVINCI_DA8XX) += 0xc0008000 |
2 | ifeq ($(CONFIG_ARCH_DAVINCI_DMx),y) | 2 | params_phys-$(CONFIG_ARCH_DAVINCI_DA8XX) := 0xc0000100 |
3 | $(error Cannot enable DaVinci and DA8XX platforms concurrently) | 3 | initrd_phys-$(CONFIG_ARCH_DAVINCI_DA8XX) := 0xc0800000 |
4 | else | 4 | |
5 | zreladdr-y += 0xc0008000 | 5 | zreladdr-$(CONFIG_ARCH_DAVINCI_DMx) += 0x80008000 |
6 | params_phys-y := 0xc0000100 | 6 | params_phys-$(CONFIG_ARCH_DAVINCI_DMx) := 0x80000100 |
7 | initrd_phys-y := 0xc0800000 | 7 | initrd_phys-$(CONFIG_ARCH_DAVINCI_DMx) := 0x80800000 |
8 | endif | ||
9 | else | ||
10 | zreladdr-y += 0x80008000 | ||
11 | params_phys-y := 0x80000100 | ||
12 | initrd_phys-y := 0x80800000 | ||
13 | endif | ||
diff --git a/arch/arm/mach-davinci/board-tnetv107x-evm.c b/arch/arm/mach-davinci/board-tnetv107x-evm.c deleted file mode 100644 index 78ea395d2aca..000000000000 --- a/arch/arm/mach-davinci/board-tnetv107x-evm.c +++ /dev/null | |||
@@ -1,287 +0,0 @@ | |||
1 | /* | ||
2 | * Texas Instruments TNETV107X EVM Board Support | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/console.h> | ||
18 | #include <linux/dma-mapping.h> | ||
19 | #include <linux/interrupt.h> | ||
20 | #include <linux/gpio.h> | ||
21 | #include <linux/delay.h> | ||
22 | #include <linux/platform_device.h> | ||
23 | #include <linux/ratelimit.h> | ||
24 | #include <linux/mtd/mtd.h> | ||
25 | #include <linux/mtd/partitions.h> | ||
26 | #include <linux/input.h> | ||
27 | #include <linux/input/matrix_keypad.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/platform_data/edma.h> | ||
30 | |||
31 | #include <asm/mach/arch.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | |||
34 | #include <mach/irqs.h> | ||
35 | #include <mach/mux.h> | ||
36 | #include <mach/cp_intc.h> | ||
37 | #include <mach/tnetv107x.h> | ||
38 | |||
39 | #define EVM_MMC_WP_GPIO 21 | ||
40 | #define EVM_MMC_CD_GPIO 24 | ||
41 | #define EVM_SPI_CS_GPIO 54 | ||
42 | |||
43 | static int initialize_gpio(int gpio, char *desc) | ||
44 | { | ||
45 | int ret; | ||
46 | |||
47 | ret = gpio_request(gpio, desc); | ||
48 | if (ret < 0) { | ||
49 | pr_err_ratelimited("cannot open %s gpio\n", desc); | ||
50 | return -ENOSYS; | ||
51 | } | ||
52 | gpio_direction_input(gpio); | ||
53 | return gpio; | ||
54 | } | ||
55 | |||
56 | static int mmc_get_cd(int index) | ||
57 | { | ||
58 | static int gpio; | ||
59 | |||
60 | if (!gpio) | ||
61 | gpio = initialize_gpio(EVM_MMC_CD_GPIO, "mmc card detect"); | ||
62 | |||
63 | if (gpio < 0) | ||
64 | return gpio; | ||
65 | |||
66 | return gpio_get_value(gpio) ? 0 : 1; | ||
67 | } | ||
68 | |||
69 | static int mmc_get_ro(int index) | ||
70 | { | ||
71 | static int gpio; | ||
72 | |||
73 | if (!gpio) | ||
74 | gpio = initialize_gpio(EVM_MMC_WP_GPIO, "mmc write protect"); | ||
75 | |||
76 | if (gpio < 0) | ||
77 | return gpio; | ||
78 | |||
79 | return gpio_get_value(gpio) ? 1 : 0; | ||
80 | } | ||
81 | |||
82 | static struct davinci_mmc_config mmc_config = { | ||
83 | .get_cd = mmc_get_cd, | ||
84 | .get_ro = mmc_get_ro, | ||
85 | .wires = 4, | ||
86 | .max_freq = 50000000, | ||
87 | .caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED, | ||
88 | }; | ||
89 | |||
90 | static const short sdio1_pins[] __initconst = { | ||
91 | TNETV107X_SDIO1_CLK_1, TNETV107X_SDIO1_CMD_1, | ||
92 | TNETV107X_SDIO1_DATA0_1, TNETV107X_SDIO1_DATA1_1, | ||
93 | TNETV107X_SDIO1_DATA2_1, TNETV107X_SDIO1_DATA3_1, | ||
94 | TNETV107X_GPIO21, TNETV107X_GPIO24, | ||
95 | -1 | ||
96 | }; | ||
97 | |||
98 | static const short uart1_pins[] __initconst = { | ||
99 | TNETV107X_UART1_RD, TNETV107X_UART1_TD, | ||
100 | -1 | ||
101 | }; | ||
102 | |||
103 | static const short ssp_pins[] __initconst = { | ||
104 | TNETV107X_SSP0_0, TNETV107X_SSP0_1, TNETV107X_SSP0_2, | ||
105 | TNETV107X_SSP1_0, TNETV107X_SSP1_1, TNETV107X_SSP1_2, | ||
106 | TNETV107X_SSP1_3, -1 | ||
107 | }; | ||
108 | |||
109 | static struct mtd_partition nand_partitions[] = { | ||
110 | /* bootloader (U-Boot, etc) in first 12 sectors */ | ||
111 | { | ||
112 | .name = "bootloader", | ||
113 | .offset = 0, | ||
114 | .size = (12*SZ_128K), | ||
115 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
116 | }, | ||
117 | /* bootloader params in the next sector */ | ||
118 | { | ||
119 | .name = "params", | ||
120 | .offset = MTDPART_OFS_NXTBLK, | ||
121 | .size = SZ_128K, | ||
122 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
123 | }, | ||
124 | /* kernel */ | ||
125 | { | ||
126 | .name = "kernel", | ||
127 | .offset = MTDPART_OFS_NXTBLK, | ||
128 | .size = SZ_4M, | ||
129 | .mask_flags = 0, | ||
130 | }, | ||
131 | /* file system */ | ||
132 | { | ||
133 | .name = "filesystem", | ||
134 | .offset = MTDPART_OFS_NXTBLK, | ||
135 | .size = MTDPART_SIZ_FULL, | ||
136 | .mask_flags = 0, | ||
137 | } | ||
138 | }; | ||
139 | |||
140 | static struct davinci_nand_pdata nand_config = { | ||
141 | .mask_cle = 0x4000, | ||
142 | .mask_ale = 0x2000, | ||
143 | .parts = nand_partitions, | ||
144 | .nr_parts = ARRAY_SIZE(nand_partitions), | ||
145 | .ecc_mode = NAND_ECC_HW, | ||
146 | .bbt_options = NAND_BBT_USE_FLASH, | ||
147 | .ecc_bits = 1, | ||
148 | }; | ||
149 | |||
150 | static struct davinci_uart_config serial_config __initconst = { | ||
151 | .enabled_uarts = BIT(1), | ||
152 | }; | ||
153 | |||
154 | static const uint32_t keymap[] = { | ||
155 | KEY(0, 0, KEY_NUMERIC_1), | ||
156 | KEY(0, 1, KEY_NUMERIC_2), | ||
157 | KEY(0, 2, KEY_NUMERIC_3), | ||
158 | KEY(0, 3, KEY_FN_F1), | ||
159 | KEY(0, 4, KEY_MENU), | ||
160 | |||
161 | KEY(1, 0, KEY_NUMERIC_4), | ||
162 | KEY(1, 1, KEY_NUMERIC_5), | ||
163 | KEY(1, 2, KEY_NUMERIC_6), | ||
164 | KEY(1, 3, KEY_UP), | ||
165 | KEY(1, 4, KEY_FN_F2), | ||
166 | |||
167 | KEY(2, 0, KEY_NUMERIC_7), | ||
168 | KEY(2, 1, KEY_NUMERIC_8), | ||
169 | KEY(2, 2, KEY_NUMERIC_9), | ||
170 | KEY(2, 3, KEY_LEFT), | ||
171 | KEY(2, 4, KEY_ENTER), | ||
172 | |||
173 | KEY(3, 0, KEY_NUMERIC_STAR), | ||
174 | KEY(3, 1, KEY_NUMERIC_0), | ||
175 | KEY(3, 2, KEY_NUMERIC_POUND), | ||
176 | KEY(3, 3, KEY_DOWN), | ||
177 | KEY(3, 4, KEY_RIGHT), | ||
178 | |||
179 | KEY(4, 0, KEY_FN_F3), | ||
180 | KEY(4, 1, KEY_FN_F4), | ||
181 | KEY(4, 2, KEY_MUTE), | ||
182 | KEY(4, 3, KEY_HOME), | ||
183 | KEY(4, 4, KEY_BACK), | ||
184 | |||
185 | KEY(5, 0, KEY_VOLUMEDOWN), | ||
186 | KEY(5, 1, KEY_VOLUMEUP), | ||
187 | KEY(5, 2, KEY_F1), | ||
188 | KEY(5, 3, KEY_F2), | ||
189 | KEY(5, 4, KEY_F3), | ||
190 | }; | ||
191 | |||
192 | static const struct matrix_keymap_data keymap_data = { | ||
193 | .keymap = keymap, | ||
194 | .keymap_size = ARRAY_SIZE(keymap), | ||
195 | }; | ||
196 | |||
197 | static struct matrix_keypad_platform_data keypad_config = { | ||
198 | .keymap_data = &keymap_data, | ||
199 | .num_row_gpios = 6, | ||
200 | .num_col_gpios = 5, | ||
201 | .debounce_ms = 0, /* minimum */ | ||
202 | .active_low = 0, /* pull up realization */ | ||
203 | .no_autorepeat = 0, | ||
204 | }; | ||
205 | |||
206 | static void spi_select_device(int cs) | ||
207 | { | ||
208 | static int gpio; | ||
209 | |||
210 | if (!gpio) { | ||
211 | int ret; | ||
212 | ret = gpio_request(EVM_SPI_CS_GPIO, "spi chipsel"); | ||
213 | if (ret < 0) { | ||
214 | pr_err("cannot open spi chipsel gpio\n"); | ||
215 | gpio = -ENOSYS; | ||
216 | return; | ||
217 | } else { | ||
218 | gpio = EVM_SPI_CS_GPIO; | ||
219 | gpio_direction_output(gpio, 0); | ||
220 | } | ||
221 | } | ||
222 | |||
223 | if (gpio < 0) | ||
224 | return; | ||
225 | |||
226 | return gpio_set_value(gpio, cs ? 1 : 0); | ||
227 | } | ||
228 | |||
229 | static struct ti_ssp_spi_data spi_master_data = { | ||
230 | .num_cs = 2, | ||
231 | .select = spi_select_device, | ||
232 | .iosel = SSP_PIN_SEL(0, SSP_CLOCK) | SSP_PIN_SEL(1, SSP_DATA) | | ||
233 | SSP_PIN_SEL(2, SSP_CHIPSEL) | SSP_PIN_SEL(3, SSP_IN) | | ||
234 | SSP_INPUT_SEL(3), | ||
235 | }; | ||
236 | |||
237 | static struct ti_ssp_data ssp_config = { | ||
238 | .out_clock = 250 * 1000, | ||
239 | .dev_data = { | ||
240 | [1] = { | ||
241 | .dev_name = "ti-ssp-spi", | ||
242 | .pdata = &spi_master_data, | ||
243 | .pdata_size = sizeof(spi_master_data), | ||
244 | }, | ||
245 | }, | ||
246 | }; | ||
247 | |||
248 | static struct tnetv107x_device_info evm_device_info __initconst = { | ||
249 | .serial_config = &serial_config, | ||
250 | .mmc_config[1] = &mmc_config, /* controller 1 */ | ||
251 | .nand_config[0] = &nand_config, /* chip select 0 */ | ||
252 | .keypad_config = &keypad_config, | ||
253 | .ssp_config = &ssp_config, | ||
254 | }; | ||
255 | |||
256 | static struct spi_board_info spi_info[] __initconst = { | ||
257 | }; | ||
258 | |||
259 | static __init void tnetv107x_evm_board_init(void) | ||
260 | { | ||
261 | davinci_cfg_reg_list(sdio1_pins); | ||
262 | davinci_cfg_reg_list(uart1_pins); | ||
263 | davinci_cfg_reg_list(ssp_pins); | ||
264 | |||
265 | tnetv107x_devices_init(&evm_device_info); | ||
266 | |||
267 | spi_register_board_info(spi_info, ARRAY_SIZE(spi_info)); | ||
268 | } | ||
269 | |||
270 | #ifdef CONFIG_SERIAL_8250_CONSOLE | ||
271 | static int __init tnetv107x_evm_console_init(void) | ||
272 | { | ||
273 | return add_preferred_console("ttyS", 0, "115200"); | ||
274 | } | ||
275 | console_initcall(tnetv107x_evm_console_init); | ||
276 | #endif | ||
277 | |||
278 | MACHINE_START(TNETV107X, "TNETV107X EVM") | ||
279 | .atag_offset = 0x100, | ||
280 | .map_io = tnetv107x_init, | ||
281 | .init_irq = cp_intc_init, | ||
282 | .init_time = davinci_timer_init, | ||
283 | .init_machine = tnetv107x_evm_board_init, | ||
284 | .init_late = davinci_init_late, | ||
285 | .dma_zone_size = SZ_128M, | ||
286 | .restart = tnetv107x_restart, | ||
287 | MACHINE_END | ||
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h index 2eebc4338802..4ffc37accce0 100644 --- a/arch/arm/mach-davinci/davinci.h +++ b/arch/arm/mach-davinci/davinci.h | |||
@@ -79,6 +79,8 @@ int davinci_gpio_register(struct resource *res, int size, void *pdata); | |||
79 | #define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 | 79 | #define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 |
80 | #define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 | 80 | #define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 |
81 | 81 | ||
82 | int davinci_init_wdt(void); | ||
83 | |||
82 | /* DM355 function declarations */ | 84 | /* DM355 function declarations */ |
83 | void dm355_init(void); | 85 | void dm355_init(void); |
84 | void dm355_init_spi0(unsigned chipselect_mask, | 86 | void dm355_init_spi0(unsigned chipselect_mask, |
diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c b/arch/arm/mach-davinci/devices-tnetv107x.c deleted file mode 100644 index 01d8686e553c..000000000000 --- a/arch/arm/mach-davinci/devices-tnetv107x.c +++ /dev/null | |||
@@ -1,434 +0,0 @@ | |||
1 | /* | ||
2 | * Texas Instruments TNETV107X SoC devices | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/dma-mapping.h> | ||
19 | #include <linux/clk.h> | ||
20 | #include <linux/slab.h> | ||
21 | #include <linux/platform_data/edma.h> | ||
22 | |||
23 | #include <mach/common.h> | ||
24 | #include <mach/irqs.h> | ||
25 | #include <mach/tnetv107x.h> | ||
26 | |||
27 | #include "clock.h" | ||
28 | |||
29 | /* Base addresses for on-chip devices */ | ||
30 | #define TNETV107X_TPCC_BASE 0x01c00000 | ||
31 | #define TNETV107X_TPTC0_BASE 0x01c10000 | ||
32 | #define TNETV107X_TPTC1_BASE 0x01c10400 | ||
33 | #define TNETV107X_WDOG_BASE 0x08086700 | ||
34 | #define TNETV107X_TSC_BASE 0x08088500 | ||
35 | #define TNETV107X_SDIO0_BASE 0x08088700 | ||
36 | #define TNETV107X_SDIO1_BASE 0x08088800 | ||
37 | #define TNETV107X_KEYPAD_BASE 0x08088a00 | ||
38 | #define TNETV107X_SSP_BASE 0x08088c00 | ||
39 | #define TNETV107X_ASYNC_EMIF_CNTRL_BASE 0x08200000 | ||
40 | #define TNETV107X_ASYNC_EMIF_DATA_CE0_BASE 0x30000000 | ||
41 | #define TNETV107X_ASYNC_EMIF_DATA_CE1_BASE 0x40000000 | ||
42 | #define TNETV107X_ASYNC_EMIF_DATA_CE2_BASE 0x44000000 | ||
43 | #define TNETV107X_ASYNC_EMIF_DATA_CE3_BASE 0x48000000 | ||
44 | |||
45 | /* TNETV107X specific EDMA3 information */ | ||
46 | #define EDMA_TNETV107X_NUM_DMACH 64 | ||
47 | #define EDMA_TNETV107X_NUM_TCC 64 | ||
48 | #define EDMA_TNETV107X_NUM_PARAMENTRY 128 | ||
49 | #define EDMA_TNETV107X_NUM_EVQUE 2 | ||
50 | #define EDMA_TNETV107X_NUM_TC 2 | ||
51 | #define EDMA_TNETV107X_CHMAP_EXIST 0 | ||
52 | #define EDMA_TNETV107X_NUM_REGIONS 4 | ||
53 | #define TNETV107X_DMACH2EVENT_MAP0 0x3C0CE000u | ||
54 | #define TNETV107X_DMACH2EVENT_MAP1 0x000FFFFFu | ||
55 | |||
56 | #define TNETV107X_DMACH_SDIO0_RX 26 | ||
57 | #define TNETV107X_DMACH_SDIO0_TX 27 | ||
58 | #define TNETV107X_DMACH_SDIO1_RX 28 | ||
59 | #define TNETV107X_DMACH_SDIO1_TX 29 | ||
60 | |||
61 | static s8 edma_tc_mapping[][2] = { | ||
62 | /* event queue no TC no */ | ||
63 | { 0, 0 }, | ||
64 | { 1, 1 }, | ||
65 | { -1, -1 } | ||
66 | }; | ||
67 | |||
68 | static s8 edma_priority_mapping[][2] = { | ||
69 | /* event queue no Prio */ | ||
70 | { 0, 3 }, | ||
71 | { 1, 7 }, | ||
72 | { -1, -1 } | ||
73 | }; | ||
74 | |||
75 | static struct edma_soc_info edma_cc0_info = { | ||
76 | .n_channel = EDMA_TNETV107X_NUM_DMACH, | ||
77 | .n_region = EDMA_TNETV107X_NUM_REGIONS, | ||
78 | .n_slot = EDMA_TNETV107X_NUM_PARAMENTRY, | ||
79 | .n_tc = EDMA_TNETV107X_NUM_TC, | ||
80 | .n_cc = 1, | ||
81 | .queue_tc_mapping = edma_tc_mapping, | ||
82 | .queue_priority_mapping = edma_priority_mapping, | ||
83 | .default_queue = EVENTQ_1, | ||
84 | }; | ||
85 | |||
86 | static struct edma_soc_info *tnetv107x_edma_info[EDMA_MAX_CC] = { | ||
87 | &edma_cc0_info, | ||
88 | }; | ||
89 | |||
90 | static struct resource edma_resources[] = { | ||
91 | { | ||
92 | .name = "edma_cc0", | ||
93 | .start = TNETV107X_TPCC_BASE, | ||
94 | .end = TNETV107X_TPCC_BASE + SZ_32K - 1, | ||
95 | .flags = IORESOURCE_MEM, | ||
96 | }, | ||
97 | { | ||
98 | .name = "edma_tc0", | ||
99 | .start = TNETV107X_TPTC0_BASE, | ||
100 | .end = TNETV107X_TPTC0_BASE + SZ_1K - 1, | ||
101 | .flags = IORESOURCE_MEM, | ||
102 | }, | ||
103 | { | ||
104 | .name = "edma_tc1", | ||
105 | .start = TNETV107X_TPTC1_BASE, | ||
106 | .end = TNETV107X_TPTC1_BASE + SZ_1K - 1, | ||
107 | .flags = IORESOURCE_MEM, | ||
108 | }, | ||
109 | { | ||
110 | .name = "edma0", | ||
111 | .start = IRQ_TNETV107X_TPCC, | ||
112 | .flags = IORESOURCE_IRQ, | ||
113 | }, | ||
114 | { | ||
115 | .name = "edma0_err", | ||
116 | .start = IRQ_TNETV107X_TPCC_ERR, | ||
117 | .flags = IORESOURCE_IRQ, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | static struct platform_device edma_device = { | ||
122 | .name = "edma", | ||
123 | .id = -1, | ||
124 | .num_resources = ARRAY_SIZE(edma_resources), | ||
125 | .resource = edma_resources, | ||
126 | .dev.platform_data = tnetv107x_edma_info, | ||
127 | }; | ||
128 | |||
129 | static struct plat_serial8250_port serial0_platform_data[] = { | ||
130 | { | ||
131 | .mapbase = TNETV107X_UART0_BASE, | ||
132 | .irq = IRQ_TNETV107X_UART0, | ||
133 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | ||
134 | UPF_FIXED_TYPE | UPF_IOREMAP, | ||
135 | .type = PORT_AR7, | ||
136 | .iotype = UPIO_MEM32, | ||
137 | .regshift = 2, | ||
138 | }, | ||
139 | { | ||
140 | .flags = 0, | ||
141 | } | ||
142 | }; | ||
143 | static struct plat_serial8250_port serial1_platform_data[] = { | ||
144 | { | ||
145 | .mapbase = TNETV107X_UART1_BASE, | ||
146 | .irq = IRQ_TNETV107X_UART1, | ||
147 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | ||
148 | UPF_FIXED_TYPE | UPF_IOREMAP, | ||
149 | .type = PORT_AR7, | ||
150 | .iotype = UPIO_MEM32, | ||
151 | .regshift = 2, | ||
152 | }, | ||
153 | { | ||
154 | .flags = 0, | ||
155 | } | ||
156 | }; | ||
157 | static struct plat_serial8250_port serial2_platform_data[] = { | ||
158 | { | ||
159 | .mapbase = TNETV107X_UART2_BASE, | ||
160 | .irq = IRQ_TNETV107X_UART2, | ||
161 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | | ||
162 | UPF_FIXED_TYPE | UPF_IOREMAP, | ||
163 | .type = PORT_AR7, | ||
164 | .iotype = UPIO_MEM32, | ||
165 | .regshift = 2, | ||
166 | }, | ||
167 | { | ||
168 | .flags = 0, | ||
169 | } | ||
170 | }; | ||
171 | |||
172 | |||
173 | struct platform_device tnetv107x_serial_device[] = { | ||
174 | { | ||
175 | .name = "serial8250", | ||
176 | .id = PLAT8250_DEV_PLATFORM, | ||
177 | .dev.platform_data = serial0_platform_data, | ||
178 | }, | ||
179 | { | ||
180 | .name = "serial8250", | ||
181 | .id = PLAT8250_DEV_PLATFORM1, | ||
182 | .dev.platform_data = serial1_platform_data, | ||
183 | }, | ||
184 | { | ||
185 | .name = "serial8250", | ||
186 | .id = PLAT8250_DEV_PLATFORM2, | ||
187 | .dev.platform_data = serial2_platform_data, | ||
188 | }, | ||
189 | { | ||
190 | } | ||
191 | }; | ||
192 | |||
193 | static struct resource mmc0_resources[] = { | ||
194 | { /* Memory mapped registers */ | ||
195 | .start = TNETV107X_SDIO0_BASE, | ||
196 | .end = TNETV107X_SDIO0_BASE + 0x0ff, | ||
197 | .flags = IORESOURCE_MEM | ||
198 | }, | ||
199 | { /* MMC interrupt */ | ||
200 | .start = IRQ_TNETV107X_MMC0, | ||
201 | .flags = IORESOURCE_IRQ | ||
202 | }, | ||
203 | { /* SDIO interrupt */ | ||
204 | .start = IRQ_TNETV107X_SDIO0, | ||
205 | .flags = IORESOURCE_IRQ | ||
206 | }, | ||
207 | { /* DMA RX */ | ||
208 | .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO0_RX), | ||
209 | .flags = IORESOURCE_DMA | ||
210 | }, | ||
211 | { /* DMA TX */ | ||
212 | .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO0_TX), | ||
213 | .flags = IORESOURCE_DMA | ||
214 | }, | ||
215 | }; | ||
216 | |||
217 | static struct resource mmc1_resources[] = { | ||
218 | { /* Memory mapped registers */ | ||
219 | .start = TNETV107X_SDIO1_BASE, | ||
220 | .end = TNETV107X_SDIO1_BASE + 0x0ff, | ||
221 | .flags = IORESOURCE_MEM | ||
222 | }, | ||
223 | { /* MMC interrupt */ | ||
224 | .start = IRQ_TNETV107X_MMC1, | ||
225 | .flags = IORESOURCE_IRQ | ||
226 | }, | ||
227 | { /* SDIO interrupt */ | ||
228 | .start = IRQ_TNETV107X_SDIO1, | ||
229 | .flags = IORESOURCE_IRQ | ||
230 | }, | ||
231 | { /* DMA RX */ | ||
232 | .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_RX), | ||
233 | .flags = IORESOURCE_DMA | ||
234 | }, | ||
235 | { /* DMA TX */ | ||
236 | .start = EDMA_CTLR_CHAN(0, TNETV107X_DMACH_SDIO1_TX), | ||
237 | .flags = IORESOURCE_DMA | ||
238 | }, | ||
239 | }; | ||
240 | |||
241 | static u64 mmc0_dma_mask = DMA_BIT_MASK(32); | ||
242 | static u64 mmc1_dma_mask = DMA_BIT_MASK(32); | ||
243 | |||
244 | static struct platform_device mmc_devices[2] = { | ||
245 | { | ||
246 | .name = "dm6441-mmc", | ||
247 | .id = 0, | ||
248 | .dev = { | ||
249 | .dma_mask = &mmc0_dma_mask, | ||
250 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
251 | }, | ||
252 | .num_resources = ARRAY_SIZE(mmc0_resources), | ||
253 | .resource = mmc0_resources | ||
254 | }, | ||
255 | { | ||
256 | .name = "dm6441-mmc", | ||
257 | .id = 1, | ||
258 | .dev = { | ||
259 | .dma_mask = &mmc1_dma_mask, | ||
260 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
261 | }, | ||
262 | .num_resources = ARRAY_SIZE(mmc1_resources), | ||
263 | .resource = mmc1_resources | ||
264 | }, | ||
265 | }; | ||
266 | |||
267 | static const u32 emif_windows[] = { | ||
268 | TNETV107X_ASYNC_EMIF_DATA_CE0_BASE, TNETV107X_ASYNC_EMIF_DATA_CE1_BASE, | ||
269 | TNETV107X_ASYNC_EMIF_DATA_CE2_BASE, TNETV107X_ASYNC_EMIF_DATA_CE3_BASE, | ||
270 | }; | ||
271 | |||
272 | static const u32 emif_window_sizes[] = { SZ_256M, SZ_64M, SZ_64M, SZ_64M }; | ||
273 | |||
274 | static struct resource wdt_resources[] = { | ||
275 | { | ||
276 | .start = TNETV107X_WDOG_BASE, | ||
277 | .end = TNETV107X_WDOG_BASE + SZ_4K - 1, | ||
278 | .flags = IORESOURCE_MEM, | ||
279 | }, | ||
280 | }; | ||
281 | |||
282 | struct platform_device tnetv107x_wdt_device = { | ||
283 | .name = "tnetv107x_wdt", | ||
284 | .id = 0, | ||
285 | .num_resources = ARRAY_SIZE(wdt_resources), | ||
286 | .resource = wdt_resources, | ||
287 | }; | ||
288 | |||
289 | static int __init nand_init(int chipsel, struct davinci_nand_pdata *data) | ||
290 | { | ||
291 | struct resource res[2]; | ||
292 | struct platform_device *pdev; | ||
293 | u32 range; | ||
294 | int ret; | ||
295 | |||
296 | /* Figure out the resource range from the ale/cle masks */ | ||
297 | range = max(data->mask_cle, data->mask_ale); | ||
298 | range = PAGE_ALIGN(range + 4) - 1; | ||
299 | |||
300 | if (range >= emif_window_sizes[chipsel]) | ||
301 | return -EINVAL; | ||
302 | |||
303 | pdev = kzalloc(sizeof(*pdev), GFP_KERNEL); | ||
304 | if (!pdev) | ||
305 | return -ENOMEM; | ||
306 | |||
307 | pdev->name = "davinci_nand"; | ||
308 | pdev->id = chipsel; | ||
309 | pdev->dev.platform_data = data; | ||
310 | |||
311 | memset(res, 0, sizeof(res)); | ||
312 | |||
313 | res[0].start = emif_windows[chipsel]; | ||
314 | res[0].end = res[0].start + range; | ||
315 | res[0].flags = IORESOURCE_MEM; | ||
316 | |||
317 | res[1].start = TNETV107X_ASYNC_EMIF_CNTRL_BASE; | ||
318 | res[1].end = res[1].start + SZ_4K - 1; | ||
319 | res[1].flags = IORESOURCE_MEM; | ||
320 | |||
321 | ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res)); | ||
322 | if (ret < 0) { | ||
323 | kfree(pdev); | ||
324 | return ret; | ||
325 | } | ||
326 | |||
327 | return platform_device_register(pdev); | ||
328 | } | ||
329 | |||
330 | static struct resource keypad_resources[] = { | ||
331 | { | ||
332 | .start = TNETV107X_KEYPAD_BASE, | ||
333 | .end = TNETV107X_KEYPAD_BASE + 0xff, | ||
334 | .flags = IORESOURCE_MEM, | ||
335 | }, | ||
336 | { | ||
337 | .start = IRQ_TNETV107X_KEYPAD, | ||
338 | .flags = IORESOURCE_IRQ, | ||
339 | .name = "press", | ||
340 | }, | ||
341 | { | ||
342 | .start = IRQ_TNETV107X_KEYPAD_FREE, | ||
343 | .flags = IORESOURCE_IRQ, | ||
344 | .name = "release", | ||
345 | }, | ||
346 | }; | ||
347 | |||
348 | static struct platform_device keypad_device = { | ||
349 | .name = "tnetv107x-keypad", | ||
350 | .num_resources = ARRAY_SIZE(keypad_resources), | ||
351 | .resource = keypad_resources, | ||
352 | }; | ||
353 | |||
354 | static struct resource tsc_resources[] = { | ||
355 | { | ||
356 | .start = TNETV107X_TSC_BASE, | ||
357 | .end = TNETV107X_TSC_BASE + 0xff, | ||
358 | .flags = IORESOURCE_MEM, | ||
359 | }, | ||
360 | { | ||
361 | .start = IRQ_TNETV107X_TSC, | ||
362 | .flags = IORESOURCE_IRQ, | ||
363 | }, | ||
364 | }; | ||
365 | |||
366 | static struct platform_device tsc_device = { | ||
367 | .name = "tnetv107x-ts", | ||
368 | .num_resources = ARRAY_SIZE(tsc_resources), | ||
369 | .resource = tsc_resources, | ||
370 | }; | ||
371 | |||
372 | static struct resource ssp_resources[] = { | ||
373 | { | ||
374 | .start = TNETV107X_SSP_BASE, | ||
375 | .end = TNETV107X_SSP_BASE + 0x1ff, | ||
376 | .flags = IORESOURCE_MEM, | ||
377 | }, | ||
378 | { | ||
379 | .start = IRQ_TNETV107X_SSP, | ||
380 | .flags = IORESOURCE_IRQ, | ||
381 | }, | ||
382 | }; | ||
383 | |||
384 | static struct platform_device ssp_device = { | ||
385 | .name = "ti-ssp", | ||
386 | .id = -1, | ||
387 | .num_resources = ARRAY_SIZE(ssp_resources), | ||
388 | .resource = ssp_resources, | ||
389 | }; | ||
390 | |||
391 | void __init tnetv107x_devices_init(struct tnetv107x_device_info *info) | ||
392 | { | ||
393 | int i, error; | ||
394 | struct clk *tsc_clk; | ||
395 | |||
396 | /* | ||
397 | * The reset defaults for tnetv107x tsc clock divider is set too high. | ||
398 | * This forces the clock down to a range that allows the ADC to | ||
399 | * complete sample conversion in time. | ||
400 | */ | ||
401 | tsc_clk = clk_get(NULL, "sys_tsc_clk"); | ||
402 | if (!IS_ERR(tsc_clk)) { | ||
403 | error = clk_set_rate(tsc_clk, 5000000); | ||
404 | WARN_ON(error < 0); | ||
405 | clk_put(tsc_clk); | ||
406 | } | ||
407 | |||
408 | platform_device_register(&edma_device); | ||
409 | platform_device_register(&tnetv107x_wdt_device); | ||
410 | platform_device_register(&tsc_device); | ||
411 | |||
412 | if (info->serial_config) | ||
413 | davinci_serial_init(tnetv107x_serial_device); | ||
414 | |||
415 | for (i = 0; i < 2; i++) | ||
416 | if (info->mmc_config[i]) { | ||
417 | mmc_devices[i].dev.platform_data = info->mmc_config[i]; | ||
418 | platform_device_register(&mmc_devices[i]); | ||
419 | } | ||
420 | |||
421 | for (i = 0; i < 4; i++) | ||
422 | if (info->nand_config[i]) | ||
423 | nand_init(i, info->nand_config[i]); | ||
424 | |||
425 | if (info->keypad_config) { | ||
426 | keypad_device.dev.platform_data = info->keypad_config; | ||
427 | platform_device_register(&keypad_device); | ||
428 | } | ||
429 | |||
430 | if (info->ssp_config) { | ||
431 | ssp_device.dev.platform_data = info->ssp_config; | ||
432 | platform_device_register(&ssp_device); | ||
433 | } | ||
434 | } | ||
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c index 5cf9a027dcc6..6257aa452568 100644 --- a/arch/arm/mach-davinci/devices.c +++ b/arch/arm/mach-davinci/devices.c | |||
@@ -313,9 +313,9 @@ void davinci_restart(enum reboot_mode mode, const char *cmd) | |||
313 | davinci_watchdog_reset(&davinci_wdt_device); | 313 | davinci_watchdog_reset(&davinci_wdt_device); |
314 | } | 314 | } |
315 | 315 | ||
316 | static void davinci_init_wdt(void) | 316 | int davinci_init_wdt(void) |
317 | { | 317 | { |
318 | platform_device_register(&davinci_wdt_device); | 318 | return platform_device_register(&davinci_wdt_device); |
319 | } | 319 | } |
320 | 320 | ||
321 | static struct platform_device davinci_gpio_device = { | 321 | static struct platform_device davinci_gpio_device = { |
@@ -348,16 +348,3 @@ struct davinci_timer_instance davinci_timer_instance[2] = { | |||
348 | }, | 348 | }, |
349 | }; | 349 | }; |
350 | 350 | ||
351 | /*-------------------------------------------------------------------------*/ | ||
352 | |||
353 | static int __init davinci_init_devices(void) | ||
354 | { | ||
355 | /* please keep these calls, and their implementations above, | ||
356 | * in alphabetical order so they're easier to sort through. | ||
357 | */ | ||
358 | davinci_init_wdt(); | ||
359 | |||
360 | return 0; | ||
361 | } | ||
362 | arch_initcall(davinci_init_devices); | ||
363 | |||
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 4668c0e19767..07381d8cea62 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
@@ -1076,12 +1076,18 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg, | |||
1076 | 1076 | ||
1077 | static int __init dm355_init_devices(void) | 1077 | static int __init dm355_init_devices(void) |
1078 | { | 1078 | { |
1079 | int ret = 0; | ||
1080 | |||
1079 | if (!cpu_is_davinci_dm355()) | 1081 | if (!cpu_is_davinci_dm355()) |
1080 | return 0; | 1082 | return 0; |
1081 | 1083 | ||
1082 | davinci_cfg_reg(DM355_INT_EDMA_CC); | 1084 | davinci_cfg_reg(DM355_INT_EDMA_CC); |
1083 | platform_device_register(&dm355_edma_device); | 1085 | platform_device_register(&dm355_edma_device); |
1084 | 1086 | ||
1085 | return 0; | 1087 | ret = davinci_init_wdt(); |
1088 | if (ret) | ||
1089 | pr_warn("%s: watchdog init failed: %d\n", __func__, ret); | ||
1090 | |||
1091 | return ret; | ||
1086 | } | 1092 | } |
1087 | postcore_initcall(dm355_init_devices); | 1093 | postcore_initcall(dm355_init_devices); |
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index b44b49e2801a..08a61b938333 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -1436,6 +1436,8 @@ int __init dm365_init_video(struct vpfe_config *vpfe_cfg, | |||
1436 | 1436 | ||
1437 | static int __init dm365_init_devices(void) | 1437 | static int __init dm365_init_devices(void) |
1438 | { | 1438 | { |
1439 | int ret = 0; | ||
1440 | |||
1439 | if (!cpu_is_davinci_dm365()) | 1441 | if (!cpu_is_davinci_dm365()) |
1440 | return 0; | 1442 | return 0; |
1441 | 1443 | ||
@@ -1445,6 +1447,10 @@ static int __init dm365_init_devices(void) | |||
1445 | platform_device_register(&dm365_mdio_device); | 1447 | platform_device_register(&dm365_mdio_device); |
1446 | platform_device_register(&dm365_emac_device); | 1448 | platform_device_register(&dm365_emac_device); |
1447 | 1449 | ||
1448 | return 0; | 1450 | ret = davinci_init_wdt(); |
1451 | if (ret) | ||
1452 | pr_warn("%s: watchdog init failed: %d\n", __func__, ret); | ||
1453 | |||
1454 | return ret; | ||
1449 | } | 1455 | } |
1450 | postcore_initcall(dm365_init_devices); | 1456 | postcore_initcall(dm365_init_devices); |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 5c3e0be95ef3..5debffba4b24 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -964,6 +964,8 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, | |||
964 | 964 | ||
965 | static int __init dm644x_init_devices(void) | 965 | static int __init dm644x_init_devices(void) |
966 | { | 966 | { |
967 | int ret = 0; | ||
968 | |||
967 | if (!cpu_is_davinci_dm644x()) | 969 | if (!cpu_is_davinci_dm644x()) |
968 | return 0; | 970 | return 0; |
969 | 971 | ||
@@ -972,6 +974,10 @@ static int __init dm644x_init_devices(void) | |||
972 | platform_device_register(&dm644x_mdio_device); | 974 | platform_device_register(&dm644x_mdio_device); |
973 | platform_device_register(&dm644x_emac_device); | 975 | platform_device_register(&dm644x_emac_device); |
974 | 976 | ||
975 | return 0; | 977 | ret = davinci_init_wdt(); |
978 | if (ret) | ||
979 | pr_warn("%s: watchdog init failed: %d\n", __func__, ret); | ||
980 | |||
981 | return ret; | ||
976 | } | 982 | } |
977 | postcore_initcall(dm644x_init_devices); | 983 | postcore_initcall(dm644x_init_devices); |
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 81768dd47096..332d00d24dc2 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -955,12 +955,18 @@ void __init dm646x_init(void) | |||
955 | 955 | ||
956 | static int __init dm646x_init_devices(void) | 956 | static int __init dm646x_init_devices(void) |
957 | { | 957 | { |
958 | int ret = 0; | ||
959 | |||
958 | if (!cpu_is_davinci_dm646x()) | 960 | if (!cpu_is_davinci_dm646x()) |
959 | return 0; | 961 | return 0; |
960 | 962 | ||
961 | platform_device_register(&dm646x_mdio_device); | 963 | platform_device_register(&dm646x_mdio_device); |
962 | platform_device_register(&dm646x_emac_device); | 964 | platform_device_register(&dm646x_emac_device); |
963 | 965 | ||
964 | return 0; | 966 | ret = davinci_init_wdt(); |
967 | if (ret) | ||
968 | pr_warn("%s: watchdog init failed: %d\n", __func__, ret); | ||
969 | |||
970 | return ret; | ||
965 | } | 971 | } |
966 | postcore_initcall(dm646x_init_devices); | 972 | postcore_initcall(dm646x_init_devices); |
diff --git a/arch/arm/mach-davinci/include/mach/cputype.h b/arch/arm/mach-davinci/include/mach/cputype.h index 957fb87e832e..1fc84e21664d 100644 --- a/arch/arm/mach-davinci/include/mach/cputype.h +++ b/arch/arm/mach-davinci/include/mach/cputype.h | |||
@@ -33,7 +33,6 @@ struct davinci_id { | |||
33 | #define DAVINCI_CPU_ID_DM365 0x03650000 | 33 | #define DAVINCI_CPU_ID_DM365 0x03650000 |
34 | #define DAVINCI_CPU_ID_DA830 0x08300000 | 34 | #define DAVINCI_CPU_ID_DA830 0x08300000 |
35 | #define DAVINCI_CPU_ID_DA850 0x08500000 | 35 | #define DAVINCI_CPU_ID_DA850 0x08500000 |
36 | #define DAVINCI_CPU_ID_TNETV107X 0x0b8a0000 | ||
37 | 36 | ||
38 | #define IS_DAVINCI_CPU(type, id) \ | 37 | #define IS_DAVINCI_CPU(type, id) \ |
39 | static inline int is_davinci_ ##type(void) \ | 38 | static inline int is_davinci_ ##type(void) \ |
@@ -47,7 +46,6 @@ IS_DAVINCI_CPU(dm355, DAVINCI_CPU_ID_DM355) | |||
47 | IS_DAVINCI_CPU(dm365, DAVINCI_CPU_ID_DM365) | 46 | IS_DAVINCI_CPU(dm365, DAVINCI_CPU_ID_DM365) |
48 | IS_DAVINCI_CPU(da830, DAVINCI_CPU_ID_DA830) | 47 | IS_DAVINCI_CPU(da830, DAVINCI_CPU_ID_DA830) |
49 | IS_DAVINCI_CPU(da850, DAVINCI_CPU_ID_DA850) | 48 | IS_DAVINCI_CPU(da850, DAVINCI_CPU_ID_DA850) |
50 | IS_DAVINCI_CPU(tnetv107x, DAVINCI_CPU_ID_TNETV107X) | ||
51 | 49 | ||
52 | #ifdef CONFIG_ARCH_DAVINCI_DM644x | 50 | #ifdef CONFIG_ARCH_DAVINCI_DM644x |
53 | #define cpu_is_davinci_dm644x() is_davinci_dm644x() | 51 | #define cpu_is_davinci_dm644x() is_davinci_dm644x() |
@@ -85,10 +83,4 @@ IS_DAVINCI_CPU(tnetv107x, DAVINCI_CPU_ID_TNETV107X) | |||
85 | #define cpu_is_davinci_da850() 0 | 83 | #define cpu_is_davinci_da850() 0 |
86 | #endif | 84 | #endif |
87 | 85 | ||
88 | #ifdef CONFIG_ARCH_DAVINCI_TNETV107X | ||
89 | #define cpu_is_davinci_tnetv107x() is_davinci_tnetv107x() | ||
90 | #else | ||
91 | #define cpu_is_davinci_tnetv107x() 0 | ||
92 | #endif | ||
93 | |||
94 | #endif | 86 | #endif |
diff --git a/arch/arm/mach-davinci/include/mach/irqs.h b/arch/arm/mach-davinci/include/mach/irqs.h index ec76c7775c2e..354af71798dc 100644 --- a/arch/arm/mach-davinci/include/mach/irqs.h +++ b/arch/arm/mach-davinci/include/mach/irqs.h | |||
@@ -401,103 +401,6 @@ | |||
401 | 401 | ||
402 | #define DA850_N_CP_INTC_IRQ 101 | 402 | #define DA850_N_CP_INTC_IRQ 101 |
403 | 403 | ||
404 | |||
405 | /* TNETV107X specific interrupts */ | ||
406 | #define IRQ_TNETV107X_TDM1_TXDMA 0 | ||
407 | #define IRQ_TNETV107X_EXT_INT_0 1 | ||
408 | #define IRQ_TNETV107X_EXT_INT_1 2 | ||
409 | #define IRQ_TNETV107X_GPIO_INT12 3 | ||
410 | #define IRQ_TNETV107X_GPIO_INT13 4 | ||
411 | #define IRQ_TNETV107X_TIMER_0_TINT12 5 | ||
412 | #define IRQ_TNETV107X_TIMER_1_TINT12 6 | ||
413 | #define IRQ_TNETV107X_UART0 7 | ||
414 | #define IRQ_TNETV107X_TDM1_RXDMA 8 | ||
415 | #define IRQ_TNETV107X_MCDMA_INT0 9 | ||
416 | #define IRQ_TNETV107X_MCDMA_INT1 10 | ||
417 | #define IRQ_TNETV107X_TPCC 11 | ||
418 | #define IRQ_TNETV107X_TPCC_INT0 12 | ||
419 | #define IRQ_TNETV107X_TPCC_INT1 13 | ||
420 | #define IRQ_TNETV107X_TPCC_INT2 14 | ||
421 | #define IRQ_TNETV107X_TPCC_INT3 15 | ||
422 | #define IRQ_TNETV107X_TPTC0 16 | ||
423 | #define IRQ_TNETV107X_TPTC1 17 | ||
424 | #define IRQ_TNETV107X_TIMER_0_TINT34 18 | ||
425 | #define IRQ_TNETV107X_ETHSS 19 | ||
426 | #define IRQ_TNETV107X_TIMER_1_TINT34 20 | ||
427 | #define IRQ_TNETV107X_DSP2ARM_INT0 21 | ||
428 | #define IRQ_TNETV107X_DSP2ARM_INT1 22 | ||
429 | #define IRQ_TNETV107X_ARM_NPMUIRQ 23 | ||
430 | #define IRQ_TNETV107X_USB1 24 | ||
431 | #define IRQ_TNETV107X_VLYNQ 25 | ||
432 | #define IRQ_TNETV107X_UART0_DMATX 26 | ||
433 | #define IRQ_TNETV107X_UART0_DMARX 27 | ||
434 | #define IRQ_TNETV107X_TDM1_TXMCSP 28 | ||
435 | #define IRQ_TNETV107X_SSP 29 | ||
436 | #define IRQ_TNETV107X_MCDMA_INT2 30 | ||
437 | #define IRQ_TNETV107X_MCDMA_INT3 31 | ||
438 | #define IRQ_TNETV107X_TDM_CODECIF_EOT 32 | ||
439 | #define IRQ_TNETV107X_IMCOP_SQR_ARM 33 | ||
440 | #define IRQ_TNETV107X_USB0 34 | ||
441 | #define IRQ_TNETV107X_USB_CDMA 35 | ||
442 | #define IRQ_TNETV107X_LCD 36 | ||
443 | #define IRQ_TNETV107X_KEYPAD 37 | ||
444 | #define IRQ_TNETV107X_KEYPAD_FREE 38 | ||
445 | #define IRQ_TNETV107X_RNG 39 | ||
446 | #define IRQ_TNETV107X_PKA 40 | ||
447 | #define IRQ_TNETV107X_TDM0_TXDMA 41 | ||
448 | #define IRQ_TNETV107X_TDM0_RXDMA 42 | ||
449 | #define IRQ_TNETV107X_TDM0_TXMCSP 43 | ||
450 | #define IRQ_TNETV107X_TDM0_RXMCSP 44 | ||
451 | #define IRQ_TNETV107X_TDM1_RXMCSP 45 | ||
452 | #define IRQ_TNETV107X_SDIO1 46 | ||
453 | #define IRQ_TNETV107X_SDIO0 47 | ||
454 | #define IRQ_TNETV107X_TSC 48 | ||
455 | #define IRQ_TNETV107X_TS 49 | ||
456 | #define IRQ_TNETV107X_UART1 50 | ||
457 | #define IRQ_TNETV107X_MBX_LITE 51 | ||
458 | #define IRQ_TNETV107X_GPIO_INT00 52 | ||
459 | #define IRQ_TNETV107X_GPIO_INT01 53 | ||
460 | #define IRQ_TNETV107X_GPIO_INT02 54 | ||
461 | #define IRQ_TNETV107X_GPIO_INT03 55 | ||
462 | #define IRQ_TNETV107X_UART2 56 | ||
463 | #define IRQ_TNETV107X_UART2_DMATX 57 | ||
464 | #define IRQ_TNETV107X_UART2_DMARX 58 | ||
465 | #define IRQ_TNETV107X_IMCOP_IMX 59 | ||
466 | #define IRQ_TNETV107X_IMCOP_VLCD 60 | ||
467 | #define IRQ_TNETV107X_AES 61 | ||
468 | #define IRQ_TNETV107X_DES 62 | ||
469 | #define IRQ_TNETV107X_SHAMD5 63 | ||
470 | #define IRQ_TNETV107X_TPCC_ERR 68 | ||
471 | #define IRQ_TNETV107X_TPCC_PROT 69 | ||
472 | #define IRQ_TNETV107X_TPTC0_ERR 70 | ||
473 | #define IRQ_TNETV107X_TPTC1_ERR 71 | ||
474 | #define IRQ_TNETV107X_UART0_ERR 72 | ||
475 | #define IRQ_TNETV107X_UART1_ERR 73 | ||
476 | #define IRQ_TNETV107X_AEMIF_ERR 74 | ||
477 | #define IRQ_TNETV107X_DDR_ERR 75 | ||
478 | #define IRQ_TNETV107X_WDTARM_INT0 76 | ||
479 | #define IRQ_TNETV107X_MCDMA_ERR 77 | ||
480 | #define IRQ_TNETV107X_GPIO_ERR 78 | ||
481 | #define IRQ_TNETV107X_MPU_ADDR 79 | ||
482 | #define IRQ_TNETV107X_MPU_PROT 80 | ||
483 | #define IRQ_TNETV107X_IOPU_ADDR 81 | ||
484 | #define IRQ_TNETV107X_IOPU_PROT 82 | ||
485 | #define IRQ_TNETV107X_KEYPAD_ADDR_ERR 83 | ||
486 | #define IRQ_TNETV107X_WDT0_ADDR_ERR 84 | ||
487 | #define IRQ_TNETV107X_WDT1_ADDR_ERR 85 | ||
488 | #define IRQ_TNETV107X_CLKCTL_ADDR_ERR 86 | ||
489 | #define IRQ_TNETV107X_PLL_UNLOCK 87 | ||
490 | #define IRQ_TNETV107X_WDTDSP_INT0 88 | ||
491 | #define IRQ_TNETV107X_SEC_CTRL_VIOLATION 89 | ||
492 | #define IRQ_TNETV107X_KEY_MNG_VIOLATION 90 | ||
493 | #define IRQ_TNETV107X_PBIST_CPU 91 | ||
494 | #define IRQ_TNETV107X_WDTARM 92 | ||
495 | #define IRQ_TNETV107X_PSC 93 | ||
496 | #define IRQ_TNETV107X_MMC0 94 | ||
497 | #define IRQ_TNETV107X_MMC1 95 | ||
498 | |||
499 | #define TNETV107X_N_CP_INTC_IRQ 96 | ||
500 | |||
501 | /* da850 currently has the most gpio pins (144) */ | 404 | /* da850 currently has the most gpio pins (144) */ |
502 | #define DAVINCI_N_GPIO 144 | 405 | #define DAVINCI_N_GPIO 144 |
503 | /* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */ | 406 | /* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */ |
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h index 9e95b8a1edb6..631655e68ae0 100644 --- a/arch/arm/mach-davinci/include/mach/mux.h +++ b/arch/arm/mach-davinci/include/mach/mux.h | |||
@@ -972,275 +972,6 @@ enum davinci_da850_index { | |||
972 | DA850_VPIF_CLKO3, | 972 | DA850_VPIF_CLKO3, |
973 | }; | 973 | }; |
974 | 974 | ||
975 | enum davinci_tnetv107x_index { | ||
976 | TNETV107X_ASR_A00, | ||
977 | TNETV107X_GPIO32, | ||
978 | TNETV107X_ASR_A01, | ||
979 | TNETV107X_GPIO33, | ||
980 | TNETV107X_ASR_A02, | ||
981 | TNETV107X_GPIO34, | ||
982 | TNETV107X_ASR_A03, | ||
983 | TNETV107X_GPIO35, | ||
984 | TNETV107X_ASR_A04, | ||
985 | TNETV107X_GPIO36, | ||
986 | TNETV107X_ASR_A05, | ||
987 | TNETV107X_GPIO37, | ||
988 | TNETV107X_ASR_A06, | ||
989 | TNETV107X_GPIO38, | ||
990 | TNETV107X_ASR_A07, | ||
991 | TNETV107X_GPIO39, | ||
992 | TNETV107X_ASR_A08, | ||
993 | TNETV107X_GPIO40, | ||
994 | TNETV107X_ASR_A09, | ||
995 | TNETV107X_GPIO41, | ||
996 | TNETV107X_ASR_A10, | ||
997 | TNETV107X_GPIO42, | ||
998 | TNETV107X_ASR_A11, | ||
999 | TNETV107X_BOOT_STRP_0, | ||
1000 | TNETV107X_ASR_A12, | ||
1001 | TNETV107X_BOOT_STRP_1, | ||
1002 | TNETV107X_ASR_A13, | ||
1003 | TNETV107X_GPIO43, | ||
1004 | TNETV107X_ASR_A14, | ||
1005 | TNETV107X_GPIO44, | ||
1006 | TNETV107X_ASR_A15, | ||
1007 | TNETV107X_GPIO45, | ||
1008 | TNETV107X_ASR_A16, | ||
1009 | TNETV107X_GPIO46, | ||
1010 | TNETV107X_ASR_A17, | ||
1011 | TNETV107X_GPIO47, | ||
1012 | TNETV107X_ASR_A18, | ||
1013 | TNETV107X_GPIO48, | ||
1014 | TNETV107X_SDIO1_DATA3_0, | ||
1015 | TNETV107X_ASR_A19, | ||
1016 | TNETV107X_GPIO49, | ||
1017 | TNETV107X_SDIO1_DATA2_0, | ||
1018 | TNETV107X_ASR_A20, | ||
1019 | TNETV107X_GPIO50, | ||
1020 | TNETV107X_SDIO1_DATA1_0, | ||
1021 | TNETV107X_ASR_A21, | ||
1022 | TNETV107X_GPIO51, | ||
1023 | TNETV107X_SDIO1_DATA0_0, | ||
1024 | TNETV107X_ASR_A22, | ||
1025 | TNETV107X_GPIO52, | ||
1026 | TNETV107X_SDIO1_CMD_0, | ||
1027 | TNETV107X_ASR_A23, | ||
1028 | TNETV107X_GPIO53, | ||
1029 | TNETV107X_SDIO1_CLK_0, | ||
1030 | TNETV107X_ASR_BA_1, | ||
1031 | TNETV107X_GPIO54, | ||
1032 | TNETV107X_SYS_PLL_CLK, | ||
1033 | TNETV107X_ASR_CS0, | ||
1034 | TNETV107X_ASR_CS1, | ||
1035 | TNETV107X_ASR_CS2, | ||
1036 | TNETV107X_TDM_PLL_CLK, | ||
1037 | TNETV107X_ASR_CS3, | ||
1038 | TNETV107X_ETH_PHY_CLK, | ||
1039 | TNETV107X_ASR_D00, | ||
1040 | TNETV107X_GPIO55, | ||
1041 | TNETV107X_ASR_D01, | ||
1042 | TNETV107X_GPIO56, | ||
1043 | TNETV107X_ASR_D02, | ||
1044 | TNETV107X_GPIO57, | ||
1045 | TNETV107X_ASR_D03, | ||
1046 | TNETV107X_GPIO58, | ||
1047 | TNETV107X_ASR_D04, | ||
1048 | TNETV107X_GPIO59_0, | ||
1049 | TNETV107X_ASR_D05, | ||
1050 | TNETV107X_GPIO60_0, | ||
1051 | TNETV107X_ASR_D06, | ||
1052 | TNETV107X_GPIO61_0, | ||
1053 | TNETV107X_ASR_D07, | ||
1054 | TNETV107X_GPIO62_0, | ||
1055 | TNETV107X_ASR_D08, | ||
1056 | TNETV107X_GPIO63_0, | ||
1057 | TNETV107X_ASR_D09, | ||
1058 | TNETV107X_GPIO64_0, | ||
1059 | TNETV107X_ASR_D10, | ||
1060 | TNETV107X_SDIO1_DATA3_1, | ||
1061 | TNETV107X_ASR_D11, | ||
1062 | TNETV107X_SDIO1_DATA2_1, | ||
1063 | TNETV107X_ASR_D12, | ||
1064 | TNETV107X_SDIO1_DATA1_1, | ||
1065 | TNETV107X_ASR_D13, | ||
1066 | TNETV107X_SDIO1_DATA0_1, | ||
1067 | TNETV107X_ASR_D14, | ||
1068 | TNETV107X_SDIO1_CMD_1, | ||
1069 | TNETV107X_ASR_D15, | ||
1070 | TNETV107X_SDIO1_CLK_1, | ||
1071 | TNETV107X_ASR_OE, | ||
1072 | TNETV107X_BOOT_STRP_2, | ||
1073 | TNETV107X_ASR_RNW, | ||
1074 | TNETV107X_GPIO29_0, | ||
1075 | TNETV107X_ASR_WAIT, | ||
1076 | TNETV107X_GPIO30_0, | ||
1077 | TNETV107X_ASR_WE, | ||
1078 | TNETV107X_BOOT_STRP_3, | ||
1079 | TNETV107X_ASR_WE_DQM0, | ||
1080 | TNETV107X_GPIO31, | ||
1081 | TNETV107X_LCD_PD17_0, | ||
1082 | TNETV107X_ASR_WE_DQM1, | ||
1083 | TNETV107X_ASR_BA0_0, | ||
1084 | TNETV107X_VLYNQ_CLK, | ||
1085 | TNETV107X_GPIO14, | ||
1086 | TNETV107X_LCD_PD19_0, | ||
1087 | TNETV107X_VLYNQ_RXD0, | ||
1088 | TNETV107X_GPIO15, | ||
1089 | TNETV107X_LCD_PD20_0, | ||
1090 | TNETV107X_VLYNQ_RXD1, | ||
1091 | TNETV107X_GPIO16, | ||
1092 | TNETV107X_LCD_PD21_0, | ||
1093 | TNETV107X_VLYNQ_TXD0, | ||
1094 | TNETV107X_GPIO17, | ||
1095 | TNETV107X_LCD_PD22_0, | ||
1096 | TNETV107X_VLYNQ_TXD1, | ||
1097 | TNETV107X_GPIO18, | ||
1098 | TNETV107X_LCD_PD23_0, | ||
1099 | TNETV107X_SDIO0_CLK, | ||
1100 | TNETV107X_GPIO19, | ||
1101 | TNETV107X_SDIO0_CMD, | ||
1102 | TNETV107X_GPIO20, | ||
1103 | TNETV107X_SDIO0_DATA0, | ||
1104 | TNETV107X_GPIO21, | ||
1105 | TNETV107X_SDIO0_DATA1, | ||
1106 | TNETV107X_GPIO22, | ||
1107 | TNETV107X_SDIO0_DATA2, | ||
1108 | TNETV107X_GPIO23, | ||
1109 | TNETV107X_SDIO0_DATA3, | ||
1110 | TNETV107X_GPIO24, | ||
1111 | TNETV107X_EMU0, | ||
1112 | TNETV107X_EMU1, | ||
1113 | TNETV107X_RTCK, | ||
1114 | TNETV107X_TRST_N, | ||
1115 | TNETV107X_TCK, | ||
1116 | TNETV107X_TDI, | ||
1117 | TNETV107X_TDO, | ||
1118 | TNETV107X_TMS, | ||
1119 | TNETV107X_TDM1_CLK, | ||
1120 | TNETV107X_TDM1_RX, | ||
1121 | TNETV107X_TDM1_TX, | ||
1122 | TNETV107X_TDM1_FS, | ||
1123 | TNETV107X_KEYPAD_R0, | ||
1124 | TNETV107X_KEYPAD_R1, | ||
1125 | TNETV107X_KEYPAD_R2, | ||
1126 | TNETV107X_KEYPAD_R3, | ||
1127 | TNETV107X_KEYPAD_R4, | ||
1128 | TNETV107X_KEYPAD_R5, | ||
1129 | TNETV107X_KEYPAD_R6, | ||
1130 | TNETV107X_GPIO12, | ||
1131 | TNETV107X_KEYPAD_R7, | ||
1132 | TNETV107X_GPIO10, | ||
1133 | TNETV107X_KEYPAD_C0, | ||
1134 | TNETV107X_KEYPAD_C1, | ||
1135 | TNETV107X_KEYPAD_C2, | ||
1136 | TNETV107X_KEYPAD_C3, | ||
1137 | TNETV107X_KEYPAD_C4, | ||
1138 | TNETV107X_KEYPAD_C5, | ||
1139 | TNETV107X_KEYPAD_C6, | ||
1140 | TNETV107X_GPIO13, | ||
1141 | TNETV107X_TEST_CLK_IN, | ||
1142 | TNETV107X_KEYPAD_C7, | ||
1143 | TNETV107X_GPIO11, | ||
1144 | TNETV107X_SSP0_0, | ||
1145 | TNETV107X_SCC_DCLK, | ||
1146 | TNETV107X_LCD_PD20_1, | ||
1147 | TNETV107X_SSP0_1, | ||
1148 | TNETV107X_SCC_CS_N, | ||
1149 | TNETV107X_LCD_PD21_1, | ||
1150 | TNETV107X_SSP0_2, | ||
1151 | TNETV107X_SCC_D, | ||
1152 | TNETV107X_LCD_PD22_1, | ||
1153 | TNETV107X_SSP0_3, | ||
1154 | TNETV107X_SCC_RESETN, | ||
1155 | TNETV107X_LCD_PD23_1, | ||
1156 | TNETV107X_SSP1_0, | ||
1157 | TNETV107X_GPIO25, | ||
1158 | TNETV107X_UART2_CTS, | ||
1159 | TNETV107X_SSP1_1, | ||
1160 | TNETV107X_GPIO26, | ||
1161 | TNETV107X_UART2_RD, | ||
1162 | TNETV107X_SSP1_2, | ||
1163 | TNETV107X_GPIO27, | ||
1164 | TNETV107X_UART2_RTS, | ||
1165 | TNETV107X_SSP1_3, | ||
1166 | TNETV107X_GPIO28, | ||
1167 | TNETV107X_UART2_TD, | ||
1168 | TNETV107X_UART0_CTS, | ||
1169 | TNETV107X_UART0_RD, | ||
1170 | TNETV107X_UART0_RTS, | ||
1171 | TNETV107X_UART0_TD, | ||
1172 | TNETV107X_UART1_RD, | ||
1173 | TNETV107X_UART1_TD, | ||
1174 | TNETV107X_LCD_AC_NCS, | ||
1175 | TNETV107X_LCD_HSYNC_RNW, | ||
1176 | TNETV107X_LCD_VSYNC_A0, | ||
1177 | TNETV107X_LCD_MCLK, | ||
1178 | TNETV107X_LCD_PD16_0, | ||
1179 | TNETV107X_LCD_PCLK_E, | ||
1180 | TNETV107X_LCD_PD00, | ||
1181 | TNETV107X_LCD_PD01, | ||
1182 | TNETV107X_LCD_PD02, | ||
1183 | TNETV107X_LCD_PD03, | ||
1184 | TNETV107X_LCD_PD04, | ||
1185 | TNETV107X_LCD_PD05, | ||
1186 | TNETV107X_LCD_PD06, | ||
1187 | TNETV107X_LCD_PD07, | ||
1188 | TNETV107X_LCD_PD08, | ||
1189 | TNETV107X_GPIO59_1, | ||
1190 | TNETV107X_LCD_PD09, | ||
1191 | TNETV107X_GPIO60_1, | ||
1192 | TNETV107X_LCD_PD10, | ||
1193 | TNETV107X_ASR_BA0_1, | ||
1194 | TNETV107X_GPIO61_1, | ||
1195 | TNETV107X_LCD_PD11, | ||
1196 | TNETV107X_GPIO62_1, | ||
1197 | TNETV107X_LCD_PD12, | ||
1198 | TNETV107X_GPIO63_1, | ||
1199 | TNETV107X_LCD_PD13, | ||
1200 | TNETV107X_GPIO64_1, | ||
1201 | TNETV107X_LCD_PD14, | ||
1202 | TNETV107X_GPIO29_1, | ||
1203 | TNETV107X_LCD_PD15, | ||
1204 | TNETV107X_GPIO30_1, | ||
1205 | TNETV107X_EINT0, | ||
1206 | TNETV107X_GPIO08, | ||
1207 | TNETV107X_EINT1, | ||
1208 | TNETV107X_GPIO09, | ||
1209 | TNETV107X_GPIO00, | ||
1210 | TNETV107X_LCD_PD20_2, | ||
1211 | TNETV107X_TDM_CLK_IN_2, | ||
1212 | TNETV107X_GPIO01, | ||
1213 | TNETV107X_LCD_PD21_2, | ||
1214 | TNETV107X_24M_CLK_OUT_1, | ||
1215 | TNETV107X_GPIO02, | ||
1216 | TNETV107X_LCD_PD22_2, | ||
1217 | TNETV107X_GPIO03, | ||
1218 | TNETV107X_LCD_PD23_2, | ||
1219 | TNETV107X_GPIO04, | ||
1220 | TNETV107X_LCD_PD16_1, | ||
1221 | TNETV107X_USB0_RXERR, | ||
1222 | TNETV107X_GPIO05, | ||
1223 | TNETV107X_LCD_PD17_1, | ||
1224 | TNETV107X_TDM_CLK_IN_1, | ||
1225 | TNETV107X_GPIO06, | ||
1226 | TNETV107X_LCD_PD18, | ||
1227 | TNETV107X_24M_CLK_OUT_2, | ||
1228 | TNETV107X_GPIO07, | ||
1229 | TNETV107X_LCD_PD19_1, | ||
1230 | TNETV107X_USB1_RXERR, | ||
1231 | TNETV107X_ETH_PLL_CLK, | ||
1232 | TNETV107X_MDIO, | ||
1233 | TNETV107X_MDC, | ||
1234 | TNETV107X_AIC_MUTE_STAT_N, | ||
1235 | TNETV107X_TDM0_CLK, | ||
1236 | TNETV107X_AIC_HNS_EN_N, | ||
1237 | TNETV107X_TDM0_FS, | ||
1238 | TNETV107X_AIC_HDS_EN_STAT_N, | ||
1239 | TNETV107X_TDM0_TX, | ||
1240 | TNETV107X_AIC_HNF_EN_STAT_N, | ||
1241 | TNETV107X_TDM0_RX, | ||
1242 | }; | ||
1243 | |||
1244 | #define PINMUX(x) (4 * (x)) | 975 | #define PINMUX(x) (4 * (x)) |
1245 | 976 | ||
1246 | #ifdef CONFIG_DAVINCI_MUX | 977 | #ifdef CONFIG_DAVINCI_MUX |
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h index 0a22710493fd..99d47cfa301f 100644 --- a/arch/arm/mach-davinci/include/mach/psc.h +++ b/arch/arm/mach-davinci/include/mach/psc.h | |||
@@ -182,53 +182,6 @@ | |||
182 | #define DA8XX_LPSC1_CR_P3_SS 26 | 182 | #define DA8XX_LPSC1_CR_P3_SS 26 |
183 | #define DA8XX_LPSC1_L3_CBA_RAM 31 | 183 | #define DA8XX_LPSC1_L3_CBA_RAM 31 |
184 | 184 | ||
185 | /* TNETV107X LPSC Assignments */ | ||
186 | #define TNETV107X_LPSC_ARM 0 | ||
187 | #define TNETV107X_LPSC_GEM 1 | ||
188 | #define TNETV107X_LPSC_DDR2_PHY 2 | ||
189 | #define TNETV107X_LPSC_TPCC 3 | ||
190 | #define TNETV107X_LPSC_TPTC0 4 | ||
191 | #define TNETV107X_LPSC_TPTC1 5 | ||
192 | #define TNETV107X_LPSC_RAM 6 | ||
193 | #define TNETV107X_LPSC_MBX_LITE 7 | ||
194 | #define TNETV107X_LPSC_LCD 8 | ||
195 | #define TNETV107X_LPSC_ETHSS 9 | ||
196 | #define TNETV107X_LPSC_AEMIF 10 | ||
197 | #define TNETV107X_LPSC_CHIP_CFG 11 | ||
198 | #define TNETV107X_LPSC_TSC 12 | ||
199 | #define TNETV107X_LPSC_ROM 13 | ||
200 | #define TNETV107X_LPSC_UART2 14 | ||
201 | #define TNETV107X_LPSC_PKTSEC 15 | ||
202 | #define TNETV107X_LPSC_SECCTL 16 | ||
203 | #define TNETV107X_LPSC_KEYMGR 17 | ||
204 | #define TNETV107X_LPSC_KEYPAD 18 | ||
205 | #define TNETV107X_LPSC_GPIO 19 | ||
206 | #define TNETV107X_LPSC_MDIO 20 | ||
207 | #define TNETV107X_LPSC_SDIO0 21 | ||
208 | #define TNETV107X_LPSC_UART0 22 | ||
209 | #define TNETV107X_LPSC_UART1 23 | ||
210 | #define TNETV107X_LPSC_TIMER0 24 | ||
211 | #define TNETV107X_LPSC_TIMER1 25 | ||
212 | #define TNETV107X_LPSC_WDT_ARM 26 | ||
213 | #define TNETV107X_LPSC_WDT_DSP 27 | ||
214 | #define TNETV107X_LPSC_SSP 28 | ||
215 | #define TNETV107X_LPSC_TDM0 29 | ||
216 | #define TNETV107X_LPSC_VLYNQ 30 | ||
217 | #define TNETV107X_LPSC_MCDMA 31 | ||
218 | #define TNETV107X_LPSC_USB0 32 | ||
219 | #define TNETV107X_LPSC_TDM1 33 | ||
220 | #define TNETV107X_LPSC_DEBUGSS 34 | ||
221 | #define TNETV107X_LPSC_ETHSS_RGMII 35 | ||
222 | #define TNETV107X_LPSC_SYSTEM 36 | ||
223 | #define TNETV107X_LPSC_IMCOP 37 | ||
224 | #define TNETV107X_LPSC_SPARE 38 | ||
225 | #define TNETV107X_LPSC_SDIO1 39 | ||
226 | #define TNETV107X_LPSC_USB1 40 | ||
227 | #define TNETV107X_LPSC_USBSS 41 | ||
228 | #define TNETV107X_LPSC_DDR2_EMIF1_VRST 42 | ||
229 | #define TNETV107X_LPSC_DDR2_EMIF2_VCTL_RST 43 | ||
230 | #define TNETV107X_LPSC_MAX 44 | ||
231 | |||
232 | /* PSC register offsets */ | 185 | /* PSC register offsets */ |
233 | #define EPCPR 0x070 | 186 | #define EPCPR 0x070 |
234 | #define PTCMD 0x120 | 187 | #define PTCMD 0x120 |
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index ce402cd21fa0..d4b4aa87964f 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
@@ -23,14 +23,6 @@ | |||
23 | #define DA8XX_UART1_BASE (IO_PHYS + 0x10c000) | 23 | #define DA8XX_UART1_BASE (IO_PHYS + 0x10c000) |
24 | #define DA8XX_UART2_BASE (IO_PHYS + 0x10d000) | 24 | #define DA8XX_UART2_BASE (IO_PHYS + 0x10d000) |
25 | 25 | ||
26 | #define TNETV107X_UART0_BASE 0x08108100 | ||
27 | #define TNETV107X_UART1_BASE 0x08088400 | ||
28 | #define TNETV107X_UART2_BASE 0x08108300 | ||
29 | |||
30 | #define TNETV107X_UART0_VIRT IOMEM(0xfee08100) | ||
31 | #define TNETV107X_UART1_VIRT IOMEM(0xfed88400) | ||
32 | #define TNETV107X_UART2_VIRT IOMEM(0xfee08300) | ||
33 | |||
34 | /* DaVinci UART register offsets */ | 26 | /* DaVinci UART register offsets */ |
35 | #define UART_DAVINCI_PWREMU 0x0c | 27 | #define UART_DAVINCI_PWREMU 0x0c |
36 | #define UART_DM646X_SCR 0x10 | 28 | #define UART_DM646X_SCR 0x10 |
diff --git a/arch/arm/mach-davinci/include/mach/tnetv107x.h b/arch/arm/mach-davinci/include/mach/tnetv107x.h deleted file mode 100644 index 494fcf5ccfe1..000000000000 --- a/arch/arm/mach-davinci/include/mach/tnetv107x.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | /* | ||
2 | * Texas Instruments TNETV107X SoC Specific Defines | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | #ifndef __ASM_ARCH_DAVINCI_TNETV107X_H | ||
16 | #define __ASM_ARCH_DAVINCI_TNETV107X_H | ||
17 | |||
18 | #include <asm/sizes.h> | ||
19 | |||
20 | #define TNETV107X_DDR_BASE 0x80000000 | ||
21 | |||
22 | /* | ||
23 | * Fixed mapping for early init starts here. If low-level debug is enabled, | ||
24 | * this area also gets mapped via io_pg_offset and io_phys by the boot code. | ||
25 | * To fit in with the io_pg_offset calculation, the io base address selected | ||
26 | * here _must_ be a multiple of 2^20. | ||
27 | */ | ||
28 | #define TNETV107X_IO_BASE 0x08000000 | ||
29 | #define TNETV107X_IO_VIRT (IO_VIRT + SZ_1M) | ||
30 | |||
31 | #define TNETV107X_N_GPIO 65 | ||
32 | |||
33 | #ifndef __ASSEMBLY__ | ||
34 | |||
35 | #include <linux/serial_8250.h> | ||
36 | #include <linux/input/matrix_keypad.h> | ||
37 | #include <linux/mfd/ti_ssp.h> | ||
38 | #include <linux/reboot.h> | ||
39 | |||
40 | #include <linux/platform_data/mmc-davinci.h> | ||
41 | #include <linux/platform_data/mtd-davinci.h> | ||
42 | #include <mach/serial.h> | ||
43 | |||
44 | struct tnetv107x_device_info { | ||
45 | struct davinci_mmc_config *mmc_config[2]; /* 2 controllers */ | ||
46 | struct davinci_nand_pdata *nand_config[4]; /* 4 chipsels */ | ||
47 | struct matrix_keypad_platform_data *keypad_config; | ||
48 | struct ti_ssp_data *ssp_config; | ||
49 | }; | ||
50 | |||
51 | extern struct platform_device tnetv107x_wdt_device; | ||
52 | extern struct platform_device tnetv107x_serial_device[]; | ||
53 | |||
54 | extern void tnetv107x_init(void); | ||
55 | extern void tnetv107x_devices_init(struct tnetv107x_device_info *); | ||
56 | extern void tnetv107x_irq_init(void); | ||
57 | void tnetv107x_restart(enum reboot_mode mode, const char *cmd); | ||
58 | |||
59 | #endif | ||
60 | |||
61 | #endif /* __ASM_ARCH_DAVINCI_TNETV107X_H */ | ||
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index f49c2916aa3a..8fb97b93b6bb 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h | |||
@@ -68,9 +68,6 @@ static inline void set_uart_info(u32 phys) | |||
68 | #define DEBUG_LL_DA8XX(machine, port) \ | 68 | #define DEBUG_LL_DA8XX(machine, port) \ |
69 | _DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE) | 69 | _DEBUG_LL_ENTRY(machine, DA8XX_UART##port##_BASE) |
70 | 70 | ||
71 | #define DEBUG_LL_TNETV107X(machine, port) \ | ||
72 | _DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE) | ||
73 | |||
74 | static inline void __arch_decomp_setup(unsigned long arch_id) | 71 | static inline void __arch_decomp_setup(unsigned long arch_id) |
75 | { | 72 | { |
76 | /* | 73 | /* |
@@ -94,9 +91,6 @@ static inline void __arch_decomp_setup(unsigned long arch_id) | |||
94 | DEBUG_LL_DA8XX(davinci_da850_evm, 2); | 91 | DEBUG_LL_DA8XX(davinci_da850_evm, 2); |
95 | DEBUG_LL_DA8XX(mityomapl138, 1); | 92 | DEBUG_LL_DA8XX(mityomapl138, 1); |
96 | DEBUG_LL_DA8XX(omapl138_hawkboard, 2); | 93 | DEBUG_LL_DA8XX(omapl138_hawkboard, 2); |
97 | |||
98 | /* TNETV107x boards */ | ||
99 | DEBUG_LL_TNETV107X(tnetv107x, 1); | ||
100 | } while (0); | 94 | } while (0); |
101 | } | 95 | } |
102 | 96 | ||
diff --git a/arch/arm/mach-davinci/tnetv107x.c b/arch/arm/mach-davinci/tnetv107x.c deleted file mode 100644 index f4d7fbb24b3b..000000000000 --- a/arch/arm/mach-davinci/tnetv107x.c +++ /dev/null | |||
@@ -1,766 +0,0 @@ | |||
1 | /* | ||
2 | * Texas Instruments TNETV107X SoC Support | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | #include <linux/gpio.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/clk.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/reboot.h> | ||
23 | |||
24 | #include <asm/mach/map.h> | ||
25 | |||
26 | #include <mach/common.h> | ||
27 | #include <mach/time.h> | ||
28 | #include <mach/cputype.h> | ||
29 | #include <mach/psc.h> | ||
30 | #include <mach/cp_intc.h> | ||
31 | #include <mach/irqs.h> | ||
32 | #include <mach/hardware.h> | ||
33 | #include <mach/tnetv107x.h> | ||
34 | #include <mach/gpio-davinci.h> | ||
35 | |||
36 | #include "clock.h" | ||
37 | #include "mux.h" | ||
38 | |||
39 | /* Base addresses for on-chip devices */ | ||
40 | #define TNETV107X_INTC_BASE 0x03000000 | ||
41 | #define TNETV107X_TIMER0_BASE 0x08086500 | ||
42 | #define TNETV107X_TIMER1_BASE 0x08086600 | ||
43 | #define TNETV107X_CHIP_CFG_BASE 0x08087000 | ||
44 | #define TNETV107X_GPIO_BASE 0x08088000 | ||
45 | #define TNETV107X_CLOCK_CONTROL_BASE 0x0808a000 | ||
46 | #define TNETV107X_PSC_BASE 0x0808b000 | ||
47 | |||
48 | /* Reference clock frequencies */ | ||
49 | #define OSC_FREQ_ONCHIP (24000 * 1000) | ||
50 | #define OSC_FREQ_OFFCHIP_SYS (25000 * 1000) | ||
51 | #define OSC_FREQ_OFFCHIP_ETH (25000 * 1000) | ||
52 | #define OSC_FREQ_OFFCHIP_TDM (19200 * 1000) | ||
53 | |||
54 | #define N_PLLS 3 | ||
55 | |||
56 | /* Clock Control Registers */ | ||
57 | struct clk_ctrl_regs { | ||
58 | u32 pll_bypass; | ||
59 | u32 _reserved0; | ||
60 | u32 gem_lrst; | ||
61 | u32 _reserved1; | ||
62 | u32 pll_unlock_stat; | ||
63 | u32 sys_unlock; | ||
64 | u32 eth_unlock; | ||
65 | u32 tdm_unlock; | ||
66 | }; | ||
67 | |||
68 | /* SSPLL Registers */ | ||
69 | struct sspll_regs { | ||
70 | u32 modes; | ||
71 | u32 post_div; | ||
72 | u32 pre_div; | ||
73 | u32 mult_factor; | ||
74 | u32 divider_range; | ||
75 | u32 bw_divider; | ||
76 | u32 spr_amount; | ||
77 | u32 spr_rate_div; | ||
78 | u32 diag; | ||
79 | }; | ||
80 | |||
81 | /* Watchdog Timer Registers */ | ||
82 | struct wdt_regs { | ||
83 | u32 kick_lock; | ||
84 | u32 kick; | ||
85 | u32 change_lock; | ||
86 | u32 change ; | ||
87 | u32 disable_lock; | ||
88 | u32 disable; | ||
89 | u32 prescale_lock; | ||
90 | u32 prescale; | ||
91 | }; | ||
92 | |||
93 | static struct clk_ctrl_regs __iomem *clk_ctrl_regs; | ||
94 | |||
95 | static struct sspll_regs __iomem *sspll_regs[N_PLLS]; | ||
96 | static int sspll_regs_base[N_PLLS] = { 0x40, 0x80, 0xc0 }; | ||
97 | |||
98 | /* PLL bypass bit shifts in clk_ctrl_regs->pll_bypass register */ | ||
99 | static u32 bypass_mask[N_PLLS] = { BIT(0), BIT(2), BIT(1) }; | ||
100 | |||
101 | /* offchip (external) reference clock frequencies */ | ||
102 | static u32 pll_ext_freq[] = { | ||
103 | OSC_FREQ_OFFCHIP_SYS, | ||
104 | OSC_FREQ_OFFCHIP_TDM, | ||
105 | OSC_FREQ_OFFCHIP_ETH | ||
106 | }; | ||
107 | |||
108 | /* PSC control registers */ | ||
109 | static u32 psc_regs[] = { TNETV107X_PSC_BASE }; | ||
110 | |||
111 | /* Host map for interrupt controller */ | ||
112 | static u32 intc_host_map[] = { 0x01010000, 0x01010101, -1 }; | ||
113 | |||
114 | static unsigned long clk_sspll_recalc(struct clk *clk); | ||
115 | |||
116 | /* Level 1 - the PLLs */ | ||
117 | #define define_pll_clk(cname, pll, divmask, base) \ | ||
118 | static struct pll_data pll_##cname##_data = { \ | ||
119 | .num = pll, \ | ||
120 | .div_ratio_mask = divmask, \ | ||
121 | .phys_base = base + \ | ||
122 | TNETV107X_CLOCK_CONTROL_BASE, \ | ||
123 | }; \ | ||
124 | static struct clk pll_##cname##_clk = { \ | ||
125 | .name = "pll_" #cname "_clk", \ | ||
126 | .pll_data = &pll_##cname##_data, \ | ||
127 | .flags = CLK_PLL, \ | ||
128 | .recalc = clk_sspll_recalc, \ | ||
129 | } | ||
130 | |||
131 | define_pll_clk(sys, 0, 0x1ff, 0x600); | ||
132 | define_pll_clk(tdm, 1, 0x0ff, 0x200); | ||
133 | define_pll_clk(eth, 2, 0x0ff, 0x400); | ||
134 | |||
135 | /* Level 2 - divided outputs from the PLLs */ | ||
136 | #define define_pll_div_clk(pll, cname, div) \ | ||
137 | static struct clk pll##_##cname##_clk = { \ | ||
138 | .name = #pll "_" #cname "_clk", \ | ||
139 | .parent = &pll_##pll##_clk, \ | ||
140 | .flags = CLK_PLL, \ | ||
141 | .div_reg = PLLDIV##div, \ | ||
142 | .set_rate = davinci_set_sysclk_rate, \ | ||
143 | } | ||
144 | |||
145 | define_pll_div_clk(sys, arm1176, 1); | ||
146 | define_pll_div_clk(sys, dsp, 2); | ||
147 | define_pll_div_clk(sys, ddr, 3); | ||
148 | define_pll_div_clk(sys, full, 4); | ||
149 | define_pll_div_clk(sys, lcd, 5); | ||
150 | define_pll_div_clk(sys, vlynq_ref, 6); | ||
151 | define_pll_div_clk(sys, tsc, 7); | ||
152 | define_pll_div_clk(sys, half, 8); | ||
153 | |||
154 | define_pll_div_clk(eth, 5mhz, 1); | ||
155 | define_pll_div_clk(eth, 50mhz, 2); | ||
156 | define_pll_div_clk(eth, 125mhz, 3); | ||
157 | define_pll_div_clk(eth, 250mhz, 4); | ||
158 | define_pll_div_clk(eth, 25mhz, 5); | ||
159 | |||
160 | define_pll_div_clk(tdm, 0, 1); | ||
161 | define_pll_div_clk(tdm, extra, 2); | ||
162 | define_pll_div_clk(tdm, 1, 3); | ||
163 | |||
164 | |||
165 | /* Level 3 - LPSC gated clocks */ | ||
166 | #define __lpsc_clk(cname, _parent, mod, flg) \ | ||
167 | static struct clk clk_##cname = { \ | ||
168 | .name = #cname, \ | ||
169 | .parent = &_parent, \ | ||
170 | .lpsc = TNETV107X_LPSC_##mod,\ | ||
171 | .flags = flg, \ | ||
172 | } | ||
173 | |||
174 | #define lpsc_clk_enabled(cname, parent, mod) \ | ||
175 | __lpsc_clk(cname, parent, mod, ALWAYS_ENABLED) | ||
176 | |||
177 | #define lpsc_clk(cname, parent, mod) \ | ||
178 | __lpsc_clk(cname, parent, mod, 0) | ||
179 | |||
180 | lpsc_clk_enabled(arm, sys_arm1176_clk, ARM); | ||
181 | lpsc_clk_enabled(gem, sys_dsp_clk, GEM); | ||
182 | lpsc_clk_enabled(ddr2_phy, sys_ddr_clk, DDR2_PHY); | ||
183 | lpsc_clk_enabled(tpcc, sys_full_clk, TPCC); | ||
184 | lpsc_clk_enabled(tptc0, sys_full_clk, TPTC0); | ||
185 | lpsc_clk_enabled(tptc1, sys_full_clk, TPTC1); | ||
186 | lpsc_clk_enabled(ram, sys_full_clk, RAM); | ||
187 | lpsc_clk_enabled(aemif, sys_full_clk, AEMIF); | ||
188 | lpsc_clk_enabled(chipcfg, sys_half_clk, CHIP_CFG); | ||
189 | lpsc_clk_enabled(rom, sys_half_clk, ROM); | ||
190 | lpsc_clk_enabled(secctl, sys_half_clk, SECCTL); | ||
191 | lpsc_clk_enabled(keymgr, sys_half_clk, KEYMGR); | ||
192 | lpsc_clk_enabled(gpio, sys_half_clk, GPIO); | ||
193 | lpsc_clk_enabled(debugss, sys_half_clk, DEBUGSS); | ||
194 | lpsc_clk_enabled(system, sys_half_clk, SYSTEM); | ||
195 | lpsc_clk_enabled(ddr2_vrst, sys_ddr_clk, DDR2_EMIF1_VRST); | ||
196 | lpsc_clk_enabled(ddr2_vctl_rst, sys_ddr_clk, DDR2_EMIF2_VCTL_RST); | ||
197 | lpsc_clk_enabled(wdt_arm, sys_half_clk, WDT_ARM); | ||
198 | lpsc_clk_enabled(timer1, sys_half_clk, TIMER1); | ||
199 | |||
200 | lpsc_clk(mbx_lite, sys_arm1176_clk, MBX_LITE); | ||
201 | lpsc_clk(ethss, eth_125mhz_clk, ETHSS); | ||
202 | lpsc_clk(tsc, sys_tsc_clk, TSC); | ||
203 | lpsc_clk(uart0, sys_half_clk, UART0); | ||
204 | lpsc_clk(uart1, sys_half_clk, UART1); | ||
205 | lpsc_clk(uart2, sys_half_clk, UART2); | ||
206 | lpsc_clk(pktsec, sys_half_clk, PKTSEC); | ||
207 | lpsc_clk(keypad, sys_half_clk, KEYPAD); | ||
208 | lpsc_clk(mdio, sys_half_clk, MDIO); | ||
209 | lpsc_clk(sdio0, sys_half_clk, SDIO0); | ||
210 | lpsc_clk(sdio1, sys_half_clk, SDIO1); | ||
211 | lpsc_clk(timer0, sys_half_clk, TIMER0); | ||
212 | lpsc_clk(wdt_dsp, sys_half_clk, WDT_DSP); | ||
213 | lpsc_clk(ssp, sys_half_clk, SSP); | ||
214 | lpsc_clk(tdm0, tdm_0_clk, TDM0); | ||
215 | lpsc_clk(tdm1, tdm_1_clk, TDM1); | ||
216 | lpsc_clk(vlynq, sys_vlynq_ref_clk, VLYNQ); | ||
217 | lpsc_clk(mcdma, sys_half_clk, MCDMA); | ||
218 | lpsc_clk(usbss, sys_half_clk, USBSS); | ||
219 | lpsc_clk(usb0, clk_usbss, USB0); | ||
220 | lpsc_clk(usb1, clk_usbss, USB1); | ||
221 | lpsc_clk(ethss_rgmii, eth_250mhz_clk, ETHSS_RGMII); | ||
222 | lpsc_clk(imcop, sys_dsp_clk, IMCOP); | ||
223 | lpsc_clk(spare, sys_half_clk, SPARE); | ||
224 | |||
225 | /* LCD needs a full power down to clear controller state */ | ||
226 | __lpsc_clk(lcd, sys_lcd_clk, LCD, PSC_SWRSTDISABLE); | ||
227 | |||
228 | |||
229 | /* Level 4 - leaf clocks for LPSC modules shared across drivers */ | ||
230 | static struct clk clk_rng = { .name = "rng", .parent = &clk_pktsec }; | ||
231 | static struct clk clk_pka = { .name = "pka", .parent = &clk_pktsec }; | ||
232 | |||
233 | static struct clk_lookup clks[] = { | ||
234 | CLK(NULL, "pll_sys_clk", &pll_sys_clk), | ||
235 | CLK(NULL, "pll_eth_clk", &pll_eth_clk), | ||
236 | CLK(NULL, "pll_tdm_clk", &pll_tdm_clk), | ||
237 | CLK(NULL, "sys_arm1176_clk", &sys_arm1176_clk), | ||
238 | CLK(NULL, "sys_dsp_clk", &sys_dsp_clk), | ||
239 | CLK(NULL, "sys_ddr_clk", &sys_ddr_clk), | ||
240 | CLK(NULL, "sys_full_clk", &sys_full_clk), | ||
241 | CLK(NULL, "sys_lcd_clk", &sys_lcd_clk), | ||
242 | CLK(NULL, "sys_vlynq_ref_clk", &sys_vlynq_ref_clk), | ||
243 | CLK(NULL, "sys_tsc_clk", &sys_tsc_clk), | ||
244 | CLK(NULL, "sys_half_clk", &sys_half_clk), | ||
245 | CLK(NULL, "eth_5mhz_clk", ð_5mhz_clk), | ||
246 | CLK(NULL, "eth_50mhz_clk", ð_50mhz_clk), | ||
247 | CLK(NULL, "eth_125mhz_clk", ð_125mhz_clk), | ||
248 | CLK(NULL, "eth_250mhz_clk", ð_250mhz_clk), | ||
249 | CLK(NULL, "eth_25mhz_clk", ð_25mhz_clk), | ||
250 | CLK(NULL, "tdm_0_clk", &tdm_0_clk), | ||
251 | CLK(NULL, "tdm_extra_clk", &tdm_extra_clk), | ||
252 | CLK(NULL, "tdm_1_clk", &tdm_1_clk), | ||
253 | CLK(NULL, "clk_arm", &clk_arm), | ||
254 | CLK(NULL, "clk_gem", &clk_gem), | ||
255 | CLK(NULL, "clk_ddr2_phy", &clk_ddr2_phy), | ||
256 | CLK(NULL, "clk_tpcc", &clk_tpcc), | ||
257 | CLK(NULL, "clk_tptc0", &clk_tptc0), | ||
258 | CLK(NULL, "clk_tptc1", &clk_tptc1), | ||
259 | CLK(NULL, "clk_ram", &clk_ram), | ||
260 | CLK(NULL, "clk_mbx_lite", &clk_mbx_lite), | ||
261 | CLK("tnetv107x-fb.0", NULL, &clk_lcd), | ||
262 | CLK(NULL, "clk_ethss", &clk_ethss), | ||
263 | CLK(NULL, "aemif", &clk_aemif), | ||
264 | CLK(NULL, "clk_chipcfg", &clk_chipcfg), | ||
265 | CLK("tnetv107x-ts.0", NULL, &clk_tsc), | ||
266 | CLK(NULL, "clk_rom", &clk_rom), | ||
267 | CLK("serial8250.2", NULL, &clk_uart2), | ||
268 | CLK(NULL, "clk_pktsec", &clk_pktsec), | ||
269 | CLK("tnetv107x-rng.0", NULL, &clk_rng), | ||
270 | CLK("tnetv107x-pka.0", NULL, &clk_pka), | ||
271 | CLK(NULL, "clk_secctl", &clk_secctl), | ||
272 | CLK(NULL, "clk_keymgr", &clk_keymgr), | ||
273 | CLK("tnetv107x-keypad.0", NULL, &clk_keypad), | ||
274 | CLK(NULL, "clk_gpio", &clk_gpio), | ||
275 | CLK(NULL, "clk_mdio", &clk_mdio), | ||
276 | CLK("dm6441-mmc.0", NULL, &clk_sdio0), | ||
277 | CLK("serial8250.0", NULL, &clk_uart0), | ||
278 | CLK("serial8250.1", NULL, &clk_uart1), | ||
279 | CLK(NULL, "timer0", &clk_timer0), | ||
280 | CLK(NULL, "timer1", &clk_timer1), | ||
281 | CLK("tnetv107x_wdt.0", NULL, &clk_wdt_arm), | ||
282 | CLK(NULL, "clk_wdt_dsp", &clk_wdt_dsp), | ||
283 | CLK("ti-ssp", NULL, &clk_ssp), | ||
284 | CLK(NULL, "clk_tdm0", &clk_tdm0), | ||
285 | CLK(NULL, "clk_vlynq", &clk_vlynq), | ||
286 | CLK(NULL, "clk_mcdma", &clk_mcdma), | ||
287 | CLK(NULL, "clk_usbss", &clk_usbss), | ||
288 | CLK(NULL, "clk_usb0", &clk_usb0), | ||
289 | CLK(NULL, "clk_usb1", &clk_usb1), | ||
290 | CLK(NULL, "clk_tdm1", &clk_tdm1), | ||
291 | CLK(NULL, "clk_debugss", &clk_debugss), | ||
292 | CLK(NULL, "clk_ethss_rgmii", &clk_ethss_rgmii), | ||
293 | CLK(NULL, "clk_system", &clk_system), | ||
294 | CLK(NULL, "clk_imcop", &clk_imcop), | ||
295 | CLK(NULL, "clk_spare", &clk_spare), | ||
296 | CLK("dm6441-mmc.1", NULL, &clk_sdio1), | ||
297 | CLK(NULL, "clk_ddr2_vrst", &clk_ddr2_vrst), | ||
298 | CLK(NULL, "clk_ddr2_vctl_rst", &clk_ddr2_vctl_rst), | ||
299 | CLK(NULL, NULL, NULL), | ||
300 | }; | ||
301 | |||
302 | static const struct mux_config pins[] = { | ||
303 | #ifdef CONFIG_DAVINCI_MUX | ||
304 | MUX_CFG(TNETV107X, ASR_A00, 0, 0, 0x1f, 0x00, false) | ||
305 | MUX_CFG(TNETV107X, GPIO32, 0, 0, 0x1f, 0x04, false) | ||
306 | MUX_CFG(TNETV107X, ASR_A01, 0, 5, 0x1f, 0x00, false) | ||
307 | MUX_CFG(TNETV107X, GPIO33, 0, 5, 0x1f, 0x04, false) | ||
308 | MUX_CFG(TNETV107X, ASR_A02, 0, 10, 0x1f, 0x00, false) | ||
309 | MUX_CFG(TNETV107X, GPIO34, 0, 10, 0x1f, 0x04, false) | ||
310 | MUX_CFG(TNETV107X, ASR_A03, 0, 15, 0x1f, 0x00, false) | ||
311 | MUX_CFG(TNETV107X, GPIO35, 0, 15, 0x1f, 0x04, false) | ||
312 | MUX_CFG(TNETV107X, ASR_A04, 0, 20, 0x1f, 0x00, false) | ||
313 | MUX_CFG(TNETV107X, GPIO36, 0, 20, 0x1f, 0x04, false) | ||
314 | MUX_CFG(TNETV107X, ASR_A05, 0, 25, 0x1f, 0x00, false) | ||
315 | MUX_CFG(TNETV107X, GPIO37, 0, 25, 0x1f, 0x04, false) | ||
316 | MUX_CFG(TNETV107X, ASR_A06, 1, 0, 0x1f, 0x00, false) | ||
317 | MUX_CFG(TNETV107X, GPIO38, 1, 0, 0x1f, 0x04, false) | ||
318 | MUX_CFG(TNETV107X, ASR_A07, 1, 5, 0x1f, 0x00, false) | ||
319 | MUX_CFG(TNETV107X, GPIO39, 1, 5, 0x1f, 0x04, false) | ||
320 | MUX_CFG(TNETV107X, ASR_A08, 1, 10, 0x1f, 0x00, false) | ||
321 | MUX_CFG(TNETV107X, GPIO40, 1, 10, 0x1f, 0x04, false) | ||
322 | MUX_CFG(TNETV107X, ASR_A09, 1, 15, 0x1f, 0x00, false) | ||
323 | MUX_CFG(TNETV107X, GPIO41, 1, 15, 0x1f, 0x04, false) | ||
324 | MUX_CFG(TNETV107X, ASR_A10, 1, 20, 0x1f, 0x00, false) | ||
325 | MUX_CFG(TNETV107X, GPIO42, 1, 20, 0x1f, 0x04, false) | ||
326 | MUX_CFG(TNETV107X, ASR_A11, 1, 25, 0x1f, 0x00, false) | ||
327 | MUX_CFG(TNETV107X, BOOT_STRP_0, 1, 25, 0x1f, 0x04, false) | ||
328 | MUX_CFG(TNETV107X, ASR_A12, 2, 0, 0x1f, 0x00, false) | ||
329 | MUX_CFG(TNETV107X, BOOT_STRP_1, 2, 0, 0x1f, 0x04, false) | ||
330 | MUX_CFG(TNETV107X, ASR_A13, 2, 5, 0x1f, 0x00, false) | ||
331 | MUX_CFG(TNETV107X, GPIO43, 2, 5, 0x1f, 0x04, false) | ||
332 | MUX_CFG(TNETV107X, ASR_A14, 2, 10, 0x1f, 0x00, false) | ||
333 | MUX_CFG(TNETV107X, GPIO44, 2, 10, 0x1f, 0x04, false) | ||
334 | MUX_CFG(TNETV107X, ASR_A15, 2, 15, 0x1f, 0x00, false) | ||
335 | MUX_CFG(TNETV107X, GPIO45, 2, 15, 0x1f, 0x04, false) | ||
336 | MUX_CFG(TNETV107X, ASR_A16, 2, 20, 0x1f, 0x00, false) | ||
337 | MUX_CFG(TNETV107X, GPIO46, 2, 20, 0x1f, 0x04, false) | ||
338 | MUX_CFG(TNETV107X, ASR_A17, 2, 25, 0x1f, 0x00, false) | ||
339 | MUX_CFG(TNETV107X, GPIO47, 2, 25, 0x1f, 0x04, false) | ||
340 | MUX_CFG(TNETV107X, ASR_A18, 3, 0, 0x1f, 0x00, false) | ||
341 | MUX_CFG(TNETV107X, GPIO48, 3, 0, 0x1f, 0x04, false) | ||
342 | MUX_CFG(TNETV107X, SDIO1_DATA3_0, 3, 0, 0x1f, 0x1c, false) | ||
343 | MUX_CFG(TNETV107X, ASR_A19, 3, 5, 0x1f, 0x00, false) | ||
344 | MUX_CFG(TNETV107X, GPIO49, 3, 5, 0x1f, 0x04, false) | ||
345 | MUX_CFG(TNETV107X, SDIO1_DATA2_0, 3, 5, 0x1f, 0x1c, false) | ||
346 | MUX_CFG(TNETV107X, ASR_A20, 3, 10, 0x1f, 0x00, false) | ||
347 | MUX_CFG(TNETV107X, GPIO50, 3, 10, 0x1f, 0x04, false) | ||
348 | MUX_CFG(TNETV107X, SDIO1_DATA1_0, 3, 10, 0x1f, 0x1c, false) | ||
349 | MUX_CFG(TNETV107X, ASR_A21, 3, 15, 0x1f, 0x00, false) | ||
350 | MUX_CFG(TNETV107X, GPIO51, 3, 15, 0x1f, 0x04, false) | ||
351 | MUX_CFG(TNETV107X, SDIO1_DATA0_0, 3, 15, 0x1f, 0x1c, false) | ||
352 | MUX_CFG(TNETV107X, ASR_A22, 3, 20, 0x1f, 0x00, false) | ||
353 | MUX_CFG(TNETV107X, GPIO52, 3, 20, 0x1f, 0x04, false) | ||
354 | MUX_CFG(TNETV107X, SDIO1_CMD_0, 3, 20, 0x1f, 0x1c, false) | ||
355 | MUX_CFG(TNETV107X, ASR_A23, 3, 25, 0x1f, 0x00, false) | ||
356 | MUX_CFG(TNETV107X, GPIO53, 3, 25, 0x1f, 0x04, false) | ||
357 | MUX_CFG(TNETV107X, SDIO1_CLK_0, 3, 25, 0x1f, 0x1c, false) | ||
358 | MUX_CFG(TNETV107X, ASR_BA_1, 4, 0, 0x1f, 0x00, false) | ||
359 | MUX_CFG(TNETV107X, GPIO54, 4, 0, 0x1f, 0x04, false) | ||
360 | MUX_CFG(TNETV107X, SYS_PLL_CLK, 4, 0, 0x1f, 0x1c, false) | ||
361 | MUX_CFG(TNETV107X, ASR_CS0, 4, 5, 0x1f, 0x00, false) | ||
362 | MUX_CFG(TNETV107X, ASR_CS1, 4, 10, 0x1f, 0x00, false) | ||
363 | MUX_CFG(TNETV107X, ASR_CS2, 4, 15, 0x1f, 0x00, false) | ||
364 | MUX_CFG(TNETV107X, TDM_PLL_CLK, 4, 15, 0x1f, 0x1c, false) | ||
365 | MUX_CFG(TNETV107X, ASR_CS3, 4, 20, 0x1f, 0x00, false) | ||
366 | MUX_CFG(TNETV107X, ETH_PHY_CLK, 4, 20, 0x1f, 0x0c, false) | ||
367 | MUX_CFG(TNETV107X, ASR_D00, 4, 25, 0x1f, 0x00, false) | ||
368 | MUX_CFG(TNETV107X, GPIO55, 4, 25, 0x1f, 0x1c, false) | ||
369 | MUX_CFG(TNETV107X, ASR_D01, 5, 0, 0x1f, 0x00, false) | ||
370 | MUX_CFG(TNETV107X, GPIO56, 5, 0, 0x1f, 0x1c, false) | ||
371 | MUX_CFG(TNETV107X, ASR_D02, 5, 5, 0x1f, 0x00, false) | ||
372 | MUX_CFG(TNETV107X, GPIO57, 5, 5, 0x1f, 0x1c, false) | ||
373 | MUX_CFG(TNETV107X, ASR_D03, 5, 10, 0x1f, 0x00, false) | ||
374 | MUX_CFG(TNETV107X, GPIO58, 5, 10, 0x1f, 0x1c, false) | ||
375 | MUX_CFG(TNETV107X, ASR_D04, 5, 15, 0x1f, 0x00, false) | ||
376 | MUX_CFG(TNETV107X, GPIO59_0, 5, 15, 0x1f, 0x1c, false) | ||
377 | MUX_CFG(TNETV107X, ASR_D05, 5, 20, 0x1f, 0x00, false) | ||
378 | MUX_CFG(TNETV107X, GPIO60_0, 5, 20, 0x1f, 0x1c, false) | ||
379 | MUX_CFG(TNETV107X, ASR_D06, 5, 25, 0x1f, 0x00, false) | ||
380 | MUX_CFG(TNETV107X, GPIO61_0, 5, 25, 0x1f, 0x1c, false) | ||
381 | MUX_CFG(TNETV107X, ASR_D07, 6, 0, 0x1f, 0x00, false) | ||
382 | MUX_CFG(TNETV107X, GPIO62_0, 6, 0, 0x1f, 0x1c, false) | ||
383 | MUX_CFG(TNETV107X, ASR_D08, 6, 5, 0x1f, 0x00, false) | ||
384 | MUX_CFG(TNETV107X, GPIO63_0, 6, 5, 0x1f, 0x1c, false) | ||
385 | MUX_CFG(TNETV107X, ASR_D09, 6, 10, 0x1f, 0x00, false) | ||
386 | MUX_CFG(TNETV107X, GPIO64_0, 6, 10, 0x1f, 0x1c, false) | ||
387 | MUX_CFG(TNETV107X, ASR_D10, 6, 15, 0x1f, 0x00, false) | ||
388 | MUX_CFG(TNETV107X, SDIO1_DATA3_1, 6, 15, 0x1f, 0x1c, false) | ||
389 | MUX_CFG(TNETV107X, ASR_D11, 6, 20, 0x1f, 0x00, false) | ||
390 | MUX_CFG(TNETV107X, SDIO1_DATA2_1, 6, 20, 0x1f, 0x1c, false) | ||
391 | MUX_CFG(TNETV107X, ASR_D12, 6, 25, 0x1f, 0x00, false) | ||
392 | MUX_CFG(TNETV107X, SDIO1_DATA1_1, 6, 25, 0x1f, 0x1c, false) | ||
393 | MUX_CFG(TNETV107X, ASR_D13, 7, 0, 0x1f, 0x00, false) | ||
394 | MUX_CFG(TNETV107X, SDIO1_DATA0_1, 7, 0, 0x1f, 0x1c, false) | ||
395 | MUX_CFG(TNETV107X, ASR_D14, 7, 5, 0x1f, 0x00, false) | ||
396 | MUX_CFG(TNETV107X, SDIO1_CMD_1, 7, 5, 0x1f, 0x1c, false) | ||
397 | MUX_CFG(TNETV107X, ASR_D15, 7, 10, 0x1f, 0x00, false) | ||
398 | MUX_CFG(TNETV107X, SDIO1_CLK_1, 7, 10, 0x1f, 0x1c, false) | ||
399 | MUX_CFG(TNETV107X, ASR_OE, 7, 15, 0x1f, 0x00, false) | ||
400 | MUX_CFG(TNETV107X, BOOT_STRP_2, 7, 15, 0x1f, 0x04, false) | ||
401 | MUX_CFG(TNETV107X, ASR_RNW, 7, 20, 0x1f, 0x00, false) | ||
402 | MUX_CFG(TNETV107X, GPIO29_0, 7, 20, 0x1f, 0x04, false) | ||
403 | MUX_CFG(TNETV107X, ASR_WAIT, 7, 25, 0x1f, 0x00, false) | ||
404 | MUX_CFG(TNETV107X, GPIO30_0, 7, 25, 0x1f, 0x04, false) | ||
405 | MUX_CFG(TNETV107X, ASR_WE, 8, 0, 0x1f, 0x00, false) | ||
406 | MUX_CFG(TNETV107X, BOOT_STRP_3, 8, 0, 0x1f, 0x04, false) | ||
407 | MUX_CFG(TNETV107X, ASR_WE_DQM0, 8, 5, 0x1f, 0x00, false) | ||
408 | MUX_CFG(TNETV107X, GPIO31, 8, 5, 0x1f, 0x04, false) | ||
409 | MUX_CFG(TNETV107X, LCD_PD17_0, 8, 5, 0x1f, 0x1c, false) | ||
410 | MUX_CFG(TNETV107X, ASR_WE_DQM1, 8, 10, 0x1f, 0x00, false) | ||
411 | MUX_CFG(TNETV107X, ASR_BA0_0, 8, 10, 0x1f, 0x04, false) | ||
412 | MUX_CFG(TNETV107X, VLYNQ_CLK, 9, 0, 0x1f, 0x00, false) | ||
413 | MUX_CFG(TNETV107X, GPIO14, 9, 0, 0x1f, 0x04, false) | ||
414 | MUX_CFG(TNETV107X, LCD_PD19_0, 9, 0, 0x1f, 0x1c, false) | ||
415 | MUX_CFG(TNETV107X, VLYNQ_RXD0, 9, 5, 0x1f, 0x00, false) | ||
416 | MUX_CFG(TNETV107X, GPIO15, 9, 5, 0x1f, 0x04, false) | ||
417 | MUX_CFG(TNETV107X, LCD_PD20_0, 9, 5, 0x1f, 0x1c, false) | ||
418 | MUX_CFG(TNETV107X, VLYNQ_RXD1, 9, 10, 0x1f, 0x00, false) | ||
419 | MUX_CFG(TNETV107X, GPIO16, 9, 10, 0x1f, 0x04, false) | ||
420 | MUX_CFG(TNETV107X, LCD_PD21_0, 9, 10, 0x1f, 0x1c, false) | ||
421 | MUX_CFG(TNETV107X, VLYNQ_TXD0, 9, 15, 0x1f, 0x00, false) | ||
422 | MUX_CFG(TNETV107X, GPIO17, 9, 15, 0x1f, 0x04, false) | ||
423 | MUX_CFG(TNETV107X, LCD_PD22_0, 9, 15, 0x1f, 0x1c, false) | ||
424 | MUX_CFG(TNETV107X, VLYNQ_TXD1, 9, 20, 0x1f, 0x00, false) | ||
425 | MUX_CFG(TNETV107X, GPIO18, 9, 20, 0x1f, 0x04, false) | ||
426 | MUX_CFG(TNETV107X, LCD_PD23_0, 9, 20, 0x1f, 0x1c, false) | ||
427 | MUX_CFG(TNETV107X, SDIO0_CLK, 10, 0, 0x1f, 0x00, false) | ||
428 | MUX_CFG(TNETV107X, GPIO19, 10, 0, 0x1f, 0x04, false) | ||
429 | MUX_CFG(TNETV107X, SDIO0_CMD, 10, 5, 0x1f, 0x00, false) | ||
430 | MUX_CFG(TNETV107X, GPIO20, 10, 5, 0x1f, 0x04, false) | ||
431 | MUX_CFG(TNETV107X, SDIO0_DATA0, 10, 10, 0x1f, 0x00, false) | ||
432 | MUX_CFG(TNETV107X, GPIO21, 10, 10, 0x1f, 0x04, false) | ||
433 | MUX_CFG(TNETV107X, SDIO0_DATA1, 10, 15, 0x1f, 0x00, false) | ||
434 | MUX_CFG(TNETV107X, GPIO22, 10, 15, 0x1f, 0x04, false) | ||
435 | MUX_CFG(TNETV107X, SDIO0_DATA2, 10, 20, 0x1f, 0x00, false) | ||
436 | MUX_CFG(TNETV107X, GPIO23, 10, 20, 0x1f, 0x04, false) | ||
437 | MUX_CFG(TNETV107X, SDIO0_DATA3, 10, 25, 0x1f, 0x00, false) | ||
438 | MUX_CFG(TNETV107X, GPIO24, 10, 25, 0x1f, 0x04, false) | ||
439 | MUX_CFG(TNETV107X, EMU0, 11, 0, 0x1f, 0x00, false) | ||
440 | MUX_CFG(TNETV107X, EMU1, 11, 5, 0x1f, 0x00, false) | ||
441 | MUX_CFG(TNETV107X, RTCK, 12, 0, 0x1f, 0x00, false) | ||
442 | MUX_CFG(TNETV107X, TRST_N, 12, 5, 0x1f, 0x00, false) | ||
443 | MUX_CFG(TNETV107X, TCK, 12, 10, 0x1f, 0x00, false) | ||
444 | MUX_CFG(TNETV107X, TDI, 12, 15, 0x1f, 0x00, false) | ||
445 | MUX_CFG(TNETV107X, TDO, 12, 20, 0x1f, 0x00, false) | ||
446 | MUX_CFG(TNETV107X, TMS, 12, 25, 0x1f, 0x00, false) | ||
447 | MUX_CFG(TNETV107X, TDM1_CLK, 13, 0, 0x1f, 0x00, false) | ||
448 | MUX_CFG(TNETV107X, TDM1_RX, 13, 5, 0x1f, 0x00, false) | ||
449 | MUX_CFG(TNETV107X, TDM1_TX, 13, 10, 0x1f, 0x00, false) | ||
450 | MUX_CFG(TNETV107X, TDM1_FS, 13, 15, 0x1f, 0x00, false) | ||
451 | MUX_CFG(TNETV107X, KEYPAD_R0, 14, 0, 0x1f, 0x00, false) | ||
452 | MUX_CFG(TNETV107X, KEYPAD_R1, 14, 5, 0x1f, 0x00, false) | ||
453 | MUX_CFG(TNETV107X, KEYPAD_R2, 14, 10, 0x1f, 0x00, false) | ||
454 | MUX_CFG(TNETV107X, KEYPAD_R3, 14, 15, 0x1f, 0x00, false) | ||
455 | MUX_CFG(TNETV107X, KEYPAD_R4, 14, 20, 0x1f, 0x00, false) | ||
456 | MUX_CFG(TNETV107X, KEYPAD_R5, 14, 25, 0x1f, 0x00, false) | ||
457 | MUX_CFG(TNETV107X, KEYPAD_R6, 15, 0, 0x1f, 0x00, false) | ||
458 | MUX_CFG(TNETV107X, GPIO12, 15, 0, 0x1f, 0x04, false) | ||
459 | MUX_CFG(TNETV107X, KEYPAD_R7, 15, 5, 0x1f, 0x00, false) | ||
460 | MUX_CFG(TNETV107X, GPIO10, 15, 5, 0x1f, 0x04, false) | ||
461 | MUX_CFG(TNETV107X, KEYPAD_C0, 15, 10, 0x1f, 0x00, false) | ||
462 | MUX_CFG(TNETV107X, KEYPAD_C1, 15, 15, 0x1f, 0x00, false) | ||
463 | MUX_CFG(TNETV107X, KEYPAD_C2, 15, 20, 0x1f, 0x00, false) | ||
464 | MUX_CFG(TNETV107X, KEYPAD_C3, 15, 25, 0x1f, 0x00, false) | ||
465 | MUX_CFG(TNETV107X, KEYPAD_C4, 16, 0, 0x1f, 0x00, false) | ||
466 | MUX_CFG(TNETV107X, KEYPAD_C5, 16, 5, 0x1f, 0x00, false) | ||
467 | MUX_CFG(TNETV107X, KEYPAD_C6, 16, 10, 0x1f, 0x00, false) | ||
468 | MUX_CFG(TNETV107X, GPIO13, 16, 10, 0x1f, 0x04, false) | ||
469 | MUX_CFG(TNETV107X, TEST_CLK_IN, 16, 10, 0x1f, 0x0c, false) | ||
470 | MUX_CFG(TNETV107X, KEYPAD_C7, 16, 15, 0x1f, 0x00, false) | ||
471 | MUX_CFG(TNETV107X, GPIO11, 16, 15, 0x1f, 0x04, false) | ||
472 | MUX_CFG(TNETV107X, SSP0_0, 17, 0, 0x1f, 0x00, false) | ||
473 | MUX_CFG(TNETV107X, SCC_DCLK, 17, 0, 0x1f, 0x04, false) | ||
474 | MUX_CFG(TNETV107X, LCD_PD20_1, 17, 0, 0x1f, 0x0c, false) | ||
475 | MUX_CFG(TNETV107X, SSP0_1, 17, 5, 0x1f, 0x00, false) | ||
476 | MUX_CFG(TNETV107X, SCC_CS_N, 17, 5, 0x1f, 0x04, false) | ||
477 | MUX_CFG(TNETV107X, LCD_PD21_1, 17, 5, 0x1f, 0x0c, false) | ||
478 | MUX_CFG(TNETV107X, SSP0_2, 17, 10, 0x1f, 0x00, false) | ||
479 | MUX_CFG(TNETV107X, SCC_D, 17, 10, 0x1f, 0x04, false) | ||
480 | MUX_CFG(TNETV107X, LCD_PD22_1, 17, 10, 0x1f, 0x0c, false) | ||
481 | MUX_CFG(TNETV107X, SSP0_3, 17, 15, 0x1f, 0x00, false) | ||
482 | MUX_CFG(TNETV107X, SCC_RESETN, 17, 15, 0x1f, 0x04, false) | ||
483 | MUX_CFG(TNETV107X, LCD_PD23_1, 17, 15, 0x1f, 0x0c, false) | ||
484 | MUX_CFG(TNETV107X, SSP1_0, 18, 0, 0x1f, 0x00, false) | ||
485 | MUX_CFG(TNETV107X, GPIO25, 18, 0, 0x1f, 0x04, false) | ||
486 | MUX_CFG(TNETV107X, UART2_CTS, 18, 0, 0x1f, 0x0c, false) | ||
487 | MUX_CFG(TNETV107X, SSP1_1, 18, 5, 0x1f, 0x00, false) | ||
488 | MUX_CFG(TNETV107X, GPIO26, 18, 5, 0x1f, 0x04, false) | ||
489 | MUX_CFG(TNETV107X, UART2_RD, 18, 5, 0x1f, 0x0c, false) | ||
490 | MUX_CFG(TNETV107X, SSP1_2, 18, 10, 0x1f, 0x00, false) | ||
491 | MUX_CFG(TNETV107X, GPIO27, 18, 10, 0x1f, 0x04, false) | ||
492 | MUX_CFG(TNETV107X, UART2_RTS, 18, 10, 0x1f, 0x0c, false) | ||
493 | MUX_CFG(TNETV107X, SSP1_3, 18, 15, 0x1f, 0x00, false) | ||
494 | MUX_CFG(TNETV107X, GPIO28, 18, 15, 0x1f, 0x04, false) | ||
495 | MUX_CFG(TNETV107X, UART2_TD, 18, 15, 0x1f, 0x0c, false) | ||
496 | MUX_CFG(TNETV107X, UART0_CTS, 19, 0, 0x1f, 0x00, false) | ||
497 | MUX_CFG(TNETV107X, UART0_RD, 19, 5, 0x1f, 0x00, false) | ||
498 | MUX_CFG(TNETV107X, UART0_RTS, 19, 10, 0x1f, 0x00, false) | ||
499 | MUX_CFG(TNETV107X, UART0_TD, 19, 15, 0x1f, 0x00, false) | ||
500 | MUX_CFG(TNETV107X, UART1_RD, 19, 20, 0x1f, 0x00, false) | ||
501 | MUX_CFG(TNETV107X, UART1_TD, 19, 25, 0x1f, 0x00, false) | ||
502 | MUX_CFG(TNETV107X, LCD_AC_NCS, 20, 0, 0x1f, 0x00, false) | ||
503 | MUX_CFG(TNETV107X, LCD_HSYNC_RNW, 20, 5, 0x1f, 0x00, false) | ||
504 | MUX_CFG(TNETV107X, LCD_VSYNC_A0, 20, 10, 0x1f, 0x00, false) | ||
505 | MUX_CFG(TNETV107X, LCD_MCLK, 20, 15, 0x1f, 0x00, false) | ||
506 | MUX_CFG(TNETV107X, LCD_PD16_0, 20, 15, 0x1f, 0x0c, false) | ||
507 | MUX_CFG(TNETV107X, LCD_PCLK_E, 20, 20, 0x1f, 0x00, false) | ||
508 | MUX_CFG(TNETV107X, LCD_PD00, 20, 25, 0x1f, 0x00, false) | ||
509 | MUX_CFG(TNETV107X, LCD_PD01, 21, 0, 0x1f, 0x00, false) | ||
510 | MUX_CFG(TNETV107X, LCD_PD02, 21, 5, 0x1f, 0x00, false) | ||
511 | MUX_CFG(TNETV107X, LCD_PD03, 21, 10, 0x1f, 0x00, false) | ||
512 | MUX_CFG(TNETV107X, LCD_PD04, 21, 15, 0x1f, 0x00, false) | ||
513 | MUX_CFG(TNETV107X, LCD_PD05, 21, 20, 0x1f, 0x00, false) | ||
514 | MUX_CFG(TNETV107X, LCD_PD06, 21, 25, 0x1f, 0x00, false) | ||
515 | MUX_CFG(TNETV107X, LCD_PD07, 22, 0, 0x1f, 0x00, false) | ||
516 | MUX_CFG(TNETV107X, LCD_PD08, 22, 5, 0x1f, 0x00, false) | ||
517 | MUX_CFG(TNETV107X, GPIO59_1, 22, 5, 0x1f, 0x0c, false) | ||
518 | MUX_CFG(TNETV107X, LCD_PD09, 22, 10, 0x1f, 0x00, false) | ||
519 | MUX_CFG(TNETV107X, GPIO60_1, 22, 10, 0x1f, 0x0c, false) | ||
520 | MUX_CFG(TNETV107X, LCD_PD10, 22, 15, 0x1f, 0x00, false) | ||
521 | MUX_CFG(TNETV107X, ASR_BA0_1, 22, 15, 0x1f, 0x04, false) | ||
522 | MUX_CFG(TNETV107X, GPIO61_1, 22, 15, 0x1f, 0x0c, false) | ||
523 | MUX_CFG(TNETV107X, LCD_PD11, 22, 20, 0x1f, 0x00, false) | ||
524 | MUX_CFG(TNETV107X, GPIO62_1, 22, 20, 0x1f, 0x0c, false) | ||
525 | MUX_CFG(TNETV107X, LCD_PD12, 22, 25, 0x1f, 0x00, false) | ||
526 | MUX_CFG(TNETV107X, GPIO63_1, 22, 25, 0x1f, 0x0c, false) | ||
527 | MUX_CFG(TNETV107X, LCD_PD13, 23, 0, 0x1f, 0x00, false) | ||
528 | MUX_CFG(TNETV107X, GPIO64_1, 23, 0, 0x1f, 0x0c, false) | ||
529 | MUX_CFG(TNETV107X, LCD_PD14, 23, 5, 0x1f, 0x00, false) | ||
530 | MUX_CFG(TNETV107X, GPIO29_1, 23, 5, 0x1f, 0x0c, false) | ||
531 | MUX_CFG(TNETV107X, LCD_PD15, 23, 10, 0x1f, 0x00, false) | ||
532 | MUX_CFG(TNETV107X, GPIO30_1, 23, 10, 0x1f, 0x0c, false) | ||
533 | MUX_CFG(TNETV107X, EINT0, 24, 0, 0x1f, 0x00, false) | ||
534 | MUX_CFG(TNETV107X, GPIO08, 24, 0, 0x1f, 0x04, false) | ||
535 | MUX_CFG(TNETV107X, EINT1, 24, 5, 0x1f, 0x00, false) | ||
536 | MUX_CFG(TNETV107X, GPIO09, 24, 5, 0x1f, 0x04, false) | ||
537 | MUX_CFG(TNETV107X, GPIO00, 24, 10, 0x1f, 0x00, false) | ||
538 | MUX_CFG(TNETV107X, LCD_PD20_2, 24, 10, 0x1f, 0x04, false) | ||
539 | MUX_CFG(TNETV107X, TDM_CLK_IN_2, 24, 10, 0x1f, 0x0c, false) | ||
540 | MUX_CFG(TNETV107X, GPIO01, 24, 15, 0x1f, 0x00, false) | ||
541 | MUX_CFG(TNETV107X, LCD_PD21_2, 24, 15, 0x1f, 0x04, false) | ||
542 | MUX_CFG(TNETV107X, 24M_CLK_OUT_1, 24, 15, 0x1f, 0x0c, false) | ||
543 | MUX_CFG(TNETV107X, GPIO02, 24, 20, 0x1f, 0x00, false) | ||
544 | MUX_CFG(TNETV107X, LCD_PD22_2, 24, 20, 0x1f, 0x04, false) | ||
545 | MUX_CFG(TNETV107X, GPIO03, 24, 25, 0x1f, 0x00, false) | ||
546 | MUX_CFG(TNETV107X, LCD_PD23_2, 24, 25, 0x1f, 0x04, false) | ||
547 | MUX_CFG(TNETV107X, GPIO04, 25, 0, 0x1f, 0x00, false) | ||
548 | MUX_CFG(TNETV107X, LCD_PD16_1, 25, 0, 0x1f, 0x04, false) | ||
549 | MUX_CFG(TNETV107X, USB0_RXERR, 25, 0, 0x1f, 0x0c, false) | ||
550 | MUX_CFG(TNETV107X, GPIO05, 25, 5, 0x1f, 0x00, false) | ||
551 | MUX_CFG(TNETV107X, LCD_PD17_1, 25, 5, 0x1f, 0x04, false) | ||
552 | MUX_CFG(TNETV107X, TDM_CLK_IN_1, 25, 5, 0x1f, 0x0c, false) | ||
553 | MUX_CFG(TNETV107X, GPIO06, 25, 10, 0x1f, 0x00, false) | ||
554 | MUX_CFG(TNETV107X, LCD_PD18, 25, 10, 0x1f, 0x04, false) | ||
555 | MUX_CFG(TNETV107X, 24M_CLK_OUT_2, 25, 10, 0x1f, 0x0c, false) | ||
556 | MUX_CFG(TNETV107X, GPIO07, 25, 15, 0x1f, 0x00, false) | ||
557 | MUX_CFG(TNETV107X, LCD_PD19_1, 25, 15, 0x1f, 0x04, false) | ||
558 | MUX_CFG(TNETV107X, USB1_RXERR, 25, 15, 0x1f, 0x0c, false) | ||
559 | MUX_CFG(TNETV107X, ETH_PLL_CLK, 25, 15, 0x1f, 0x1c, false) | ||
560 | MUX_CFG(TNETV107X, MDIO, 26, 0, 0x1f, 0x00, false) | ||
561 | MUX_CFG(TNETV107X, MDC, 26, 5, 0x1f, 0x00, false) | ||
562 | MUX_CFG(TNETV107X, AIC_MUTE_STAT_N, 26, 10, 0x1f, 0x00, false) | ||
563 | MUX_CFG(TNETV107X, TDM0_CLK, 26, 10, 0x1f, 0x04, false) | ||
564 | MUX_CFG(TNETV107X, AIC_HNS_EN_N, 26, 15, 0x1f, 0x00, false) | ||
565 | MUX_CFG(TNETV107X, TDM0_FS, 26, 15, 0x1f, 0x04, false) | ||
566 | MUX_CFG(TNETV107X, AIC_HDS_EN_STAT_N, 26, 20, 0x1f, 0x00, false) | ||
567 | MUX_CFG(TNETV107X, TDM0_TX, 26, 20, 0x1f, 0x04, false) | ||
568 | MUX_CFG(TNETV107X, AIC_HNF_EN_STAT_N, 26, 25, 0x1f, 0x00, false) | ||
569 | MUX_CFG(TNETV107X, TDM0_RX, 26, 25, 0x1f, 0x04, false) | ||
570 | #endif | ||
571 | }; | ||
572 | |||
573 | /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ | ||
574 | static u8 irq_prios[TNETV107X_N_CP_INTC_IRQ] = { | ||
575 | /* fill in default priority 7 */ | ||
576 | [0 ... (TNETV107X_N_CP_INTC_IRQ - 1)] = 7, | ||
577 | /* now override as needed, e.g. [xxx] = 5 */ | ||
578 | }; | ||
579 | |||
580 | /* Contents of JTAG ID register used to identify exact cpu type */ | ||
581 | static struct davinci_id ids[] = { | ||
582 | { | ||
583 | .variant = 0x0, | ||
584 | .part_no = 0xb8a1, | ||
585 | .manufacturer = 0x017, | ||
586 | .cpu_id = DAVINCI_CPU_ID_TNETV107X, | ||
587 | .name = "tnetv107x rev 1.0", | ||
588 | }, | ||
589 | { | ||
590 | .variant = 0x1, | ||
591 | .part_no = 0xb8a1, | ||
592 | .manufacturer = 0x017, | ||
593 | .cpu_id = DAVINCI_CPU_ID_TNETV107X, | ||
594 | .name = "tnetv107x rev 1.1/1.2", | ||
595 | }, | ||
596 | }; | ||
597 | |||
598 | static struct davinci_timer_instance timer_instance[2] = { | ||
599 | { | ||
600 | .base = TNETV107X_TIMER0_BASE, | ||
601 | .bottom_irq = IRQ_TNETV107X_TIMER_0_TINT12, | ||
602 | .top_irq = IRQ_TNETV107X_TIMER_0_TINT34, | ||
603 | }, | ||
604 | { | ||
605 | .base = TNETV107X_TIMER1_BASE, | ||
606 | .bottom_irq = IRQ_TNETV107X_TIMER_1_TINT12, | ||
607 | .top_irq = IRQ_TNETV107X_TIMER_1_TINT34, | ||
608 | }, | ||
609 | }; | ||
610 | |||
611 | static struct davinci_timer_info timer_info = { | ||
612 | .timers = timer_instance, | ||
613 | .clockevent_id = T0_BOT, | ||
614 | .clocksource_id = T0_TOP, | ||
615 | }; | ||
616 | |||
617 | /* | ||
618 | * TNETV107X platforms do not use the static mappings from Davinci | ||
619 | * IO_PHYS/IO_VIRT. This SOC's interesting MMRs are at different addresses, | ||
620 | * and changing IO_PHYS would break away from existing Davinci SOCs. | ||
621 | * | ||
622 | * The primary impact of the current model is that IO_ADDRESS() is not to be | ||
623 | * used to map registers on TNETV107X. | ||
624 | * | ||
625 | * 1. The first chunk is for INTC: This needs to be mapped in via iotable | ||
626 | * because ioremap() does not seem to be operational at the time when | ||
627 | * irqs are initialized. Without this, consistent dma init bombs. | ||
628 | * | ||
629 | * 2. The second chunk maps in register areas that need to be populated into | ||
630 | * davinci_soc_info. Note that alignment restrictions come into play if | ||
631 | * low-level debug is enabled (see note in <mach/tnetv107x.h>). | ||
632 | */ | ||
633 | static struct map_desc io_desc[] = { | ||
634 | { /* INTC */ | ||
635 | .virtual = IO_VIRT, | ||
636 | .pfn = __phys_to_pfn(TNETV107X_INTC_BASE), | ||
637 | .length = SZ_16K, | ||
638 | .type = MT_DEVICE | ||
639 | }, | ||
640 | { /* Most of the rest */ | ||
641 | .virtual = TNETV107X_IO_VIRT, | ||
642 | .pfn = __phys_to_pfn(TNETV107X_IO_BASE), | ||
643 | .length = IO_SIZE - SZ_1M, | ||
644 | .type = MT_DEVICE | ||
645 | }, | ||
646 | }; | ||
647 | |||
648 | static unsigned long clk_sspll_recalc(struct clk *clk) | ||
649 | { | ||
650 | int pll; | ||
651 | unsigned long mult = 0, prediv = 1, postdiv = 1; | ||
652 | unsigned long ref = OSC_FREQ_ONCHIP, ret; | ||
653 | u32 tmp; | ||
654 | |||
655 | if (WARN_ON(!clk->pll_data)) | ||
656 | return clk->rate; | ||
657 | |||
658 | if (!clk_ctrl_regs) { | ||
659 | void __iomem *tmp; | ||
660 | |||
661 | tmp = ioremap(TNETV107X_CLOCK_CONTROL_BASE, SZ_4K); | ||
662 | |||
663 | if (WARN(!tmp, "failed ioremap for clock control regs\n")) | ||
664 | return clk->parent ? clk->parent->rate : 0; | ||
665 | |||
666 | for (pll = 0; pll < N_PLLS; pll++) | ||
667 | sspll_regs[pll] = tmp + sspll_regs_base[pll]; | ||
668 | |||
669 | clk_ctrl_regs = tmp; | ||
670 | } | ||
671 | |||
672 | pll = clk->pll_data->num; | ||
673 | |||
674 | tmp = __raw_readl(&clk_ctrl_regs->pll_bypass); | ||
675 | if (!(tmp & bypass_mask[pll])) { | ||
676 | mult = __raw_readl(&sspll_regs[pll]->mult_factor); | ||
677 | prediv = __raw_readl(&sspll_regs[pll]->pre_div) + 1; | ||
678 | postdiv = __raw_readl(&sspll_regs[pll]->post_div) + 1; | ||
679 | } | ||
680 | |||
681 | tmp = __raw_readl(clk->pll_data->base + PLLCTL); | ||
682 | if (tmp & PLLCTL_CLKMODE) | ||
683 | ref = pll_ext_freq[pll]; | ||
684 | |||
685 | clk->pll_data->input_rate = ref; | ||
686 | |||
687 | tmp = __raw_readl(clk->pll_data->base + PLLCTL); | ||
688 | if (!(tmp & PLLCTL_PLLEN)) | ||
689 | return ref; | ||
690 | |||
691 | ret = ref; | ||
692 | if (mult) | ||
693 | ret += ((unsigned long long)ref * mult) / 256; | ||
694 | |||
695 | ret /= (prediv * postdiv); | ||
696 | |||
697 | return ret; | ||
698 | } | ||
699 | |||
700 | static void tnetv107x_watchdog_reset(struct platform_device *pdev) | ||
701 | { | ||
702 | struct wdt_regs __iomem *regs; | ||
703 | |||
704 | regs = ioremap(pdev->resource[0].start, SZ_4K); | ||
705 | |||
706 | /* disable watchdog */ | ||
707 | __raw_writel(0x7777, ®s->disable_lock); | ||
708 | __raw_writel(0xcccc, ®s->disable_lock); | ||
709 | __raw_writel(0xdddd, ®s->disable_lock); | ||
710 | __raw_writel(0, ®s->disable); | ||
711 | |||
712 | /* program prescale */ | ||
713 | __raw_writel(0x5a5a, ®s->prescale_lock); | ||
714 | __raw_writel(0xa5a5, ®s->prescale_lock); | ||
715 | __raw_writel(0, ®s->prescale); | ||
716 | |||
717 | /* program countdown */ | ||
718 | __raw_writel(0x6666, ®s->change_lock); | ||
719 | __raw_writel(0xbbbb, ®s->change_lock); | ||
720 | __raw_writel(1, ®s->change); | ||
721 | |||
722 | /* enable watchdog */ | ||
723 | __raw_writel(0x7777, ®s->disable_lock); | ||
724 | __raw_writel(0xcccc, ®s->disable_lock); | ||
725 | __raw_writel(0xdddd, ®s->disable_lock); | ||
726 | __raw_writel(1, ®s->disable); | ||
727 | |||
728 | /* kick */ | ||
729 | __raw_writel(0x5555, ®s->kick_lock); | ||
730 | __raw_writel(0xaaaa, ®s->kick_lock); | ||
731 | __raw_writel(1, ®s->kick); | ||
732 | } | ||
733 | |||
734 | void tnetv107x_restart(enum reboot_mode mode, const char *cmd) | ||
735 | { | ||
736 | tnetv107x_watchdog_reset(&tnetv107x_wdt_device); | ||
737 | } | ||
738 | |||
739 | static struct davinci_soc_info tnetv107x_soc_info = { | ||
740 | .io_desc = io_desc, | ||
741 | .io_desc_num = ARRAY_SIZE(io_desc), | ||
742 | .ids = ids, | ||
743 | .ids_num = ARRAY_SIZE(ids), | ||
744 | .jtag_id_reg = TNETV107X_CHIP_CFG_BASE + 0x018, | ||
745 | .cpu_clks = clks, | ||
746 | .psc_bases = psc_regs, | ||
747 | .psc_bases_num = ARRAY_SIZE(psc_regs), | ||
748 | .pinmux_base = TNETV107X_CHIP_CFG_BASE + 0x150, | ||
749 | .pinmux_pins = pins, | ||
750 | .pinmux_pins_num = ARRAY_SIZE(pins), | ||
751 | .intc_type = DAVINCI_INTC_TYPE_CP_INTC, | ||
752 | .intc_base = TNETV107X_INTC_BASE, | ||
753 | .intc_irq_prios = irq_prios, | ||
754 | .intc_irq_num = TNETV107X_N_CP_INTC_IRQ, | ||
755 | .intc_host_map = intc_host_map, | ||
756 | .gpio_base = TNETV107X_GPIO_BASE, | ||
757 | .gpio_type = GPIO_TYPE_TNETV107X, | ||
758 | .gpio_num = TNETV107X_N_GPIO, | ||
759 | .timer_info = &timer_info, | ||
760 | .serial_dev = tnetv107x_serial_device, | ||
761 | }; | ||
762 | |||
763 | void __init tnetv107x_init(void) | ||
764 | { | ||
765 | davinci_common_init(&tnetv107x_soc_info); | ||
766 | } | ||
diff --git a/arch/arm/mach-dove/Kconfig b/arch/arm/mach-dove/Kconfig index 0bc7cdf8cf46..d8c439c89ea9 100644 --- a/arch/arm/mach-dove/Kconfig +++ b/arch/arm/mach-dove/Kconfig | |||
@@ -20,18 +20,6 @@ config MACH_CM_A510 | |||
20 | Say 'Y' here if you want your kernel to support the | 20 | Say 'Y' here if you want your kernel to support the |
21 | CompuLab CM-A510 Board. | 21 | CompuLab CM-A510 Board. |
22 | 22 | ||
23 | config MACH_DOVE_DT | ||
24 | bool "Marvell Dove Flattened Device Tree" | ||
25 | select DOVE_CLK | ||
26 | select ORION_IRQCHIP | ||
27 | select ORION_TIMER | ||
28 | select REGULATOR | ||
29 | select REGULATOR_FIXED_VOLTAGE | ||
30 | select USE_OF | ||
31 | help | ||
32 | Say 'Y' here if you want your kernel to support the | ||
33 | Marvell Dove using flattened device tree. | ||
34 | |||
35 | endmenu | 23 | endmenu |
36 | 24 | ||
37 | endif | 25 | endif |
diff --git a/arch/arm/mach-dove/Makefile b/arch/arm/mach-dove/Makefile index cbc5c0618788..b608a21919fb 100644 --- a/arch/arm/mach-dove/Makefile +++ b/arch/arm/mach-dove/Makefile | |||
@@ -2,5 +2,4 @@ obj-y += common.o | |||
2 | obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o | 2 | obj-$(CONFIG_DOVE_LEGACY) += irq.o mpp.o |
3 | obj-$(CONFIG_PCI) += pcie.o | 3 | obj-$(CONFIG_PCI) += pcie.o |
4 | obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o | 4 | obj-$(CONFIG_MACH_DOVE_DB) += dove-db-setup.o |
5 | obj-$(CONFIG_MACH_DOVE_DT) += board-dt.o | ||
6 | obj-$(CONFIG_MACH_CM_A510) += cm-a510.o | 5 | obj-$(CONFIG_MACH_CM_A510) += cm-a510.o |
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig index 0aded64a9ebc..830b76e70250 100644 --- a/arch/arm/mach-highbank/Kconfig +++ b/arch/arm/mach-highbank/Kconfig | |||
@@ -5,7 +5,6 @@ config ARCH_HIGHBANK | |||
5 | select ARCH_HAS_HOLES_MEMORYMODEL | 5 | select ARCH_HAS_HOLES_MEMORYMODEL |
6 | select ARCH_HAS_OPP | 6 | select ARCH_HAS_OPP |
7 | select ARCH_SUPPORTS_BIG_ENDIAN | 7 | select ARCH_SUPPORTS_BIG_ENDIAN |
8 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
9 | select ARM_AMBA | 8 | select ARM_AMBA |
10 | select ARM_ERRATA_764369 if SMP | 9 | select ARM_ERRATA_764369 if SMP |
11 | select ARM_ERRATA_775420 | 10 | select ARM_ERRATA_775420 |
@@ -14,14 +13,8 @@ config ARCH_HIGHBANK | |||
14 | select ARM_PSCI | 13 | select ARM_PSCI |
15 | select ARM_TIMER_SP804 | 14 | select ARM_TIMER_SP804 |
16 | select CACHE_L2X0 | 15 | select CACHE_L2X0 |
17 | select COMMON_CLK | ||
18 | select CPU_V7 | ||
19 | select GENERIC_CLOCKEVENTS | ||
20 | select HAVE_ARM_SCU | 16 | select HAVE_ARM_SCU |
21 | select HAVE_ARM_TWD if SMP | 17 | select HAVE_ARM_TWD if SMP |
22 | select HAVE_SMP | ||
23 | select MAILBOX | 18 | select MAILBOX |
24 | select PL320_MBOX | 19 | select PL320_MBOX |
25 | select SPARSE_IRQ | ||
26 | select USE_OF | ||
27 | select ZONE_DMA if ARM_LPAE | 20 | select ZONE_DMA if ARM_LPAE |
diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig index 8f4649b301b2..9d0a87b025e3 100644 --- a/arch/arm/mach-hisi/Kconfig +++ b/arch/arm/mach-hisi/Kconfig | |||
@@ -3,13 +3,9 @@ config ARCH_HI3xxx | |||
3 | select ARM_AMBA | 3 | select ARM_AMBA |
4 | select ARM_GIC | 4 | select ARM_GIC |
5 | select ARM_TIMER_SP804 | 5 | select ARM_TIMER_SP804 |
6 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
7 | select CACHE_L2X0 | 6 | select CACHE_L2X0 |
8 | select CLKSRC_OF | ||
9 | select GENERIC_CLOCKEVENTS | ||
10 | select HAVE_ARM_SCU | 7 | select HAVE_ARM_SCU |
11 | select HAVE_ARM_TWD | 8 | select HAVE_ARM_TWD if SMP |
12 | select HAVE_SMP | ||
13 | select PINCTRL | 9 | select PINCTRL |
14 | select PINCTRL_SINGLE | 10 | select PINCTRL_SINGLE |
15 | help | 11 | help |
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 33567aa5880f..5740296dc429 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -1,19 +1,15 @@ | |||
1 | config ARCH_MXC | 1 | config ARCH_MXC |
2 | bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 | 2 | bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 |
3 | select ARCH_HAS_CPUFREQ | ||
4 | select ARCH_HAS_OPP | ||
3 | select ARCH_REQUIRE_GPIOLIB | 5 | select ARCH_REQUIRE_GPIOLIB |
4 | select ARM_CPU_SUSPEND if PM | 6 | select ARM_CPU_SUSPEND if PM |
5 | select ARM_PATCH_PHYS_VIRT | ||
6 | select CLKSRC_MMIO | 7 | select CLKSRC_MMIO |
7 | select COMMON_CLK | ||
8 | select GENERIC_ALLOCATOR | ||
9 | select GENERIC_CLOCKEVENTS | ||
10 | select GENERIC_IRQ_CHIP | 8 | select GENERIC_IRQ_CHIP |
11 | select MIGHT_HAVE_CACHE_L2X0 if ARCH_MULTI_V6_V7 | ||
12 | select MULTI_IRQ_HANDLER | ||
13 | select PINCTRL | 9 | select PINCTRL |
10 | select PM_OPP if PM | ||
14 | select SOC_BUS | 11 | select SOC_BUS |
15 | select SPARSE_IRQ | 12 | select SRAM |
16 | select USE_OF | ||
17 | help | 13 | help |
18 | Support for Freescale MXC/iMX-based family of processors | 14 | Support for Freescale MXC/iMX-based family of processors |
19 | 15 | ||
@@ -121,18 +117,16 @@ config SOC_IMX31 | |||
121 | config SOC_IMX35 | 117 | config SOC_IMX35 |
122 | bool | 118 | bool |
123 | select ARCH_MXC_IOMUX_V3 | 119 | select ARCH_MXC_IOMUX_V3 |
124 | select CPU_V6K | ||
125 | select HAVE_EPIT | 120 | select HAVE_EPIT |
126 | select MXC_AVIC | 121 | select MXC_AVIC |
122 | select PINCTRL_IMX35 | ||
127 | select SMP_ON_UP if SMP | 123 | select SMP_ON_UP if SMP |
128 | select PINCTRL | ||
129 | 124 | ||
130 | config SOC_IMX5 | 125 | config SOC_IMX5 |
131 | bool | 126 | bool |
132 | select ARCH_HAS_CPUFREQ | 127 | select ARCH_HAS_CPUFREQ |
133 | select ARCH_HAS_OPP | 128 | select ARCH_HAS_OPP |
134 | select ARCH_MXC_IOMUX_V3 | 129 | select ARCH_MXC_IOMUX_V3 |
135 | select CPU_V7 | ||
136 | select MXC_TZIC | 130 | select MXC_TZIC |
137 | 131 | ||
138 | config SOC_IMX51 | 132 | config SOC_IMX51 |
@@ -777,65 +771,50 @@ config SOC_IMX50 | |||
777 | config SOC_IMX53 | 771 | config SOC_IMX53 |
778 | bool "i.MX53 support" | 772 | bool "i.MX53 support" |
779 | select HAVE_IMX_SRC | 773 | select HAVE_IMX_SRC |
780 | select IMX_HAVE_PLATFORM_IMX2_WDT | ||
781 | select PINCTRL_IMX53 | 774 | select PINCTRL_IMX53 |
782 | select SOC_IMX5 | 775 | select SOC_IMX5 |
783 | 776 | ||
784 | help | 777 | help |
785 | This enables support for Freescale i.MX53 processor. | 778 | This enables support for Freescale i.MX53 processor. |
786 | 779 | ||
787 | config SOC_IMX6Q | 780 | config SOC_IMX6 |
788 | bool "i.MX6 Quad/DualLite support" | 781 | bool |
789 | select ARCH_HAS_CPUFREQ | ||
790 | select ARCH_HAS_OPP | ||
791 | select ARM_ERRATA_754322 | 782 | select ARM_ERRATA_754322 |
792 | select ARM_ERRATA_764369 if SMP | ||
793 | select ARM_ERRATA_775420 | 783 | select ARM_ERRATA_775420 |
794 | select ARM_GIC | 784 | select ARM_GIC |
795 | select CPU_V7 | ||
796 | select HAVE_ARM_SCU if SMP | ||
797 | select HAVE_ARM_TWD if SMP | ||
798 | select HAVE_IMX_ANATOP | 785 | select HAVE_IMX_ANATOP |
799 | select HAVE_IMX_GPC | 786 | select HAVE_IMX_GPC |
800 | select HAVE_IMX_MMDC | 787 | select HAVE_IMX_MMDC |
801 | select HAVE_IMX_SRC | 788 | select HAVE_IMX_SRC |
802 | select HAVE_SMP | ||
803 | select MFD_SYSCON | 789 | select MFD_SYSCON |
804 | select MIGHT_HAVE_PCI | ||
805 | select PCI_DOMAINS if PCI | ||
806 | select PINCTRL_IMX6Q | ||
807 | select PL310_ERRATA_588369 if CACHE_PL310 | 790 | select PL310_ERRATA_588369 if CACHE_PL310 |
808 | select PL310_ERRATA_727915 if CACHE_PL310 | 791 | select PL310_ERRATA_727915 if CACHE_PL310 |
809 | select PL310_ERRATA_769419 if CACHE_PL310 | 792 | select PL310_ERRATA_769419 if CACHE_PL310 |
810 | select PM_OPP if PM | 793 | |
794 | config SOC_IMX6Q | ||
795 | bool "i.MX6 Quad/DualLite support" | ||
796 | select ARM_ERRATA_764369 if SMP | ||
797 | select HAVE_ARM_SCU if SMP | ||
798 | select HAVE_ARM_TWD if SMP | ||
799 | select MIGHT_HAVE_PCI | ||
800 | select PCI_DOMAINS if PCI | ||
801 | select PINCTRL_IMX6Q | ||
802 | select SOC_IMX6 | ||
811 | 803 | ||
812 | help | 804 | help |
813 | This enables support for Freescale i.MX6 Quad processor. | 805 | This enables support for Freescale i.MX6 Quad processor. |
814 | 806 | ||
815 | config SOC_IMX6SL | 807 | config SOC_IMX6SL |
816 | bool "i.MX6 SoloLite support" | 808 | bool "i.MX6 SoloLite support" |
817 | select ARM_ERRATA_754322 | ||
818 | select ARM_ERRATA_775420 | ||
819 | select ARM_GIC | ||
820 | select CPU_V7 | ||
821 | select HAVE_IMX_ANATOP | ||
822 | select HAVE_IMX_GPC | ||
823 | select HAVE_IMX_MMDC | ||
824 | select HAVE_IMX_SRC | ||
825 | select MFD_SYSCON | ||
826 | select PINCTRL_IMX6SL | 809 | select PINCTRL_IMX6SL |
827 | select PL310_ERRATA_588369 if CACHE_PL310 | 810 | select SOC_IMX6 |
828 | select PL310_ERRATA_727915 if CACHE_PL310 | ||
829 | select PL310_ERRATA_769419 if CACHE_PL310 | ||
830 | 811 | ||
831 | help | 812 | help |
832 | This enables support for Freescale i.MX6 SoloLite processor. | 813 | This enables support for Freescale i.MX6 SoloLite processor. |
833 | 814 | ||
834 | config SOC_VF610 | 815 | config SOC_VF610 |
835 | bool "Vybrid Family VF610 support" | 816 | bool "Vybrid Family VF610 support" |
836 | select CPU_V7 | ||
837 | select ARM_GIC | 817 | select ARM_GIC |
838 | select CLKSRC_OF | ||
839 | select PINCTRL_VF610 | 818 | select PINCTRL_VF610 |
840 | select VF_PIT_TIMER | 819 | select VF_PIT_TIMER |
841 | select PL310_ERRATA_588369 if CACHE_PL310 | 820 | select PL310_ERRATA_588369 if CACHE_PL310 |
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index befcaf5d0574..f4ed83032dd0 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -30,6 +30,7 @@ obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o | |||
30 | ifeq ($(CONFIG_CPU_IDLE),y) | 30 | ifeq ($(CONFIG_CPU_IDLE),y) |
31 | obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o | 31 | obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o |
32 | obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o | 32 | obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o |
33 | obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o | ||
33 | endif | 34 | endif |
34 | 35 | ||
35 | ifdef CONFIG_SND_IMX_SOC | 36 | ifdef CONFIG_SND_IMX_SOC |
@@ -101,11 +102,11 @@ obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | |||
101 | obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o | 102 | obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o |
102 | obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o | 103 | obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o |
103 | 104 | ||
104 | ifeq ($(CONFIG_PM),y) | 105 | ifeq ($(CONFIG_SUSPEND),y) |
105 | obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o | 106 | AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a |
106 | # i.MX6SL reuses i.MX6Q code | 107 | obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o |
107 | obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o | ||
108 | endif | 108 | endif |
109 | obj-$(CONFIG_SOC_IMX6) += pm-imx6.o | ||
109 | 110 | ||
110 | # i.MX5 based machines | 111 | # i.MX5 based machines |
111 | obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o | 112 | obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o |
diff --git a/arch/arm/mach-imx/clk-imx21.c b/arch/arm/mach-imx/clk-imx21.c index d7ed66091a2a..bdc2e4630a08 100644 --- a/arch/arm/mach-imx/clk-imx21.c +++ b/arch/arm/mach-imx/clk-imx21.c | |||
@@ -149,7 +149,6 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href) | |||
149 | clk_register_clkdev(clk[per1], "per", "imx-gpt.1"); | 149 | clk_register_clkdev(clk[per1], "per", "imx-gpt.1"); |
150 | clk_register_clkdev(clk[gpt3_ipg_gate], "ipg", "imx-gpt.2"); | 150 | clk_register_clkdev(clk[gpt3_ipg_gate], "ipg", "imx-gpt.2"); |
151 | clk_register_clkdev(clk[per1], "per", "imx-gpt.2"); | 151 | clk_register_clkdev(clk[per1], "per", "imx-gpt.2"); |
152 | clk_register_clkdev(clk[pwm_ipg_gate], "pwm", "mxc_pwm.0"); | ||
153 | clk_register_clkdev(clk[per2], "per", "imx21-cspi.0"); | 152 | clk_register_clkdev(clk[per2], "per", "imx21-cspi.0"); |
154 | clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx21-cspi.0"); | 153 | clk_register_clkdev(clk[cspi1_ipg_gate], "ipg", "imx21-cspi.0"); |
155 | clk_register_clkdev(clk[per2], "per", "imx21-cspi.1"); | 154 | clk_register_clkdev(clk[per2], "per", "imx21-cspi.1"); |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index 69858c78f40d..dc36e6c2f1da 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
@@ -265,14 +265,6 @@ int __init mx25_clocks_init(void) | |||
265 | clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0"); | 265 | clk_register_clkdev(clk[cspi1_ipg], NULL, "imx35-cspi.0"); |
266 | clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1"); | 266 | clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1"); |
267 | clk_register_clkdev(clk[cspi3_ipg], NULL, "imx35-cspi.2"); | 267 | clk_register_clkdev(clk[cspi3_ipg], NULL, "imx35-cspi.2"); |
268 | clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.0"); | ||
269 | clk_register_clkdev(clk[per10], "per", "mxc_pwm.0"); | ||
270 | clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.1"); | ||
271 | clk_register_clkdev(clk[per10], "per", "mxc_pwm.1"); | ||
272 | clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.2"); | ||
273 | clk_register_clkdev(clk[per10], "per", "mxc_pwm.2"); | ||
274 | clk_register_clkdev(clk[pwm1_ipg], "ipg", "mxc_pwm.3"); | ||
275 | clk_register_clkdev(clk[per10], "per", "mxc_pwm.3"); | ||
276 | clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad"); | 268 | clk_register_clkdev(clk[kpp_ipg], NULL, "imx-keypad"); |
277 | clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc"); | 269 | clk_register_clkdev(clk[tsc_ipg], NULL, "mx25-adc"); |
278 | clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0"); | 270 | clk_register_clkdev(clk[i2c_ipg_per], NULL, "imx21-i2c.0"); |
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index c6b40f386786..d2da8908b268 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c | |||
@@ -231,7 +231,6 @@ int __init mx27_clocks_init(unsigned long fref) | |||
231 | clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.4"); | 231 | clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.4"); |
232 | clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); | 232 | clk_register_clkdev(clk[gpt6_ipg_gate], "ipg", "imx-gpt.5"); |
233 | clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); | 233 | clk_register_clkdev(clk[per1_gate], "per", "imx-gpt.5"); |
234 | clk_register_clkdev(clk[pwm_ipg_gate], NULL, "mxc_pwm.0"); | ||
235 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0"); | 234 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.0"); |
236 | clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0"); | 235 | clk_register_clkdev(clk[sdhc1_ipg_gate], "ipg", "imx21-mmc.0"); |
237 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1"); | 236 | clk_register_clkdev(clk[per2_gate], "per", "imx21-mmc.1"); |
diff --git a/arch/arm/mach-imx/clk-imx51-imx53.c b/arch/arm/mach-imx/clk-imx51-imx53.c index 19fca1fdc6fe..568ef0a4de84 100644 --- a/arch/arm/mach-imx/clk-imx51-imx53.c +++ b/arch/arm/mach-imx/clk-imx51-imx53.c | |||
@@ -266,8 +266,6 @@ static void __init mx5_clocks_common_init(unsigned long rate_ckil, | |||
266 | clk_register_clkdev(clk[IMX5_CLK_ECSPI2_PER_GATE], "per", "imx51-ecspi.1"); | 266 | clk_register_clkdev(clk[IMX5_CLK_ECSPI2_PER_GATE], "per", "imx51-ecspi.1"); |
267 | clk_register_clkdev(clk[IMX5_CLK_ECSPI2_IPG_GATE], "ipg", "imx51-ecspi.1"); | 267 | clk_register_clkdev(clk[IMX5_CLK_ECSPI2_IPG_GATE], "ipg", "imx51-ecspi.1"); |
268 | clk_register_clkdev(clk[IMX5_CLK_CSPI_IPG_GATE], NULL, "imx35-cspi.2"); | 268 | clk_register_clkdev(clk[IMX5_CLK_CSPI_IPG_GATE], NULL, "imx35-cspi.2"); |
269 | clk_register_clkdev(clk[IMX5_CLK_PWM1_IPG_GATE], "pwm", "mxc_pwm.0"); | ||
270 | clk_register_clkdev(clk[IMX5_CLK_PWM2_IPG_GATE], "pwm", "mxc_pwm.1"); | ||
271 | clk_register_clkdev(clk[IMX5_CLK_I2C1_GATE], NULL, "imx21-i2c.0"); | 269 | clk_register_clkdev(clk[IMX5_CLK_I2C1_GATE], NULL, "imx21-i2c.0"); |
272 | clk_register_clkdev(clk[IMX5_CLK_I2C2_GATE], NULL, "imx21-i2c.1"); | 270 | clk_register_clkdev(clk[IMX5_CLK_I2C2_GATE], NULL, "imx21-i2c.1"); |
273 | clk_register_clkdev(clk[IMX5_CLK_USBOH3_PER_GATE], "per", "mxc-ehci.0"); | 271 | clk_register_clkdev(clk[IMX5_CLK_USBOH3_PER_GATE], "per", "mxc-ehci.0"); |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index af2e582d2b74..b0e7f9d2c245 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -437,12 +437,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
437 | 437 | ||
438 | clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0"); | 438 | clk_register_clkdev(clk[gpt_ipg], "ipg", "imx-gpt.0"); |
439 | clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); | 439 | clk_register_clkdev(clk[gpt_ipg_per], "per", "imx-gpt.0"); |
440 | clk_register_clkdev(clk[cko1_sel], "cko1_sel", NULL); | 440 | clk_register_clkdev(clk[enet_ref], "enet_ref", NULL); |
441 | clk_register_clkdev(clk[ahb], "ahb", NULL); | ||
442 | clk_register_clkdev(clk[cko1], "cko1", NULL); | ||
443 | clk_register_clkdev(clk[arm], NULL, "cpu0"); | ||
444 | clk_register_clkdev(clk[pll4_post_div], "pll4_post_div", NULL); | ||
445 | clk_register_clkdev(clk[pll4_audio], "pll4_audio", NULL); | ||
446 | 441 | ||
447 | if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || | 442 | if ((imx_get_soc_revision() != IMX_CHIP_REVISION_1_0) || |
448 | cpu_is_imx6dl()) { | 443 | cpu_is_imx6dl()) { |
@@ -482,6 +477,9 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
482 | if (IS_ENABLED(CONFIG_PCI_IMX6)) | 477 | if (IS_ENABLED(CONFIG_PCI_IMX6)) |
483 | clk_set_parent(clk[lvds1_sel], clk[sata_ref]); | 478 | clk_set_parent(clk[lvds1_sel], clk[sata_ref]); |
484 | 479 | ||
480 | /* Set initial power mode */ | ||
481 | imx6q_set_lpm(WAIT_CLOCKED); | ||
482 | |||
485 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"); | 483 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt"); |
486 | base = of_iomap(np, 0); | 484 | base = of_iomap(np, 0); |
487 | WARN_ON(!base); | 485 | WARN_ON(!base); |
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c index 3781a1853998..f7073c0782fb 100644 --- a/arch/arm/mach-imx/clk-imx6sl.c +++ b/arch/arm/mach-imx/clk-imx6sl.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2013 Freescale Semiconductor, Inc. | 2 | * Copyright 2013-2014 Freescale Semiconductor, Inc. |
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 version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
@@ -18,27 +18,43 @@ | |||
18 | #include "clk.h" | 18 | #include "clk.h" |
19 | #include "common.h" | 19 | #include "common.h" |
20 | 20 | ||
21 | static const char const *step_sels[] = { "osc", "pll2_pfd2", }; | 21 | #define CCSR 0xc |
22 | static const char const *pll1_sw_sels[] = { "pll1_sys", "step", }; | 22 | #define BM_CCSR_PLL1_SW_CLK_SEL (1 << 2) |
23 | static const char const *ocram_alt_sels[] = { "pll2_pfd2", "pll3_pfd1", }; | 23 | #define CACRR 0x10 |
24 | static const char const *ocram_sels[] = { "periph", "ocram_alt_sels", }; | 24 | #define CDHIPR 0x48 |
25 | static const char const *pre_periph_sels[] = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", }; | 25 | #define BM_CDHIPR_ARM_PODF_BUSY (1 << 16) |
26 | static const char const *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", "dummy", }; | 26 | #define ARM_WAIT_DIV_396M 2 |
27 | static const char const *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", }; | 27 | #define ARM_WAIT_DIV_792M 4 |
28 | static const char const *periph_sels[] = { "pre_periph_sel", "periph_clk2_podf", }; | 28 | #define ARM_WAIT_DIV_996M 6 |
29 | static const char const *periph2_sels[] = { "pre_periph2_sel", "periph2_clk2_podf", }; | 29 | |
30 | static const char const *csi_lcdif_sels[] = { "mmdc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", }; | 30 | #define PLL_ARM 0x0 |
31 | static const char const *usdhc_sels[] = { "pll2_pfd2", "pll2_pfd0", }; | 31 | #define BM_PLL_ARM_DIV_SELECT (0x7f << 0) |
32 | static const char const *ssi_sels[] = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", }; | 32 | #define BM_PLL_ARM_POWERDOWN (1 << 12) |
33 | static const char const *perclk_sels[] = { "ipg", "osc", }; | 33 | #define BM_PLL_ARM_ENABLE (1 << 13) |
34 | static const char const *epdc_pxp_sels[] = { "mmdc", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd1", }; | 34 | #define BM_PLL_ARM_LOCK (1 << 31) |
35 | static const char const *gpu2d_ovg_sels[] = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", }; | 35 | #define PLL_ARM_DIV_792M 66 |
36 | static const char const *gpu2d_sels[] = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", }; | 36 | |
37 | static const char const *lcdif_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", }; | 37 | static const char *step_sels[] = { "osc", "pll2_pfd2", }; |
38 | static const char const *epdc_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", }; | 38 | static const char *pll1_sw_sels[] = { "pll1_sys", "step", }; |
39 | static const char const *audio_sels[] = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", }; | 39 | static const char *ocram_alt_sels[] = { "pll2_pfd2", "pll3_pfd1", }; |
40 | static const char const *ecspi_sels[] = { "pll3_60m", "osc", }; | 40 | static const char *ocram_sels[] = { "periph", "ocram_alt_sels", }; |
41 | static const char const *uart_sels[] = { "pll3_80m", "osc", }; | 41 | static const char *pre_periph_sels[] = { "pll2_bus", "pll2_pfd2", "pll2_pfd0", "pll2_198m", }; |
42 | static const char *periph_clk2_sels[] = { "pll3_usb_otg", "osc", "osc", "dummy", }; | ||
43 | static const char *periph2_clk2_sels[] = { "pll3_usb_otg", "pll2_bus", }; | ||
44 | static const char *periph_sels[] = { "pre_periph_sel", "periph_clk2_podf", }; | ||
45 | static const char *periph2_sels[] = { "pre_periph2_sel", "periph2_clk2_podf", }; | ||
46 | static const char *csi_lcdif_sels[] = { "mmdc", "pll2_pfd2", "pll3_120m", "pll3_pfd1", }; | ||
47 | static const char *usdhc_sels[] = { "pll2_pfd2", "pll2_pfd0", }; | ||
48 | static const char *ssi_sels[] = { "pll3_pfd2", "pll3_pfd3", "pll4_audio_div", "dummy", }; | ||
49 | static const char *perclk_sels[] = { "ipg", "osc", }; | ||
50 | static const char *epdc_pxp_sels[] = { "mmdc", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd2", "pll3_pfd1", }; | ||
51 | static const char *gpu2d_ovg_sels[] = { "pll3_pfd1", "pll3_usb_otg", "pll2_bus", "pll2_pfd2", }; | ||
52 | static const char *gpu2d_sels[] = { "pll2_pfd2", "pll3_usb_otg", "pll3_pfd1", "pll2_bus", }; | ||
53 | static const char *lcdif_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll3_pfd0", "pll3_pfd1", }; | ||
54 | static const char *epdc_pix_sels[] = { "pll2_bus", "pll3_usb_otg", "pll5_video_div", "pll2_pfd0", "pll2_pfd1", "pll3_pfd1", }; | ||
55 | static const char *audio_sels[] = { "pll4_audio_div", "pll3_pfd2", "pll3_pfd3", "pll3_usb_otg", }; | ||
56 | static const char *ecspi_sels[] = { "pll3_60m", "osc", }; | ||
57 | static const char *uart_sels[] = { "pll3_80m", "osc", }; | ||
42 | 58 | ||
43 | static struct clk_div_table clk_enet_ref_table[] = { | 59 | static struct clk_div_table clk_enet_ref_table[] = { |
44 | { .val = 0, .div = 20, }, | 60 | { .val = 0, .div = 20, }, |
@@ -65,6 +81,89 @@ static struct clk_div_table video_div_table[] = { | |||
65 | 81 | ||
66 | static struct clk *clks[IMX6SL_CLK_END]; | 82 | static struct clk *clks[IMX6SL_CLK_END]; |
67 | static struct clk_onecell_data clk_data; | 83 | static struct clk_onecell_data clk_data; |
84 | static void __iomem *ccm_base; | ||
85 | static void __iomem *anatop_base; | ||
86 | |||
87 | static const u32 clks_init_on[] __initconst = { | ||
88 | IMX6SL_CLK_IPG, IMX6SL_CLK_ARM, IMX6SL_CLK_MMDC_ROOT, | ||
89 | }; | ||
90 | |||
91 | /* | ||
92 | * ERR005311 CCM: After exit from WAIT mode, unwanted interrupt(s) taken | ||
93 | * during WAIT mode entry process could cause cache memory | ||
94 | * corruption. | ||
95 | * | ||
96 | * Software workaround: | ||
97 | * To prevent this issue from occurring, software should ensure that the | ||
98 | * ARM to IPG clock ratio is less than 12:5 (that is < 2.4x), before | ||
99 | * entering WAIT mode. | ||
100 | * | ||
101 | * This function will set the ARM clk to max value within the 12:5 limit. | ||
102 | * As IPG clock is fixed at 66MHz(so ARM freq must not exceed 158.4MHz), | ||
103 | * ARM freq are one of below setpoints: 396MHz, 792MHz and 996MHz, since | ||
104 | * the clk APIs can NOT be called in idle thread(may cause kernel schedule | ||
105 | * as there is sleep function in PLL wait function), so here we just slow | ||
106 | * down ARM to below freq according to previous freq: | ||
107 | * | ||
108 | * run mode wait mode | ||
109 | * 396MHz -> 132MHz; | ||
110 | * 792MHz -> 158.4MHz; | ||
111 | * 996MHz -> 142.3MHz; | ||
112 | */ | ||
113 | static int imx6sl_get_arm_divider_for_wait(void) | ||
114 | { | ||
115 | if (readl_relaxed(ccm_base + CCSR) & BM_CCSR_PLL1_SW_CLK_SEL) { | ||
116 | return ARM_WAIT_DIV_396M; | ||
117 | } else { | ||
118 | if ((readl_relaxed(anatop_base + PLL_ARM) & | ||
119 | BM_PLL_ARM_DIV_SELECT) == PLL_ARM_DIV_792M) | ||
120 | return ARM_WAIT_DIV_792M; | ||
121 | else | ||
122 | return ARM_WAIT_DIV_996M; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | static void imx6sl_enable_pll_arm(bool enable) | ||
127 | { | ||
128 | static u32 saved_pll_arm; | ||
129 | u32 val; | ||
130 | |||
131 | if (enable) { | ||
132 | saved_pll_arm = val = readl_relaxed(anatop_base + PLL_ARM); | ||
133 | val |= BM_PLL_ARM_ENABLE; | ||
134 | val &= ~BM_PLL_ARM_POWERDOWN; | ||
135 | writel_relaxed(val, anatop_base + PLL_ARM); | ||
136 | while (!(__raw_readl(anatop_base + PLL_ARM) & BM_PLL_ARM_LOCK)) | ||
137 | ; | ||
138 | } else { | ||
139 | writel_relaxed(saved_pll_arm, anatop_base + PLL_ARM); | ||
140 | } | ||
141 | } | ||
142 | |||
143 | void imx6sl_set_wait_clk(bool enter) | ||
144 | { | ||
145 | static unsigned long saved_arm_div; | ||
146 | int arm_div_for_wait = imx6sl_get_arm_divider_for_wait(); | ||
147 | |||
148 | /* | ||
149 | * According to hardware design, arm podf change need | ||
150 | * PLL1 clock enabled. | ||
151 | */ | ||
152 | if (arm_div_for_wait == ARM_WAIT_DIV_396M) | ||
153 | imx6sl_enable_pll_arm(true); | ||
154 | |||
155 | if (enter) { | ||
156 | saved_arm_div = readl_relaxed(ccm_base + CACRR); | ||
157 | writel_relaxed(arm_div_for_wait, ccm_base + CACRR); | ||
158 | } else { | ||
159 | writel_relaxed(saved_arm_div, ccm_base + CACRR); | ||
160 | } | ||
161 | while (__raw_readl(ccm_base + CDHIPR) & BM_CDHIPR_ARM_PODF_BUSY) | ||
162 | ; | ||
163 | |||
164 | if (arm_div_for_wait == ARM_WAIT_DIV_396M) | ||
165 | imx6sl_enable_pll_arm(false); | ||
166 | } | ||
68 | 167 | ||
69 | static void __init imx6sl_clocks_init(struct device_node *ccm_node) | 168 | static void __init imx6sl_clocks_init(struct device_node *ccm_node) |
70 | { | 169 | { |
@@ -72,6 +171,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) | |||
72 | void __iomem *base; | 171 | void __iomem *base; |
73 | int irq; | 172 | int irq; |
74 | int i; | 173 | int i; |
174 | int ret; | ||
75 | 175 | ||
76 | clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0); | 176 | clks[IMX6SL_CLK_DUMMY] = imx_clk_fixed("dummy", 0); |
77 | clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0); | 177 | clks[IMX6SL_CLK_CKIL] = imx_obtain_fixed_clock("ckil", 0); |
@@ -80,6 +180,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) | |||
80 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop"); | 180 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-anatop"); |
81 | base = of_iomap(np, 0); | 181 | base = of_iomap(np, 0); |
82 | WARN_ON(!base); | 182 | WARN_ON(!base); |
183 | anatop_base = base; | ||
83 | 184 | ||
84 | /* type name parent base div_mask */ | 185 | /* type name parent base div_mask */ |
85 | clks[IMX6SL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f); | 186 | clks[IMX6SL_CLK_PLL1_SYS] = imx_clk_pllv3(IMX_PLLV3_SYS, "pll1_sys", "osc", base, 0x7f); |
@@ -127,6 +228,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) | |||
127 | np = ccm_node; | 228 | np = ccm_node; |
128 | base = of_iomap(np, 0); | 229 | base = of_iomap(np, 0); |
129 | WARN_ON(!base); | 230 | WARN_ON(!base); |
231 | ccm_base = base; | ||
130 | 232 | ||
131 | /* Reuse imx6q pm code */ | 233 | /* Reuse imx6q pm code */ |
132 | imx6q_pm_set_ccm_base(base); | 234 | imx6q_pm_set_ccm_base(base); |
@@ -258,6 +360,19 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) | |||
258 | clk_register_clkdev(clks[IMX6SL_CLK_GPT], "ipg", "imx-gpt.0"); | 360 | clk_register_clkdev(clks[IMX6SL_CLK_GPT], "ipg", "imx-gpt.0"); |
259 | clk_register_clkdev(clks[IMX6SL_CLK_GPT_SERIAL], "per", "imx-gpt.0"); | 361 | clk_register_clkdev(clks[IMX6SL_CLK_GPT_SERIAL], "per", "imx-gpt.0"); |
260 | 362 | ||
363 | /* Ensure the AHB clk is at 132MHz. */ | ||
364 | ret = clk_set_rate(clks[IMX6SL_CLK_AHB], 132000000); | ||
365 | if (ret) | ||
366 | pr_warn("%s: failed to set AHB clock rate %d!\n", | ||
367 | __func__, ret); | ||
368 | |||
369 | /* | ||
370 | * Make sure those always on clocks are enabled to maintain the correct | ||
371 | * usecount and enabling/disabling of parent PLLs. | ||
372 | */ | ||
373 | for (i = 0; i < ARRAY_SIZE(clks_init_on); i++) | ||
374 | clk_prepare_enable(clks[clks_init_on[i]]); | ||
375 | |||
261 | if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { | 376 | if (IS_ENABLED(CONFIG_USB_MXS_PHY)) { |
262 | clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]); | 377 | clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]); |
263 | clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]); | 378 | clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]); |
@@ -266,6 +381,9 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node) | |||
266 | /* Audio-related clocks configuration */ | 381 | /* Audio-related clocks configuration */ |
267 | clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]); | 382 | clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]); |
268 | 383 | ||
384 | /* Set initial power mode */ | ||
385 | imx6q_set_lpm(WAIT_CLOCKED); | ||
386 | |||
269 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-gpt"); | 387 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6sl-gpt"); |
270 | base = of_iomap(np, 0); | 388 | base = of_iomap(np, 0); |
271 | WARN_ON(!base); | 389 | WARN_ON(!base); |
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c index ecd66d8e20b6..22dc3ee21fd4 100644 --- a/arch/arm/mach-imx/clk-vf610.c +++ b/arch/arm/mach-imx/clk-vf610.c | |||
@@ -63,25 +63,25 @@ static void __iomem *anatop_base; | |||
63 | static void __iomem *ccm_base; | 63 | static void __iomem *ccm_base; |
64 | 64 | ||
65 | /* sources for multiplexer clocks, this is used multiple times */ | 65 | /* sources for multiplexer clocks, this is used multiple times */ |
66 | static const char const *fast_sels[] = { "firc", "fxosc", }; | 66 | static const char *fast_sels[] = { "firc", "fxosc", }; |
67 | static const char const *slow_sels[] = { "sirc_32k", "sxosc", }; | 67 | static const char *slow_sels[] = { "sirc_32k", "sxosc", }; |
68 | static const char const *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; | 68 | static const char *pll1_sels[] = { "pll1_main", "pll1_pfd1", "pll1_pfd2", "pll1_pfd3", "pll1_pfd4", }; |
69 | static const char const *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; | 69 | static const char *pll2_sels[] = { "pll2_main", "pll2_pfd1", "pll2_pfd2", "pll2_pfd3", "pll2_pfd4", }; |
70 | static const char const *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", }; | 70 | static const char *sys_sels[] = { "fast_clk_sel", "slow_clk_sel", "pll2_pfd_sel", "pll2_main", "pll1_pfd_sel", "pll3_main", }; |
71 | static const char const *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; | 71 | static const char *ddr_sels[] = { "pll2_pfd2", "sys_sel", }; |
72 | static const char const *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; | 72 | static const char *rmii_sels[] = { "enet_ext", "audio_ext", "enet_50m", "enet_25m", }; |
73 | static const char const *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; | 73 | static const char *enet_ts_sels[] = { "enet_ext", "fxosc", "audio_ext", "usb", "enet_ts", "enet_25m", "enet_50m", }; |
74 | static const char const *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; | 74 | static const char *esai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; |
75 | static const char const *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; | 75 | static const char *sai_sels[] = { "audio_ext", "mlb", "spdif_rx", "pll4_main_div", }; |
76 | static const char const *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; | 76 | static const char *nfc_sels[] = { "platform_bus", "pll1_pfd1", "pll3_pfd1", "pll3_pfd3", }; |
77 | static const char const *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; | 77 | static const char *qspi_sels[] = { "pll3_main", "pll3_pfd4", "pll2_pfd4", "pll1_pfd4", }; |
78 | static const char const *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; | 78 | static const char *esdhc_sels[] = { "pll3_main", "pll3_pfd3", "pll1_pfd3", "platform_bus", }; |
79 | static const char const *dcu_sels[] = { "pll1_pfd2", "pll3_main", }; | 79 | static const char *dcu_sels[] = { "pll1_pfd2", "pll3_main", }; |
80 | static const char const *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; | 80 | static const char *gpu_sels[] = { "pll2_pfd2", "pll3_pfd2", }; |
81 | static const char const *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", }; | 81 | static const char *vadc_sels[] = { "pll6_main_div", "pll3_main_div", "pll3_main", }; |
82 | /* FTM counter clock source, not module clock */ | 82 | /* FTM counter clock source, not module clock */ |
83 | static const char const *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; | 83 | static const char *ftm_ext_sels[] = {"sirc_128k", "sxosc", "fxosc_half", "audio_ext", }; |
84 | static const char const *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; | 84 | static const char *ftm_fix_sels[] = { "sxosc", "ipg_bus", }; |
85 | 85 | ||
86 | static struct clk_div_table pll4_main_div_table[] = { | 86 | static struct clk_div_table pll4_main_div_table[] = { |
87 | { .val = 0, .div = 1 }, | 87 | { .val = 0, .div = 1 }, |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 59c3b9b26bb4..b5241ea76706 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2004-2014 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | */ | 3 | */ |
4 | 4 | ||
5 | /* | 5 | /* |
@@ -116,7 +116,6 @@ void imx_enable_cpu(int cpu, bool enable); | |||
116 | void imx_set_cpu_jump(int cpu, void *jump_addr); | 116 | void imx_set_cpu_jump(int cpu, void *jump_addr); |
117 | u32 imx_get_cpu_arg(int cpu); | 117 | u32 imx_get_cpu_arg(int cpu); |
118 | void imx_set_cpu_arg(int cpu, u32 arg); | 118 | void imx_set_cpu_arg(int cpu, u32 arg); |
119 | void v7_cpu_resume(void); | ||
120 | #ifdef CONFIG_SMP | 119 | #ifdef CONFIG_SMP |
121 | void v7_secondary_startup(void); | 120 | void v7_secondary_startup(void); |
122 | void imx_scu_map_io(void); | 121 | void imx_scu_map_io(void); |
@@ -139,18 +138,28 @@ void imx_anatop_init(void); | |||
139 | void imx_anatop_pre_suspend(void); | 138 | void imx_anatop_pre_suspend(void); |
140 | void imx_anatop_post_resume(void); | 139 | void imx_anatop_post_resume(void); |
141 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); | 140 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); |
142 | void imx6q_set_chicken_bit(void); | 141 | void imx6q_set_int_mem_clk_lpm(void); |
142 | void imx6sl_set_wait_clk(bool enter); | ||
143 | 143 | ||
144 | void imx_cpu_die(unsigned int cpu); | 144 | void imx_cpu_die(unsigned int cpu); |
145 | int imx_cpu_kill(unsigned int cpu); | 145 | int imx_cpu_kill(unsigned int cpu); |
146 | 146 | ||
147 | #ifdef CONFIG_PM | 147 | #ifdef CONFIG_SUSPEND |
148 | void v7_cpu_resume(void); | ||
149 | void imx6_suspend(void __iomem *ocram_vbase); | ||
150 | #else | ||
151 | static inline void v7_cpu_resume(void) {} | ||
152 | static inline void imx6_suspend(void __iomem *ocram_vbase) {} | ||
153 | #endif | ||
154 | |||
148 | void imx6q_pm_init(void); | 155 | void imx6q_pm_init(void); |
156 | void imx6dl_pm_init(void); | ||
157 | void imx6sl_pm_init(void); | ||
149 | void imx6q_pm_set_ccm_base(void __iomem *base); | 158 | void imx6q_pm_set_ccm_base(void __iomem *base); |
159 | |||
160 | #ifdef CONFIG_PM | ||
150 | void imx5_pm_init(void); | 161 | void imx5_pm_init(void); |
151 | #else | 162 | #else |
152 | static inline void imx6q_pm_init(void) {} | ||
153 | static inline void imx6q_pm_set_ccm_base(void __iomem *base) {} | ||
154 | static inline void imx5_pm_init(void) {} | 163 | static inline void imx5_pm_init(void) {} |
155 | #endif | 164 | #endif |
156 | 165 | ||
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index 23ddfb693b2d..6bcae0479049 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c | |||
@@ -68,8 +68,8 @@ int __init imx6q_cpuidle_init(void) | |||
68 | /* Need to enable SCU standby for entering WAIT modes */ | 68 | /* Need to enable SCU standby for entering WAIT modes */ |
69 | imx_scu_standby_enable(); | 69 | imx_scu_standby_enable(); |
70 | 70 | ||
71 | /* Set chicken bit to get a reliable WAIT mode support */ | 71 | /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */ |
72 | imx6q_set_chicken_bit(); | 72 | imx6q_set_int_mem_clk_lpm(); |
73 | 73 | ||
74 | return cpuidle_register(&imx6q_cpuidle_driver, NULL); | 74 | return cpuidle_register(&imx6q_cpuidle_driver, NULL); |
75 | } | 75 | } |
diff --git a/arch/arm/mach-imx/cpuidle-imx6sl.c b/arch/arm/mach-imx/cpuidle-imx6sl.c new file mode 100644 index 000000000000..d4b6b8171fa9 --- /dev/null +++ b/arch/arm/mach-imx/cpuidle-imx6sl.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Freescale Semiconductor, Inc. | ||
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 | #include <linux/cpuidle.h> | ||
10 | #include <linux/module.h> | ||
11 | #include <asm/cpuidle.h> | ||
12 | #include <asm/proc-fns.h> | ||
13 | |||
14 | #include "common.h" | ||
15 | #include "cpuidle.h" | ||
16 | |||
17 | static int imx6sl_enter_wait(struct cpuidle_device *dev, | ||
18 | struct cpuidle_driver *drv, int index) | ||
19 | { | ||
20 | imx6q_set_lpm(WAIT_UNCLOCKED); | ||
21 | /* | ||
22 | * Software workaround for ERR005311, see function | ||
23 | * description for details. | ||
24 | */ | ||
25 | imx6sl_set_wait_clk(true); | ||
26 | cpu_do_idle(); | ||
27 | imx6sl_set_wait_clk(false); | ||
28 | imx6q_set_lpm(WAIT_CLOCKED); | ||
29 | |||
30 | return index; | ||
31 | } | ||
32 | |||
33 | static struct cpuidle_driver imx6sl_cpuidle_driver = { | ||
34 | .name = "imx6sl_cpuidle", | ||
35 | .owner = THIS_MODULE, | ||
36 | .states = { | ||
37 | /* WFI */ | ||
38 | ARM_CPUIDLE_WFI_STATE, | ||
39 | /* WAIT */ | ||
40 | { | ||
41 | .exit_latency = 50, | ||
42 | .target_residency = 75, | ||
43 | .flags = CPUIDLE_FLAG_TIME_VALID | | ||
44 | CPUIDLE_FLAG_TIMER_STOP, | ||
45 | .enter = imx6sl_enter_wait, | ||
46 | .name = "WAIT", | ||
47 | .desc = "Clock off", | ||
48 | }, | ||
49 | }, | ||
50 | .state_count = 2, | ||
51 | .safe_state_index = 0, | ||
52 | }; | ||
53 | |||
54 | int __init imx6sl_cpuidle_init(void) | ||
55 | { | ||
56 | return cpuidle_register(&imx6sl_cpuidle_driver, NULL); | ||
57 | } | ||
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h index 786f98ecc145..24e33670417c 100644 --- a/arch/arm/mach-imx/cpuidle.h +++ b/arch/arm/mach-imx/cpuidle.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifdef CONFIG_CPU_IDLE | 13 | #ifdef CONFIG_CPU_IDLE |
14 | extern int imx5_cpuidle_init(void); | 14 | extern int imx5_cpuidle_init(void); |
15 | extern int imx6q_cpuidle_init(void); | 15 | extern int imx6q_cpuidle_init(void); |
16 | extern int imx6sl_cpuidle_init(void); | ||
16 | #else | 17 | #else |
17 | static inline int imx5_cpuidle_init(void) | 18 | static inline int imx5_cpuidle_init(void) |
18 | { | 19 | { |
@@ -22,4 +23,8 @@ static inline int imx6q_cpuidle_init(void) | |||
22 | { | 23 | { |
23 | return 0; | 24 | return 0; |
24 | } | 25 | } |
26 | static inline int imx6sl_cpuidle_init(void) | ||
27 | { | ||
28 | return 0; | ||
29 | } | ||
25 | #endif | 30 | #endif |
diff --git a/arch/arm/mach-imx/devices-imx25.h b/arch/arm/mach-imx/devices-imx25.h index 769563fdeaa0..61a114cddc39 100644 --- a/arch/arm/mach-imx/devices-imx25.h +++ b/arch/arm/mach-imx/devices-imx25.h | |||
@@ -83,7 +83,3 @@ extern const struct imx_spi_imx_data imx25_cspi_data[]; | |||
83 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) | 83 | #define imx25_add_spi_imx0(pdata) imx25_add_spi_imx(0, pdata) |
84 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) | 84 | #define imx25_add_spi_imx1(pdata) imx25_add_spi_imx(1, pdata) |
85 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) | 85 | #define imx25_add_spi_imx2(pdata) imx25_add_spi_imx(2, pdata) |
86 | |||
87 | extern struct imx_mxc_pwm_data imx25_mxc_pwm_data[]; | ||
88 | #define imx25_add_mxc_pwm(id) \ | ||
89 | imx_add_mxc_pwm(&imx25_mxc_pwm_data[id]) | ||
diff --git a/arch/arm/mach-imx/devices-imx51.h b/arch/arm/mach-imx/devices-imx51.h index deee5baee88c..26389f35a2b2 100644 --- a/arch/arm/mach-imx/devices-imx51.h +++ b/arch/arm/mach-imx/devices-imx51.h | |||
@@ -57,10 +57,6 @@ extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[]; | |||
57 | #define imx51_add_imx2_wdt(id) \ | 57 | #define imx51_add_imx2_wdt(id) \ |
58 | imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) | 58 | imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) |
59 | 59 | ||
60 | extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[]; | ||
61 | #define imx51_add_mxc_pwm(id) \ | ||
62 | imx_add_mxc_pwm(&imx51_mxc_pwm_data[id]) | ||
63 | |||
64 | extern const struct imx_imx_keypad_data imx51_imx_keypad_data; | 60 | extern const struct imx_imx_keypad_data imx51_imx_keypad_data; |
65 | #define imx51_add_imx_keypad(pdata) \ | 61 | #define imx51_add_imx_keypad(pdata) \ |
66 | imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) | 62 | imx_add_imx_keypad(&imx51_imx_keypad_data, pdata) |
diff --git a/arch/arm/mach-imx/devices/Kconfig b/arch/arm/mach-imx/devices/Kconfig index 68c74fb0373c..2d260a5a307c 100644 --- a/arch/arm/mach-imx/devices/Kconfig +++ b/arch/arm/mach-imx/devices/Kconfig | |||
@@ -67,9 +67,6 @@ config IMX_HAVE_PLATFORM_MXC_MMC | |||
67 | config IMX_HAVE_PLATFORM_MXC_NAND | 67 | config IMX_HAVE_PLATFORM_MXC_NAND |
68 | bool | 68 | bool |
69 | 69 | ||
70 | config IMX_HAVE_PLATFORM_MXC_PWM | ||
71 | bool | ||
72 | |||
73 | config IMX_HAVE_PLATFORM_MXC_RNGA | 70 | config IMX_HAVE_PLATFORM_MXC_RNGA |
74 | bool | 71 | bool |
75 | select ARCH_HAS_RNGA | 72 | select ARCH_HAS_RNGA |
diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile index 67416fb1dc69..1cbc14cd80d1 100644 --- a/arch/arm/mach-imx/devices/Makefile +++ b/arch/arm/mach-imx/devices/Makefile | |||
@@ -23,7 +23,6 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o | |||
23 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o | 23 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o |
24 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o | 24 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o |
25 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 25 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
26 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o | ||
27 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o | 26 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RNGA) += platform-mxc_rnga.o |
28 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o | 27 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o |
29 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o | 28 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o |
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index c13b76b9f6b3..61352a80bb59 100644 --- a/arch/arm/mach-imx/devices/devices-common.h +++ b/arch/arm/mach-imx/devices/devices-common.h | |||
@@ -290,15 +290,6 @@ struct imx_pata_imx_data { | |||
290 | struct platform_device *__init imx_add_pata_imx( | 290 | struct platform_device *__init imx_add_pata_imx( |
291 | const struct imx_pata_imx_data *data); | 291 | const struct imx_pata_imx_data *data); |
292 | 292 | ||
293 | struct imx_mxc_pwm_data { | ||
294 | int id; | ||
295 | resource_size_t iobase; | ||
296 | resource_size_t iosize; | ||
297 | resource_size_t irq; | ||
298 | }; | ||
299 | struct platform_device *__init imx_add_mxc_pwm( | ||
300 | const struct imx_mxc_pwm_data *data); | ||
301 | |||
302 | /* mxc_rtc */ | 293 | /* mxc_rtc */ |
303 | struct imx_mxc_rtc_data { | 294 | struct imx_mxc_rtc_data { |
304 | const char *devid; | 295 | const char *devid; |
diff --git a/arch/arm/mach-imx/devices/platform-mxc_pwm.c b/arch/arm/mach-imx/devices/platform-mxc_pwm.c deleted file mode 100644 index dcd289777687..000000000000 --- a/arch/arm/mach-imx/devices/platform-mxc_pwm.c +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include "../hardware.h" | ||
10 | #include "devices-common.h" | ||
11 | |||
12 | #define imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) \ | ||
13 | { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _PWM ## _hwid ## _BASE_ADDR, \ | ||
16 | .iosize = _size, \ | ||
17 | .irq = soc ## _INT_PWM ## _hwid, \ | ||
18 | } | ||
19 | #define imx_mxc_pwm_data_entry(soc, _id, _hwid, _size) \ | ||
20 | [_id] = imx_mxc_pwm_data_entry_single(soc, _id, _hwid, _size) | ||
21 | |||
22 | #ifdef CONFIG_SOC_IMX21 | ||
23 | const struct imx_mxc_pwm_data imx21_mxc_pwm_data __initconst = | ||
24 | imx_mxc_pwm_data_entry_single(MX21, 0, , SZ_4K); | ||
25 | #endif /* ifdef CONFIG_SOC_IMX21 */ | ||
26 | |||
27 | #ifdef CONFIG_SOC_IMX25 | ||
28 | const struct imx_mxc_pwm_data imx25_mxc_pwm_data[] __initconst = { | ||
29 | #define imx25_mxc_pwm_data_entry(_id, _hwid) \ | ||
30 | imx_mxc_pwm_data_entry(MX25, _id, _hwid, SZ_16K) | ||
31 | imx25_mxc_pwm_data_entry(0, 1), | ||
32 | imx25_mxc_pwm_data_entry(1, 2), | ||
33 | imx25_mxc_pwm_data_entry(2, 3), | ||
34 | imx25_mxc_pwm_data_entry(3, 4), | ||
35 | }; | ||
36 | #endif /* ifdef CONFIG_SOC_IMX25 */ | ||
37 | |||
38 | #ifdef CONFIG_SOC_IMX27 | ||
39 | const struct imx_mxc_pwm_data imx27_mxc_pwm_data __initconst = | ||
40 | imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); | ||
41 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
42 | |||
43 | #ifdef CONFIG_SOC_IMX51 | ||
44 | const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { | ||
45 | #define imx51_mxc_pwm_data_entry(_id, _hwid) \ | ||
46 | imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K) | ||
47 | imx51_mxc_pwm_data_entry(0, 1), | ||
48 | imx51_mxc_pwm_data_entry(1, 2), | ||
49 | }; | ||
50 | #endif /* ifdef CONFIG_SOC_IMX51 */ | ||
51 | |||
52 | struct platform_device *__init imx_add_mxc_pwm( | ||
53 | const struct imx_mxc_pwm_data *data) | ||
54 | { | ||
55 | struct resource res[] = { | ||
56 | { | ||
57 | .start = data->iobase, | ||
58 | .end = data->iobase + data->iosize - 1, | ||
59 | .flags = IORESOURCE_MEM, | ||
60 | }, { | ||
61 | .start = data->irq, | ||
62 | .end = data->irq, | ||
63 | .flags = IORESOURCE_IRQ, | ||
64 | }, | ||
65 | }; | ||
66 | |||
67 | return imx_add_platform_device("mxc_pwm", data->id, | ||
68 | res, ARRAY_SIZE(res), NULL, 0); | ||
69 | } | ||
diff --git a/arch/arm/mach-imx/hardware.h b/arch/arm/mach-imx/hardware.h index a3b0b04b45c9..abf43bb47eca 100644 --- a/arch/arm/mach-imx/hardware.h +++ b/arch/arm/mach-imx/hardware.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. | 2 | * Copyright 2004-2007, 2014 Freescale Semiconductor, Inc. All Rights Reserved. |
3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de | 3 | * Copyright 2008 Juergen Beisert, kernel@pengutronix.de |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
@@ -20,7 +20,9 @@ | |||
20 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ | 20 | #ifndef __ASM_ARCH_MXC_HARDWARE_H__ |
21 | #define __ASM_ARCH_MXC_HARDWARE_H__ | 21 | #define __ASM_ARCH_MXC_HARDWARE_H__ |
22 | 22 | ||
23 | #ifndef __ASSEMBLY__ | ||
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #endif | ||
24 | #include <asm/sizes.h> | 26 | #include <asm/sizes.h> |
25 | 27 | ||
26 | #define addr_in_module(addr, mod) \ | 28 | #define addr_in_module(addr, mod) \ |
diff --git a/arch/arm/mach-imx/headsmp.S b/arch/arm/mach-imx/headsmp.S index 627f16f0e9d1..de5047c8a6c8 100644 --- a/arch/arm/mach-imx/headsmp.S +++ b/arch/arm/mach-imx/headsmp.S | |||
@@ -12,12 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <asm/asm-offsets.h> | ||
16 | #include <asm/hardware/cache-l2x0.h> | ||
17 | 15 | ||
18 | .section ".text.head", "ax" | ||
19 | |||
20 | #ifdef CONFIG_SMP | ||
21 | diag_reg_offset: | 16 | diag_reg_offset: |
22 | .word g_diag_reg - . | 17 | .word g_diag_reg - . |
23 | 18 | ||
@@ -34,38 +29,3 @@ ENTRY(v7_secondary_startup) | |||
34 | set_diag_reg | 29 | set_diag_reg |
35 | b secondary_startup | 30 | b secondary_startup |
36 | ENDPROC(v7_secondary_startup) | 31 | ENDPROC(v7_secondary_startup) |
37 | #endif | ||
38 | |||
39 | #ifdef CONFIG_ARM_CPU_SUSPEND | ||
40 | /* | ||
41 | * The following code must assume it is running from physical address | ||
42 | * where absolute virtual addresses to the data section have to be | ||
43 | * turned into relative ones. | ||
44 | */ | ||
45 | |||
46 | #ifdef CONFIG_CACHE_L2X0 | ||
47 | .macro pl310_resume | ||
48 | adr r0, l2x0_saved_regs_offset | ||
49 | ldr r2, [r0] | ||
50 | add r2, r2, r0 | ||
51 | ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0 | ||
52 | ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value | ||
53 | str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl | ||
54 | mov r1, #0x1 | ||
55 | str r1, [r0, #L2X0_CTRL] @ re-enable L2 | ||
56 | .endm | ||
57 | |||
58 | l2x0_saved_regs_offset: | ||
59 | .word l2x0_saved_regs - . | ||
60 | |||
61 | #else | ||
62 | .macro pl310_resume | ||
63 | .endm | ||
64 | #endif | ||
65 | |||
66 | ENTRY(v7_cpu_resume) | ||
67 | bl v7_invalidate_l1 | ||
68 | pl310_resume | ||
69 | b cpu_resume | ||
70 | ENDPROC(v7_cpu_resume) | ||
71 | #endif | ||
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 76e5db4fce35..e60456d85c9d 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -182,16 +182,83 @@ static void __init imx6q_enet_phy_init(void) | |||
182 | 182 | ||
183 | static void __init imx6q_1588_init(void) | 183 | static void __init imx6q_1588_init(void) |
184 | { | 184 | { |
185 | struct device_node *np; | ||
186 | struct clk *ptp_clk; | ||
187 | struct clk *enet_ref; | ||
185 | struct regmap *gpr; | 188 | struct regmap *gpr; |
189 | u32 clksel; | ||
186 | 190 | ||
191 | np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-fec"); | ||
192 | if (!np) { | ||
193 | pr_warn("%s: failed to find fec node\n", __func__); | ||
194 | return; | ||
195 | } | ||
196 | |||
197 | ptp_clk = of_clk_get(np, 2); | ||
198 | if (IS_ERR(ptp_clk)) { | ||
199 | pr_warn("%s: failed to get ptp clock\n", __func__); | ||
200 | goto put_node; | ||
201 | } | ||
202 | |||
203 | enet_ref = clk_get_sys(NULL, "enet_ref"); | ||
204 | if (IS_ERR(enet_ref)) { | ||
205 | pr_warn("%s: failed to get enet clock\n", __func__); | ||
206 | goto put_ptp_clk; | ||
207 | } | ||
208 | |||
209 | /* | ||
210 | * If enet_ref from ANATOP/CCM is the PTP clock source, we need to | ||
211 | * set bit IOMUXC_GPR1[21]. Or the PTP clock must be from pad | ||
212 | * (external OSC), and we need to clear the bit. | ||
213 | */ | ||
214 | clksel = ptp_clk == enet_ref ? IMX6Q_GPR1_ENET_CLK_SEL_ANATOP : | ||
215 | IMX6Q_GPR1_ENET_CLK_SEL_PAD; | ||
187 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); | 216 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); |
188 | if (!IS_ERR(gpr)) | 217 | if (!IS_ERR(gpr)) |
189 | regmap_update_bits(gpr, IOMUXC_GPR1, | 218 | regmap_update_bits(gpr, IOMUXC_GPR1, |
190 | IMX6Q_GPR1_ENET_CLK_SEL_MASK, | 219 | IMX6Q_GPR1_ENET_CLK_SEL_MASK, |
191 | IMX6Q_GPR1_ENET_CLK_SEL_ANATOP); | 220 | clksel); |
192 | else | 221 | else |
193 | pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); | 222 | pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); |
194 | 223 | ||
224 | clk_put(enet_ref); | ||
225 | put_ptp_clk: | ||
226 | clk_put(ptp_clk); | ||
227 | put_node: | ||
228 | of_node_put(np); | ||
229 | } | ||
230 | |||
231 | static void __init imx6q_axi_init(void) | ||
232 | { | ||
233 | struct regmap *gpr; | ||
234 | unsigned int mask; | ||
235 | |||
236 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); | ||
237 | if (!IS_ERR(gpr)) { | ||
238 | /* | ||
239 | * Enable the cacheable attribute of VPU and IPU | ||
240 | * AXI transactions. | ||
241 | */ | ||
242 | mask = IMX6Q_GPR4_VPU_WR_CACHE_SEL | | ||
243 | IMX6Q_GPR4_VPU_RD_CACHE_SEL | | ||
244 | IMX6Q_GPR4_VPU_P_WR_CACHE_VAL | | ||
245 | IMX6Q_GPR4_VPU_P_RD_CACHE_VAL_MASK | | ||
246 | IMX6Q_GPR4_IPU_WR_CACHE_CTL | | ||
247 | IMX6Q_GPR4_IPU_RD_CACHE_CTL; | ||
248 | regmap_update_bits(gpr, IOMUXC_GPR4, mask, mask); | ||
249 | |||
250 | /* Increase IPU read QoS priority */ | ||
251 | regmap_update_bits(gpr, IOMUXC_GPR6, | ||
252 | IMX6Q_GPR6_IPU1_ID00_RD_QOS_MASK | | ||
253 | IMX6Q_GPR6_IPU1_ID01_RD_QOS_MASK, | ||
254 | (0xf << 16) | (0x7 << 20)); | ||
255 | regmap_update_bits(gpr, IOMUXC_GPR7, | ||
256 | IMX6Q_GPR7_IPU2_ID00_RD_QOS_MASK | | ||
257 | IMX6Q_GPR7_IPU2_ID01_RD_QOS_MASK, | ||
258 | (0xf << 16) | (0x7 << 20)); | ||
259 | } else { | ||
260 | pr_warn("failed to find fsl,imx6q-iomuxc-gpr regmap\n"); | ||
261 | } | ||
195 | } | 262 | } |
196 | 263 | ||
197 | static void __init imx6q_init_machine(void) | 264 | static void __init imx6q_init_machine(void) |
@@ -212,15 +279,18 @@ static void __init imx6q_init_machine(void) | |||
212 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); | 279 | of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); |
213 | 280 | ||
214 | imx_anatop_init(); | 281 | imx_anatop_init(); |
215 | imx6q_pm_init(); | 282 | cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init(); |
216 | imx6q_1588_init(); | 283 | imx6q_1588_init(); |
284 | imx6q_axi_init(); | ||
217 | } | 285 | } |
218 | 286 | ||
219 | #define OCOTP_CFG3 0x440 | 287 | #define OCOTP_CFG3 0x440 |
220 | #define OCOTP_CFG3_SPEED_SHIFT 16 | 288 | #define OCOTP_CFG3_SPEED_SHIFT 16 |
221 | #define OCOTP_CFG3_SPEED_1P2GHZ 0x3 | 289 | #define OCOTP_CFG3_SPEED_1P2GHZ 0x3 |
290 | #define OCOTP_CFG3_SPEED_996MHZ 0x2 | ||
291 | #define OCOTP_CFG3_SPEED_852MHZ 0x1 | ||
222 | 292 | ||
223 | static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev) | 293 | static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev) |
224 | { | 294 | { |
225 | struct device_node *np; | 295 | struct device_node *np; |
226 | void __iomem *base; | 296 | void __iomem *base; |
@@ -238,11 +308,29 @@ static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev) | |||
238 | goto put_node; | 308 | goto put_node; |
239 | } | 309 | } |
240 | 310 | ||
311 | /* | ||
312 | * SPEED_GRADING[1:0] defines the max speed of ARM: | ||
313 | * 2b'11: 1200000000Hz; | ||
314 | * 2b'10: 996000000Hz; | ||
315 | * 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. | ||
316 | * 2b'00: 792000000Hz; | ||
317 | * We need to set the max speed of ARM according to fuse map. | ||
318 | */ | ||
241 | val = readl_relaxed(base + OCOTP_CFG3); | 319 | val = readl_relaxed(base + OCOTP_CFG3); |
242 | val >>= OCOTP_CFG3_SPEED_SHIFT; | 320 | val >>= OCOTP_CFG3_SPEED_SHIFT; |
243 | if ((val & 0x3) != OCOTP_CFG3_SPEED_1P2GHZ) | 321 | val &= 0x3; |
322 | |||
323 | if (val != OCOTP_CFG3_SPEED_1P2GHZ) | ||
244 | if (dev_pm_opp_disable(cpu_dev, 1200000000)) | 324 | if (dev_pm_opp_disable(cpu_dev, 1200000000)) |
245 | pr_warn("failed to disable 1.2 GHz OPP\n"); | 325 | pr_warn("failed to disable 1.2 GHz OPP\n"); |
326 | if (val < OCOTP_CFG3_SPEED_996MHZ) | ||
327 | if (dev_pm_opp_disable(cpu_dev, 996000000)) | ||
328 | pr_warn("failed to disable 996 MHz OPP\n"); | ||
329 | if (cpu_is_imx6q()) { | ||
330 | if (val != OCOTP_CFG3_SPEED_852MHZ) | ||
331 | if (dev_pm_opp_disable(cpu_dev, 852000000)) | ||
332 | pr_warn("failed to disable 852 MHz OPP\n"); | ||
333 | } | ||
246 | 334 | ||
247 | put_node: | 335 | put_node: |
248 | of_node_put(np); | 336 | of_node_put(np); |
@@ -268,7 +356,7 @@ static void __init imx6q_opp_init(void) | |||
268 | goto put_node; | 356 | goto put_node; |
269 | } | 357 | } |
270 | 358 | ||
271 | imx6q_opp_check_1p2ghz(cpu_dev); | 359 | imx6q_opp_check_speed_grading(cpu_dev); |
272 | 360 | ||
273 | put_node: | 361 | put_node: |
274 | of_node_put(np); | 362 | of_node_put(np); |
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c index 0f4fd4c0ab8e..ad323385115c 100644 --- a/arch/arm/mach-imx/mach-imx6sl.c +++ b/arch/arm/mach-imx/mach-imx6sl.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
18 | 18 | ||
19 | #include "common.h" | 19 | #include "common.h" |
20 | #include "cpuidle.h" | ||
20 | 21 | ||
21 | static void __init imx6sl_fec_init(void) | 22 | static void __init imx6sl_fec_init(void) |
22 | { | 23 | { |
@@ -39,6 +40,8 @@ static void __init imx6sl_init_late(void) | |||
39 | /* imx6sl reuses imx6q cpufreq driver */ | 40 | /* imx6sl reuses imx6q cpufreq driver */ |
40 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) | 41 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) |
41 | platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); | 42 | platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); |
43 | |||
44 | imx6sl_cpuidle_init(); | ||
42 | } | 45 | } |
43 | 46 | ||
44 | static void __init imx6sl_init_machine(void) | 47 | static void __init imx6sl_init_machine(void) |
@@ -55,8 +58,7 @@ static void __init imx6sl_init_machine(void) | |||
55 | 58 | ||
56 | imx6sl_fec_init(); | 59 | imx6sl_fec_init(); |
57 | imx_anatop_init(); | 60 | imx_anatop_init(); |
58 | /* Reuse imx6q pm code */ | 61 | imx6sl_pm_init(); |
59 | imx6q_pm_init(); | ||
60 | } | 62 | } |
61 | 63 | ||
62 | static void __init imx6sl_init_irq(void) | 64 | static void __init imx6sl_init_irq(void) |
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c new file mode 100644 index 000000000000..16f0d249f6a7 --- /dev/null +++ b/arch/arm/mach-imx/pm-imx6.c | |||
@@ -0,0 +1,552 @@ | |||
1 | /* | ||
2 | * Copyright 2011-2014 Freescale Semiconductor, Inc. | ||
3 | * Copyright 2011 Linaro Ltd. | ||
4 | * | ||
5 | * The code contained herein is licensed under the GNU General Public | ||
6 | * License. You may obtain a copy of the GNU General Public License | ||
7 | * Version 2 or later at the following locations: | ||
8 | * | ||
9 | * http://www.opensource.org/licenses/gpl-license.html | ||
10 | * http://www.gnu.org/copyleft/gpl.html | ||
11 | */ | ||
12 | |||
13 | #include <linux/delay.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/genalloc.h> | ||
18 | #include <linux/mfd/syscon.h> | ||
19 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> | ||
20 | #include <linux/of.h> | ||
21 | #include <linux/of_address.h> | ||
22 | #include <linux/of_platform.h> | ||
23 | #include <linux/regmap.h> | ||
24 | #include <linux/suspend.h> | ||
25 | #include <asm/cacheflush.h> | ||
26 | #include <asm/fncpy.h> | ||
27 | #include <asm/proc-fns.h> | ||
28 | #include <asm/suspend.h> | ||
29 | #include <asm/tlb.h> | ||
30 | |||
31 | #include "common.h" | ||
32 | #include "hardware.h" | ||
33 | |||
34 | #define CCR 0x0 | ||
35 | #define BM_CCR_WB_COUNT (0x7 << 16) | ||
36 | #define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21) | ||
37 | #define BM_CCR_RBC_EN (0x1 << 27) | ||
38 | |||
39 | #define CLPCR 0x54 | ||
40 | #define BP_CLPCR_LPM 0 | ||
41 | #define BM_CLPCR_LPM (0x3 << 0) | ||
42 | #define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2) | ||
43 | #define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5) | ||
44 | #define BM_CLPCR_SBYOS (0x1 << 6) | ||
45 | #define BM_CLPCR_DIS_REF_OSC (0x1 << 7) | ||
46 | #define BM_CLPCR_VSTBY (0x1 << 8) | ||
47 | #define BP_CLPCR_STBY_COUNT 9 | ||
48 | #define BM_CLPCR_STBY_COUNT (0x3 << 9) | ||
49 | #define BM_CLPCR_COSC_PWRDOWN (0x1 << 11) | ||
50 | #define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16) | ||
51 | #define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17) | ||
52 | #define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19) | ||
53 | #define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21) | ||
54 | #define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22) | ||
55 | #define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23) | ||
56 | #define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24) | ||
57 | #define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25) | ||
58 | #define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26) | ||
59 | #define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27) | ||
60 | |||
61 | #define CGPR 0x64 | ||
62 | #define BM_CGPR_INT_MEM_CLK_LPM (0x1 << 17) | ||
63 | |||
64 | #define MX6Q_SUSPEND_OCRAM_SIZE 0x1000 | ||
65 | #define MX6_MAX_MMDC_IO_NUM 33 | ||
66 | |||
67 | static void __iomem *ccm_base; | ||
68 | static void __iomem *suspend_ocram_base; | ||
69 | static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase); | ||
70 | |||
71 | /* | ||
72 | * suspend ocram space layout: | ||
73 | * ======================== high address ====================== | ||
74 | * . | ||
75 | * . | ||
76 | * . | ||
77 | * ^ | ||
78 | * ^ | ||
79 | * ^ | ||
80 | * imx6_suspend code | ||
81 | * PM_INFO structure(imx6_cpu_pm_info) | ||
82 | * ======================== low address ======================= | ||
83 | */ | ||
84 | |||
85 | struct imx6_pm_base { | ||
86 | phys_addr_t pbase; | ||
87 | void __iomem *vbase; | ||
88 | }; | ||
89 | |||
90 | struct imx6_pm_socdata { | ||
91 | u32 cpu_type; | ||
92 | const char *mmdc_compat; | ||
93 | const char *src_compat; | ||
94 | const char *iomuxc_compat; | ||
95 | const char *gpc_compat; | ||
96 | const u32 mmdc_io_num; | ||
97 | const u32 *mmdc_io_offset; | ||
98 | }; | ||
99 | |||
100 | static const u32 imx6q_mmdc_io_offset[] __initconst = { | ||
101 | 0x5ac, 0x5b4, 0x528, 0x520, /* DQM0 ~ DQM3 */ | ||
102 | 0x514, 0x510, 0x5bc, 0x5c4, /* DQM4 ~ DQM7 */ | ||
103 | 0x56c, 0x578, 0x588, 0x594, /* CAS, RAS, SDCLK_0, SDCLK_1 */ | ||
104 | 0x5a8, 0x5b0, 0x524, 0x51c, /* SDQS0 ~ SDQS3 */ | ||
105 | 0x518, 0x50c, 0x5b8, 0x5c0, /* SDQS4 ~ SDQS7 */ | ||
106 | 0x784, 0x788, 0x794, 0x79c, /* GPR_B0DS ~ GPR_B3DS */ | ||
107 | 0x7a0, 0x7a4, 0x7a8, 0x748, /* GPR_B4DS ~ GPR_B7DS */ | ||
108 | 0x59c, 0x5a0, 0x750, 0x774, /* SODT0, SODT1, MODE_CTL, MODE */ | ||
109 | 0x74c, /* GPR_ADDS */ | ||
110 | }; | ||
111 | |||
112 | static const u32 imx6dl_mmdc_io_offset[] __initconst = { | ||
113 | 0x470, 0x474, 0x478, 0x47c, /* DQM0 ~ DQM3 */ | ||
114 | 0x480, 0x484, 0x488, 0x48c, /* DQM4 ~ DQM7 */ | ||
115 | 0x464, 0x490, 0x4ac, 0x4b0, /* CAS, RAS, SDCLK_0, SDCLK_1 */ | ||
116 | 0x4bc, 0x4c0, 0x4c4, 0x4c8, /* DRAM_SDQS0 ~ DRAM_SDQS3 */ | ||
117 | 0x4cc, 0x4d0, 0x4d4, 0x4d8, /* DRAM_SDQS4 ~ DRAM_SDQS7 */ | ||
118 | 0x764, 0x770, 0x778, 0x77c, /* GPR_B0DS ~ GPR_B3DS */ | ||
119 | 0x780, 0x784, 0x78c, 0x748, /* GPR_B4DS ~ GPR_B7DS */ | ||
120 | 0x4b4, 0x4b8, 0x750, 0x760, /* SODT0, SODT1, MODE_CTL, MODE */ | ||
121 | 0x74c, /* GPR_ADDS */ | ||
122 | }; | ||
123 | |||
124 | static const u32 imx6sl_mmdc_io_offset[] __initconst = { | ||
125 | 0x30c, 0x310, 0x314, 0x318, /* DQM0 ~ DQM3 */ | ||
126 | 0x5c4, 0x5cc, 0x5d4, 0x5d8, /* GPR_B0DS ~ GPR_B3DS */ | ||
127 | 0x300, 0x31c, 0x338, 0x5ac, /* CAS, RAS, SDCLK_0, GPR_ADDS */ | ||
128 | 0x33c, 0x340, 0x5b0, 0x5c0, /* SODT0, SODT1, MODE_CTL, MODE */ | ||
129 | 0x330, 0x334, 0x320, /* SDCKE0, SDCKE1, RESET */ | ||
130 | }; | ||
131 | |||
132 | static const struct imx6_pm_socdata imx6q_pm_data __initconst = { | ||
133 | .cpu_type = MXC_CPU_IMX6Q, | ||
134 | .mmdc_compat = "fsl,imx6q-mmdc", | ||
135 | .src_compat = "fsl,imx6q-src", | ||
136 | .iomuxc_compat = "fsl,imx6q-iomuxc", | ||
137 | .gpc_compat = "fsl,imx6q-gpc", | ||
138 | .mmdc_io_num = ARRAY_SIZE(imx6q_mmdc_io_offset), | ||
139 | .mmdc_io_offset = imx6q_mmdc_io_offset, | ||
140 | }; | ||
141 | |||
142 | static const struct imx6_pm_socdata imx6dl_pm_data __initconst = { | ||
143 | .cpu_type = MXC_CPU_IMX6DL, | ||
144 | .mmdc_compat = "fsl,imx6q-mmdc", | ||
145 | .src_compat = "fsl,imx6q-src", | ||
146 | .iomuxc_compat = "fsl,imx6dl-iomuxc", | ||
147 | .gpc_compat = "fsl,imx6q-gpc", | ||
148 | .mmdc_io_num = ARRAY_SIZE(imx6dl_mmdc_io_offset), | ||
149 | .mmdc_io_offset = imx6dl_mmdc_io_offset, | ||
150 | }; | ||
151 | |||
152 | static const struct imx6_pm_socdata imx6sl_pm_data __initconst = { | ||
153 | .cpu_type = MXC_CPU_IMX6SL, | ||
154 | .mmdc_compat = "fsl,imx6sl-mmdc", | ||
155 | .src_compat = "fsl,imx6sl-src", | ||
156 | .iomuxc_compat = "fsl,imx6sl-iomuxc", | ||
157 | .gpc_compat = "fsl,imx6sl-gpc", | ||
158 | .mmdc_io_num = ARRAY_SIZE(imx6sl_mmdc_io_offset), | ||
159 | .mmdc_io_offset = imx6sl_mmdc_io_offset, | ||
160 | }; | ||
161 | |||
162 | /* | ||
163 | * This structure is for passing necessary data for low level ocram | ||
164 | * suspend code(arch/arm/mach-imx/suspend-imx6.S), if this struct | ||
165 | * definition is changed, the offset definition in | ||
166 | * arch/arm/mach-imx/suspend-imx6.S must be also changed accordingly, | ||
167 | * otherwise, the suspend to ocram function will be broken! | ||
168 | */ | ||
169 | struct imx6_cpu_pm_info { | ||
170 | phys_addr_t pbase; /* The physical address of pm_info. */ | ||
171 | phys_addr_t resume_addr; /* The physical resume address for asm code */ | ||
172 | u32 cpu_type; | ||
173 | u32 pm_info_size; /* Size of pm_info. */ | ||
174 | struct imx6_pm_base mmdc_base; | ||
175 | struct imx6_pm_base src_base; | ||
176 | struct imx6_pm_base iomuxc_base; | ||
177 | struct imx6_pm_base ccm_base; | ||
178 | struct imx6_pm_base gpc_base; | ||
179 | struct imx6_pm_base l2_base; | ||
180 | u32 mmdc_io_num; /* Number of MMDC IOs which need saved/restored. */ | ||
181 | u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */ | ||
182 | } __aligned(8); | ||
183 | |||
184 | void imx6q_set_int_mem_clk_lpm(void) | ||
185 | { | ||
186 | u32 val = readl_relaxed(ccm_base + CGPR); | ||
187 | |||
188 | val |= BM_CGPR_INT_MEM_CLK_LPM; | ||
189 | writel_relaxed(val, ccm_base + CGPR); | ||
190 | } | ||
191 | |||
192 | static void imx6q_enable_rbc(bool enable) | ||
193 | { | ||
194 | u32 val; | ||
195 | |||
196 | /* | ||
197 | * need to mask all interrupts in GPC before | ||
198 | * operating RBC configurations | ||
199 | */ | ||
200 | imx_gpc_mask_all(); | ||
201 | |||
202 | /* configure RBC enable bit */ | ||
203 | val = readl_relaxed(ccm_base + CCR); | ||
204 | val &= ~BM_CCR_RBC_EN; | ||
205 | val |= enable ? BM_CCR_RBC_EN : 0; | ||
206 | writel_relaxed(val, ccm_base + CCR); | ||
207 | |||
208 | /* configure RBC count */ | ||
209 | val = readl_relaxed(ccm_base + CCR); | ||
210 | val &= ~BM_CCR_RBC_BYPASS_COUNT; | ||
211 | val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0; | ||
212 | writel(val, ccm_base + CCR); | ||
213 | |||
214 | /* | ||
215 | * need to delay at least 2 cycles of CKIL(32K) | ||
216 | * due to hardware design requirement, which is | ||
217 | * ~61us, here we use 65us for safe | ||
218 | */ | ||
219 | udelay(65); | ||
220 | |||
221 | /* restore GPC interrupt mask settings */ | ||
222 | imx_gpc_restore_all(); | ||
223 | } | ||
224 | |||
225 | static void imx6q_enable_wb(bool enable) | ||
226 | { | ||
227 | u32 val; | ||
228 | |||
229 | /* configure well bias enable bit */ | ||
230 | val = readl_relaxed(ccm_base + CLPCR); | ||
231 | val &= ~BM_CLPCR_WB_PER_AT_LPM; | ||
232 | val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0; | ||
233 | writel_relaxed(val, ccm_base + CLPCR); | ||
234 | |||
235 | /* configure well bias count */ | ||
236 | val = readl_relaxed(ccm_base + CCR); | ||
237 | val &= ~BM_CCR_WB_COUNT; | ||
238 | val |= enable ? BM_CCR_WB_COUNT : 0; | ||
239 | writel_relaxed(val, ccm_base + CCR); | ||
240 | } | ||
241 | |||
242 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) | ||
243 | { | ||
244 | struct irq_desc *iomuxc_irq_desc; | ||
245 | u32 val = readl_relaxed(ccm_base + CLPCR); | ||
246 | |||
247 | val &= ~BM_CLPCR_LPM; | ||
248 | switch (mode) { | ||
249 | case WAIT_CLOCKED: | ||
250 | break; | ||
251 | case WAIT_UNCLOCKED: | ||
252 | val |= 0x1 << BP_CLPCR_LPM; | ||
253 | val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM; | ||
254 | break; | ||
255 | case STOP_POWER_ON: | ||
256 | val |= 0x2 << BP_CLPCR_LPM; | ||
257 | break; | ||
258 | case WAIT_UNCLOCKED_POWER_OFF: | ||
259 | val |= 0x1 << BP_CLPCR_LPM; | ||
260 | val &= ~BM_CLPCR_VSTBY; | ||
261 | val &= ~BM_CLPCR_SBYOS; | ||
262 | break; | ||
263 | case STOP_POWER_OFF: | ||
264 | val |= 0x2 << BP_CLPCR_LPM; | ||
265 | val |= 0x3 << BP_CLPCR_STBY_COUNT; | ||
266 | val |= BM_CLPCR_VSTBY; | ||
267 | val |= BM_CLPCR_SBYOS; | ||
268 | if (cpu_is_imx6sl()) { | ||
269 | val |= BM_CLPCR_BYPASS_PMIC_READY; | ||
270 | val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS; | ||
271 | } else { | ||
272 | val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; | ||
273 | } | ||
274 | break; | ||
275 | default: | ||
276 | return -EINVAL; | ||
277 | } | ||
278 | |||
279 | /* | ||
280 | * ERR007265: CCM: When improper low-power sequence is used, | ||
281 | * the SoC enters low power mode before the ARM core executes WFI. | ||
282 | * | ||
283 | * Software workaround: | ||
284 | * 1) Software should trigger IRQ #32 (IOMUX) to be always pending | ||
285 | * by setting IOMUX_GPR1_GINT. | ||
286 | * 2) Software should then unmask IRQ #32 in GPC before setting CCM | ||
287 | * Low-Power mode. | ||
288 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode | ||
289 | * is set (set bits 0-1 of CCM_CLPCR). | ||
290 | */ | ||
291 | iomuxc_irq_desc = irq_to_desc(32); | ||
292 | imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data); | ||
293 | writel_relaxed(val, ccm_base + CLPCR); | ||
294 | imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data); | ||
295 | |||
296 | return 0; | ||
297 | } | ||
298 | |||
299 | static int imx6q_suspend_finish(unsigned long val) | ||
300 | { | ||
301 | if (!imx6_suspend_in_ocram_fn) { | ||
302 | cpu_do_idle(); | ||
303 | } else { | ||
304 | /* | ||
305 | * call low level suspend function in ocram, | ||
306 | * as we need to float DDR IO. | ||
307 | */ | ||
308 | local_flush_tlb_all(); | ||
309 | imx6_suspend_in_ocram_fn(suspend_ocram_base); | ||
310 | } | ||
311 | |||
312 | return 0; | ||
313 | } | ||
314 | |||
315 | static int imx6q_pm_enter(suspend_state_t state) | ||
316 | { | ||
317 | switch (state) { | ||
318 | case PM_SUSPEND_MEM: | ||
319 | imx6q_set_lpm(STOP_POWER_OFF); | ||
320 | imx6q_enable_wb(true); | ||
321 | /* | ||
322 | * For suspend into ocram, asm code already take care of | ||
323 | * RBC setting, so we do NOT need to do that here. | ||
324 | */ | ||
325 | if (!imx6_suspend_in_ocram_fn) | ||
326 | imx6q_enable_rbc(true); | ||
327 | imx_gpc_pre_suspend(); | ||
328 | imx_anatop_pre_suspend(); | ||
329 | imx_set_cpu_jump(0, v7_cpu_resume); | ||
330 | /* Zzz ... */ | ||
331 | cpu_suspend(0, imx6q_suspend_finish); | ||
332 | if (cpu_is_imx6q() || cpu_is_imx6dl()) | ||
333 | imx_smp_prepare(); | ||
334 | imx_anatop_post_resume(); | ||
335 | imx_gpc_post_resume(); | ||
336 | imx6q_enable_rbc(false); | ||
337 | imx6q_enable_wb(false); | ||
338 | imx6q_set_lpm(WAIT_CLOCKED); | ||
339 | break; | ||
340 | default: | ||
341 | return -EINVAL; | ||
342 | } | ||
343 | |||
344 | return 0; | ||
345 | } | ||
346 | |||
347 | static const struct platform_suspend_ops imx6q_pm_ops = { | ||
348 | .enter = imx6q_pm_enter, | ||
349 | .valid = suspend_valid_only_mem, | ||
350 | }; | ||
351 | |||
352 | void __init imx6q_pm_set_ccm_base(void __iomem *base) | ||
353 | { | ||
354 | ccm_base = base; | ||
355 | } | ||
356 | |||
357 | static int __init imx6_pm_get_base(struct imx6_pm_base *base, | ||
358 | const char *compat) | ||
359 | { | ||
360 | struct device_node *node; | ||
361 | struct resource res; | ||
362 | int ret = 0; | ||
363 | |||
364 | node = of_find_compatible_node(NULL, NULL, compat); | ||
365 | if (!node) { | ||
366 | ret = -ENODEV; | ||
367 | goto out; | ||
368 | } | ||
369 | |||
370 | ret = of_address_to_resource(node, 0, &res); | ||
371 | if (ret) | ||
372 | goto put_node; | ||
373 | |||
374 | base->pbase = res.start; | ||
375 | base->vbase = ioremap(res.start, resource_size(&res)); | ||
376 | if (!base->vbase) | ||
377 | ret = -ENOMEM; | ||
378 | |||
379 | put_node: | ||
380 | of_node_put(node); | ||
381 | out: | ||
382 | return ret; | ||
383 | } | ||
384 | |||
385 | static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) | ||
386 | { | ||
387 | phys_addr_t ocram_pbase; | ||
388 | struct device_node *node; | ||
389 | struct platform_device *pdev; | ||
390 | struct imx6_cpu_pm_info *pm_info; | ||
391 | struct gen_pool *ocram_pool; | ||
392 | unsigned long ocram_base; | ||
393 | int i, ret = 0; | ||
394 | const u32 *mmdc_offset_array; | ||
395 | |||
396 | suspend_set_ops(&imx6q_pm_ops); | ||
397 | |||
398 | if (!socdata) { | ||
399 | pr_warn("%s: invalid argument!\n", __func__); | ||
400 | return -EINVAL; | ||
401 | } | ||
402 | |||
403 | node = of_find_compatible_node(NULL, NULL, "mmio-sram"); | ||
404 | if (!node) { | ||
405 | pr_warn("%s: failed to find ocram node!\n", __func__); | ||
406 | return -ENODEV; | ||
407 | } | ||
408 | |||
409 | pdev = of_find_device_by_node(node); | ||
410 | if (!pdev) { | ||
411 | pr_warn("%s: failed to find ocram device!\n", __func__); | ||
412 | ret = -ENODEV; | ||
413 | goto put_node; | ||
414 | } | ||
415 | |||
416 | ocram_pool = dev_get_gen_pool(&pdev->dev); | ||
417 | if (!ocram_pool) { | ||
418 | pr_warn("%s: ocram pool unavailable!\n", __func__); | ||
419 | ret = -ENODEV; | ||
420 | goto put_node; | ||
421 | } | ||
422 | |||
423 | ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE); | ||
424 | if (!ocram_base) { | ||
425 | pr_warn("%s: unable to alloc ocram!\n", __func__); | ||
426 | ret = -ENOMEM; | ||
427 | goto put_node; | ||
428 | } | ||
429 | |||
430 | ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base); | ||
431 | |||
432 | suspend_ocram_base = __arm_ioremap_exec(ocram_pbase, | ||
433 | MX6Q_SUSPEND_OCRAM_SIZE, false); | ||
434 | |||
435 | pm_info = suspend_ocram_base; | ||
436 | pm_info->pbase = ocram_pbase; | ||
437 | pm_info->resume_addr = virt_to_phys(v7_cpu_resume); | ||
438 | pm_info->pm_info_size = sizeof(*pm_info); | ||
439 | |||
440 | /* | ||
441 | * ccm physical address is not used by asm code currently, | ||
442 | * so get ccm virtual address directly, as we already have | ||
443 | * it from ccm driver. | ||
444 | */ | ||
445 | pm_info->ccm_base.vbase = ccm_base; | ||
446 | |||
447 | ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat); | ||
448 | if (ret) { | ||
449 | pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret); | ||
450 | goto put_node; | ||
451 | } | ||
452 | |||
453 | ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat); | ||
454 | if (ret) { | ||
455 | pr_warn("%s: failed to get src base %d!\n", __func__, ret); | ||
456 | goto src_map_failed; | ||
457 | } | ||
458 | |||
459 | ret = imx6_pm_get_base(&pm_info->iomuxc_base, socdata->iomuxc_compat); | ||
460 | if (ret) { | ||
461 | pr_warn("%s: failed to get iomuxc base %d!\n", __func__, ret); | ||
462 | goto iomuxc_map_failed; | ||
463 | } | ||
464 | |||
465 | ret = imx6_pm_get_base(&pm_info->gpc_base, socdata->gpc_compat); | ||
466 | if (ret) { | ||
467 | pr_warn("%s: failed to get gpc base %d!\n", __func__, ret); | ||
468 | goto gpc_map_failed; | ||
469 | } | ||
470 | |||
471 | ret = imx6_pm_get_base(&pm_info->l2_base, "arm,pl310-cache"); | ||
472 | if (ret) { | ||
473 | pr_warn("%s: failed to get pl310-cache base %d!\n", | ||
474 | __func__, ret); | ||
475 | goto pl310_cache_map_failed; | ||
476 | } | ||
477 | |||
478 | pm_info->cpu_type = socdata->cpu_type; | ||
479 | pm_info->mmdc_io_num = socdata->mmdc_io_num; | ||
480 | mmdc_offset_array = socdata->mmdc_io_offset; | ||
481 | |||
482 | for (i = 0; i < pm_info->mmdc_io_num; i++) { | ||
483 | pm_info->mmdc_io_val[i][0] = | ||
484 | mmdc_offset_array[i]; | ||
485 | pm_info->mmdc_io_val[i][1] = | ||
486 | readl_relaxed(pm_info->iomuxc_base.vbase + | ||
487 | mmdc_offset_array[i]); | ||
488 | } | ||
489 | |||
490 | imx6_suspend_in_ocram_fn = fncpy( | ||
491 | suspend_ocram_base + sizeof(*pm_info), | ||
492 | &imx6_suspend, | ||
493 | MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)); | ||
494 | |||
495 | goto put_node; | ||
496 | |||
497 | pl310_cache_map_failed: | ||
498 | iounmap(&pm_info->gpc_base.vbase); | ||
499 | gpc_map_failed: | ||
500 | iounmap(&pm_info->iomuxc_base.vbase); | ||
501 | iomuxc_map_failed: | ||
502 | iounmap(&pm_info->src_base.vbase); | ||
503 | src_map_failed: | ||
504 | iounmap(&pm_info->mmdc_base.vbase); | ||
505 | put_node: | ||
506 | of_node_put(node); | ||
507 | |||
508 | return ret; | ||
509 | } | ||
510 | |||
511 | static void __init imx6_pm_common_init(const struct imx6_pm_socdata | ||
512 | *socdata) | ||
513 | { | ||
514 | struct regmap *gpr; | ||
515 | int ret; | ||
516 | |||
517 | WARN_ON(!ccm_base); | ||
518 | |||
519 | if (IS_ENABLED(CONFIG_SUSPEND)) { | ||
520 | ret = imx6q_suspend_init(socdata); | ||
521 | if (ret) | ||
522 | pr_warn("%s: No DDR LPM support with suspend %d!\n", | ||
523 | __func__, ret); | ||
524 | } | ||
525 | |||
526 | /* | ||
527 | * This is for SW workaround step #1 of ERR007265, see comments | ||
528 | * in imx6q_set_lpm for details of this errata. | ||
529 | * Force IOMUXC irq pending, so that the interrupt to GPC can be | ||
530 | * used to deassert dsm_request signal when the signal gets | ||
531 | * asserted unexpectedly. | ||
532 | */ | ||
533 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); | ||
534 | if (!IS_ERR(gpr)) | ||
535 | regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT, | ||
536 | IMX6Q_GPR1_GINT); | ||
537 | } | ||
538 | |||
539 | void __init imx6q_pm_init(void) | ||
540 | { | ||
541 | imx6_pm_common_init(&imx6q_pm_data); | ||
542 | } | ||
543 | |||
544 | void __init imx6dl_pm_init(void) | ||
545 | { | ||
546 | imx6_pm_common_init(&imx6dl_pm_data); | ||
547 | } | ||
548 | |||
549 | void __init imx6sl_pm_init(void) | ||
550 | { | ||
551 | imx6_pm_common_init(&imx6sl_pm_data); | ||
552 | } | ||
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c deleted file mode 100644 index 9d47adc078aa..000000000000 --- a/arch/arm/mach-imx/pm-imx6q.c +++ /dev/null | |||
@@ -1,243 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2011-2013 Freescale Semiconductor, Inc. | ||
3 | * Copyright 2011 Linaro Ltd. | ||
4 | * | ||
5 | * The code contained herein is licensed under the GNU General Public | ||
6 | * License. You may obtain a copy of the GNU General Public License | ||
7 | * Version 2 or later at the following locations: | ||
8 | * | ||
9 | * http://www.opensource.org/licenses/gpl-license.html | ||
10 | * http://www.gnu.org/copyleft/gpl.html | ||
11 | */ | ||
12 | |||
13 | #include <linux/delay.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/irq.h> | ||
17 | #include <linux/mfd/syscon.h> | ||
18 | #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> | ||
19 | #include <linux/of.h> | ||
20 | #include <linux/of_address.h> | ||
21 | #include <linux/regmap.h> | ||
22 | #include <linux/suspend.h> | ||
23 | #include <asm/cacheflush.h> | ||
24 | #include <asm/proc-fns.h> | ||
25 | #include <asm/suspend.h> | ||
26 | #include <asm/hardware/cache-l2x0.h> | ||
27 | |||
28 | #include "common.h" | ||
29 | #include "hardware.h" | ||
30 | |||
31 | #define CCR 0x0 | ||
32 | #define BM_CCR_WB_COUNT (0x7 << 16) | ||
33 | #define BM_CCR_RBC_BYPASS_COUNT (0x3f << 21) | ||
34 | #define BM_CCR_RBC_EN (0x1 << 27) | ||
35 | |||
36 | #define CLPCR 0x54 | ||
37 | #define BP_CLPCR_LPM 0 | ||
38 | #define BM_CLPCR_LPM (0x3 << 0) | ||
39 | #define BM_CLPCR_BYPASS_PMIC_READY (0x1 << 2) | ||
40 | #define BM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5) | ||
41 | #define BM_CLPCR_SBYOS (0x1 << 6) | ||
42 | #define BM_CLPCR_DIS_REF_OSC (0x1 << 7) | ||
43 | #define BM_CLPCR_VSTBY (0x1 << 8) | ||
44 | #define BP_CLPCR_STBY_COUNT 9 | ||
45 | #define BM_CLPCR_STBY_COUNT (0x3 << 9) | ||
46 | #define BM_CLPCR_COSC_PWRDOWN (0x1 << 11) | ||
47 | #define BM_CLPCR_WB_PER_AT_LPM (0x1 << 16) | ||
48 | #define BM_CLPCR_WB_CORE_AT_LPM (0x1 << 17) | ||
49 | #define BM_CLPCR_BYP_MMDC_CH0_LPM_HS (0x1 << 19) | ||
50 | #define BM_CLPCR_BYP_MMDC_CH1_LPM_HS (0x1 << 21) | ||
51 | #define BM_CLPCR_MASK_CORE0_WFI (0x1 << 22) | ||
52 | #define BM_CLPCR_MASK_CORE1_WFI (0x1 << 23) | ||
53 | #define BM_CLPCR_MASK_CORE2_WFI (0x1 << 24) | ||
54 | #define BM_CLPCR_MASK_CORE3_WFI (0x1 << 25) | ||
55 | #define BM_CLPCR_MASK_SCU_IDLE (0x1 << 26) | ||
56 | #define BM_CLPCR_MASK_L2CC_IDLE (0x1 << 27) | ||
57 | |||
58 | #define CGPR 0x64 | ||
59 | #define BM_CGPR_CHICKEN_BIT (0x1 << 17) | ||
60 | |||
61 | static void __iomem *ccm_base; | ||
62 | |||
63 | void imx6q_set_chicken_bit(void) | ||
64 | { | ||
65 | u32 val = readl_relaxed(ccm_base + CGPR); | ||
66 | |||
67 | val |= BM_CGPR_CHICKEN_BIT; | ||
68 | writel_relaxed(val, ccm_base + CGPR); | ||
69 | } | ||
70 | |||
71 | static void imx6q_enable_rbc(bool enable) | ||
72 | { | ||
73 | u32 val; | ||
74 | |||
75 | /* | ||
76 | * need to mask all interrupts in GPC before | ||
77 | * operating RBC configurations | ||
78 | */ | ||
79 | imx_gpc_mask_all(); | ||
80 | |||
81 | /* configure RBC enable bit */ | ||
82 | val = readl_relaxed(ccm_base + CCR); | ||
83 | val &= ~BM_CCR_RBC_EN; | ||
84 | val |= enable ? BM_CCR_RBC_EN : 0; | ||
85 | writel_relaxed(val, ccm_base + CCR); | ||
86 | |||
87 | /* configure RBC count */ | ||
88 | val = readl_relaxed(ccm_base + CCR); | ||
89 | val &= ~BM_CCR_RBC_BYPASS_COUNT; | ||
90 | val |= enable ? BM_CCR_RBC_BYPASS_COUNT : 0; | ||
91 | writel(val, ccm_base + CCR); | ||
92 | |||
93 | /* | ||
94 | * need to delay at least 2 cycles of CKIL(32K) | ||
95 | * due to hardware design requirement, which is | ||
96 | * ~61us, here we use 65us for safe | ||
97 | */ | ||
98 | udelay(65); | ||
99 | |||
100 | /* restore GPC interrupt mask settings */ | ||
101 | imx_gpc_restore_all(); | ||
102 | } | ||
103 | |||
104 | static void imx6q_enable_wb(bool enable) | ||
105 | { | ||
106 | u32 val; | ||
107 | |||
108 | /* configure well bias enable bit */ | ||
109 | val = readl_relaxed(ccm_base + CLPCR); | ||
110 | val &= ~BM_CLPCR_WB_PER_AT_LPM; | ||
111 | val |= enable ? BM_CLPCR_WB_PER_AT_LPM : 0; | ||
112 | writel_relaxed(val, ccm_base + CLPCR); | ||
113 | |||
114 | /* configure well bias count */ | ||
115 | val = readl_relaxed(ccm_base + CCR); | ||
116 | val &= ~BM_CCR_WB_COUNT; | ||
117 | val |= enable ? BM_CCR_WB_COUNT : 0; | ||
118 | writel_relaxed(val, ccm_base + CCR); | ||
119 | } | ||
120 | |||
121 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) | ||
122 | { | ||
123 | struct irq_desc *iomuxc_irq_desc; | ||
124 | u32 val = readl_relaxed(ccm_base + CLPCR); | ||
125 | |||
126 | val &= ~BM_CLPCR_LPM; | ||
127 | switch (mode) { | ||
128 | case WAIT_CLOCKED: | ||
129 | break; | ||
130 | case WAIT_UNCLOCKED: | ||
131 | val |= 0x1 << BP_CLPCR_LPM; | ||
132 | val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM; | ||
133 | break; | ||
134 | case STOP_POWER_ON: | ||
135 | val |= 0x2 << BP_CLPCR_LPM; | ||
136 | break; | ||
137 | case WAIT_UNCLOCKED_POWER_OFF: | ||
138 | val |= 0x1 << BP_CLPCR_LPM; | ||
139 | val &= ~BM_CLPCR_VSTBY; | ||
140 | val &= ~BM_CLPCR_SBYOS; | ||
141 | break; | ||
142 | case STOP_POWER_OFF: | ||
143 | val |= 0x2 << BP_CLPCR_LPM; | ||
144 | val |= 0x3 << BP_CLPCR_STBY_COUNT; | ||
145 | val |= BM_CLPCR_VSTBY; | ||
146 | val |= BM_CLPCR_SBYOS; | ||
147 | if (cpu_is_imx6sl()) { | ||
148 | val |= BM_CLPCR_BYPASS_PMIC_READY; | ||
149 | val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS; | ||
150 | } else { | ||
151 | val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; | ||
152 | } | ||
153 | break; | ||
154 | default: | ||
155 | return -EINVAL; | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * ERR007265: CCM: When improper low-power sequence is used, | ||
160 | * the SoC enters low power mode before the ARM core executes WFI. | ||
161 | * | ||
162 | * Software workaround: | ||
163 | * 1) Software should trigger IRQ #32 (IOMUX) to be always pending | ||
164 | * by setting IOMUX_GPR1_GINT. | ||
165 | * 2) Software should then unmask IRQ #32 in GPC before setting CCM | ||
166 | * Low-Power mode. | ||
167 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode | ||
168 | * is set (set bits 0-1 of CCM_CLPCR). | ||
169 | */ | ||
170 | iomuxc_irq_desc = irq_to_desc(32); | ||
171 | imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data); | ||
172 | writel_relaxed(val, ccm_base + CLPCR); | ||
173 | imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data); | ||
174 | |||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | static int imx6q_suspend_finish(unsigned long val) | ||
179 | { | ||
180 | cpu_do_idle(); | ||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | static int imx6q_pm_enter(suspend_state_t state) | ||
185 | { | ||
186 | switch (state) { | ||
187 | case PM_SUSPEND_MEM: | ||
188 | imx6q_set_lpm(STOP_POWER_OFF); | ||
189 | imx6q_enable_wb(true); | ||
190 | imx6q_enable_rbc(true); | ||
191 | imx_gpc_pre_suspend(); | ||
192 | imx_anatop_pre_suspend(); | ||
193 | imx_set_cpu_jump(0, v7_cpu_resume); | ||
194 | /* Zzz ... */ | ||
195 | cpu_suspend(0, imx6q_suspend_finish); | ||
196 | if (cpu_is_imx6q() || cpu_is_imx6dl()) | ||
197 | imx_smp_prepare(); | ||
198 | imx_anatop_post_resume(); | ||
199 | imx_gpc_post_resume(); | ||
200 | imx6q_enable_rbc(false); | ||
201 | imx6q_enable_wb(false); | ||
202 | imx6q_set_lpm(WAIT_CLOCKED); | ||
203 | break; | ||
204 | default: | ||
205 | return -EINVAL; | ||
206 | } | ||
207 | |||
208 | return 0; | ||
209 | } | ||
210 | |||
211 | static const struct platform_suspend_ops imx6q_pm_ops = { | ||
212 | .enter = imx6q_pm_enter, | ||
213 | .valid = suspend_valid_only_mem, | ||
214 | }; | ||
215 | |||
216 | void __init imx6q_pm_set_ccm_base(void __iomem *base) | ||
217 | { | ||
218 | ccm_base = base; | ||
219 | } | ||
220 | |||
221 | void __init imx6q_pm_init(void) | ||
222 | { | ||
223 | struct regmap *gpr; | ||
224 | |||
225 | WARN_ON(!ccm_base); | ||
226 | |||
227 | /* | ||
228 | * This is for SW workaround step #1 of ERR007265, see comments | ||
229 | * in imx6q_set_lpm for details of this errata. | ||
230 | * Force IOMUXC irq pending, so that the interrupt to GPC can be | ||
231 | * used to deassert dsm_request signal when the signal gets | ||
232 | * asserted unexpectedly. | ||
233 | */ | ||
234 | gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr"); | ||
235 | if (!IS_ERR(gpr)) | ||
236 | regmap_update_bits(gpr, IOMUXC_GPR1, IMX6Q_GPR1_GINT, | ||
237 | IMX6Q_GPR1_GINT); | ||
238 | |||
239 | /* Set initial power mode */ | ||
240 | imx6q_set_lpm(WAIT_CLOCKED); | ||
241 | |||
242 | suspend_set_ops(&imx6q_pm_ops); | ||
243 | } | ||
diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S new file mode 100644 index 000000000000..20048ff05739 --- /dev/null +++ b/arch/arm/mach-imx/suspend-imx6.S | |||
@@ -0,0 +1,361 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Freescale Semiconductor, Inc. | ||
3 | * | ||
4 | * The code contained herein is licensed under the GNU General Public | ||
5 | * License. You may obtain a copy of the GNU General Public License | ||
6 | * Version 2 or later at the following locations: | ||
7 | * | ||
8 | * http://www.opensource.org/licenses/gpl-license.html | ||
9 | * http://www.gnu.org/copyleft/gpl.html | ||
10 | */ | ||
11 | |||
12 | #include <linux/linkage.h> | ||
13 | #include <asm/asm-offsets.h> | ||
14 | #include <asm/hardware/cache-l2x0.h> | ||
15 | #include "hardware.h" | ||
16 | |||
17 | /* | ||
18 | * ==================== low level suspend ==================== | ||
19 | * | ||
20 | * Better to follow below rules to use ARM registers: | ||
21 | * r0: pm_info structure address; | ||
22 | * r1 ~ r4: for saving pm_info members; | ||
23 | * r5 ~ r10: free registers; | ||
24 | * r11: io base address. | ||
25 | * | ||
26 | * suspend ocram space layout: | ||
27 | * ======================== high address ====================== | ||
28 | * . | ||
29 | * . | ||
30 | * . | ||
31 | * ^ | ||
32 | * ^ | ||
33 | * ^ | ||
34 | * imx6_suspend code | ||
35 | * PM_INFO structure(imx6_cpu_pm_info) | ||
36 | * ======================== low address ======================= | ||
37 | */ | ||
38 | |||
39 | /* | ||
40 | * Below offsets are based on struct imx6_cpu_pm_info | ||
41 | * which defined in arch/arm/mach-imx/pm-imx6q.c, this | ||
42 | * structure contains necessary pm info for low level | ||
43 | * suspend related code. | ||
44 | */ | ||
45 | #define PM_INFO_PBASE_OFFSET 0x0 | ||
46 | #define PM_INFO_RESUME_ADDR_OFFSET 0x4 | ||
47 | #define PM_INFO_CPU_TYPE_OFFSET 0x8 | ||
48 | #define PM_INFO_PM_INFO_SIZE_OFFSET 0xC | ||
49 | #define PM_INFO_MX6Q_MMDC_P_OFFSET 0x10 | ||
50 | #define PM_INFO_MX6Q_MMDC_V_OFFSET 0x14 | ||
51 | #define PM_INFO_MX6Q_SRC_P_OFFSET 0x18 | ||
52 | #define PM_INFO_MX6Q_SRC_V_OFFSET 0x1C | ||
53 | #define PM_INFO_MX6Q_IOMUXC_P_OFFSET 0x20 | ||
54 | #define PM_INFO_MX6Q_IOMUXC_V_OFFSET 0x24 | ||
55 | #define PM_INFO_MX6Q_CCM_P_OFFSET 0x28 | ||
56 | #define PM_INFO_MX6Q_CCM_V_OFFSET 0x2C | ||
57 | #define PM_INFO_MX6Q_GPC_P_OFFSET 0x30 | ||
58 | #define PM_INFO_MX6Q_GPC_V_OFFSET 0x34 | ||
59 | #define PM_INFO_MX6Q_L2_P_OFFSET 0x38 | ||
60 | #define PM_INFO_MX6Q_L2_V_OFFSET 0x3C | ||
61 | #define PM_INFO_MMDC_IO_NUM_OFFSET 0x40 | ||
62 | #define PM_INFO_MMDC_IO_VAL_OFFSET 0x44 | ||
63 | |||
64 | #define MX6Q_SRC_GPR1 0x20 | ||
65 | #define MX6Q_SRC_GPR2 0x24 | ||
66 | #define MX6Q_MMDC_MAPSR 0x404 | ||
67 | #define MX6Q_MMDC_MPDGCTRL0 0x83c | ||
68 | #define MX6Q_GPC_IMR1 0x08 | ||
69 | #define MX6Q_GPC_IMR2 0x0c | ||
70 | #define MX6Q_GPC_IMR3 0x10 | ||
71 | #define MX6Q_GPC_IMR4 0x14 | ||
72 | #define MX6Q_CCM_CCR 0x0 | ||
73 | |||
74 | .align 3 | ||
75 | |||
76 | .macro sync_l2_cache | ||
77 | |||
78 | /* sync L2 cache to drain L2's buffers to DRAM. */ | ||
79 | #ifdef CONFIG_CACHE_L2X0 | ||
80 | ldr r11, [r0, #PM_INFO_MX6Q_L2_V_OFFSET] | ||
81 | mov r6, #0x0 | ||
82 | str r6, [r11, #L2X0_CACHE_SYNC] | ||
83 | 1: | ||
84 | ldr r6, [r11, #L2X0_CACHE_SYNC] | ||
85 | ands r6, r6, #0x1 | ||
86 | bne 1b | ||
87 | #endif | ||
88 | |||
89 | .endm | ||
90 | |||
91 | .macro resume_mmdc | ||
92 | |||
93 | /* restore MMDC IO */ | ||
94 | cmp r5, #0x0 | ||
95 | ldreq r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET] | ||
96 | ldrne r11, [r0, #PM_INFO_MX6Q_IOMUXC_P_OFFSET] | ||
97 | |||
98 | ldr r6, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET] | ||
99 | ldr r7, =PM_INFO_MMDC_IO_VAL_OFFSET | ||
100 | add r7, r7, r0 | ||
101 | 1: | ||
102 | ldr r8, [r7], #0x4 | ||
103 | ldr r9, [r7], #0x4 | ||
104 | str r9, [r11, r8] | ||
105 | subs r6, r6, #0x1 | ||
106 | bne 1b | ||
107 | |||
108 | cmp r5, #0x0 | ||
109 | ldreq r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET] | ||
110 | ldrne r11, [r0, #PM_INFO_MX6Q_MMDC_P_OFFSET] | ||
111 | |||
112 | cmp r3, #MXC_CPU_IMX6SL | ||
113 | bne 4f | ||
114 | |||
115 | /* reset read FIFO, RST_RD_FIFO */ | ||
116 | ldr r7, =MX6Q_MMDC_MPDGCTRL0 | ||
117 | ldr r6, [r11, r7] | ||
118 | orr r6, r6, #(1 << 31) | ||
119 | str r6, [r11, r7] | ||
120 | 2: | ||
121 | ldr r6, [r11, r7] | ||
122 | ands r6, r6, #(1 << 31) | ||
123 | bne 2b | ||
124 | |||
125 | /* reset FIFO a second time */ | ||
126 | ldr r6, [r11, r7] | ||
127 | orr r6, r6, #(1 << 31) | ||
128 | str r6, [r11, r7] | ||
129 | 3: | ||
130 | ldr r6, [r11, r7] | ||
131 | ands r6, r6, #(1 << 31) | ||
132 | bne 3b | ||
133 | 4: | ||
134 | /* let DDR out of self-refresh */ | ||
135 | ldr r7, [r11, #MX6Q_MMDC_MAPSR] | ||
136 | bic r7, r7, #(1 << 21) | ||
137 | str r7, [r11, #MX6Q_MMDC_MAPSR] | ||
138 | 5: | ||
139 | ldr r7, [r11, #MX6Q_MMDC_MAPSR] | ||
140 | ands r7, r7, #(1 << 25) | ||
141 | bne 5b | ||
142 | |||
143 | /* enable DDR auto power saving */ | ||
144 | ldr r7, [r11, #MX6Q_MMDC_MAPSR] | ||
145 | bic r7, r7, #0x1 | ||
146 | str r7, [r11, #MX6Q_MMDC_MAPSR] | ||
147 | |||
148 | .endm | ||
149 | |||
150 | ENTRY(imx6_suspend) | ||
151 | ldr r1, [r0, #PM_INFO_PBASE_OFFSET] | ||
152 | ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET] | ||
153 | ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET] | ||
154 | ldr r4, [r0, #PM_INFO_PM_INFO_SIZE_OFFSET] | ||
155 | |||
156 | /* | ||
157 | * counting the resume address in iram | ||
158 | * to set it in SRC register. | ||
159 | */ | ||
160 | ldr r6, =imx6_suspend | ||
161 | ldr r7, =resume | ||
162 | sub r7, r7, r6 | ||
163 | add r8, r1, r4 | ||
164 | add r9, r8, r7 | ||
165 | |||
166 | /* | ||
167 | * make sure TLB contain the addr we want, | ||
168 | * as we will access them after MMDC IO floated. | ||
169 | */ | ||
170 | |||
171 | ldr r11, [r0, #PM_INFO_MX6Q_CCM_V_OFFSET] | ||
172 | ldr r6, [r11, #0x0] | ||
173 | ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET] | ||
174 | ldr r6, [r11, #0x0] | ||
175 | |||
176 | /* use r11 to store the IO address */ | ||
177 | ldr r11, [r0, #PM_INFO_MX6Q_SRC_V_OFFSET] | ||
178 | /* store physical resume addr and pm_info address. */ | ||
179 | str r9, [r11, #MX6Q_SRC_GPR1] | ||
180 | str r1, [r11, #MX6Q_SRC_GPR2] | ||
181 | |||
182 | /* need to sync L2 cache before DSM. */ | ||
183 | sync_l2_cache | ||
184 | |||
185 | ldr r11, [r0, #PM_INFO_MX6Q_MMDC_V_OFFSET] | ||
186 | /* | ||
187 | * put DDR explicitly into self-refresh and | ||
188 | * disable automatic power savings. | ||
189 | */ | ||
190 | ldr r7, [r11, #MX6Q_MMDC_MAPSR] | ||
191 | orr r7, r7, #0x1 | ||
192 | str r7, [r11, #MX6Q_MMDC_MAPSR] | ||
193 | |||
194 | /* make the DDR explicitly enter self-refresh. */ | ||
195 | ldr r7, [r11, #MX6Q_MMDC_MAPSR] | ||
196 | orr r7, r7, #(1 << 21) | ||
197 | str r7, [r11, #MX6Q_MMDC_MAPSR] | ||
198 | |||
199 | poll_dvfs_set: | ||
200 | ldr r7, [r11, #MX6Q_MMDC_MAPSR] | ||
201 | ands r7, r7, #(1 << 25) | ||
202 | beq poll_dvfs_set | ||
203 | |||
204 | ldr r11, [r0, #PM_INFO_MX6Q_IOMUXC_V_OFFSET] | ||
205 | ldr r6, =0x0 | ||
206 | ldr r7, [r0, #PM_INFO_MMDC_IO_NUM_OFFSET] | ||
207 | ldr r8, =PM_INFO_MMDC_IO_VAL_OFFSET | ||
208 | add r8, r8, r0 | ||
209 | /* i.MX6SL's last 3 IOs need special setting */ | ||
210 | cmp r3, #MXC_CPU_IMX6SL | ||
211 | subeq r7, r7, #0x3 | ||
212 | set_mmdc_io_lpm: | ||
213 | ldr r9, [r8], #0x8 | ||
214 | str r6, [r11, r9] | ||
215 | subs r7, r7, #0x1 | ||
216 | bne set_mmdc_io_lpm | ||
217 | |||
218 | cmp r3, #MXC_CPU_IMX6SL | ||
219 | bne set_mmdc_io_lpm_done | ||
220 | ldr r6, =0x1000 | ||
221 | ldr r9, [r8], #0x8 | ||
222 | str r6, [r11, r9] | ||
223 | ldr r9, [r8], #0x8 | ||
224 | str r6, [r11, r9] | ||
225 | ldr r6, =0x80000 | ||
226 | ldr r9, [r8] | ||
227 | str r6, [r11, r9] | ||
228 | set_mmdc_io_lpm_done: | ||
229 | |||
230 | /* | ||
231 | * mask all GPC interrupts before | ||
232 | * enabling the RBC counters to | ||
233 | * avoid the counter starting too | ||
234 | * early if an interupt is already | ||
235 | * pending. | ||
236 | */ | ||
237 | ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET] | ||
238 | ldr r6, [r11, #MX6Q_GPC_IMR1] | ||
239 | ldr r7, [r11, #MX6Q_GPC_IMR2] | ||
240 | ldr r8, [r11, #MX6Q_GPC_IMR3] | ||
241 | ldr r9, [r11, #MX6Q_GPC_IMR4] | ||
242 | |||
243 | ldr r10, =0xffffffff | ||
244 | str r10, [r11, #MX6Q_GPC_IMR1] | ||
245 | str r10, [r11, #MX6Q_GPC_IMR2] | ||
246 | str r10, [r11, #MX6Q_GPC_IMR3] | ||
247 | str r10, [r11, #MX6Q_GPC_IMR4] | ||
248 | |||
249 | /* | ||
250 | * enable the RBC bypass counter here | ||
251 | * to hold off the interrupts. RBC counter | ||
252 | * = 32 (1ms), Minimum RBC delay should be | ||
253 | * 400us for the analog LDOs to power down. | ||
254 | */ | ||
255 | ldr r11, [r0, #PM_INFO_MX6Q_CCM_V_OFFSET] | ||
256 | ldr r10, [r11, #MX6Q_CCM_CCR] | ||
257 | bic r10, r10, #(0x3f << 21) | ||
258 | orr r10, r10, #(0x20 << 21) | ||
259 | str r10, [r11, #MX6Q_CCM_CCR] | ||
260 | |||
261 | /* enable the counter. */ | ||
262 | ldr r10, [r11, #MX6Q_CCM_CCR] | ||
263 | orr r10, r10, #(0x1 << 27) | ||
264 | str r10, [r11, #MX6Q_CCM_CCR] | ||
265 | |||
266 | /* unmask all the GPC interrupts. */ | ||
267 | ldr r11, [r0, #PM_INFO_MX6Q_GPC_V_OFFSET] | ||
268 | str r6, [r11, #MX6Q_GPC_IMR1] | ||
269 | str r7, [r11, #MX6Q_GPC_IMR2] | ||
270 | str r8, [r11, #MX6Q_GPC_IMR3] | ||
271 | str r9, [r11, #MX6Q_GPC_IMR4] | ||
272 | |||
273 | /* | ||
274 | * now delay for a short while (3usec) | ||
275 | * ARM is at 1GHz at this point | ||
276 | * so a short loop should be enough. | ||
277 | * this delay is required to ensure that | ||
278 | * the RBC counter can start counting in | ||
279 | * case an interrupt is already pending | ||
280 | * or in case an interrupt arrives just | ||
281 | * as ARM is about to assert DSM_request. | ||
282 | */ | ||
283 | ldr r6, =2000 | ||
284 | rbc_loop: | ||
285 | subs r6, r6, #0x1 | ||
286 | bne rbc_loop | ||
287 | |||
288 | /* Zzz, enter stop mode */ | ||
289 | wfi | ||
290 | nop | ||
291 | nop | ||
292 | nop | ||
293 | nop | ||
294 | |||
295 | /* | ||
296 | * run to here means there is pending | ||
297 | * wakeup source, system should auto | ||
298 | * resume, we need to restore MMDC IO first | ||
299 | */ | ||
300 | mov r5, #0x0 | ||
301 | resume_mmdc | ||
302 | |||
303 | /* return to suspend finish */ | ||
304 | mov pc, lr | ||
305 | |||
306 | resume: | ||
307 | /* invalidate L1 I-cache first */ | ||
308 | mov r6, #0x0 | ||
309 | mcr p15, 0, r6, c7, c5, 0 | ||
310 | mcr p15, 0, r6, c7, c5, 6 | ||
311 | /* enable the Icache and branch prediction */ | ||
312 | mov r6, #0x1800 | ||
313 | mcr p15, 0, r6, c1, c0, 0 | ||
314 | isb | ||
315 | |||
316 | /* get physical resume address from pm_info. */ | ||
317 | ldr lr, [r0, #PM_INFO_RESUME_ADDR_OFFSET] | ||
318 | /* clear core0's entry and parameter */ | ||
319 | ldr r11, [r0, #PM_INFO_MX6Q_SRC_P_OFFSET] | ||
320 | mov r7, #0x0 | ||
321 | str r7, [r11, #MX6Q_SRC_GPR1] | ||
322 | str r7, [r11, #MX6Q_SRC_GPR2] | ||
323 | |||
324 | ldr r3, [r0, #PM_INFO_CPU_TYPE_OFFSET] | ||
325 | mov r5, #0x1 | ||
326 | resume_mmdc | ||
327 | |||
328 | mov pc, lr | ||
329 | ENDPROC(imx6_suspend) | ||
330 | |||
331 | /* | ||
332 | * The following code must assume it is running from physical address | ||
333 | * where absolute virtual addresses to the data section have to be | ||
334 | * turned into relative ones. | ||
335 | */ | ||
336 | |||
337 | #ifdef CONFIG_CACHE_L2X0 | ||
338 | .macro pl310_resume | ||
339 | adr r0, l2x0_saved_regs_offset | ||
340 | ldr r2, [r0] | ||
341 | add r2, r2, r0 | ||
342 | ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0 | ||
343 | ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value | ||
344 | str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl | ||
345 | mov r1, #0x1 | ||
346 | str r1, [r0, #L2X0_CTRL] @ re-enable L2 | ||
347 | .endm | ||
348 | |||
349 | l2x0_saved_regs_offset: | ||
350 | .word l2x0_saved_regs - . | ||
351 | |||
352 | #else | ||
353 | .macro pl310_resume | ||
354 | .endm | ||
355 | #endif | ||
356 | |||
357 | ENTRY(v7_cpu_resume) | ||
358 | bl v7_invalidate_l1 | ||
359 | pl310_resume | ||
360 | b cpu_resume | ||
361 | ENDPROC(v7_cpu_resume) | ||
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c index 1a3a5f615770..65222ea0df6d 100644 --- a/arch/arm/mach-imx/time.c +++ b/arch/arm/mach-imx/time.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/irq.h> | 25 | #include <linux/irq.h> |
26 | #include <linux/clockchips.h> | 26 | #include <linux/clockchips.h> |
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/delay.h> | ||
28 | #include <linux/err.h> | 29 | #include <linux/err.h> |
29 | #include <linux/sched_clock.h> | 30 | #include <linux/sched_clock.h> |
30 | 31 | ||
@@ -116,11 +117,22 @@ static u64 notrace mxc_read_sched_clock(void) | |||
116 | return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0; | 117 | return sched_clock_reg ? __raw_readl(sched_clock_reg) : 0; |
117 | } | 118 | } |
118 | 119 | ||
120 | static struct delay_timer imx_delay_timer; | ||
121 | |||
122 | static unsigned long imx_read_current_timer(void) | ||
123 | { | ||
124 | return __raw_readl(sched_clock_reg); | ||
125 | } | ||
126 | |||
119 | static int __init mxc_clocksource_init(struct clk *timer_clk) | 127 | static int __init mxc_clocksource_init(struct clk *timer_clk) |
120 | { | 128 | { |
121 | unsigned int c = clk_get_rate(timer_clk); | 129 | unsigned int c = clk_get_rate(timer_clk); |
122 | void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN); | 130 | void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN); |
123 | 131 | ||
132 | imx_delay_timer.read_current_timer = &imx_read_current_timer; | ||
133 | imx_delay_timer.freq = c; | ||
134 | register_current_timer_delay(&imx_delay_timer); | ||
135 | |||
124 | sched_clock_reg = reg; | 136 | sched_clock_reg = reg; |
125 | 137 | ||
126 | sched_clock_register(mxc_read_sched_clock, 32, c); | 138 | sched_clock_register(mxc_read_sched_clock, 32, c); |
diff --git a/arch/arm/mach-keystone/Kconfig b/arch/arm/mach-keystone/Kconfig index 90a708fef541..f50bc936cb84 100644 --- a/arch/arm/mach-keystone/Kconfig +++ b/arch/arm/mach-keystone/Kconfig | |||
@@ -1,13 +1,9 @@ | |||
1 | config ARCH_KEYSTONE | 1 | config ARCH_KEYSTONE |
2 | bool "Texas Instruments Keystone Devices" | 2 | bool "Texas Instruments Keystone Devices" |
3 | depends on ARCH_MULTI_V7 | 3 | depends on ARCH_MULTI_V7 |
4 | select CPU_V7 | ||
5 | select ARM_GIC | 4 | select ARM_GIC |
6 | select HAVE_ARM_ARCH_TIMER | 5 | select HAVE_ARM_ARCH_TIMER |
7 | select HAVE_SMP | ||
8 | select CLKSRC_MMIO | 6 | select CLKSRC_MMIO |
9 | select GENERIC_CLOCKEVENTS | ||
10 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
11 | select ARM_ERRATA_798181 if SMP | 7 | select ARM_ERRATA_798181 if SMP |
12 | select COMMON_CLK_KEYSTONE | 8 | select COMMON_CLK_KEYSTONE |
13 | select ARCH_SUPPORTS_BIG_ENDIAN | 9 | select ARCH_SUPPORTS_BIG_ENDIAN |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index fe8319ad3158..df4b26340ae4 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -106,13 +106,6 @@ config ARCH_KIRKWOOD_DT | |||
106 | Say 'Y' here if you want your kernel to support the | 106 | Say 'Y' here if you want your kernel to support the |
107 | Marvell Kirkwood using flattened device tree. | 107 | Marvell Kirkwood using flattened device tree. |
108 | 108 | ||
109 | config MACH_MV88F6281GTW_GE_DT | ||
110 | bool "Marvell 88F6281 GTW GE Board (Flattened Device Tree)" | ||
111 | depends on ARCH_KIRKWOOD_DT | ||
112 | help | ||
113 | Say 'Y' here if you want your kernel to support the | ||
114 | Marvell 88F6281 GTW GE Board (Flattened Device Tree). | ||
115 | |||
116 | endmenu | 109 | endmenu |
117 | 110 | ||
118 | endif | 111 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 144b51102939..3a72c5c6e747 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -1,5 +1,4 @@ | |||
1 | obj-y += common.o pcie.o | 1 | obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o common.o pcie.o |
2 | obj-$(CONFIG_KIRKWOOD_LEGACY) += irq.o mpp.o | ||
3 | obj-$(CONFIG_PM) += pm.o | 2 | obj-$(CONFIG_PM) += pm.o |
4 | 3 | ||
5 | obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o | 4 | obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o |
@@ -13,4 +12,3 @@ obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o | |||
13 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o | 12 | obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o |
14 | 13 | ||
15 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o | 14 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o |
16 | obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o | ||
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 78188159484d..2801da49e2a3 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -19,11 +19,84 @@ | |||
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #include <linux/dma-mapping.h> | 20 | #include <linux/dma-mapping.h> |
21 | #include <linux/irqchip.h> | 21 | #include <linux/irqchip.h> |
22 | #include <linux/kexec.h> | 22 | #include <asm/hardware/cache-feroceon-l2.h> |
23 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
24 | #include <asm/mach/map.h> | ||
24 | #include <mach/bridge-regs.h> | 25 | #include <mach/bridge-regs.h> |
25 | #include <plat/common.h> | 26 | #include <plat/common.h> |
26 | #include "common.h" | 27 | #include <plat/pcie.h> |
28 | #include "pm.h" | ||
29 | |||
30 | static struct map_desc kirkwood_io_desc[] __initdata = { | ||
31 | { | ||
32 | .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE, | ||
33 | .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), | ||
34 | .length = KIRKWOOD_REGS_SIZE, | ||
35 | .type = MT_DEVICE, | ||
36 | }, | ||
37 | }; | ||
38 | |||
39 | static void __init kirkwood_map_io(void) | ||
40 | { | ||
41 | iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc)); | ||
42 | } | ||
43 | |||
44 | static struct resource kirkwood_cpufreq_resources[] = { | ||
45 | [0] = { | ||
46 | .start = CPU_CONTROL_PHYS, | ||
47 | .end = CPU_CONTROL_PHYS + 3, | ||
48 | .flags = IORESOURCE_MEM, | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | static struct platform_device kirkwood_cpufreq_device = { | ||
53 | .name = "kirkwood-cpufreq", | ||
54 | .id = -1, | ||
55 | .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), | ||
56 | .resource = kirkwood_cpufreq_resources, | ||
57 | }; | ||
58 | |||
59 | static void __init kirkwood_cpufreq_init(void) | ||
60 | { | ||
61 | platform_device_register(&kirkwood_cpufreq_device); | ||
62 | } | ||
63 | |||
64 | static struct resource kirkwood_cpuidle_resource[] = { | ||
65 | { | ||
66 | .flags = IORESOURCE_MEM, | ||
67 | .start = DDR_OPERATION_BASE, | ||
68 | .end = DDR_OPERATION_BASE + 3, | ||
69 | }, | ||
70 | }; | ||
71 | |||
72 | static struct platform_device kirkwood_cpuidle = { | ||
73 | .name = "kirkwood_cpuidle", | ||
74 | .id = -1, | ||
75 | .resource = kirkwood_cpuidle_resource, | ||
76 | .num_resources = 1, | ||
77 | }; | ||
78 | |||
79 | static void __init kirkwood_cpuidle_init(void) | ||
80 | { | ||
81 | platform_device_register(&kirkwood_cpuidle); | ||
82 | } | ||
83 | |||
84 | /* Temporary here since mach-mvebu has a function we can use */ | ||
85 | static void kirkwood_restart(enum reboot_mode mode, const char *cmd) | ||
86 | { | ||
87 | /* | ||
88 | * Enable soft reset to assert RSTOUTn. | ||
89 | */ | ||
90 | writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK); | ||
91 | |||
92 | /* | ||
93 | * Assert soft reset. | ||
94 | */ | ||
95 | writel(SOFT_RESET, SYSTEM_SOFT_RESET); | ||
96 | |||
97 | while (1) | ||
98 | ; | ||
99 | } | ||
27 | 100 | ||
28 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 | 101 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 |
29 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 | 102 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 |
@@ -104,35 +177,35 @@ eth_fixup_skip: | |||
104 | } | 177 | } |
105 | } | 178 | } |
106 | 179 | ||
107 | static void __init kirkwood_dt_init(void) | 180 | /* |
181 | * Disable propagation of mbus errors to the CPU local bus, as this | ||
182 | * causes mbus errors (which can occur for example for PCI aborts) to | ||
183 | * throw CPU aborts, which we're not set up to deal with. | ||
184 | */ | ||
185 | static void __init kirkwood_disable_mbus_error_propagation(void) | ||
108 | { | 186 | { |
109 | pr_info("Kirkwood: %s.\n", kirkwood_id()); | 187 | void __iomem *cpu_config; |
110 | 188 | ||
111 | /* | 189 | cpu_config = ioremap(CPU_CONFIG_PHYS, 4); |
112 | * Disable propagation of mbus errors to the CPU local bus, | 190 | writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); |
113 | * as this causes mbus errors (which can occur for example | 191 | iounmap(cpu_config); |
114 | * for PCI aborts) to throw CPU aborts, which we're not set | 192 | } |
115 | * up to deal with. | ||
116 | */ | ||
117 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); | ||
118 | 193 | ||
119 | BUG_ON(mvebu_mbus_dt_init()); | 194 | static void __init kirkwood_dt_init(void) |
195 | { | ||
196 | kirkwood_disable_mbus_error_propagation(); | ||
120 | 197 | ||
121 | kirkwood_l2_init(); | 198 | BUG_ON(mvebu_mbus_dt_init()); |
122 | 199 | ||
200 | #ifdef CONFIG_CACHE_FEROCEON_L2 | ||
201 | feroceon_of_init(); | ||
202 | #endif | ||
123 | kirkwood_cpufreq_init(); | 203 | kirkwood_cpufreq_init(); |
124 | kirkwood_cpuidle_init(); | 204 | kirkwood_cpuidle_init(); |
125 | 205 | ||
126 | kirkwood_pm_init(); | 206 | kirkwood_pm_init(); |
127 | kirkwood_dt_eth_fixup(); | 207 | kirkwood_dt_eth_fixup(); |
128 | 208 | ||
129 | #ifdef CONFIG_KEXEC | ||
130 | kexec_reinit = kirkwood_enable_pcie; | ||
131 | #endif | ||
132 | |||
133 | if (of_machine_is_compatible("marvell,mv88f6281gtw-ge")) | ||
134 | mv88f6281gtw_ge_init(); | ||
135 | |||
136 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 209 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
137 | } | 210 | } |
138 | 211 | ||
diff --git a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c b/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c deleted file mode 100644 index ee5eea678c11..000000000000 --- a/arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/board-mv88f6281gtw_ge.c | ||
3 | * | ||
4 | * Marvell 88F6281 GTW GE Board Setup | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | #include <linux/irq.h> | ||
15 | #include <linux/timer.h> | ||
16 | #include <linux/mv643xx_eth.h> | ||
17 | #include <linux/ethtool.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <net/dsa.h> | ||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <asm/mach/pci.h> | ||
23 | #include <mach/kirkwood.h> | ||
24 | #include "common.h" | ||
25 | |||
26 | static struct mv643xx_eth_platform_data mv88f6281gtw_ge_ge00_data = { | ||
27 | .phy_addr = MV643XX_ETH_PHY_NONE, | ||
28 | .speed = SPEED_1000, | ||
29 | .duplex = DUPLEX_FULL, | ||
30 | }; | ||
31 | |||
32 | static struct dsa_chip_data mv88f6281gtw_ge_switch_chip_data = { | ||
33 | .port_names[0] = "lan1", | ||
34 | .port_names[1] = "lan2", | ||
35 | .port_names[2] = "lan3", | ||
36 | .port_names[3] = "lan4", | ||
37 | .port_names[4] = "wan", | ||
38 | .port_names[5] = "cpu", | ||
39 | }; | ||
40 | |||
41 | static struct dsa_platform_data mv88f6281gtw_ge_switch_plat_data = { | ||
42 | .nr_chips = 1, | ||
43 | .chip = &mv88f6281gtw_ge_switch_chip_data, | ||
44 | }; | ||
45 | |||
46 | void __init mv88f6281gtw_ge_init(void) | ||
47 | { | ||
48 | kirkwood_ge00_init(&mv88f6281gtw_ge_ge00_data); | ||
49 | kirkwood_ge00_switch_init(&mv88f6281gtw_ge_switch_plat_data, NO_IRQ); | ||
50 | } | ||
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index f3407a5db216..255f33a3903c 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -25,10 +25,10 @@ | |||
25 | #include <asm/page.h> | 25 | #include <asm/page.h> |
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | #include <asm/mach/time.h> | 27 | #include <asm/mach/time.h> |
28 | #include <asm/hardware/cache-feroceon-l2.h> | ||
28 | #include <mach/kirkwood.h> | 29 | #include <mach/kirkwood.h> |
29 | #include <mach/bridge-regs.h> | 30 | #include <mach/bridge-regs.h> |
30 | #include <linux/platform_data/asoc-kirkwood.h> | 31 | #include <linux/platform_data/asoc-kirkwood.h> |
31 | #include <plat/cache-feroceon-l2.h> | ||
32 | #include <linux/platform_data/mmc-mvsdio.h> | 32 | #include <linux/platform_data/mmc-mvsdio.h> |
33 | #include <linux/platform_data/mtd-orion_nand.h> | 33 | #include <linux/platform_data/mtd-orion_nand.h> |
34 | #include <linux/platform_data/usb-ehci-orion.h> | 34 | #include <linux/platform_data/usb-ehci-orion.h> |
@@ -36,6 +36,7 @@ | |||
36 | #include <plat/time.h> | 36 | #include <plat/time.h> |
37 | #include <linux/platform_data/dma-mv_xor.h> | 37 | #include <linux/platform_data/dma-mv_xor.h> |
38 | #include "common.h" | 38 | #include "common.h" |
39 | #include "pm.h" | ||
39 | 40 | ||
40 | /* These can go away once Kirkwood uses the mvebu-mbus DT binding */ | 41 | /* These can go away once Kirkwood uses the mvebu-mbus DT binding */ |
41 | #define KIRKWOOD_MBUS_NAND_TARGET 0x01 | 42 | #define KIRKWOOD_MBUS_NAND_TARGET 0x01 |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 05fd648df543..832a4e2ab8d7 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -58,19 +58,6 @@ void kirkwood_cpufreq_init(void); | |||
58 | void kirkwood_restart(enum reboot_mode, const char *); | 58 | void kirkwood_restart(enum reboot_mode, const char *); |
59 | void kirkwood_clk_init(void); | 59 | void kirkwood_clk_init(void); |
60 | 60 | ||
61 | #ifdef CONFIG_PM | ||
62 | void kirkwood_pm_init(void); | ||
63 | #else | ||
64 | static inline void kirkwood_pm_init(void) {}; | ||
65 | #endif | ||
66 | |||
67 | /* board init functions for boards not fully converted to fdt */ | ||
68 | #ifdef CONFIG_MACH_MV88F6281GTW_GE_DT | ||
69 | void mv88f6281gtw_ge_init(void); | ||
70 | #else | ||
71 | static inline void mv88f6281gtw_ge_init(void) {}; | ||
72 | #endif | ||
73 | |||
74 | /* early init functions not converted to fdt yet */ | 61 | /* early init functions not converted to fdt yet */ |
75 | char *kirkwood_id(void); | 62 | char *kirkwood_id(void); |
76 | void kirkwood_l2_init(void); | 63 | void kirkwood_l2_init(void); |
diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h index 8b9d1c9ff199..6e5077e2ec26 100644 --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <mach/kirkwood.h> | 14 | #include <mach/kirkwood.h> |
15 | 15 | ||
16 | #define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) | 16 | #define CPU_CONFIG (BRIDGE_VIRT_BASE + 0x0100) |
17 | #define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100) | ||
17 | #define CPU_CONFIG_ERROR_PROP 0x00000004 | 18 | #define CPU_CONFIG_ERROR_PROP 0x00000004 |
18 | 19 | ||
19 | #define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) | 20 | #define CPU_CONTROL (BRIDGE_VIRT_BASE + 0x0104) |
@@ -79,5 +80,6 @@ | |||
79 | #define CGC_RESERVED (0x6 << 21) | 80 | #define CGC_RESERVED (0x6 << 21) |
80 | 81 | ||
81 | #define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) | 82 | #define MEMORY_PM_CTRL (BRIDGE_VIRT_BASE + 0x118) |
83 | #define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x118) | ||
82 | 84 | ||
83 | #endif | 85 | #endif |
diff --git a/arch/arm/mach-kirkwood/pm.c b/arch/arm/mach-kirkwood/pm.c index c6ab8d9303a5..8e5e0329d04c 100644 --- a/arch/arm/mach-kirkwood/pm.c +++ b/arch/arm/mach-kirkwood/pm.c | |||
@@ -21,15 +21,16 @@ | |||
21 | #include "common.h" | 21 | #include "common.h" |
22 | 22 | ||
23 | static void __iomem *ddr_operation_base; | 23 | static void __iomem *ddr_operation_base; |
24 | static void __iomem *memory_pm_ctrl; | ||
24 | 25 | ||
25 | static void kirkwood_low_power(void) | 26 | static void kirkwood_low_power(void) |
26 | { | 27 | { |
27 | u32 mem_pm_ctrl; | 28 | u32 mem_pm_ctrl; |
28 | 29 | ||
29 | mem_pm_ctrl = readl(MEMORY_PM_CTRL); | 30 | mem_pm_ctrl = readl(memory_pm_ctrl); |
30 | 31 | ||
31 | /* Set peripherals to low-power mode */ | 32 | /* Set peripherals to low-power mode */ |
32 | writel_relaxed(~0, MEMORY_PM_CTRL); | 33 | writel_relaxed(~0, memory_pm_ctrl); |
33 | 34 | ||
34 | /* Set DDR in self-refresh */ | 35 | /* Set DDR in self-refresh */ |
35 | writel_relaxed(0x7, ddr_operation_base); | 36 | writel_relaxed(0x7, ddr_operation_base); |
@@ -41,7 +42,7 @@ static void kirkwood_low_power(void) | |||
41 | */ | 42 | */ |
42 | cpu_do_idle(); | 43 | cpu_do_idle(); |
43 | 44 | ||
44 | writel_relaxed(mem_pm_ctrl, MEMORY_PM_CTRL); | 45 | writel_relaxed(mem_pm_ctrl, memory_pm_ctrl); |
45 | } | 46 | } |
46 | 47 | ||
47 | static int kirkwood_suspend_enter(suspend_state_t state) | 48 | static int kirkwood_suspend_enter(suspend_state_t state) |
@@ -69,5 +70,7 @@ static const struct platform_suspend_ops kirkwood_suspend_ops = { | |||
69 | void __init kirkwood_pm_init(void) | 70 | void __init kirkwood_pm_init(void) |
70 | { | 71 | { |
71 | ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); | 72 | ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); |
73 | memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4); | ||
74 | |||
72 | suspend_set_ops(&kirkwood_suspend_ops); | 75 | suspend_set_ops(&kirkwood_suspend_ops); |
73 | } | 76 | } |
diff --git a/arch/arm/mach-kirkwood/pm.h b/arch/arm/mach-kirkwood/pm.h new file mode 100644 index 000000000000..21e7530f368b --- /dev/null +++ b/arch/arm/mach-kirkwood/pm.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Power Management driver for Marvell Kirkwood SoCs | ||
3 | * | ||
4 | * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> | ||
5 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, | ||
9 | * version 2 of the License. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __ARCH_KIRKWOOD_PM_H | ||
18 | #define __ARCH_KIRKWOOD_PM_H | ||
19 | |||
20 | #ifdef CONFIG_PM | ||
21 | void kirkwood_pm_init(void); | ||
22 | #else | ||
23 | static inline void kirkwood_pm_init(void) {}; | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig index ba470d64493b..95a6a4b43c37 100644 --- a/arch/arm/mach-moxart/Kconfig +++ b/arch/arm/mach-moxart/Kconfig | |||
@@ -2,15 +2,9 @@ config ARCH_MOXART | |||
2 | bool "MOXA ART SoC" if ARCH_MULTI_V4T | 2 | bool "MOXA ART SoC" if ARCH_MULTI_V4T |
3 | select CPU_FA526 | 3 | select CPU_FA526 |
4 | select ARM_DMA_MEM_BUFFERABLE | 4 | select ARM_DMA_MEM_BUFFERABLE |
5 | select DMA_OF | ||
6 | select USE_OF | ||
7 | select CLKSRC_OF | ||
8 | select CLKSRC_MMIO | 5 | select CLKSRC_MMIO |
9 | select HAVE_CLK | ||
10 | select COMMON_CLK | ||
11 | select GENERIC_IRQ_CHIP | 6 | select GENERIC_IRQ_CHIP |
12 | select ARCH_REQUIRE_GPIOLIB | 7 | select ARCH_REQUIRE_GPIOLIB |
13 | select GENERIC_CLOCKEVENTS | ||
14 | select PHYLIB if NETDEVICES | 8 | select PHYLIB if NETDEVICES |
15 | help | 9 | help |
16 | Say Y here if you want to run your kernel on hardware with a | 10 | Say Y here if you want to run your kernel on hardware with a |
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index 9625cf378931..a7f959e58c3d 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig | |||
@@ -1,50 +1,9 @@ | |||
1 | config ARCH_MSM | ||
2 | bool | ||
3 | |||
4 | config ARCH_MSM_DT | ||
5 | bool "Qualcomm MSM DT Support" if ARCH_MULTI_V7 | ||
6 | select ARCH_MSM | ||
7 | select ARCH_REQUIRE_GPIOLIB | ||
8 | select CLKSRC_OF | ||
9 | select GENERIC_CLOCKEVENTS | ||
10 | help | ||
11 | Support for Qualcomm's devicetree based MSM systems. | ||
12 | |||
13 | if ARCH_MSM | 1 | if ARCH_MSM |
14 | 2 | ||
15 | menu "Qualcomm MSM SoC Selection" | ||
16 | depends on ARCH_MSM_DT | ||
17 | |||
18 | config ARCH_MSM8X60 | ||
19 | bool "Enable support for MSM8X60" | ||
20 | select ARM_GIC | ||
21 | select CPU_V7 | ||
22 | select HAVE_SMP | ||
23 | select MSM_SCM if SMP | ||
24 | select MSM_TIMER | ||
25 | |||
26 | config ARCH_MSM8960 | ||
27 | bool "Enable support for MSM8960" | ||
28 | select ARM_GIC | ||
29 | select CPU_V7 | ||
30 | select HAVE_SMP | ||
31 | select MSM_SCM if SMP | ||
32 | select MSM_TIMER | ||
33 | |||
34 | config ARCH_MSM8974 | ||
35 | bool "Enable support for MSM8974" | ||
36 | select ARM_GIC | ||
37 | select CPU_V7 | ||
38 | select HAVE_ARM_ARCH_TIMER | ||
39 | select HAVE_SMP | ||
40 | select MSM_SCM if SMP | ||
41 | |||
42 | endmenu | ||
43 | |||
44 | choice | 3 | choice |
45 | prompt "Qualcomm MSM SoC Type" | 4 | prompt "Qualcomm MSM SoC Type" |
46 | default ARCH_MSM7X00A | 5 | default ARCH_MSM7X00A |
47 | depends on ARCH_MSM_NODT | 6 | depends on ARCH_MSM |
48 | 7 | ||
49 | config ARCH_MSM7X00A | 8 | config ARCH_MSM7X00A |
50 | bool "MSM7x00A / MSM7x01A" | 9 | bool "MSM7x00A / MSM7x01A" |
@@ -54,7 +13,7 @@ config ARCH_MSM7X00A | |||
54 | select MACH_TROUT if !MACH_HALIBUT | 13 | select MACH_TROUT if !MACH_HALIBUT |
55 | select MSM_PROC_COMM | 14 | select MSM_PROC_COMM |
56 | select MSM_SMD | 15 | select MSM_SMD |
57 | select MSM_TIMER | 16 | select CLKSRC_QCOM |
58 | select MSM_SMD_PKG3 | 17 | select MSM_SMD_PKG3 |
59 | 18 | ||
60 | config ARCH_MSM7X30 | 19 | config ARCH_MSM7X30 |
@@ -66,7 +25,7 @@ config ARCH_MSM7X30 | |||
66 | select MSM_GPIOMUX | 25 | select MSM_GPIOMUX |
67 | select MSM_PROC_COMM | 26 | select MSM_PROC_COMM |
68 | select MSM_SMD | 27 | select MSM_SMD |
69 | select MSM_TIMER | 28 | select CLKSRC_QCOM |
70 | select MSM_VIC | 29 | select MSM_VIC |
71 | 30 | ||
72 | config ARCH_QSD8X50 | 31 | config ARCH_QSD8X50 |
@@ -78,7 +37,7 @@ config ARCH_QSD8X50 | |||
78 | select MSM_GPIOMUX | 37 | select MSM_GPIOMUX |
79 | select MSM_PROC_COMM | 38 | select MSM_PROC_COMM |
80 | select MSM_SMD | 39 | select MSM_SMD |
81 | select MSM_TIMER | 40 | select CLKSRC_QCOM |
82 | select MSM_VIC | 41 | select MSM_VIC |
83 | 42 | ||
84 | endchoice | 43 | endchoice |
@@ -99,7 +58,7 @@ config MSM_VIC | |||
99 | bool | 58 | bool |
100 | 59 | ||
101 | menu "Qualcomm MSM Board Type" | 60 | menu "Qualcomm MSM Board Type" |
102 | depends on ARCH_MSM_NODT | 61 | depends on ARCH_MSM |
103 | 62 | ||
104 | config MACH_HALIBUT | 63 | config MACH_HALIBUT |
105 | depends on ARCH_MSM | 64 | depends on ARCH_MSM |
@@ -153,7 +112,4 @@ config MSM_GPIOMUX | |||
153 | config MSM_SCM | 112 | config MSM_SCM |
154 | bool | 113 | bool |
155 | 114 | ||
156 | config MSM_TIMER | ||
157 | bool | ||
158 | |||
159 | endif | 115 | endif |
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index 8e307a10d3c3..27c078a568df 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | obj-$(CONFIG_MSM_TIMER) += timer.o | ||
2 | obj-$(CONFIG_MSM_PROC_COMM) += clock.o | 1 | obj-$(CONFIG_MSM_PROC_COMM) += clock.o |
3 | 2 | ||
4 | obj-$(CONFIG_MSM_VIC) += irq-vic.o | 3 | obj-$(CONFIG_MSM_VIC) += irq-vic.o |
@@ -14,18 +13,11 @@ obj-$(CONFIG_ARCH_QSD8X50) += dma.o io.o | |||
14 | 13 | ||
15 | obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o | 14 | obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o |
16 | obj-$(CONFIG_MSM_SMD) += last_radio_log.o | 15 | obj-$(CONFIG_MSM_SMD) += last_radio_log.o |
17 | obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o | ||
18 | |||
19 | CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) | ||
20 | |||
21 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | ||
22 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | ||
23 | 16 | ||
24 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o | 17 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o |
25 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o | 18 | obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o |
26 | obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o | 19 | obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o |
27 | obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o | 20 | obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o |
28 | obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o | 21 | obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o |
29 | obj-$(CONFIG_ARCH_MSM_DT) += board-dt.o | ||
30 | obj-$(CONFIG_MSM_GPIOMUX) += gpiomux.o | 22 | obj-$(CONFIG_MSM_GPIOMUX) += gpiomux.o |
31 | obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o | 23 | obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o |
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h index 33c7725adae2..572479a3c7be 100644 --- a/arch/arm/mach-msm/common.h +++ b/arch/arm/mach-msm/common.h | |||
@@ -23,9 +23,6 @@ extern void msm_map_qsd8x50_io(void); | |||
23 | extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size, | 23 | extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size, |
24 | unsigned int mtype, void *caller); | 24 | unsigned int mtype, void *caller); |
25 | 25 | ||
26 | extern struct smp_operations msm_smp_ops; | ||
27 | extern void msm_cpu_die(unsigned int cpu); | ||
28 | |||
29 | struct msm_mmc_platform_data; | 26 | struct msm_mmc_platform_data; |
30 | 27 | ||
31 | extern void msm_add_devices(void); | 28 | extern void msm_add_devices(void); |
diff --git a/arch/arm/mach-msm/headsmp.S b/arch/arm/mach-msm/headsmp.S deleted file mode 100644 index 6c62c3f82fe6..000000000000 --- a/arch/arm/mach-msm/headsmp.S +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-realview/headsmp.S | ||
3 | * | ||
4 | * Copyright (c) 2003 ARM Limited | ||
5 | * All Rights Reserved | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | #include <linux/linkage.h> | ||
12 | #include <linux/init.h> | ||
13 | |||
14 | /* | ||
15 | * MSM specific entry point for secondary CPUs. This provides | ||
16 | * a "holding pen" into which all secondary cores are held until we're | ||
17 | * ready for them to initialise. | ||
18 | */ | ||
19 | ENTRY(msm_secondary_startup) | ||
20 | mrc p15, 0, r0, c0, c0, 5 | ||
21 | and r0, r0, #15 | ||
22 | adr r4, 1f | ||
23 | ldmia r4, {r5, r6} | ||
24 | sub r4, r4, r5 | ||
25 | add r6, r6, r4 | ||
26 | pen: ldr r7, [r6] | ||
27 | cmp r7, r0 | ||
28 | bne pen | ||
29 | |||
30 | /* | ||
31 | * we've been released from the holding pen: secondary_stack | ||
32 | * should now contain the SVC stack for this core | ||
33 | */ | ||
34 | b secondary_startup | ||
35 | ENDPROC(msm_secondary_startup) | ||
36 | |||
37 | .align | ||
38 | 1: .long . | ||
39 | .long pen_release | ||
diff --git a/arch/arm/mach-msm/hotplug.c b/arch/arm/mach-msm/hotplug.c deleted file mode 100644 index 326a87261f9a..000000000000 --- a/arch/arm/mach-msm/hotplug.c +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 ARM Ltd. | ||
3 | * All Rights Reserved | ||
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 version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | #include <linux/kernel.h> | ||
10 | #include <linux/errno.h> | ||
11 | #include <linux/smp.h> | ||
12 | |||
13 | #include <asm/smp_plat.h> | ||
14 | |||
15 | #include "common.h" | ||
16 | |||
17 | static inline void cpu_enter_lowpower(void) | ||
18 | { | ||
19 | } | ||
20 | |||
21 | static inline void cpu_leave_lowpower(void) | ||
22 | { | ||
23 | } | ||
24 | |||
25 | static inline void platform_do_lowpower(unsigned int cpu) | ||
26 | { | ||
27 | /* Just enter wfi for now. TODO: Properly shut off the cpu. */ | ||
28 | for (;;) { | ||
29 | /* | ||
30 | * here's the WFI | ||
31 | */ | ||
32 | asm("wfi" | ||
33 | : | ||
34 | : | ||
35 | : "memory", "cc"); | ||
36 | |||
37 | if (pen_release == cpu_logical_map(cpu)) { | ||
38 | /* | ||
39 | * OK, proper wakeup, we're done | ||
40 | */ | ||
41 | break; | ||
42 | } | ||
43 | |||
44 | /* | ||
45 | * getting here, means that we have come out of WFI without | ||
46 | * having been woken up - this shouldn't happen | ||
47 | * | ||
48 | * The trouble is, letting people know about this is not really | ||
49 | * possible, since we are currently running incoherently, and | ||
50 | * therefore cannot safely call printk() or anything else | ||
51 | */ | ||
52 | pr_debug("CPU%u: spurious wakeup call\n", cpu); | ||
53 | } | ||
54 | } | ||
55 | |||
56 | /* | ||
57 | * platform-specific code to shutdown a CPU | ||
58 | * | ||
59 | * Called with IRQs disabled | ||
60 | */ | ||
61 | void __ref msm_cpu_die(unsigned int cpu) | ||
62 | { | ||
63 | /* | ||
64 | * we're ready for shutdown now, so do it | ||
65 | */ | ||
66 | cpu_enter_lowpower(); | ||
67 | platform_do_lowpower(cpu); | ||
68 | |||
69 | /* | ||
70 | * bring this CPU back into the world of cache | ||
71 | * coherency, and then restore interrupts | ||
72 | */ | ||
73 | cpu_leave_lowpower(); | ||
74 | } | ||
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c deleted file mode 100644 index f10a1f58fde9..000000000000 --- a/arch/arm/mach-msm/platsmp.c +++ /dev/null | |||
@@ -1,161 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 ARM Ltd. | ||
3 | * All Rights Reserved | ||
4 | * Copyright (c) 2010, Code Aurora Forum. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/errno.h> | ||
13 | #include <linux/delay.h> | ||
14 | #include <linux/device.h> | ||
15 | #include <linux/jiffies.h> | ||
16 | #include <linux/smp.h> | ||
17 | #include <linux/io.h> | ||
18 | |||
19 | #include <asm/cacheflush.h> | ||
20 | #include <asm/cputype.h> | ||
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/smp_plat.h> | ||
23 | |||
24 | #include "scm-boot.h" | ||
25 | #include "common.h" | ||
26 | |||
27 | #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x15A0 | ||
28 | #define SCSS_CPU1CORE_RESET 0xD80 | ||
29 | #define SCSS_DBG_STATUS_CORE_PWRDUP 0xE64 | ||
30 | |||
31 | extern void msm_secondary_startup(void); | ||
32 | |||
33 | static DEFINE_SPINLOCK(boot_lock); | ||
34 | |||
35 | static inline int get_core_count(void) | ||
36 | { | ||
37 | /* 1 + the PART[1:0] field of MIDR */ | ||
38 | return ((read_cpuid_id() >> 4) & 3) + 1; | ||
39 | } | ||
40 | |||
41 | static void msm_secondary_init(unsigned int cpu) | ||
42 | { | ||
43 | /* | ||
44 | * let the primary processor know we're out of the | ||
45 | * pen, then head off into the C entry point | ||
46 | */ | ||
47 | pen_release = -1; | ||
48 | smp_wmb(); | ||
49 | |||
50 | /* | ||
51 | * Synchronise with the boot thread. | ||
52 | */ | ||
53 | spin_lock(&boot_lock); | ||
54 | spin_unlock(&boot_lock); | ||
55 | } | ||
56 | |||
57 | static void prepare_cold_cpu(unsigned int cpu) | ||
58 | { | ||
59 | int ret; | ||
60 | ret = scm_set_boot_addr(virt_to_phys(msm_secondary_startup), | ||
61 | SCM_FLAG_COLDBOOT_CPU1); | ||
62 | if (ret == 0) { | ||
63 | void __iomem *sc1_base_ptr; | ||
64 | sc1_base_ptr = ioremap_nocache(0x00902000, SZ_4K*2); | ||
65 | if (sc1_base_ptr) { | ||
66 | writel(0, sc1_base_ptr + VDD_SC1_ARRAY_CLAMP_GFS_CTL); | ||
67 | writel(0, sc1_base_ptr + SCSS_CPU1CORE_RESET); | ||
68 | writel(3, sc1_base_ptr + SCSS_DBG_STATUS_CORE_PWRDUP); | ||
69 | iounmap(sc1_base_ptr); | ||
70 | } | ||
71 | } else | ||
72 | printk(KERN_DEBUG "Failed to set secondary core boot " | ||
73 | "address\n"); | ||
74 | } | ||
75 | |||
76 | static int msm_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
77 | { | ||
78 | unsigned long timeout; | ||
79 | static int cold_boot_done; | ||
80 | |||
81 | /* Only need to bring cpu out of reset this way once */ | ||
82 | if (cold_boot_done == false) { | ||
83 | prepare_cold_cpu(cpu); | ||
84 | cold_boot_done = true; | ||
85 | } | ||
86 | |||
87 | /* | ||
88 | * set synchronisation state between this boot processor | ||
89 | * and the secondary one | ||
90 | */ | ||
91 | spin_lock(&boot_lock); | ||
92 | |||
93 | /* | ||
94 | * The secondary processor is waiting to be released from | ||
95 | * the holding pen - release it, then wait for it to flag | ||
96 | * that it has been released by resetting pen_release. | ||
97 | * | ||
98 | * Note that "pen_release" is the hardware CPU ID, whereas | ||
99 | * "cpu" is Linux's internal ID. | ||
100 | */ | ||
101 | pen_release = cpu_logical_map(cpu); | ||
102 | sync_cache_w(&pen_release); | ||
103 | |||
104 | /* | ||
105 | * Send the secondary CPU a soft interrupt, thereby causing | ||
106 | * the boot monitor to read the system wide flags register, | ||
107 | * and branch to the address found there. | ||
108 | */ | ||
109 | arch_send_wakeup_ipi_mask(cpumask_of(cpu)); | ||
110 | |||
111 | timeout = jiffies + (1 * HZ); | ||
112 | while (time_before(jiffies, timeout)) { | ||
113 | smp_rmb(); | ||
114 | if (pen_release == -1) | ||
115 | break; | ||
116 | |||
117 | udelay(10); | ||
118 | } | ||
119 | |||
120 | /* | ||
121 | * now the secondary core is starting up let it run its | ||
122 | * calibrations, then wait for it to finish | ||
123 | */ | ||
124 | spin_unlock(&boot_lock); | ||
125 | |||
126 | return pen_release != -1 ? -ENOSYS : 0; | ||
127 | } | ||
128 | |||
129 | /* | ||
130 | * Initialise the CPU possible map early - this describes the CPUs | ||
131 | * which may be present or become present in the system. The msm8x60 | ||
132 | * does not support the ARM SCU, so just set the possible cpu mask to | ||
133 | * NR_CPUS. | ||
134 | */ | ||
135 | static void __init msm_smp_init_cpus(void) | ||
136 | { | ||
137 | unsigned int i, ncores = get_core_count(); | ||
138 | |||
139 | if (ncores > nr_cpu_ids) { | ||
140 | pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", | ||
141 | ncores, nr_cpu_ids); | ||
142 | ncores = nr_cpu_ids; | ||
143 | } | ||
144 | |||
145 | for (i = 0; i < ncores; i++) | ||
146 | set_cpu_possible(i, true); | ||
147 | } | ||
148 | |||
149 | static void __init msm_smp_prepare_cpus(unsigned int max_cpus) | ||
150 | { | ||
151 | } | ||
152 | |||
153 | struct smp_operations msm_smp_ops __initdata = { | ||
154 | .smp_init_cpus = msm_smp_init_cpus, | ||
155 | .smp_prepare_cpus = msm_smp_prepare_cpus, | ||
156 | .smp_secondary_init = msm_secondary_init, | ||
157 | .smp_boot_secondary = msm_boot_secondary, | ||
158 | #ifdef CONFIG_HOTPLUG_CPU | ||
159 | .cpu_die = msm_cpu_die, | ||
160 | #endif | ||
161 | }; | ||
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c deleted file mode 100644 index fd1644987534..000000000000 --- a/arch/arm/mach-msm/timer.c +++ /dev/null | |||
@@ -1,333 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | ||
4 | * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
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 | */ | ||
16 | |||
17 | #include <linux/clocksource.h> | ||
18 | #include <linux/clockchips.h> | ||
19 | #include <linux/cpu.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/irq.h> | ||
23 | #include <linux/io.h> | ||
24 | #include <linux/of.h> | ||
25 | #include <linux/of_address.h> | ||
26 | #include <linux/of_irq.h> | ||
27 | #include <linux/sched_clock.h> | ||
28 | |||
29 | #include <asm/mach/time.h> | ||
30 | |||
31 | #include "common.h" | ||
32 | |||
33 | #define TIMER_MATCH_VAL 0x0000 | ||
34 | #define TIMER_COUNT_VAL 0x0004 | ||
35 | #define TIMER_ENABLE 0x0008 | ||
36 | #define TIMER_ENABLE_CLR_ON_MATCH_EN BIT(1) | ||
37 | #define TIMER_ENABLE_EN BIT(0) | ||
38 | #define TIMER_CLEAR 0x000C | ||
39 | #define DGT_CLK_CTL 0x10 | ||
40 | #define DGT_CLK_CTL_DIV_4 0x3 | ||
41 | #define TIMER_STS_GPT0_CLR_PEND BIT(10) | ||
42 | |||
43 | #define GPT_HZ 32768 | ||
44 | |||
45 | #define MSM_DGT_SHIFT 5 | ||
46 | |||
47 | static void __iomem *event_base; | ||
48 | static void __iomem *sts_base; | ||
49 | |||
50 | static irqreturn_t msm_timer_interrupt(int irq, void *dev_id) | ||
51 | { | ||
52 | struct clock_event_device *evt = dev_id; | ||
53 | /* Stop the timer tick */ | ||
54 | if (evt->mode == CLOCK_EVT_MODE_ONESHOT) { | ||
55 | u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE); | ||
56 | ctrl &= ~TIMER_ENABLE_EN; | ||
57 | writel_relaxed(ctrl, event_base + TIMER_ENABLE); | ||
58 | } | ||
59 | evt->event_handler(evt); | ||
60 | return IRQ_HANDLED; | ||
61 | } | ||
62 | |||
63 | static int msm_timer_set_next_event(unsigned long cycles, | ||
64 | struct clock_event_device *evt) | ||
65 | { | ||
66 | u32 ctrl = readl_relaxed(event_base + TIMER_ENABLE); | ||
67 | |||
68 | ctrl &= ~TIMER_ENABLE_EN; | ||
69 | writel_relaxed(ctrl, event_base + TIMER_ENABLE); | ||
70 | |||
71 | writel_relaxed(ctrl, event_base + TIMER_CLEAR); | ||
72 | writel_relaxed(cycles, event_base + TIMER_MATCH_VAL); | ||
73 | |||
74 | if (sts_base) | ||
75 | while (readl_relaxed(sts_base) & TIMER_STS_GPT0_CLR_PEND) | ||
76 | cpu_relax(); | ||
77 | |||
78 | writel_relaxed(ctrl | TIMER_ENABLE_EN, event_base + TIMER_ENABLE); | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | static void msm_timer_set_mode(enum clock_event_mode mode, | ||
83 | struct clock_event_device *evt) | ||
84 | { | ||
85 | u32 ctrl; | ||
86 | |||
87 | ctrl = readl_relaxed(event_base + TIMER_ENABLE); | ||
88 | ctrl &= ~(TIMER_ENABLE_EN | TIMER_ENABLE_CLR_ON_MATCH_EN); | ||
89 | |||
90 | switch (mode) { | ||
91 | case CLOCK_EVT_MODE_RESUME: | ||
92 | case CLOCK_EVT_MODE_PERIODIC: | ||
93 | break; | ||
94 | case CLOCK_EVT_MODE_ONESHOT: | ||
95 | /* Timer is enabled in set_next_event */ | ||
96 | break; | ||
97 | case CLOCK_EVT_MODE_UNUSED: | ||
98 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
99 | break; | ||
100 | } | ||
101 | writel_relaxed(ctrl, event_base + TIMER_ENABLE); | ||
102 | } | ||
103 | |||
104 | static struct clock_event_device __percpu *msm_evt; | ||
105 | |||
106 | static void __iomem *source_base; | ||
107 | |||
108 | static notrace cycle_t msm_read_timer_count(struct clocksource *cs) | ||
109 | { | ||
110 | return readl_relaxed(source_base + TIMER_COUNT_VAL); | ||
111 | } | ||
112 | |||
113 | static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs) | ||
114 | { | ||
115 | /* | ||
116 | * Shift timer count down by a constant due to unreliable lower bits | ||
117 | * on some targets. | ||
118 | */ | ||
119 | return msm_read_timer_count(cs) >> MSM_DGT_SHIFT; | ||
120 | } | ||
121 | |||
122 | static struct clocksource msm_clocksource = { | ||
123 | .name = "dg_timer", | ||
124 | .rating = 300, | ||
125 | .read = msm_read_timer_count, | ||
126 | .mask = CLOCKSOURCE_MASK(32), | ||
127 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
128 | }; | ||
129 | |||
130 | static int msm_timer_irq; | ||
131 | static int msm_timer_has_ppi; | ||
132 | |||
133 | static int msm_local_timer_setup(struct clock_event_device *evt) | ||
134 | { | ||
135 | int cpu = smp_processor_id(); | ||
136 | int err; | ||
137 | |||
138 | evt->irq = msm_timer_irq; | ||
139 | evt->name = "msm_timer"; | ||
140 | evt->features = CLOCK_EVT_FEAT_ONESHOT; | ||
141 | evt->rating = 200; | ||
142 | evt->set_mode = msm_timer_set_mode; | ||
143 | evt->set_next_event = msm_timer_set_next_event; | ||
144 | evt->cpumask = cpumask_of(cpu); | ||
145 | |||
146 | clockevents_config_and_register(evt, GPT_HZ, 4, 0xffffffff); | ||
147 | |||
148 | if (msm_timer_has_ppi) { | ||
149 | enable_percpu_irq(evt->irq, IRQ_TYPE_EDGE_RISING); | ||
150 | } else { | ||
151 | err = request_irq(evt->irq, msm_timer_interrupt, | ||
152 | IRQF_TIMER | IRQF_NOBALANCING | | ||
153 | IRQF_TRIGGER_RISING, "gp_timer", evt); | ||
154 | if (err) | ||
155 | pr_err("request_irq failed\n"); | ||
156 | } | ||
157 | |||
158 | return 0; | ||
159 | } | ||
160 | |||
161 | static void msm_local_timer_stop(struct clock_event_device *evt) | ||
162 | { | ||
163 | evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt); | ||
164 | disable_percpu_irq(evt->irq); | ||
165 | } | ||
166 | |||
167 | static int msm_timer_cpu_notify(struct notifier_block *self, | ||
168 | unsigned long action, void *hcpu) | ||
169 | { | ||
170 | /* | ||
171 | * Grab cpu pointer in each case to avoid spurious | ||
172 | * preemptible warnings | ||
173 | */ | ||
174 | switch (action & ~CPU_TASKS_FROZEN) { | ||
175 | case CPU_STARTING: | ||
176 | msm_local_timer_setup(this_cpu_ptr(msm_evt)); | ||
177 | break; | ||
178 | case CPU_DYING: | ||
179 | msm_local_timer_stop(this_cpu_ptr(msm_evt)); | ||
180 | break; | ||
181 | } | ||
182 | |||
183 | return NOTIFY_OK; | ||
184 | } | ||
185 | |||
186 | static struct notifier_block msm_timer_cpu_nb = { | ||
187 | .notifier_call = msm_timer_cpu_notify, | ||
188 | }; | ||
189 | |||
190 | static u64 notrace msm_sched_clock_read(void) | ||
191 | { | ||
192 | return msm_clocksource.read(&msm_clocksource); | ||
193 | } | ||
194 | |||
195 | static void __init msm_timer_init(u32 dgt_hz, int sched_bits, int irq, | ||
196 | bool percpu) | ||
197 | { | ||
198 | struct clocksource *cs = &msm_clocksource; | ||
199 | int res = 0; | ||
200 | |||
201 | msm_timer_irq = irq; | ||
202 | msm_timer_has_ppi = percpu; | ||
203 | |||
204 | msm_evt = alloc_percpu(struct clock_event_device); | ||
205 | if (!msm_evt) { | ||
206 | pr_err("memory allocation failed for clockevents\n"); | ||
207 | goto err; | ||
208 | } | ||
209 | |||
210 | if (percpu) | ||
211 | res = request_percpu_irq(irq, msm_timer_interrupt, | ||
212 | "gp_timer", msm_evt); | ||
213 | |||
214 | if (res) { | ||
215 | pr_err("request_percpu_irq failed\n"); | ||
216 | } else { | ||
217 | res = register_cpu_notifier(&msm_timer_cpu_nb); | ||
218 | if (res) { | ||
219 | free_percpu_irq(irq, msm_evt); | ||
220 | goto err; | ||
221 | } | ||
222 | |||
223 | /* Immediately configure the timer on the boot CPU */ | ||
224 | msm_local_timer_setup(__this_cpu_ptr(msm_evt)); | ||
225 | } | ||
226 | |||
227 | err: | ||
228 | writel_relaxed(TIMER_ENABLE_EN, source_base + TIMER_ENABLE); | ||
229 | res = clocksource_register_hz(cs, dgt_hz); | ||
230 | if (res) | ||
231 | pr_err("clocksource_register failed\n"); | ||
232 | sched_clock_register(msm_sched_clock_read, sched_bits, dgt_hz); | ||
233 | } | ||
234 | |||
235 | #ifdef CONFIG_OF | ||
236 | static void __init msm_dt_timer_init(struct device_node *np) | ||
237 | { | ||
238 | u32 freq; | ||
239 | int irq; | ||
240 | struct resource res; | ||
241 | u32 percpu_offset; | ||
242 | void __iomem *base; | ||
243 | void __iomem *cpu0_base; | ||
244 | |||
245 | base = of_iomap(np, 0); | ||
246 | if (!base) { | ||
247 | pr_err("Failed to map event base\n"); | ||
248 | return; | ||
249 | } | ||
250 | |||
251 | /* We use GPT0 for the clockevent */ | ||
252 | irq = irq_of_parse_and_map(np, 1); | ||
253 | if (irq <= 0) { | ||
254 | pr_err("Can't get irq\n"); | ||
255 | return; | ||
256 | } | ||
257 | |||
258 | /* We use CPU0's DGT for the clocksource */ | ||
259 | if (of_property_read_u32(np, "cpu-offset", &percpu_offset)) | ||
260 | percpu_offset = 0; | ||
261 | |||
262 | if (of_address_to_resource(np, 0, &res)) { | ||
263 | pr_err("Failed to parse DGT resource\n"); | ||
264 | return; | ||
265 | } | ||
266 | |||
267 | cpu0_base = ioremap(res.start + percpu_offset, resource_size(&res)); | ||
268 | if (!cpu0_base) { | ||
269 | pr_err("Failed to map source base\n"); | ||
270 | return; | ||
271 | } | ||
272 | |||
273 | if (of_property_read_u32(np, "clock-frequency", &freq)) { | ||
274 | pr_err("Unknown frequency\n"); | ||
275 | return; | ||
276 | } | ||
277 | |||
278 | event_base = base + 0x4; | ||
279 | sts_base = base + 0x88; | ||
280 | source_base = cpu0_base + 0x24; | ||
281 | freq /= 4; | ||
282 | writel_relaxed(DGT_CLK_CTL_DIV_4, source_base + DGT_CLK_CTL); | ||
283 | |||
284 | msm_timer_init(freq, 32, irq, !!percpu_offset); | ||
285 | } | ||
286 | CLOCKSOURCE_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init); | ||
287 | CLOCKSOURCE_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init); | ||
288 | #endif | ||
289 | |||
290 | static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source, | ||
291 | u32 sts) | ||
292 | { | ||
293 | void __iomem *base; | ||
294 | |||
295 | base = ioremap(addr, SZ_256); | ||
296 | if (!base) { | ||
297 | pr_err("Failed to map timer base\n"); | ||
298 | return -ENOMEM; | ||
299 | } | ||
300 | event_base = base + event; | ||
301 | source_base = base + source; | ||
302 | if (sts) | ||
303 | sts_base = base + sts; | ||
304 | |||
305 | return 0; | ||
306 | } | ||
307 | |||
308 | void __init msm7x01_timer_init(void) | ||
309 | { | ||
310 | struct clocksource *cs = &msm_clocksource; | ||
311 | |||
312 | if (msm_timer_map(0xc0100000, 0x0, 0x10, 0x0)) | ||
313 | return; | ||
314 | cs->read = msm_read_timer_count_shift; | ||
315 | cs->mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT)); | ||
316 | /* 600 KHz */ | ||
317 | msm_timer_init(19200000 >> MSM_DGT_SHIFT, 32 - MSM_DGT_SHIFT, 7, | ||
318 | false); | ||
319 | } | ||
320 | |||
321 | void __init msm7x30_timer_init(void) | ||
322 | { | ||
323 | if (msm_timer_map(0xc0100000, 0x4, 0x24, 0x80)) | ||
324 | return; | ||
325 | msm_timer_init(24576000 / 4, 32, 1, false); | ||
326 | } | ||
327 | |||
328 | void __init qsd8x50_timer_init(void) | ||
329 | { | ||
330 | if (msm_timer_map(0xAC100000, 0x0, 0x10, 0x34)) | ||
331 | return; | ||
332 | msm_timer_init(19200000 / 4, 32, 7, false); | ||
333 | } | ||
diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index 75062eff2494..e6ac679bece9 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c | |||
@@ -15,11 +15,11 @@ | |||
15 | #include <linux/ata_platform.h> | 15 | #include <linux/ata_platform.h> |
16 | #include <linux/clk-provider.h> | 16 | #include <linux/clk-provider.h> |
17 | #include <linux/ethtool.h> | 17 | #include <linux/ethtool.h> |
18 | #include <asm/hardware/cache-feroceon-l2.h> | ||
18 | #include <asm/mach/map.h> | 19 | #include <asm/mach/map.h> |
19 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
20 | #include <mach/mv78xx0.h> | 21 | #include <mach/mv78xx0.h> |
21 | #include <mach/bridge-regs.h> | 22 | #include <mach/bridge-regs.h> |
22 | #include <plat/cache-feroceon-l2.h> | ||
23 | #include <linux/platform_data/usb-ehci-orion.h> | 23 | #include <linux/platform_data/usb-ehci-orion.h> |
24 | #include <linux/platform_data/mtd-orion_nand.h> | 24 | #include <linux/platform_data/mtd-orion_nand.h> |
25 | #include <plat/time.h> | 25 | #include <plat/time.h> |
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 5e269d7263ce..485513cb98c4 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig | |||
@@ -1,16 +1,11 @@ | |||
1 | config ARCH_MVEBU | 1 | config ARCH_MVEBU |
2 | bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 | 2 | bool "Marvell Engineering Business Unit (MVEBU) SoCs" if (ARCH_MULTI_V7 || ARCH_MULTI_V5) |
3 | select ARCH_SUPPORTS_BIG_ENDIAN | 3 | select ARCH_SUPPORTS_BIG_ENDIAN |
4 | select CLKSRC_MMIO | 4 | select CLKSRC_MMIO |
5 | select COMMON_CLK | ||
6 | select GENERIC_CLOCKEVENTS | ||
7 | select GENERIC_IRQ_CHIP | 5 | select GENERIC_IRQ_CHIP |
8 | select IRQ_DOMAIN | 6 | select IRQ_DOMAIN |
9 | select MULTI_IRQ_HANDLER | ||
10 | select PINCTRL | 7 | select PINCTRL |
11 | select PLAT_ORION | 8 | select PLAT_ORION |
12 | select SPARSE_IRQ | ||
13 | select CLKDEV_LOOKUP | ||
14 | select MVEBU_MBUS | 9 | select MVEBU_MBUS |
15 | select ZONE_DMA if ARM_LPAE | 10 | select ZONE_DMA if ARM_LPAE |
16 | select ARCH_REQUIRE_GPIOLIB | 11 | select ARCH_REQUIRE_GPIOLIB |
@@ -19,33 +14,97 @@ config ARCH_MVEBU | |||
19 | 14 | ||
20 | if ARCH_MVEBU | 15 | if ARCH_MVEBU |
21 | 16 | ||
22 | menu "Marvell SOC with device tree" | 17 | menu "Marvell EBU SoC variants" |
23 | 18 | ||
24 | config MACH_ARMADA_370_XP | 19 | config MACH_MVEBU_V7 |
25 | bool | 20 | bool |
26 | select ARMADA_370_XP_TIMER | 21 | select ARMADA_370_XP_TIMER |
27 | select HAVE_SMP | ||
28 | select CACHE_L2X0 | 22 | select CACHE_L2X0 |
29 | select CPU_PJ4B | ||
30 | 23 | ||
31 | config MACH_ARMADA_370 | 24 | config MACH_ARMADA_370 |
32 | bool "Marvell Armada 370 boards" | 25 | bool "Marvell Armada 370 boards" if ARCH_MULTI_V7 |
33 | select ARMADA_370_CLK | 26 | select ARMADA_370_CLK |
34 | select MACH_ARMADA_370_XP | 27 | select CPU_PJ4B |
28 | select MACH_MVEBU_V7 | ||
35 | select PINCTRL_ARMADA_370 | 29 | select PINCTRL_ARMADA_370 |
36 | help | 30 | help |
37 | Say 'Y' here if you want your kernel to support boards based | 31 | Say 'Y' here if you want your kernel to support boards based |
38 | on the Marvell Armada 370 SoC with device tree. | 32 | on the Marvell Armada 370 SoC with device tree. |
39 | 33 | ||
34 | config MACH_ARMADA_375 | ||
35 | bool "Marvell Armada 375 boards" if ARCH_MULTI_V7 | ||
36 | select ARM_ERRATA_720789 | ||
37 | select ARM_ERRATA_753970 | ||
38 | select ARM_GIC | ||
39 | select ARMADA_375_CLK | ||
40 | select CPU_V7 | ||
41 | select MACH_MVEBU_V7 | ||
42 | select NEON | ||
43 | select PINCTRL_ARMADA_375 | ||
44 | help | ||
45 | Say 'Y' here if you want your kernel to support boards based | ||
46 | on the Marvell Armada 375 SoC with device tree. | ||
47 | |||
48 | config MACH_ARMADA_38X | ||
49 | bool "Marvell Armada 380/385 boards" if ARCH_MULTI_V7 | ||
50 | select ARM_ERRATA_720789 | ||
51 | select ARM_ERRATA_753970 | ||
52 | select ARM_GIC | ||
53 | select ARMADA_38X_CLK | ||
54 | select CPU_V7 | ||
55 | select MACH_MVEBU_V7 | ||
56 | select NEON | ||
57 | select PINCTRL_ARMADA_38X | ||
58 | help | ||
59 | Say 'Y' here if you want your kernel to support boards based | ||
60 | on the Marvell Armada 380/385 SoC with device tree. | ||
61 | |||
40 | config MACH_ARMADA_XP | 62 | config MACH_ARMADA_XP |
41 | bool "Marvell Armada XP boards" | 63 | bool "Marvell Armada XP boards" if ARCH_MULTI_V7 |
42 | select ARMADA_XP_CLK | 64 | select ARMADA_XP_CLK |
43 | select MACH_ARMADA_370_XP | 65 | select CPU_PJ4B |
66 | select MACH_MVEBU_V7 | ||
44 | select PINCTRL_ARMADA_XP | 67 | select PINCTRL_ARMADA_XP |
45 | help | 68 | help |
46 | Say 'Y' here if you want your kernel to support boards based | 69 | Say 'Y' here if you want your kernel to support boards based |
47 | on the Marvell Armada XP SoC with device tree. | 70 | on the Marvell Armada XP SoC with device tree. |
48 | 71 | ||
72 | config MACH_DOVE | ||
73 | bool "Marvell Dove boards" if ARCH_MULTI_V7 | ||
74 | select CACHE_L2X0 | ||
75 | select CPU_PJ4 | ||
76 | select DOVE_CLK | ||
77 | select ORION_IRQCHIP | ||
78 | select ORION_TIMER | ||
79 | select PINCTRL_DOVE | ||
80 | help | ||
81 | Say 'Y' here if you want your kernel to support the | ||
82 | Marvell Dove using flattened device tree. | ||
83 | |||
84 | config MACH_KIRKWOOD | ||
85 | bool "Marvell Kirkwood boards" if ARCH_MULTI_V5 | ||
86 | select ARCH_HAS_CPUFREQ | ||
87 | select ARCH_REQUIRE_GPIOLIB | ||
88 | select CPU_FEROCEON | ||
89 | select KIRKWOOD_CLK | ||
90 | select OF_IRQ | ||
91 | select ORION_IRQCHIP | ||
92 | select ORION_TIMER | ||
93 | select PCI | ||
94 | select PCI_QUIRKS | ||
95 | select PINCTRL_KIRKWOOD | ||
96 | select USE_OF | ||
97 | help | ||
98 | Say 'Y' here if you want your kernel to support boards based | ||
99 | on the Marvell Kirkwood device tree. | ||
100 | |||
101 | config MACH_T5325 | ||
102 | bool "HP T5325 thin client" | ||
103 | depends on MACH_KIRKWOOD | ||
104 | help | ||
105 | Say 'Y' here if you want your kernel to support the | ||
106 | HP T5325 Thin client | ||
107 | |||
49 | endmenu | 108 | endmenu |
50 | 109 | ||
51 | endif | 110 | endif |
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile index 878aebe98dcc..a63e43b6b451 100644 --- a/arch/arm/mach-mvebu/Makefile +++ b/arch/arm/mach-mvebu/Makefile | |||
@@ -4,7 +4,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \ | |||
4 | AFLAGS_coherency_ll.o := -Wa,-march=armv7-a | 4 | AFLAGS_coherency_ll.o := -Wa,-march=armv7-a |
5 | 5 | ||
6 | obj-y += system-controller.o mvebu-soc-id.o | 6 | obj-y += system-controller.o mvebu-soc-id.o |
7 | obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o | 7 | obj-$(CONFIG_MACH_MVEBU_V7) += board-v7.o |
8 | obj-$(CONFIG_MACH_DOVE) += dove.o | ||
8 | obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o | 9 | obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o |
9 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o | 10 | obj-$(CONFIG_SMP) += platsmp.o headsmp.o |
10 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o | 11 | obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o |
12 | obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o | ||
13 | obj-$(CONFIG_MACH_T5325) += board-t5325.o | ||
diff --git a/arch/arm/mach-mvebu/board-t5325.c b/arch/arm/mach-mvebu/board-t5325.c new file mode 100644 index 000000000000..65ace6db9f28 --- /dev/null +++ b/arch/arm/mach-mvebu/board-t5325.c | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * HP T5325 Board Setup | ||
3 | * | ||
4 | * Copyright (C) 2014 | ||
5 | * | ||
6 | * Andrew Lunn <andrew@lunn.ch> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/i2c.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <sound/alc5623.h> | ||
18 | #include "board.h" | ||
19 | |||
20 | static struct platform_device hp_t5325_audio_device = { | ||
21 | .name = "t5325-audio", | ||
22 | .id = -1, | ||
23 | }; | ||
24 | |||
25 | static struct alc5623_platform_data alc5621_data = { | ||
26 | .add_ctrl = 0x3700, | ||
27 | .jack_det_ctrl = 0x4810, | ||
28 | }; | ||
29 | |||
30 | static struct i2c_board_info i2c_board_info[] __initdata = { | ||
31 | { | ||
32 | I2C_BOARD_INFO("alc5621", 0x1a), | ||
33 | .platform_data = &alc5621_data, | ||
34 | }, | ||
35 | }; | ||
36 | |||
37 | void __init t5325_init(void) | ||
38 | { | ||
39 | i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info)); | ||
40 | platform_device_register(&hp_t5325_audio_device); | ||
41 | } | ||
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/board-v7.c index f6c9d1d85c14..746134ecdfc2 100644 --- a/arch/arm/mach-mvebu/armada-370-xp.c +++ b/arch/arm/mach-mvebu/board-v7.c | |||
@@ -31,12 +31,28 @@ | |||
31 | #include "coherency.h" | 31 | #include "coherency.h" |
32 | #include "mvebu-soc-id.h" | 32 | #include "mvebu-soc-id.h" |
33 | 33 | ||
34 | static void __init armada_370_xp_map_io(void) | 34 | /* |
35 | * Early versions of Armada 375 SoC have a bug where the BootROM | ||
36 | * leaves an external data abort pending. The kernel is hit by this | ||
37 | * data abort as soon as it enters userspace, because it unmasks the | ||
38 | * data aborts at this moment. We register a custom abort handler | ||
39 | * below to ignore the first data abort to work around this | ||
40 | * problem. | ||
41 | */ | ||
42 | static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr, | ||
43 | struct pt_regs *regs) | ||
35 | { | 44 | { |
36 | debug_ll_io_init(); | 45 | static int ignore_first; |
46 | |||
47 | if (!ignore_first && fsr == 0x1406) { | ||
48 | ignore_first = 1; | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | return 1; | ||
37 | } | 53 | } |
38 | 54 | ||
39 | static void __init armada_370_xp_timer_and_clk_init(void) | 55 | static void __init mvebu_timer_and_clk_init(void) |
40 | { | 56 | { |
41 | of_clk_init(NULL); | 57 | of_clk_init(NULL); |
42 | clocksource_of_init(); | 58 | clocksource_of_init(); |
@@ -45,6 +61,10 @@ static void __init armada_370_xp_timer_and_clk_init(void) | |||
45 | #ifdef CONFIG_CACHE_L2X0 | 61 | #ifdef CONFIG_CACHE_L2X0 |
46 | l2x0_of_init(0, ~0UL); | 62 | l2x0_of_init(0, ~0UL); |
47 | #endif | 63 | #endif |
64 | |||
65 | if (of_machine_is_compatible("marvell,armada375")) | ||
66 | hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0, | ||
67 | "imprecise external abort"); | ||
48 | } | 68 | } |
49 | 69 | ||
50 | static void __init i2c_quirk(void) | 70 | static void __init i2c_quirk(void) |
@@ -75,7 +95,7 @@ static void __init i2c_quirk(void) | |||
75 | return; | 95 | return; |
76 | } | 96 | } |
77 | 97 | ||
78 | static void __init armada_370_xp_dt_init(void) | 98 | static void __init mvebu_dt_init(void) |
79 | { | 99 | { |
80 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) | 100 | if (of_machine_is_compatible("plathome,openblocks-ax3-4")) |
81 | i2c_quirk(); | 101 | i2c_quirk(); |
@@ -87,11 +107,33 @@ static const char * const armada_370_xp_dt_compat[] = { | |||
87 | NULL, | 107 | NULL, |
88 | }; | 108 | }; |
89 | 109 | ||
90 | DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") | 110 | DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)") |
91 | .smp = smp_ops(armada_xp_smp_ops), | 111 | .smp = smp_ops(armada_xp_smp_ops), |
92 | .init_machine = armada_370_xp_dt_init, | 112 | .init_machine = mvebu_dt_init, |
93 | .map_io = armada_370_xp_map_io, | 113 | .init_time = mvebu_timer_and_clk_init, |
94 | .init_time = armada_370_xp_timer_and_clk_init, | ||
95 | .restart = mvebu_restart, | 114 | .restart = mvebu_restart, |
96 | .dt_compat = armada_370_xp_dt_compat, | 115 | .dt_compat = armada_370_xp_dt_compat, |
97 | MACHINE_END | 116 | MACHINE_END |
117 | |||
118 | static const char * const armada_375_dt_compat[] = { | ||
119 | "marvell,armada375", | ||
120 | NULL, | ||
121 | }; | ||
122 | |||
123 | DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)") | ||
124 | .init_time = mvebu_timer_and_clk_init, | ||
125 | .restart = mvebu_restart, | ||
126 | .dt_compat = armada_375_dt_compat, | ||
127 | MACHINE_END | ||
128 | |||
129 | static const char * const armada_38x_dt_compat[] = { | ||
130 | "marvell,armada380", | ||
131 | "marvell,armada385", | ||
132 | NULL, | ||
133 | }; | ||
134 | |||
135 | DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)") | ||
136 | .init_time = mvebu_timer_and_clk_init, | ||
137 | .restart = mvebu_restart, | ||
138 | .dt_compat = armada_38x_dt_compat, | ||
139 | MACHINE_END | ||
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h new file mode 100644 index 000000000000..de7f0a191394 --- /dev/null +++ b/arch/arm/mach-mvebu/board.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Board functions for Marvell System On Chip | ||
3 | * | ||
4 | * Copyright (C) 2014 | ||
5 | * | ||
6 | * Andrew Lunn <andrew@lunn.ch> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ARCH_MVEBU_BOARD_H | ||
14 | #define __ARCH_MVEBU_BOARD_H | ||
15 | |||
16 | #ifdef CONFIG_MACH_T5325 | ||
17 | void t5325_init(void); | ||
18 | #else | ||
19 | static inline void t5325_init(void) {}; | ||
20 | #endif | ||
21 | |||
22 | #endif | ||
diff --git a/arch/arm/mach-dove/board-dt.c b/arch/arm/mach-mvebu/dove.c index 49fa9abd09da..5e5a43624237 100644 --- a/arch/arm/mach-dove/board-dt.c +++ b/arch/arm/mach-mvebu/dove.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-dove/board-dt.c | 2 | * arch/arm/mach-mvebu/dove.c |
3 | * | 3 | * |
4 | * Marvell Dove 88AP510 System On Chip FDT Board | 4 | * Marvell Dove 88AP510 System On Chip FDT Board |
5 | * | 5 | * |
@@ -9,17 +9,14 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/clk-provider.h> | 12 | #include <linux/mbus.h> |
13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
14 | #include <linux/of_platform.h> | 14 | #include <linux/of_platform.h> |
15 | #include <asm/hardware/cache-tauros2.h> | 15 | #include <asm/hardware/cache-tauros2.h> |
16 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
17 | #include <mach/dove.h> | ||
18 | #include <mach/pm.h> | ||
19 | #include <plat/common.h> | ||
20 | #include "common.h" | 17 | #include "common.h" |
21 | 18 | ||
22 | static void __init dove_dt_init(void) | 19 | static void __init dove_init(void) |
23 | { | 20 | { |
24 | pr_info("Dove 88AP510 SoC\n"); | 21 | pr_info("Dove 88AP510 SoC\n"); |
25 | 22 | ||
@@ -30,14 +27,13 @@ static void __init dove_dt_init(void) | |||
30 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 27 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
31 | } | 28 | } |
32 | 29 | ||
33 | static const char * const dove_dt_board_compat[] = { | 30 | static const char * const dove_dt_compat[] = { |
34 | "marvell,dove", | 31 | "marvell,dove", |
35 | NULL | 32 | NULL |
36 | }; | 33 | }; |
37 | 34 | ||
38 | DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") | 35 | DT_MACHINE_START(DOVE_DT, "Marvell Dove") |
39 | .map_io = dove_map_io, | 36 | .init_machine = dove_init, |
40 | .init_machine = dove_dt_init, | 37 | .restart = mvebu_restart, |
41 | .restart = dove_restart, | 38 | .dt_compat = dove_dt_compat, |
42 | .dt_compat = dove_dt_board_compat, | ||
43 | MACHINE_END | 39 | MACHINE_END |
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.c b/arch/arm/mach-mvebu/kirkwood-pm.c new file mode 100644 index 000000000000..cbb816f2120c --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood-pm.c | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * Power Management driver for Marvell Kirkwood SoCs | ||
3 | * | ||
4 | * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> | ||
5 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, | ||
9 | * version 2 of the License. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/suspend.h> | ||
19 | #include <linux/io.h> | ||
20 | #include "kirkwood.h" | ||
21 | |||
22 | static void __iomem *ddr_operation_base; | ||
23 | static void __iomem *memory_pm_ctrl; | ||
24 | |||
25 | static void kirkwood_low_power(void) | ||
26 | { | ||
27 | u32 mem_pm_ctrl; | ||
28 | |||
29 | mem_pm_ctrl = readl(memory_pm_ctrl); | ||
30 | |||
31 | /* Set peripherals to low-power mode */ | ||
32 | writel_relaxed(~0, memory_pm_ctrl); | ||
33 | |||
34 | /* Set DDR in self-refresh */ | ||
35 | writel_relaxed(0x7, ddr_operation_base); | ||
36 | |||
37 | /* | ||
38 | * Set CPU in wait-for-interrupt state. | ||
39 | * This disables the CPU core clocks, | ||
40 | * the array clocks, and also the L2 controller. | ||
41 | */ | ||
42 | cpu_do_idle(); | ||
43 | |||
44 | writel_relaxed(mem_pm_ctrl, memory_pm_ctrl); | ||
45 | } | ||
46 | |||
47 | static int kirkwood_suspend_enter(suspend_state_t state) | ||
48 | { | ||
49 | switch (state) { | ||
50 | case PM_SUSPEND_STANDBY: | ||
51 | kirkwood_low_power(); | ||
52 | break; | ||
53 | default: | ||
54 | return -EINVAL; | ||
55 | } | ||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static int kirkwood_pm_valid_standby(suspend_state_t state) | ||
60 | { | ||
61 | return state == PM_SUSPEND_STANDBY; | ||
62 | } | ||
63 | |||
64 | static const struct platform_suspend_ops kirkwood_suspend_ops = { | ||
65 | .enter = kirkwood_suspend_enter, | ||
66 | .valid = kirkwood_pm_valid_standby, | ||
67 | }; | ||
68 | |||
69 | int __init kirkwood_pm_init(void) | ||
70 | { | ||
71 | ddr_operation_base = ioremap(DDR_OPERATION_BASE, 4); | ||
72 | memory_pm_ctrl = ioremap(MEMORY_PM_CTRL_PHYS, 4); | ||
73 | |||
74 | suspend_set_ops(&kirkwood_suspend_ops); | ||
75 | return 0; | ||
76 | } | ||
diff --git a/arch/arm/mach-mvebu/kirkwood-pm.h b/arch/arm/mach-mvebu/kirkwood-pm.h new file mode 100644 index 000000000000..21e7530f368b --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood-pm.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Power Management driver for Marvell Kirkwood SoCs | ||
3 | * | ||
4 | * Copyright (C) 2013 Ezequiel Garcia <ezequiel@free-electrons.com> | ||
5 | * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License, | ||
9 | * version 2 of the License. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | */ | ||
16 | |||
17 | #ifndef __ARCH_KIRKWOOD_PM_H | ||
18 | #define __ARCH_KIRKWOOD_PM_H | ||
19 | |||
20 | #ifdef CONFIG_PM | ||
21 | void kirkwood_pm_init(void); | ||
22 | #else | ||
23 | static inline void kirkwood_pm_init(void) {}; | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/arch/arm/mach-mvebu/kirkwood.c b/arch/arm/mach-mvebu/kirkwood.c new file mode 100644 index 000000000000..120207fc36f1 --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood.c | |||
@@ -0,0 +1,199 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net> | ||
3 | * | ||
4 | * arch/arm/mach-mvebu/kirkwood.c | ||
5 | * | ||
6 | * Flattened Device Tree board initialization | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/clk.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/mbus.h> | ||
17 | #include <linux/of.h> | ||
18 | #include <linux/of_address.h> | ||
19 | #include <linux/of_net.h> | ||
20 | #include <linux/of_platform.h> | ||
21 | #include <linux/slab.h> | ||
22 | #include <asm/hardware/cache-feroceon-l2.h> | ||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/map.h> | ||
25 | #include "kirkwood.h" | ||
26 | #include "kirkwood-pm.h" | ||
27 | #include "common.h" | ||
28 | #include "board.h" | ||
29 | |||
30 | static struct resource kirkwood_cpufreq_resources[] = { | ||
31 | [0] = { | ||
32 | .start = CPU_CONTROL_PHYS, | ||
33 | .end = CPU_CONTROL_PHYS + 3, | ||
34 | .flags = IORESOURCE_MEM, | ||
35 | }, | ||
36 | }; | ||
37 | |||
38 | static struct platform_device kirkwood_cpufreq_device = { | ||
39 | .name = "kirkwood-cpufreq", | ||
40 | .id = -1, | ||
41 | .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), | ||
42 | .resource = kirkwood_cpufreq_resources, | ||
43 | }; | ||
44 | |||
45 | static void __init kirkwood_cpufreq_init(void) | ||
46 | { | ||
47 | platform_device_register(&kirkwood_cpufreq_device); | ||
48 | } | ||
49 | |||
50 | static struct resource kirkwood_cpuidle_resource[] = { | ||
51 | { | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | .start = DDR_OPERATION_BASE, | ||
54 | .end = DDR_OPERATION_BASE + 3, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static struct platform_device kirkwood_cpuidle = { | ||
59 | .name = "kirkwood_cpuidle", | ||
60 | .id = -1, | ||
61 | .resource = kirkwood_cpuidle_resource, | ||
62 | .num_resources = 1, | ||
63 | }; | ||
64 | |||
65 | static void __init kirkwood_cpuidle_init(void) | ||
66 | { | ||
67 | platform_device_register(&kirkwood_cpuidle); | ||
68 | } | ||
69 | |||
70 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 | ||
71 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 | ||
72 | |||
73 | static void __init kirkwood_dt_eth_fixup(void) | ||
74 | { | ||
75 | struct device_node *np; | ||
76 | |||
77 | /* | ||
78 | * The ethernet interfaces forget the MAC address assigned by u-boot | ||
79 | * if the clocks are turned off. Usually, u-boot on kirkwood boards | ||
80 | * has no DT support to properly set local-mac-address property. | ||
81 | * As a workaround, we get the MAC address from mv643xx_eth registers | ||
82 | * and update the port device node if no valid MAC address is set. | ||
83 | */ | ||
84 | for_each_compatible_node(np, NULL, "marvell,kirkwood-eth-port") { | ||
85 | struct device_node *pnp = of_get_parent(np); | ||
86 | struct clk *clk; | ||
87 | struct property *pmac; | ||
88 | void __iomem *io; | ||
89 | u8 *macaddr; | ||
90 | u32 reg; | ||
91 | |||
92 | if (!pnp) | ||
93 | continue; | ||
94 | |||
95 | /* skip disabled nodes or nodes with valid MAC address*/ | ||
96 | if (!of_device_is_available(pnp) || of_get_mac_address(np)) | ||
97 | goto eth_fixup_skip; | ||
98 | |||
99 | clk = of_clk_get(pnp, 0); | ||
100 | if (IS_ERR(clk)) | ||
101 | goto eth_fixup_skip; | ||
102 | |||
103 | io = of_iomap(pnp, 0); | ||
104 | if (!io) | ||
105 | goto eth_fixup_no_map; | ||
106 | |||
107 | /* ensure port clock is not gated to not hang CPU */ | ||
108 | clk_prepare_enable(clk); | ||
109 | |||
110 | /* store MAC address register contents in local-mac-address */ | ||
111 | pr_err(FW_INFO "%s: local-mac-address is not set\n", | ||
112 | np->full_name); | ||
113 | |||
114 | pmac = kzalloc(sizeof(*pmac) + 6, GFP_KERNEL); | ||
115 | if (!pmac) | ||
116 | goto eth_fixup_no_mem; | ||
117 | |||
118 | pmac->value = pmac + 1; | ||
119 | pmac->length = 6; | ||
120 | pmac->name = kstrdup("local-mac-address", GFP_KERNEL); | ||
121 | if (!pmac->name) { | ||
122 | kfree(pmac); | ||
123 | goto eth_fixup_no_mem; | ||
124 | } | ||
125 | |||
126 | macaddr = pmac->value; | ||
127 | reg = readl(io + MV643XX_ETH_MAC_ADDR_HIGH); | ||
128 | macaddr[0] = (reg >> 24) & 0xff; | ||
129 | macaddr[1] = (reg >> 16) & 0xff; | ||
130 | macaddr[2] = (reg >> 8) & 0xff; | ||
131 | macaddr[3] = reg & 0xff; | ||
132 | |||
133 | reg = readl(io + MV643XX_ETH_MAC_ADDR_LOW); | ||
134 | macaddr[4] = (reg >> 8) & 0xff; | ||
135 | macaddr[5] = reg & 0xff; | ||
136 | |||
137 | of_update_property(np, pmac); | ||
138 | |||
139 | eth_fixup_no_mem: | ||
140 | iounmap(io); | ||
141 | clk_disable_unprepare(clk); | ||
142 | eth_fixup_no_map: | ||
143 | clk_put(clk); | ||
144 | eth_fixup_skip: | ||
145 | of_node_put(pnp); | ||
146 | } | ||
147 | } | ||
148 | |||
149 | /* | ||
150 | * Disable propagation of mbus errors to the CPU local bus, as this | ||
151 | * causes mbus errors (which can occur for example for PCI aborts) to | ||
152 | * throw CPU aborts, which we're not set up to deal with. | ||
153 | */ | ||
154 | void kirkwood_disable_mbus_error_propagation(void) | ||
155 | { | ||
156 | void __iomem *cpu_config; | ||
157 | |||
158 | cpu_config = ioremap(CPU_CONFIG_PHYS, 4); | ||
159 | writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); | ||
160 | } | ||
161 | |||
162 | static struct of_dev_auxdata auxdata[] __initdata = { | ||
163 | OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000, | ||
164 | "mvebu-audio", NULL), | ||
165 | { /* sentinel */ } | ||
166 | }; | ||
167 | |||
168 | static void __init kirkwood_dt_init(void) | ||
169 | { | ||
170 | kirkwood_disable_mbus_error_propagation(); | ||
171 | |||
172 | BUG_ON(mvebu_mbus_dt_init()); | ||
173 | |||
174 | #ifdef CONFIG_CACHE_FEROCEON_L2 | ||
175 | feroceon_of_init(); | ||
176 | #endif | ||
177 | kirkwood_cpufreq_init(); | ||
178 | kirkwood_cpuidle_init(); | ||
179 | |||
180 | kirkwood_pm_init(); | ||
181 | kirkwood_dt_eth_fixup(); | ||
182 | |||
183 | if (of_machine_is_compatible("hp,t5325")) | ||
184 | t5325_init(); | ||
185 | |||
186 | of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL); | ||
187 | } | ||
188 | |||
189 | static const char * const kirkwood_dt_board_compat[] = { | ||
190 | "marvell,kirkwood", | ||
191 | NULL | ||
192 | }; | ||
193 | |||
194 | DT_MACHINE_START(KIRKWOOD_DT, "Marvell Kirkwood (Flattened Device Tree)") | ||
195 | /* Maintainer: Jason Cooper <jason@lakedaemon.net> */ | ||
196 | .init_machine = kirkwood_dt_init, | ||
197 | .restart = mvebu_restart, | ||
198 | .dt_compat = kirkwood_dt_board_compat, | ||
199 | MACHINE_END | ||
diff --git a/arch/arm/mach-mvebu/kirkwood.h b/arch/arm/mach-mvebu/kirkwood.h new file mode 100644 index 000000000000..89f3d1f51643 --- /dev/null +++ b/arch/arm/mach-mvebu/kirkwood.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mvebu/kirkwood.h | ||
3 | * | ||
4 | * Generic definitions for Marvell Kirkwood SoC flavors: | ||
5 | * 88F6180, 88F6192 and 88F6281. | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public | ||
8 | * License version 2. This program is licensed "as is" without any | ||
9 | * warranty of any kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #define KIRKWOOD_REGS_PHYS_BASE 0xf1000000 | ||
13 | #define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000) | ||
14 | #define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000) | ||
15 | |||
16 | #define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418) | ||
17 | |||
18 | #define CPU_CONFIG_PHYS (BRIDGE_PHYS_BASE + 0x0100) | ||
19 | #define CPU_CONFIG_ERROR_PROP 0x00000004 | ||
20 | |||
21 | #define CPU_CONTROL_PHYS (BRIDGE_PHYS_BASE + 0x0104) | ||
22 | #define MEMORY_PM_CTRL_PHYS (BRIDGE_PHYS_BASE + 0x0118) | ||
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index f3b325f6cbd4..f3d4cf53f746 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c | |||
@@ -38,6 +38,7 @@ static bool is_id_valid; | |||
38 | static const struct of_device_id mvebu_pcie_of_match_table[] = { | 38 | static const struct of_device_id mvebu_pcie_of_match_table[] = { |
39 | { .compatible = "marvell,armada-xp-pcie", }, | 39 | { .compatible = "marvell,armada-xp-pcie", }, |
40 | { .compatible = "marvell,armada-370-pcie", }, | 40 | { .compatible = "marvell,armada-370-pcie", }, |
41 | { .compatible = "marvell,kirkwood-pcie" }, | ||
41 | {}, | 42 | {}, |
42 | }; | 43 | }; |
43 | 44 | ||
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c index a7fb89a5b5d9..614ba6832ff3 100644 --- a/arch/arm/mach-mvebu/system-controller.c +++ b/arch/arm/mach-mvebu/system-controller.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * System controller support for Armada 370 and XP platforms. | 2 | * System controller support for Armada 370, 375 and XP platforms. |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Marvell | 4 | * Copyright (C) 2012 Marvell |
5 | * | 5 | * |
@@ -11,7 +11,7 @@ | |||
11 | * License version 2. This program is licensed "as is" without any | 11 | * License version 2. This program is licensed "as is" without any |
12 | * warranty of any kind, whether express or implied. | 12 | * warranty of any kind, whether express or implied. |
13 | * | 13 | * |
14 | * The Armada 370 and Armada XP SoCs both have a range of | 14 | * The Armada 370, 375 and Armada XP SoCs have a range of |
15 | * miscellaneous registers, that do not belong to a particular device, | 15 | * miscellaneous registers, that do not belong to a particular device, |
16 | * but rather provide system-level features. This basic | 16 | * but rather provide system-level features. This basic |
17 | * system-controller driver provides a device tree binding for those | 17 | * system-controller driver provides a device tree binding for those |
@@ -47,6 +47,13 @@ static const struct mvebu_system_controller armada_370_xp_system_controller = { | |||
47 | .system_soft_reset = 0x1, | 47 | .system_soft_reset = 0x1, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const struct mvebu_system_controller armada_375_system_controller = { | ||
51 | .rstoutn_mask_offset = 0x54, | ||
52 | .system_soft_reset_offset = 0x58, | ||
53 | .rstoutn_mask_reset_out_en = 0x1, | ||
54 | .system_soft_reset = 0x1, | ||
55 | }; | ||
56 | |||
50 | static const struct mvebu_system_controller orion_system_controller = { | 57 | static const struct mvebu_system_controller orion_system_controller = { |
51 | .rstoutn_mask_offset = 0x108, | 58 | .rstoutn_mask_offset = 0x108, |
52 | .system_soft_reset_offset = 0x10c, | 59 | .system_soft_reset_offset = 0x10c, |
@@ -54,13 +61,16 @@ static const struct mvebu_system_controller orion_system_controller = { | |||
54 | .system_soft_reset = 0x1, | 61 | .system_soft_reset = 0x1, |
55 | }; | 62 | }; |
56 | 63 | ||
57 | static struct of_device_id of_system_controller_table[] = { | 64 | static const struct of_device_id of_system_controller_table[] = { |
58 | { | 65 | { |
59 | .compatible = "marvell,orion-system-controller", | 66 | .compatible = "marvell,orion-system-controller", |
60 | .data = (void *) &orion_system_controller, | 67 | .data = (void *) &orion_system_controller, |
61 | }, { | 68 | }, { |
62 | .compatible = "marvell,armada-370-xp-system-controller", | 69 | .compatible = "marvell,armada-370-xp-system-controller", |
63 | .data = (void *) &armada_370_xp_system_controller, | 70 | .data = (void *) &armada_370_xp_system_controller, |
71 | }, { | ||
72 | .compatible = "marvell,armada-375-system-controller", | ||
73 | .data = (void *) &armada_375_system_controller, | ||
64 | }, | 74 | }, |
65 | { /* end of list */ }, | 75 | { /* end of list */ }, |
66 | }; | 76 | }; |
@@ -90,13 +100,12 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd) | |||
90 | 100 | ||
91 | static int __init mvebu_system_controller_init(void) | 101 | static int __init mvebu_system_controller_init(void) |
92 | { | 102 | { |
103 | const struct of_device_id *match; | ||
93 | struct device_node *np; | 104 | struct device_node *np; |
94 | 105 | ||
95 | np = of_find_matching_node(NULL, of_system_controller_table); | 106 | np = of_find_matching_node_and_match(NULL, of_system_controller_table, |
107 | &match); | ||
96 | if (np) { | 108 | if (np) { |
97 | const struct of_device_id *match = | ||
98 | of_match_node(of_system_controller_table, np); | ||
99 | BUG_ON(!match); | ||
100 | system_controller_base = of_iomap(np, 0); | 109 | system_controller_base = of_iomap(np, 0); |
101 | mvebu_sc = (struct mvebu_system_controller *)match->data; | 110 | mvebu_sc = (struct mvebu_system_controller *)match->data; |
102 | of_node_put(np); | 111 | of_node_put(np); |
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index 8cde9e05b5d6..84794137b175 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig | |||
@@ -16,11 +16,7 @@ config ARCH_MXS | |||
16 | bool "Freescale MXS (i.MX23, i.MX28) support" | 16 | bool "Freescale MXS (i.MX23, i.MX28) support" |
17 | depends on ARCH_MULTI_V5 | 17 | depends on ARCH_MULTI_V5 |
18 | select ARCH_REQUIRE_GPIOLIB | 18 | select ARCH_REQUIRE_GPIOLIB |
19 | select CLKDEV_LOOKUP | ||
20 | select CLKSRC_MMIO | 19 | select CLKSRC_MMIO |
21 | select CLKSRC_OF | ||
22 | select GENERIC_CLOCKEVENTS | ||
23 | select HAVE_CLK_PREPARE | ||
24 | select PINCTRL | 20 | select PINCTRL |
25 | select SOC_BUS | 21 | select SOC_BUS |
26 | select SOC_IMX23 | 22 | select SOC_IMX23 |
diff --git a/arch/arm/mach-nomadik/Kconfig b/arch/arm/mach-nomadik/Kconfig index 4d42da49753c..486d301f43fd 100644 --- a/arch/arm/mach-nomadik/Kconfig +++ b/arch/arm/mach-nomadik/Kconfig | |||
@@ -6,16 +6,11 @@ config ARCH_NOMADIK | |||
6 | select ARM_VIC | 6 | select ARM_VIC |
7 | select CLKSRC_NOMADIK_MTU | 7 | select CLKSRC_NOMADIK_MTU |
8 | select CLKSRC_NOMADIK_MTU_SCHED_CLOCK | 8 | select CLKSRC_NOMADIK_MTU_SCHED_CLOCK |
9 | select CLKSRC_OF | ||
10 | select COMMON_CLK | ||
11 | select CPU_ARM926T | 9 | select CPU_ARM926T |
12 | select GENERIC_CLOCKEVENTS | ||
13 | select MIGHT_HAVE_CACHE_L2X0 | 10 | select MIGHT_HAVE_CACHE_L2X0 |
14 | select PINCTRL | 11 | select PINCTRL |
15 | select PINCTRL_NOMADIK | 12 | select PINCTRL_NOMADIK |
16 | select PINCTRL_STN8815 | 13 | select PINCTRL_STN8815 |
17 | select SPARSE_IRQ | ||
18 | select USE_OF | ||
19 | help | 14 | help |
20 | Support for the Nomadik platform by ST-Ericsson | 15 | Support for the Nomadik platform by ST-Ericsson |
21 | 16 | ||
diff --git a/arch/arm/mach-nspire/Kconfig b/arch/arm/mach-nspire/Kconfig index 59d8f0a70919..bc41f26c1a12 100644 --- a/arch/arm/mach-nspire/Kconfig +++ b/arch/arm/mach-nspire/Kconfig | |||
@@ -3,14 +3,9 @@ config ARCH_NSPIRE | |||
3 | depends on ARCH_MULTI_V4_V5 | 3 | depends on ARCH_MULTI_V4_V5 |
4 | depends on MMU | 4 | depends on MMU |
5 | select CPU_ARM926T | 5 | select CPU_ARM926T |
6 | select COMMON_CLK | ||
7 | select GENERIC_CLOCKEVENTS | ||
8 | select GENERIC_IRQ_CHIP | 6 | select GENERIC_IRQ_CHIP |
9 | select SPARSE_IRQ | ||
10 | select ARM_AMBA | 7 | select ARM_AMBA |
11 | select ARM_VIC | 8 | select ARM_VIC |
12 | select ARM_TIMER_SP804 | 9 | select ARM_TIMER_SP804 |
13 | select USE_OF | ||
14 | select CLKSRC_OF | ||
15 | help | 10 | help |
16 | This enables support for systems using the TI-NSPIRE CPU | 11 | This enables support for systems using the TI-NSPIRE CPU |
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 91449c5cb70f..85089d821982 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -156,6 +156,7 @@ static struct omap_usb_config nokia770_usb_config __initdata = { | |||
156 | .register_dev = 1, | 156 | .register_dev = 1, |
157 | .hmc_mode = 16, | 157 | .hmc_mode = 16, |
158 | .pins[0] = 6, | 158 | .pins[0] = 6, |
159 | .extcon = "tahvo-usb", | ||
159 | }; | 160 | }; |
160 | 161 | ||
161 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) | 162 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) |
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 653b489479e0..e55ae63bb030 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -6,7 +6,6 @@ config ARCH_OMAP2 | |||
6 | depends on ARCH_MULTI_V6 | 6 | depends on ARCH_MULTI_V6 |
7 | select ARCH_OMAP2PLUS | 7 | select ARCH_OMAP2PLUS |
8 | select CPU_V6 | 8 | select CPU_V6 |
9 | select MULTI_IRQ_HANDLER | ||
10 | select SOC_HAS_OMAP2_SDRC | 9 | select SOC_HAS_OMAP2_SDRC |
11 | 10 | ||
12 | config ARCH_OMAP3 | 11 | config ARCH_OMAP3 |
@@ -15,8 +14,6 @@ config ARCH_OMAP3 | |||
15 | select ARCH_OMAP2PLUS | 14 | select ARCH_OMAP2PLUS |
16 | select ARCH_HAS_OPP | 15 | select ARCH_HAS_OPP |
17 | select ARM_CPU_SUSPEND if PM | 16 | select ARM_CPU_SUSPEND if PM |
18 | select CPU_V7 | ||
19 | select MULTI_IRQ_HANDLER | ||
20 | select OMAP_INTERCONNECT | 17 | select OMAP_INTERCONNECT |
21 | select PM_OPP if PM | 18 | select PM_OPP if PM |
22 | select PM_RUNTIME if CPU_IDLE | 19 | select PM_RUNTIME if CPU_IDLE |
@@ -33,10 +30,8 @@ config ARCH_OMAP4 | |||
33 | select ARM_ERRATA_720789 | 30 | select ARM_ERRATA_720789 |
34 | select ARM_GIC | 31 | select ARM_GIC |
35 | select CACHE_L2X0 | 32 | select CACHE_L2X0 |
36 | select CPU_V7 | ||
37 | select HAVE_ARM_SCU if SMP | 33 | select HAVE_ARM_SCU if SMP |
38 | select HAVE_ARM_TWD if SMP | 34 | select HAVE_ARM_TWD if SMP |
39 | select HAVE_SMP | ||
40 | select OMAP_INTERCONNECT | 35 | select OMAP_INTERCONNECT |
41 | select PL310_ERRATA_588369 | 36 | select PL310_ERRATA_588369 |
42 | select PL310_ERRATA_727915 | 37 | select PL310_ERRATA_727915 |
@@ -50,12 +45,11 @@ config SOC_OMAP5 | |||
50 | bool "TI OMAP5" | 45 | bool "TI OMAP5" |
51 | depends on ARCH_MULTI_V7 | 46 | depends on ARCH_MULTI_V7 |
52 | select ARCH_OMAP2PLUS | 47 | select ARCH_OMAP2PLUS |
48 | select ARCH_HAS_OPP | ||
53 | select ARM_CPU_SUSPEND if PM | 49 | select ARM_CPU_SUSPEND if PM |
54 | select ARM_GIC | 50 | select ARM_GIC |
55 | select CPU_V7 | ||
56 | select HAVE_ARM_SCU if SMP | 51 | select HAVE_ARM_SCU if SMP |
57 | select HAVE_ARM_TWD if LOCAL_TIMERS | 52 | select HAVE_ARM_TWD if SMP |
58 | select HAVE_SMP | ||
59 | select HAVE_ARM_ARCH_TIMER | 53 | select HAVE_ARM_ARCH_TIMER |
60 | select ARM_ERRATA_798181 if SMP | 54 | select ARM_ERRATA_798181 if SMP |
61 | 55 | ||
@@ -63,16 +57,14 @@ config SOC_AM33XX | |||
63 | bool "TI AM33XX" | 57 | bool "TI AM33XX" |
64 | depends on ARCH_MULTI_V7 | 58 | depends on ARCH_MULTI_V7 |
65 | select ARCH_OMAP2PLUS | 59 | select ARCH_OMAP2PLUS |
60 | select ARCH_HAS_OPP | ||
66 | select ARM_CPU_SUSPEND if PM | 61 | select ARM_CPU_SUSPEND if PM |
67 | select CPU_V7 | ||
68 | select MULTI_IRQ_HANDLER | ||
69 | 62 | ||
70 | config SOC_AM43XX | 63 | config SOC_AM43XX |
71 | bool "TI AM43x" | 64 | bool "TI AM43x" |
72 | depends on ARCH_MULTI_V7 | 65 | depends on ARCH_MULTI_V7 |
73 | select CPU_V7 | ||
74 | select ARCH_OMAP2PLUS | 66 | select ARCH_OMAP2PLUS |
75 | select MULTI_IRQ_HANDLER | 67 | select ARCH_HAS_OPP |
76 | select ARM_GIC | 68 | select ARM_GIC |
77 | select MACH_OMAP_GENERIC | 69 | select MACH_OMAP_GENERIC |
78 | 70 | ||
@@ -80,10 +72,9 @@ config SOC_DRA7XX | |||
80 | bool "TI DRA7XX" | 72 | bool "TI DRA7XX" |
81 | depends on ARCH_MULTI_V7 | 73 | depends on ARCH_MULTI_V7 |
82 | select ARCH_OMAP2PLUS | 74 | select ARCH_OMAP2PLUS |
75 | select ARCH_HAS_OPP | ||
83 | select ARM_CPU_SUSPEND if PM | 76 | select ARM_CPU_SUSPEND if PM |
84 | select ARM_GIC | 77 | select ARM_GIC |
85 | select CPU_V7 | ||
86 | select HAVE_SMP | ||
87 | select HAVE_ARM_ARCH_TIMER | 78 | select HAVE_ARM_ARCH_TIMER |
88 | 79 | ||
89 | config ARCH_OMAP2PLUS | 80 | config ARCH_OMAP2PLUS |
@@ -94,17 +85,13 @@ config ARCH_OMAP2PLUS | |||
94 | select ARCH_OMAP | 85 | select ARCH_OMAP |
95 | select ARCH_REQUIRE_GPIOLIB | 86 | select ARCH_REQUIRE_GPIOLIB |
96 | select CLKSRC_MMIO | 87 | select CLKSRC_MMIO |
97 | select COMMON_CLK | ||
98 | select GENERIC_CLOCKEVENTS | ||
99 | select GENERIC_IRQ_CHIP | 88 | select GENERIC_IRQ_CHIP |
100 | select MACH_OMAP_GENERIC | 89 | select MACH_OMAP_GENERIC |
101 | select OMAP_DM_TIMER | 90 | select OMAP_DM_TIMER |
102 | select PINCTRL | 91 | select PINCTRL |
103 | select PROC_DEVICETREE if PROC_FS | 92 | select PROC_DEVICETREE if PROC_FS |
104 | select SOC_BUS | 93 | select SOC_BUS |
105 | select SPARSE_IRQ | ||
106 | select TI_PRIV_EDMA | 94 | select TI_PRIV_EDMA |
107 | select USE_OF | ||
108 | help | 95 | help |
109 | Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 | 96 | Systems based on OMAP2, OMAP3, OMAP4 or OMAP5 |
110 | 97 | ||
@@ -165,12 +152,6 @@ config SOC_TI81XX | |||
165 | depends on ARCH_OMAP3 | 152 | depends on ARCH_OMAP3 |
166 | default y | 153 | default y |
167 | 154 | ||
168 | config OMAP_PACKAGE_ZAF | ||
169 | bool | ||
170 | |||
171 | config OMAP_PACKAGE_ZAC | ||
172 | bool | ||
173 | |||
174 | config OMAP_PACKAGE_CBC | 155 | config OMAP_PACKAGE_CBC |
175 | bool | 156 | bool |
176 | 157 | ||
@@ -268,9 +249,6 @@ config MACH_OMAP_3430SDP | |||
268 | default y | 249 | default y |
269 | select OMAP_PACKAGE_CBB | 250 | select OMAP_PACKAGE_CBB |
270 | 251 | ||
271 | config MACH_NOKIA_N800 | ||
272 | bool | ||
273 | |||
274 | config MACH_NOKIA_N810 | 252 | config MACH_NOKIA_N810 |
275 | bool | 253 | bool |
276 | 254 | ||
@@ -281,10 +259,8 @@ config MACH_NOKIA_N8X0 | |||
281 | bool "Nokia N800/N810" | 259 | bool "Nokia N800/N810" |
282 | depends on SOC_OMAP2420 | 260 | depends on SOC_OMAP2420 |
283 | default y | 261 | default y |
284 | select MACH_NOKIA_N800 | ||
285 | select MACH_NOKIA_N810 | 262 | select MACH_NOKIA_N810 |
286 | select MACH_NOKIA_N810_WIMAX | 263 | select MACH_NOKIA_N810_WIMAX |
287 | select OMAP_PACKAGE_ZAC | ||
288 | 264 | ||
289 | config MACH_NOKIA_RX51 | 265 | config MACH_NOKIA_RX51 |
290 | bool "Nokia N900 (RX-51) phone" | 266 | bool "Nokia N900 (RX-51) phone" |
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index e6eec6f72fd3..8421f38cf445 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -60,6 +60,7 @@ AFLAGS_sram34xx.o :=-Wa,-march=armv7-a | |||
60 | obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o | 60 | obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o |
61 | obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o | 61 | obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o |
62 | obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o | 62 | obj-$(CONFIG_SOC_AM33XX) += am33xx-restart.o |
63 | obj-$(CONFIG_SOC_AM43XX) += omap4-restart.o | ||
63 | obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o | 64 | obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o |
64 | obj-$(CONFIG_ARCH_OMAP4) += omap4-restart.o | 65 | obj-$(CONFIG_ARCH_OMAP4) += omap4-restart.o |
65 | obj-$(CONFIG_SOC_OMAP5) += omap4-restart.o | 66 | obj-$(CONFIG_SOC_OMAP5) += omap4-restart.o |
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 8e3daa11602b..bc6013fbb773 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c | |||
@@ -229,8 +229,9 @@ DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") | |||
229 | .init_late = am43xx_init_late, | 229 | .init_late = am43xx_init_late, |
230 | .init_irq = omap_gic_of_init, | 230 | .init_irq = omap_gic_of_init, |
231 | .init_machine = omap_generic_init, | 231 | .init_machine = omap_generic_init, |
232 | .init_time = omap3_sync32k_timer_init, | 232 | .init_time = omap3_gptimer_timer_init, |
233 | .dt_compat = am43_boards_compat, | 233 | .dt_compat = am43_boards_compat, |
234 | .restart = omap44xx_restart, | ||
234 | MACHINE_END | 235 | MACHINE_END |
235 | #endif | 236 | #endif |
236 | 237 | ||
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 47f9562ca7aa..2649ce445845 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -306,7 +306,7 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, | |||
306 | 306 | ||
307 | ref_rate = __clk_get_rate(dd->clk_ref); | 307 | ref_rate = __clk_get_rate(dd->clk_ref); |
308 | clk_name = __clk_get_name(hw->clk); | 308 | clk_name = __clk_get_name(hw->clk); |
309 | pr_debug("clock: %s: starting DPLL round_rate, target rate %ld\n", | 309 | pr_debug("clock: %s: starting DPLL round_rate, target rate %lu\n", |
310 | clk_name, target_rate); | 310 | clk_name, target_rate); |
311 | 311 | ||
312 | scaled_rt_rp = target_rate / (ref_rate / DPLL_SCALE_FACTOR); | 312 | scaled_rt_rp = target_rate / (ref_rate / DPLL_SCALE_FACTOR); |
@@ -342,7 +342,7 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, | |||
342 | if (r == DPLL_MULT_UNDERFLOW) | 342 | if (r == DPLL_MULT_UNDERFLOW) |
343 | continue; | 343 | continue; |
344 | 344 | ||
345 | pr_debug("clock: %s: m = %d: n = %d: new_rate = %ld\n", | 345 | pr_debug("clock: %s: m = %d: n = %d: new_rate = %lu\n", |
346 | clk_name, m, n, new_rate); | 346 | clk_name, m, n, new_rate); |
347 | 347 | ||
348 | if (target_rate == new_rate) { | 348 | if (target_rate == new_rate) { |
@@ -354,7 +354,7 @@ long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate, | |||
354 | } | 354 | } |
355 | 355 | ||
356 | if (target_rate != new_rate) { | 356 | if (target_rate != new_rate) { |
357 | pr_debug("clock: %s: cannot round to rate %ld\n", | 357 | pr_debug("clock: %s: cannot round to rate %lu\n", |
358 | clk_name, target_rate); | 358 | clk_name, target_rate); |
359 | return ~0; | 359 | return ~0; |
360 | } | 360 | } |
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index 731ca134348c..f5c4731b6f06 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c | |||
@@ -254,6 +254,11 @@ void omap4_cminst_clkdm_force_wakeup(u8 part, u16 inst, u16 cdoffs) | |||
254 | * | 254 | * |
255 | */ | 255 | */ |
256 | 256 | ||
257 | void omap4_cminst_clkdm_force_sleep(u8 part, u16 inst, u16 cdoffs) | ||
258 | { | ||
259 | _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs); | ||
260 | } | ||
261 | |||
257 | /** | 262 | /** |
258 | * omap4_cminst_wait_module_ready - wait for a module to be in 'func' state | 263 | * omap4_cminst_wait_module_ready - wait for a module to be in 'func' state |
259 | * @part: PRCM partition ID that the CM_CLKCTRL register exists in | 264 | * @part: PRCM partition ID that the CM_CLKCTRL register exists in |
@@ -404,8 +409,17 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) | |||
404 | 409 | ||
405 | static int omap4_clkdm_sleep(struct clockdomain *clkdm) | 410 | static int omap4_clkdm_sleep(struct clockdomain *clkdm) |
406 | { | 411 | { |
407 | omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, | 412 | if (clkdm->flags & CLKDM_CAN_HWSUP) |
408 | clkdm->cm_inst, clkdm->clkdm_offs); | 413 | omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, |
414 | clkdm->cm_inst, | ||
415 | clkdm->clkdm_offs); | ||
416 | else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP) | ||
417 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, | ||
418 | clkdm->cm_inst, | ||
419 | clkdm->clkdm_offs); | ||
420 | else | ||
421 | return -EINVAL; | ||
422 | |||
409 | return 0; | 423 | return 0; |
410 | } | 424 | } |
411 | 425 | ||
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index 3185ced807c9..d9bcbf7641b5 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -525,7 +525,7 @@ int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate, | |||
525 | * stuff is inherited for free | 525 | * stuff is inherited for free |
526 | */ | 526 | */ |
527 | 527 | ||
528 | if (!ret) | 528 | if (!ret && clk_get_parent(hw->clk) != new_parent) |
529 | __clk_reparent(hw->clk, new_parent); | 529 | __clk_reparent(hw->clk, new_parent); |
530 | 530 | ||
531 | return 0; | 531 | return 0; |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index d24926e6340f..ab43755364f5 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -1339,7 +1339,7 @@ static void __maybe_unused gpmc_read_timings_dt(struct device_node *np, | |||
1339 | of_property_read_bool(np, "gpmc,time-para-granularity"); | 1339 | of_property_read_bool(np, "gpmc,time-para-granularity"); |
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | #ifdef CONFIG_MTD_NAND | 1342 | #if IS_ENABLED(CONFIG_MTD_NAND) |
1343 | 1343 | ||
1344 | static const char * const nand_xfer_types[] = { | 1344 | static const char * const nand_xfer_types[] = { |
1345 | [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled", | 1345 | [NAND_OMAP_PREFETCH_POLLED] = "prefetch-polled", |
@@ -1429,7 +1429,7 @@ static int gpmc_probe_nand_child(struct platform_device *pdev, | |||
1429 | } | 1429 | } |
1430 | #endif | 1430 | #endif |
1431 | 1431 | ||
1432 | #ifdef CONFIG_MTD_ONENAND | 1432 | #if IS_ENABLED(CONFIG_MTD_ONENAND) |
1433 | static int gpmc_probe_onenand_child(struct platform_device *pdev, | 1433 | static int gpmc_probe_onenand_child(struct platform_device *pdev, |
1434 | struct device_node *child) | 1434 | struct device_node *child) |
1435 | { | 1435 | { |
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 9428c5f9d4f2..157412e4273a 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -465,8 +465,18 @@ void __init omap3xxx_check_revision(void) | |||
465 | } | 465 | } |
466 | break; | 466 | break; |
467 | case 0xb98c: | 467 | case 0xb98c: |
468 | omap_revision = AM437X_REV_ES1_0; | 468 | switch (rev) { |
469 | cpu_rev = "1.0"; | 469 | case 0: |
470 | omap_revision = AM437X_REV_ES1_0; | ||
471 | cpu_rev = "1.0"; | ||
472 | break; | ||
473 | case 1: | ||
474 | /* FALLTHROUGH */ | ||
475 | default: | ||
476 | omap_revision = AM437X_REV_ES1_1; | ||
477 | cpu_rev = "1.1"; | ||
478 | break; | ||
479 | } | ||
470 | break; | 480 | break; |
471 | case 0xb8f2: | 481 | case 0xb8f2: |
472 | switch (rev) { | 482 | switch (rev) { |
@@ -657,6 +667,8 @@ static const char * __init omap_get_family(void) | |||
657 | return kasprintf(GFP_KERNEL, "OMAP4"); | 667 | return kasprintf(GFP_KERNEL, "OMAP4"); |
658 | else if (soc_is_omap54xx()) | 668 | else if (soc_is_omap54xx()) |
659 | return kasprintf(GFP_KERNEL, "OMAP5"); | 669 | return kasprintf(GFP_KERNEL, "OMAP5"); |
670 | else if (soc_is_am43xx()) | ||
671 | return kasprintf(GFP_KERNEL, "AM43xx"); | ||
660 | else | 672 | else |
661 | return kasprintf(GFP_KERNEL, "Unknown"); | 673 | return kasprintf(GFP_KERNEL, "Unknown"); |
662 | } | 674 | } |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index d408b15b4fbf..f14f9ac2dca1 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -179,15 +179,6 @@ static struct map_desc omap34xx_io_desc[] __initdata = { | |||
179 | .length = L4_EMU_34XX_SIZE, | 179 | .length = L4_EMU_34XX_SIZE, |
180 | .type = MT_DEVICE | 180 | .type = MT_DEVICE |
181 | }, | 181 | }, |
182 | #if defined(CONFIG_DEBUG_LL) && \ | ||
183 | (defined(CONFIG_MACH_OMAP_ZOOM2) || defined(CONFIG_MACH_OMAP_ZOOM3)) | ||
184 | { | ||
185 | .virtual = ZOOM_UART_VIRT, | ||
186 | .pfn = __phys_to_pfn(ZOOM_UART_BASE), | ||
187 | .length = SZ_1M, | ||
188 | .type = MT_DEVICE | ||
189 | }, | ||
190 | #endif | ||
191 | }; | 182 | }; |
192 | #endif | 183 | #endif |
193 | 184 | ||
@@ -613,6 +604,7 @@ void __init am43xx_init_early(void) | |||
613 | omap_prm_base_init(); | 604 | omap_prm_base_init(); |
614 | omap_cm_base_init(); | 605 | omap_cm_base_init(); |
615 | omap3xxx_check_revision(); | 606 | omap3xxx_check_revision(); |
607 | am33xx_check_features(); | ||
616 | am43xx_powerdomains_init(); | 608 | am43xx_powerdomains_init(); |
617 | am43xx_clockdomains_init(); | 609 | am43xx_clockdomains_init(); |
618 | am43xx_hwmod_init(); | 610 | am43xx_hwmod_init(); |
diff --git a/arch/arm/mach-omap2/mux.h b/arch/arm/mach-omap2/mux.h index a722330d4d53..d121fb6df4e6 100644 --- a/arch/arm/mach-omap2/mux.h +++ b/arch/arm/mach-omap2/mux.h | |||
@@ -63,9 +63,6 @@ | |||
63 | #define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */ | 63 | #define OMAP_PACKAGE_CUS 5 /* 423-pin 0.65 */ |
64 | #define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */ | 64 | #define OMAP_PACKAGE_CBB 4 /* 515-pin 0.40 0.50 */ |
65 | #define OMAP_PACKAGE_CBC 3 /* 515-pin 0.50 0.65 */ | 65 | #define OMAP_PACKAGE_CBC 3 /* 515-pin 0.50 0.65 */ |
66 | #define OMAP_PACKAGE_ZAC 2 /* 24xx 447-pin POP */ | ||
67 | #define OMAP_PACKAGE_ZAF 1 /* 2420 447-pin SIP */ | ||
68 | |||
69 | 66 | ||
70 | #define OMAP_MUX_NR_MODES 8 /* Available modes */ | 67 | #define OMAP_MUX_NR_MODES 8 /* Available modes */ |
71 | #define OMAP_MUX_NR_SIDES 2 /* Bottom & top */ | 68 | #define OMAP_MUX_NR_SIDES 2 /* Bottom & top */ |
diff --git a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c index 9002fca76699..5c2cc8083fdd 100644 --- a/arch/arm/mach-omap2/omap_hwmod_43xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_43xx_data.c | |||
@@ -719,6 +719,7 @@ static struct omap_hwmod_ocp_if *am43xx_hwmod_ocp_ifs[] __initdata = { | |||
719 | &am33xx_l4_ls__uart4, | 719 | &am33xx_l4_ls__uart4, |
720 | &am33xx_l4_ls__uart5, | 720 | &am33xx_l4_ls__uart5, |
721 | &am33xx_l4_ls__uart6, | 721 | &am33xx_l4_ls__uart6, |
722 | &am33xx_l4_ls__spinlock, | ||
722 | &am33xx_l4_ls__elm, | 723 | &am33xx_l4_ls__elm, |
723 | &am33xx_l4_ls__epwmss0, | 724 | &am33xx_l4_ls__epwmss0, |
724 | &am33xx_epwmss0__ecap0, | 725 | &am33xx_epwmss0__ecap0, |
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c index 6334b96b4097..f5989f2af89f 100644 --- a/arch/arm/mach-omap2/prminst44xx.c +++ b/arch/arm/mach-omap2/prminst44xx.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "prminst44xx.h" | 25 | #include "prminst44xx.h" |
26 | #include "prm-regbits-44xx.h" | 26 | #include "prm-regbits-44xx.h" |
27 | #include "prcm44xx.h" | 27 | #include "prcm44xx.h" |
28 | #include "prcm43xx.h" | ||
28 | #include "prcm_mpu44xx.h" | 29 | #include "prcm_mpu44xx.h" |
29 | #include "soc.h" | 30 | #include "soc.h" |
30 | 31 | ||
@@ -176,6 +177,8 @@ void omap4_prminst_global_warm_sw_reset(void) | |||
176 | dev_inst = OMAP54XX_PRM_DEVICE_INST; | 177 | dev_inst = OMAP54XX_PRM_DEVICE_INST; |
177 | else if (soc_is_dra7xx()) | 178 | else if (soc_is_dra7xx()) |
178 | dev_inst = DRA7XX_PRM_DEVICE_INST; | 179 | dev_inst = DRA7XX_PRM_DEVICE_INST; |
180 | else if (soc_is_am43xx()) | ||
181 | dev_inst = AM43XX_PRM_DEVICE_INST; | ||
179 | else | 182 | else |
180 | return; | 183 | return; |
181 | 184 | ||
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h index 076bd90a6ce0..30abcc8b20e0 100644 --- a/arch/arm/mach-omap2/soc.h +++ b/arch/arm/mach-omap2/soc.h | |||
@@ -438,7 +438,8 @@ IS_OMAP_TYPE(3430, 0x3430) | |||
438 | #define AM335X_REV_ES2_1 (AM335X_CLASS | (0x2 << 8)) | 438 | #define AM335X_REV_ES2_1 (AM335X_CLASS | (0x2 << 8)) |
439 | 439 | ||
440 | #define AM437X_CLASS 0x43700000 | 440 | #define AM437X_CLASS 0x43700000 |
441 | #define AM437X_REV_ES1_0 AM437X_CLASS | 441 | #define AM437X_REV_ES1_0 (AM437X_CLASS | (0x10 << 8)) |
442 | #define AM437X_REV_ES1_1 (AM437X_CLASS | (0x11 << 8)) | ||
442 | 443 | ||
443 | #define OMAP443X_CLASS 0x44300044 | 444 | #define OMAP443X_CLASS 0x44300044 |
444 | #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) | 445 | #define OMAP4430_REV_ES1_0 (OMAP443X_CLASS | (0x10 << 8)) |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 74044aaf438b..b62de9f9d05c 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -604,7 +604,8 @@ OMAP_SYS_32K_TIMER_INIT(3_secure, 12, "secure_32k_fck", "ti,timer-secure", | |||
604 | 2, "timer_sys_ck", NULL); | 604 | 2, "timer_sys_ck", NULL); |
605 | #endif /* CONFIG_ARCH_OMAP3 */ | 605 | #endif /* CONFIG_ARCH_OMAP3 */ |
606 | 606 | ||
607 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) | 607 | #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_SOC_AM33XX) || \ |
608 | defined(CONFIG_SOC_AM43XX) | ||
608 | OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL, | 609 | OMAP_SYS_GP_TIMER_INIT(3, 2, "timer_sys_ck", NULL, |
609 | 1, "timer_sys_ck", "ti,timer-alwon"); | 610 | 1, "timer_sys_ck", "ti,timer-alwon"); |
610 | #endif | 611 | #endif |
diff --git a/arch/arm/mach-picoxcell/Kconfig b/arch/arm/mach-picoxcell/Kconfig index b1022f4315f7..eca9eb1c5931 100644 --- a/arch/arm/mach-picoxcell/Kconfig +++ b/arch/arm/mach-picoxcell/Kconfig | |||
@@ -1,12 +1,7 @@ | |||
1 | config ARCH_PICOXCELL | 1 | config ARCH_PICOXCELL |
2 | bool "Picochip PicoXcell" if ARCH_MULTI_V6 | 2 | bool "Picochip PicoXcell" if ARCH_MULTI_V6 |
3 | select ARCH_REQUIRE_GPIOLIB | 3 | select ARCH_REQUIRE_GPIOLIB |
4 | select ARM_PATCH_PHYS_VIRT | ||
5 | select ARM_VIC | 4 | select ARM_VIC |
6 | select CPU_V6K | ||
7 | select DW_APB_TIMER_OF | 5 | select DW_APB_TIMER_OF |
8 | select GENERIC_CLOCKEVENTS | ||
9 | select HAVE_TCM | 6 | select HAVE_TCM |
10 | select NO_IOPORT | 7 | select NO_IOPORT |
11 | select SPARSE_IRQ | ||
12 | select USE_OF | ||
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig index 6988b117fc17..2c726b4f9356 100644 --- a/arch/arm/mach-prima2/Kconfig +++ b/arch/arm/mach-prima2/Kconfig | |||
@@ -1,9 +1,7 @@ | |||
1 | config ARCH_SIRF | 1 | config ARCH_SIRF |
2 | bool "CSR SiRF" if ARCH_MULTI_V7 | 2 | bool "CSR SiRF" if ARCH_MULTI_V7 |
3 | select ARCH_REQUIRE_GPIOLIB | 3 | select ARCH_REQUIRE_GPIOLIB |
4 | select GENERIC_CLOCKEVENTS | ||
5 | select GENERIC_IRQ_CHIP | 4 | select GENERIC_IRQ_CHIP |
6 | select MIGHT_HAVE_CACHE_L2X0 | ||
7 | select NO_IOPORT | 5 | select NO_IOPORT |
8 | select PINCTRL | 6 | select PINCTRL |
9 | select PINCTRL_SIRF | 7 | select PINCTRL_SIRF |
@@ -17,7 +15,6 @@ menu "CSR SiRF atlas6/primaII/Marco/Polo Specific Features" | |||
17 | config ARCH_ATLAS6 | 15 | config ARCH_ATLAS6 |
18 | bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" | 16 | bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" |
19 | default y | 17 | default y |
20 | select CPU_V7 | ||
21 | select SIRF_IRQ | 18 | select SIRF_IRQ |
22 | help | 19 | help |
23 | Support for CSR SiRFSoC ARM Cortex A9 Platform | 20 | Support for CSR SiRFSoC ARM Cortex A9 Platform |
@@ -25,7 +22,6 @@ config ARCH_ATLAS6 | |||
25 | config ARCH_PRIMA2 | 22 | config ARCH_PRIMA2 |
26 | bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" | 23 | bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" |
27 | default y | 24 | default y |
28 | select CPU_V7 | ||
29 | select SIRF_IRQ | 25 | select SIRF_IRQ |
30 | select ZONE_DMA | 26 | select ZONE_DMA |
31 | help | 27 | help |
@@ -35,9 +31,7 @@ config ARCH_MARCO | |||
35 | bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform" | 31 | bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform" |
36 | default y | 32 | default y |
37 | select ARM_GIC | 33 | select ARM_GIC |
38 | select CPU_V7 | ||
39 | select HAVE_ARM_SCU if SMP | 34 | select HAVE_ARM_SCU if SMP |
40 | select HAVE_SMP | ||
41 | select SMP_ON_UP if SMP | 35 | select SMP_ON_UP if SMP |
42 | help | 36 | help |
43 | Support for CSR SiRFSoC ARM Cortex A9 Platform | 37 | Support for CSR SiRFSoC ARM Cortex A9 Platform |
diff --git a/arch/arm/mach-pxa/am300epd.c b/arch/arm/mach-pxa/am300epd.c index c9f309ae88c5..8b90c4f2d430 100644 --- a/arch/arm/mach-pxa/am300epd.c +++ b/arch/arm/mach-pxa/am300epd.c | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | #include <mach/gumstix.h> | 31 | #include <mach/gumstix.h> |
32 | #include <mach/mfp-pxa25x.h> | 32 | #include <mach/mfp-pxa25x.h> |
33 | #include <mach/irqs.h> | ||
33 | #include <linux/platform_data/video-pxafb.h> | 34 | #include <linux/platform_data/video-pxafb.h> |
34 | 35 | ||
35 | #include "generic.h" | 36 | #include "generic.h" |
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h index 954641e6c8b1..1b0825911e62 100644 --- a/arch/arm/mach-pxa/include/mach/balloon3.h +++ b/arch/arm/mach-pxa/include/mach/balloon3.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef ASM_ARCH_BALLOON3_H | 14 | #ifndef ASM_ARCH_BALLOON3_H |
15 | #define ASM_ARCH_BALLOON3_H | 15 | #define ASM_ARCH_BALLOON3_H |
16 | 16 | ||
17 | #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ | ||
18 | |||
17 | enum balloon3_features { | 19 | enum balloon3_features { |
18 | BALLOON3_FEATURE_OHCI, | 20 | BALLOON3_FEATURE_OHCI, |
19 | BALLOON3_FEATURE_MMC, | 21 | BALLOON3_FEATURE_MMC, |
diff --git a/arch/arm/mach-pxa/include/mach/corgi.h b/arch/arm/mach-pxa/include/mach/corgi.h index f3c3493b468d..c030d955bbd7 100644 --- a/arch/arm/mach-pxa/include/mach/corgi.h +++ b/arch/arm/mach-pxa/include/mach/corgi.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_CORGI_H | 13 | #ifndef __ASM_ARCH_CORGI_H |
14 | #define __ASM_ARCH_CORGI_H 1 | 14 | #define __ASM_ARCH_CORGI_H 1 |
15 | 15 | ||
16 | #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ | ||
16 | 17 | ||
17 | /* | 18 | /* |
18 | * Corgi (Non Standard) GPIO Definitions | 19 | * Corgi (Non Standard) GPIO Definitions |
diff --git a/arch/arm/mach-pxa/include/mach/csb726.h b/arch/arm/mach-pxa/include/mach/csb726.h index 2628e7b72116..00cfbbbf73f7 100644 --- a/arch/arm/mach-pxa/include/mach/csb726.h +++ b/arch/arm/mach-pxa/include/mach/csb726.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef CSB726_H | 11 | #ifndef CSB726_H |
12 | #define CSB726_H | 12 | #define CSB726_H |
13 | 13 | ||
14 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
15 | |||
14 | #define CSB726_GPIO_IRQ_LAN 52 | 16 | #define CSB726_GPIO_IRQ_LAN 52 |
15 | #define CSB726_GPIO_IRQ_SM501 53 | 17 | #define CSB726_GPIO_IRQ_SM501 53 |
16 | #define CSB726_GPIO_MMC_DETECT 100 | 18 | #define CSB726_GPIO_MMC_DETECT 100 |
diff --git a/arch/arm/mach-pxa/include/mach/gumstix.h b/arch/arm/mach-pxa/include/mach/gumstix.h index dba14b6503ad..f7df27bbb42e 100644 --- a/arch/arm/mach-pxa/include/mach/gumstix.h +++ b/arch/arm/mach-pxa/include/mach/gumstix.h | |||
@@ -6,6 +6,7 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
9 | 10 | ||
10 | /* BTRESET - Reset line to Bluetooth module, active low signal. */ | 11 | /* BTRESET - Reset line to Bluetooth module, active low signal. */ |
11 | #define GPIO_GUMSTIX_BTRESET 7 | 12 | #define GPIO_GUMSTIX_BTRESET 7 |
diff --git a/arch/arm/mach-pxa/include/mach/idp.h b/arch/arm/mach-pxa/include/mach/idp.h index 22a96f87232b..7e63f4680271 100644 --- a/arch/arm/mach-pxa/include/mach/idp.h +++ b/arch/arm/mach-pxa/include/mach/idp.h | |||
@@ -23,6 +23,7 @@ | |||
23 | * IDP hardware. | 23 | * IDP hardware. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
26 | 27 | ||
27 | #define IDP_FLASH_PHYS (PXA_CS0_PHYS) | 28 | #define IDP_FLASH_PHYS (PXA_CS0_PHYS) |
28 | #define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS) | 29 | #define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS) |
diff --git a/arch/arm/mach-pxa/include/mach/palmld.h b/arch/arm/mach-pxa/include/mach/palmld.h index 2c4471336570..b184f296023b 100644 --- a/arch/arm/mach-pxa/include/mach/palmld.h +++ b/arch/arm/mach-pxa/include/mach/palmld.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef _INCLUDE_PALMLD_H_ | 13 | #ifndef _INCLUDE_PALMLD_H_ |
14 | #define _INCLUDE_PALMLD_H_ | 14 | #define _INCLUDE_PALMLD_H_ |
15 | 15 | ||
16 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
17 | |||
16 | /** HERE ARE GPIOs **/ | 18 | /** HERE ARE GPIOs **/ |
17 | 19 | ||
18 | /* GPIOs */ | 20 | /* GPIOs */ |
diff --git a/arch/arm/mach-pxa/include/mach/palmt5.h b/arch/arm/mach-pxa/include/mach/palmt5.h index 0bd4f036c72f..e342c5921405 100644 --- a/arch/arm/mach-pxa/include/mach/palmt5.h +++ b/arch/arm/mach-pxa/include/mach/palmt5.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef _INCLUDE_PALMT5_H_ | 15 | #ifndef _INCLUDE_PALMT5_H_ |
16 | #define _INCLUDE_PALMT5_H_ | 16 | #define _INCLUDE_PALMT5_H_ |
17 | 17 | ||
18 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
19 | |||
18 | /** HERE ARE GPIOs **/ | 20 | /** HERE ARE GPIOs **/ |
19 | 21 | ||
20 | /* GPIOs */ | 22 | /* GPIOs */ |
diff --git a/arch/arm/mach-pxa/include/mach/palmtc.h b/arch/arm/mach-pxa/include/mach/palmtc.h index c383a21680b6..81c727b3cfd2 100644 --- a/arch/arm/mach-pxa/include/mach/palmtc.h +++ b/arch/arm/mach-pxa/include/mach/palmtc.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #ifndef _INCLUDE_PALMTC_H_ | 16 | #ifndef _INCLUDE_PALMTC_H_ |
17 | #define _INCLUDE_PALMTC_H_ | 17 | #define _INCLUDE_PALMTC_H_ |
18 | 18 | ||
19 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
20 | |||
19 | /** HERE ARE GPIOs **/ | 21 | /** HERE ARE GPIOs **/ |
20 | 22 | ||
21 | /* GPIOs */ | 23 | /* GPIOs */ |
diff --git a/arch/arm/mach-pxa/include/mach/palmtx.h b/arch/arm/mach-pxa/include/mach/palmtx.h index f2e530380253..92bc1f05300d 100644 --- a/arch/arm/mach-pxa/include/mach/palmtx.h +++ b/arch/arm/mach-pxa/include/mach/palmtx.h | |||
@@ -16,6 +16,8 @@ | |||
16 | #ifndef _INCLUDE_PALMTX_H_ | 16 | #ifndef _INCLUDE_PALMTX_H_ |
17 | #define _INCLUDE_PALMTX_H_ | 17 | #define _INCLUDE_PALMTX_H_ |
18 | 18 | ||
19 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
20 | |||
19 | /** HERE ARE GPIOs **/ | 21 | /** HERE ARE GPIOs **/ |
20 | 22 | ||
21 | /* GPIOs */ | 23 | /* GPIOs */ |
diff --git a/arch/arm/mach-pxa/include/mach/pcm027.h b/arch/arm/mach-pxa/include/mach/pcm027.h index 6bf28de228bd..86ebd7b6c960 100644 --- a/arch/arm/mach-pxa/include/mach/pcm027.h +++ b/arch/arm/mach-pxa/include/mach/pcm027.h | |||
@@ -23,6 +23,8 @@ | |||
23 | * Definitions of CPU card resources only | 23 | * Definitions of CPU card resources only |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
27 | |||
26 | /* phyCORE-PXA270 (PCM027) Interrupts */ | 28 | /* phyCORE-PXA270 (PCM027) Interrupts */ |
27 | #define PCM027_IRQ(x) (IRQ_BOARD_START + (x)) | 29 | #define PCM027_IRQ(x) (IRQ_BOARD_START + (x)) |
28 | #define PCM027_BTDET_IRQ PCM027_IRQ(0) | 30 | #define PCM027_BTDET_IRQ PCM027_IRQ(0) |
diff --git a/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h b/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h index 0260aaa2fc17..7e544c14967e 100644 --- a/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h +++ b/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h | |||
@@ -20,6 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <mach/pcm027.h> | 22 | #include <mach/pcm027.h> |
23 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
23 | 24 | ||
24 | /* | 25 | /* |
25 | * definitions relevant only when the PCM-990 | 26 | * definitions relevant only when the PCM-990 |
diff --git a/arch/arm/mach-pxa/include/mach/poodle.h b/arch/arm/mach-pxa/include/mach/poodle.h index f32ff75dcca8..b56b19351a03 100644 --- a/arch/arm/mach-pxa/include/mach/poodle.h +++ b/arch/arm/mach-pxa/include/mach/poodle.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __ASM_ARCH_POODLE_H | 15 | #ifndef __ASM_ARCH_POODLE_H |
16 | #define __ASM_ARCH_POODLE_H 1 | 16 | #define __ASM_ARCH_POODLE_H 1 |
17 | 17 | ||
18 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
19 | |||
18 | /* | 20 | /* |
19 | * GPIOs | 21 | * GPIOs |
20 | */ | 22 | */ |
diff --git a/arch/arm/mach-pxa/include/mach/spitz.h b/arch/arm/mach-pxa/include/mach/spitz.h index 0bfe6507c95d..25c9f62e46aa 100644 --- a/arch/arm/mach-pxa/include/mach/spitz.h +++ b/arch/arm/mach-pxa/include/mach/spitz.h | |||
@@ -15,8 +15,8 @@ | |||
15 | #define __ASM_ARCH_SPITZ_H 1 | 15 | #define __ASM_ARCH_SPITZ_H 1 |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | #include "irqs.h" /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */ | ||
18 | #include <linux/fb.h> | 19 | #include <linux/fb.h> |
19 | #include <linux/gpio.h> | ||
20 | 20 | ||
21 | /* Spitz/Akita GPIOs */ | 21 | /* Spitz/Akita GPIOs */ |
22 | 22 | ||
diff --git a/arch/arm/mach-pxa/include/mach/tosa.h b/arch/arm/mach-pxa/include/mach/tosa.h index 2bb0e862598c..0497d95cef25 100644 --- a/arch/arm/mach-pxa/include/mach/tosa.h +++ b/arch/arm/mach-pxa/include/mach/tosa.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef _ASM_ARCH_TOSA_H_ | 13 | #ifndef _ASM_ARCH_TOSA_H_ |
14 | #define _ASM_ARCH_TOSA_H_ 1 | 14 | #define _ASM_ARCH_TOSA_H_ 1 |
15 | 15 | ||
16 | #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ | ||
17 | |||
16 | /* TOSA Chip selects */ | 18 | /* TOSA Chip selects */ |
17 | #define TOSA_LCDC_PHYS PXA_CS4_PHYS | 19 | #define TOSA_LCDC_PHYS PXA_CS4_PHYS |
18 | /* Internel Scoop */ | 20 | /* Internel Scoop */ |
diff --git a/arch/arm/mach-pxa/include/mach/trizeps4.h b/arch/arm/mach-pxa/include/mach/trizeps4.h index d2ca01053f69..ae3ca013afab 100644 --- a/arch/arm/mach-pxa/include/mach/trizeps4.h +++ b/arch/arm/mach-pxa/include/mach/trizeps4.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef _TRIPEPS4_H_ | 10 | #ifndef _TRIPEPS4_H_ |
11 | #define _TRIPEPS4_H_ | 11 | #define _TRIPEPS4_H_ |
12 | 12 | ||
13 | #include "irqs.h" /* PXA_GPIO_TO_IRQ */ | ||
14 | |||
13 | /* physical memory regions */ | 15 | /* physical memory regions */ |
14 | #define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */ | 16 | #define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */ |
15 | #define TRIZEPS4_DISK_PHYS (PXA_CS1_PHYS) /* Disk On Chip region */ | 17 | #define TRIZEPS4_DISK_PHYS (PXA_CS1_PHYS) /* Disk On Chip region */ |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index f70583fee59f..29997bde277d 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/mtd/physmap.h> | 38 | #include <linux/mtd/physmap.h> |
39 | #include <linux/usb/gpio_vbus.h> | 39 | #include <linux/usb/gpio_vbus.h> |
40 | #include <linux/reboot.h> | 40 | #include <linux/reboot.h> |
41 | #include <linux/regulator/fixed.h> | ||
41 | #include <linux/regulator/max1586.h> | 42 | #include <linux/regulator/max1586.h> |
42 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
43 | #include <linux/i2c/pxa-i2c.h> | 44 | #include <linux/i2c/pxa-i2c.h> |
@@ -714,6 +715,10 @@ static struct gpio global_gpios[] = { | |||
714 | { GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" }, | 715 | { GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" }, |
715 | }; | 716 | }; |
716 | 717 | ||
718 | static struct regulator_consumer_supply fixed_5v0_consumers[] = { | ||
719 | REGULATOR_SUPPLY("power", "pwm-backlight"), | ||
720 | }; | ||
721 | |||
717 | static void __init mioa701_machine_init(void) | 722 | static void __init mioa701_machine_init(void) |
718 | { | 723 | { |
719 | int rc; | 724 | int rc; |
@@ -753,6 +758,10 @@ static void __init mioa701_machine_init(void) | |||
753 | pxa_set_i2c_info(&i2c_pdata); | 758 | pxa_set_i2c_info(&i2c_pdata); |
754 | pxa27x_set_i2c_power_info(NULL); | 759 | pxa27x_set_i2c_power_info(NULL); |
755 | pxa_set_camera_info(&mioa701_pxacamera_platform_data); | 760 | pxa_set_camera_info(&mioa701_pxacamera_platform_data); |
761 | |||
762 | regulator_register_always_on(0, "fixed-5.0V", fixed_5v0_consumers, | ||
763 | ARRAY_SIZE(fixed_5v0_consumers), | ||
764 | 5000000); | ||
756 | } | 765 | } |
757 | 766 | ||
758 | static void mioa701_machine_exit(void) | 767 | static void mioa701_machine_exit(void) |
diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig new file mode 100644 index 000000000000..a028be234334 --- /dev/null +++ b/arch/arm/mach-qcom/Kconfig | |||
@@ -0,0 +1,33 @@ | |||
1 | config ARCH_QCOM | ||
2 | bool "Qualcomm Support" if ARCH_MULTI_V7 | ||
3 | select ARCH_REQUIRE_GPIOLIB | ||
4 | select ARM_GIC | ||
5 | select CLKSRC_OF | ||
6 | select GENERIC_CLOCKEVENTS | ||
7 | select HAVE_SMP | ||
8 | select QCOM_SCM if SMP | ||
9 | help | ||
10 | Support for Qualcomm's devicetree based systems. | ||
11 | |||
12 | if ARCH_QCOM | ||
13 | |||
14 | menu "Qualcomm SoC Selection" | ||
15 | |||
16 | config ARCH_MSM8X60 | ||
17 | bool "Enable support for MSM8X60" | ||
18 | select CLKSRC_QCOM | ||
19 | |||
20 | config ARCH_MSM8960 | ||
21 | bool "Enable support for MSM8960" | ||
22 | select CLKSRC_QCOM | ||
23 | |||
24 | config ARCH_MSM8974 | ||
25 | bool "Enable support for MSM8974" | ||
26 | select HAVE_ARM_ARCH_TIMER | ||
27 | |||
28 | endmenu | ||
29 | |||
30 | config QCOM_SCM | ||
31 | bool | ||
32 | |||
33 | endif | ||
diff --git a/arch/arm/mach-qcom/Makefile b/arch/arm/mach-qcom/Makefile new file mode 100644 index 000000000000..8f756ae1ae31 --- /dev/null +++ b/arch/arm/mach-qcom/Makefile | |||
@@ -0,0 +1,5 @@ | |||
1 | obj-y := board.o | ||
2 | obj-$(CONFIG_SMP) += platsmp.o | ||
3 | obj-$(CONFIG_QCOM_SCM) += scm.o scm-boot.o | ||
4 | |||
5 | CFLAGS_scm.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1) | ||
diff --git a/arch/arm/mach-msm/board-dt.c b/arch/arm/mach-qcom/board.c index 1f11d93e700e..bae617ef0b31 100644 --- a/arch/arm/mach-msm/board-dt.c +++ b/arch/arm/mach-qcom/board.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright (c) 2010-2012,2013 The Linux Foundation. All rights reserved. | 1 | /* Copyright (c) 2010-2014 The Linux Foundation. All rights reserved. |
2 | * | 2 | * |
3 | * This program is free software; you can redistribute it and/or modify | 3 | * This program is free software; you can redistribute it and/or modify |
4 | * it under the terms of the GNU General Public License version 2 and | 4 | * it under the terms of the GNU General Public License version 2 and |
@@ -11,31 +11,16 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/of.h> | ||
15 | #include <linux/of_platform.h> | ||
16 | 14 | ||
17 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
18 | #include <asm/mach/map.h> | ||
19 | 16 | ||
20 | #include "common.h" | 17 | static const char * const qcom_dt_match[] __initconst = { |
21 | |||
22 | static const char * const msm_dt_match[] __initconst = { | ||
23 | "qcom,msm8660-fluid", | ||
24 | "qcom,msm8660-surf", | 18 | "qcom,msm8660-surf", |
25 | "qcom,msm8960-cdp", | 19 | "qcom,msm8960-cdp", |
26 | NULL | ||
27 | }; | ||
28 | |||
29 | static const char * const apq8074_dt_match[] __initconst = { | ||
30 | "qcom,apq8074-dragonboard", | 20 | "qcom,apq8074-dragonboard", |
31 | NULL | 21 | NULL |
32 | }; | 22 | }; |
33 | 23 | ||
34 | DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") | 24 | DT_MACHINE_START(QCOM_DT, "Qualcomm (Flattened Device Tree)") |
35 | .smp = smp_ops(msm_smp_ops), | 25 | .dt_compat = qcom_dt_match, |
36 | .dt_compat = msm_dt_match, | ||
37 | MACHINE_END | ||
38 | |||
39 | DT_MACHINE_START(APQ_DT, "Qualcomm MSM (Flattened Device Tree)") | ||
40 | .dt_compat = apq8074_dt_match, | ||
41 | MACHINE_END | 26 | MACHINE_END |
diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c new file mode 100644 index 000000000000..d6908569ecaf --- /dev/null +++ b/arch/arm/mach-qcom/platsmp.c | |||
@@ -0,0 +1,378 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 ARM Ltd. | ||
3 | * All Rights Reserved | ||
4 | * Copyright (c) 2010, Code Aurora Forum. All rights reserved. | ||
5 | * Copyright (c) 2014 The Linux Foundation. All rights reserved. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/init.h> | ||
13 | #include <linux/errno.h> | ||
14 | #include <linux/delay.h> | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/of.h> | ||
17 | #include <linux/of_address.h> | ||
18 | #include <linux/smp.h> | ||
19 | #include <linux/io.h> | ||
20 | |||
21 | #include <asm/smp_plat.h> | ||
22 | |||
23 | #include "scm-boot.h" | ||
24 | |||
25 | #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x35a0 | ||
26 | #define SCSS_CPU1CORE_RESET 0x2d80 | ||
27 | #define SCSS_DBG_STATUS_CORE_PWRDUP 0x2e64 | ||
28 | |||
29 | #define APCS_CPU_PWR_CTL 0x04 | ||
30 | #define PLL_CLAMP BIT(8) | ||
31 | #define CORE_PWRD_UP BIT(7) | ||
32 | #define COREPOR_RST BIT(5) | ||
33 | #define CORE_RST BIT(4) | ||
34 | #define L2DT_SLP BIT(3) | ||
35 | #define CLAMP BIT(0) | ||
36 | |||
37 | #define APC_PWR_GATE_CTL 0x14 | ||
38 | #define BHS_CNT_SHIFT 24 | ||
39 | #define LDO_PWR_DWN_SHIFT 16 | ||
40 | #define LDO_BYP_SHIFT 8 | ||
41 | #define BHS_SEG_SHIFT 1 | ||
42 | #define BHS_EN BIT(0) | ||
43 | |||
44 | #define APCS_SAW2_VCTL 0x14 | ||
45 | #define APCS_SAW2_2_VCTL 0x1c | ||
46 | |||
47 | extern void secondary_startup(void); | ||
48 | |||
49 | static DEFINE_SPINLOCK(boot_lock); | ||
50 | |||
51 | #ifdef CONFIG_HOTPLUG_CPU | ||
52 | static void __ref qcom_cpu_die(unsigned int cpu) | ||
53 | { | ||
54 | wfi(); | ||
55 | } | ||
56 | #endif | ||
57 | |||
58 | static void qcom_secondary_init(unsigned int cpu) | ||
59 | { | ||
60 | /* | ||
61 | * Synchronise with the boot thread. | ||
62 | */ | ||
63 | spin_lock(&boot_lock); | ||
64 | spin_unlock(&boot_lock); | ||
65 | } | ||
66 | |||
67 | static int scss_release_secondary(unsigned int cpu) | ||
68 | { | ||
69 | struct device_node *node; | ||
70 | void __iomem *base; | ||
71 | |||
72 | node = of_find_compatible_node(NULL, NULL, "qcom,gcc-msm8660"); | ||
73 | if (!node) { | ||
74 | pr_err("%s: can't find node\n", __func__); | ||
75 | return -ENXIO; | ||
76 | } | ||
77 | |||
78 | base = of_iomap(node, 0); | ||
79 | of_node_put(node); | ||
80 | if (!base) | ||
81 | return -ENOMEM; | ||
82 | |||
83 | writel_relaxed(0, base + VDD_SC1_ARRAY_CLAMP_GFS_CTL); | ||
84 | writel_relaxed(0, base + SCSS_CPU1CORE_RESET); | ||
85 | writel_relaxed(3, base + SCSS_DBG_STATUS_CORE_PWRDUP); | ||
86 | mb(); | ||
87 | iounmap(base); | ||
88 | |||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static int kpssv1_release_secondary(unsigned int cpu) | ||
93 | { | ||
94 | int ret = 0; | ||
95 | void __iomem *reg, *saw_reg; | ||
96 | struct device_node *cpu_node, *acc_node, *saw_node; | ||
97 | u32 val; | ||
98 | |||
99 | cpu_node = of_get_cpu_node(cpu, NULL); | ||
100 | if (!cpu_node) | ||
101 | return -ENODEV; | ||
102 | |||
103 | acc_node = of_parse_phandle(cpu_node, "qcom,acc", 0); | ||
104 | if (!acc_node) { | ||
105 | ret = -ENODEV; | ||
106 | goto out_acc; | ||
107 | } | ||
108 | |||
109 | saw_node = of_parse_phandle(cpu_node, "qcom,saw", 0); | ||
110 | if (!saw_node) { | ||
111 | ret = -ENODEV; | ||
112 | goto out_saw; | ||
113 | } | ||
114 | |||
115 | reg = of_iomap(acc_node, 0); | ||
116 | if (!reg) { | ||
117 | ret = -ENOMEM; | ||
118 | goto out_acc_map; | ||
119 | } | ||
120 | |||
121 | saw_reg = of_iomap(saw_node, 0); | ||
122 | if (!saw_reg) { | ||
123 | ret = -ENOMEM; | ||
124 | goto out_saw_map; | ||
125 | } | ||
126 | |||
127 | /* Turn on CPU rail */ | ||
128 | writel_relaxed(0xA4, saw_reg + APCS_SAW2_VCTL); | ||
129 | mb(); | ||
130 | udelay(512); | ||
131 | |||
132 | /* Krait bring-up sequence */ | ||
133 | val = PLL_CLAMP | L2DT_SLP | CLAMP; | ||
134 | writel_relaxed(val, reg + APCS_CPU_PWR_CTL); | ||
135 | val &= ~L2DT_SLP; | ||
136 | writel_relaxed(val, reg + APCS_CPU_PWR_CTL); | ||
137 | mb(); | ||
138 | ndelay(300); | ||
139 | |||
140 | val |= COREPOR_RST; | ||
141 | writel_relaxed(val, reg + APCS_CPU_PWR_CTL); | ||
142 | mb(); | ||
143 | udelay(2); | ||
144 | |||
145 | val &= ~CLAMP; | ||
146 | writel_relaxed(val, reg + APCS_CPU_PWR_CTL); | ||
147 | mb(); | ||
148 | udelay(2); | ||
149 | |||
150 | val &= ~COREPOR_RST; | ||
151 | writel_relaxed(val, reg + APCS_CPU_PWR_CTL); | ||
152 | mb(); | ||
153 | udelay(100); | ||
154 | |||
155 | val |= CORE_PWRD_UP; | ||
156 | writel_relaxed(val, reg + APCS_CPU_PWR_CTL); | ||
157 | mb(); | ||
158 | |||
159 | iounmap(saw_reg); | ||
160 | out_saw_map: | ||
161 | iounmap(reg); | ||
162 | out_acc_map: | ||
163 | of_node_put(saw_node); | ||
164 | out_saw: | ||
165 | of_node_put(acc_node); | ||
166 | out_acc: | ||
167 | of_node_put(cpu_node); | ||
168 | return ret; | ||
169 | } | ||
170 | |||
171 | static int kpssv2_release_secondary(unsigned int cpu) | ||
172 | { | ||
173 | void __iomem *reg; | ||
174 | struct device_node *cpu_node, *l2_node, *acc_node, *saw_node; | ||
175 | void __iomem *l2_saw_base; | ||
176 | unsigned reg_val; | ||
177 | int ret; | ||
178 | |||
179 | cpu_node = of_get_cpu_node(cpu, NULL); | ||
180 | if (!cpu_node) | ||
181 | return -ENODEV; | ||
182 | |||
183 | acc_node = of_parse_phandle(cpu_node, "qcom,acc", 0); | ||
184 | if (!acc_node) { | ||
185 | ret = -ENODEV; | ||
186 | goto out_acc; | ||
187 | } | ||
188 | |||
189 | l2_node = of_parse_phandle(cpu_node, "next-level-cache", 0); | ||
190 | if (!l2_node) { | ||
191 | ret = -ENODEV; | ||
192 | goto out_l2; | ||
193 | } | ||
194 | |||
195 | saw_node = of_parse_phandle(l2_node, "qcom,saw", 0); | ||
196 | if (!saw_node) { | ||
197 | ret = -ENODEV; | ||
198 | goto out_saw; | ||
199 | } | ||
200 | |||
201 | reg = of_iomap(acc_node, 0); | ||
202 | if (!reg) { | ||
203 | ret = -ENOMEM; | ||
204 | goto out_map; | ||
205 | } | ||
206 | |||
207 | l2_saw_base = of_iomap(saw_node, 0); | ||
208 | if (!l2_saw_base) { | ||
209 | ret = -ENOMEM; | ||
210 | goto out_saw_map; | ||
211 | } | ||
212 | |||
213 | /* Turn on the BHS, turn off LDO Bypass and power down LDO */ | ||
214 | reg_val = (64 << BHS_CNT_SHIFT) | (0x3f << LDO_PWR_DWN_SHIFT) | BHS_EN; | ||
215 | writel_relaxed(reg_val, reg + APC_PWR_GATE_CTL); | ||
216 | mb(); | ||
217 | /* wait for the BHS to settle */ | ||
218 | udelay(1); | ||
219 | |||
220 | /* Turn on BHS segments */ | ||
221 | reg_val |= 0x3f << BHS_SEG_SHIFT; | ||
222 | writel_relaxed(reg_val, reg + APC_PWR_GATE_CTL); | ||
223 | mb(); | ||
224 | /* wait for the BHS to settle */ | ||
225 | udelay(1); | ||
226 | |||
227 | /* Finally turn on the bypass so that BHS supplies power */ | ||
228 | reg_val |= 0x3f << LDO_BYP_SHIFT; | ||
229 | writel_relaxed(reg_val, reg + APC_PWR_GATE_CTL); | ||
230 | |||
231 | /* enable max phases */ | ||
232 | writel_relaxed(0x10003, l2_saw_base + APCS_SAW2_2_VCTL); | ||
233 | mb(); | ||
234 | udelay(50); | ||
235 | |||
236 | reg_val = COREPOR_RST | CLAMP; | ||
237 | writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL); | ||
238 | mb(); | ||
239 | udelay(2); | ||
240 | |||
241 | reg_val &= ~CLAMP; | ||
242 | writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL); | ||
243 | mb(); | ||
244 | udelay(2); | ||
245 | |||
246 | reg_val &= ~COREPOR_RST; | ||
247 | writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL); | ||
248 | mb(); | ||
249 | |||
250 | reg_val |= CORE_PWRD_UP; | ||
251 | writel_relaxed(reg_val, reg + APCS_CPU_PWR_CTL); | ||
252 | mb(); | ||
253 | |||
254 | ret = 0; | ||
255 | |||
256 | iounmap(l2_saw_base); | ||
257 | out_saw_map: | ||
258 | iounmap(reg); | ||
259 | out_map: | ||
260 | of_node_put(saw_node); | ||
261 | out_saw: | ||
262 | of_node_put(l2_node); | ||
263 | out_l2: | ||
264 | of_node_put(acc_node); | ||
265 | out_acc: | ||
266 | of_node_put(cpu_node); | ||
267 | |||
268 | return ret; | ||
269 | } | ||
270 | |||
271 | static DEFINE_PER_CPU(int, cold_boot_done); | ||
272 | |||
273 | static int qcom_boot_secondary(unsigned int cpu, int (*func)(unsigned int)) | ||
274 | { | ||
275 | int ret = 0; | ||
276 | |||
277 | if (!per_cpu(cold_boot_done, cpu)) { | ||
278 | ret = func(cpu); | ||
279 | if (!ret) | ||
280 | per_cpu(cold_boot_done, cpu) = true; | ||
281 | } | ||
282 | |||
283 | /* | ||
284 | * set synchronisation state between this boot processor | ||
285 | * and the secondary one | ||
286 | */ | ||
287 | spin_lock(&boot_lock); | ||
288 | |||
289 | /* | ||
290 | * Send the secondary CPU a soft interrupt, thereby causing | ||
291 | * the boot monitor to read the system wide flags register, | ||
292 | * and branch to the address found there. | ||
293 | */ | ||
294 | arch_send_wakeup_ipi_mask(cpumask_of(cpu)); | ||
295 | |||
296 | /* | ||
297 | * now the secondary core is starting up let it run its | ||
298 | * calibrations, then wait for it to finish | ||
299 | */ | ||
300 | spin_unlock(&boot_lock); | ||
301 | |||
302 | return ret; | ||
303 | } | ||
304 | |||
305 | static int msm8660_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
306 | { | ||
307 | return qcom_boot_secondary(cpu, scss_release_secondary); | ||
308 | } | ||
309 | |||
310 | static int kpssv1_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
311 | { | ||
312 | return qcom_boot_secondary(cpu, kpssv1_release_secondary); | ||
313 | } | ||
314 | |||
315 | static int kpssv2_boot_secondary(unsigned int cpu, struct task_struct *idle) | ||
316 | { | ||
317 | return qcom_boot_secondary(cpu, kpssv2_release_secondary); | ||
318 | } | ||
319 | |||
320 | static void __init qcom_smp_prepare_cpus(unsigned int max_cpus) | ||
321 | { | ||
322 | int cpu, map; | ||
323 | unsigned int flags = 0; | ||
324 | static const int cold_boot_flags[] = { | ||
325 | 0, | ||
326 | SCM_FLAG_COLDBOOT_CPU1, | ||
327 | SCM_FLAG_COLDBOOT_CPU2, | ||
328 | SCM_FLAG_COLDBOOT_CPU3, | ||
329 | }; | ||
330 | |||
331 | for_each_present_cpu(cpu) { | ||
332 | map = cpu_logical_map(cpu); | ||
333 | if (WARN_ON(map >= ARRAY_SIZE(cold_boot_flags))) { | ||
334 | set_cpu_present(cpu, false); | ||
335 | continue; | ||
336 | } | ||
337 | flags |= cold_boot_flags[map]; | ||
338 | } | ||
339 | |||
340 | if (scm_set_boot_addr(virt_to_phys(secondary_startup), flags)) { | ||
341 | for_each_present_cpu(cpu) { | ||
342 | if (cpu == smp_processor_id()) | ||
343 | continue; | ||
344 | set_cpu_present(cpu, false); | ||
345 | } | ||
346 | pr_warn("Failed to set CPU boot address, disabling SMP\n"); | ||
347 | } | ||
348 | } | ||
349 | |||
350 | static struct smp_operations smp_msm8660_ops __initdata = { | ||
351 | .smp_prepare_cpus = qcom_smp_prepare_cpus, | ||
352 | .smp_secondary_init = qcom_secondary_init, | ||
353 | .smp_boot_secondary = msm8660_boot_secondary, | ||
354 | #ifdef CONFIG_HOTPLUG_CPU | ||
355 | .cpu_die = qcom_cpu_die, | ||
356 | #endif | ||
357 | }; | ||
358 | CPU_METHOD_OF_DECLARE(qcom_smp, "qcom,gcc-msm8660", &smp_msm8660_ops); | ||
359 | |||
360 | static struct smp_operations qcom_smp_kpssv1_ops __initdata = { | ||
361 | .smp_prepare_cpus = qcom_smp_prepare_cpus, | ||
362 | .smp_secondary_init = qcom_secondary_init, | ||
363 | .smp_boot_secondary = kpssv1_boot_secondary, | ||
364 | #ifdef CONFIG_HOTPLUG_CPU | ||
365 | .cpu_die = qcom_cpu_die, | ||
366 | #endif | ||
367 | }; | ||
368 | CPU_METHOD_OF_DECLARE(qcom_smp_kpssv1, "qcom,kpss-acc-v1", &qcom_smp_kpssv1_ops); | ||
369 | |||
370 | static struct smp_operations qcom_smp_kpssv2_ops __initdata = { | ||
371 | .smp_prepare_cpus = qcom_smp_prepare_cpus, | ||
372 | .smp_secondary_init = qcom_secondary_init, | ||
373 | .smp_boot_secondary = kpssv2_boot_secondary, | ||
374 | #ifdef CONFIG_HOTPLUG_CPU | ||
375 | .cpu_die = qcom_cpu_die, | ||
376 | #endif | ||
377 | }; | ||
378 | CPU_METHOD_OF_DECLARE(qcom_smp_kpssv2, "qcom,kpss-acc-v2", &qcom_smp_kpssv2_ops); | ||
diff --git a/arch/arm/mach-msm/scm-boot.c b/arch/arm/mach-qcom/scm-boot.c index 45cee3e469a5..45cee3e469a5 100644 --- a/arch/arm/mach-msm/scm-boot.c +++ b/arch/arm/mach-qcom/scm-boot.c | |||
diff --git a/arch/arm/mach-msm/scm-boot.h b/arch/arm/mach-qcom/scm-boot.h index 7be32ff5d687..6aabb2428176 100644 --- a/arch/arm/mach-msm/scm-boot.h +++ b/arch/arm/mach-qcom/scm-boot.h | |||
@@ -13,9 +13,11 @@ | |||
13 | #define __MACH_SCM_BOOT_H | 13 | #define __MACH_SCM_BOOT_H |
14 | 14 | ||
15 | #define SCM_BOOT_ADDR 0x1 | 15 | #define SCM_BOOT_ADDR 0x1 |
16 | #define SCM_FLAG_COLDBOOT_CPU1 0x1 | 16 | #define SCM_FLAG_COLDBOOT_CPU1 0x01 |
17 | #define SCM_FLAG_WARMBOOT_CPU1 0x2 | 17 | #define SCM_FLAG_COLDBOOT_CPU2 0x08 |
18 | #define SCM_FLAG_WARMBOOT_CPU0 0x4 | 18 | #define SCM_FLAG_COLDBOOT_CPU3 0x20 |
19 | #define SCM_FLAG_WARMBOOT_CPU0 0x04 | ||
20 | #define SCM_FLAG_WARMBOOT_CPU1 0x02 | ||
19 | 21 | ||
20 | int scm_set_boot_addr(phys_addr_t addr, int flags); | 22 | int scm_set_boot_addr(phys_addr_t addr, int flags); |
21 | 23 | ||
diff --git a/arch/arm/mach-msm/scm.c b/arch/arm/mach-qcom/scm.c index c536fd6bf827..c536fd6bf827 100644 --- a/arch/arm/mach-msm/scm.c +++ b/arch/arm/mach-qcom/scm.c | |||
diff --git a/arch/arm/mach-msm/scm.h b/arch/arm/mach-qcom/scm.h index 00b31ea58f29..00b31ea58f29 100644 --- a/arch/arm/mach-msm/scm.h +++ b/arch/arm/mach-qcom/scm.h | |||
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index cf073dea5784..1caee6d548b8 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig | |||
@@ -5,10 +5,8 @@ config ARCH_ROCKCHIP | |||
5 | select ARCH_REQUIRE_GPIOLIB | 5 | select ARCH_REQUIRE_GPIOLIB |
6 | select ARM_GIC | 6 | select ARM_GIC |
7 | select CACHE_L2X0 | 7 | select CACHE_L2X0 |
8 | select HAVE_ARM_SCU if SMP | ||
8 | select HAVE_ARM_TWD if SMP | 9 | select HAVE_ARM_TWD if SMP |
9 | select HAVE_SMP | ||
10 | select COMMON_CLK | ||
11 | select GENERIC_CLOCKEVENTS | ||
12 | select DW_APB_TIMER_OF | 10 | select DW_APB_TIMER_OF |
13 | select ARM_GLOBAL_TIMER | 11 | select ARM_GLOBAL_TIMER |
14 | select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK | 12 | select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK |
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile index 1547d4fc920a..4377a1436a98 100644 --- a/arch/arm/mach-rockchip/Makefile +++ b/arch/arm/mach-rockchip/Makefile | |||
@@ -1 +1,2 @@ | |||
1 | obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o | 1 | obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o |
2 | obj-$(CONFIG_SMP) += headsmp.o platsmp.o | ||
diff --git a/arch/arm/mach-rockchip/core.h b/arch/arm/mach-rockchip/core.h new file mode 100644 index 000000000000..e2e7c9dbb200 --- /dev/null +++ b/arch/arm/mach-rockchip/core.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013 MundoReader S.L. | ||
3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
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 | |||
16 | extern char rockchip_secondary_trampoline; | ||
17 | extern char rockchip_secondary_trampoline_end; | ||
18 | |||
19 | extern unsigned long rockchip_boot_fn; | ||
20 | extern void rockchip_secondary_startup(void); | ||
21 | |||
22 | extern struct smp_operations rockchip_smp_ops; | ||
diff --git a/arch/arm/mach-rockchip/headsmp.S b/arch/arm/mach-rockchip/headsmp.S new file mode 100644 index 000000000000..73206e360e31 --- /dev/null +++ b/arch/arm/mach-rockchip/headsmp.S | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013 MundoReader S.L. | ||
3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
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 | #include <linux/linkage.h> | ||
16 | #include <linux/init.h> | ||
17 | |||
18 | ENTRY(rockchip_secondary_startup) | ||
19 | bl v7_invalidate_l1 | ||
20 | b secondary_startup | ||
21 | ENDPROC(rockchip_secondary_startup) | ||
22 | |||
23 | ENTRY(rockchip_secondary_trampoline) | ||
24 | ldr pc, 1f | ||
25 | ENDPROC(rockchip_secondary_trampoline) | ||
26 | .globl rockchip_boot_fn | ||
27 | rockchip_boot_fn: | ||
28 | 1: .space 4 | ||
29 | |||
30 | ENTRY(rockchip_secondary_trampoline_end) | ||
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c new file mode 100644 index 000000000000..dbfa5a26cfff --- /dev/null +++ b/arch/arm/mach-rockchip/platsmp.c | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2013 MundoReader S.L. | ||
3 | * Author: Heiko Stuebner <heiko@sntech.de> | ||
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 | |||
16 | #include <linux/delay.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/smp.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/of.h> | ||
21 | #include <linux/of_address.h> | ||
22 | |||
23 | #include <asm/cacheflush.h> | ||
24 | #include <asm/smp_scu.h> | ||
25 | #include <asm/smp_plat.h> | ||
26 | #include <asm/mach/map.h> | ||
27 | |||
28 | #include "core.h" | ||
29 | |||
30 | static void __iomem *scu_base_addr; | ||
31 | static void __iomem *sram_base_addr; | ||
32 | static int ncores; | ||
33 | |||
34 | #define PMU_PWRDN_CON 0x08 | ||
35 | #define PMU_PWRDN_ST 0x0c | ||
36 | |||
37 | #define PMU_PWRDN_SCU 4 | ||
38 | |||
39 | static void __iomem *pmu_base_addr; | ||
40 | |||
41 | static inline bool pmu_power_domain_is_on(int pd) | ||
42 | { | ||
43 | return !(readl_relaxed(pmu_base_addr + PMU_PWRDN_ST) & BIT(pd)); | ||
44 | } | ||
45 | |||
46 | static void pmu_set_power_domain(int pd, bool on) | ||
47 | { | ||
48 | u32 val = readl_relaxed(pmu_base_addr + PMU_PWRDN_CON); | ||
49 | if (on) | ||
50 | val &= ~BIT(pd); | ||
51 | else | ||
52 | val |= BIT(pd); | ||
53 | writel(val, pmu_base_addr + PMU_PWRDN_CON); | ||
54 | |||
55 | while (pmu_power_domain_is_on(pd) != on) { } | ||
56 | } | ||
57 | |||
58 | /* | ||
59 | * Handling of CPU cores | ||
60 | */ | ||
61 | |||
62 | static int __cpuinit rockchip_boot_secondary(unsigned int cpu, | ||
63 | struct task_struct *idle) | ||
64 | { | ||
65 | if (!sram_base_addr || !pmu_base_addr) { | ||
66 | pr_err("%s: sram or pmu missing for cpu boot\n", __func__); | ||
67 | return -ENXIO; | ||
68 | } | ||
69 | |||
70 | if (cpu >= ncores) { | ||
71 | pr_err("%s: cpu %d outside maximum number of cpus %d\n", | ||
72 | __func__, cpu, ncores); | ||
73 | return -ENXIO; | ||
74 | } | ||
75 | |||
76 | /* start the core */ | ||
77 | pmu_set_power_domain(0 + cpu, true); | ||
78 | |||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | /** | ||
83 | * rockchip_smp_prepare_sram - populate necessary sram block | ||
84 | * Starting cores execute the code residing at the start of the on-chip sram | ||
85 | * after power-on. Therefore make sure, this sram region is reserved and | ||
86 | * big enough. After this check, copy the trampoline code that directs the | ||
87 | * core to the real startup code in ram into the sram-region. | ||
88 | * @node: mmio-sram device node | ||
89 | */ | ||
90 | static int __init rockchip_smp_prepare_sram(struct device_node *node) | ||
91 | { | ||
92 | unsigned int trampoline_sz = &rockchip_secondary_trampoline_end - | ||
93 | &rockchip_secondary_trampoline; | ||
94 | struct resource res; | ||
95 | unsigned int rsize; | ||
96 | int ret; | ||
97 | |||
98 | ret = of_address_to_resource(node, 0, &res); | ||
99 | if (ret < 0) { | ||
100 | pr_err("%s: could not get address for node %s\n", | ||
101 | __func__, node->full_name); | ||
102 | return ret; | ||
103 | } | ||
104 | |||
105 | rsize = resource_size(&res); | ||
106 | if (rsize < trampoline_sz) { | ||
107 | pr_err("%s: reserved block with size 0x%x is to small for trampoline size 0x%x\n", | ||
108 | __func__, rsize, trampoline_sz); | ||
109 | return -EINVAL; | ||
110 | } | ||
111 | |||
112 | sram_base_addr = of_iomap(node, 0); | ||
113 | |||
114 | /* set the boot function for the sram code */ | ||
115 | rockchip_boot_fn = virt_to_phys(rockchip_secondary_startup); | ||
116 | |||
117 | /* copy the trampoline to sram, that runs during startup of the core */ | ||
118 | memcpy(sram_base_addr, &rockchip_secondary_trampoline, trampoline_sz); | ||
119 | flush_cache_all(); | ||
120 | outer_clean_range(0, trampoline_sz); | ||
121 | |||
122 | dsb_sev(); | ||
123 | |||
124 | return 0; | ||
125 | } | ||
126 | |||
127 | static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) | ||
128 | { | ||
129 | struct device_node *node; | ||
130 | unsigned int i; | ||
131 | |||
132 | node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); | ||
133 | if (!node) { | ||
134 | pr_err("%s: missing scu\n", __func__); | ||
135 | return; | ||
136 | } | ||
137 | |||
138 | scu_base_addr = of_iomap(node, 0); | ||
139 | if (!scu_base_addr) { | ||
140 | pr_err("%s: could not map scu registers\n", __func__); | ||
141 | return; | ||
142 | } | ||
143 | |||
144 | node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-smp-sram"); | ||
145 | if (!node) { | ||
146 | pr_err("%s: could not find sram dt node\n", __func__); | ||
147 | return; | ||
148 | } | ||
149 | |||
150 | if (rockchip_smp_prepare_sram(node)) | ||
151 | return; | ||
152 | |||
153 | node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-pmu"); | ||
154 | if (!node) { | ||
155 | pr_err("%s: could not find sram dt node\n", __func__); | ||
156 | return; | ||
157 | } | ||
158 | |||
159 | pmu_base_addr = of_iomap(node, 0); | ||
160 | if (!pmu_base_addr) { | ||
161 | pr_err("%s: could not map pmu registers\n", __func__); | ||
162 | return; | ||
163 | } | ||
164 | |||
165 | /* enable the SCU power domain */ | ||
166 | pmu_set_power_domain(PMU_PWRDN_SCU, true); | ||
167 | |||
168 | /* | ||
169 | * While the number of cpus is gathered from dt, also get the number | ||
170 | * of cores from the scu to verify this value when booting the cores. | ||
171 | */ | ||
172 | ncores = scu_get_core_count(scu_base_addr); | ||
173 | |||
174 | scu_enable(scu_base_addr); | ||
175 | |||
176 | /* Make sure that all cores except the first are really off */ | ||
177 | for (i = 1; i < ncores; i++) | ||
178 | pmu_set_power_domain(0 + i, false); | ||
179 | } | ||
180 | |||
181 | struct smp_operations rockchip_smp_ops __initdata = { | ||
182 | .smp_prepare_cpus = rockchip_smp_prepare_cpus, | ||
183 | .smp_boot_secondary = rockchip_boot_secondary, | ||
184 | }; | ||
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c index 82c0b0709712..d211d6fa0d98 100644 --- a/arch/arm/mach-rockchip/rockchip.c +++ b/arch/arm/mach-rockchip/rockchip.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/map.h> | 23 | #include <asm/mach/map.h> |
24 | #include <asm/hardware/cache-l2x0.h> | 24 | #include <asm/hardware/cache-l2x0.h> |
25 | #include "core.h" | ||
25 | 26 | ||
26 | static void __init rockchip_dt_init(void) | 27 | static void __init rockchip_dt_init(void) |
27 | { | 28 | { |
@@ -38,6 +39,7 @@ static const char * const rockchip_board_dt_compat[] = { | |||
38 | }; | 39 | }; |
39 | 40 | ||
40 | DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") | 41 | DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") |
42 | .smp = smp_ops(rockchip_smp_ops), | ||
41 | .init_machine = rockchip_dt_init, | 43 | .init_machine = rockchip_dt_init, |
42 | .dt_compat = rockchip_board_dt_compat, | 44 | .dt_compat = rockchip_board_dt_compat, |
43 | MACHINE_END | 45 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 338640631e08..c54db0046ce3 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -5,18 +5,14 @@ config ARCH_SHMOBILE_MULTI | |||
5 | bool "Renesas ARM SoCs" if ARCH_MULTI_V7 | 5 | bool "Renesas ARM SoCs" if ARCH_MULTI_V7 |
6 | depends on MMU | 6 | depends on MMU |
7 | select ARCH_SHMOBILE | 7 | select ARCH_SHMOBILE |
8 | select CPU_V7 | ||
9 | select GENERIC_CLOCKEVENTS | ||
10 | select HAVE_ARM_SCU if SMP | 8 | select HAVE_ARM_SCU if SMP |
11 | select HAVE_ARM_TWD if LOCAL_TIMERS | 9 | select HAVE_ARM_TWD if SMP |
12 | select HAVE_SMP | ||
13 | select ARM_GIC | 10 | select ARM_GIC |
14 | select MIGHT_HAVE_CACHE_L2X0 | ||
15 | select MIGHT_HAVE_PCI | 11 | select MIGHT_HAVE_PCI |
12 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | ||
16 | select NO_IOPORT | 13 | select NO_IOPORT |
17 | select PINCTRL | 14 | select PINCTRL |
18 | select ARCH_REQUIRE_GPIOLIB | 15 | select ARCH_REQUIRE_GPIOLIB |
19 | select CLKDEV_LOOKUP | ||
20 | 16 | ||
21 | if ARCH_SHMOBILE_MULTI | 17 | if ARCH_SHMOBILE_MULTI |
22 | 18 | ||
@@ -123,6 +119,7 @@ config ARCH_R8A7790 | |||
123 | select MIGHT_HAVE_PCI | 119 | select MIGHT_HAVE_PCI |
124 | select SH_CLK_CPG | 120 | select SH_CLK_CPG |
125 | select RENESAS_IRQC | 121 | select RENESAS_IRQC |
122 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | ||
126 | 123 | ||
127 | config ARCH_R8A7791 | 124 | config ARCH_R8A7791 |
128 | bool "R-Car M2 (R8A77910)" | 125 | bool "R-Car M2 (R8A77910)" |
@@ -132,6 +129,7 @@ config ARCH_R8A7791 | |||
132 | select MIGHT_HAVE_PCI | 129 | select MIGHT_HAVE_PCI |
133 | select SH_CLK_CPG | 130 | select SH_CLK_CPG |
134 | select RENESAS_IRQC | 131 | select RENESAS_IRQC |
132 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | ||
135 | 133 | ||
136 | config ARCH_EMEV2 | 134 | config ARCH_EMEV2 |
137 | bool "Emma Mobile EV2" | 135 | bool "Emma Mobile EV2" |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index fe7d4ff706e4..d38a6362e5f8 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -52,7 +52,8 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o | |||
52 | obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o | 52 | obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o |
53 | obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o | 53 | obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o |
54 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o | 54 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o |
55 | obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o | 55 | obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o |
56 | obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o | ||
56 | 57 | ||
57 | # Board objects | 58 | # Board objects |
58 | ifdef CONFIG_ARCH_SHMOBILE_MULTI | 59 | ifdef CONFIG_ARCH_SHMOBILE_MULTI |
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rcar.h b/arch/arm/mach-shmobile/include/mach/pm-rcar.h new file mode 100644 index 000000000000..ef3a1ef628f1 --- /dev/null +++ b/arch/arm/mach-shmobile/include/mach/pm-rcar.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef PM_RCAR_H | ||
2 | #define PM_RCAR_H | ||
3 | |||
4 | struct rcar_sysc_ch { | ||
5 | unsigned long chan_offs; | ||
6 | unsigned int chan_bit; | ||
7 | unsigned int isr_bit; | ||
8 | }; | ||
9 | |||
10 | int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch); | ||
11 | int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch); | ||
12 | bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch); | ||
13 | void __iomem *rcar_sysc_init(phys_addr_t base); | ||
14 | |||
15 | #endif /* PM_RCAR_H */ | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h index b40e13631f6a..88eeceaf1088 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/sh_clk.h> | 4 | #include <linux/sh_clk.h> |
5 | #include <linux/pm_domain.h> | 5 | #include <linux/pm_domain.h> |
6 | #include <mach/pm-rcar.h> | ||
6 | 7 | ||
7 | /* HPB-DMA slave IDs */ | 8 | /* HPB-DMA slave IDs */ |
8 | enum { | 9 | enum { |
@@ -11,18 +12,12 @@ enum { | |||
11 | HPBDMA_SLAVE_SDHI0_RX, | 12 | HPBDMA_SLAVE_SDHI0_RX, |
12 | }; | 13 | }; |
13 | 14 | ||
14 | struct r8a7779_pm_ch { | ||
15 | unsigned long chan_offs; | ||
16 | unsigned int chan_bit; | ||
17 | unsigned int isr_bit; | ||
18 | }; | ||
19 | |||
20 | struct r8a7779_pm_domain { | 15 | struct r8a7779_pm_domain { |
21 | struct generic_pm_domain genpd; | 16 | struct generic_pm_domain genpd; |
22 | struct r8a7779_pm_ch ch; | 17 | struct rcar_sysc_ch ch; |
23 | }; | 18 | }; |
24 | 19 | ||
25 | static inline struct r8a7779_pm_ch *to_r8a7779_ch(struct generic_pm_domain *d) | 20 | static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) |
26 | { | 21 | { |
27 | return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; | 22 | return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; |
28 | } | 23 | } |
@@ -41,8 +36,6 @@ extern void r8a7779_clock_init(void); | |||
41 | extern void r8a7779_pinmux_init(void); | 36 | extern void r8a7779_pinmux_init(void); |
42 | extern void r8a7779_pm_init(void); | 37 | extern void r8a7779_pm_init(void); |
43 | extern void r8a7779_register_twd(void); | 38 | extern void r8a7779_register_twd(void); |
44 | extern int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch); | ||
45 | extern int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch); | ||
46 | 39 | ||
47 | #ifdef CONFIG_PM | 40 | #ifdef CONFIG_PM |
48 | extern void __init r8a7779_init_pm_domains(void); | 41 | extern void __init r8a7779_init_pm_domains(void); |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h index 5fbfa28b40b6..3389f0775def 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h | |||
@@ -7,6 +7,7 @@ void r8a7790_add_standard_devices(void); | |||
7 | void r8a7790_add_dt_devices(void); | 7 | void r8a7790_add_dt_devices(void); |
8 | void r8a7790_clock_init(void); | 8 | void r8a7790_clock_init(void); |
9 | void r8a7790_pinmux_init(void); | 9 | void r8a7790_pinmux_init(void); |
10 | void r8a7790_pm_init(void); | ||
10 | void r8a7790_init_early(void); | 11 | void r8a7790_init_early(void); |
11 | extern struct smp_operations r8a7790_smp_ops; | 12 | extern struct smp_operations r8a7790_smp_ops; |
12 | 13 | ||
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 1da5a72d9642..8cb641c00fdb 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c | |||
@@ -75,8 +75,7 @@ static void apmu_init_cpu(struct resource *res, int cpu, int bit) | |||
75 | apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); | 75 | apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); |
76 | apmu_cpus[cpu].bit = bit; | 76 | apmu_cpus[cpu].bit = bit; |
77 | 77 | ||
78 | pr_debug("apmu ioremap %d %d 0x%08x 0x%08x\n", cpu, bit, | 78 | pr_debug("apmu ioremap %d %d %pr\n", cpu, bit, res); |
79 | res->start, resource_size(res)); | ||
80 | } | 79 | } |
81 | 80 | ||
82 | static struct { | 81 | static struct { |
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c index d50a8e9b94a4..d6fe189b2df6 100644 --- a/arch/arm/mach-shmobile/pm-r8a7779.c +++ b/arch/arm/mach-shmobile/pm-r8a7779.c | |||
@@ -20,132 +20,22 @@ | |||
20 | #include <linux/console.h> | 20 | #include <linux/console.h> |
21 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | #include <mach/common.h> | 22 | #include <mach/common.h> |
23 | #include <mach/pm-rcar.h> | ||
23 | #include <mach/r8a7779.h> | 24 | #include <mach/r8a7779.h> |
24 | 25 | ||
25 | static void __iomem *r8a7779_sysc_base; | ||
26 | |||
27 | /* SYSC */ | 26 | /* SYSC */ |
28 | #define SYSCSR 0x00 | ||
29 | #define SYSCISR 0x04 | ||
30 | #define SYSCISCR 0x08 | ||
31 | #define SYSCIER 0x0c | 27 | #define SYSCIER 0x0c |
32 | #define SYSCIMR 0x10 | 28 | #define SYSCIMR 0x10 |
33 | #define PWRSR0 0x40 | ||
34 | #define PWRSR1 0x80 | ||
35 | #define PWRSR2 0xc0 | ||
36 | #define PWRSR3 0x100 | ||
37 | #define PWRSR4 0x140 | ||
38 | |||
39 | #define PWRSR_OFFS 0x00 | ||
40 | #define PWROFFCR_OFFS 0x04 | ||
41 | #define PWRONCR_OFFS 0x0c | ||
42 | #define PWRER_OFFS 0x14 | ||
43 | |||
44 | #define SYSCSR_RETRIES 100 | ||
45 | #define SYSCSR_DELAY_US 1 | ||
46 | |||
47 | #define SYSCISR_RETRIES 1000 | ||
48 | #define SYSCISR_DELAY_US 1 | ||
49 | 29 | ||
50 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) | 30 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) |
51 | 31 | ||
52 | static DEFINE_SPINLOCK(r8a7779_sysc_lock); /* SMP CPUs + I/O devices */ | ||
53 | |||
54 | static int r8a7779_sysc_pwr_on_off(struct r8a7779_pm_ch *r8a7779_ch, | ||
55 | int sr_bit, int reg_offs) | ||
56 | { | ||
57 | int k; | ||
58 | |||
59 | for (k = 0; k < SYSCSR_RETRIES; k++) { | ||
60 | if (ioread32(r8a7779_sysc_base + SYSCSR) & (1 << sr_bit)) | ||
61 | break; | ||
62 | udelay(SYSCSR_DELAY_US); | ||
63 | } | ||
64 | |||
65 | if (k == SYSCSR_RETRIES) | ||
66 | return -EAGAIN; | ||
67 | |||
68 | iowrite32(1 << r8a7779_ch->chan_bit, | ||
69 | r8a7779_sysc_base + r8a7779_ch->chan_offs + reg_offs); | ||
70 | |||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | static int r8a7779_sysc_pwr_off(struct r8a7779_pm_ch *r8a7779_ch) | ||
75 | { | ||
76 | return r8a7779_sysc_pwr_on_off(r8a7779_ch, 0, PWROFFCR_OFFS); | ||
77 | } | ||
78 | |||
79 | static int r8a7779_sysc_pwr_on(struct r8a7779_pm_ch *r8a7779_ch) | ||
80 | { | ||
81 | return r8a7779_sysc_pwr_on_off(r8a7779_ch, 1, PWRONCR_OFFS); | ||
82 | } | ||
83 | |||
84 | static int r8a7779_sysc_update(struct r8a7779_pm_ch *r8a7779_ch, | ||
85 | int (*on_off_fn)(struct r8a7779_pm_ch *)) | ||
86 | { | ||
87 | unsigned int isr_mask = 1 << r8a7779_ch->isr_bit; | ||
88 | unsigned int chan_mask = 1 << r8a7779_ch->chan_bit; | ||
89 | unsigned int status; | ||
90 | unsigned long flags; | ||
91 | int ret = 0; | ||
92 | int k; | ||
93 | |||
94 | spin_lock_irqsave(&r8a7779_sysc_lock, flags); | ||
95 | |||
96 | iowrite32(isr_mask, r8a7779_sysc_base + SYSCISCR); | ||
97 | |||
98 | do { | ||
99 | ret = on_off_fn(r8a7779_ch); | ||
100 | if (ret) | ||
101 | goto out; | ||
102 | |||
103 | status = ioread32(r8a7779_sysc_base + | ||
104 | r8a7779_ch->chan_offs + PWRER_OFFS); | ||
105 | } while (status & chan_mask); | ||
106 | |||
107 | for (k = 0; k < SYSCISR_RETRIES; k++) { | ||
108 | if (ioread32(r8a7779_sysc_base + SYSCISR) & isr_mask) | ||
109 | break; | ||
110 | udelay(SYSCISR_DELAY_US); | ||
111 | } | ||
112 | |||
113 | if (k == SYSCISR_RETRIES) | ||
114 | ret = -EIO; | ||
115 | |||
116 | iowrite32(isr_mask, r8a7779_sysc_base + SYSCISCR); | ||
117 | |||
118 | out: | ||
119 | spin_unlock_irqrestore(&r8a7779_sysc_lock, flags); | ||
120 | |||
121 | pr_debug("r8a7779 power domain %d: %02x %02x %02x %02x %02x -> %d\n", | ||
122 | r8a7779_ch->isr_bit, ioread32(r8a7779_sysc_base + PWRSR0), | ||
123 | ioread32(r8a7779_sysc_base + PWRSR1), | ||
124 | ioread32(r8a7779_sysc_base + PWRSR2), | ||
125 | ioread32(r8a7779_sysc_base + PWRSR3), | ||
126 | ioread32(r8a7779_sysc_base + PWRSR4), ret); | ||
127 | return ret; | ||
128 | } | ||
129 | |||
130 | int r8a7779_sysc_power_down(struct r8a7779_pm_ch *r8a7779_ch) | ||
131 | { | ||
132 | return r8a7779_sysc_update(r8a7779_ch, r8a7779_sysc_pwr_off); | ||
133 | } | ||
134 | |||
135 | int r8a7779_sysc_power_up(struct r8a7779_pm_ch *r8a7779_ch) | ||
136 | { | ||
137 | return r8a7779_sysc_update(r8a7779_ch, r8a7779_sysc_pwr_on); | ||
138 | } | ||
139 | |||
140 | static void __init r8a7779_sysc_init(void) | 32 | static void __init r8a7779_sysc_init(void) |
141 | { | 33 | { |
142 | r8a7779_sysc_base = ioremap_nocache(0xffd85000, PAGE_SIZE); | 34 | void __iomem *base = rcar_sysc_init(0xffd85000); |
143 | if (!r8a7779_sysc_base) | ||
144 | panic("unable to ioremap r8a7779 SYSC hardware block\n"); | ||
145 | 35 | ||
146 | /* enable all interrupt sources, but do not use interrupt handler */ | 36 | /* enable all interrupt sources, but do not use interrupt handler */ |
147 | iowrite32(0x0131000e, r8a7779_sysc_base + SYSCIER); | 37 | iowrite32(0x0131000e, base + SYSCIER); |
148 | iowrite32(0, r8a7779_sysc_base + SYSCIMR); | 38 | iowrite32(0, base + SYSCIMR); |
149 | } | 39 | } |
150 | 40 | ||
151 | #else /* CONFIG_PM || CONFIG_SMP */ | 41 | #else /* CONFIG_PM || CONFIG_SMP */ |
@@ -158,24 +48,17 @@ static inline void r8a7779_sysc_init(void) {} | |||
158 | 48 | ||
159 | static int pd_power_down(struct generic_pm_domain *genpd) | 49 | static int pd_power_down(struct generic_pm_domain *genpd) |
160 | { | 50 | { |
161 | return r8a7779_sysc_power_down(to_r8a7779_ch(genpd)); | 51 | return rcar_sysc_power_down(to_r8a7779_ch(genpd)); |
162 | } | 52 | } |
163 | 53 | ||
164 | static int pd_power_up(struct generic_pm_domain *genpd) | 54 | static int pd_power_up(struct generic_pm_domain *genpd) |
165 | { | 55 | { |
166 | return r8a7779_sysc_power_up(to_r8a7779_ch(genpd)); | 56 | return rcar_sysc_power_up(to_r8a7779_ch(genpd)); |
167 | } | 57 | } |
168 | 58 | ||
169 | static bool pd_is_off(struct generic_pm_domain *genpd) | 59 | static bool pd_is_off(struct generic_pm_domain *genpd) |
170 | { | 60 | { |
171 | struct r8a7779_pm_ch *r8a7779_ch = to_r8a7779_ch(genpd); | 61 | return rcar_sysc_power_is_off(to_r8a7779_ch(genpd)); |
172 | unsigned int st; | ||
173 | |||
174 | st = ioread32(r8a7779_sysc_base + r8a7779_ch->chan_offs + PWRSR_OFFS); | ||
175 | if (st & (1 << r8a7779_ch->chan_bit)) | ||
176 | return true; | ||
177 | |||
178 | return false; | ||
179 | } | 62 | } |
180 | 63 | ||
181 | static bool pd_active_wakeup(struct device *dev) | 64 | static bool pd_active_wakeup(struct device *dev) |
diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c new file mode 100644 index 000000000000..fc82839e2c2a --- /dev/null +++ b/arch/arm/mach-shmobile/pm-r8a7790.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * r8a7790 Power management support | ||
3 | * | ||
4 | * Copyright (C) 2013 Renesas Electronics Corporation | ||
5 | * Copyright (C) 2011 Renesas Solutions Corp. | ||
6 | * Copyright (C) 2011 Magnus Damm | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <asm/io.h> | ||
15 | #include <mach/pm-rcar.h> | ||
16 | #include <mach/r8a7790.h> | ||
17 | |||
18 | /* SYSC */ | ||
19 | #define SYSCIER 0x0c | ||
20 | #define SYSCIMR 0x10 | ||
21 | |||
22 | #if defined(CONFIG_SMP) | ||
23 | |||
24 | static void __init r8a7790_sysc_init(void) | ||
25 | { | ||
26 | void __iomem *base = rcar_sysc_init(0xe6180000); | ||
27 | |||
28 | /* enable all interrupt sources, but do not use interrupt handler */ | ||
29 | iowrite32(0x0131000e, base + SYSCIER); | ||
30 | iowrite32(0, base + SYSCIMR); | ||
31 | } | ||
32 | |||
33 | #else /* CONFIG_SMP */ | ||
34 | |||
35 | static inline void r8a7790_sysc_init(void) {} | ||
36 | |||
37 | #endif /* CONFIG_SMP */ | ||
38 | |||
39 | void __init r8a7790_pm_init(void) | ||
40 | { | ||
41 | static int once; | ||
42 | |||
43 | if (!once++) | ||
44 | r8a7790_sysc_init(); | ||
45 | } | ||
diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c new file mode 100644 index 000000000000..1f465a12d1b1 --- /dev/null +++ b/arch/arm/mach-shmobile/pm-rcar.c | |||
@@ -0,0 +1,141 @@ | |||
1 | /* | ||
2 | * R-Car SYSC Power management support | ||
3 | * | ||
4 | * Copyright (C) 2014 Magnus Damm | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/delay.h> | ||
12 | #include <linux/err.h> | ||
13 | #include <linux/mm.h> | ||
14 | #include <linux/spinlock.h> | ||
15 | #include <asm/io.h> | ||
16 | #include <mach/pm-rcar.h> | ||
17 | |||
18 | /* SYSC */ | ||
19 | #define SYSCSR 0x00 | ||
20 | #define SYSCISR 0x04 | ||
21 | #define SYSCISCR 0x08 | ||
22 | |||
23 | #define PWRSR_OFFS 0x00 | ||
24 | #define PWROFFCR_OFFS 0x04 | ||
25 | #define PWRONCR_OFFS 0x0c | ||
26 | #define PWRER_OFFS 0x14 | ||
27 | |||
28 | #define SYSCSR_RETRIES 100 | ||
29 | #define SYSCSR_DELAY_US 1 | ||
30 | |||
31 | #define SYSCISR_RETRIES 1000 | ||
32 | #define SYSCISR_DELAY_US 1 | ||
33 | |||
34 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) | ||
35 | |||
36 | static void __iomem *rcar_sysc_base; | ||
37 | static DEFINE_SPINLOCK(rcar_sysc_lock); /* SMP CPUs + I/O devices */ | ||
38 | |||
39 | static int rcar_sysc_pwr_on_off(struct rcar_sysc_ch *sysc_ch, | ||
40 | int sr_bit, int reg_offs) | ||
41 | { | ||
42 | int k; | ||
43 | |||
44 | for (k = 0; k < SYSCSR_RETRIES; k++) { | ||
45 | if (ioread32(rcar_sysc_base + SYSCSR) & (1 << sr_bit)) | ||
46 | break; | ||
47 | udelay(SYSCSR_DELAY_US); | ||
48 | } | ||
49 | |||
50 | if (k == SYSCSR_RETRIES) | ||
51 | return -EAGAIN; | ||
52 | |||
53 | iowrite32(1 << sysc_ch->chan_bit, | ||
54 | rcar_sysc_base + sysc_ch->chan_offs + reg_offs); | ||
55 | |||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | static int rcar_sysc_pwr_off(struct rcar_sysc_ch *sysc_ch) | ||
60 | { | ||
61 | return rcar_sysc_pwr_on_off(sysc_ch, 0, PWROFFCR_OFFS); | ||
62 | } | ||
63 | |||
64 | static int rcar_sysc_pwr_on(struct rcar_sysc_ch *sysc_ch) | ||
65 | { | ||
66 | return rcar_sysc_pwr_on_off(sysc_ch, 1, PWRONCR_OFFS); | ||
67 | } | ||
68 | |||
69 | static int rcar_sysc_update(struct rcar_sysc_ch *sysc_ch, | ||
70 | int (*on_off_fn)(struct rcar_sysc_ch *)) | ||
71 | { | ||
72 | unsigned int isr_mask = 1 << sysc_ch->isr_bit; | ||
73 | unsigned int chan_mask = 1 << sysc_ch->chan_bit; | ||
74 | unsigned int status; | ||
75 | unsigned long flags; | ||
76 | int ret = 0; | ||
77 | int k; | ||
78 | |||
79 | spin_lock_irqsave(&rcar_sysc_lock, flags); | ||
80 | |||
81 | iowrite32(isr_mask, rcar_sysc_base + SYSCISCR); | ||
82 | |||
83 | do { | ||
84 | ret = on_off_fn(sysc_ch); | ||
85 | if (ret) | ||
86 | goto out; | ||
87 | |||
88 | status = ioread32(rcar_sysc_base + | ||
89 | sysc_ch->chan_offs + PWRER_OFFS); | ||
90 | } while (status & chan_mask); | ||
91 | |||
92 | for (k = 0; k < SYSCISR_RETRIES; k++) { | ||
93 | if (ioread32(rcar_sysc_base + SYSCISR) & isr_mask) | ||
94 | break; | ||
95 | udelay(SYSCISR_DELAY_US); | ||
96 | } | ||
97 | |||
98 | if (k == SYSCISR_RETRIES) | ||
99 | ret = -EIO; | ||
100 | |||
101 | iowrite32(isr_mask, rcar_sysc_base + SYSCISCR); | ||
102 | |||
103 | out: | ||
104 | spin_unlock_irqrestore(&rcar_sysc_lock, flags); | ||
105 | |||
106 | pr_debug("sysc power domain %d: %08x -> %d\n", | ||
107 | sysc_ch->isr_bit, ioread32(rcar_sysc_base + SYSCISR), ret); | ||
108 | return ret; | ||
109 | } | ||
110 | |||
111 | int rcar_sysc_power_down(struct rcar_sysc_ch *sysc_ch) | ||
112 | { | ||
113 | return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_off); | ||
114 | } | ||
115 | |||
116 | int rcar_sysc_power_up(struct rcar_sysc_ch *sysc_ch) | ||
117 | { | ||
118 | return rcar_sysc_update(sysc_ch, rcar_sysc_pwr_on); | ||
119 | } | ||
120 | |||
121 | bool rcar_sysc_power_is_off(struct rcar_sysc_ch *sysc_ch) | ||
122 | { | ||
123 | unsigned int st; | ||
124 | |||
125 | st = ioread32(rcar_sysc_base + sysc_ch->chan_offs + PWRSR_OFFS); | ||
126 | if (st & (1 << sysc_ch->chan_bit)) | ||
127 | return true; | ||
128 | |||
129 | return false; | ||
130 | } | ||
131 | |||
132 | void __iomem *rcar_sysc_init(phys_addr_t base) | ||
133 | { | ||
134 | rcar_sysc_base = ioremap_nocache(base, PAGE_SIZE); | ||
135 | if (!rcar_sysc_base) | ||
136 | panic("unable to ioremap R-Car SYSC hardware block\n"); | ||
137 | |||
138 | return rcar_sysc_base; | ||
139 | } | ||
140 | |||
141 | #endif /* CONFIG_PM || CONFIG_SMP */ | ||
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 69ccc6c6fd33..10604480f325 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | #define MODEMR 0xe6160060 | 29 | #define MODEMR 0xe6160060 |
30 | 30 | ||
31 | u32 __init rcar_gen2_read_mode_pins(void) | 31 | u32 rcar_gen2_read_mode_pins(void) |
32 | { | 32 | { |
33 | void __iomem *modemr = ioremap_nocache(MODEMR, 4); | 33 | void __iomem *modemr = ioremap_nocache(MODEMR, 4); |
34 | u32 mode; | 34 | u32 mode; |
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index 627c1f0d9478..e7a3201473d0 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <mach/common.h> | 26 | #include <mach/common.h> |
27 | #include <mach/pm-rcar.h> | ||
27 | #include <mach/r8a7779.h> | 28 | #include <mach/r8a7779.h> |
28 | #include <asm/cacheflush.h> | 29 | #include <asm/cacheflush.h> |
29 | #include <asm/smp_plat.h> | 30 | #include <asm/smp_plat.h> |
@@ -33,25 +34,25 @@ | |||
33 | #define AVECR IOMEM(0xfe700040) | 34 | #define AVECR IOMEM(0xfe700040) |
34 | #define R8A7779_SCU_BASE 0xf0000000 | 35 | #define R8A7779_SCU_BASE 0xf0000000 |
35 | 36 | ||
36 | static struct r8a7779_pm_ch r8a7779_ch_cpu1 = { | 37 | static struct rcar_sysc_ch r8a7779_ch_cpu1 = { |
37 | .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ | 38 | .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ |
38 | .chan_bit = 1, /* ARM1 */ | 39 | .chan_bit = 1, /* ARM1 */ |
39 | .isr_bit = 1, /* ARM1 */ | 40 | .isr_bit = 1, /* ARM1 */ |
40 | }; | 41 | }; |
41 | 42 | ||
42 | static struct r8a7779_pm_ch r8a7779_ch_cpu2 = { | 43 | static struct rcar_sysc_ch r8a7779_ch_cpu2 = { |
43 | .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ | 44 | .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ |
44 | .chan_bit = 2, /* ARM2 */ | 45 | .chan_bit = 2, /* ARM2 */ |
45 | .isr_bit = 2, /* ARM2 */ | 46 | .isr_bit = 2, /* ARM2 */ |
46 | }; | 47 | }; |
47 | 48 | ||
48 | static struct r8a7779_pm_ch r8a7779_ch_cpu3 = { | 49 | static struct rcar_sysc_ch r8a7779_ch_cpu3 = { |
49 | .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ | 50 | .chan_offs = 0x40, /* PWRSR0 .. PWRER0 */ |
50 | .chan_bit = 3, /* ARM3 */ | 51 | .chan_bit = 3, /* ARM3 */ |
51 | .isr_bit = 3, /* ARM3 */ | 52 | .isr_bit = 3, /* ARM3 */ |
52 | }; | 53 | }; |
53 | 54 | ||
54 | static struct r8a7779_pm_ch *r8a7779_ch_cpu[4] = { | 55 | static struct rcar_sysc_ch *r8a7779_ch_cpu[4] = { |
55 | [1] = &r8a7779_ch_cpu1, | 56 | [1] = &r8a7779_ch_cpu1, |
56 | [2] = &r8a7779_ch_cpu2, | 57 | [2] = &r8a7779_ch_cpu2, |
57 | [3] = &r8a7779_ch_cpu3, | 58 | [3] = &r8a7779_ch_cpu3, |
@@ -67,7 +68,7 @@ void __init r8a7779_register_twd(void) | |||
67 | 68 | ||
68 | static int r8a7779_platform_cpu_kill(unsigned int cpu) | 69 | static int r8a7779_platform_cpu_kill(unsigned int cpu) |
69 | { | 70 | { |
70 | struct r8a7779_pm_ch *ch = NULL; | 71 | struct rcar_sysc_ch *ch = NULL; |
71 | int ret = -EIO; | 72 | int ret = -EIO; |
72 | 73 | ||
73 | cpu = cpu_logical_map(cpu); | 74 | cpu = cpu_logical_map(cpu); |
@@ -76,14 +77,14 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu) | |||
76 | ch = r8a7779_ch_cpu[cpu]; | 77 | ch = r8a7779_ch_cpu[cpu]; |
77 | 78 | ||
78 | if (ch) | 79 | if (ch) |
79 | ret = r8a7779_sysc_power_down(ch); | 80 | ret = rcar_sysc_power_down(ch); |
80 | 81 | ||
81 | return ret ? ret : 1; | 82 | return ret ? ret : 1; |
82 | } | 83 | } |
83 | 84 | ||
84 | static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) | 85 | static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) |
85 | { | 86 | { |
86 | struct r8a7779_pm_ch *ch = NULL; | 87 | struct rcar_sysc_ch *ch = NULL; |
87 | unsigned int lcpu = cpu_logical_map(cpu); | 88 | unsigned int lcpu = cpu_logical_map(cpu); |
88 | int ret; | 89 | int ret; |
89 | 90 | ||
@@ -91,7 +92,7 @@ static int r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
91 | ch = r8a7779_ch_cpu[lcpu]; | 92 | ch = r8a7779_ch_cpu[lcpu]; |
92 | 93 | ||
93 | if (ch) | 94 | if (ch) |
94 | ret = r8a7779_sysc_power_up(ch); | 95 | ret = rcar_sysc_power_up(ch); |
95 | else | 96 | else |
96 | ret = -EIO; | 97 | ret = -EIO; |
97 | 98 | ||
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 015e2753de1f..591052799e8f 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c | |||
@@ -19,6 +19,8 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <asm/smp_plat.h> | 20 | #include <asm/smp_plat.h> |
21 | #include <mach/common.h> | 21 | #include <mach/common.h> |
22 | #include <mach/pm-rcar.h> | ||
23 | #include <mach/r8a7790.h> | ||
22 | 24 | ||
23 | #define RST 0xe6160000 | 25 | #define RST 0xe6160000 |
24 | #define CA15BAR 0x0020 | 26 | #define CA15BAR 0x0020 |
@@ -27,6 +29,16 @@ | |||
27 | #define CA7RESCNT 0x0044 | 29 | #define CA7RESCNT 0x0044 |
28 | #define MERAM 0xe8080000 | 30 | #define MERAM 0xe8080000 |
29 | 31 | ||
32 | static struct rcar_sysc_ch r8a7790_ca15_scu = { | ||
33 | .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ | ||
34 | .isr_bit = 12, /* CA15-SCU */ | ||
35 | }; | ||
36 | |||
37 | static struct rcar_sysc_ch r8a7790_ca7_scu = { | ||
38 | .chan_offs = 0x100, /* PWRSR3 .. PWRER3 */ | ||
39 | .isr_bit = 21, /* CA7-SCU */ | ||
40 | }; | ||
41 | |||
30 | static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) | 42 | static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) |
31 | { | 43 | { |
32 | void __iomem *p; | 44 | void __iomem *p; |
@@ -54,6 +66,11 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) | |||
54 | writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, | 66 | writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, |
55 | p + CA7RESCNT); | 67 | p + CA7RESCNT); |
56 | iounmap(p); | 68 | iounmap(p); |
69 | |||
70 | /* turn on power to SCU */ | ||
71 | r8a7790_pm_init(); | ||
72 | rcar_sysc_power_up(&r8a7790_ca15_scu); | ||
73 | rcar_sysc_power_up(&r8a7790_ca7_scu); | ||
57 | } | 74 | } |
58 | 75 | ||
59 | struct smp_operations r8a7790_smp_ops __initdata = { | 76 | struct smp_operations r8a7790_smp_ops __initdata = { |
diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig index aee77f06f887..b5f8d75d51a0 100644 --- a/arch/arm/mach-socfpga/Kconfig +++ b/arch/arm/mach-socfpga/Kconfig | |||
@@ -1,17 +1,10 @@ | |||
1 | config ARCH_SOCFPGA | 1 | config ARCH_SOCFPGA |
2 | bool "Altera SOCFPGA family" if ARCH_MULTI_V7 | 2 | bool "Altera SOCFPGA family" if ARCH_MULTI_V7 |
3 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
4 | select ARM_AMBA | 3 | select ARM_AMBA |
5 | select ARM_GIC | 4 | select ARM_GIC |
6 | select CACHE_L2X0 | 5 | select CACHE_L2X0 |
7 | select COMMON_CLK | ||
8 | select CPU_V7 | ||
9 | select DW_APB_TIMER_OF | 6 | select DW_APB_TIMER_OF |
10 | select GENERIC_CLOCKEVENTS | ||
11 | select GPIO_PL061 if GPIOLIB | 7 | select GPIO_PL061 if GPIOLIB |
12 | select HAVE_ARM_SCU | 8 | select HAVE_ARM_SCU |
13 | select HAVE_ARM_TWD if SMP | 9 | select HAVE_ARM_TWD if SMP |
14 | select HAVE_SMP | ||
15 | select MFD_SYSCON | 10 | select MFD_SYSCON |
16 | select SPARSE_IRQ | ||
17 | select USE_OF | ||
diff --git a/arch/arm/mach-spear/Kconfig b/arch/arm/mach-spear/Kconfig index ac1710e64d9a..5c57262b97e9 100644 --- a/arch/arm/mach-spear/Kconfig +++ b/arch/arm/mach-spear/Kconfig | |||
@@ -8,8 +8,6 @@ menuconfig PLAT_SPEAR | |||
8 | select ARCH_REQUIRE_GPIOLIB | 8 | select ARCH_REQUIRE_GPIOLIB |
9 | select ARM_AMBA | 9 | select ARM_AMBA |
10 | select CLKSRC_MMIO | 10 | select CLKSRC_MMIO |
11 | select COMMON_CLK | ||
12 | select GENERIC_CLOCKEVENTS | ||
13 | 11 | ||
14 | if PLAT_SPEAR | 12 | if PLAT_SPEAR |
15 | 13 | ||
@@ -18,14 +16,10 @@ config ARCH_SPEAR13XX | |||
18 | depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE | 16 | depends on ARCH_MULTI_V7 || PLAT_SPEAR_SINGLE |
19 | select ARCH_HAS_CPUFREQ | 17 | select ARCH_HAS_CPUFREQ |
20 | select ARM_GIC | 18 | select ARM_GIC |
21 | select CPU_V7 | ||
22 | select GPIO_SPEAR_SPICS | 19 | select GPIO_SPEAR_SPICS |
23 | select HAVE_ARM_SCU if SMP | 20 | select HAVE_ARM_SCU if SMP |
24 | select HAVE_ARM_TWD if SMP | 21 | select HAVE_ARM_TWD if SMP |
25 | select HAVE_SMP | ||
26 | select MIGHT_HAVE_CACHE_L2X0 | ||
27 | select PINCTRL | 22 | select PINCTRL |
28 | select USE_OF | ||
29 | help | 23 | help |
30 | Supports for ARM's SPEAR13XX family | 24 | Supports for ARM's SPEAR13XX family |
31 | 25 | ||
@@ -50,9 +44,7 @@ config ARCH_SPEAR3XX | |||
50 | depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE | 44 | depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE |
51 | depends on !ARCH_SPEAR13XX | 45 | depends on !ARCH_SPEAR13XX |
52 | select ARM_VIC | 46 | select ARM_VIC |
53 | select CPU_ARM926T | ||
54 | select PINCTRL | 47 | select PINCTRL |
55 | select USE_OF | ||
56 | help | 48 | help |
57 | Supports for ARM's SPEAR3XX family | 49 | Supports for ARM's SPEAR3XX family |
58 | 50 | ||
@@ -83,14 +75,12 @@ config ARCH_SPEAR6XX | |||
83 | depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE | 75 | depends on ARCH_MULTI_V5 || PLAT_SPEAR_SINGLE |
84 | depends on !ARCH_SPEAR13XX | 76 | depends on !ARCH_SPEAR13XX |
85 | select ARM_VIC | 77 | select ARM_VIC |
86 | select CPU_ARM926T | ||
87 | help | 78 | help |
88 | Supports for ARM's SPEAR6XX family | 79 | Supports for ARM's SPEAR6XX family |
89 | 80 | ||
90 | config MACH_SPEAR600 | 81 | config MACH_SPEAR600 |
91 | def_bool y | 82 | def_bool y |
92 | depends on ARCH_SPEAR6XX | 83 | depends on ARCH_SPEAR6XX |
93 | select USE_OF | ||
94 | help | 84 | help |
95 | Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig" | 85 | Supports ST SPEAr600 boards configured via the device-treesource "arch/arm/mach-spear6xx/Kconfig" |
96 | 86 | ||
diff --git a/arch/arm/mach-sti/Kconfig b/arch/arm/mach-sti/Kconfig index d71654bc8d54..d2c13ba1190b 100644 --- a/arch/arm/mach-sti/Kconfig +++ b/arch/arm/mach-sti/Kconfig | |||
@@ -1,14 +1,10 @@ | |||
1 | menuconfig ARCH_STI | 1 | menuconfig ARCH_STI |
2 | bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7 | 2 | bool "STMicroelectronics Consumer Electronics SOCs with Device Trees" if ARCH_MULTI_V7 |
3 | select GENERIC_CLOCKEVENTS | ||
4 | select CLKDEV_LOOKUP | ||
5 | select ARM_GIC | 3 | select ARM_GIC |
6 | select ARM_GLOBAL_TIMER | 4 | select ARM_GLOBAL_TIMER |
7 | select PINCTRL | 5 | select PINCTRL |
8 | select PINCTRL_ST | 6 | select PINCTRL_ST |
9 | select MFD_SYSCON | 7 | select MFD_SYSCON |
10 | select MIGHT_HAVE_CACHE_L2X0 | ||
11 | select HAVE_SMP | ||
12 | select HAVE_ARM_SCU if SMP | 8 | select HAVE_ARM_SCU if SMP |
13 | select ARCH_REQUIRE_GPIOLIB | 9 | select ARCH_REQUIRE_GPIOLIB |
14 | select ARM_ERRATA_754322 | 10 | select ARM_ERRATA_754322 |
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index b9d6cad8669b..9de27cfa688f 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig | |||
@@ -5,14 +5,9 @@ config ARCH_SUNXI | |||
5 | select ARM_GIC | 5 | select ARM_GIC |
6 | select ARM_PSCI | 6 | select ARM_PSCI |
7 | select CLKSRC_MMIO | 7 | select CLKSRC_MMIO |
8 | select CLKSRC_OF | ||
9 | select COMMON_CLK | ||
10 | select GENERIC_CLOCKEVENTS | ||
11 | select GENERIC_IRQ_CHIP | 8 | select GENERIC_IRQ_CHIP |
12 | select HAVE_SMP | ||
13 | select PINCTRL | 9 | select PINCTRL |
14 | select PINCTRL_SUNXI | 10 | select PINCTRL_SUNXI |
15 | select RESET_CONTROLLER | 11 | select RESET_CONTROLLER |
16 | select SPARSE_IRQ | ||
17 | select SUN4I_TIMER | 12 | select SUN4I_TIMER |
18 | select SUN5I_HSTIMER | 13 | select SUN5I_HSTIMER |
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c index aeea6ceea725..460b5a4962ef 100644 --- a/arch/arm/mach-sunxi/sunxi.c +++ b/arch/arm/mach-sunxi/sunxi.c | |||
@@ -94,8 +94,8 @@ static void sun6i_restart(enum reboot_mode mode, const char *cmd) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | static struct of_device_id sunxi_restart_ids[] = { | 96 | static struct of_device_id sunxi_restart_ids[] = { |
97 | { .compatible = "allwinner,sun4i-wdt" }, | 97 | { .compatible = "allwinner,sun4i-a10-wdt" }, |
98 | { .compatible = "allwinner,sun6i-wdt" }, | 98 | { .compatible = "allwinner,sun6i-a31-wdt" }, |
99 | { /*sentinel*/ } | 99 | { /*sentinel*/ } |
100 | }; | 100 | }; |
101 | 101 | ||
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index b1232d8be6f5..f61cd5b9f103 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig | |||
@@ -5,24 +5,16 @@ config ARCH_TEGRA | |||
5 | select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS | 5 | select ARCH_SUPPORTS_TRUSTED_FOUNDATIONS |
6 | select ARM_GIC | 6 | select ARM_GIC |
7 | select CLKSRC_MMIO | 7 | select CLKSRC_MMIO |
8 | select CLKSRC_OF | ||
9 | select COMMON_CLK | ||
10 | select CPU_V7 | ||
11 | select GENERIC_CLOCKEVENTS | ||
12 | select HAVE_ARM_SCU if SMP | 8 | select HAVE_ARM_SCU if SMP |
13 | select HAVE_ARM_TWD if SMP | 9 | select HAVE_ARM_TWD if SMP |
14 | select HAVE_SMP | ||
15 | select MIGHT_HAVE_CACHE_L2X0 | ||
16 | select MIGHT_HAVE_PCI | 10 | select MIGHT_HAVE_PCI |
17 | select PINCTRL | 11 | select PINCTRL |
18 | select ARCH_HAS_RESET_CONTROLLER | 12 | select ARCH_HAS_RESET_CONTROLLER |
19 | select RESET_CONTROLLER | 13 | select RESET_CONTROLLER |
20 | select SOC_BUS | 14 | select SOC_BUS |
21 | select SPARSE_IRQ | ||
22 | select USB_ARCH_HAS_EHCI if USB_SUPPORT | 15 | select USB_ARCH_HAS_EHCI if USB_SUPPORT |
23 | select USB_ULPI if USB_PHY | 16 | select USB_ULPI if USB_PHY |
24 | select USB_ULPI_VIEWPORT if USB_PHY | 17 | select USB_ULPI_VIEWPORT if USB_PHY |
25 | select USE_OF | ||
26 | help | 18 | help |
27 | This enables support for NVIDIA Tegra based systems. | 19 | This enables support for NVIDIA Tegra based systems. |
28 | 20 | ||
diff --git a/arch/arm/mach-tegra/cpuidle-tegra114.c b/arch/arm/mach-tegra/cpuidle-tegra114.c index e0b87300243d..b5fb7c110c64 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra114.c +++ b/arch/arm/mach-tegra/cpuidle-tegra114.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/cpuidle.h> | 19 | #include <linux/cpuidle.h> |
20 | #include <linux/cpu_pm.h> | 20 | #include <linux/cpu_pm.h> |
21 | #include <linux/clockchips.h> | 21 | #include <linux/clockchips.h> |
22 | #include <asm/firmware.h> | ||
22 | 23 | ||
23 | #include <asm/cpuidle.h> | 24 | #include <asm/cpuidle.h> |
24 | #include <asm/suspend.h> | 25 | #include <asm/suspend.h> |
@@ -45,7 +46,11 @@ static int tegra114_idle_power_down(struct cpuidle_device *dev, | |||
45 | 46 | ||
46 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu); | 47 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu); |
47 | 48 | ||
48 | cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); | 49 | call_firmware_op(prepare_idle); |
50 | |||
51 | /* Do suspend by ourselves if the firmware does not implement it */ | ||
52 | if (call_firmware_op(do_idle) == -ENOSYS) | ||
53 | cpu_suspend(0, tegra30_sleep_cpu_secondary_finish); | ||
49 | 54 | ||
50 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); | 55 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &dev->cpu); |
51 | 56 | ||
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 4ae0286b468d..f55b05a29b55 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/cpu_pm.h> | 24 | #include <linux/cpu_pm.h> |
25 | #include <linux/suspend.h> | 25 | #include <linux/suspend.h> |
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/slab.h> | ||
27 | #include <linux/clk/tegra.h> | 28 | #include <linux/clk/tegra.h> |
28 | 29 | ||
29 | #include <asm/smp_plat.h> | 30 | #include <asm/smp_plat.h> |
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 303a285d80fd..6191603379e1 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c | |||
@@ -73,10 +73,20 @@ u32 tegra_uart_config[3] = { | |||
73 | static void __init tegra_init_cache(void) | 73 | static void __init tegra_init_cache(void) |
74 | { | 74 | { |
75 | #ifdef CONFIG_CACHE_L2X0 | 75 | #ifdef CONFIG_CACHE_L2X0 |
76 | static const struct of_device_id pl310_ids[] __initconst = { | ||
77 | { .compatible = "arm,pl310-cache", }, | ||
78 | {} | ||
79 | }; | ||
80 | |||
81 | struct device_node *np; | ||
76 | int ret; | 82 | int ret; |
77 | void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000; | 83 | void __iomem *p = IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x3000; |
78 | u32 aux_ctrl, cache_type; | 84 | u32 aux_ctrl, cache_type; |
79 | 85 | ||
86 | np = of_find_matching_node(NULL, pl310_ids); | ||
87 | if (!np) | ||
88 | return; | ||
89 | |||
80 | cache_type = readl(p + L2X0_CACHE_TYPE); | 90 | cache_type = readl(p + L2X0_CACHE_TYPE); |
81 | aux_ctrl = (cache_type & 0x700) << (17-8); | 91 | aux_ctrl = (cache_type & 0x700) << (17-8); |
82 | aux_ctrl |= 0x7C400001; | 92 | aux_ctrl |= 0x7C400001; |
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig index 8e23071bd1b3..e3a96d7302e9 100644 --- a/arch/arm/mach-u300/Kconfig +++ b/arch/arm/mach-u300/Kconfig | |||
@@ -3,20 +3,14 @@ config ARCH_U300 | |||
3 | depends on MMU | 3 | depends on MMU |
4 | select ARCH_REQUIRE_GPIOLIB | 4 | select ARCH_REQUIRE_GPIOLIB |
5 | select ARM_AMBA | 5 | select ARM_AMBA |
6 | select ARM_PATCH_PHYS_VIRT | ||
7 | select ARM_VIC | 6 | select ARM_VIC |
8 | select CLKSRC_MMIO | 7 | select CLKSRC_MMIO |
9 | select CLKSRC_OF | ||
10 | select COMMON_CLK | ||
11 | select CPU_ARM926T | 8 | select CPU_ARM926T |
12 | select GENERIC_CLOCKEVENTS | ||
13 | select HAVE_TCM | 9 | select HAVE_TCM |
14 | select PINCTRL | 10 | select PINCTRL |
15 | select PINCTRL_COH901 | 11 | select PINCTRL_COH901 |
16 | select PINCTRL_U300 | 12 | select PINCTRL_U300 |
17 | select SPARSE_IRQ | ||
18 | select MFD_SYSCON | 13 | select MFD_SYSCON |
19 | select USE_OF | ||
20 | help | 14 | help |
21 | Support for ST-Ericsson U300 series mobile platforms. | 15 | Support for ST-Ericsson U300 series mobile platforms. |
22 | 16 | ||
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 0034d2cd6973..8052bd52450d 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig | |||
@@ -11,13 +11,8 @@ config ARCH_U8500 | |||
11 | select ARM_GIC | 11 | select ARM_GIC |
12 | select CACHE_L2X0 | 12 | select CACHE_L2X0 |
13 | select CLKSRC_NOMADIK_MTU | 13 | select CLKSRC_NOMADIK_MTU |
14 | select COMMON_CLK | ||
15 | select CPU_V7 | ||
16 | select GENERIC_CLOCKEVENTS | ||
17 | select HAVE_ARM_SCU if SMP | 14 | select HAVE_ARM_SCU if SMP |
18 | select HAVE_ARM_TWD if SMP | 15 | select HAVE_ARM_TWD if SMP |
19 | select HAVE_SMP | ||
20 | select MIGHT_HAVE_CACHE_L2X0 | ||
21 | select PINCTRL | 16 | select PINCTRL |
22 | select PINCTRL_ABX500 | 17 | select PINCTRL_ABX500 |
23 | select PINCTRL_NOMADIK | 18 | select PINCTRL_NOMADIK |
@@ -76,7 +71,6 @@ config UX500_AUTO_PLATFORM | |||
76 | config MACH_UX500_DT | 71 | config MACH_UX500_DT |
77 | bool "Generic U8500 support using device tree" | 72 | bool "Generic U8500 support using device tree" |
78 | depends on MACH_MOP500 | 73 | depends on MACH_MOP500 |
79 | select USE_OF | ||
80 | 74 | ||
81 | endmenu | 75 | endmenu |
82 | 76 | ||
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index 4a70be485ff8..80b4be36f10a 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig | |||
@@ -5,16 +5,11 @@ config ARCH_VEXPRESS | |||
5 | select ARM_AMBA | 5 | select ARM_AMBA |
6 | select ARM_GIC | 6 | select ARM_GIC |
7 | select ARM_TIMER_SP804 | 7 | select ARM_TIMER_SP804 |
8 | select COMMON_CLK | ||
9 | select COMMON_CLK_VERSATILE | 8 | select COMMON_CLK_VERSATILE |
10 | select CPU_V7 | ||
11 | select GENERIC_CLOCKEVENTS | ||
12 | select HAVE_ARM_SCU if SMP | 9 | select HAVE_ARM_SCU if SMP |
13 | select HAVE_ARM_TWD if SMP | 10 | select HAVE_ARM_TWD if SMP |
14 | select HAVE_PATA_PLATFORM | 11 | select HAVE_PATA_PLATFORM |
15 | select HAVE_SMP | ||
16 | select ICST | 12 | select ICST |
17 | select MIGHT_HAVE_CACHE_L2X0 | ||
18 | select NO_IOPORT | 13 | select NO_IOPORT |
19 | select PLAT_VERSATILE | 14 | select PLAT_VERSATILE |
20 | select PLAT_VERSATILE_CLCD | 15 | select PLAT_VERSATILE_CLCD |
diff --git a/arch/arm/mach-virt/Kconfig b/arch/arm/mach-virt/Kconfig deleted file mode 100644 index 081d46929436..000000000000 --- a/arch/arm/mach-virt/Kconfig +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | config ARCH_VIRT | ||
2 | bool "Dummy Virtual Machine" if ARCH_MULTI_V7 | ||
3 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
4 | select ARM_GIC | ||
5 | select HAVE_ARM_ARCH_TIMER | ||
6 | select ARM_PSCI | ||
7 | select HAVE_SMP | ||
8 | select CPU_V7 | ||
9 | select SPARSE_IRQ | ||
10 | select USE_OF | ||
diff --git a/arch/arm/mach-virt/Makefile b/arch/arm/mach-virt/Makefile deleted file mode 100644 index 7ddbfa60227f..000000000000 --- a/arch/arm/mach-virt/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for the linux kernel. | ||
3 | # | ||
4 | |||
5 | obj-y := virt.o | ||
diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c deleted file mode 100644 index b184e57d1854..000000000000 --- a/arch/arm/mach-virt/virt.c +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | /* | ||
2 | * Dummy Virtual Machine - does what it says on the tin. | ||
3 | * | ||
4 | * Copyright (C) 2012 ARM Ltd | ||
5 | * Authors: Will Deacon <will.deacon@arm.com>, | ||
6 | * Marc Zyngier <marc.zyngier@arm.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #include <linux/of_irq.h> | ||
22 | #include <linux/of_platform.h> | ||
23 | #include <linux/smp.h> | ||
24 | |||
25 | #include <asm/mach/arch.h> | ||
26 | |||
27 | static void __init virt_init(void) | ||
28 | { | ||
29 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
30 | } | ||
31 | |||
32 | static const char *virt_dt_match[] = { | ||
33 | "linux,dummy-virt", | ||
34 | "xen,xenvm", | ||
35 | NULL | ||
36 | }; | ||
37 | |||
38 | DT_MACHINE_START(VIRT, "Dummy Virtual Machine") | ||
39 | .init_machine = virt_init, | ||
40 | .dt_compat = virt_dt_match, | ||
41 | MACHINE_END | ||
diff --git a/arch/arm/mach-vt8500/Kconfig b/arch/arm/mach-vt8500/Kconfig index 927be93b692e..08f56a41cb55 100644 --- a/arch/arm/mach-vt8500/Kconfig +++ b/arch/arm/mach-vt8500/Kconfig | |||
@@ -3,8 +3,6 @@ config ARCH_VT8500 | |||
3 | select ARCH_HAS_CPUFREQ | 3 | select ARCH_HAS_CPUFREQ |
4 | select ARCH_REQUIRE_GPIOLIB | 4 | select ARCH_REQUIRE_GPIOLIB |
5 | select CLKDEV_LOOKUP | 5 | select CLKDEV_LOOKUP |
6 | select CLKSRC_OF | ||
7 | select GENERIC_CLOCKEVENTS | ||
8 | select VT8500_TIMER | 6 | select VT8500_TIMER |
9 | select PINCTRL | 7 | select PINCTRL |
10 | help | 8 | help |
@@ -21,7 +19,6 @@ config ARCH_WM8750 | |||
21 | bool "WonderMedia WM8750" | 19 | bool "WonderMedia WM8750" |
22 | depends on ARCH_MULTI_V6 | 20 | depends on ARCH_MULTI_V6 |
23 | select ARCH_VT8500 | 21 | select ARCH_VT8500 |
24 | select CPU_V6 | ||
25 | help | 22 | help |
26 | Support for WonderMedia WM8750 System-on-Chip. | 23 | Support for WonderMedia WM8750 System-on-Chip. |
27 | 24 | ||
@@ -29,6 +26,5 @@ config ARCH_WM8850 | |||
29 | bool "WonderMedia WM8850" | 26 | bool "WonderMedia WM8850" |
30 | depends on ARCH_MULTI_V7 | 27 | depends on ARCH_MULTI_V7 |
31 | select ARCH_VT8500 | 28 | select ARCH_VT8500 |
32 | select CPU_V7 | ||
33 | help | 29 | help |
34 | Support for WonderMedia WM8850 System-on-Chip. | 30 | Support for WonderMedia WM8850 System-on-Chip. |
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index 6b04260aa142..105d39b72a25 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig | |||
@@ -2,16 +2,9 @@ config ARCH_ZYNQ | |||
2 | bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 | 2 | bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 |
3 | select ARM_AMBA | 3 | select ARM_AMBA |
4 | select ARM_GIC | 4 | select ARM_GIC |
5 | select COMMON_CLK | ||
6 | select CPU_V7 | ||
7 | select GENERIC_CLOCKEVENTS | ||
8 | select HAVE_ARM_SCU if SMP | 5 | select HAVE_ARM_SCU if SMP |
9 | select HAVE_ARM_TWD if SMP | 6 | select HAVE_ARM_TWD if SMP |
10 | select ICST | 7 | select ICST |
11 | select MIGHT_HAVE_CACHE_L2X0 | ||
12 | select USE_OF | ||
13 | select HAVE_SMP | ||
14 | select SPARSE_IRQ | ||
15 | select CADENCE_TTC_TIMER | 8 | select CADENCE_TTC_TIMER |
16 | select ARM_GLOBAL_TIMER | 9 | select ARM_GLOBAL_TIMER |
17 | help | 10 | help |
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 1db2a5ca9ab8..8c09a8393fb6 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/of_irq.h> | 25 | #include <linux/of_irq.h> |
26 | #include <linux/of_platform.h> | 26 | #include <linux/of_platform.h> |
27 | #include <linux/of.h> | 27 | #include <linux/of.h> |
28 | #include <linux/memblock.h> | ||
28 | #include <linux/irqchip.h> | 29 | #include <linux/irqchip.h> |
29 | #include <linux/irqchip/arm-gic.h> | 30 | #include <linux/irqchip/arm-gic.h> |
30 | 31 | ||
@@ -41,6 +42,18 @@ | |||
41 | 42 | ||
42 | void __iomem *zynq_scu_base; | 43 | void __iomem *zynq_scu_base; |
43 | 44 | ||
45 | /** | ||
46 | * zynq_memory_init - Initialize special memory | ||
47 | * | ||
48 | * We need to stop things allocating the low memory as DMA can't work in | ||
49 | * the 1st 512K of memory. | ||
50 | */ | ||
51 | static void __init zynq_memory_init(void) | ||
52 | { | ||
53 | if (!__pa(PAGE_OFFSET)) | ||
54 | memblock_reserve(__pa(PAGE_OFFSET), __pa(swapper_pg_dir)); | ||
55 | } | ||
56 | |||
44 | static struct platform_device zynq_cpuidle_device = { | 57 | static struct platform_device zynq_cpuidle_device = { |
45 | .name = "cpuidle-zynq", | 58 | .name = "cpuidle-zynq", |
46 | }; | 59 | }; |
@@ -117,5 +130,6 @@ DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") | |||
117 | .init_machine = zynq_init_machine, | 130 | .init_machine = zynq_init_machine, |
118 | .init_time = zynq_timer_init, | 131 | .init_time = zynq_timer_init, |
119 | .dt_compat = zynq_dt_match, | 132 | .dt_compat = zynq_dt_match, |
133 | .reserve = zynq_memory_init, | ||
120 | .restart = zynq_system_reset, | 134 | .restart = zynq_system_reset, |
121 | MACHINE_END | 135 | MACHINE_END |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 1f8fed94c2a4..dccd7e177653 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -855,7 +855,7 @@ config OUTER_CACHE_SYNC | |||
855 | 855 | ||
856 | config CACHE_FEROCEON_L2 | 856 | config CACHE_FEROCEON_L2 |
857 | bool "Enable the Feroceon L2 cache controller" | 857 | bool "Enable the Feroceon L2 cache controller" |
858 | depends on ARCH_KIRKWOOD || ARCH_MV78XX0 | 858 | depends on ARCH_KIRKWOOD || ARCH_MV78XX0 || ARCH_MVEBU |
859 | default y | 859 | default y |
860 | select OUTER_CACHE | 860 | select OUTER_CACHE |
861 | help | 861 | help |
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index 48bc3c0a87ce..8dc1a2b5a8ed 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c | |||
@@ -13,10 +13,15 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/of.h> | ||
17 | #include <linux/of_address.h> | ||
16 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
19 | #include <linux/io.h> | ||
17 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
18 | #include <asm/cp15.h> | 21 | #include <asm/cp15.h> |
19 | #include <plat/cache-feroceon-l2.h> | 22 | #include <asm/hardware/cache-feroceon-l2.h> |
23 | |||
24 | #define L2_WRITETHROUGH_KIRKWOOD BIT(4) | ||
20 | 25 | ||
21 | /* | 26 | /* |
22 | * Low-level cache maintenance operations. | 27 | * Low-level cache maintenance operations. |
@@ -350,3 +355,41 @@ void __init feroceon_l2_init(int __l2_wt_override) | |||
350 | printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", | 355 | printk(KERN_INFO "Feroceon L2: Cache support initialised%s.\n", |
351 | l2_wt_override ? ", in WT override mode" : ""); | 356 | l2_wt_override ? ", in WT override mode" : ""); |
352 | } | 357 | } |
358 | #ifdef CONFIG_OF | ||
359 | static const struct of_device_id feroceon_ids[] __initconst = { | ||
360 | { .compatible = "marvell,kirkwood-cache"}, | ||
361 | { .compatible = "marvell,feroceon-cache"}, | ||
362 | {} | ||
363 | }; | ||
364 | |||
365 | int __init feroceon_of_init(void) | ||
366 | { | ||
367 | struct device_node *node; | ||
368 | void __iomem *base; | ||
369 | bool l2_wt_override = false; | ||
370 | struct resource res; | ||
371 | |||
372 | #if defined(CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH) | ||
373 | l2_wt_override = true; | ||
374 | #endif | ||
375 | |||
376 | node = of_find_matching_node(NULL, feroceon_ids); | ||
377 | if (node && of_device_is_compatible(node, "marvell,kirkwood-cache")) { | ||
378 | if (of_address_to_resource(node, 0, &res)) | ||
379 | return -ENODEV; | ||
380 | |||
381 | base = ioremap(res.start, resource_size(&res)); | ||
382 | if (!base) | ||
383 | return -ENOMEM; | ||
384 | |||
385 | if (l2_wt_override) | ||
386 | writel(readl(base) | L2_WRITETHROUGH_KIRKWOOD, base); | ||
387 | else | ||
388 | writel(readl(base) & ~L2_WRITETHROUGH_KIRKWOOD, base); | ||
389 | } | ||
390 | |||
391 | feroceon_l2_init(l2_wt_override); | ||
392 | |||
393 | return 0; | ||
394 | } | ||
395 | #endif | ||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 1a77450e728a..11b3914660d2 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -1358,7 +1358,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size, | |||
1358 | *handle = DMA_ERROR_CODE; | 1358 | *handle = DMA_ERROR_CODE; |
1359 | size = PAGE_ALIGN(size); | 1359 | size = PAGE_ALIGN(size); |
1360 | 1360 | ||
1361 | if (gfp & GFP_ATOMIC) | 1361 | if (!(gfp & __GFP_WAIT)) |
1362 | return __iommu_alloc_atomic(dev, size, handle); | 1362 | return __iommu_alloc_atomic(dev, size, handle); |
1363 | 1363 | ||
1364 | /* | 1364 | /* |
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index d5a982d15a88..7ea641b7aa7d 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h | |||
@@ -38,6 +38,7 @@ static inline pmd_t *pmd_off_k(unsigned long virt) | |||
38 | 38 | ||
39 | struct mem_type { | 39 | struct mem_type { |
40 | pteval_t prot_pte; | 40 | pteval_t prot_pte; |
41 | pteval_t prot_pte_s2; | ||
41 | pmdval_t prot_l1; | 42 | pmdval_t prot_l1; |
42 | pmdval_t prot_sect; | 43 | pmdval_t prot_sect; |
43 | unsigned int domain; | 44 | unsigned int domain; |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4f08c133cc25..a623cb3ad012 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -232,12 +232,16 @@ __setup("noalign", noalign_setup); | |||
232 | #endif /* ifdef CONFIG_CPU_CP15 / else */ | 232 | #endif /* ifdef CONFIG_CPU_CP15 / else */ |
233 | 233 | ||
234 | #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN | 234 | #define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_XN |
235 | #define PROT_PTE_S2_DEVICE PROT_PTE_DEVICE | ||
235 | #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE | 236 | #define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_AP_WRITE |
236 | 237 | ||
237 | static struct mem_type mem_types[] = { | 238 | static struct mem_type mem_types[] = { |
238 | [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ | 239 | [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */ |
239 | .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | | 240 | .prot_pte = PROT_PTE_DEVICE | L_PTE_MT_DEV_SHARED | |
240 | L_PTE_SHARED, | 241 | L_PTE_SHARED, |
242 | .prot_pte_s2 = s2_policy(PROT_PTE_S2_DEVICE) | | ||
243 | s2_policy(L_PTE_S2_MT_DEV_SHARED) | | ||
244 | L_PTE_SHARED, | ||
241 | .prot_l1 = PMD_TYPE_TABLE, | 245 | .prot_l1 = PMD_TYPE_TABLE, |
242 | .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S, | 246 | .prot_sect = PROT_SECT_DEVICE | PMD_SECT_S, |
243 | .domain = DOMAIN_IO, | 247 | .domain = DOMAIN_IO, |
@@ -508,7 +512,8 @@ static void __init build_mem_type_table(void) | |||
508 | cp = &cache_policies[cachepolicy]; | 512 | cp = &cache_policies[cachepolicy]; |
509 | vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; | 513 | vecs_pgprot = kern_pgprot = user_pgprot = cp->pte; |
510 | s2_pgprot = cp->pte_s2; | 514 | s2_pgprot = cp->pte_s2; |
511 | hyp_device_pgprot = s2_device_pgprot = mem_types[MT_DEVICE].prot_pte; | 515 | hyp_device_pgprot = mem_types[MT_DEVICE].prot_pte; |
516 | s2_device_pgprot = mem_types[MT_DEVICE].prot_pte_s2; | ||
512 | 517 | ||
513 | /* | 518 | /* |
514 | * ARMv6 and above have extended page tables. | 519 | * ARMv6 and above have extended page tables. |
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 45dc29f85d56..32b3558321c4 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -208,7 +208,6 @@ __v6_setup: | |||
208 | mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache | 208 | mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache |
209 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache | 209 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache |
210 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache | 210 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache |
211 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | ||
212 | #ifdef CONFIG_MMU | 211 | #ifdef CONFIG_MMU |
213 | mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs | 212 | mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs |
214 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register | 213 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register |
@@ -218,6 +217,8 @@ __v6_setup: | |||
218 | ALT_UP(orr r8, r8, #TTB_FLAGS_UP) | 217 | ALT_UP(orr r8, r8, #TTB_FLAGS_UP) |
219 | mcr p15, 0, r8, c2, c0, 1 @ load TTB1 | 218 | mcr p15, 0, r8, c2, c0, 1 @ load TTB1 |
220 | #endif /* CONFIG_MMU */ | 219 | #endif /* CONFIG_MMU */ |
220 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer and | ||
221 | @ complete invalidations | ||
221 | adr r5, v6_crval | 222 | adr r5, v6_crval |
222 | ldmia r5, {r5, r6} | 223 | ldmia r5, {r5, r6} |
223 | ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables | 224 | ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index bd1781979a39..74f6033e76dd 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -351,7 +351,6 @@ __v7_setup: | |||
351 | 351 | ||
352 | 4: mov r10, #0 | 352 | 4: mov r10, #0 |
353 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate | 353 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate |
354 | dsb | ||
355 | #ifdef CONFIG_MMU | 354 | #ifdef CONFIG_MMU |
356 | mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs | 355 | mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs |
357 | v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup | 356 | v7_ttb_setup r10, r4, r8, r5 @ TTBCR, TTBRx setup |
@@ -360,6 +359,7 @@ __v7_setup: | |||
360 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 359 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |
361 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR | 360 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR |
362 | #endif | 361 | #endif |
362 | dsb @ Complete invalidations | ||
363 | #ifndef CONFIG_ARM_THUMBEE | 363 | #ifndef CONFIG_ARM_THUMBEE |
364 | mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE | 364 | mrc p15, 0, r0, c0, c1, 0 @ read ID_PFR0 for ThumbEE |
365 | and r0, r0, #(0xf << 12) @ ThumbEE enabled field | 365 | and r0, r0, #(0xf << 12) @ ThumbEE enabled field |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index dd4327f09ba4..27bbcfc7202a 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -36,6 +36,7 @@ config ARM64 | |||
36 | select HAVE_GENERIC_DMA_COHERENT | 36 | select HAVE_GENERIC_DMA_COHERENT |
37 | select HAVE_HW_BREAKPOINT if PERF_EVENTS | 37 | select HAVE_HW_BREAKPOINT if PERF_EVENTS |
38 | select HAVE_MEMBLOCK | 38 | select HAVE_MEMBLOCK |
39 | select HAVE_PATA_PLATFORM | ||
39 | select HAVE_PERF_EVENTS | 40 | select HAVE_PERF_EVENTS |
40 | select IRQ_DOMAIN | 41 | select IRQ_DOMAIN |
41 | select MODULES_USE_ELF_RELA | 42 | select MODULES_USE_ELF_RELA |
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 84139be62ae6..7959dd0ca5d5 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig | |||
@@ -1,4 +1,3 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | # CONFIG_LOCALVERSION_AUTO is not set | 1 | # CONFIG_LOCALVERSION_AUTO is not set |
3 | # CONFIG_SWAP is not set | 2 | # CONFIG_SWAP is not set |
4 | CONFIG_SYSVIPC=y | 3 | CONFIG_SYSVIPC=y |
@@ -19,6 +18,7 @@ CONFIG_BLK_DEV_INITRD=y | |||
19 | CONFIG_KALLSYMS_ALL=y | 18 | CONFIG_KALLSYMS_ALL=y |
20 | # CONFIG_COMPAT_BRK is not set | 19 | # CONFIG_COMPAT_BRK is not set |
21 | CONFIG_PROFILING=y | 20 | CONFIG_PROFILING=y |
21 | CONFIG_JUMP_LABEL=y | ||
22 | CONFIG_MODULES=y | 22 | CONFIG_MODULES=y |
23 | CONFIG_MODULE_UNLOAD=y | 23 | CONFIG_MODULE_UNLOAD=y |
24 | # CONFIG_BLK_DEV_BSG is not set | 24 | # CONFIG_BLK_DEV_BSG is not set |
@@ -27,6 +27,7 @@ CONFIG_ARCH_VEXPRESS=y | |||
27 | CONFIG_ARCH_XGENE=y | 27 | CONFIG_ARCH_XGENE=y |
28 | CONFIG_SMP=y | 28 | CONFIG_SMP=y |
29 | CONFIG_PREEMPT=y | 29 | CONFIG_PREEMPT=y |
30 | CONFIG_CMA=y | ||
30 | CONFIG_CMDLINE="console=ttyAMA0" | 31 | CONFIG_CMDLINE="console=ttyAMA0" |
31 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 32 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
32 | CONFIG_COMPAT=y | 33 | CONFIG_COMPAT=y |
@@ -42,14 +43,17 @@ CONFIG_IP_PNP_BOOTP=y | |||
42 | # CONFIG_WIRELESS is not set | 43 | # CONFIG_WIRELESS is not set |
43 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 44 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
44 | CONFIG_DEVTMPFS=y | 45 | CONFIG_DEVTMPFS=y |
45 | CONFIG_BLK_DEV=y | 46 | CONFIG_DMA_CMA=y |
46 | CONFIG_SCSI=y | 47 | CONFIG_SCSI=y |
47 | # CONFIG_SCSI_PROC_FS is not set | 48 | # CONFIG_SCSI_PROC_FS is not set |
48 | CONFIG_BLK_DEV_SD=y | 49 | CONFIG_BLK_DEV_SD=y |
49 | # CONFIG_SCSI_LOWLEVEL is not set | 50 | # CONFIG_SCSI_LOWLEVEL is not set |
51 | CONFIG_ATA=y | ||
52 | CONFIG_PATA_PLATFORM=y | ||
53 | CONFIG_PATA_OF_PLATFORM=y | ||
50 | CONFIG_NETDEVICES=y | 54 | CONFIG_NETDEVICES=y |
51 | CONFIG_MII=y | ||
52 | CONFIG_SMC91X=y | 55 | CONFIG_SMC91X=y |
56 | CONFIG_SMSC911X=y | ||
53 | # CONFIG_WLAN is not set | 57 | # CONFIG_WLAN is not set |
54 | CONFIG_INPUT_EVDEV=y | 58 | CONFIG_INPUT_EVDEV=y |
55 | # CONFIG_SERIO_I8042 is not set | 59 | # CONFIG_SERIO_I8042 is not set |
@@ -62,13 +66,19 @@ CONFIG_SERIAL_AMBA_PL011=y | |||
62 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | 66 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
63 | # CONFIG_HW_RANDOM is not set | 67 | # CONFIG_HW_RANDOM is not set |
64 | # CONFIG_HWMON is not set | 68 | # CONFIG_HWMON is not set |
69 | CONFIG_REGULATOR=y | ||
70 | CONFIG_REGULATOR_FIXED_VOLTAGE=y | ||
65 | CONFIG_FB=y | 71 | CONFIG_FB=y |
66 | # CONFIG_VGA_CONSOLE is not set | 72 | # CONFIG_VGA_CONSOLE is not set |
67 | CONFIG_FRAMEBUFFER_CONSOLE=y | 73 | CONFIG_FRAMEBUFFER_CONSOLE=y |
68 | CONFIG_LOGO=y | 74 | CONFIG_LOGO=y |
69 | # CONFIG_LOGO_LINUX_MONO is not set | 75 | # CONFIG_LOGO_LINUX_MONO is not set |
70 | # CONFIG_LOGO_LINUX_VGA16 is not set | 76 | # CONFIG_LOGO_LINUX_VGA16 is not set |
71 | # CONFIG_USB_SUPPORT is not set | 77 | CONFIG_USB=y |
78 | CONFIG_USB_ISP1760_HCD=y | ||
79 | CONFIG_USB_STORAGE=y | ||
80 | CONFIG_MMC=y | ||
81 | CONFIG_MMC_ARMMMCI=y | ||
72 | # CONFIG_IOMMU_SUPPORT is not set | 82 | # CONFIG_IOMMU_SUPPORT is not set |
73 | CONFIG_EXT2_FS=y | 83 | CONFIG_EXT2_FS=y |
74 | CONFIG_EXT3_FS=y | 84 | CONFIG_EXT3_FS=y |
diff --git a/arch/arm64/include/asm/atomic.h b/arch/arm64/include/asm/atomic.h index 01de5aaa3edc..0237f0867e37 100644 --- a/arch/arm64/include/asm/atomic.h +++ b/arch/arm64/include/asm/atomic.h | |||
@@ -54,8 +54,7 @@ static inline void atomic_add(int i, atomic_t *v) | |||
54 | " stxr %w1, %w0, %2\n" | 54 | " stxr %w1, %w0, %2\n" |
55 | " cbnz %w1, 1b" | 55 | " cbnz %w1, 1b" |
56 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 56 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
57 | : "Ir" (i) | 57 | : "Ir" (i)); |
58 | : "cc"); | ||
59 | } | 58 | } |
60 | 59 | ||
61 | static inline int atomic_add_return(int i, atomic_t *v) | 60 | static inline int atomic_add_return(int i, atomic_t *v) |
@@ -64,14 +63,15 @@ static inline int atomic_add_return(int i, atomic_t *v) | |||
64 | int result; | 63 | int result; |
65 | 64 | ||
66 | asm volatile("// atomic_add_return\n" | 65 | asm volatile("// atomic_add_return\n" |
67 | "1: ldaxr %w0, %2\n" | 66 | "1: ldxr %w0, %2\n" |
68 | " add %w0, %w0, %w3\n" | 67 | " add %w0, %w0, %w3\n" |
69 | " stlxr %w1, %w0, %2\n" | 68 | " stlxr %w1, %w0, %2\n" |
70 | " cbnz %w1, 1b" | 69 | " cbnz %w1, 1b" |
71 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 70 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
72 | : "Ir" (i) | 71 | : "Ir" (i) |
73 | : "cc", "memory"); | 72 | : "memory"); |
74 | 73 | ||
74 | smp_mb(); | ||
75 | return result; | 75 | return result; |
76 | } | 76 | } |
77 | 77 | ||
@@ -86,8 +86,7 @@ static inline void atomic_sub(int i, atomic_t *v) | |||
86 | " stxr %w1, %w0, %2\n" | 86 | " stxr %w1, %w0, %2\n" |
87 | " cbnz %w1, 1b" | 87 | " cbnz %w1, 1b" |
88 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 88 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
89 | : "Ir" (i) | 89 | : "Ir" (i)); |
90 | : "cc"); | ||
91 | } | 90 | } |
92 | 91 | ||
93 | static inline int atomic_sub_return(int i, atomic_t *v) | 92 | static inline int atomic_sub_return(int i, atomic_t *v) |
@@ -96,14 +95,15 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
96 | int result; | 95 | int result; |
97 | 96 | ||
98 | asm volatile("// atomic_sub_return\n" | 97 | asm volatile("// atomic_sub_return\n" |
99 | "1: ldaxr %w0, %2\n" | 98 | "1: ldxr %w0, %2\n" |
100 | " sub %w0, %w0, %w3\n" | 99 | " sub %w0, %w0, %w3\n" |
101 | " stlxr %w1, %w0, %2\n" | 100 | " stlxr %w1, %w0, %2\n" |
102 | " cbnz %w1, 1b" | 101 | " cbnz %w1, 1b" |
103 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 102 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
104 | : "Ir" (i) | 103 | : "Ir" (i) |
105 | : "cc", "memory"); | 104 | : "memory"); |
106 | 105 | ||
106 | smp_mb(); | ||
107 | return result; | 107 | return result; |
108 | } | 108 | } |
109 | 109 | ||
@@ -112,17 +112,20 @@ static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) | |||
112 | unsigned long tmp; | 112 | unsigned long tmp; |
113 | int oldval; | 113 | int oldval; |
114 | 114 | ||
115 | smp_mb(); | ||
116 | |||
115 | asm volatile("// atomic_cmpxchg\n" | 117 | asm volatile("// atomic_cmpxchg\n" |
116 | "1: ldaxr %w1, %2\n" | 118 | "1: ldxr %w1, %2\n" |
117 | " cmp %w1, %w3\n" | 119 | " cmp %w1, %w3\n" |
118 | " b.ne 2f\n" | 120 | " b.ne 2f\n" |
119 | " stlxr %w0, %w4, %2\n" | 121 | " stxr %w0, %w4, %2\n" |
120 | " cbnz %w0, 1b\n" | 122 | " cbnz %w0, 1b\n" |
121 | "2:" | 123 | "2:" |
122 | : "=&r" (tmp), "=&r" (oldval), "+Q" (ptr->counter) | 124 | : "=&r" (tmp), "=&r" (oldval), "+Q" (ptr->counter) |
123 | : "Ir" (old), "r" (new) | 125 | : "Ir" (old), "r" (new) |
124 | : "cc", "memory"); | 126 | : "cc"); |
125 | 127 | ||
128 | smp_mb(); | ||
126 | return oldval; | 129 | return oldval; |
127 | } | 130 | } |
128 | 131 | ||
@@ -173,8 +176,7 @@ static inline void atomic64_add(u64 i, atomic64_t *v) | |||
173 | " stxr %w1, %0, %2\n" | 176 | " stxr %w1, %0, %2\n" |
174 | " cbnz %w1, 1b" | 177 | " cbnz %w1, 1b" |
175 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 178 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
176 | : "Ir" (i) | 179 | : "Ir" (i)); |
177 | : "cc"); | ||
178 | } | 180 | } |
179 | 181 | ||
180 | static inline long atomic64_add_return(long i, atomic64_t *v) | 182 | static inline long atomic64_add_return(long i, atomic64_t *v) |
@@ -183,14 +185,15 @@ static inline long atomic64_add_return(long i, atomic64_t *v) | |||
183 | unsigned long tmp; | 185 | unsigned long tmp; |
184 | 186 | ||
185 | asm volatile("// atomic64_add_return\n" | 187 | asm volatile("// atomic64_add_return\n" |
186 | "1: ldaxr %0, %2\n" | 188 | "1: ldxr %0, %2\n" |
187 | " add %0, %0, %3\n" | 189 | " add %0, %0, %3\n" |
188 | " stlxr %w1, %0, %2\n" | 190 | " stlxr %w1, %0, %2\n" |
189 | " cbnz %w1, 1b" | 191 | " cbnz %w1, 1b" |
190 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 192 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
191 | : "Ir" (i) | 193 | : "Ir" (i) |
192 | : "cc", "memory"); | 194 | : "memory"); |
193 | 195 | ||
196 | smp_mb(); | ||
194 | return result; | 197 | return result; |
195 | } | 198 | } |
196 | 199 | ||
@@ -205,8 +208,7 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) | |||
205 | " stxr %w1, %0, %2\n" | 208 | " stxr %w1, %0, %2\n" |
206 | " cbnz %w1, 1b" | 209 | " cbnz %w1, 1b" |
207 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 210 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
208 | : "Ir" (i) | 211 | : "Ir" (i)); |
209 | : "cc"); | ||
210 | } | 212 | } |
211 | 213 | ||
212 | static inline long atomic64_sub_return(long i, atomic64_t *v) | 214 | static inline long atomic64_sub_return(long i, atomic64_t *v) |
@@ -215,14 +217,15 @@ static inline long atomic64_sub_return(long i, atomic64_t *v) | |||
215 | unsigned long tmp; | 217 | unsigned long tmp; |
216 | 218 | ||
217 | asm volatile("// atomic64_sub_return\n" | 219 | asm volatile("// atomic64_sub_return\n" |
218 | "1: ldaxr %0, %2\n" | 220 | "1: ldxr %0, %2\n" |
219 | " sub %0, %0, %3\n" | 221 | " sub %0, %0, %3\n" |
220 | " stlxr %w1, %0, %2\n" | 222 | " stlxr %w1, %0, %2\n" |
221 | " cbnz %w1, 1b" | 223 | " cbnz %w1, 1b" |
222 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 224 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
223 | : "Ir" (i) | 225 | : "Ir" (i) |
224 | : "cc", "memory"); | 226 | : "memory"); |
225 | 227 | ||
228 | smp_mb(); | ||
226 | return result; | 229 | return result; |
227 | } | 230 | } |
228 | 231 | ||
@@ -231,17 +234,20 @@ static inline long atomic64_cmpxchg(atomic64_t *ptr, long old, long new) | |||
231 | long oldval; | 234 | long oldval; |
232 | unsigned long res; | 235 | unsigned long res; |
233 | 236 | ||
237 | smp_mb(); | ||
238 | |||
234 | asm volatile("// atomic64_cmpxchg\n" | 239 | asm volatile("// atomic64_cmpxchg\n" |
235 | "1: ldaxr %1, %2\n" | 240 | "1: ldxr %1, %2\n" |
236 | " cmp %1, %3\n" | 241 | " cmp %1, %3\n" |
237 | " b.ne 2f\n" | 242 | " b.ne 2f\n" |
238 | " stlxr %w0, %4, %2\n" | 243 | " stxr %w0, %4, %2\n" |
239 | " cbnz %w0, 1b\n" | 244 | " cbnz %w0, 1b\n" |
240 | "2:" | 245 | "2:" |
241 | : "=&r" (res), "=&r" (oldval), "+Q" (ptr->counter) | 246 | : "=&r" (res), "=&r" (oldval), "+Q" (ptr->counter) |
242 | : "Ir" (old), "r" (new) | 247 | : "Ir" (old), "r" (new) |
243 | : "cc", "memory"); | 248 | : "cc"); |
244 | 249 | ||
250 | smp_mb(); | ||
245 | return oldval; | 251 | return oldval; |
246 | } | 252 | } |
247 | 253 | ||
@@ -253,11 +259,12 @@ static inline long atomic64_dec_if_positive(atomic64_t *v) | |||
253 | unsigned long tmp; | 259 | unsigned long tmp; |
254 | 260 | ||
255 | asm volatile("// atomic64_dec_if_positive\n" | 261 | asm volatile("// atomic64_dec_if_positive\n" |
256 | "1: ldaxr %0, %2\n" | 262 | "1: ldxr %0, %2\n" |
257 | " subs %0, %0, #1\n" | 263 | " subs %0, %0, #1\n" |
258 | " b.mi 2f\n" | 264 | " b.mi 2f\n" |
259 | " stlxr %w1, %0, %2\n" | 265 | " stlxr %w1, %0, %2\n" |
260 | " cbnz %w1, 1b\n" | 266 | " cbnz %w1, 1b\n" |
267 | " dmb ish\n" | ||
261 | "2:" | 268 | "2:" |
262 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) | 269 | : "=&r" (result), "=&r" (tmp), "+Q" (v->counter) |
263 | : | 270 | : |
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h index 78e20ba8806b..409ca370cfe2 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define wfi() asm volatile("wfi" : : : "memory") | 25 | #define wfi() asm volatile("wfi" : : : "memory") |
26 | 26 | ||
27 | #define isb() asm volatile("isb" : : : "memory") | 27 | #define isb() asm volatile("isb" : : : "memory") |
28 | #define dsb() asm volatile("dsb sy" : : : "memory") | 28 | #define dsb(opt) asm volatile("dsb sy" : : : "memory") |
29 | 29 | ||
30 | #define mb() dsb() | 30 | #define mb() dsb() |
31 | #define rmb() asm volatile("dsb ld" : : : "memory") | 31 | #define rmb() asm volatile("dsb ld" : : : "memory") |
diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index fea9ee327206..889324981aa4 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h | |||
@@ -116,6 +116,7 @@ extern void flush_dcache_page(struct page *); | |||
116 | static inline void __flush_icache_all(void) | 116 | static inline void __flush_icache_all(void) |
117 | { | 117 | { |
118 | asm("ic ialluis"); | 118 | asm("ic ialluis"); |
119 | dsb(); | ||
119 | } | 120 | } |
120 | 121 | ||
121 | #define flush_dcache_mmap_lock(mapping) \ | 122 | #define flush_dcache_mmap_lock(mapping) \ |
diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h index 56166d7f4a25..57c0fa7bf711 100644 --- a/arch/arm64/include/asm/cmpxchg.h +++ b/arch/arm64/include/asm/cmpxchg.h | |||
@@ -29,44 +29,45 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size | |||
29 | switch (size) { | 29 | switch (size) { |
30 | case 1: | 30 | case 1: |
31 | asm volatile("// __xchg1\n" | 31 | asm volatile("// __xchg1\n" |
32 | "1: ldaxrb %w0, %2\n" | 32 | "1: ldxrb %w0, %2\n" |
33 | " stlxrb %w1, %w3, %2\n" | 33 | " stlxrb %w1, %w3, %2\n" |
34 | " cbnz %w1, 1b\n" | 34 | " cbnz %w1, 1b\n" |
35 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u8 *)ptr) | 35 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u8 *)ptr) |
36 | : "r" (x) | 36 | : "r" (x) |
37 | : "cc", "memory"); | 37 | : "memory"); |
38 | break; | 38 | break; |
39 | case 2: | 39 | case 2: |
40 | asm volatile("// __xchg2\n" | 40 | asm volatile("// __xchg2\n" |
41 | "1: ldaxrh %w0, %2\n" | 41 | "1: ldxrh %w0, %2\n" |
42 | " stlxrh %w1, %w3, %2\n" | 42 | " stlxrh %w1, %w3, %2\n" |
43 | " cbnz %w1, 1b\n" | 43 | " cbnz %w1, 1b\n" |
44 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u16 *)ptr) | 44 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u16 *)ptr) |
45 | : "r" (x) | 45 | : "r" (x) |
46 | : "cc", "memory"); | 46 | : "memory"); |
47 | break; | 47 | break; |
48 | case 4: | 48 | case 4: |
49 | asm volatile("// __xchg4\n" | 49 | asm volatile("// __xchg4\n" |
50 | "1: ldaxr %w0, %2\n" | 50 | "1: ldxr %w0, %2\n" |
51 | " stlxr %w1, %w3, %2\n" | 51 | " stlxr %w1, %w3, %2\n" |
52 | " cbnz %w1, 1b\n" | 52 | " cbnz %w1, 1b\n" |
53 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u32 *)ptr) | 53 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u32 *)ptr) |
54 | : "r" (x) | 54 | : "r" (x) |
55 | : "cc", "memory"); | 55 | : "memory"); |
56 | break; | 56 | break; |
57 | case 8: | 57 | case 8: |
58 | asm volatile("// __xchg8\n" | 58 | asm volatile("// __xchg8\n" |
59 | "1: ldaxr %0, %2\n" | 59 | "1: ldxr %0, %2\n" |
60 | " stlxr %w1, %3, %2\n" | 60 | " stlxr %w1, %3, %2\n" |
61 | " cbnz %w1, 1b\n" | 61 | " cbnz %w1, 1b\n" |
62 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u64 *)ptr) | 62 | : "=&r" (ret), "=&r" (tmp), "+Q" (*(u64 *)ptr) |
63 | : "r" (x) | 63 | : "r" (x) |
64 | : "cc", "memory"); | 64 | : "memory"); |
65 | break; | 65 | break; |
66 | default: | 66 | default: |
67 | BUILD_BUG(); | 67 | BUILD_BUG(); |
68 | } | 68 | } |
69 | 69 | ||
70 | smp_mb(); | ||
70 | return ret; | 71 | return ret; |
71 | } | 72 | } |
72 | 73 | ||
diff --git a/arch/arm64/include/asm/esr.h b/arch/arm64/include/asm/esr.h index 78834123a32e..c4a7f940b387 100644 --- a/arch/arm64/include/asm/esr.h +++ b/arch/arm64/include/asm/esr.h | |||
@@ -42,7 +42,7 @@ | |||
42 | #define ESR_EL1_EC_SP_ALIGN (0x26) | 42 | #define ESR_EL1_EC_SP_ALIGN (0x26) |
43 | #define ESR_EL1_EC_FP_EXC32 (0x28) | 43 | #define ESR_EL1_EC_FP_EXC32 (0x28) |
44 | #define ESR_EL1_EC_FP_EXC64 (0x2C) | 44 | #define ESR_EL1_EC_FP_EXC64 (0x2C) |
45 | #define ESR_EL1_EC_SERRROR (0x2F) | 45 | #define ESR_EL1_EC_SERROR (0x2F) |
46 | #define ESR_EL1_EC_BREAKPT_EL0 (0x30) | 46 | #define ESR_EL1_EC_BREAKPT_EL0 (0x30) |
47 | #define ESR_EL1_EC_BREAKPT_EL1 (0x31) | 47 | #define ESR_EL1_EC_BREAKPT_EL1 (0x31) |
48 | #define ESR_EL1_EC_SOFTSTP_EL0 (0x32) | 48 | #define ESR_EL1_EC_SOFTSTP_EL0 (0x32) |
diff --git a/arch/arm64/include/asm/futex.h b/arch/arm64/include/asm/futex.h index 78cc3aba5d69..5f750dc96e0f 100644 --- a/arch/arm64/include/asm/futex.h +++ b/arch/arm64/include/asm/futex.h | |||
@@ -24,10 +24,11 @@ | |||
24 | 24 | ||
25 | #define __futex_atomic_op(insn, ret, oldval, uaddr, tmp, oparg) \ | 25 | #define __futex_atomic_op(insn, ret, oldval, uaddr, tmp, oparg) \ |
26 | asm volatile( \ | 26 | asm volatile( \ |
27 | "1: ldaxr %w1, %2\n" \ | 27 | "1: ldxr %w1, %2\n" \ |
28 | insn "\n" \ | 28 | insn "\n" \ |
29 | "2: stlxr %w3, %w0, %2\n" \ | 29 | "2: stlxr %w3, %w0, %2\n" \ |
30 | " cbnz %w3, 1b\n" \ | 30 | " cbnz %w3, 1b\n" \ |
31 | " dmb ish\n" \ | ||
31 | "3:\n" \ | 32 | "3:\n" \ |
32 | " .pushsection .fixup,\"ax\"\n" \ | 33 | " .pushsection .fixup,\"ax\"\n" \ |
33 | " .align 2\n" \ | 34 | " .align 2\n" \ |
@@ -40,7 +41,7 @@ | |||
40 | " .popsection\n" \ | 41 | " .popsection\n" \ |
41 | : "=&r" (ret), "=&r" (oldval), "+Q" (*uaddr), "=&r" (tmp) \ | 42 | : "=&r" (ret), "=&r" (oldval), "+Q" (*uaddr), "=&r" (tmp) \ |
42 | : "r" (oparg), "Ir" (-EFAULT) \ | 43 | : "r" (oparg), "Ir" (-EFAULT) \ |
43 | : "cc", "memory") | 44 | : "memory") |
44 | 45 | ||
45 | static inline int | 46 | static inline int |
46 | futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | 47 | futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) |
@@ -111,11 +112,12 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
111 | return -EFAULT; | 112 | return -EFAULT; |
112 | 113 | ||
113 | asm volatile("// futex_atomic_cmpxchg_inatomic\n" | 114 | asm volatile("// futex_atomic_cmpxchg_inatomic\n" |
114 | "1: ldaxr %w1, %2\n" | 115 | "1: ldxr %w1, %2\n" |
115 | " sub %w3, %w1, %w4\n" | 116 | " sub %w3, %w1, %w4\n" |
116 | " cbnz %w3, 3f\n" | 117 | " cbnz %w3, 3f\n" |
117 | "2: stlxr %w3, %w5, %2\n" | 118 | "2: stlxr %w3, %w5, %2\n" |
118 | " cbnz %w3, 1b\n" | 119 | " cbnz %w3, 1b\n" |
120 | " dmb ish\n" | ||
119 | "3:\n" | 121 | "3:\n" |
120 | " .pushsection .fixup,\"ax\"\n" | 122 | " .pushsection .fixup,\"ax\"\n" |
121 | "4: mov %w0, %w6\n" | 123 | "4: mov %w0, %w6\n" |
@@ -127,7 +129,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
127 | " .popsection\n" | 129 | " .popsection\n" |
128 | : "+r" (ret), "=&r" (val), "+Q" (*uaddr), "=&r" (tmp) | 130 | : "+r" (ret), "=&r" (val), "+Q" (*uaddr), "=&r" (tmp) |
129 | : "r" (oldval), "r" (newval), "Ir" (-EFAULT) | 131 | : "r" (oldval), "r" (newval), "Ir" (-EFAULT) |
130 | : "cc", "memory"); | 132 | : "memory"); |
131 | 133 | ||
132 | *uval = val; | 134 | *uval = val; |
133 | return ret; | 135 | return ret; |
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index c98ef4771c73..0eb398655378 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h | |||
@@ -231,7 +231,7 @@ | |||
231 | #define ESR_EL2_EC_SP_ALIGN (0x26) | 231 | #define ESR_EL2_EC_SP_ALIGN (0x26) |
232 | #define ESR_EL2_EC_FP_EXC32 (0x28) | 232 | #define ESR_EL2_EC_FP_EXC32 (0x28) |
233 | #define ESR_EL2_EC_FP_EXC64 (0x2C) | 233 | #define ESR_EL2_EC_FP_EXC64 (0x2C) |
234 | #define ESR_EL2_EC_SERRROR (0x2F) | 234 | #define ESR_EL2_EC_SERROR (0x2F) |
235 | #define ESR_EL2_EC_BREAKPT (0x30) | 235 | #define ESR_EL2_EC_BREAKPT (0x30) |
236 | #define ESR_EL2_EC_BREAKPT_HYP (0x31) | 236 | #define ESR_EL2_EC_BREAKPT_HYP (0x31) |
237 | #define ESR_EL2_EC_SOFTSTP (0x32) | 237 | #define ESR_EL2_EC_SOFTSTP (0x32) |
diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h index 3d5cf064d7a1..c45b7b1b7197 100644 --- a/arch/arm64/include/asm/spinlock.h +++ b/arch/arm64/include/asm/spinlock.h | |||
@@ -132,7 +132,7 @@ static inline void arch_write_lock(arch_rwlock_t *rw) | |||
132 | " cbnz %w0, 2b\n" | 132 | " cbnz %w0, 2b\n" |
133 | : "=&r" (tmp), "+Q" (rw->lock) | 133 | : "=&r" (tmp), "+Q" (rw->lock) |
134 | : "r" (0x80000000) | 134 | : "r" (0x80000000) |
135 | : "cc", "memory"); | 135 | : "memory"); |
136 | } | 136 | } |
137 | 137 | ||
138 | static inline int arch_write_trylock(arch_rwlock_t *rw) | 138 | static inline int arch_write_trylock(arch_rwlock_t *rw) |
@@ -146,7 +146,7 @@ static inline int arch_write_trylock(arch_rwlock_t *rw) | |||
146 | "1:\n" | 146 | "1:\n" |
147 | : "=&r" (tmp), "+Q" (rw->lock) | 147 | : "=&r" (tmp), "+Q" (rw->lock) |
148 | : "r" (0x80000000) | 148 | : "r" (0x80000000) |
149 | : "cc", "memory"); | 149 | : "memory"); |
150 | 150 | ||
151 | return !tmp; | 151 | return !tmp; |
152 | } | 152 | } |
@@ -187,7 +187,7 @@ static inline void arch_read_lock(arch_rwlock_t *rw) | |||
187 | " cbnz %w1, 2b\n" | 187 | " cbnz %w1, 2b\n" |
188 | : "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock) | 188 | : "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock) |
189 | : | 189 | : |
190 | : "cc", "memory"); | 190 | : "memory"); |
191 | } | 191 | } |
192 | 192 | ||
193 | static inline void arch_read_unlock(arch_rwlock_t *rw) | 193 | static inline void arch_read_unlock(arch_rwlock_t *rw) |
@@ -201,7 +201,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw) | |||
201 | " cbnz %w1, 1b\n" | 201 | " cbnz %w1, 1b\n" |
202 | : "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock) | 202 | : "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock) |
203 | : | 203 | : |
204 | : "cc", "memory"); | 204 | : "memory"); |
205 | } | 205 | } |
206 | 206 | ||
207 | static inline int arch_read_trylock(arch_rwlock_t *rw) | 207 | static inline int arch_read_trylock(arch_rwlock_t *rw) |
@@ -216,7 +216,7 @@ static inline int arch_read_trylock(arch_rwlock_t *rw) | |||
216 | "1:\n" | 216 | "1:\n" |
217 | : "=&r" (tmp), "+r" (tmp2), "+Q" (rw->lock) | 217 | : "=&r" (tmp), "+r" (tmp2), "+Q" (rw->lock) |
218 | : | 218 | : |
219 | : "cc", "memory"); | 219 | : "memory"); |
220 | 220 | ||
221 | return !tmp2; | 221 | return !tmp2; |
222 | } | 222 | } |
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 58125bf008d3..bb8eb8a78e67 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h | |||
@@ -399,7 +399,10 @@ __SYSCALL(374, compat_sys_sendmmsg) | |||
399 | __SYSCALL(375, sys_setns) | 399 | __SYSCALL(375, sys_setns) |
400 | __SYSCALL(376, compat_sys_process_vm_readv) | 400 | __SYSCALL(376, compat_sys_process_vm_readv) |
401 | __SYSCALL(377, compat_sys_process_vm_writev) | 401 | __SYSCALL(377, compat_sys_process_vm_writev) |
402 | __SYSCALL(378, sys_ni_syscall) /* 378 for kcmp */ | 402 | __SYSCALL(378, sys_kcmp) |
403 | __SYSCALL(379, sys_finit_module) | ||
404 | __SYSCALL(380, sys_sched_setattr) | ||
405 | __SYSCALL(381, sys_sched_getattr) | ||
403 | 406 | ||
404 | #define __NR_compat_syscalls 379 | 407 | #define __NR_compat_syscalls 379 |
405 | 408 | ||
diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index 495ab6f84a61..eaf54a30bedc 100644 --- a/arch/arm64/include/uapi/asm/kvm.h +++ b/arch/arm64/include/uapi/asm/kvm.h | |||
@@ -148,6 +148,15 @@ struct kvm_arch_memory_slot { | |||
148 | #define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2) | 148 | #define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2) |
149 | #define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2) | 149 | #define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2) |
150 | 150 | ||
151 | /* Device Control API: ARM VGIC */ | ||
152 | #define KVM_DEV_ARM_VGIC_GRP_ADDR 0 | ||
153 | #define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1 | ||
154 | #define KVM_DEV_ARM_VGIC_GRP_CPU_REGS 2 | ||
155 | #define KVM_DEV_ARM_VGIC_CPUID_SHIFT 32 | ||
156 | #define KVM_DEV_ARM_VGIC_CPUID_MASK (0xffULL << KVM_DEV_ARM_VGIC_CPUID_SHIFT) | ||
157 | #define KVM_DEV_ARM_VGIC_OFFSET_SHIFT 0 | ||
158 | #define KVM_DEV_ARM_VGIC_OFFSET_MASK (0xffffffffULL << KVM_DEV_ARM_VGIC_OFFSET_SHIFT) | ||
159 | |||
151 | /* KVM_IRQ_LINE irq field index values */ | 160 | /* KVM_IRQ_LINE irq field index values */ |
152 | #define KVM_ARM_IRQ_TYPE_SHIFT 24 | 161 | #define KVM_ARM_IRQ_TYPE_SHIFT 24 |
153 | #define KVM_ARM_IRQ_TYPE_MASK 0xff | 162 | #define KVM_ARM_IRQ_TYPE_MASK 0xff |
diff --git a/arch/arm64/kernel/kuser32.S b/arch/arm64/kernel/kuser32.S index 63c48ffdf230..7787208e8cc6 100644 --- a/arch/arm64/kernel/kuser32.S +++ b/arch/arm64/kernel/kuser32.S | |||
@@ -38,12 +38,13 @@ __kuser_cmpxchg64: // 0xffff0f60 | |||
38 | .inst 0xe92d00f0 // push {r4, r5, r6, r7} | 38 | .inst 0xe92d00f0 // push {r4, r5, r6, r7} |
39 | .inst 0xe1c040d0 // ldrd r4, r5, [r0] | 39 | .inst 0xe1c040d0 // ldrd r4, r5, [r0] |
40 | .inst 0xe1c160d0 // ldrd r6, r7, [r1] | 40 | .inst 0xe1c160d0 // ldrd r6, r7, [r1] |
41 | .inst 0xe1b20e9f // 1: ldaexd r0, r1, [r2] | 41 | .inst 0xe1b20f9f // 1: ldrexd r0, r1, [r2] |
42 | .inst 0xe0303004 // eors r3, r0, r4 | 42 | .inst 0xe0303004 // eors r3, r0, r4 |
43 | .inst 0x00313005 // eoreqs r3, r1, r5 | 43 | .inst 0x00313005 // eoreqs r3, r1, r5 |
44 | .inst 0x01a23e96 // stlexdeq r3, r6, [r2] | 44 | .inst 0x01a23e96 // stlexdeq r3, r6, [r2] |
45 | .inst 0x03330001 // teqeq r3, #1 | 45 | .inst 0x03330001 // teqeq r3, #1 |
46 | .inst 0x0afffff9 // beq 1b | 46 | .inst 0x0afffff9 // beq 1b |
47 | .inst 0xf57ff05b // dmb ish | ||
47 | .inst 0xe2730000 // rsbs r0, r3, #0 | 48 | .inst 0xe2730000 // rsbs r0, r3, #0 |
48 | .inst 0xe8bd00f0 // pop {r4, r5, r6, r7} | 49 | .inst 0xe8bd00f0 // pop {r4, r5, r6, r7} |
49 | .inst 0xe12fff1e // bx lr | 50 | .inst 0xe12fff1e // bx lr |
@@ -55,11 +56,12 @@ __kuser_memory_barrier: // 0xffff0fa0 | |||
55 | 56 | ||
56 | .align 5 | 57 | .align 5 |
57 | __kuser_cmpxchg: // 0xffff0fc0 | 58 | __kuser_cmpxchg: // 0xffff0fc0 |
58 | .inst 0xe1923e9f // 1: ldaex r3, [r2] | 59 | .inst 0xe1923f9f // 1: ldrex r3, [r2] |
59 | .inst 0xe0533000 // subs r3, r3, r0 | 60 | .inst 0xe0533000 // subs r3, r3, r0 |
60 | .inst 0x01823e91 // stlexeq r3, r1, [r2] | 61 | .inst 0x01823e91 // stlexeq r3, r1, [r2] |
61 | .inst 0x03330001 // teqeq r3, #1 | 62 | .inst 0x03330001 // teqeq r3, #1 |
62 | .inst 0x0afffffa // beq 1b | 63 | .inst 0x0afffffa // beq 1b |
64 | .inst 0xf57ff05b // dmb ish | ||
63 | .inst 0xe2730000 // rsbs r0, r3, #0 | 65 | .inst 0xe2730000 // rsbs r0, r3, #0 |
64 | .inst 0xe12fff1e // bx lr | 66 | .inst 0xe12fff1e // bx lr |
65 | 67 | ||
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index 65d40cf6945a..a7149cae1615 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c | |||
@@ -238,6 +238,8 @@ void update_vsyscall(struct timekeeper *tk) | |||
238 | vdso_data->use_syscall = use_syscall; | 238 | vdso_data->use_syscall = use_syscall; |
239 | vdso_data->xtime_coarse_sec = xtime_coarse.tv_sec; | 239 | vdso_data->xtime_coarse_sec = xtime_coarse.tv_sec; |
240 | vdso_data->xtime_coarse_nsec = xtime_coarse.tv_nsec; | 240 | vdso_data->xtime_coarse_nsec = xtime_coarse.tv_nsec; |
241 | vdso_data->wtm_clock_sec = tk->wall_to_monotonic.tv_sec; | ||
242 | vdso_data->wtm_clock_nsec = tk->wall_to_monotonic.tv_nsec; | ||
241 | 243 | ||
242 | if (!use_syscall) { | 244 | if (!use_syscall) { |
243 | vdso_data->cs_cycle_last = tk->clock->cycle_last; | 245 | vdso_data->cs_cycle_last = tk->clock->cycle_last; |
@@ -245,8 +247,6 @@ void update_vsyscall(struct timekeeper *tk) | |||
245 | vdso_data->xtime_clock_nsec = tk->xtime_nsec; | 247 | vdso_data->xtime_clock_nsec = tk->xtime_nsec; |
246 | vdso_data->cs_mult = tk->mult; | 248 | vdso_data->cs_mult = tk->mult; |
247 | vdso_data->cs_shift = tk->shift; | 249 | vdso_data->cs_shift = tk->shift; |
248 | vdso_data->wtm_clock_sec = tk->wall_to_monotonic.tv_sec; | ||
249 | vdso_data->wtm_clock_nsec = tk->wall_to_monotonic.tv_nsec; | ||
250 | } | 250 | } |
251 | 251 | ||
252 | smp_wmb(); | 252 | smp_wmb(); |
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index d8064af42e62..6d20b7d162d8 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile | |||
@@ -48,7 +48,7 @@ $(obj-vdso): %.o: %.S | |||
48 | 48 | ||
49 | # Actual build commands | 49 | # Actual build commands |
50 | quiet_cmd_vdsold = VDSOL $@ | 50 | quiet_cmd_vdsold = VDSOL $@ |
51 | cmd_vdsold = $(CC) $(c_flags) -Wl,-T $^ -o $@ | 51 | cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ |
52 | quiet_cmd_vdsoas = VDSOA $@ | 52 | quiet_cmd_vdsoas = VDSOA $@ |
53 | cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $< | 53 | cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $< |
54 | 54 | ||
diff --git a/arch/arm64/kernel/vdso/gettimeofday.S b/arch/arm64/kernel/vdso/gettimeofday.S index f0a6d10b5211..fe652ffd34c2 100644 --- a/arch/arm64/kernel/vdso/gettimeofday.S +++ b/arch/arm64/kernel/vdso/gettimeofday.S | |||
@@ -103,6 +103,8 @@ ENTRY(__kernel_clock_gettime) | |||
103 | bl __do_get_tspec | 103 | bl __do_get_tspec |
104 | seqcnt_check w9, 1b | 104 | seqcnt_check w9, 1b |
105 | 105 | ||
106 | mov x30, x2 | ||
107 | |||
106 | cmp w0, #CLOCK_MONOTONIC | 108 | cmp w0, #CLOCK_MONOTONIC |
107 | b.ne 6f | 109 | b.ne 6f |
108 | 110 | ||
@@ -118,6 +120,9 @@ ENTRY(__kernel_clock_gettime) | |||
118 | ccmp w0, #CLOCK_MONOTONIC_COARSE, #0x4, ne | 120 | ccmp w0, #CLOCK_MONOTONIC_COARSE, #0x4, ne |
119 | b.ne 8f | 121 | b.ne 8f |
120 | 122 | ||
123 | /* xtime_coarse_nsec is already right-shifted */ | ||
124 | mov x12, #0 | ||
125 | |||
121 | /* Get coarse timespec. */ | 126 | /* Get coarse timespec. */ |
122 | adr vdso_data, _vdso_data | 127 | adr vdso_data, _vdso_data |
123 | 3: seqcnt_acquire | 128 | 3: seqcnt_acquire |
@@ -156,7 +161,7 @@ ENTRY(__kernel_clock_gettime) | |||
156 | lsr x11, x11, x12 | 161 | lsr x11, x11, x12 |
157 | stp x10, x11, [x1, #TSPEC_TV_SEC] | 162 | stp x10, x11, [x1, #TSPEC_TV_SEC] |
158 | mov x0, xzr | 163 | mov x0, xzr |
159 | ret x2 | 164 | ret |
160 | 7: | 165 | 7: |
161 | mov x30, x2 | 166 | mov x30, x2 |
162 | 8: /* Syscall fallback. */ | 167 | 8: /* Syscall fallback. */ |
diff --git a/arch/arm64/lib/bitops.S b/arch/arm64/lib/bitops.S index e5db797790d3..7dac371cc9a2 100644 --- a/arch/arm64/lib/bitops.S +++ b/arch/arm64/lib/bitops.S | |||
@@ -46,11 +46,12 @@ ENTRY( \name ) | |||
46 | mov x2, #1 | 46 | mov x2, #1 |
47 | add x1, x1, x0, lsr #3 // Get word offset | 47 | add x1, x1, x0, lsr #3 // Get word offset |
48 | lsl x4, x2, x3 // Create mask | 48 | lsl x4, x2, x3 // Create mask |
49 | 1: ldaxr x2, [x1] | 49 | 1: ldxr x2, [x1] |
50 | lsr x0, x2, x3 // Save old value of bit | 50 | lsr x0, x2, x3 // Save old value of bit |
51 | \instr x2, x2, x4 // toggle bit | 51 | \instr x2, x2, x4 // toggle bit |
52 | stlxr w5, x2, [x1] | 52 | stlxr w5, x2, [x1] |
53 | cbnz w5, 1b | 53 | cbnz w5, 1b |
54 | dmb ish | ||
54 | and x0, x0, #1 | 55 | and x0, x0, #1 |
55 | 3: ret | 56 | 3: ret |
56 | ENDPROC(\name ) | 57 | ENDPROC(\name ) |
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 45b5ab54c9ee..fbd76785c5db 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -45,6 +45,7 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size, | |||
45 | if (IS_ENABLED(CONFIG_DMA_CMA)) { | 45 | if (IS_ENABLED(CONFIG_DMA_CMA)) { |
46 | struct page *page; | 46 | struct page *page; |
47 | 47 | ||
48 | size = PAGE_ALIGN(size); | ||
48 | page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, | 49 | page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT, |
49 | get_order(size)); | 50 | get_order(size)); |
50 | if (!page) | 51 | if (!page) |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index f557ebbe7013..f8dc7e8fce6f 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -203,10 +203,18 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr, | |||
203 | do { | 203 | do { |
204 | next = pmd_addr_end(addr, end); | 204 | next = pmd_addr_end(addr, end); |
205 | /* try section mapping first */ | 205 | /* try section mapping first */ |
206 | if (((addr | next | phys) & ~SECTION_MASK) == 0) | 206 | if (((addr | next | phys) & ~SECTION_MASK) == 0) { |
207 | pmd_t old_pmd =*pmd; | ||
207 | set_pmd(pmd, __pmd(phys | prot_sect_kernel)); | 208 | set_pmd(pmd, __pmd(phys | prot_sect_kernel)); |
208 | else | 209 | /* |
210 | * Check for previous table entries created during | ||
211 | * boot (__create_page_tables) and flush them. | ||
212 | */ | ||
213 | if (!pmd_none(old_pmd)) | ||
214 | flush_tlb_all(); | ||
215 | } else { | ||
209 | alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys)); | 216 | alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys)); |
217 | } | ||
210 | phys += next - addr; | 218 | phys += next - addr; |
211 | } while (pmd++, addr = next, addr != end); | 219 | } while (pmd++, addr = next, addr != end); |
212 | } | 220 | } |
diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c index 7083cdada657..62c6101df260 100644 --- a/arch/arm64/mm/pgd.c +++ b/arch/arm64/mm/pgd.c | |||
@@ -32,17 +32,10 @@ | |||
32 | 32 | ||
33 | pgd_t *pgd_alloc(struct mm_struct *mm) | 33 | pgd_t *pgd_alloc(struct mm_struct *mm) |
34 | { | 34 | { |
35 | pgd_t *new_pgd; | ||
36 | |||
37 | if (PGD_SIZE == PAGE_SIZE) | 35 | if (PGD_SIZE == PAGE_SIZE) |
38 | new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); | 36 | return (pgd_t *)get_zeroed_page(GFP_KERNEL); |
39 | else | 37 | else |
40 | new_pgd = kzalloc(PGD_SIZE, GFP_KERNEL); | 38 | return kzalloc(PGD_SIZE, GFP_KERNEL); |
41 | |||
42 | if (!new_pgd) | ||
43 | return NULL; | ||
44 | |||
45 | return new_pgd; | ||
46 | } | 39 | } |
47 | 40 | ||
48 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) | 41 | void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index 22fb66590dcd..dba48a5d5bb9 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile | |||
@@ -11,7 +11,7 @@ all: uImage vmlinux.elf | |||
11 | 11 | ||
12 | KBUILD_DEFCONFIG := atstk1002_defconfig | 12 | KBUILD_DEFCONFIG := atstk1002_defconfig |
13 | 13 | ||
14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic | 14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic -D__linux__ |
15 | KBUILD_AFLAGS += -mrelax -mno-pic | 15 | KBUILD_AFLAGS += -mrelax -mno-pic |
16 | KBUILD_CFLAGS_MODULE += -mno-relax | 16 | KBUILD_CFLAGS_MODULE += -mno-relax |
17 | LDFLAGS_vmlinux += --relax | 17 | LDFLAGS_vmlinux += --relax |
diff --git a/arch/avr32/boards/mimc200/fram.c b/arch/avr32/boards/mimc200/fram.c index 9764a1a1073e..c1466a872b9c 100644 --- a/arch/avr32/boards/mimc200/fram.c +++ b/arch/avr32/boards/mimc200/fram.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #define FRAM_VERSION "1.0" | 11 | #define FRAM_VERSION "1.0" |
12 | 12 | ||
13 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
14 | #include <linux/module.h> | ||
14 | #include <linux/proc_fs.h> | 15 | #include <linux/proc_fs.h> |
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
16 | #include <linux/io.h> | 17 | #include <linux/io.h> |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index cfb9fe1b8df9..c7c64a63c29f 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
@@ -17,5 +17,6 @@ generic-y += scatterlist.h | |||
17 | generic-y += sections.h | 17 | generic-y += sections.h |
18 | generic-y += topology.h | 18 | generic-y += topology.h |
19 | generic-y += trace_clock.h | 19 | generic-y += trace_clock.h |
20 | generic-y += vga.h | ||
20 | generic-y += xor.h | 21 | generic-y += xor.h |
21 | generic-y += hash.h | 22 | generic-y += hash.h |
diff --git a/arch/avr32/include/asm/io.h b/arch/avr32/include/asm/io.h index fc6483f83ccc..4f5ec2bb7172 100644 --- a/arch/avr32/include/asm/io.h +++ b/arch/avr32/include/asm/io.h | |||
@@ -295,6 +295,8 @@ extern void __iounmap(void __iomem *addr); | |||
295 | #define iounmap(addr) \ | 295 | #define iounmap(addr) \ |
296 | __iounmap(addr) | 296 | __iounmap(addr) |
297 | 297 | ||
298 | #define ioremap_wc ioremap_nocache | ||
299 | |||
298 | #define cached(addr) P1SEGADDR(addr) | 300 | #define cached(addr) P1SEGADDR(addr) |
299 | #define uncached(addr) P2SEGADDR(addr) | 301 | #define uncached(addr) P2SEGADDR(addr) |
300 | 302 | ||
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index afd45e0d552e..ae763d8bf55a 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | 13 | ||
14 | #define NR_syscalls 312 /* length of syscall table */ | 14 | #define NR_syscalls 314 /* length of syscall table */ |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * The following defines stop scripts/checksyscalls.sh from complaining about | 17 | * The following defines stop scripts/checksyscalls.sh from complaining about |
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 34fd6fe46da1..715e85f858de 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h | |||
@@ -325,5 +325,7 @@ | |||
325 | #define __NR_process_vm_writev 1333 | 325 | #define __NR_process_vm_writev 1333 |
326 | #define __NR_accept4 1334 | 326 | #define __NR_accept4 1334 |
327 | #define __NR_finit_module 1335 | 327 | #define __NR_finit_module 1335 |
328 | #define __NR_sched_setattr 1336 | ||
329 | #define __NR_sched_getattr 1337 | ||
328 | 330 | ||
329 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ | 331 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index ddea607f948a..fa8d61a312a7 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1773,6 +1773,8 @@ sys_call_table: | |||
1773 | data8 sys_process_vm_writev | 1773 | data8 sys_process_vm_writev |
1774 | data8 sys_accept4 | 1774 | data8 sys_accept4 |
1775 | data8 sys_finit_module // 1335 | 1775 | data8 sys_finit_module // 1335 |
1776 | data8 sys_sched_setattr | ||
1777 | data8 sys_sched_getattr | ||
1776 | 1778 | ||
1777 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1779 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
1778 | #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ | 1780 | #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ |
diff --git a/arch/microblaze/include/asm/delay.h b/arch/microblaze/include/asm/delay.h index 05b7d39e4391..66fc24c24238 100644 --- a/arch/microblaze/include/asm/delay.h +++ b/arch/microblaze/include/asm/delay.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef _ASM_MICROBLAZE_DELAY_H | 13 | #ifndef _ASM_MICROBLAZE_DELAY_H |
14 | #define _ASM_MICROBLAZE_DELAY_H | 14 | #define _ASM_MICROBLAZE_DELAY_H |
15 | 15 | ||
16 | #include <linux/param.h> | ||
17 | |||
16 | extern inline void __delay(unsigned long loops) | 18 | extern inline void __delay(unsigned long loops) |
17 | { | 19 | { |
18 | asm volatile ("# __delay \n\t" \ | 20 | asm volatile ("# __delay \n\t" \ |
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index a2cea7206077..3fbb7f1db3bc 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h | |||
@@ -89,6 +89,11 @@ static inline unsigned int readl(const volatile void __iomem *addr) | |||
89 | { | 89 | { |
90 | return le32_to_cpu(*(volatile unsigned int __force *)addr); | 90 | return le32_to_cpu(*(volatile unsigned int __force *)addr); |
91 | } | 91 | } |
92 | #define readq readq | ||
93 | static inline u64 readq(const volatile void __iomem *addr) | ||
94 | { | ||
95 | return le64_to_cpu(__raw_readq(addr)); | ||
96 | } | ||
92 | static inline void writeb(unsigned char v, volatile void __iomem *addr) | 97 | static inline void writeb(unsigned char v, volatile void __iomem *addr) |
93 | { | 98 | { |
94 | *(volatile unsigned char __force *)addr = v; | 99 | *(volatile unsigned char __force *)addr = v; |
@@ -101,6 +106,7 @@ static inline void writel(unsigned int v, volatile void __iomem *addr) | |||
101 | { | 106 | { |
102 | *(volatile unsigned int __force *)addr = cpu_to_le32(v); | 107 | *(volatile unsigned int __force *)addr = cpu_to_le32(v); |
103 | } | 108 | } |
109 | #define writeq(b, addr) __raw_writeq(cpu_to_le64(b), addr) | ||
104 | 110 | ||
105 | /* ioread and iowrite variants. thease are for now same as __raw_ | 111 | /* ioread and iowrite variants. thease are for now same as __raw_ |
106 | * variants of accessors. we might check for endianess in the feature | 112 | * variants of accessors. we might check for endianess in the feature |
diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S index b7fb0438458c..17645b2e2f07 100644 --- a/arch/microblaze/kernel/head.S +++ b/arch/microblaze/kernel/head.S | |||
@@ -66,7 +66,7 @@ real_start: | |||
66 | mts rmsr, r0 | 66 | mts rmsr, r0 |
67 | /* Disable stack protection from bootloader */ | 67 | /* Disable stack protection from bootloader */ |
68 | mts rslr, r0 | 68 | mts rslr, r0 |
69 | addi r8, r0, 0xFFFFFFF | 69 | addi r8, r0, 0xFFFFFFFF |
70 | mts rshr, r8 | 70 | mts rshr, r8 |
71 | /* | 71 | /* |
72 | * According to Xilinx, msrclr instruction behaves like 'mfs rX,rpc' | 72 | * According to Xilinx, msrclr instruction behaves like 'mfs rX,rpc' |
diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c index 11f3ad20321c..5483906e0f86 100644 --- a/arch/mips/alchemy/devboards/db1000.c +++ b/arch/mips/alchemy/devboards/db1000.c | |||
@@ -534,13 +534,10 @@ static int __init db1000_dev_init(void) | |||
534 | s0 = AU1100_GPIO1_INT; | 534 | s0 = AU1100_GPIO1_INT; |
535 | s1 = AU1100_GPIO4_INT; | 535 | s1 = AU1100_GPIO4_INT; |
536 | 536 | ||
537 | gpio_request(19, "sd0_cd"); | ||
538 | gpio_request(20, "sd1_cd"); | ||
537 | gpio_direction_input(19); /* sd0 cd# */ | 539 | gpio_direction_input(19); /* sd0 cd# */ |
538 | gpio_direction_input(20); /* sd1 cd# */ | 540 | gpio_direction_input(20); /* sd1 cd# */ |
539 | gpio_direction_input(21); /* touch pendown# */ | ||
540 | gpio_direction_input(207); /* SPI MISO */ | ||
541 | gpio_direction_output(208, 0); /* SPI MOSI */ | ||
542 | gpio_direction_output(209, 1); /* SPI SCK */ | ||
543 | gpio_direction_output(210, 1); /* SPI CS# */ | ||
544 | 541 | ||
545 | /* spi_gpio on SSI0 pins */ | 542 | /* spi_gpio on SSI0 pins */ |
546 | pfc = __raw_readl((void __iomem *)SYS_PINFUNC); | 543 | pfc = __raw_readl((void __iomem *)SYS_PINFUNC); |
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h index cfe092fc720d..6b9749540edf 100644 --- a/arch/mips/include/asm/fpu.h +++ b/arch/mips/include/asm/fpu.h | |||
@@ -74,6 +74,8 @@ static inline int __enable_fpu(enum fpu_mode mode) | |||
74 | default: | 74 | default: |
75 | BUG(); | 75 | BUG(); |
76 | } | 76 | } |
77 | |||
78 | return SIGFPE; | ||
77 | } | 79 | } |
78 | 80 | ||
79 | #define __disable_fpu() \ | 81 | #define __disable_fpu() \ |
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index 1dee279f9665..d6e154a9e6a5 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h | |||
@@ -369,16 +369,18 @@ | |||
369 | #define __NR_process_vm_writev (__NR_Linux + 346) | 369 | #define __NR_process_vm_writev (__NR_Linux + 346) |
370 | #define __NR_kcmp (__NR_Linux + 347) | 370 | #define __NR_kcmp (__NR_Linux + 347) |
371 | #define __NR_finit_module (__NR_Linux + 348) | 371 | #define __NR_finit_module (__NR_Linux + 348) |
372 | #define __NR_sched_setattr (__NR_Linux + 349) | ||
373 | #define __NR_sched_getattr (__NR_Linux + 350) | ||
372 | 374 | ||
373 | /* | 375 | /* |
374 | * Offset of the last Linux o32 flavoured syscall | 376 | * Offset of the last Linux o32 flavoured syscall |
375 | */ | 377 | */ |
376 | #define __NR_Linux_syscalls 348 | 378 | #define __NR_Linux_syscalls 350 |
377 | 379 | ||
378 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 380 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
379 | 381 | ||
380 | #define __NR_O32_Linux 4000 | 382 | #define __NR_O32_Linux 4000 |
381 | #define __NR_O32_Linux_syscalls 348 | 383 | #define __NR_O32_Linux_syscalls 350 |
382 | 384 | ||
383 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 385 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
384 | 386 | ||
@@ -695,16 +697,18 @@ | |||
695 | #define __NR_kcmp (__NR_Linux + 306) | 697 | #define __NR_kcmp (__NR_Linux + 306) |
696 | #define __NR_finit_module (__NR_Linux + 307) | 698 | #define __NR_finit_module (__NR_Linux + 307) |
697 | #define __NR_getdents64 (__NR_Linux + 308) | 699 | #define __NR_getdents64 (__NR_Linux + 308) |
700 | #define __NR_sched_setattr (__NR_Linux + 309) | ||
701 | #define __NR_sched_getattr (__NR_Linux + 310) | ||
698 | 702 | ||
699 | /* | 703 | /* |
700 | * Offset of the last Linux 64-bit flavoured syscall | 704 | * Offset of the last Linux 64-bit flavoured syscall |
701 | */ | 705 | */ |
702 | #define __NR_Linux_syscalls 308 | 706 | #define __NR_Linux_syscalls 310 |
703 | 707 | ||
704 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 708 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
705 | 709 | ||
706 | #define __NR_64_Linux 5000 | 710 | #define __NR_64_Linux 5000 |
707 | #define __NR_64_Linux_syscalls 308 | 711 | #define __NR_64_Linux_syscalls 310 |
708 | 712 | ||
709 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 713 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
710 | 714 | ||
@@ -1025,15 +1029,17 @@ | |||
1025 | #define __NR_process_vm_writev (__NR_Linux + 310) | 1029 | #define __NR_process_vm_writev (__NR_Linux + 310) |
1026 | #define __NR_kcmp (__NR_Linux + 311) | 1030 | #define __NR_kcmp (__NR_Linux + 311) |
1027 | #define __NR_finit_module (__NR_Linux + 312) | 1031 | #define __NR_finit_module (__NR_Linux + 312) |
1032 | #define __NR_sched_setattr (__NR_Linux + 313) | ||
1033 | #define __NR_sched_getattr (__NR_Linux + 314) | ||
1028 | 1034 | ||
1029 | /* | 1035 | /* |
1030 | * Offset of the last N32 flavoured syscall | 1036 | * Offset of the last N32 flavoured syscall |
1031 | */ | 1037 | */ |
1032 | #define __NR_Linux_syscalls 312 | 1038 | #define __NR_Linux_syscalls 314 |
1033 | 1039 | ||
1034 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 1040 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
1035 | 1041 | ||
1036 | #define __NR_N32_Linux 6000 | 1042 | #define __NR_N32_Linux 6000 |
1037 | #define __NR_N32_Linux_syscalls 312 | 1043 | #define __NR_N32_Linux_syscalls 314 |
1038 | 1044 | ||
1039 | #endif /* _UAPI_ASM_UNISTD_H */ | 1045 | #endif /* _UAPI_ASM_UNISTD_H */ |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index e8e541b40d86..a5b14f48e1af 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -563,3 +563,5 @@ EXPORT(sys_call_table) | |||
563 | PTR sys_process_vm_writev | 563 | PTR sys_process_vm_writev |
564 | PTR sys_kcmp | 564 | PTR sys_kcmp |
565 | PTR sys_finit_module | 565 | PTR sys_finit_module |
566 | PTR sys_sched_setattr | ||
567 | PTR sys_sched_getattr /* 4350 */ | ||
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 57e3742fec59..b56e254beb15 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -425,4 +425,6 @@ EXPORT(sys_call_table) | |||
425 | PTR sys_kcmp | 425 | PTR sys_kcmp |
426 | PTR sys_finit_module | 426 | PTR sys_finit_module |
427 | PTR sys_getdents64 | 427 | PTR sys_getdents64 |
428 | PTR sys_sched_setattr | ||
429 | PTR sys_sched_getattr /* 5310 */ | ||
428 | .size sys_call_table,.-sys_call_table | 430 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 2f48f5934399..f7e5b72cf481 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -418,4 +418,6 @@ EXPORT(sysn32_call_table) | |||
418 | PTR compat_sys_process_vm_writev /* 6310 */ | 418 | PTR compat_sys_process_vm_writev /* 6310 */ |
419 | PTR sys_kcmp | 419 | PTR sys_kcmp |
420 | PTR sys_finit_module | 420 | PTR sys_finit_module |
421 | PTR sys_sched_setattr | ||
422 | PTR sys_sched_getattr | ||
421 | .size sysn32_call_table,.-sysn32_call_table | 423 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index f1acdb429f4f..6788727d91af 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -541,4 +541,6 @@ EXPORT(sys32_call_table) | |||
541 | PTR compat_sys_process_vm_writev | 541 | PTR compat_sys_process_vm_writev |
542 | PTR sys_kcmp | 542 | PTR sys_kcmp |
543 | PTR sys_finit_module | 543 | PTR sys_finit_module |
544 | PTR sys_sched_setattr | ||
545 | PTR sys_sched_getattr /* 4350 */ | ||
544 | .size sys32_call_table,.-sys32_call_table | 546 | .size sys32_call_table,.-sys32_call_table |
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 88d0962de65a..2bedafea3d94 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -33,22 +33,9 @@ | |||
33 | 33 | ||
34 | int hpux_execve(struct pt_regs *regs) | 34 | int hpux_execve(struct pt_regs *regs) |
35 | { | 35 | { |
36 | int error; | 36 | return do_execve(getname((const char __user *) regs->gr[26]), |
37 | struct filename *filename; | ||
38 | |||
39 | filename = getname((const char __user *) regs->gr[26]); | ||
40 | error = PTR_ERR(filename); | ||
41 | if (IS_ERR(filename)) | ||
42 | goto out; | ||
43 | |||
44 | error = do_execve(filename->name, | ||
45 | (const char __user *const __user *) regs->gr[25], | 37 | (const char __user *const __user *) regs->gr[25], |
46 | (const char __user *const __user *) regs->gr[24]); | 38 | (const char __user *const __user *) regs->gr[24]); |
47 | |||
48 | putname(filename); | ||
49 | |||
50 | out: | ||
51 | return error; | ||
52 | } | 39 | } |
53 | 40 | ||
54 | struct hpux_dirent { | 41 | struct hpux_dirent { |
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index e27e9ad6818e..150866b2a3fe 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -134,6 +134,7 @@ static inline int dma_supported(struct device *dev, u64 mask) | |||
134 | } | 134 | } |
135 | 135 | ||
136 | extern int dma_set_mask(struct device *dev, u64 dma_mask); | 136 | extern int dma_set_mask(struct device *dev, u64 dma_mask); |
137 | extern int __dma_set_mask(struct device *dev, u64 dma_mask); | ||
137 | 138 | ||
138 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) | 139 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
139 | 140 | ||
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index 9e39ceb1d19f..d4dd41fb951b 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc/include/asm/eeh.h | |||
@@ -172,10 +172,20 @@ struct eeh_ops { | |||
172 | }; | 172 | }; |
173 | 173 | ||
174 | extern struct eeh_ops *eeh_ops; | 174 | extern struct eeh_ops *eeh_ops; |
175 | extern int eeh_subsystem_enabled; | 175 | extern bool eeh_subsystem_enabled; |
176 | extern raw_spinlock_t confirm_error_lock; | 176 | extern raw_spinlock_t confirm_error_lock; |
177 | extern int eeh_probe_mode; | 177 | extern int eeh_probe_mode; |
178 | 178 | ||
179 | static inline bool eeh_enabled(void) | ||
180 | { | ||
181 | return eeh_subsystem_enabled; | ||
182 | } | ||
183 | |||
184 | static inline void eeh_set_enable(bool mode) | ||
185 | { | ||
186 | eeh_subsystem_enabled = mode; | ||
187 | } | ||
188 | |||
179 | #define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ | 189 | #define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ |
180 | #define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */ | 190 | #define EEH_PROBE_MODE_DEVTREE (1<<1) /* From device tree */ |
181 | 191 | ||
@@ -246,7 +256,7 @@ void eeh_remove_device(struct pci_dev *); | |||
246 | * If this macro yields TRUE, the caller relays to eeh_check_failure() | 256 | * If this macro yields TRUE, the caller relays to eeh_check_failure() |
247 | * which does further tests out of line. | 257 | * which does further tests out of line. |
248 | */ | 258 | */ |
249 | #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_subsystem_enabled) | 259 | #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_enabled()) |
250 | 260 | ||
251 | /* | 261 | /* |
252 | * Reads from a device which has been isolated by EEH will return | 262 | * Reads from a device which has been isolated by EEH will return |
@@ -257,6 +267,13 @@ void eeh_remove_device(struct pci_dev *); | |||
257 | 267 | ||
258 | #else /* !CONFIG_EEH */ | 268 | #else /* !CONFIG_EEH */ |
259 | 269 | ||
270 | static inline bool eeh_enabled(void) | ||
271 | { | ||
272 | return false; | ||
273 | } | ||
274 | |||
275 | static inline void eeh_set_enable(bool mode) { } | ||
276 | |||
260 | static inline int eeh_init(void) | 277 | static inline int eeh_init(void) |
261 | { | 278 | { |
262 | return 0; | 279 | return 0; |
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index d750336b171d..623f2971ce0e 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h | |||
@@ -127,7 +127,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | |||
127 | unsigned long addr, pte_t *ptep) | 127 | unsigned long addr, pte_t *ptep) |
128 | { | 128 | { |
129 | #ifdef CONFIG_PPC64 | 129 | #ifdef CONFIG_PPC64 |
130 | return __pte(pte_update(mm, addr, ptep, ~0UL, 1)); | 130 | return __pte(pte_update(mm, addr, ptep, ~0UL, 0, 1)); |
131 | #else | 131 | #else |
132 | return __pte(pte_update(ptep, ~0UL, 0)); | 132 | return __pte(pte_update(ptep, ~0UL, 0)); |
133 | #endif | 133 | #endif |
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h index f7a8036579b5..42632c7a2a4e 100644 --- a/arch/powerpc/include/asm/iommu.h +++ b/arch/powerpc/include/asm/iommu.h | |||
@@ -77,6 +77,7 @@ struct iommu_table { | |||
77 | #ifdef CONFIG_IOMMU_API | 77 | #ifdef CONFIG_IOMMU_API |
78 | struct iommu_group *it_group; | 78 | struct iommu_group *it_group; |
79 | #endif | 79 | #endif |
80 | void (*set_bypass)(struct iommu_table *tbl, bool enable); | ||
80 | }; | 81 | }; |
81 | 82 | ||
82 | /* Pure 2^n version of get_order */ | 83 | /* Pure 2^n version of get_order */ |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index bc141c950b1e..eb9261024f51 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
@@ -195,6 +195,7 @@ extern void hpte_need_flush(struct mm_struct *mm, unsigned long addr, | |||
195 | static inline unsigned long pte_update(struct mm_struct *mm, | 195 | static inline unsigned long pte_update(struct mm_struct *mm, |
196 | unsigned long addr, | 196 | unsigned long addr, |
197 | pte_t *ptep, unsigned long clr, | 197 | pte_t *ptep, unsigned long clr, |
198 | unsigned long set, | ||
198 | int huge) | 199 | int huge) |
199 | { | 200 | { |
200 | #ifdef PTE_ATOMIC_UPDATES | 201 | #ifdef PTE_ATOMIC_UPDATES |
@@ -205,14 +206,15 @@ static inline unsigned long pte_update(struct mm_struct *mm, | |||
205 | andi. %1,%0,%6\n\ | 206 | andi. %1,%0,%6\n\ |
206 | bne- 1b \n\ | 207 | bne- 1b \n\ |
207 | andc %1,%0,%4 \n\ | 208 | andc %1,%0,%4 \n\ |
209 | or %1,%1,%7\n\ | ||
208 | stdcx. %1,0,%3 \n\ | 210 | stdcx. %1,0,%3 \n\ |
209 | bne- 1b" | 211 | bne- 1b" |
210 | : "=&r" (old), "=&r" (tmp), "=m" (*ptep) | 212 | : "=&r" (old), "=&r" (tmp), "=m" (*ptep) |
211 | : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) | 213 | : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY), "r" (set) |
212 | : "cc" ); | 214 | : "cc" ); |
213 | #else | 215 | #else |
214 | unsigned long old = pte_val(*ptep); | 216 | unsigned long old = pte_val(*ptep); |
215 | *ptep = __pte(old & ~clr); | 217 | *ptep = __pte((old & ~clr) | set); |
216 | #endif | 218 | #endif |
217 | /* huge pages use the old page table lock */ | 219 | /* huge pages use the old page table lock */ |
218 | if (!huge) | 220 | if (!huge) |
@@ -231,9 +233,9 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm, | |||
231 | { | 233 | { |
232 | unsigned long old; | 234 | unsigned long old; |
233 | 235 | ||
234 | if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) | 236 | if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) |
235 | return 0; | 237 | return 0; |
236 | old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0); | 238 | old = pte_update(mm, addr, ptep, _PAGE_ACCESSED, 0, 0); |
237 | return (old & _PAGE_ACCESSED) != 0; | 239 | return (old & _PAGE_ACCESSED) != 0; |
238 | } | 240 | } |
239 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 241 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
@@ -252,7 +254,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
252 | if ((pte_val(*ptep) & _PAGE_RW) == 0) | 254 | if ((pte_val(*ptep) & _PAGE_RW) == 0) |
253 | return; | 255 | return; |
254 | 256 | ||
255 | pte_update(mm, addr, ptep, _PAGE_RW, 0); | 257 | pte_update(mm, addr, ptep, _PAGE_RW, 0, 0); |
256 | } | 258 | } |
257 | 259 | ||
258 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | 260 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, |
@@ -261,7 +263,7 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | |||
261 | if ((pte_val(*ptep) & _PAGE_RW) == 0) | 263 | if ((pte_val(*ptep) & _PAGE_RW) == 0) |
262 | return; | 264 | return; |
263 | 265 | ||
264 | pte_update(mm, addr, ptep, _PAGE_RW, 1); | 266 | pte_update(mm, addr, ptep, _PAGE_RW, 0, 1); |
265 | } | 267 | } |
266 | 268 | ||
267 | /* | 269 | /* |
@@ -284,14 +286,14 @@ static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | |||
284 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, | 286 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, |
285 | unsigned long addr, pte_t *ptep) | 287 | unsigned long addr, pte_t *ptep) |
286 | { | 288 | { |
287 | unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0); | 289 | unsigned long old = pte_update(mm, addr, ptep, ~0UL, 0, 0); |
288 | return __pte(old); | 290 | return __pte(old); |
289 | } | 291 | } |
290 | 292 | ||
291 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, | 293 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, |
292 | pte_t * ptep) | 294 | pte_t * ptep) |
293 | { | 295 | { |
294 | pte_update(mm, addr, ptep, ~0UL, 0); | 296 | pte_update(mm, addr, ptep, ~0UL, 0, 0); |
295 | } | 297 | } |
296 | 298 | ||
297 | 299 | ||
@@ -506,7 +508,9 @@ extern int pmdp_set_access_flags(struct vm_area_struct *vma, | |||
506 | 508 | ||
507 | extern unsigned long pmd_hugepage_update(struct mm_struct *mm, | 509 | extern unsigned long pmd_hugepage_update(struct mm_struct *mm, |
508 | unsigned long addr, | 510 | unsigned long addr, |
509 | pmd_t *pmdp, unsigned long clr); | 511 | pmd_t *pmdp, |
512 | unsigned long clr, | ||
513 | unsigned long set); | ||
510 | 514 | ||
511 | static inline int __pmdp_test_and_clear_young(struct mm_struct *mm, | 515 | static inline int __pmdp_test_and_clear_young(struct mm_struct *mm, |
512 | unsigned long addr, pmd_t *pmdp) | 516 | unsigned long addr, pmd_t *pmdp) |
@@ -515,7 +519,7 @@ static inline int __pmdp_test_and_clear_young(struct mm_struct *mm, | |||
515 | 519 | ||
516 | if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) | 520 | if ((pmd_val(*pmdp) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) |
517 | return 0; | 521 | return 0; |
518 | old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED); | 522 | old = pmd_hugepage_update(mm, addr, pmdp, _PAGE_ACCESSED, 0); |
519 | return ((old & _PAGE_ACCESSED) != 0); | 523 | return ((old & _PAGE_ACCESSED) != 0); |
520 | } | 524 | } |
521 | 525 | ||
@@ -542,7 +546,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
542 | if ((pmd_val(*pmdp) & _PAGE_RW) == 0) | 546 | if ((pmd_val(*pmdp) & _PAGE_RW) == 0) |
543 | return; | 547 | return; |
544 | 548 | ||
545 | pmd_hugepage_update(mm, addr, pmdp, _PAGE_RW); | 549 | pmd_hugepage_update(mm, addr, pmdp, _PAGE_RW, 0); |
546 | } | 550 | } |
547 | 551 | ||
548 | #define __HAVE_ARCH_PMDP_SPLITTING_FLUSH | 552 | #define __HAVE_ARCH_PMDP_SPLITTING_FLUSH |
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index f83b6f3e1b39..3ebb188c3ff5 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h | |||
@@ -75,12 +75,34 @@ static inline pte_t pte_mknuma(pte_t pte) | |||
75 | return pte; | 75 | return pte; |
76 | } | 76 | } |
77 | 77 | ||
78 | #define ptep_set_numa ptep_set_numa | ||
79 | static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr, | ||
80 | pte_t *ptep) | ||
81 | { | ||
82 | if ((pte_val(*ptep) & _PAGE_PRESENT) == 0) | ||
83 | VM_BUG_ON(1); | ||
84 | |||
85 | pte_update(mm, addr, ptep, _PAGE_PRESENT, _PAGE_NUMA, 0); | ||
86 | return; | ||
87 | } | ||
88 | |||
78 | #define pmd_numa pmd_numa | 89 | #define pmd_numa pmd_numa |
79 | static inline int pmd_numa(pmd_t pmd) | 90 | static inline int pmd_numa(pmd_t pmd) |
80 | { | 91 | { |
81 | return pte_numa(pmd_pte(pmd)); | 92 | return pte_numa(pmd_pte(pmd)); |
82 | } | 93 | } |
83 | 94 | ||
95 | #define pmdp_set_numa pmdp_set_numa | ||
96 | static inline void pmdp_set_numa(struct mm_struct *mm, unsigned long addr, | ||
97 | pmd_t *pmdp) | ||
98 | { | ||
99 | if ((pmd_val(*pmdp) & _PAGE_PRESENT) == 0) | ||
100 | VM_BUG_ON(1); | ||
101 | |||
102 | pmd_hugepage_update(mm, addr, pmdp, _PAGE_PRESENT, _PAGE_NUMA); | ||
103 | return; | ||
104 | } | ||
105 | |||
84 | #define pmd_mknonnuma pmd_mknonnuma | 106 | #define pmd_mknonnuma pmd_mknonnuma |
85 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) | 107 | static inline pmd_t pmd_mknonnuma(pmd_t pmd) |
86 | { | 108 | { |
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index 4ee06fe15de4..d0e784e0ff48 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #ifdef __powerpc64__ | 9 | #ifdef __powerpc64__ |
10 | 10 | ||
11 | extern char __start_interrupts[]; | ||
11 | extern char __end_interrupts[]; | 12 | extern char __end_interrupts[]; |
12 | 13 | ||
13 | extern char __prom_init_toc_start[]; | 14 | extern char __prom_init_toc_start[]; |
@@ -21,6 +22,17 @@ static inline int in_kernel_text(unsigned long addr) | |||
21 | return 0; | 22 | return 0; |
22 | } | 23 | } |
23 | 24 | ||
25 | static inline int overlaps_interrupt_vector_text(unsigned long start, | ||
26 | unsigned long end) | ||
27 | { | ||
28 | unsigned long real_start, real_end; | ||
29 | real_start = __start_interrupts - _stext; | ||
30 | real_end = __end_interrupts - _stext; | ||
31 | |||
32 | return start < (unsigned long)__va(real_end) && | ||
33 | (unsigned long)__va(real_start) < end; | ||
34 | } | ||
35 | |||
24 | static inline int overlaps_kernel_text(unsigned long start, unsigned long end) | 36 | static inline int overlaps_kernel_text(unsigned long start, unsigned long end) |
25 | { | 37 | { |
26 | return start < (unsigned long)__init_end && | 38 | return start < (unsigned long)__init_end && |
diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h index 0d9cecddf8a4..c53f5f6d1761 100644 --- a/arch/powerpc/include/asm/vdso.h +++ b/arch/powerpc/include/asm/vdso.h | |||
@@ -4,11 +4,11 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | /* Default link addresses for the vDSOs */ | 6 | /* Default link addresses for the vDSOs */ |
7 | #define VDSO32_LBASE 0x100000 | 7 | #define VDSO32_LBASE 0x0 |
8 | #define VDSO64_LBASE 0x100000 | 8 | #define VDSO64_LBASE 0x0 |
9 | 9 | ||
10 | /* Default map addresses for 32bit vDSO */ | 10 | /* Default map addresses for 32bit vDSO */ |
11 | #define VDSO32_MBASE VDSO32_LBASE | 11 | #define VDSO32_MBASE 0x100000 |
12 | 12 | ||
13 | #define VDSO_VERSION_STRING LINUX_2.6.15 | 13 | #define VDSO_VERSION_STRING LINUX_2.6.15 |
14 | 14 | ||
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 8032b97ccdcb..ee78f6e49d64 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c | |||
@@ -191,12 +191,10 @@ EXPORT_SYMBOL(dma_direct_ops); | |||
191 | 191 | ||
192 | #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16) | 192 | #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16) |
193 | 193 | ||
194 | int dma_set_mask(struct device *dev, u64 dma_mask) | 194 | int __dma_set_mask(struct device *dev, u64 dma_mask) |
195 | { | 195 | { |
196 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 196 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
197 | 197 | ||
198 | if (ppc_md.dma_set_mask) | ||
199 | return ppc_md.dma_set_mask(dev, dma_mask); | ||
200 | if ((dma_ops != NULL) && (dma_ops->set_dma_mask != NULL)) | 198 | if ((dma_ops != NULL) && (dma_ops->set_dma_mask != NULL)) |
201 | return dma_ops->set_dma_mask(dev, dma_mask); | 199 | return dma_ops->set_dma_mask(dev, dma_mask); |
202 | if (!dev->dma_mask || !dma_supported(dev, dma_mask)) | 200 | if (!dev->dma_mask || !dma_supported(dev, dma_mask)) |
@@ -204,6 +202,12 @@ int dma_set_mask(struct device *dev, u64 dma_mask) | |||
204 | *dev->dma_mask = dma_mask; | 202 | *dev->dma_mask = dma_mask; |
205 | return 0; | 203 | return 0; |
206 | } | 204 | } |
205 | int dma_set_mask(struct device *dev, u64 dma_mask) | ||
206 | { | ||
207 | if (ppc_md.dma_set_mask) | ||
208 | return ppc_md.dma_set_mask(dev, dma_mask); | ||
209 | return __dma_set_mask(dev, dma_mask); | ||
210 | } | ||
207 | EXPORT_SYMBOL(dma_set_mask); | 211 | EXPORT_SYMBOL(dma_set_mask); |
208 | 212 | ||
209 | u64 dma_get_required_mask(struct device *dev) | 213 | u64 dma_get_required_mask(struct device *dev) |
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 148db72a8c43..e7b76a6bf150 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
29 | #include <linux/proc_fs.h> | 29 | #include <linux/proc_fs.h> |
30 | #include <linux/rbtree.h> | 30 | #include <linux/rbtree.h> |
31 | #include <linux/reboot.h> | ||
31 | #include <linux/seq_file.h> | 32 | #include <linux/seq_file.h> |
32 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
33 | #include <linux/export.h> | 34 | #include <linux/export.h> |
@@ -89,7 +90,7 @@ | |||
89 | /* Platform dependent EEH operations */ | 90 | /* Platform dependent EEH operations */ |
90 | struct eeh_ops *eeh_ops = NULL; | 91 | struct eeh_ops *eeh_ops = NULL; |
91 | 92 | ||
92 | int eeh_subsystem_enabled; | 93 | bool eeh_subsystem_enabled = false; |
93 | EXPORT_SYMBOL(eeh_subsystem_enabled); | 94 | EXPORT_SYMBOL(eeh_subsystem_enabled); |
94 | 95 | ||
95 | /* | 96 | /* |
@@ -364,7 +365,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev) | |||
364 | 365 | ||
365 | eeh_stats.total_mmio_ffs++; | 366 | eeh_stats.total_mmio_ffs++; |
366 | 367 | ||
367 | if (!eeh_subsystem_enabled) | 368 | if (!eeh_enabled()) |
368 | return 0; | 369 | return 0; |
369 | 370 | ||
370 | if (!edev) { | 371 | if (!edev) { |
@@ -747,6 +748,17 @@ int __exit eeh_ops_unregister(const char *name) | |||
747 | return -EEXIST; | 748 | return -EEXIST; |
748 | } | 749 | } |
749 | 750 | ||
751 | static int eeh_reboot_notifier(struct notifier_block *nb, | ||
752 | unsigned long action, void *unused) | ||
753 | { | ||
754 | eeh_set_enable(false); | ||
755 | return NOTIFY_DONE; | ||
756 | } | ||
757 | |||
758 | static struct notifier_block eeh_reboot_nb = { | ||
759 | .notifier_call = eeh_reboot_notifier, | ||
760 | }; | ||
761 | |||
750 | /** | 762 | /** |
751 | * eeh_init - EEH initialization | 763 | * eeh_init - EEH initialization |
752 | * | 764 | * |
@@ -778,6 +790,14 @@ int eeh_init(void) | |||
778 | if (machine_is(powernv) && cnt++ <= 0) | 790 | if (machine_is(powernv) && cnt++ <= 0) |
779 | return ret; | 791 | return ret; |
780 | 792 | ||
793 | /* Register reboot notifier */ | ||
794 | ret = register_reboot_notifier(&eeh_reboot_nb); | ||
795 | if (ret) { | ||
796 | pr_warn("%s: Failed to register notifier (%d)\n", | ||
797 | __func__, ret); | ||
798 | return ret; | ||
799 | } | ||
800 | |||
781 | /* call platform initialization function */ | 801 | /* call platform initialization function */ |
782 | if (!eeh_ops) { | 802 | if (!eeh_ops) { |
783 | pr_warning("%s: Platform EEH operation not found\n", | 803 | pr_warning("%s: Platform EEH operation not found\n", |
@@ -822,7 +842,7 @@ int eeh_init(void) | |||
822 | return ret; | 842 | return ret; |
823 | } | 843 | } |
824 | 844 | ||
825 | if (eeh_subsystem_enabled) | 845 | if (eeh_enabled()) |
826 | pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n"); | 846 | pr_info("EEH: PCI Enhanced I/O Error Handling Enabled\n"); |
827 | else | 847 | else |
828 | pr_warning("EEH: No capable adapters found\n"); | 848 | pr_warning("EEH: No capable adapters found\n"); |
@@ -897,7 +917,7 @@ void eeh_add_device_late(struct pci_dev *dev) | |||
897 | struct device_node *dn; | 917 | struct device_node *dn; |
898 | struct eeh_dev *edev; | 918 | struct eeh_dev *edev; |
899 | 919 | ||
900 | if (!dev || !eeh_subsystem_enabled) | 920 | if (!dev || !eeh_enabled()) |
901 | return; | 921 | return; |
902 | 922 | ||
903 | pr_debug("EEH: Adding device %s\n", pci_name(dev)); | 923 | pr_debug("EEH: Adding device %s\n", pci_name(dev)); |
@@ -1005,7 +1025,7 @@ void eeh_remove_device(struct pci_dev *dev) | |||
1005 | { | 1025 | { |
1006 | struct eeh_dev *edev; | 1026 | struct eeh_dev *edev; |
1007 | 1027 | ||
1008 | if (!dev || !eeh_subsystem_enabled) | 1028 | if (!dev || !eeh_enabled()) |
1009 | return; | 1029 | return; |
1010 | edev = pci_dev_to_eeh_dev(dev); | 1030 | edev = pci_dev_to_eeh_dev(dev); |
1011 | 1031 | ||
@@ -1045,7 +1065,7 @@ void eeh_remove_device(struct pci_dev *dev) | |||
1045 | 1065 | ||
1046 | static int proc_eeh_show(struct seq_file *m, void *v) | 1066 | static int proc_eeh_show(struct seq_file *m, void *v) |
1047 | { | 1067 | { |
1048 | if (0 == eeh_subsystem_enabled) { | 1068 | if (!eeh_enabled()) { |
1049 | seq_printf(m, "EEH Subsystem is globally disabled\n"); | 1069 | seq_printf(m, "EEH Subsystem is globally disabled\n"); |
1050 | seq_printf(m, "eeh_total_mmio_ffs=%llu\n", eeh_stats.total_mmio_ffs); | 1070 | seq_printf(m, "eeh_total_mmio_ffs=%llu\n", eeh_stats.total_mmio_ffs); |
1051 | } else { | 1071 | } else { |
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 7bb30dca4e19..fdc679d309ec 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c | |||
@@ -362,9 +362,13 @@ static void *eeh_rmv_device(void *data, void *userdata) | |||
362 | */ | 362 | */ |
363 | if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE)) | 363 | if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE)) |
364 | return NULL; | 364 | return NULL; |
365 | |||
365 | driver = eeh_pcid_get(dev); | 366 | driver = eeh_pcid_get(dev); |
366 | if (driver && driver->err_handler) | 367 | if (driver) { |
367 | return NULL; | 368 | eeh_pcid_put(dev); |
369 | if (driver->err_handler) | ||
370 | return NULL; | ||
371 | } | ||
368 | 372 | ||
369 | /* Remove it from PCI subsystem */ | 373 | /* Remove it from PCI subsystem */ |
370 | pr_debug("EEH: Removing %s without EEH sensitive driver\n", | 374 | pr_debug("EEH: Removing %s without EEH sensitive driver\n", |
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index d773dd440a45..88e3ec6e1d96 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -1088,6 +1088,14 @@ int iommu_take_ownership(struct iommu_table *tbl) | |||
1088 | memset(tbl->it_map, 0xff, sz); | 1088 | memset(tbl->it_map, 0xff, sz); |
1089 | iommu_clear_tces_and_put_pages(tbl, tbl->it_offset, tbl->it_size); | 1089 | iommu_clear_tces_and_put_pages(tbl, tbl->it_offset, tbl->it_size); |
1090 | 1090 | ||
1091 | /* | ||
1092 | * Disable iommu bypass, otherwise the user can DMA to all of | ||
1093 | * our physical memory via the bypass window instead of just | ||
1094 | * the pages that has been explicitly mapped into the iommu | ||
1095 | */ | ||
1096 | if (tbl->set_bypass) | ||
1097 | tbl->set_bypass(tbl, false); | ||
1098 | |||
1091 | return 0; | 1099 | return 0; |
1092 | } | 1100 | } |
1093 | EXPORT_SYMBOL_GPL(iommu_take_ownership); | 1101 | EXPORT_SYMBOL_GPL(iommu_take_ownership); |
@@ -1102,6 +1110,10 @@ void iommu_release_ownership(struct iommu_table *tbl) | |||
1102 | /* Restore bit#0 set by iommu_init_table() */ | 1110 | /* Restore bit#0 set by iommu_init_table() */ |
1103 | if (tbl->it_offset == 0) | 1111 | if (tbl->it_offset == 0) |
1104 | set_bit(0, tbl->it_map); | 1112 | set_bit(0, tbl->it_map); |
1113 | |||
1114 | /* The kernel owns the device now, we can restore the iommu bypass */ | ||
1115 | if (tbl->set_bypass) | ||
1116 | tbl->set_bypass(tbl, true); | ||
1105 | } | 1117 | } |
1106 | EXPORT_SYMBOL_GPL(iommu_release_ownership); | 1118 | EXPORT_SYMBOL_GPL(iommu_release_ownership); |
1107 | 1119 | ||
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 9729b23bfb0a..1d0848bba049 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -559,8 +559,13 @@ void exc_lvl_ctx_init(void) | |||
559 | #ifdef CONFIG_PPC64 | 559 | #ifdef CONFIG_PPC64 |
560 | cpu_nr = i; | 560 | cpu_nr = i; |
561 | #else | 561 | #else |
562 | #ifdef CONFIG_SMP | ||
562 | cpu_nr = get_hard_smp_processor_id(i); | 563 | cpu_nr = get_hard_smp_processor_id(i); |
564 | #else | ||
565 | cpu_nr = 0; | ||
563 | #endif | 566 | #endif |
567 | #endif | ||
568 | |||
564 | memset((void *)critirq_ctx[cpu_nr], 0, THREAD_SIZE); | 569 | memset((void *)critirq_ctx[cpu_nr], 0, THREAD_SIZE); |
565 | tp = critirq_ctx[cpu_nr]; | 570 | tp = critirq_ctx[cpu_nr]; |
566 | tp->cpu = cpu_nr; | 571 | tp->cpu = cpu_nr; |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index 75d4f7340da8..015ae55c1868 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -196,7 +196,9 @@ int overlaps_crashkernel(unsigned long start, unsigned long size) | |||
196 | 196 | ||
197 | /* Values we need to export to the second kernel via the device tree. */ | 197 | /* Values we need to export to the second kernel via the device tree. */ |
198 | static phys_addr_t kernel_end; | 198 | static phys_addr_t kernel_end; |
199 | static phys_addr_t crashk_base; | ||
199 | static phys_addr_t crashk_size; | 200 | static phys_addr_t crashk_size; |
201 | static unsigned long long mem_limit; | ||
200 | 202 | ||
201 | static struct property kernel_end_prop = { | 203 | static struct property kernel_end_prop = { |
202 | .name = "linux,kernel-end", | 204 | .name = "linux,kernel-end", |
@@ -207,7 +209,7 @@ static struct property kernel_end_prop = { | |||
207 | static struct property crashk_base_prop = { | 209 | static struct property crashk_base_prop = { |
208 | .name = "linux,crashkernel-base", | 210 | .name = "linux,crashkernel-base", |
209 | .length = sizeof(phys_addr_t), | 211 | .length = sizeof(phys_addr_t), |
210 | .value = &crashk_res.start, | 212 | .value = &crashk_base |
211 | }; | 213 | }; |
212 | 214 | ||
213 | static struct property crashk_size_prop = { | 215 | static struct property crashk_size_prop = { |
@@ -219,9 +221,11 @@ static struct property crashk_size_prop = { | |||
219 | static struct property memory_limit_prop = { | 221 | static struct property memory_limit_prop = { |
220 | .name = "linux,memory-limit", | 222 | .name = "linux,memory-limit", |
221 | .length = sizeof(unsigned long long), | 223 | .length = sizeof(unsigned long long), |
222 | .value = &memory_limit, | 224 | .value = &mem_limit, |
223 | }; | 225 | }; |
224 | 226 | ||
227 | #define cpu_to_be_ulong __PASTE(cpu_to_be, BITS_PER_LONG) | ||
228 | |||
225 | static void __init export_crashk_values(struct device_node *node) | 229 | static void __init export_crashk_values(struct device_node *node) |
226 | { | 230 | { |
227 | struct property *prop; | 231 | struct property *prop; |
@@ -237,8 +241,9 @@ static void __init export_crashk_values(struct device_node *node) | |||
237 | of_remove_property(node, prop); | 241 | of_remove_property(node, prop); |
238 | 242 | ||
239 | if (crashk_res.start != 0) { | 243 | if (crashk_res.start != 0) { |
244 | crashk_base = cpu_to_be_ulong(crashk_res.start), | ||
240 | of_add_property(node, &crashk_base_prop); | 245 | of_add_property(node, &crashk_base_prop); |
241 | crashk_size = resource_size(&crashk_res); | 246 | crashk_size = cpu_to_be_ulong(resource_size(&crashk_res)); |
242 | of_add_property(node, &crashk_size_prop); | 247 | of_add_property(node, &crashk_size_prop); |
243 | } | 248 | } |
244 | 249 | ||
@@ -246,6 +251,7 @@ static void __init export_crashk_values(struct device_node *node) | |||
246 | * memory_limit is required by the kexec-tools to limit the | 251 | * memory_limit is required by the kexec-tools to limit the |
247 | * crash regions to the actual memory used. | 252 | * crash regions to the actual memory used. |
248 | */ | 253 | */ |
254 | mem_limit = cpu_to_be_ulong(memory_limit); | ||
249 | of_update_property(node, &memory_limit_prop); | 255 | of_update_property(node, &memory_limit_prop); |
250 | } | 256 | } |
251 | 257 | ||
@@ -264,7 +270,7 @@ static int __init kexec_setup(void) | |||
264 | of_remove_property(node, prop); | 270 | of_remove_property(node, prop); |
265 | 271 | ||
266 | /* information needed by userspace when using default_machine_kexec */ | 272 | /* information needed by userspace when using default_machine_kexec */ |
267 | kernel_end = __pa(_end); | 273 | kernel_end = cpu_to_be_ulong(__pa(_end)); |
268 | of_add_property(node, &kernel_end_prop); | 274 | of_add_property(node, &kernel_end_prop); |
269 | 275 | ||
270 | export_crashk_values(node); | 276 | export_crashk_values(node); |
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index be4e6d648f60..59d229a2a3e0 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -369,6 +369,7 @@ void default_machine_kexec(struct kimage *image) | |||
369 | 369 | ||
370 | /* Values we need to export to the second kernel via the device tree. */ | 370 | /* Values we need to export to the second kernel via the device tree. */ |
371 | static unsigned long htab_base; | 371 | static unsigned long htab_base; |
372 | static unsigned long htab_size; | ||
372 | 373 | ||
373 | static struct property htab_base_prop = { | 374 | static struct property htab_base_prop = { |
374 | .name = "linux,htab-base", | 375 | .name = "linux,htab-base", |
@@ -379,7 +380,7 @@ static struct property htab_base_prop = { | |||
379 | static struct property htab_size_prop = { | 380 | static struct property htab_size_prop = { |
380 | .name = "linux,htab-size", | 381 | .name = "linux,htab-size", |
381 | .length = sizeof(unsigned long), | 382 | .length = sizeof(unsigned long), |
382 | .value = &htab_size_bytes, | 383 | .value = &htab_size, |
383 | }; | 384 | }; |
384 | 385 | ||
385 | static int __init export_htab_values(void) | 386 | static int __init export_htab_values(void) |
@@ -403,8 +404,9 @@ static int __init export_htab_values(void) | |||
403 | if (prop) | 404 | if (prop) |
404 | of_remove_property(node, prop); | 405 | of_remove_property(node, prop); |
405 | 406 | ||
406 | htab_base = __pa(htab_address); | 407 | htab_base = cpu_to_be64(__pa(htab_address)); |
407 | of_add_property(node, &htab_base_prop); | 408 | of_add_property(node, &htab_base_prop); |
409 | htab_size = cpu_to_be64(htab_size_bytes); | ||
408 | of_add_property(node, &htab_size_prop); | 410 | of_add_property(node, &htab_size_prop); |
409 | 411 | ||
410 | of_node_put(node); | 412 | of_node_put(node); |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 879f09620f83..7c6bb4b17b49 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -57,11 +57,14 @@ _GLOBAL(call_do_softirq) | |||
57 | mtlr r0 | 57 | mtlr r0 |
58 | blr | 58 | blr |
59 | 59 | ||
60 | /* | ||
61 | * void call_do_irq(struct pt_regs *regs, struct thread_info *irqtp); | ||
62 | */ | ||
60 | _GLOBAL(call_do_irq) | 63 | _GLOBAL(call_do_irq) |
61 | mflr r0 | 64 | mflr r0 |
62 | stw r0,4(r1) | 65 | stw r0,4(r1) |
63 | lwz r10,THREAD+KSP_LIMIT(r2) | 66 | lwz r10,THREAD+KSP_LIMIT(r2) |
64 | addi r11,r3,THREAD_INFO_GAP | 67 | addi r11,r4,THREAD_INFO_GAP |
65 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) | 68 | stwu r1,THREAD_SIZE-STACK_FRAME_OVERHEAD(r4) |
66 | mr r1,r4 | 69 | mr r1,r4 |
67 | stw r10,8(r1) | 70 | stw r10,8(r1) |
diff --git a/arch/powerpc/kernel/reloc_64.S b/arch/powerpc/kernel/reloc_64.S index b47a0e1ab001..1482327cfeba 100644 --- a/arch/powerpc/kernel/reloc_64.S +++ b/arch/powerpc/kernel/reloc_64.S | |||
@@ -69,8 +69,8 @@ _GLOBAL(relocate) | |||
69 | * R_PPC64_RELATIVE ones. | 69 | * R_PPC64_RELATIVE ones. |
70 | */ | 70 | */ |
71 | mtctr r8 | 71 | mtctr r8 |
72 | 5: lwz r0,12(9) /* ELF64_R_TYPE(reloc->r_info) */ | 72 | 5: ld r0,8(9) /* ELF64_R_TYPE(reloc->r_info) */ |
73 | cmpwi r0,R_PPC64_RELATIVE | 73 | cmpdi r0,R_PPC64_RELATIVE |
74 | bne 6f | 74 | bne 6f |
75 | ld r6,0(r9) /* reloc->r_offset */ | 75 | ld r6,0(r9) /* reloc->r_offset */ |
76 | ld r0,16(r9) /* reloc->r_addend */ | 76 | ld r0,16(r9) /* reloc->r_addend */ |
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 2b0da27eaee4..04cc4fcca78b 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -247,7 +247,12 @@ static void __init exc_lvl_early_init(void) | |||
247 | /* interrupt stacks must be in lowmem, we get that for free on ppc32 | 247 | /* interrupt stacks must be in lowmem, we get that for free on ppc32 |
248 | * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */ | 248 | * as the memblock is limited to lowmem by MEMBLOCK_REAL_LIMIT */ |
249 | for_each_possible_cpu(i) { | 249 | for_each_possible_cpu(i) { |
250 | #ifdef CONFIG_SMP | ||
250 | hw_cpu = get_hard_smp_processor_id(i); | 251 | hw_cpu = get_hard_smp_processor_id(i); |
252 | #else | ||
253 | hw_cpu = 0; | ||
254 | #endif | ||
255 | |||
251 | critirq_ctx[hw_cpu] = (struct thread_info *) | 256 | critirq_ctx[hw_cpu] = (struct thread_info *) |
252 | __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); | 257 | __va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); |
253 | #ifdef CONFIG_BOOKE | 258 | #ifdef CONFIG_BOOKE |
diff --git a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S index 79683d0393f5..6ac107ac402a 100644 --- a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S +++ b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S | |||
@@ -6,7 +6,7 @@ | |||
6 | .globl vdso32_start, vdso32_end | 6 | .globl vdso32_start, vdso32_end |
7 | .balign PAGE_SIZE | 7 | .balign PAGE_SIZE |
8 | vdso32_start: | 8 | vdso32_start: |
9 | .incbin "arch/powerpc/kernel/vdso32/vdso32.so" | 9 | .incbin "arch/powerpc/kernel/vdso32/vdso32.so.dbg" |
10 | .balign PAGE_SIZE | 10 | .balign PAGE_SIZE |
11 | vdso32_end: | 11 | vdso32_end: |
12 | 12 | ||
diff --git a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S index 8df9e2463007..df60fca6a13d 100644 --- a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S +++ b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S | |||
@@ -6,7 +6,7 @@ | |||
6 | .globl vdso64_start, vdso64_end | 6 | .globl vdso64_start, vdso64_end |
7 | .balign PAGE_SIZE | 7 | .balign PAGE_SIZE |
8 | vdso64_start: | 8 | vdso64_start: |
9 | .incbin "arch/powerpc/kernel/vdso64/vdso64.so" | 9 | .incbin "arch/powerpc/kernel/vdso64/vdso64.so.dbg" |
10 | .balign PAGE_SIZE | 10 | .balign PAGE_SIZE |
11 | vdso64_end: | 11 | vdso64_end: |
12 | 12 | ||
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index de6881259aef..d766d6ee33fe 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -207,6 +207,20 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
207 | if (overlaps_kernel_text(vaddr, vaddr + step)) | 207 | if (overlaps_kernel_text(vaddr, vaddr + step)) |
208 | tprot &= ~HPTE_R_N; | 208 | tprot &= ~HPTE_R_N; |
209 | 209 | ||
210 | /* | ||
211 | * If relocatable, check if it overlaps interrupt vectors that | ||
212 | * are copied down to real 0. For relocatable kernel | ||
213 | * (e.g. kdump case) we copy interrupt vectors down to real | ||
214 | * address 0. Mark that region as executable. This is | ||
215 | * because on p8 system with relocation on exception feature | ||
216 | * enabled, exceptions are raised with MMU (IR=DR=1) ON. Hence | ||
217 | * in order to execute the interrupt handlers in virtual | ||
218 | * mode the vector region need to be marked as executable. | ||
219 | */ | ||
220 | if ((PHYSICAL_START > MEMORY_START) && | ||
221 | overlaps_interrupt_vector_text(vaddr, vaddr + step)) | ||
222 | tprot &= ~HPTE_R_N; | ||
223 | |||
210 | hash = hpt_hash(vpn, shift, ssize); | 224 | hash = hpt_hash(vpn, shift, ssize); |
211 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); | 225 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); |
212 | 226 | ||
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index 65b7b65e8708..62bf5e8e78da 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c | |||
@@ -510,7 +510,8 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, unsigned long address, | |||
510 | } | 510 | } |
511 | 511 | ||
512 | unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, | 512 | unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, |
513 | pmd_t *pmdp, unsigned long clr) | 513 | pmd_t *pmdp, unsigned long clr, |
514 | unsigned long set) | ||
514 | { | 515 | { |
515 | 516 | ||
516 | unsigned long old, tmp; | 517 | unsigned long old, tmp; |
@@ -526,14 +527,15 @@ unsigned long pmd_hugepage_update(struct mm_struct *mm, unsigned long addr, | |||
526 | andi. %1,%0,%6\n\ | 527 | andi. %1,%0,%6\n\ |
527 | bne- 1b \n\ | 528 | bne- 1b \n\ |
528 | andc %1,%0,%4 \n\ | 529 | andc %1,%0,%4 \n\ |
530 | or %1,%1,%7\n\ | ||
529 | stdcx. %1,0,%3 \n\ | 531 | stdcx. %1,0,%3 \n\ |
530 | bne- 1b" | 532 | bne- 1b" |
531 | : "=&r" (old), "=&r" (tmp), "=m" (*pmdp) | 533 | : "=&r" (old), "=&r" (tmp), "=m" (*pmdp) |
532 | : "r" (pmdp), "r" (clr), "m" (*pmdp), "i" (_PAGE_BUSY) | 534 | : "r" (pmdp), "r" (clr), "m" (*pmdp), "i" (_PAGE_BUSY), "r" (set) |
533 | : "cc" ); | 535 | : "cc" ); |
534 | #else | 536 | #else |
535 | old = pmd_val(*pmdp); | 537 | old = pmd_val(*pmdp); |
536 | *pmdp = __pmd(old & ~clr); | 538 | *pmdp = __pmd((old & ~clr) | set); |
537 | #endif | 539 | #endif |
538 | if (old & _PAGE_HASHPTE) | 540 | if (old & _PAGE_HASHPTE) |
539 | hpte_do_hugepage_flush(mm, addr, pmdp); | 541 | hpte_do_hugepage_flush(mm, addr, pmdp); |
@@ -708,7 +710,7 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr, | |||
708 | void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, | 710 | void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, |
709 | pmd_t *pmdp) | 711 | pmd_t *pmdp) |
710 | { | 712 | { |
711 | pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT); | 713 | pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT, 0); |
712 | } | 714 | } |
713 | 715 | ||
714 | /* | 716 | /* |
@@ -835,7 +837,7 @@ pmd_t pmdp_get_and_clear(struct mm_struct *mm, | |||
835 | unsigned long old; | 837 | unsigned long old; |
836 | pgtable_t *pgtable_slot; | 838 | pgtable_t *pgtable_slot; |
837 | 839 | ||
838 | old = pmd_hugepage_update(mm, addr, pmdp, ~0UL); | 840 | old = pmd_hugepage_update(mm, addr, pmdp, ~0UL, 0); |
839 | old_pmd = __pmd(old); | 841 | old_pmd = __pmd(old); |
840 | /* | 842 | /* |
841 | * We have pmd == none and we are holding page_table_lock. | 843 | * We have pmd == none and we are holding page_table_lock. |
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c index a770df2dae70..6c0b1f5f8d2c 100644 --- a/arch/powerpc/mm/subpage-prot.c +++ b/arch/powerpc/mm/subpage-prot.c | |||
@@ -78,7 +78,7 @@ static void hpte_flush_range(struct mm_struct *mm, unsigned long addr, | |||
78 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); | 78 | pte = pte_offset_map_lock(mm, pmd, addr, &ptl); |
79 | arch_enter_lazy_mmu_mode(); | 79 | arch_enter_lazy_mmu_mode(); |
80 | for (; npages > 0; --npages) { | 80 | for (; npages > 0; --npages) { |
81 | pte_update(mm, addr, pte, 0, 0); | 81 | pte_update(mm, addr, pte, 0, 0, 0); |
82 | addr += PAGE_SIZE; | 82 | addr += PAGE_SIZE; |
83 | ++pte; | 83 | ++pte; |
84 | } | 84 | } |
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 29b89e863d7c..67cf22083f4c 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c | |||
@@ -1147,6 +1147,9 @@ static void power_pmu_enable(struct pmu *pmu) | |||
1147 | mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]); | 1147 | mmcr0 = ebb_switch_in(ebb, cpuhw->mmcr[0]); |
1148 | 1148 | ||
1149 | mb(); | 1149 | mb(); |
1150 | if (cpuhw->bhrb_users) | ||
1151 | ppmu->config_bhrb(cpuhw->bhrb_filter); | ||
1152 | |||
1150 | write_mmcr0(cpuhw, mmcr0); | 1153 | write_mmcr0(cpuhw, mmcr0); |
1151 | 1154 | ||
1152 | /* | 1155 | /* |
@@ -1158,8 +1161,6 @@ static void power_pmu_enable(struct pmu *pmu) | |||
1158 | } | 1161 | } |
1159 | 1162 | ||
1160 | out: | 1163 | out: |
1161 | if (cpuhw->bhrb_users) | ||
1162 | ppmu->config_bhrb(cpuhw->bhrb_filter); | ||
1163 | 1164 | ||
1164 | local_irq_restore(flags); | 1165 | local_irq_restore(flags); |
1165 | } | 1166 | } |
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index a3f7abd2f13f..96cee20dcd34 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c | |||
@@ -25,6 +25,37 @@ | |||
25 | #define PM_BRU_FIN 0x10068 | 25 | #define PM_BRU_FIN 0x10068 |
26 | #define PM_BR_MPRED_CMPL 0x400f6 | 26 | #define PM_BR_MPRED_CMPL 0x400f6 |
27 | 27 | ||
28 | /* All L1 D cache load references counted at finish, gated by reject */ | ||
29 | #define PM_LD_REF_L1 0x100ee | ||
30 | /* Load Missed L1 */ | ||
31 | #define PM_LD_MISS_L1 0x3e054 | ||
32 | /* Store Missed L1 */ | ||
33 | #define PM_ST_MISS_L1 0x300f0 | ||
34 | /* L1 cache data prefetches */ | ||
35 | #define PM_L1_PREF 0x0d8b8 | ||
36 | /* Instruction fetches from L1 */ | ||
37 | #define PM_INST_FROM_L1 0x04080 | ||
38 | /* Demand iCache Miss */ | ||
39 | #define PM_L1_ICACHE_MISS 0x200fd | ||
40 | /* Instruction Demand sectors wriittent into IL1 */ | ||
41 | #define PM_L1_DEMAND_WRITE 0x0408c | ||
42 | /* Instruction prefetch written into IL1 */ | ||
43 | #define PM_IC_PREF_WRITE 0x0408e | ||
44 | /* The data cache was reloaded from local core's L3 due to a demand load */ | ||
45 | #define PM_DATA_FROM_L3 0x4c042 | ||
46 | /* Demand LD - L3 Miss (not L2 hit and not L3 hit) */ | ||
47 | #define PM_DATA_FROM_L3MISS 0x300fe | ||
48 | /* All successful D-side store dispatches for this thread */ | ||
49 | #define PM_L2_ST 0x17080 | ||
50 | /* All successful D-side store dispatches for this thread that were L2 Miss */ | ||
51 | #define PM_L2_ST_MISS 0x17082 | ||
52 | /* Total HW L3 prefetches(Load+store) */ | ||
53 | #define PM_L3_PREF_ALL 0x4e052 | ||
54 | /* Data PTEG reload */ | ||
55 | #define PM_DTLB_MISS 0x300fc | ||
56 | /* ITLB Reloaded */ | ||
57 | #define PM_ITLB_MISS 0x400fc | ||
58 | |||
28 | 59 | ||
29 | /* | 60 | /* |
30 | * Raw event encoding for POWER8: | 61 | * Raw event encoding for POWER8: |
@@ -557,6 +588,8 @@ static int power8_generic_events[] = { | |||
557 | [PERF_COUNT_HW_INSTRUCTIONS] = PM_INST_CMPL, | 588 | [PERF_COUNT_HW_INSTRUCTIONS] = PM_INST_CMPL, |
558 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = PM_BRU_FIN, | 589 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = PM_BRU_FIN, |
559 | [PERF_COUNT_HW_BRANCH_MISSES] = PM_BR_MPRED_CMPL, | 590 | [PERF_COUNT_HW_BRANCH_MISSES] = PM_BR_MPRED_CMPL, |
591 | [PERF_COUNT_HW_CACHE_REFERENCES] = PM_LD_REF_L1, | ||
592 | [PERF_COUNT_HW_CACHE_MISSES] = PM_LD_MISS_L1, | ||
560 | }; | 593 | }; |
561 | 594 | ||
562 | static u64 power8_bhrb_filter_map(u64 branch_sample_type) | 595 | static u64 power8_bhrb_filter_map(u64 branch_sample_type) |
@@ -596,6 +629,116 @@ static void power8_config_bhrb(u64 pmu_bhrb_filter) | |||
596 | mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter)); | 629 | mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter)); |
597 | } | 630 | } |
598 | 631 | ||
632 | #define C(x) PERF_COUNT_HW_CACHE_##x | ||
633 | |||
634 | /* | ||
635 | * Table of generalized cache-related events. | ||
636 | * 0 means not supported, -1 means nonsensical, other values | ||
637 | * are event codes. | ||
638 | */ | ||
639 | static int power8_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { | ||
640 | [ C(L1D) ] = { | ||
641 | [ C(OP_READ) ] = { | ||
642 | [ C(RESULT_ACCESS) ] = PM_LD_REF_L1, | ||
643 | [ C(RESULT_MISS) ] = PM_LD_MISS_L1, | ||
644 | }, | ||
645 | [ C(OP_WRITE) ] = { | ||
646 | [ C(RESULT_ACCESS) ] = 0, | ||
647 | [ C(RESULT_MISS) ] = PM_ST_MISS_L1, | ||
648 | }, | ||
649 | [ C(OP_PREFETCH) ] = { | ||
650 | [ C(RESULT_ACCESS) ] = PM_L1_PREF, | ||
651 | [ C(RESULT_MISS) ] = 0, | ||
652 | }, | ||
653 | }, | ||
654 | [ C(L1I) ] = { | ||
655 | [ C(OP_READ) ] = { | ||
656 | [ C(RESULT_ACCESS) ] = PM_INST_FROM_L1, | ||
657 | [ C(RESULT_MISS) ] = PM_L1_ICACHE_MISS, | ||
658 | }, | ||
659 | [ C(OP_WRITE) ] = { | ||
660 | [ C(RESULT_ACCESS) ] = PM_L1_DEMAND_WRITE, | ||
661 | [ C(RESULT_MISS) ] = -1, | ||
662 | }, | ||
663 | [ C(OP_PREFETCH) ] = { | ||
664 | [ C(RESULT_ACCESS) ] = PM_IC_PREF_WRITE, | ||
665 | [ C(RESULT_MISS) ] = 0, | ||
666 | }, | ||
667 | }, | ||
668 | [ C(LL) ] = { | ||
669 | [ C(OP_READ) ] = { | ||
670 | [ C(RESULT_ACCESS) ] = PM_DATA_FROM_L3, | ||
671 | [ C(RESULT_MISS) ] = PM_DATA_FROM_L3MISS, | ||
672 | }, | ||
673 | [ C(OP_WRITE) ] = { | ||
674 | [ C(RESULT_ACCESS) ] = PM_L2_ST, | ||
675 | [ C(RESULT_MISS) ] = PM_L2_ST_MISS, | ||
676 | }, | ||
677 | [ C(OP_PREFETCH) ] = { | ||
678 | [ C(RESULT_ACCESS) ] = PM_L3_PREF_ALL, | ||
679 | [ C(RESULT_MISS) ] = 0, | ||
680 | }, | ||
681 | }, | ||
682 | [ C(DTLB) ] = { | ||
683 | [ C(OP_READ) ] = { | ||
684 | [ C(RESULT_ACCESS) ] = 0, | ||
685 | [ C(RESULT_MISS) ] = PM_DTLB_MISS, | ||
686 | }, | ||
687 | [ C(OP_WRITE) ] = { | ||
688 | [ C(RESULT_ACCESS) ] = -1, | ||
689 | [ C(RESULT_MISS) ] = -1, | ||
690 | }, | ||
691 | [ C(OP_PREFETCH) ] = { | ||
692 | [ C(RESULT_ACCESS) ] = -1, | ||
693 | [ C(RESULT_MISS) ] = -1, | ||
694 | }, | ||
695 | }, | ||
696 | [ C(ITLB) ] = { | ||
697 | [ C(OP_READ) ] = { | ||
698 | [ C(RESULT_ACCESS) ] = 0, | ||
699 | [ C(RESULT_MISS) ] = PM_ITLB_MISS, | ||
700 | }, | ||
701 | [ C(OP_WRITE) ] = { | ||
702 | [ C(RESULT_ACCESS) ] = -1, | ||
703 | [ C(RESULT_MISS) ] = -1, | ||
704 | }, | ||
705 | [ C(OP_PREFETCH) ] = { | ||
706 | [ C(RESULT_ACCESS) ] = -1, | ||
707 | [ C(RESULT_MISS) ] = -1, | ||
708 | }, | ||
709 | }, | ||
710 | [ C(BPU) ] = { | ||
711 | [ C(OP_READ) ] = { | ||
712 | [ C(RESULT_ACCESS) ] = PM_BRU_FIN, | ||
713 | [ C(RESULT_MISS) ] = PM_BR_MPRED_CMPL, | ||
714 | }, | ||
715 | [ C(OP_WRITE) ] = { | ||
716 | [ C(RESULT_ACCESS) ] = -1, | ||
717 | [ C(RESULT_MISS) ] = -1, | ||
718 | }, | ||
719 | [ C(OP_PREFETCH) ] = { | ||
720 | [ C(RESULT_ACCESS) ] = -1, | ||
721 | [ C(RESULT_MISS) ] = -1, | ||
722 | }, | ||
723 | }, | ||
724 | [ C(NODE) ] = { | ||
725 | [ C(OP_READ) ] = { | ||
726 | [ C(RESULT_ACCESS) ] = -1, | ||
727 | [ C(RESULT_MISS) ] = -1, | ||
728 | }, | ||
729 | [ C(OP_WRITE) ] = { | ||
730 | [ C(RESULT_ACCESS) ] = -1, | ||
731 | [ C(RESULT_MISS) ] = -1, | ||
732 | }, | ||
733 | [ C(OP_PREFETCH) ] = { | ||
734 | [ C(RESULT_ACCESS) ] = -1, | ||
735 | [ C(RESULT_MISS) ] = -1, | ||
736 | }, | ||
737 | }, | ||
738 | }; | ||
739 | |||
740 | #undef C | ||
741 | |||
599 | static struct power_pmu power8_pmu = { | 742 | static struct power_pmu power8_pmu = { |
600 | .name = "POWER8", | 743 | .name = "POWER8", |
601 | .n_counter = 6, | 744 | .n_counter = 6, |
@@ -611,6 +754,7 @@ static struct power_pmu power8_pmu = { | |||
611 | .flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_BHRB | PPMU_EBB, | 754 | .flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_BHRB | PPMU_EBB, |
612 | .n_generic = ARRAY_SIZE(power8_generic_events), | 755 | .n_generic = ARRAY_SIZE(power8_generic_events), |
613 | .generic_events = power8_generic_events, | 756 | .generic_events = power8_generic_events, |
757 | .cache_events = &power8_cache_events, | ||
614 | .attr_groups = power8_pmu_attr_groups, | 758 | .attr_groups = power8_pmu_attr_groups, |
615 | .bhrb_nr = 32, | 759 | .bhrb_nr = 32, |
616 | }; | 760 | }; |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index e1e71618b70c..f51474336460 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -44,7 +44,8 @@ static int ioda_eeh_event(struct notifier_block *nb, | |||
44 | 44 | ||
45 | /* We simply send special EEH event */ | 45 | /* We simply send special EEH event */ |
46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && | 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && |
47 | (events & OPAL_EVENT_PCI_ERROR)) | 47 | (events & OPAL_EVENT_PCI_ERROR) && |
48 | eeh_enabled()) | ||
48 | eeh_send_failure_event(NULL); | 49 | eeh_send_failure_event(NULL); |
49 | 50 | ||
50 | return 0; | 51 | return 0; |
@@ -489,8 +490,7 @@ static int ioda_eeh_bridge_reset(struct pci_controller *hose, | |||
489 | static int ioda_eeh_reset(struct eeh_pe *pe, int option) | 490 | static int ioda_eeh_reset(struct eeh_pe *pe, int option) |
490 | { | 491 | { |
491 | struct pci_controller *hose = pe->phb; | 492 | struct pci_controller *hose = pe->phb; |
492 | struct eeh_dev *edev; | 493 | struct pci_bus *bus; |
493 | struct pci_dev *dev; | ||
494 | int ret; | 494 | int ret; |
495 | 495 | ||
496 | /* | 496 | /* |
@@ -519,31 +519,11 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option) | |||
519 | if (pe->type & EEH_PE_PHB) { | 519 | if (pe->type & EEH_PE_PHB) { |
520 | ret = ioda_eeh_phb_reset(hose, option); | 520 | ret = ioda_eeh_phb_reset(hose, option); |
521 | } else { | 521 | } else { |
522 | if (pe->type & EEH_PE_DEVICE) { | 522 | bus = eeh_pe_bus_get(pe); |
523 | /* | 523 | if (pci_is_root_bus(bus)) |
524 | * If it's device PE, we didn't refer to the parent | ||
525 | * PCI bus yet. So we have to figure it out indirectly. | ||
526 | */ | ||
527 | edev = list_first_entry(&pe->edevs, | ||
528 | struct eeh_dev, list); | ||
529 | dev = eeh_dev_to_pci_dev(edev); | ||
530 | dev = dev->bus->self; | ||
531 | } else { | ||
532 | /* | ||
533 | * If it's bus PE, the parent PCI bus is already there | ||
534 | * and just pick it up. | ||
535 | */ | ||
536 | dev = pe->bus->self; | ||
537 | } | ||
538 | |||
539 | /* | ||
540 | * Do reset based on the fact that the direct upstream bridge | ||
541 | * is root bridge (port) or not. | ||
542 | */ | ||
543 | if (dev->bus->number == 0) | ||
544 | ret = ioda_eeh_root_reset(hose, option); | 524 | ret = ioda_eeh_root_reset(hose, option); |
545 | else | 525 | else |
546 | ret = ioda_eeh_bridge_reset(hose, dev, option); | 526 | ret = ioda_eeh_bridge_reset(hose, bus->self, option); |
547 | } | 527 | } |
548 | 528 | ||
549 | return ret; | 529 | return ret; |
diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index a79fddc5e74e..a59788e83b8b 100644 --- a/arch/powerpc/platforms/powernv/eeh-powernv.c +++ b/arch/powerpc/platforms/powernv/eeh-powernv.c | |||
@@ -145,7 +145,7 @@ static int powernv_eeh_dev_probe(struct pci_dev *dev, void *flag) | |||
145 | * Enable EEH explicitly so that we will do EEH check | 145 | * Enable EEH explicitly so that we will do EEH check |
146 | * while accessing I/O stuff | 146 | * while accessing I/O stuff |
147 | */ | 147 | */ |
148 | eeh_subsystem_enabled = 1; | 148 | eeh_set_enable(true); |
149 | 149 | ||
150 | /* Save memory bars */ | 150 | /* Save memory bars */ |
151 | eeh_save_bars(edev); | 151 | eeh_save_bars(edev); |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 7d6dcc6d5fa9..3b2b4fb3585b 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/irq.h> | 21 | #include <linux/irq.h> |
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/msi.h> | 23 | #include <linux/msi.h> |
24 | #include <linux/memblock.h> | ||
24 | 25 | ||
25 | #include <asm/sections.h> | 26 | #include <asm/sections.h> |
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
@@ -460,9 +461,39 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev | |||
460 | return; | 461 | return; |
461 | 462 | ||
462 | pe = &phb->ioda.pe_array[pdn->pe_number]; | 463 | pe = &phb->ioda.pe_array[pdn->pe_number]; |
464 | WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops); | ||
463 | set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table); | 465 | set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table); |
464 | } | 466 | } |
465 | 467 | ||
468 | static int pnv_pci_ioda_dma_set_mask(struct pnv_phb *phb, | ||
469 | struct pci_dev *pdev, u64 dma_mask) | ||
470 | { | ||
471 | struct pci_dn *pdn = pci_get_pdn(pdev); | ||
472 | struct pnv_ioda_pe *pe; | ||
473 | uint64_t top; | ||
474 | bool bypass = false; | ||
475 | |||
476 | if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) | ||
477 | return -ENODEV;; | ||
478 | |||
479 | pe = &phb->ioda.pe_array[pdn->pe_number]; | ||
480 | if (pe->tce_bypass_enabled) { | ||
481 | top = pe->tce_bypass_base + memblock_end_of_DRAM() - 1; | ||
482 | bypass = (dma_mask >= top); | ||
483 | } | ||
484 | |||
485 | if (bypass) { | ||
486 | dev_info(&pdev->dev, "Using 64-bit DMA iommu bypass\n"); | ||
487 | set_dma_ops(&pdev->dev, &dma_direct_ops); | ||
488 | set_dma_offset(&pdev->dev, pe->tce_bypass_base); | ||
489 | } else { | ||
490 | dev_info(&pdev->dev, "Using 32-bit DMA via iommu\n"); | ||
491 | set_dma_ops(&pdev->dev, &dma_iommu_ops); | ||
492 | set_iommu_table_base(&pdev->dev, &pe->tce32_table); | ||
493 | } | ||
494 | return 0; | ||
495 | } | ||
496 | |||
466 | static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus) | 497 | static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus) |
467 | { | 498 | { |
468 | struct pci_dev *dev; | 499 | struct pci_dev *dev; |
@@ -657,6 +688,56 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb *phb, | |||
657 | __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs)); | 688 | __free_pages(tce_mem, get_order(TCE32_TABLE_SIZE * segs)); |
658 | } | 689 | } |
659 | 690 | ||
691 | static void pnv_pci_ioda2_set_bypass(struct iommu_table *tbl, bool enable) | ||
692 | { | ||
693 | struct pnv_ioda_pe *pe = container_of(tbl, struct pnv_ioda_pe, | ||
694 | tce32_table); | ||
695 | uint16_t window_id = (pe->pe_number << 1 ) + 1; | ||
696 | int64_t rc; | ||
697 | |||
698 | pe_info(pe, "%sabling 64-bit DMA bypass\n", enable ? "En" : "Dis"); | ||
699 | if (enable) { | ||
700 | phys_addr_t top = memblock_end_of_DRAM(); | ||
701 | |||
702 | top = roundup_pow_of_two(top); | ||
703 | rc = opal_pci_map_pe_dma_window_real(pe->phb->opal_id, | ||
704 | pe->pe_number, | ||
705 | window_id, | ||
706 | pe->tce_bypass_base, | ||
707 | top); | ||
708 | } else { | ||
709 | rc = opal_pci_map_pe_dma_window_real(pe->phb->opal_id, | ||
710 | pe->pe_number, | ||
711 | window_id, | ||
712 | pe->tce_bypass_base, | ||
713 | 0); | ||
714 | |||
715 | /* | ||
716 | * We might want to reset the DMA ops of all devices on | ||
717 | * this PE. However in theory, that shouldn't be necessary | ||
718 | * as this is used for VFIO/KVM pass-through and the device | ||
719 | * hasn't yet been returned to its kernel driver | ||
720 | */ | ||
721 | } | ||
722 | if (rc) | ||
723 | pe_err(pe, "OPAL error %lld configuring bypass window\n", rc); | ||
724 | else | ||
725 | pe->tce_bypass_enabled = enable; | ||
726 | } | ||
727 | |||
728 | static void pnv_pci_ioda2_setup_bypass_pe(struct pnv_phb *phb, | ||
729 | struct pnv_ioda_pe *pe) | ||
730 | { | ||
731 | /* TVE #1 is selected by PCI address bit 59 */ | ||
732 | pe->tce_bypass_base = 1ull << 59; | ||
733 | |||
734 | /* Install set_bypass callback for VFIO */ | ||
735 | pe->tce32_table.set_bypass = pnv_pci_ioda2_set_bypass; | ||
736 | |||
737 | /* Enable bypass by default */ | ||
738 | pnv_pci_ioda2_set_bypass(&pe->tce32_table, true); | ||
739 | } | ||
740 | |||
660 | static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb, | 741 | static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb, |
661 | struct pnv_ioda_pe *pe) | 742 | struct pnv_ioda_pe *pe) |
662 | { | 743 | { |
@@ -727,6 +808,8 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb, | |||
727 | else | 808 | else |
728 | pnv_ioda_setup_bus_dma(pe, pe->pbus); | 809 | pnv_ioda_setup_bus_dma(pe, pe->pbus); |
729 | 810 | ||
811 | /* Also create a bypass window */ | ||
812 | pnv_pci_ioda2_setup_bypass_pe(phb, pe); | ||
730 | return; | 813 | return; |
731 | fail: | 814 | fail: |
732 | if (pe->tce32_seg >= 0) | 815 | if (pe->tce32_seg >= 0) |
@@ -1286,6 +1369,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, | |||
1286 | 1369 | ||
1287 | /* Setup TCEs */ | 1370 | /* Setup TCEs */ |
1288 | phb->dma_dev_setup = pnv_pci_ioda_dma_dev_setup; | 1371 | phb->dma_dev_setup = pnv_pci_ioda_dma_dev_setup; |
1372 | phb->dma_set_mask = pnv_pci_ioda_dma_set_mask; | ||
1289 | 1373 | ||
1290 | /* Setup shutdown function for kexec */ | 1374 | /* Setup shutdown function for kexec */ |
1291 | phb->shutdown = pnv_pci_ioda_shutdown; | 1375 | phb->shutdown = pnv_pci_ioda_shutdown; |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index b555ebc57ef5..95633d79ef5d 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -634,6 +634,16 @@ static void pnv_pci_dma_dev_setup(struct pci_dev *pdev) | |||
634 | pnv_pci_dma_fallback_setup(hose, pdev); | 634 | pnv_pci_dma_fallback_setup(hose, pdev); |
635 | } | 635 | } |
636 | 636 | ||
637 | int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask) | ||
638 | { | ||
639 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | ||
640 | struct pnv_phb *phb = hose->private_data; | ||
641 | |||
642 | if (phb && phb->dma_set_mask) | ||
643 | return phb->dma_set_mask(phb, pdev, dma_mask); | ||
644 | return __dma_set_mask(&pdev->dev, dma_mask); | ||
645 | } | ||
646 | |||
637 | void pnv_pci_shutdown(void) | 647 | void pnv_pci_shutdown(void) |
638 | { | 648 | { |
639 | struct pci_controller *hose; | 649 | struct pci_controller *hose; |
diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerpc/platforms/powernv/pci.h index 13f1942a9a5f..cde169442775 100644 --- a/arch/powerpc/platforms/powernv/pci.h +++ b/arch/powerpc/platforms/powernv/pci.h | |||
@@ -54,7 +54,9 @@ struct pnv_ioda_pe { | |||
54 | struct iommu_table tce32_table; | 54 | struct iommu_table tce32_table; |
55 | phys_addr_t tce_inval_reg_phys; | 55 | phys_addr_t tce_inval_reg_phys; |
56 | 56 | ||
57 | /* XXX TODO: Add support for additional 64-bit iommus */ | 57 | /* 64-bit TCE bypass region */ |
58 | bool tce_bypass_enabled; | ||
59 | uint64_t tce_bypass_base; | ||
58 | 60 | ||
59 | /* MSIs. MVE index is identical for for 32 and 64 bit MSI | 61 | /* MSIs. MVE index is identical for for 32 and 64 bit MSI |
60 | * and -1 if not supported. (It's actually identical to the | 62 | * and -1 if not supported. (It's actually identical to the |
@@ -113,6 +115,8 @@ struct pnv_phb { | |||
113 | unsigned int hwirq, unsigned int virq, | 115 | unsigned int hwirq, unsigned int virq, |
114 | unsigned int is_64, struct msi_msg *msg); | 116 | unsigned int is_64, struct msi_msg *msg); |
115 | void (*dma_dev_setup)(struct pnv_phb *phb, struct pci_dev *pdev); | 117 | void (*dma_dev_setup)(struct pnv_phb *phb, struct pci_dev *pdev); |
118 | int (*dma_set_mask)(struct pnv_phb *phb, struct pci_dev *pdev, | ||
119 | u64 dma_mask); | ||
116 | void (*fixup_phb)(struct pci_controller *hose); | 120 | void (*fixup_phb)(struct pci_controller *hose); |
117 | u32 (*bdfn_to_pe)(struct pnv_phb *phb, struct pci_bus *bus, u32 devfn); | 121 | u32 (*bdfn_to_pe)(struct pnv_phb *phb, struct pci_bus *bus, u32 devfn); |
118 | void (*shutdown)(struct pnv_phb *phb); | 122 | void (*shutdown)(struct pnv_phb *phb); |
diff --git a/arch/powerpc/platforms/powernv/powernv.h b/arch/powerpc/platforms/powernv/powernv.h index de6819be1f95..0051e108ef0f 100644 --- a/arch/powerpc/platforms/powernv/powernv.h +++ b/arch/powerpc/platforms/powernv/powernv.h | |||
@@ -7,12 +7,20 @@ extern void pnv_smp_init(void); | |||
7 | static inline void pnv_smp_init(void) { } | 7 | static inline void pnv_smp_init(void) { } |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | struct pci_dev; | ||
11 | |||
10 | #ifdef CONFIG_PCI | 12 | #ifdef CONFIG_PCI |
11 | extern void pnv_pci_init(void); | 13 | extern void pnv_pci_init(void); |
12 | extern void pnv_pci_shutdown(void); | 14 | extern void pnv_pci_shutdown(void); |
15 | extern int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask); | ||
13 | #else | 16 | #else |
14 | static inline void pnv_pci_init(void) { } | 17 | static inline void pnv_pci_init(void) { } |
15 | static inline void pnv_pci_shutdown(void) { } | 18 | static inline void pnv_pci_shutdown(void) { } |
19 | |||
20 | static inline int pnv_pci_dma_set_mask(struct pci_dev *pdev, u64 dma_mask) | ||
21 | { | ||
22 | return -ENODEV; | ||
23 | } | ||
16 | #endif | 24 | #endif |
17 | 25 | ||
18 | extern void pnv_lpc_init(void); | 26 | extern void pnv_lpc_init(void); |
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 21166f65c97c..110f4fbd319f 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/bug.h> | 28 | #include <linux/bug.h> |
29 | #include <linux/cpuidle.h> | 29 | #include <linux/cpuidle.h> |
30 | #include <linux/pci.h> | ||
30 | 31 | ||
31 | #include <asm/machdep.h> | 32 | #include <asm/machdep.h> |
32 | #include <asm/firmware.h> | 33 | #include <asm/firmware.h> |
@@ -141,6 +142,13 @@ static void pnv_progress(char *s, unsigned short hex) | |||
141 | { | 142 | { |
142 | } | 143 | } |
143 | 144 | ||
145 | static int pnv_dma_set_mask(struct device *dev, u64 dma_mask) | ||
146 | { | ||
147 | if (dev_is_pci(dev)) | ||
148 | return pnv_pci_dma_set_mask(to_pci_dev(dev), dma_mask); | ||
149 | return __dma_set_mask(dev, dma_mask); | ||
150 | } | ||
151 | |||
144 | static void pnv_shutdown(void) | 152 | static void pnv_shutdown(void) |
145 | { | 153 | { |
146 | /* Let the PCI code clear up IODA tables */ | 154 | /* Let the PCI code clear up IODA tables */ |
@@ -238,6 +246,7 @@ define_machine(powernv) { | |||
238 | .machine_shutdown = pnv_shutdown, | 246 | .machine_shutdown = pnv_shutdown, |
239 | .power_save = powernv_idle, | 247 | .power_save = powernv_idle, |
240 | .calibrate_decr = generic_calibrate_decr, | 248 | .calibrate_decr = generic_calibrate_decr, |
249 | .dma_set_mask = pnv_dma_set_mask, | ||
241 | #ifdef CONFIG_KEXEC | 250 | #ifdef CONFIG_KEXEC |
242 | .kexec_cpu_down = pnv_kexec_cpu_down, | 251 | .kexec_cpu_down = pnv_kexec_cpu_down, |
243 | #endif | 252 | #endif |
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 37300f6ee244..80b1d57c306a 100644 --- a/arch/powerpc/platforms/pseries/Kconfig +++ b/arch/powerpc/platforms/pseries/Kconfig | |||
@@ -20,6 +20,7 @@ config PPC_PSERIES | |||
20 | select PPC_DOORBELL | 20 | select PPC_DOORBELL |
21 | select HAVE_CONTEXT_TRACKING | 21 | select HAVE_CONTEXT_TRACKING |
22 | select HOTPLUG_CPU if SMP | 22 | select HOTPLUG_CPU if SMP |
23 | select ARCH_RANDOM | ||
23 | default y | 24 | default y |
24 | 25 | ||
25 | config PPC_SPLPAR | 26 | config PPC_SPLPAR |
diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c index 9ef3cc8ebc11..8a8f0472d98f 100644 --- a/arch/powerpc/platforms/pseries/eeh_pseries.c +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c | |||
@@ -265,7 +265,7 @@ static void *pseries_eeh_of_probe(struct device_node *dn, void *flag) | |||
265 | enable = 1; | 265 | enable = 1; |
266 | 266 | ||
267 | if (enable) { | 267 | if (enable) { |
268 | eeh_subsystem_enabled = 1; | 268 | eeh_set_enable(true); |
269 | eeh_add_to_parent_pe(edev); | 269 | eeh_add_to_parent_pe(edev); |
270 | 270 | ||
271 | pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n", | 271 | pr_debug("%s: EEH enabled on %s PHB#%d-PE#%x, config addr#%x\n", |
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c index 70670a2d9cf2..c413ec158ff5 100644 --- a/arch/powerpc/platforms/pseries/pci.c +++ b/arch/powerpc/platforms/pseries/pci.c | |||
@@ -113,7 +113,8 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
113 | { | 113 | { |
114 | struct device_node *dn, *pdn; | 114 | struct device_node *dn, *pdn; |
115 | struct pci_bus *bus; | 115 | struct pci_bus *bus; |
116 | const __be32 *pcie_link_speed_stats; | 116 | u32 pcie_link_speed_stats[2]; |
117 | int rc; | ||
117 | 118 | ||
118 | bus = bridge->bus; | 119 | bus = bridge->bus; |
119 | 120 | ||
@@ -122,38 +123,45 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
122 | return 0; | 123 | return 0; |
123 | 124 | ||
124 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { | 125 | for (pdn = dn; pdn != NULL; pdn = of_get_next_parent(pdn)) { |
125 | pcie_link_speed_stats = of_get_property(pdn, | 126 | rc = of_property_read_u32_array(pdn, |
126 | "ibm,pcie-link-speed-stats", NULL); | 127 | "ibm,pcie-link-speed-stats", |
127 | if (pcie_link_speed_stats) | 128 | &pcie_link_speed_stats[0], 2); |
129 | if (!rc) | ||
128 | break; | 130 | break; |
129 | } | 131 | } |
130 | 132 | ||
131 | of_node_put(pdn); | 133 | of_node_put(pdn); |
132 | 134 | ||
133 | if (!pcie_link_speed_stats) { | 135 | if (rc) { |
134 | pr_err("no ibm,pcie-link-speed-stats property\n"); | 136 | pr_err("no ibm,pcie-link-speed-stats property\n"); |
135 | return 0; | 137 | return 0; |
136 | } | 138 | } |
137 | 139 | ||
138 | switch (be32_to_cpup(pcie_link_speed_stats)) { | 140 | switch (pcie_link_speed_stats[0]) { |
139 | case 0x01: | 141 | case 0x01: |
140 | bus->max_bus_speed = PCIE_SPEED_2_5GT; | 142 | bus->max_bus_speed = PCIE_SPEED_2_5GT; |
141 | break; | 143 | break; |
142 | case 0x02: | 144 | case 0x02: |
143 | bus->max_bus_speed = PCIE_SPEED_5_0GT; | 145 | bus->max_bus_speed = PCIE_SPEED_5_0GT; |
144 | break; | 146 | break; |
147 | case 0x04: | ||
148 | bus->max_bus_speed = PCIE_SPEED_8_0GT; | ||
149 | break; | ||
145 | default: | 150 | default: |
146 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; | 151 | bus->max_bus_speed = PCI_SPEED_UNKNOWN; |
147 | break; | 152 | break; |
148 | } | 153 | } |
149 | 154 | ||
150 | switch (be32_to_cpup(pcie_link_speed_stats)) { | 155 | switch (pcie_link_speed_stats[1]) { |
151 | case 0x01: | 156 | case 0x01: |
152 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; | 157 | bus->cur_bus_speed = PCIE_SPEED_2_5GT; |
153 | break; | 158 | break; |
154 | case 0x02: | 159 | case 0x02: |
155 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; | 160 | bus->cur_bus_speed = PCIE_SPEED_5_0GT; |
156 | break; | 161 | break; |
162 | case 0x04: | ||
163 | bus->cur_bus_speed = PCIE_SPEED_8_0GT; | ||
164 | break; | ||
157 | default: | 165 | default: |
158 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; | 166 | bus->cur_bus_speed = PCI_SPEED_UNKNOWN; |
159 | break; | 167 | break; |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 8e639d7cbda7..972df0ffd4dc 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -430,8 +430,7 @@ static void pSeries_machine_kexec(struct kimage *image) | |||
430 | { | 430 | { |
431 | long rc; | 431 | long rc; |
432 | 432 | ||
433 | if (firmware_has_feature(FW_FEATURE_SET_MODE) && | 433 | if (firmware_has_feature(FW_FEATURE_SET_MODE)) { |
434 | (image->type != KEXEC_TYPE_CRASH)) { | ||
435 | rc = pSeries_disable_reloc_on_exc(); | 434 | rc = pSeries_disable_reloc_on_exc(); |
436 | if (rc != H_SUCCESS) | 435 | if (rc != H_SUCCESS) |
437 | pr_warning("Warning: Failed to disable relocation on " | 436 | pr_warning("Warning: Failed to disable relocation on " |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 0e166ed4cd16..8209744b2829 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -886,25 +886,25 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type) | |||
886 | 886 | ||
887 | /* Default: read HW settings */ | 887 | /* Default: read HW settings */ |
888 | if (flow_type == IRQ_TYPE_DEFAULT) { | 888 | if (flow_type == IRQ_TYPE_DEFAULT) { |
889 | switch(vold & (MPIC_INFO(VECPRI_POLARITY_MASK) | | 889 | int vold_ps; |
890 | MPIC_INFO(VECPRI_SENSE_MASK))) { | 890 | |
891 | case MPIC_INFO(VECPRI_SENSE_EDGE) | | 891 | vold_ps = vold & (MPIC_INFO(VECPRI_POLARITY_MASK) | |
892 | MPIC_INFO(VECPRI_POLARITY_POSITIVE): | 892 | MPIC_INFO(VECPRI_SENSE_MASK)); |
893 | flow_type = IRQ_TYPE_EDGE_RISING; | 893 | |
894 | break; | 894 | if (vold_ps == (MPIC_INFO(VECPRI_SENSE_EDGE) | |
895 | case MPIC_INFO(VECPRI_SENSE_EDGE) | | 895 | MPIC_INFO(VECPRI_POLARITY_POSITIVE))) |
896 | MPIC_INFO(VECPRI_POLARITY_NEGATIVE): | 896 | flow_type = IRQ_TYPE_EDGE_RISING; |
897 | flow_type = IRQ_TYPE_EDGE_FALLING; | 897 | else if (vold_ps == (MPIC_INFO(VECPRI_SENSE_EDGE) | |
898 | break; | 898 | MPIC_INFO(VECPRI_POLARITY_NEGATIVE))) |
899 | case MPIC_INFO(VECPRI_SENSE_LEVEL) | | 899 | flow_type = IRQ_TYPE_EDGE_FALLING; |
900 | MPIC_INFO(VECPRI_POLARITY_POSITIVE): | 900 | else if (vold_ps == (MPIC_INFO(VECPRI_SENSE_LEVEL) | |
901 | flow_type = IRQ_TYPE_LEVEL_HIGH; | 901 | MPIC_INFO(VECPRI_POLARITY_POSITIVE))) |
902 | break; | 902 | flow_type = IRQ_TYPE_LEVEL_HIGH; |
903 | case MPIC_INFO(VECPRI_SENSE_LEVEL) | | 903 | else if (vold_ps == (MPIC_INFO(VECPRI_SENSE_LEVEL) | |
904 | MPIC_INFO(VECPRI_POLARITY_NEGATIVE): | 904 | MPIC_INFO(VECPRI_POLARITY_NEGATIVE))) |
905 | flow_type = IRQ_TYPE_LEVEL_LOW; | 905 | flow_type = IRQ_TYPE_LEVEL_LOW; |
906 | break; | 906 | else |
907 | } | 907 | WARN_ONCE(1, "mpic: unknown IRQ type %d\n", vold); |
908 | } | 908 | } |
909 | 909 | ||
910 | /* Apply to irq desc */ | 910 | /* Apply to irq desc */ |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index a90731b3d44a..b07909850f77 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -309,16 +309,23 @@ static void get_output_lock(void) | |||
309 | 309 | ||
310 | if (xmon_speaker == me) | 310 | if (xmon_speaker == me) |
311 | return; | 311 | return; |
312 | |||
312 | for (;;) { | 313 | for (;;) { |
313 | if (xmon_speaker == 0) { | 314 | last_speaker = cmpxchg(&xmon_speaker, 0, me); |
314 | last_speaker = cmpxchg(&xmon_speaker, 0, me); | 315 | if (last_speaker == 0) |
315 | if (last_speaker == 0) | 316 | return; |
316 | return; | 317 | |
317 | } | 318 | /* |
318 | timeout = 10000000; | 319 | * Wait a full second for the lock, we might be on a slow |
320 | * console, but check every 100us. | ||
321 | */ | ||
322 | timeout = 10000; | ||
319 | while (xmon_speaker == last_speaker) { | 323 | while (xmon_speaker == last_speaker) { |
320 | if (--timeout > 0) | 324 | if (--timeout > 0) { |
325 | udelay(100); | ||
321 | continue; | 326 | continue; |
327 | } | ||
328 | |||
322 | /* hostile takeover */ | 329 | /* hostile takeover */ |
323 | prev = cmpxchg(&xmon_speaker, last_speaker, me); | 330 | prev = cmpxchg(&xmon_speaker, last_speaker, me); |
324 | if (prev == last_speaker) | 331 | if (prev == last_speaker) |
@@ -397,7 +404,6 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
397 | } | 404 | } |
398 | 405 | ||
399 | xmon_fault_jmp[cpu] = recurse_jmp; | 406 | xmon_fault_jmp[cpu] = recurse_jmp; |
400 | cpumask_set_cpu(cpu, &cpus_in_xmon); | ||
401 | 407 | ||
402 | bp = NULL; | 408 | bp = NULL; |
403 | if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) | 409 | if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) |
@@ -419,6 +425,8 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
419 | release_output_lock(); | 425 | release_output_lock(); |
420 | } | 426 | } |
421 | 427 | ||
428 | cpumask_set_cpu(cpu, &cpus_in_xmon); | ||
429 | |||
422 | waiting: | 430 | waiting: |
423 | secondary = 1; | 431 | secondary = 1; |
424 | while (secondary && !xmon_gate) { | 432 | while (secondary && !xmon_gate) { |
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 4c4a1cef5208..47c8630c93cd 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -529,6 +529,7 @@ static int __init appldata_init(void) | |||
529 | { | 529 | { |
530 | int rc; | 530 | int rc; |
531 | 531 | ||
532 | init_virt_timer(&appldata_timer); | ||
532 | appldata_timer.function = appldata_timer_function; | 533 | appldata_timer.function = appldata_timer_function; |
533 | appldata_timer.data = (unsigned long) &appldata_work; | 534 | appldata_timer.data = (unsigned long) &appldata_work; |
534 | 535 | ||
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index b3feabd39f31..cf3c0089bef2 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/spinlock.h> | ||
28 | #include "crypt_s390.h" | 29 | #include "crypt_s390.h" |
29 | 30 | ||
30 | #define AES_KEYLEN_128 1 | 31 | #define AES_KEYLEN_128 1 |
@@ -32,6 +33,7 @@ | |||
32 | #define AES_KEYLEN_256 4 | 33 | #define AES_KEYLEN_256 4 |
33 | 34 | ||
34 | static u8 *ctrblk; | 35 | static u8 *ctrblk; |
36 | static DEFINE_SPINLOCK(ctrblk_lock); | ||
35 | static char keylen_flag; | 37 | static char keylen_flag; |
36 | 38 | ||
37 | struct s390_aes_ctx { | 39 | struct s390_aes_ctx { |
@@ -758,43 +760,67 @@ static int ctr_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, | |||
758 | return aes_set_key(tfm, in_key, key_len); | 760 | return aes_set_key(tfm, in_key, key_len); |
759 | } | 761 | } |
760 | 762 | ||
763 | static unsigned int __ctrblk_init(u8 *ctrptr, unsigned int nbytes) | ||
764 | { | ||
765 | unsigned int i, n; | ||
766 | |||
767 | /* only use complete blocks, max. PAGE_SIZE */ | ||
768 | n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : nbytes & ~(AES_BLOCK_SIZE - 1); | ||
769 | for (i = AES_BLOCK_SIZE; i < n; i += AES_BLOCK_SIZE) { | ||
770 | memcpy(ctrptr + i, ctrptr + i - AES_BLOCK_SIZE, | ||
771 | AES_BLOCK_SIZE); | ||
772 | crypto_inc(ctrptr + i, AES_BLOCK_SIZE); | ||
773 | } | ||
774 | return n; | ||
775 | } | ||
776 | |||
761 | static int ctr_aes_crypt(struct blkcipher_desc *desc, long func, | 777 | static int ctr_aes_crypt(struct blkcipher_desc *desc, long func, |
762 | struct s390_aes_ctx *sctx, struct blkcipher_walk *walk) | 778 | struct s390_aes_ctx *sctx, struct blkcipher_walk *walk) |
763 | { | 779 | { |
764 | int ret = blkcipher_walk_virt_block(desc, walk, AES_BLOCK_SIZE); | 780 | int ret = blkcipher_walk_virt_block(desc, walk, AES_BLOCK_SIZE); |
765 | unsigned int i, n, nbytes; | 781 | unsigned int n, nbytes; |
766 | u8 buf[AES_BLOCK_SIZE]; | 782 | u8 buf[AES_BLOCK_SIZE], ctrbuf[AES_BLOCK_SIZE]; |
767 | u8 *out, *in; | 783 | u8 *out, *in, *ctrptr = ctrbuf; |
768 | 784 | ||
769 | if (!walk->nbytes) | 785 | if (!walk->nbytes) |
770 | return ret; | 786 | return ret; |
771 | 787 | ||
772 | memcpy(ctrblk, walk->iv, AES_BLOCK_SIZE); | 788 | if (spin_trylock(&ctrblk_lock)) |
789 | ctrptr = ctrblk; | ||
790 | |||
791 | memcpy(ctrptr, walk->iv, AES_BLOCK_SIZE); | ||
773 | while ((nbytes = walk->nbytes) >= AES_BLOCK_SIZE) { | 792 | while ((nbytes = walk->nbytes) >= AES_BLOCK_SIZE) { |
774 | out = walk->dst.virt.addr; | 793 | out = walk->dst.virt.addr; |
775 | in = walk->src.virt.addr; | 794 | in = walk->src.virt.addr; |
776 | while (nbytes >= AES_BLOCK_SIZE) { | 795 | while (nbytes >= AES_BLOCK_SIZE) { |
777 | /* only use complete blocks, max. PAGE_SIZE */ | 796 | if (ctrptr == ctrblk) |
778 | n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : | 797 | n = __ctrblk_init(ctrptr, nbytes); |
779 | nbytes & ~(AES_BLOCK_SIZE - 1); | 798 | else |
780 | for (i = AES_BLOCK_SIZE; i < n; i += AES_BLOCK_SIZE) { | 799 | n = AES_BLOCK_SIZE; |
781 | memcpy(ctrblk + i, ctrblk + i - AES_BLOCK_SIZE, | 800 | ret = crypt_s390_kmctr(func, sctx->key, out, in, |
782 | AES_BLOCK_SIZE); | 801 | n, ctrptr); |
783 | crypto_inc(ctrblk + i, AES_BLOCK_SIZE); | 802 | if (ret < 0 || ret != n) { |
784 | } | 803 | if (ctrptr == ctrblk) |
785 | ret = crypt_s390_kmctr(func, sctx->key, out, in, n, ctrblk); | 804 | spin_unlock(&ctrblk_lock); |
786 | if (ret < 0 || ret != n) | ||
787 | return -EIO; | 805 | return -EIO; |
806 | } | ||
788 | if (n > AES_BLOCK_SIZE) | 807 | if (n > AES_BLOCK_SIZE) |
789 | memcpy(ctrblk, ctrblk + n - AES_BLOCK_SIZE, | 808 | memcpy(ctrptr, ctrptr + n - AES_BLOCK_SIZE, |
790 | AES_BLOCK_SIZE); | 809 | AES_BLOCK_SIZE); |
791 | crypto_inc(ctrblk, AES_BLOCK_SIZE); | 810 | crypto_inc(ctrptr, AES_BLOCK_SIZE); |
792 | out += n; | 811 | out += n; |
793 | in += n; | 812 | in += n; |
794 | nbytes -= n; | 813 | nbytes -= n; |
795 | } | 814 | } |
796 | ret = blkcipher_walk_done(desc, walk, nbytes); | 815 | ret = blkcipher_walk_done(desc, walk, nbytes); |
797 | } | 816 | } |
817 | if (ctrptr == ctrblk) { | ||
818 | if (nbytes) | ||
819 | memcpy(ctrbuf, ctrptr, AES_BLOCK_SIZE); | ||
820 | else | ||
821 | memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE); | ||
822 | spin_unlock(&ctrblk_lock); | ||
823 | } | ||
798 | /* | 824 | /* |
799 | * final block may be < AES_BLOCK_SIZE, copy only nbytes | 825 | * final block may be < AES_BLOCK_SIZE, copy only nbytes |
800 | */ | 826 | */ |
@@ -802,14 +828,15 @@ static int ctr_aes_crypt(struct blkcipher_desc *desc, long func, | |||
802 | out = walk->dst.virt.addr; | 828 | out = walk->dst.virt.addr; |
803 | in = walk->src.virt.addr; | 829 | in = walk->src.virt.addr; |
804 | ret = crypt_s390_kmctr(func, sctx->key, buf, in, | 830 | ret = crypt_s390_kmctr(func, sctx->key, buf, in, |
805 | AES_BLOCK_SIZE, ctrblk); | 831 | AES_BLOCK_SIZE, ctrbuf); |
806 | if (ret < 0 || ret != AES_BLOCK_SIZE) | 832 | if (ret < 0 || ret != AES_BLOCK_SIZE) |
807 | return -EIO; | 833 | return -EIO; |
808 | memcpy(out, buf, nbytes); | 834 | memcpy(out, buf, nbytes); |
809 | crypto_inc(ctrblk, AES_BLOCK_SIZE); | 835 | crypto_inc(ctrbuf, AES_BLOCK_SIZE); |
810 | ret = blkcipher_walk_done(desc, walk, 0); | 836 | ret = blkcipher_walk_done(desc, walk, 0); |
837 | memcpy(walk->iv, ctrbuf, AES_BLOCK_SIZE); | ||
811 | } | 838 | } |
812 | memcpy(walk->iv, ctrblk, AES_BLOCK_SIZE); | 839 | |
813 | return ret; | 840 | return ret; |
814 | } | 841 | } |
815 | 842 | ||
diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c index 200f2a1b599d..0a5aac8a9412 100644 --- a/arch/s390/crypto/des_s390.c +++ b/arch/s390/crypto/des_s390.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #define DES3_KEY_SIZE (3 * DES_KEY_SIZE) | 25 | #define DES3_KEY_SIZE (3 * DES_KEY_SIZE) |
26 | 26 | ||
27 | static u8 *ctrblk; | 27 | static u8 *ctrblk; |
28 | static DEFINE_SPINLOCK(ctrblk_lock); | ||
28 | 29 | ||
29 | struct s390_des_ctx { | 30 | struct s390_des_ctx { |
30 | u8 iv[DES_BLOCK_SIZE]; | 31 | u8 iv[DES_BLOCK_SIZE]; |
@@ -105,29 +106,35 @@ static int ecb_desall_crypt(struct blkcipher_desc *desc, long func, | |||
105 | } | 106 | } |
106 | 107 | ||
107 | static int cbc_desall_crypt(struct blkcipher_desc *desc, long func, | 108 | static int cbc_desall_crypt(struct blkcipher_desc *desc, long func, |
108 | u8 *iv, struct blkcipher_walk *walk) | 109 | struct blkcipher_walk *walk) |
109 | { | 110 | { |
111 | struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); | ||
110 | int ret = blkcipher_walk_virt(desc, walk); | 112 | int ret = blkcipher_walk_virt(desc, walk); |
111 | unsigned int nbytes = walk->nbytes; | 113 | unsigned int nbytes = walk->nbytes; |
114 | struct { | ||
115 | u8 iv[DES_BLOCK_SIZE]; | ||
116 | u8 key[DES3_KEY_SIZE]; | ||
117 | } param; | ||
112 | 118 | ||
113 | if (!nbytes) | 119 | if (!nbytes) |
114 | goto out; | 120 | goto out; |
115 | 121 | ||
116 | memcpy(iv, walk->iv, DES_BLOCK_SIZE); | 122 | memcpy(param.iv, walk->iv, DES_BLOCK_SIZE); |
123 | memcpy(param.key, ctx->key, DES3_KEY_SIZE); | ||
117 | do { | 124 | do { |
118 | /* only use complete blocks */ | 125 | /* only use complete blocks */ |
119 | unsigned int n = nbytes & ~(DES_BLOCK_SIZE - 1); | 126 | unsigned int n = nbytes & ~(DES_BLOCK_SIZE - 1); |
120 | u8 *out = walk->dst.virt.addr; | 127 | u8 *out = walk->dst.virt.addr; |
121 | u8 *in = walk->src.virt.addr; | 128 | u8 *in = walk->src.virt.addr; |
122 | 129 | ||
123 | ret = crypt_s390_kmc(func, iv, out, in, n); | 130 | ret = crypt_s390_kmc(func, ¶m, out, in, n); |
124 | if (ret < 0 || ret != n) | 131 | if (ret < 0 || ret != n) |
125 | return -EIO; | 132 | return -EIO; |
126 | 133 | ||
127 | nbytes &= DES_BLOCK_SIZE - 1; | 134 | nbytes &= DES_BLOCK_SIZE - 1; |
128 | ret = blkcipher_walk_done(desc, walk, nbytes); | 135 | ret = blkcipher_walk_done(desc, walk, nbytes); |
129 | } while ((nbytes = walk->nbytes)); | 136 | } while ((nbytes = walk->nbytes)); |
130 | memcpy(walk->iv, iv, DES_BLOCK_SIZE); | 137 | memcpy(walk->iv, param.iv, DES_BLOCK_SIZE); |
131 | 138 | ||
132 | out: | 139 | out: |
133 | return ret; | 140 | return ret; |
@@ -179,22 +186,20 @@ static int cbc_des_encrypt(struct blkcipher_desc *desc, | |||
179 | struct scatterlist *dst, struct scatterlist *src, | 186 | struct scatterlist *dst, struct scatterlist *src, |
180 | unsigned int nbytes) | 187 | unsigned int nbytes) |
181 | { | 188 | { |
182 | struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); | ||
183 | struct blkcipher_walk walk; | 189 | struct blkcipher_walk walk; |
184 | 190 | ||
185 | blkcipher_walk_init(&walk, dst, src, nbytes); | 191 | blkcipher_walk_init(&walk, dst, src, nbytes); |
186 | return cbc_desall_crypt(desc, KMC_DEA_ENCRYPT, ctx->iv, &walk); | 192 | return cbc_desall_crypt(desc, KMC_DEA_ENCRYPT, &walk); |
187 | } | 193 | } |
188 | 194 | ||
189 | static int cbc_des_decrypt(struct blkcipher_desc *desc, | 195 | static int cbc_des_decrypt(struct blkcipher_desc *desc, |
190 | struct scatterlist *dst, struct scatterlist *src, | 196 | struct scatterlist *dst, struct scatterlist *src, |
191 | unsigned int nbytes) | 197 | unsigned int nbytes) |
192 | { | 198 | { |
193 | struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); | ||
194 | struct blkcipher_walk walk; | 199 | struct blkcipher_walk walk; |
195 | 200 | ||
196 | blkcipher_walk_init(&walk, dst, src, nbytes); | 201 | blkcipher_walk_init(&walk, dst, src, nbytes); |
197 | return cbc_desall_crypt(desc, KMC_DEA_DECRYPT, ctx->iv, &walk); | 202 | return cbc_desall_crypt(desc, KMC_DEA_DECRYPT, &walk); |
198 | } | 203 | } |
199 | 204 | ||
200 | static struct crypto_alg cbc_des_alg = { | 205 | static struct crypto_alg cbc_des_alg = { |
@@ -327,22 +332,20 @@ static int cbc_des3_encrypt(struct blkcipher_desc *desc, | |||
327 | struct scatterlist *dst, struct scatterlist *src, | 332 | struct scatterlist *dst, struct scatterlist *src, |
328 | unsigned int nbytes) | 333 | unsigned int nbytes) |
329 | { | 334 | { |
330 | struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); | ||
331 | struct blkcipher_walk walk; | 335 | struct blkcipher_walk walk; |
332 | 336 | ||
333 | blkcipher_walk_init(&walk, dst, src, nbytes); | 337 | blkcipher_walk_init(&walk, dst, src, nbytes); |
334 | return cbc_desall_crypt(desc, KMC_TDEA_192_ENCRYPT, ctx->iv, &walk); | 338 | return cbc_desall_crypt(desc, KMC_TDEA_192_ENCRYPT, &walk); |
335 | } | 339 | } |
336 | 340 | ||
337 | static int cbc_des3_decrypt(struct blkcipher_desc *desc, | 341 | static int cbc_des3_decrypt(struct blkcipher_desc *desc, |
338 | struct scatterlist *dst, struct scatterlist *src, | 342 | struct scatterlist *dst, struct scatterlist *src, |
339 | unsigned int nbytes) | 343 | unsigned int nbytes) |
340 | { | 344 | { |
341 | struct s390_des_ctx *ctx = crypto_blkcipher_ctx(desc->tfm); | ||
342 | struct blkcipher_walk walk; | 345 | struct blkcipher_walk walk; |
343 | 346 | ||
344 | blkcipher_walk_init(&walk, dst, src, nbytes); | 347 | blkcipher_walk_init(&walk, dst, src, nbytes); |
345 | return cbc_desall_crypt(desc, KMC_TDEA_192_DECRYPT, ctx->iv, &walk); | 348 | return cbc_desall_crypt(desc, KMC_TDEA_192_DECRYPT, &walk); |
346 | } | 349 | } |
347 | 350 | ||
348 | static struct crypto_alg cbc_des3_alg = { | 351 | static struct crypto_alg cbc_des3_alg = { |
@@ -366,54 +369,80 @@ static struct crypto_alg cbc_des3_alg = { | |||
366 | } | 369 | } |
367 | }; | 370 | }; |
368 | 371 | ||
372 | static unsigned int __ctrblk_init(u8 *ctrptr, unsigned int nbytes) | ||
373 | { | ||
374 | unsigned int i, n; | ||
375 | |||
376 | /* align to block size, max. PAGE_SIZE */ | ||
377 | n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : nbytes & ~(DES_BLOCK_SIZE - 1); | ||
378 | for (i = DES_BLOCK_SIZE; i < n; i += DES_BLOCK_SIZE) { | ||
379 | memcpy(ctrptr + i, ctrptr + i - DES_BLOCK_SIZE, DES_BLOCK_SIZE); | ||
380 | crypto_inc(ctrptr + i, DES_BLOCK_SIZE); | ||
381 | } | ||
382 | return n; | ||
383 | } | ||
384 | |||
369 | static int ctr_desall_crypt(struct blkcipher_desc *desc, long func, | 385 | static int ctr_desall_crypt(struct blkcipher_desc *desc, long func, |
370 | struct s390_des_ctx *ctx, struct blkcipher_walk *walk) | 386 | struct s390_des_ctx *ctx, |
387 | struct blkcipher_walk *walk) | ||
371 | { | 388 | { |
372 | int ret = blkcipher_walk_virt_block(desc, walk, DES_BLOCK_SIZE); | 389 | int ret = blkcipher_walk_virt_block(desc, walk, DES_BLOCK_SIZE); |
373 | unsigned int i, n, nbytes; | 390 | unsigned int n, nbytes; |
374 | u8 buf[DES_BLOCK_SIZE]; | 391 | u8 buf[DES_BLOCK_SIZE], ctrbuf[DES_BLOCK_SIZE]; |
375 | u8 *out, *in; | 392 | u8 *out, *in, *ctrptr = ctrbuf; |
393 | |||
394 | if (!walk->nbytes) | ||
395 | return ret; | ||
376 | 396 | ||
377 | memcpy(ctrblk, walk->iv, DES_BLOCK_SIZE); | 397 | if (spin_trylock(&ctrblk_lock)) |
398 | ctrptr = ctrblk; | ||
399 | |||
400 | memcpy(ctrptr, walk->iv, DES_BLOCK_SIZE); | ||
378 | while ((nbytes = walk->nbytes) >= DES_BLOCK_SIZE) { | 401 | while ((nbytes = walk->nbytes) >= DES_BLOCK_SIZE) { |
379 | out = walk->dst.virt.addr; | 402 | out = walk->dst.virt.addr; |
380 | in = walk->src.virt.addr; | 403 | in = walk->src.virt.addr; |
381 | while (nbytes >= DES_BLOCK_SIZE) { | 404 | while (nbytes >= DES_BLOCK_SIZE) { |
382 | /* align to block size, max. PAGE_SIZE */ | 405 | if (ctrptr == ctrblk) |
383 | n = (nbytes > PAGE_SIZE) ? PAGE_SIZE : | 406 | n = __ctrblk_init(ctrptr, nbytes); |
384 | nbytes & ~(DES_BLOCK_SIZE - 1); | 407 | else |
385 | for (i = DES_BLOCK_SIZE; i < n; i += DES_BLOCK_SIZE) { | 408 | n = DES_BLOCK_SIZE; |
386 | memcpy(ctrblk + i, ctrblk + i - DES_BLOCK_SIZE, | 409 | ret = crypt_s390_kmctr(func, ctx->key, out, in, |
387 | DES_BLOCK_SIZE); | 410 | n, ctrptr); |
388 | crypto_inc(ctrblk + i, DES_BLOCK_SIZE); | 411 | if (ret < 0 || ret != n) { |
389 | } | 412 | if (ctrptr == ctrblk) |
390 | ret = crypt_s390_kmctr(func, ctx->key, out, in, n, ctrblk); | 413 | spin_unlock(&ctrblk_lock); |
391 | if (ret < 0 || ret != n) | ||
392 | return -EIO; | 414 | return -EIO; |
415 | } | ||
393 | if (n > DES_BLOCK_SIZE) | 416 | if (n > DES_BLOCK_SIZE) |
394 | memcpy(ctrblk, ctrblk + n - DES_BLOCK_SIZE, | 417 | memcpy(ctrptr, ctrptr + n - DES_BLOCK_SIZE, |
395 | DES_BLOCK_SIZE); | 418 | DES_BLOCK_SIZE); |
396 | crypto_inc(ctrblk, DES_BLOCK_SIZE); | 419 | crypto_inc(ctrptr, DES_BLOCK_SIZE); |
397 | out += n; | 420 | out += n; |
398 | in += n; | 421 | in += n; |
399 | nbytes -= n; | 422 | nbytes -= n; |
400 | } | 423 | } |
401 | ret = blkcipher_walk_done(desc, walk, nbytes); | 424 | ret = blkcipher_walk_done(desc, walk, nbytes); |
402 | } | 425 | } |
403 | 426 | if (ctrptr == ctrblk) { | |
427 | if (nbytes) | ||
428 | memcpy(ctrbuf, ctrptr, DES_BLOCK_SIZE); | ||
429 | else | ||
430 | memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE); | ||
431 | spin_unlock(&ctrblk_lock); | ||
432 | } | ||
404 | /* final block may be < DES_BLOCK_SIZE, copy only nbytes */ | 433 | /* final block may be < DES_BLOCK_SIZE, copy only nbytes */ |
405 | if (nbytes) { | 434 | if (nbytes) { |
406 | out = walk->dst.virt.addr; | 435 | out = walk->dst.virt.addr; |
407 | in = walk->src.virt.addr; | 436 | in = walk->src.virt.addr; |
408 | ret = crypt_s390_kmctr(func, ctx->key, buf, in, | 437 | ret = crypt_s390_kmctr(func, ctx->key, buf, in, |
409 | DES_BLOCK_SIZE, ctrblk); | 438 | DES_BLOCK_SIZE, ctrbuf); |
410 | if (ret < 0 || ret != DES_BLOCK_SIZE) | 439 | if (ret < 0 || ret != DES_BLOCK_SIZE) |
411 | return -EIO; | 440 | return -EIO; |
412 | memcpy(out, buf, nbytes); | 441 | memcpy(out, buf, nbytes); |
413 | crypto_inc(ctrblk, DES_BLOCK_SIZE); | 442 | crypto_inc(ctrbuf, DES_BLOCK_SIZE); |
414 | ret = blkcipher_walk_done(desc, walk, 0); | 443 | ret = blkcipher_walk_done(desc, walk, 0); |
444 | memcpy(walk->iv, ctrbuf, DES_BLOCK_SIZE); | ||
415 | } | 445 | } |
416 | memcpy(walk->iv, ctrblk, DES_BLOCK_SIZE); | ||
417 | return ret; | 446 | return ret; |
418 | } | 447 | } |
419 | 448 | ||
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index b9e25ae2579c..d7c00507568a 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
@@ -59,7 +59,7 @@ ENTRY(startup_continue) | |||
59 | .quad 0 # cr12: tracing off | 59 | .quad 0 # cr12: tracing off |
60 | .quad 0 # cr13: home space segment table | 60 | .quad 0 # cr13: home space segment table |
61 | .quad 0xc0000000 # cr14: machine check handling off | 61 | .quad 0xc0000000 # cr14: machine check handling off |
62 | .quad 0 # cr15: linkage stack operations | 62 | .quad .Llinkage_stack # cr15: linkage stack operations |
63 | .Lpcmsk:.quad 0x0000000180000000 | 63 | .Lpcmsk:.quad 0x0000000180000000 |
64 | .L4malign:.quad 0xffffffffffc00000 | 64 | .L4malign:.quad 0xffffffffffc00000 |
65 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 | 65 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 |
@@ -67,12 +67,15 @@ ENTRY(startup_continue) | |||
67 | .Lparmaddr: | 67 | .Lparmaddr: |
68 | .quad PARMAREA | 68 | .quad PARMAREA |
69 | .align 64 | 69 | .align 64 |
70 | .Lduct: .long 0,0,0,0,.Lduald,0,0,0 | 70 | .Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0 |
71 | .long 0,0,0,0,0,0,0,0 | 71 | .long 0,0,0,0,0,0,0,0 |
72 | .Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0 | ||
72 | .align 128 | 73 | .align 128 |
73 | .Lduald:.rept 8 | 74 | .Lduald:.rept 8 |
74 | .long 0x80000000,0,0,0 # invalid access-list entries | 75 | .long 0x80000000,0,0,0 # invalid access-list entries |
75 | .endr | 76 | .endr |
77 | .Llinkage_stack: | ||
78 | .long 0,0,0x89000000,0,0,0,0x8a000000,0 | ||
76 | 79 | ||
77 | ENTRY(_ehead) | 80 | ENTRY(_ehead) |
78 | 81 | ||
diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c index a90d45e9dfb0..27c50f4d90cb 100644 --- a/arch/s390/mm/page-states.c +++ b/arch/s390/mm/page-states.c | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/gfp.h> | 13 | #include <linux/gfp.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <asm/setup.h> | ||
16 | #include <asm/ipl.h> | ||
15 | 17 | ||
16 | #define ESSA_SET_STABLE 1 | 18 | #define ESSA_SET_STABLE 1 |
17 | #define ESSA_SET_UNUSED 2 | 19 | #define ESSA_SET_UNUSED 2 |
@@ -41,6 +43,14 @@ void __init cmma_init(void) | |||
41 | 43 | ||
42 | if (!cmma_flag) | 44 | if (!cmma_flag) |
43 | return; | 45 | return; |
46 | /* | ||
47 | * Disable CMM for dump, otherwise the tprot based memory | ||
48 | * detection can fail because of unstable pages. | ||
49 | */ | ||
50 | if (OLDMEM_BASE || ipl_info.type == IPL_TYPE_FCP_DUMP) { | ||
51 | cmma_flag = 0; | ||
52 | return; | ||
53 | } | ||
44 | asm volatile( | 54 | asm volatile( |
45 | " .insn rrf,0xb9ab0000,%1,%1,0,0\n" | 55 | " .insn rrf,0xb9ab0000,%1,%1,0,0\n" |
46 | "0: la %0,0\n" | 56 | "0: la %0,0\n" |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index c51efdcd07a2..7d8b7e94b93b 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -27,7 +27,7 @@ config SPARC | |||
27 | select RTC_DRV_M48T59 | 27 | select RTC_DRV_M48T59 |
28 | select HAVE_DMA_ATTRS | 28 | select HAVE_DMA_ATTRS |
29 | select HAVE_DMA_API_DEBUG | 29 | select HAVE_DMA_API_DEBUG |
30 | select HAVE_ARCH_JUMP_LABEL | 30 | select HAVE_ARCH_JUMP_LABEL if SPARC64 |
31 | select GENERIC_IRQ_SHOW | 31 | select GENERIC_IRQ_SHOW |
32 | select ARCH_WANT_IPC_PARSE_VERSION | 32 | select ARCH_WANT_IPC_PARSE_VERSION |
33 | select GENERIC_PCI_IOMAP | 33 | select GENERIC_PCI_IOMAP |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 869023abe5a4..cfbe53c17b0d 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
15 | #include <linux/vmalloc.h> | 15 | #include <linux/vmalloc.h> |
16 | #include <linux/kdebug.h> | 16 | #include <linux/kdebug.h> |
17 | #include <linux/export.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
19 | #include <linux/log2.h> | 20 | #include <linux/log2.h> |
@@ -62,6 +63,7 @@ extern unsigned long last_valid_pfn; | |||
62 | static pgd_t *srmmu_swapper_pg_dir; | 63 | static pgd_t *srmmu_swapper_pg_dir; |
63 | 64 | ||
64 | const struct sparc32_cachetlb_ops *sparc32_cachetlb_ops; | 65 | const struct sparc32_cachetlb_ops *sparc32_cachetlb_ops; |
66 | EXPORT_SYMBOL(sparc32_cachetlb_ops); | ||
65 | 67 | ||
66 | #ifdef CONFIG_SMP | 68 | #ifdef CONFIG_SMP |
67 | const struct sparc32_cachetlb_ops *local_ops; | 69 | const struct sparc32_cachetlb_ops *local_ops; |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 940e50ebfafa..0af5250d914f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -444,6 +444,7 @@ config X86_INTEL_MID | |||
444 | bool "Intel MID platform support" | 444 | bool "Intel MID platform support" |
445 | depends on X86_32 | 445 | depends on X86_32 |
446 | depends on X86_EXTENDED_PLATFORM | 446 | depends on X86_EXTENDED_PLATFORM |
447 | depends on X86_PLATFORM_DEVICES | ||
447 | depends on PCI | 448 | depends on PCI |
448 | depends on PCI_GOANY | 449 | depends on PCI_GOANY |
449 | depends on X86_IO_APIC | 450 | depends on X86_IO_APIC |
@@ -1051,9 +1052,9 @@ config MICROCODE_INTEL | |||
1051 | This options enables microcode patch loading support for Intel | 1052 | This options enables microcode patch loading support for Intel |
1052 | processors. | 1053 | processors. |
1053 | 1054 | ||
1054 | For latest news and information on obtaining all the required | 1055 | For the current Intel microcode data package go to |
1055 | Intel ingredients for this driver, check: | 1056 | <https://downloadcenter.intel.com> and search for |
1056 | <http://www.urbanmyth.org/microcode/>. | 1057 | 'Linux Processor Microcode Data File'. |
1057 | 1058 | ||
1058 | config MICROCODE_AMD | 1059 | config MICROCODE_AMD |
1059 | bool "AMD microcode loading support" | 1060 | bool "AMD microcode loading support" |
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 0f3621ed1db6..321a52ccf63a 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
@@ -184,6 +184,7 @@ config HAVE_MMIOTRACE_SUPPORT | |||
184 | config X86_DECODER_SELFTEST | 184 | config X86_DECODER_SELFTEST |
185 | bool "x86 instruction decoder selftest" | 185 | bool "x86 instruction decoder selftest" |
186 | depends on DEBUG_KERNEL && KPROBES | 186 | depends on DEBUG_KERNEL && KPROBES |
187 | depends on !COMPILE_TEST | ||
187 | ---help--- | 188 | ---help--- |
188 | Perform x86 instruction decoder selftests at build time. | 189 | Perform x86 instruction decoder selftests at build time. |
189 | This option is useful for checking the sanity of x86 instruction | 190 | This option is useful for checking the sanity of x86 instruction |
diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h index a54ee1d054d9..aaac3b2fb746 100644 --- a/arch/x86/include/asm/amd_nb.h +++ b/arch/x86/include/asm/amd_nb.h | |||
@@ -19,7 +19,7 @@ extern int amd_cache_northbridges(void); | |||
19 | extern void amd_flush_garts(void); | 19 | extern void amd_flush_garts(void); |
20 | extern int amd_numa_init(void); | 20 | extern int amd_numa_init(void); |
21 | extern int amd_get_subcaches(int); | 21 | extern int amd_get_subcaches(int); |
22 | extern int amd_set_subcaches(int, int); | 22 | extern int amd_set_subcaches(int, unsigned long); |
23 | 23 | ||
24 | struct amd_l3_cache { | 24 | struct amd_l3_cache { |
25 | unsigned indices; | 25 | unsigned indices; |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 3b978c472d08..3d6b9f81cc68 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -132,6 +132,8 @@ extern void __init efi_map_region_fixed(efi_memory_desc_t *md); | |||
132 | extern void efi_sync_low_kernel_mappings(void); | 132 | extern void efi_sync_low_kernel_mappings(void); |
133 | extern void efi_setup_page_tables(void); | 133 | extern void efi_setup_page_tables(void); |
134 | extern void __init old_map_region(efi_memory_desc_t *md); | 134 | extern void __init old_map_region(efi_memory_desc_t *md); |
135 | extern void __init runtime_code_page_mkexec(void); | ||
136 | extern void __init efi_runtime_mkexec(void); | ||
135 | 137 | ||
136 | struct efi_setup_data { | 138 | struct efi_setup_data { |
137 | u64 fw_vendor; | 139 | u64 fw_vendor; |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index bbc8b12fa443..5ad38ad07890 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -445,10 +445,20 @@ static inline int pte_same(pte_t a, pte_t b) | |||
445 | return a.pte == b.pte; | 445 | return a.pte == b.pte; |
446 | } | 446 | } |
447 | 447 | ||
448 | static inline int pteval_present(pteval_t pteval) | ||
449 | { | ||
450 | /* | ||
451 | * Yes Linus, _PAGE_PROTNONE == _PAGE_NUMA. Expressing it this | ||
452 | * way clearly states that the intent is that protnone and numa | ||
453 | * hinting ptes are considered present for the purposes of | ||
454 | * pagetable operations like zapping, protection changes, gup etc. | ||
455 | */ | ||
456 | return pteval & (_PAGE_PRESENT | _PAGE_PROTNONE | _PAGE_NUMA); | ||
457 | } | ||
458 | |||
448 | static inline int pte_present(pte_t a) | 459 | static inline int pte_present(pte_t a) |
449 | { | 460 | { |
450 | return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE | | 461 | return pteval_present(pte_flags(a)); |
451 | _PAGE_NUMA); | ||
452 | } | 462 | } |
453 | 463 | ||
454 | #define pte_accessible pte_accessible | 464 | #define pte_accessible pte_accessible |
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index e6d90babc245..04905bfc508b 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h | |||
@@ -62,7 +62,7 @@ static inline void __flush_tlb_all(void) | |||
62 | 62 | ||
63 | static inline void __flush_tlb_one(unsigned long addr) | 63 | static inline void __flush_tlb_one(unsigned long addr) |
64 | { | 64 | { |
65 | count_vm_event(NR_TLB_LOCAL_FLUSH_ONE); | 65 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE); |
66 | __flush_tlb_single(addr); | 66 | __flush_tlb_single(addr); |
67 | } | 67 | } |
68 | 68 | ||
@@ -93,13 +93,13 @@ static inline void __flush_tlb_one(unsigned long addr) | |||
93 | */ | 93 | */ |
94 | static inline void __flush_tlb_up(void) | 94 | static inline void __flush_tlb_up(void) |
95 | { | 95 | { |
96 | count_vm_event(NR_TLB_LOCAL_FLUSH_ALL); | 96 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); |
97 | __flush_tlb(); | 97 | __flush_tlb(); |
98 | } | 98 | } |
99 | 99 | ||
100 | static inline void flush_tlb_all(void) | 100 | static inline void flush_tlb_all(void) |
101 | { | 101 | { |
102 | count_vm_event(NR_TLB_LOCAL_FLUSH_ALL); | 102 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); |
103 | __flush_tlb_all(); | 103 | __flush_tlb_all(); |
104 | } | 104 | } |
105 | 105 | ||
diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h index 57ae63cd6ee2..94605c0e9cee 100644 --- a/arch/x86/include/asm/tsc.h +++ b/arch/x86/include/asm/tsc.h | |||
@@ -66,6 +66,6 @@ extern void tsc_save_sched_clock_state(void); | |||
66 | extern void tsc_restore_sched_clock_state(void); | 66 | extern void tsc_restore_sched_clock_state(void); |
67 | 67 | ||
68 | /* MSR based TSC calibration for Intel Atom SoC platforms */ | 68 | /* MSR based TSC calibration for Intel Atom SoC platforms */ |
69 | int try_msr_calibrate_tsc(unsigned long *fast_calibrate); | 69 | unsigned long try_msr_calibrate_tsc(void); |
70 | 70 | ||
71 | #endif /* _ASM_X86_TSC_H */ | 71 | #endif /* _ASM_X86_TSC_H */ |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 787e1bb5aafc..3e276eb23d1b 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -52,8 +52,7 @@ extern unsigned long set_phys_range_identity(unsigned long pfn_s, | |||
52 | extern int m2p_add_override(unsigned long mfn, struct page *page, | 52 | extern int m2p_add_override(unsigned long mfn, struct page *page, |
53 | struct gnttab_map_grant_ref *kmap_op); | 53 | struct gnttab_map_grant_ref *kmap_op); |
54 | extern int m2p_remove_override(struct page *page, | 54 | extern int m2p_remove_override(struct page *page, |
55 | struct gnttab_map_grant_ref *kmap_op, | 55 | struct gnttab_map_grant_ref *kmap_op); |
56 | unsigned long mfn); | ||
57 | extern struct page *m2p_find_override(unsigned long mfn); | 56 | extern struct page *m2p_find_override(unsigned long mfn); |
58 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); | 57 | extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn); |
59 | 58 | ||
@@ -122,7 +121,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn) | |||
122 | pfn = m2p_find_override_pfn(mfn, ~0); | 121 | pfn = m2p_find_override_pfn(mfn, ~0); |
123 | } | 122 | } |
124 | 123 | ||
125 | /* | 124 | /* |
126 | * pfn is ~0 if there are no entries in the m2p for mfn or if the | 125 | * pfn is ~0 if there are no entries in the m2p for mfn or if the |
127 | * entry doesn't map back to the mfn and m2p_override doesn't have a | 126 | * entry doesn't map back to the mfn and m2p_override doesn't have a |
128 | * valid entry for it. | 127 | * valid entry for it. |
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index 59554dca96ec..dec8de4e1663 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c | |||
@@ -179,7 +179,7 @@ int amd_get_subcaches(int cpu) | |||
179 | return (mask >> (4 * cuid)) & 0xf; | 179 | return (mask >> (4 * cuid)) & 0xf; |
180 | } | 180 | } |
181 | 181 | ||
182 | int amd_set_subcaches(int cpu, int mask) | 182 | int amd_set_subcaches(int cpu, unsigned long mask) |
183 | { | 183 | { |
184 | static unsigned int reset, ban; | 184 | static unsigned int reset, ban; |
185 | struct amd_northbridge *nb = node_to_amd_nb(amd_get_nb_id(cpu)); | 185 | struct amd_northbridge *nb = node_to_amd_nb(amd_get_nb_id(cpu)); |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index d3153e281d72..c67ffa686064 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -767,10 +767,7 @@ static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size) | |||
767 | 767 | ||
768 | static void cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c) | 768 | static void cpu_set_tlb_flushall_shift(struct cpuinfo_x86 *c) |
769 | { | 769 | { |
770 | tlb_flushall_shift = 5; | 770 | tlb_flushall_shift = 6; |
771 | |||
772 | if (c->x86 <= 0x11) | ||
773 | tlb_flushall_shift = 4; | ||
774 | } | 771 | } |
775 | 772 | ||
776 | static void cpu_detect_tlb_amd(struct cpuinfo_x86 *c) | 773 | static void cpu_detect_tlb_amd(struct cpuinfo_x86 *c) |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 24b6fd10625a..8e28bf2fc3ef 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -284,8 +284,13 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c) | |||
284 | raw_local_save_flags(eflags); | 284 | raw_local_save_flags(eflags); |
285 | BUG_ON(eflags & X86_EFLAGS_AC); | 285 | BUG_ON(eflags & X86_EFLAGS_AC); |
286 | 286 | ||
287 | if (cpu_has(c, X86_FEATURE_SMAP)) | 287 | if (cpu_has(c, X86_FEATURE_SMAP)) { |
288 | #ifdef CONFIG_X86_SMAP | ||
288 | set_in_cr4(X86_CR4_SMAP); | 289 | set_in_cr4(X86_CR4_SMAP); |
290 | #else | ||
291 | clear_in_cr4(X86_CR4_SMAP); | ||
292 | #endif | ||
293 | } | ||
289 | } | 294 | } |
290 | 295 | ||
291 | /* | 296 | /* |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 3db61c644e44..5cd9bfabd645 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -640,21 +640,17 @@ static void intel_tlb_flushall_shift_set(struct cpuinfo_x86 *c) | |||
640 | case 0x61d: /* six-core 45 nm xeon "Dunnington" */ | 640 | case 0x61d: /* six-core 45 nm xeon "Dunnington" */ |
641 | tlb_flushall_shift = -1; | 641 | tlb_flushall_shift = -1; |
642 | break; | 642 | break; |
643 | case 0x63a: /* Ivybridge */ | ||
644 | tlb_flushall_shift = 2; | ||
645 | break; | ||
643 | case 0x61a: /* 45 nm nehalem, "Bloomfield" */ | 646 | case 0x61a: /* 45 nm nehalem, "Bloomfield" */ |
644 | case 0x61e: /* 45 nm nehalem, "Lynnfield" */ | 647 | case 0x61e: /* 45 nm nehalem, "Lynnfield" */ |
645 | case 0x625: /* 32 nm nehalem, "Clarkdale" */ | 648 | case 0x625: /* 32 nm nehalem, "Clarkdale" */ |
646 | case 0x62c: /* 32 nm nehalem, "Gulftown" */ | 649 | case 0x62c: /* 32 nm nehalem, "Gulftown" */ |
647 | case 0x62e: /* 45 nm nehalem-ex, "Beckton" */ | 650 | case 0x62e: /* 45 nm nehalem-ex, "Beckton" */ |
648 | case 0x62f: /* 32 nm Xeon E7 */ | 651 | case 0x62f: /* 32 nm Xeon E7 */ |
649 | tlb_flushall_shift = 6; | ||
650 | break; | ||
651 | case 0x62a: /* SandyBridge */ | 652 | case 0x62a: /* SandyBridge */ |
652 | case 0x62d: /* SandyBridge, "Romely-EP" */ | 653 | case 0x62d: /* SandyBridge, "Romely-EP" */ |
653 | tlb_flushall_shift = 5; | ||
654 | break; | ||
655 | case 0x63a: /* Ivybridge */ | ||
656 | tlb_flushall_shift = 1; | ||
657 | break; | ||
658 | default: | 654 | default: |
659 | tlb_flushall_shift = 6; | 655 | tlb_flushall_shift = 6; |
660 | } | 656 | } |
diff --git a/arch/x86/kernel/cpu/microcode/amd_early.c b/arch/x86/kernel/cpu/microcode/amd_early.c index 8384c0fa206f..617a9e284245 100644 --- a/arch/x86/kernel/cpu/microcode/amd_early.c +++ b/arch/x86/kernel/cpu/microcode/amd_early.c | |||
@@ -285,6 +285,15 @@ static void __init collect_cpu_sig_on_bsp(void *arg) | |||
285 | 285 | ||
286 | uci->cpu_sig.sig = cpuid_eax(0x00000001); | 286 | uci->cpu_sig.sig = cpuid_eax(0x00000001); |
287 | } | 287 | } |
288 | |||
289 | static void __init get_bsp_sig(void) | ||
290 | { | ||
291 | unsigned int bsp = boot_cpu_data.cpu_index; | ||
292 | struct ucode_cpu_info *uci = ucode_cpu_info + bsp; | ||
293 | |||
294 | if (!uci->cpu_sig.sig) | ||
295 | smp_call_function_single(bsp, collect_cpu_sig_on_bsp, NULL, 1); | ||
296 | } | ||
288 | #else | 297 | #else |
289 | void load_ucode_amd_ap(void) | 298 | void load_ucode_amd_ap(void) |
290 | { | 299 | { |
@@ -337,31 +346,37 @@ void load_ucode_amd_ap(void) | |||
337 | 346 | ||
338 | int __init save_microcode_in_initrd_amd(void) | 347 | int __init save_microcode_in_initrd_amd(void) |
339 | { | 348 | { |
349 | unsigned long cont; | ||
340 | enum ucode_state ret; | 350 | enum ucode_state ret; |
341 | u32 eax; | 351 | u32 eax; |
342 | 352 | ||
343 | #ifdef CONFIG_X86_32 | 353 | if (!container) |
344 | unsigned int bsp = boot_cpu_data.cpu_index; | 354 | return -EINVAL; |
345 | struct ucode_cpu_info *uci = ucode_cpu_info + bsp; | ||
346 | |||
347 | if (!uci->cpu_sig.sig) | ||
348 | smp_call_function_single(bsp, collect_cpu_sig_on_bsp, NULL, 1); | ||
349 | 355 | ||
356 | #ifdef CONFIG_X86_32 | ||
357 | get_bsp_sig(); | ||
358 | cont = (unsigned long)container; | ||
359 | #else | ||
350 | /* | 360 | /* |
351 | * Take into account the fact that the ramdisk might get relocated | 361 | * We need the physical address of the container for both bitness since |
352 | * and therefore we need to recompute the container's position in | 362 | * boot_params.hdr.ramdisk_image is a physical address. |
353 | * virtual memory space. | ||
354 | */ | 363 | */ |
355 | container = (u8 *)(__va((u32)relocated_ramdisk) + | 364 | cont = __pa(container); |
356 | ((u32)container - boot_params.hdr.ramdisk_image)); | ||
357 | #endif | 365 | #endif |
366 | |||
367 | /* | ||
368 | * Take into account the fact that the ramdisk might get relocated and | ||
369 | * therefore we need to recompute the container's position in virtual | ||
370 | * memory space. | ||
371 | */ | ||
372 | if (relocated_ramdisk) | ||
373 | container = (u8 *)(__va(relocated_ramdisk) + | ||
374 | (cont - boot_params.hdr.ramdisk_image)); | ||
375 | |||
358 | if (ucode_new_rev) | 376 | if (ucode_new_rev) |
359 | pr_info("microcode: updated early to new patch_level=0x%08x\n", | 377 | pr_info("microcode: updated early to new patch_level=0x%08x\n", |
360 | ucode_new_rev); | 378 | ucode_new_rev); |
361 | 379 | ||
362 | if (!container) | ||
363 | return -EINVAL; | ||
364 | |||
365 | eax = cpuid_eax(0x00000001); | 380 | eax = cpuid_eax(0x00000001); |
366 | eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff); | 381 | eax = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff); |
367 | 382 | ||
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index ce2d0a2c3e4f..0e25a1bc5ab5 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c | |||
@@ -683,7 +683,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock) | |||
683 | } | 683 | } |
684 | 684 | ||
685 | /* Flush all TLBs via a mov %cr3, %reg; mov %reg, %cr3 */ | 685 | /* Flush all TLBs via a mov %cr3, %reg; mov %reg, %cr3 */ |
686 | count_vm_event(NR_TLB_LOCAL_FLUSH_ALL); | 686 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); |
687 | __flush_tlb(); | 687 | __flush_tlb(); |
688 | 688 | ||
689 | /* Save MTRR state */ | 689 | /* Save MTRR state */ |
@@ -697,7 +697,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock) | |||
697 | static void post_set(void) __releases(set_atomicity_lock) | 697 | static void post_set(void) __releases(set_atomicity_lock) |
698 | { | 698 | { |
699 | /* Flush TLBs (no need to flush caches - they are disabled) */ | 699 | /* Flush TLBs (no need to flush caches - they are disabled) */ |
700 | count_vm_event(NR_TLB_LOCAL_FLUSH_ALL); | 700 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); |
701 | __flush_tlb(); | 701 | __flush_tlb(); |
702 | 702 | ||
703 | /* Intel (P6) standard MTRRs */ | 703 | /* Intel (P6) standard MTRRs */ |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index b88645191fe5..895604f2e916 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1521,6 +1521,8 @@ static int __init init_hw_perf_events(void) | |||
1521 | 1521 | ||
1522 | pr_cont("%s PMU driver.\n", x86_pmu.name); | 1522 | pr_cont("%s PMU driver.\n", x86_pmu.name); |
1523 | 1523 | ||
1524 | x86_pmu.attr_rdpmc = 1; /* enable userspace RDPMC usage by default */ | ||
1525 | |||
1524 | for (quirk = x86_pmu.quirks; quirk; quirk = quirk->next) | 1526 | for (quirk = x86_pmu.quirks; quirk; quirk = quirk->next) |
1525 | quirk->func(); | 1527 | quirk->func(); |
1526 | 1528 | ||
@@ -1534,7 +1536,6 @@ static int __init init_hw_perf_events(void) | |||
1534 | __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_counters) - 1, | 1536 | __EVENT_CONSTRAINT(0, (1ULL << x86_pmu.num_counters) - 1, |
1535 | 0, x86_pmu.num_counters, 0, 0); | 1537 | 0, x86_pmu.num_counters, 0, 0); |
1536 | 1538 | ||
1537 | x86_pmu.attr_rdpmc = 1; /* enable userspace RDPMC usage by default */ | ||
1538 | x86_pmu_format_group.attrs = x86_pmu.format_attrs; | 1539 | x86_pmu_format_group.attrs = x86_pmu.format_attrs; |
1539 | 1540 | ||
1540 | if (x86_pmu.event_attrs) | 1541 | if (x86_pmu.event_attrs) |
@@ -1820,9 +1821,12 @@ static ssize_t set_attr_rdpmc(struct device *cdev, | |||
1820 | if (ret) | 1821 | if (ret) |
1821 | return ret; | 1822 | return ret; |
1822 | 1823 | ||
1824 | if (x86_pmu.attr_rdpmc_broken) | ||
1825 | return -ENOTSUPP; | ||
1826 | |||
1823 | if (!!val != !!x86_pmu.attr_rdpmc) { | 1827 | if (!!val != !!x86_pmu.attr_rdpmc) { |
1824 | x86_pmu.attr_rdpmc = !!val; | 1828 | x86_pmu.attr_rdpmc = !!val; |
1825 | smp_call_function(change_rdpmc, (void *)val, 1); | 1829 | on_each_cpu(change_rdpmc, (void *)val, 1); |
1826 | } | 1830 | } |
1827 | 1831 | ||
1828 | return count; | 1832 | return count; |
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index c1a861829d81..4972c244d0bc 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
@@ -409,6 +409,7 @@ struct x86_pmu { | |||
409 | /* | 409 | /* |
410 | * sysfs attrs | 410 | * sysfs attrs |
411 | */ | 411 | */ |
412 | int attr_rdpmc_broken; | ||
412 | int attr_rdpmc; | 413 | int attr_rdpmc; |
413 | struct attribute **format_attrs; | 414 | struct attribute **format_attrs; |
414 | struct attribute **event_attrs; | 415 | struct attribute **event_attrs; |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 0fa4f242f050..aa333d966886 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -1361,10 +1361,8 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) | |||
1361 | intel_pmu_disable_all(); | 1361 | intel_pmu_disable_all(); |
1362 | handled = intel_pmu_drain_bts_buffer(); | 1362 | handled = intel_pmu_drain_bts_buffer(); |
1363 | status = intel_pmu_get_status(); | 1363 | status = intel_pmu_get_status(); |
1364 | if (!status) { | 1364 | if (!status) |
1365 | intel_pmu_enable_all(0); | 1365 | goto done; |
1366 | return handled; | ||
1367 | } | ||
1368 | 1366 | ||
1369 | loops = 0; | 1367 | loops = 0; |
1370 | again: | 1368 | again: |
@@ -2310,10 +2308,7 @@ __init int intel_pmu_init(void) | |||
2310 | if (version > 1) | 2308 | if (version > 1) |
2311 | x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); | 2309 | x86_pmu.num_counters_fixed = max((int)edx.split.num_counters_fixed, 3); |
2312 | 2310 | ||
2313 | /* | 2311 | if (boot_cpu_has(X86_FEATURE_PDCM)) { |
2314 | * v2 and above have a perf capabilities MSR | ||
2315 | */ | ||
2316 | if (version > 1) { | ||
2317 | u64 capabilities; | 2312 | u64 capabilities; |
2318 | 2313 | ||
2319 | rdmsrl(MSR_IA32_PERF_CAPABILITIES, capabilities); | 2314 | rdmsrl(MSR_IA32_PERF_CAPABILITIES, capabilities); |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 29c248799ced..c88f7f4b03ee 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
@@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = { | |||
501 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, | 501 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, |
502 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), | 502 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), |
503 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), | 503 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), |
504 | SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6), | ||
504 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), | 505 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), |
506 | SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6), | ||
505 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), | 507 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), |
508 | SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6), | ||
506 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6), | 509 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6), |
507 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8), | 510 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8), |
508 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8), | 511 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8), |
@@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = { | |||
1178 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, | 1181 | SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN, |
1179 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), | 1182 | SNBEP_CBO_PMON_CTL_TID_EN, 0x1), |
1180 | SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2), | 1183 | SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2), |
1184 | SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4), | ||
1185 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc), | ||
1186 | SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc), | ||
1181 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), | 1187 | SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4), |
1188 | SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc), | ||
1182 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), | 1189 | SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4), |
1190 | SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc), | ||
1183 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), | 1191 | SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4), |
1184 | SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc), | 1192 | SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc), |
1185 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10), | 1193 | SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10), |
1186 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10), | 1194 | SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10), |
1187 | SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10), | 1195 | SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10), |
diff --git a/arch/x86/kernel/cpu/perf_event_p6.c b/arch/x86/kernel/cpu/perf_event_p6.c index b1e2fe115323..7c1a0c07b607 100644 --- a/arch/x86/kernel/cpu/perf_event_p6.c +++ b/arch/x86/kernel/cpu/perf_event_p6.c | |||
@@ -231,31 +231,49 @@ static __initconst const struct x86_pmu p6_pmu = { | |||
231 | 231 | ||
232 | }; | 232 | }; |
233 | 233 | ||
234 | static __init void p6_pmu_rdpmc_quirk(void) | ||
235 | { | ||
236 | if (boot_cpu_data.x86_mask < 9) { | ||
237 | /* | ||
238 | * PPro erratum 26; fixed in stepping 9 and above. | ||
239 | */ | ||
240 | pr_warn("Userspace RDPMC support disabled due to a CPU erratum\n"); | ||
241 | x86_pmu.attr_rdpmc_broken = 1; | ||
242 | x86_pmu.attr_rdpmc = 0; | ||
243 | } | ||
244 | } | ||
245 | |||
234 | __init int p6_pmu_init(void) | 246 | __init int p6_pmu_init(void) |
235 | { | 247 | { |
248 | x86_pmu = p6_pmu; | ||
249 | |||
236 | switch (boot_cpu_data.x86_model) { | 250 | switch (boot_cpu_data.x86_model) { |
237 | case 1: | 251 | case 1: /* Pentium Pro */ |
238 | case 3: /* Pentium Pro */ | 252 | x86_add_quirk(p6_pmu_rdpmc_quirk); |
239 | case 5: | 253 | break; |
240 | case 6: /* Pentium II */ | 254 | |
241 | case 7: | 255 | case 3: /* Pentium II - Klamath */ |
242 | case 8: | 256 | case 5: /* Pentium II - Deschutes */ |
243 | case 11: /* Pentium III */ | 257 | case 6: /* Pentium II - Mendocino */ |
244 | case 9: | ||
245 | case 13: | ||
246 | /* Pentium M */ | ||
247 | break; | 258 | break; |
259 | |||
260 | case 7: /* Pentium III - Katmai */ | ||
261 | case 8: /* Pentium III - Coppermine */ | ||
262 | case 10: /* Pentium III Xeon */ | ||
263 | case 11: /* Pentium III - Tualatin */ | ||
264 | break; | ||
265 | |||
266 | case 9: /* Pentium M - Banias */ | ||
267 | case 13: /* Pentium M - Dothan */ | ||
268 | break; | ||
269 | |||
248 | default: | 270 | default: |
249 | pr_cont("unsupported p6 CPU model %d ", | 271 | pr_cont("unsupported p6 CPU model %d ", boot_cpu_data.x86_model); |
250 | boot_cpu_data.x86_model); | ||
251 | return -ENODEV; | 272 | return -ENODEV; |
252 | } | 273 | } |
253 | 274 | ||
254 | x86_pmu = p6_pmu; | ||
255 | |||
256 | memcpy(hw_cache_event_ids, p6_hw_cache_event_ids, | 275 | memcpy(hw_cache_event_ids, p6_hw_cache_event_ids, |
257 | sizeof(hw_cache_event_ids)); | 276 | sizeof(hw_cache_event_ids)); |
258 | 277 | ||
259 | |||
260 | return 0; | 278 | return 0; |
261 | } | 279 | } |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index d4bdd253fea7..e6253195a301 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -77,8 +77,7 @@ within(unsigned long addr, unsigned long start, unsigned long end) | |||
77 | return addr >= start && addr < end; | 77 | return addr >= start && addr < end; |
78 | } | 78 | } |
79 | 79 | ||
80 | static int | 80 | static unsigned long text_ip_addr(unsigned long ip) |
81 | do_ftrace_mod_code(unsigned long ip, const void *new_code) | ||
82 | { | 81 | { |
83 | /* | 82 | /* |
84 | * On x86_64, kernel text mappings are mapped read-only with | 83 | * On x86_64, kernel text mappings are mapped read-only with |
@@ -91,7 +90,7 @@ do_ftrace_mod_code(unsigned long ip, const void *new_code) | |||
91 | if (within(ip, (unsigned long)_text, (unsigned long)_etext)) | 90 | if (within(ip, (unsigned long)_text, (unsigned long)_etext)) |
92 | ip = (unsigned long)__va(__pa_symbol(ip)); | 91 | ip = (unsigned long)__va(__pa_symbol(ip)); |
93 | 92 | ||
94 | return probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE); | 93 | return ip; |
95 | } | 94 | } |
96 | 95 | ||
97 | static const unsigned char *ftrace_nop_replace(void) | 96 | static const unsigned char *ftrace_nop_replace(void) |
@@ -123,8 +122,10 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code, | |||
123 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) | 122 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) |
124 | return -EINVAL; | 123 | return -EINVAL; |
125 | 124 | ||
125 | ip = text_ip_addr(ip); | ||
126 | |||
126 | /* replace the text with the new text */ | 127 | /* replace the text with the new text */ |
127 | if (do_ftrace_mod_code(ip, new_code)) | 128 | if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE)) |
128 | return -EPERM; | 129 | return -EPERM; |
129 | 130 | ||
130 | sync_core(); | 131 | sync_core(); |
@@ -221,37 +222,51 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr, | |||
221 | return -EINVAL; | 222 | return -EINVAL; |
222 | } | 223 | } |
223 | 224 | ||
224 | int ftrace_update_ftrace_func(ftrace_func_t func) | 225 | static unsigned long ftrace_update_func; |
226 | |||
227 | static int update_ftrace_func(unsigned long ip, void *new) | ||
225 | { | 228 | { |
226 | unsigned long ip = (unsigned long)(&ftrace_call); | 229 | unsigned char old[MCOUNT_INSN_SIZE]; |
227 | unsigned char old[MCOUNT_INSN_SIZE], *new; | ||
228 | int ret; | 230 | int ret; |
229 | 231 | ||
230 | memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE); | 232 | memcpy(old, (void *)ip, MCOUNT_INSN_SIZE); |
231 | new = ftrace_call_replace(ip, (unsigned long)func); | 233 | |
234 | ftrace_update_func = ip; | ||
235 | /* Make sure the breakpoints see the ftrace_update_func update */ | ||
236 | smp_wmb(); | ||
232 | 237 | ||
233 | /* See comment above by declaration of modifying_ftrace_code */ | 238 | /* See comment above by declaration of modifying_ftrace_code */ |
234 | atomic_inc(&modifying_ftrace_code); | 239 | atomic_inc(&modifying_ftrace_code); |
235 | 240 | ||
236 | ret = ftrace_modify_code(ip, old, new); | 241 | ret = ftrace_modify_code(ip, old, new); |
237 | 242 | ||
243 | atomic_dec(&modifying_ftrace_code); | ||
244 | |||
245 | return ret; | ||
246 | } | ||
247 | |||
248 | int ftrace_update_ftrace_func(ftrace_func_t func) | ||
249 | { | ||
250 | unsigned long ip = (unsigned long)(&ftrace_call); | ||
251 | unsigned char *new; | ||
252 | int ret; | ||
253 | |||
254 | new = ftrace_call_replace(ip, (unsigned long)func); | ||
255 | ret = update_ftrace_func(ip, new); | ||
256 | |||
238 | /* Also update the regs callback function */ | 257 | /* Also update the regs callback function */ |
239 | if (!ret) { | 258 | if (!ret) { |
240 | ip = (unsigned long)(&ftrace_regs_call); | 259 | ip = (unsigned long)(&ftrace_regs_call); |
241 | memcpy(old, &ftrace_regs_call, MCOUNT_INSN_SIZE); | ||
242 | new = ftrace_call_replace(ip, (unsigned long)func); | 260 | new = ftrace_call_replace(ip, (unsigned long)func); |
243 | ret = ftrace_modify_code(ip, old, new); | 261 | ret = update_ftrace_func(ip, new); |
244 | } | 262 | } |
245 | 263 | ||
246 | atomic_dec(&modifying_ftrace_code); | ||
247 | |||
248 | return ret; | 264 | return ret; |
249 | } | 265 | } |
250 | 266 | ||
251 | static int is_ftrace_caller(unsigned long ip) | 267 | static int is_ftrace_caller(unsigned long ip) |
252 | { | 268 | { |
253 | if (ip == (unsigned long)(&ftrace_call) || | 269 | if (ip == ftrace_update_func) |
254 | ip == (unsigned long)(&ftrace_regs_call)) | ||
255 | return 1; | 270 | return 1; |
256 | 271 | ||
257 | return 0; | 272 | return 0; |
@@ -677,45 +692,41 @@ int __init ftrace_dyn_arch_init(void *data) | |||
677 | #ifdef CONFIG_DYNAMIC_FTRACE | 692 | #ifdef CONFIG_DYNAMIC_FTRACE |
678 | extern void ftrace_graph_call(void); | 693 | extern void ftrace_graph_call(void); |
679 | 694 | ||
680 | static int ftrace_mod_jmp(unsigned long ip, | 695 | static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr) |
681 | int old_offset, int new_offset) | ||
682 | { | 696 | { |
683 | unsigned char code[MCOUNT_INSN_SIZE]; | 697 | static union ftrace_code_union calc; |
684 | 698 | ||
685 | if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE)) | 699 | /* Jmp not a call (ignore the .e8) */ |
686 | return -EFAULT; | 700 | calc.e8 = 0xe9; |
701 | calc.offset = ftrace_calc_offset(ip + MCOUNT_INSN_SIZE, addr); | ||
687 | 702 | ||
688 | if (code[0] != 0xe9 || old_offset != *(int *)(&code[1])) | 703 | /* |
689 | return -EINVAL; | 704 | * ftrace external locks synchronize the access to the static variable. |
705 | */ | ||
706 | return calc.code; | ||
707 | } | ||
690 | 708 | ||
691 | *(int *)(&code[1]) = new_offset; | 709 | static int ftrace_mod_jmp(unsigned long ip, void *func) |
710 | { | ||
711 | unsigned char *new; | ||
692 | 712 | ||
693 | if (do_ftrace_mod_code(ip, &code)) | 713 | new = ftrace_jmp_replace(ip, (unsigned long)func); |
694 | return -EPERM; | ||
695 | 714 | ||
696 | return 0; | 715 | return update_ftrace_func(ip, new); |
697 | } | 716 | } |
698 | 717 | ||
699 | int ftrace_enable_ftrace_graph_caller(void) | 718 | int ftrace_enable_ftrace_graph_caller(void) |
700 | { | 719 | { |
701 | unsigned long ip = (unsigned long)(&ftrace_graph_call); | 720 | unsigned long ip = (unsigned long)(&ftrace_graph_call); |
702 | int old_offset, new_offset; | ||
703 | 721 | ||
704 | old_offset = (unsigned long)(&ftrace_stub) - (ip + MCOUNT_INSN_SIZE); | 722 | return ftrace_mod_jmp(ip, &ftrace_graph_caller); |
705 | new_offset = (unsigned long)(&ftrace_graph_caller) - (ip + MCOUNT_INSN_SIZE); | ||
706 | |||
707 | return ftrace_mod_jmp(ip, old_offset, new_offset); | ||
708 | } | 723 | } |
709 | 724 | ||
710 | int ftrace_disable_ftrace_graph_caller(void) | 725 | int ftrace_disable_ftrace_graph_caller(void) |
711 | { | 726 | { |
712 | unsigned long ip = (unsigned long)(&ftrace_graph_call); | 727 | unsigned long ip = (unsigned long)(&ftrace_graph_call); |
713 | int old_offset, new_offset; | ||
714 | |||
715 | old_offset = (unsigned long)(&ftrace_graph_caller) - (ip + MCOUNT_INSN_SIZE); | ||
716 | new_offset = (unsigned long)(&ftrace_stub) - (ip + MCOUNT_INSN_SIZE); | ||
717 | 728 | ||
718 | return ftrace_mod_jmp(ip, old_offset, new_offset); | 729 | return ftrace_mod_jmp(ip, &ftrace_stub); |
719 | } | 730 | } |
720 | 731 | ||
721 | #endif /* !CONFIG_DYNAMIC_FTRACE */ | 732 | #endif /* !CONFIG_DYNAMIC_FTRACE */ |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index dbb60878b744..d99f31d9a750 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -266,6 +266,14 @@ __visible void smp_trace_x86_platform_ipi(struct pt_regs *regs) | |||
266 | EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); | 266 | EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); |
267 | 267 | ||
268 | #ifdef CONFIG_HOTPLUG_CPU | 268 | #ifdef CONFIG_HOTPLUG_CPU |
269 | |||
270 | /* These two declarations are only used in check_irq_vectors_for_cpu_disable() | ||
271 | * below, which is protected by stop_machine(). Putting them on the stack | ||
272 | * results in a stack frame overflow. Dynamically allocating could result in a | ||
273 | * failure so declare these two cpumasks as global. | ||
274 | */ | ||
275 | static struct cpumask affinity_new, online_new; | ||
276 | |||
269 | /* | 277 | /* |
270 | * This cpu is going to be removed and its vectors migrated to the remaining | 278 | * This cpu is going to be removed and its vectors migrated to the remaining |
271 | * online cpus. Check to see if there are enough vectors in the remaining cpus. | 279 | * online cpus. Check to see if there are enough vectors in the remaining cpus. |
@@ -277,7 +285,6 @@ int check_irq_vectors_for_cpu_disable(void) | |||
277 | unsigned int this_cpu, vector, this_count, count; | 285 | unsigned int this_cpu, vector, this_count, count; |
278 | struct irq_desc *desc; | 286 | struct irq_desc *desc; |
279 | struct irq_data *data; | 287 | struct irq_data *data; |
280 | struct cpumask affinity_new, online_new; | ||
281 | 288 | ||
282 | this_cpu = smp_processor_id(); | 289 | this_cpu = smp_processor_id(); |
283 | cpumask_copy(&online_new, cpu_online_mask); | 290 | cpumask_copy(&online_new, cpu_online_mask); |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 872079a67e4d..f7d0672481fd 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -100,8 +100,10 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, | |||
100 | flag |= __GFP_ZERO; | 100 | flag |= __GFP_ZERO; |
101 | again: | 101 | again: |
102 | page = NULL; | 102 | page = NULL; |
103 | if (!(flag & GFP_ATOMIC)) | 103 | /* CMA can be used only in the context which permits sleeping */ |
104 | if (flag & __GFP_WAIT) | ||
104 | page = dma_alloc_from_contiguous(dev, count, get_order(size)); | 105 | page = dma_alloc_from_contiguous(dev, count, get_order(size)); |
106 | /* fallback */ | ||
105 | if (!page) | 107 | if (!page) |
106 | page = alloc_pages_node(dev_to_node(dev), flag, get_order(size)); | 108 | page = alloc_pages_node(dev_to_node(dev), flag, get_order(size)); |
107 | if (!page) | 109 | if (!page) |
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index 04ee1e2e4c02..7c6acd4b8995 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c | |||
@@ -571,3 +571,40 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F5, | |||
571 | quirk_amd_nb_node); | 571 | quirk_amd_nb_node); |
572 | 572 | ||
573 | #endif | 573 | #endif |
574 | |||
575 | #ifdef CONFIG_PCI | ||
576 | /* | ||
577 | * Processor does not ensure DRAM scrub read/write sequence | ||
578 | * is atomic wrt accesses to CC6 save state area. Therefore | ||
579 | * if a concurrent scrub read/write access is to same address | ||
580 | * the entry may appear as if it is not written. This quirk | ||
581 | * applies to Fam16h models 00h-0Fh | ||
582 | * | ||
583 | * See "Revision Guide" for AMD F16h models 00h-0fh, | ||
584 | * document 51810 rev. 3.04, Nov 2013 | ||
585 | */ | ||
586 | static void amd_disable_seq_and_redirect_scrub(struct pci_dev *dev) | ||
587 | { | ||
588 | u32 val; | ||
589 | |||
590 | /* | ||
591 | * Suggested workaround: | ||
592 | * set D18F3x58[4:0] = 00h and set D18F3x5C[0] = 0b | ||
593 | */ | ||
594 | pci_read_config_dword(dev, 0x58, &val); | ||
595 | if (val & 0x1F) { | ||
596 | val &= ~(0x1F); | ||
597 | pci_write_config_dword(dev, 0x58, val); | ||
598 | } | ||
599 | |||
600 | pci_read_config_dword(dev, 0x5C, &val); | ||
601 | if (val & BIT(0)) { | ||
602 | val &= ~BIT(0); | ||
603 | pci_write_config_dword(dev, 0x5c, val); | ||
604 | } | ||
605 | } | ||
606 | |||
607 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3, | ||
608 | amd_disable_seq_and_redirect_scrub); | ||
609 | |||
610 | #endif | ||
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 19e5adb49a27..cfbe99f88830 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -209,7 +209,7 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc) | |||
209 | * dance when its actually needed. | 209 | * dance when its actually needed. |
210 | */ | 210 | */ |
211 | 211 | ||
212 | preempt_disable(); | 212 | preempt_disable_notrace(); |
213 | data = this_cpu_read(cyc2ns.head); | 213 | data = this_cpu_read(cyc2ns.head); |
214 | tail = this_cpu_read(cyc2ns.tail); | 214 | tail = this_cpu_read(cyc2ns.tail); |
215 | 215 | ||
@@ -229,7 +229,7 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc) | |||
229 | if (!--data->__count) | 229 | if (!--data->__count) |
230 | this_cpu_write(cyc2ns.tail, data); | 230 | this_cpu_write(cyc2ns.tail, data); |
231 | } | 231 | } |
232 | preempt_enable(); | 232 | preempt_enable_notrace(); |
233 | 233 | ||
234 | return ns; | 234 | return ns; |
235 | } | 235 | } |
@@ -653,13 +653,10 @@ unsigned long native_calibrate_tsc(void) | |||
653 | 653 | ||
654 | /* Calibrate TSC using MSR for Intel Atom SoCs */ | 654 | /* Calibrate TSC using MSR for Intel Atom SoCs */ |
655 | local_irq_save(flags); | 655 | local_irq_save(flags); |
656 | i = try_msr_calibrate_tsc(&fast_calibrate); | 656 | fast_calibrate = try_msr_calibrate_tsc(); |
657 | local_irq_restore(flags); | 657 | local_irq_restore(flags); |
658 | if (i >= 0) { | 658 | if (fast_calibrate) |
659 | if (i == 0) | ||
660 | pr_warn("Fast TSC calibration using MSR failed\n"); | ||
661 | return fast_calibrate; | 659 | return fast_calibrate; |
662 | } | ||
663 | 660 | ||
664 | local_irq_save(flags); | 661 | local_irq_save(flags); |
665 | fast_calibrate = quick_pit_calibrate(); | 662 | fast_calibrate = quick_pit_calibrate(); |
diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c index 8b5434f4389f..92ae6acac8a7 100644 --- a/arch/x86/kernel/tsc_msr.c +++ b/arch/x86/kernel/tsc_msr.c | |||
@@ -53,7 +53,7 @@ static struct freq_desc freq_desc_tables[] = { | |||
53 | /* TNG */ | 53 | /* TNG */ |
54 | { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } }, | 54 | { 6, 0x4a, 1, { 0, FREQ_100, FREQ_133, 0, 0, 0, 0, 0 } }, |
55 | /* VLV2 */ | 55 | /* VLV2 */ |
56 | { 6, 0x37, 1, { 0, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } }, | 56 | { 6, 0x37, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_166, 0, 0, 0, 0 } }, |
57 | /* ANN */ | 57 | /* ANN */ |
58 | { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } }, | 58 | { 6, 0x5a, 1, { FREQ_83, FREQ_100, FREQ_133, FREQ_100, 0, 0, 0, 0 } }, |
59 | }; | 59 | }; |
@@ -77,21 +77,18 @@ static int match_cpu(u8 family, u8 model) | |||
77 | 77 | ||
78 | /* | 78 | /* |
79 | * Do MSR calibration only for known/supported CPUs. | 79 | * Do MSR calibration only for known/supported CPUs. |
80 | * Return values: | 80 | * |
81 | * -1: CPU is unknown/unsupported for MSR based calibration | 81 | * Returns the calibration value or 0 if MSR calibration failed. |
82 | * 0: CPU is known/supported, but calibration failed | ||
83 | * 1: CPU is known/supported, and calibration succeeded | ||
84 | */ | 82 | */ |
85 | int try_msr_calibrate_tsc(unsigned long *fast_calibrate) | 83 | unsigned long try_msr_calibrate_tsc(void) |
86 | { | 84 | { |
87 | int cpu_index; | ||
88 | u32 lo, hi, ratio, freq_id, freq; | 85 | u32 lo, hi, ratio, freq_id, freq; |
86 | unsigned long res; | ||
87 | int cpu_index; | ||
89 | 88 | ||
90 | cpu_index = match_cpu(boot_cpu_data.x86, boot_cpu_data.x86_model); | 89 | cpu_index = match_cpu(boot_cpu_data.x86, boot_cpu_data.x86_model); |
91 | if (cpu_index < 0) | 90 | if (cpu_index < 0) |
92 | return -1; | 91 | return 0; |
93 | |||
94 | *fast_calibrate = 0; | ||
95 | 92 | ||
96 | if (freq_desc_tables[cpu_index].msr_plat) { | 93 | if (freq_desc_tables[cpu_index].msr_plat) { |
97 | rdmsr(MSR_PLATFORM_INFO, lo, hi); | 94 | rdmsr(MSR_PLATFORM_INFO, lo, hi); |
@@ -103,7 +100,7 @@ int try_msr_calibrate_tsc(unsigned long *fast_calibrate) | |||
103 | pr_info("Maximum core-clock to bus-clock ratio: 0x%x\n", ratio); | 100 | pr_info("Maximum core-clock to bus-clock ratio: 0x%x\n", ratio); |
104 | 101 | ||
105 | if (!ratio) | 102 | if (!ratio) |
106 | return 0; | 103 | goto fail; |
107 | 104 | ||
108 | /* Get FSB FREQ ID */ | 105 | /* Get FSB FREQ ID */ |
109 | rdmsr(MSR_FSB_FREQ, lo, hi); | 106 | rdmsr(MSR_FSB_FREQ, lo, hi); |
@@ -112,16 +109,19 @@ int try_msr_calibrate_tsc(unsigned long *fast_calibrate) | |||
112 | pr_info("Resolved frequency ID: %u, frequency: %u KHz\n", | 109 | pr_info("Resolved frequency ID: %u, frequency: %u KHz\n", |
113 | freq_id, freq); | 110 | freq_id, freq); |
114 | if (!freq) | 111 | if (!freq) |
115 | return 0; | 112 | goto fail; |
116 | 113 | ||
117 | /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */ | 114 | /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */ |
118 | *fast_calibrate = freq * ratio; | 115 | res = freq * ratio; |
119 | pr_info("TSC runs at %lu KHz\n", *fast_calibrate); | 116 | pr_info("TSC runs at %lu KHz\n", res); |
120 | 117 | ||
121 | #ifdef CONFIG_X86_LOCAL_APIC | 118 | #ifdef CONFIG_X86_LOCAL_APIC |
122 | lapic_timer_frequency = (freq * 1000) / HZ; | 119 | lapic_timer_frequency = (freq * 1000) / HZ; |
123 | pr_info("lapic_timer_frequency = %d\n", lapic_timer_frequency); | 120 | pr_info("lapic_timer_frequency = %d\n", lapic_timer_frequency); |
124 | #endif | 121 | #endif |
122 | return res; | ||
125 | 123 | ||
126 | return 1; | 124 | fail: |
125 | pr_warn("Fast TSC calibration using MSR failed\n"); | ||
126 | return 0; | ||
127 | } | 127 | } |
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 9d591c895803..6dea040cc3a1 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -1001,6 +1001,12 @@ static int fault_in_kernel_space(unsigned long address) | |||
1001 | 1001 | ||
1002 | static inline bool smap_violation(int error_code, struct pt_regs *regs) | 1002 | static inline bool smap_violation(int error_code, struct pt_regs *regs) |
1003 | { | 1003 | { |
1004 | if (!IS_ENABLED(CONFIG_X86_SMAP)) | ||
1005 | return false; | ||
1006 | |||
1007 | if (!static_cpu_has(X86_FEATURE_SMAP)) | ||
1008 | return false; | ||
1009 | |||
1004 | if (error_code & PF_USER) | 1010 | if (error_code & PF_USER) |
1005 | return false; | 1011 | return false; |
1006 | 1012 | ||
@@ -1087,11 +1093,9 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
1087 | if (unlikely(error_code & PF_RSVD)) | 1093 | if (unlikely(error_code & PF_RSVD)) |
1088 | pgtable_bad(regs, error_code, address); | 1094 | pgtable_bad(regs, error_code, address); |
1089 | 1095 | ||
1090 | if (static_cpu_has(X86_FEATURE_SMAP)) { | 1096 | if (unlikely(smap_violation(error_code, regs))) { |
1091 | if (unlikely(smap_violation(error_code, regs))) { | 1097 | bad_area_nosemaphore(regs, error_code, address); |
1092 | bad_area_nosemaphore(regs, error_code, address); | 1098 | return; |
1093 | return; | ||
1094 | } | ||
1095 | } | 1099 | } |
1096 | 1100 | ||
1097 | /* | 1101 | /* |
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 81b2750f3666..27aa0455fab3 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c | |||
@@ -493,14 +493,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi) | |||
493 | struct numa_memblk *mb = &mi->blk[i]; | 493 | struct numa_memblk *mb = &mi->blk[i]; |
494 | memblock_set_node(mb->start, mb->end - mb->start, | 494 | memblock_set_node(mb->start, mb->end - mb->start, |
495 | &memblock.memory, mb->nid); | 495 | &memblock.memory, mb->nid); |
496 | |||
497 | /* | ||
498 | * At this time, all memory regions reserved by memblock are | ||
499 | * used by the kernel. Set the nid in memblock.reserved will | ||
500 | * mark out all the nodes the kernel resides in. | ||
501 | */ | ||
502 | memblock_set_node(mb->start, mb->end - mb->start, | ||
503 | &memblock.reserved, mb->nid); | ||
504 | } | 496 | } |
505 | 497 | ||
506 | /* | 498 | /* |
@@ -565,10 +557,21 @@ static void __init numa_init_array(void) | |||
565 | static void __init numa_clear_kernel_node_hotplug(void) | 557 | static void __init numa_clear_kernel_node_hotplug(void) |
566 | { | 558 | { |
567 | int i, nid; | 559 | int i, nid; |
568 | nodemask_t numa_kernel_nodes; | 560 | nodemask_t numa_kernel_nodes = NODE_MASK_NONE; |
569 | unsigned long start, end; | 561 | unsigned long start, end; |
570 | struct memblock_type *type = &memblock.reserved; | 562 | struct memblock_type *type = &memblock.reserved; |
571 | 563 | ||
564 | /* | ||
565 | * At this time, all memory regions reserved by memblock are | ||
566 | * used by the kernel. Set the nid in memblock.reserved will | ||
567 | * mark out all the nodes the kernel resides in. | ||
568 | */ | ||
569 | for (i = 0; i < numa_meminfo.nr_blks; i++) { | ||
570 | struct numa_memblk *mb = &numa_meminfo.blk[i]; | ||
571 | memblock_set_node(mb->start, mb->end - mb->start, | ||
572 | &memblock.reserved, mb->nid); | ||
573 | } | ||
574 | |||
572 | /* Mark all kernel nodes. */ | 575 | /* Mark all kernel nodes. */ |
573 | for (i = 0; i < type->cnt; i++) | 576 | for (i = 0; i < type->cnt; i++) |
574 | node_set(type->regions[i].nid, numa_kernel_nodes); | 577 | node_set(type->regions[i].nid, numa_kernel_nodes); |
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c index 0342d27ca798..47b6436e41c2 100644 --- a/arch/x86/mm/numa_32.c +++ b/arch/x86/mm/numa_32.c | |||
@@ -52,6 +52,8 @@ void memory_present(int nid, unsigned long start, unsigned long end) | |||
52 | nid, start, end); | 52 | nid, start, end); |
53 | printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid); | 53 | printk(KERN_DEBUG " Setting physnode_map array to node %d for pfns:\n", nid); |
54 | printk(KERN_DEBUG " "); | 54 | printk(KERN_DEBUG " "); |
55 | start = round_down(start, PAGES_PER_SECTION); | ||
56 | end = round_up(end, PAGES_PER_SECTION); | ||
55 | for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { | 57 | for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { |
56 | physnode_map[pfn / PAGES_PER_SECTION] = nid; | 58 | physnode_map[pfn / PAGES_PER_SECTION] = nid; |
57 | printk(KERN_CONT "%lx ", pfn); | 59 | printk(KERN_CONT "%lx ", pfn); |
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 1a25187e151e..1953e9c9391a 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c | |||
@@ -42,15 +42,25 @@ static __init inline int srat_disabled(void) | |||
42 | return acpi_numa < 0; | 42 | return acpi_numa < 0; |
43 | } | 43 | } |
44 | 44 | ||
45 | /* Callback for SLIT parsing */ | 45 | /* |
46 | * Callback for SLIT parsing. pxm_to_node() returns NUMA_NO_NODE for | ||
47 | * I/O localities since SRAT does not list them. I/O localities are | ||
48 | * not supported at this point. | ||
49 | */ | ||
46 | void __init acpi_numa_slit_init(struct acpi_table_slit *slit) | 50 | void __init acpi_numa_slit_init(struct acpi_table_slit *slit) |
47 | { | 51 | { |
48 | int i, j; | 52 | int i, j; |
49 | 53 | ||
50 | for (i = 0; i < slit->locality_count; i++) | 54 | for (i = 0; i < slit->locality_count; i++) { |
51 | for (j = 0; j < slit->locality_count; j++) | 55 | if (pxm_to_node(i) == NUMA_NO_NODE) |
56 | continue; | ||
57 | for (j = 0; j < slit->locality_count; j++) { | ||
58 | if (pxm_to_node(j) == NUMA_NO_NODE) | ||
59 | continue; | ||
52 | numa_set_distance(pxm_to_node(i), pxm_to_node(j), | 60 | numa_set_distance(pxm_to_node(i), pxm_to_node(j), |
53 | slit->entry[slit->locality_count * i + j]); | 61 | slit->entry[slit->locality_count * i + j]); |
62 | } | ||
63 | } | ||
54 | } | 64 | } |
55 | 65 | ||
56 | /* Callback for Proximity Domain -> x2APIC mapping */ | 66 | /* Callback for Proximity Domain -> x2APIC mapping */ |
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index ae699b3bbac8..dd8dda167a24 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c | |||
@@ -103,7 +103,7 @@ static void flush_tlb_func(void *info) | |||
103 | if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm)) | 103 | if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm)) |
104 | return; | 104 | return; |
105 | 105 | ||
106 | count_vm_event(NR_TLB_REMOTE_FLUSH_RECEIVED); | 106 | count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); |
107 | if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) { | 107 | if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) { |
108 | if (f->flush_end == TLB_FLUSH_ALL) | 108 | if (f->flush_end == TLB_FLUSH_ALL) |
109 | local_flush_tlb(); | 109 | local_flush_tlb(); |
@@ -131,7 +131,7 @@ void native_flush_tlb_others(const struct cpumask *cpumask, | |||
131 | info.flush_start = start; | 131 | info.flush_start = start; |
132 | info.flush_end = end; | 132 | info.flush_end = end; |
133 | 133 | ||
134 | count_vm_event(NR_TLB_REMOTE_FLUSH); | 134 | count_vm_tlb_event(NR_TLB_REMOTE_FLUSH); |
135 | if (is_uv_system()) { | 135 | if (is_uv_system()) { |
136 | unsigned int cpu; | 136 | unsigned int cpu; |
137 | 137 | ||
@@ -151,44 +151,19 @@ void flush_tlb_current_task(void) | |||
151 | 151 | ||
152 | preempt_disable(); | 152 | preempt_disable(); |
153 | 153 | ||
154 | count_vm_event(NR_TLB_LOCAL_FLUSH_ALL); | 154 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); |
155 | local_flush_tlb(); | 155 | local_flush_tlb(); |
156 | if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids) | 156 | if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids) |
157 | flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL); | 157 | flush_tlb_others(mm_cpumask(mm), mm, 0UL, TLB_FLUSH_ALL); |
158 | preempt_enable(); | 158 | preempt_enable(); |
159 | } | 159 | } |
160 | 160 | ||
161 | /* | ||
162 | * It can find out the THP large page, or | ||
163 | * HUGETLB page in tlb_flush when THP disabled | ||
164 | */ | ||
165 | static inline unsigned long has_large_page(struct mm_struct *mm, | ||
166 | unsigned long start, unsigned long end) | ||
167 | { | ||
168 | pgd_t *pgd; | ||
169 | pud_t *pud; | ||
170 | pmd_t *pmd; | ||
171 | unsigned long addr = ALIGN(start, HPAGE_SIZE); | ||
172 | for (; addr < end; addr += HPAGE_SIZE) { | ||
173 | pgd = pgd_offset(mm, addr); | ||
174 | if (likely(!pgd_none(*pgd))) { | ||
175 | pud = pud_offset(pgd, addr); | ||
176 | if (likely(!pud_none(*pud))) { | ||
177 | pmd = pmd_offset(pud, addr); | ||
178 | if (likely(!pmd_none(*pmd))) | ||
179 | if (pmd_large(*pmd)) | ||
180 | return addr; | ||
181 | } | ||
182 | } | ||
183 | } | ||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, | 161 | void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, |
188 | unsigned long end, unsigned long vmflag) | 162 | unsigned long end, unsigned long vmflag) |
189 | { | 163 | { |
190 | unsigned long addr; | 164 | unsigned long addr; |
191 | unsigned act_entries, tlb_entries = 0; | 165 | unsigned act_entries, tlb_entries = 0; |
166 | unsigned long nr_base_pages; | ||
192 | 167 | ||
193 | preempt_disable(); | 168 | preempt_disable(); |
194 | if (current->active_mm != mm) | 169 | if (current->active_mm != mm) |
@@ -210,21 +185,20 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, | |||
210 | tlb_entries = tlb_lli_4k[ENTRIES]; | 185 | tlb_entries = tlb_lli_4k[ENTRIES]; |
211 | else | 186 | else |
212 | tlb_entries = tlb_lld_4k[ENTRIES]; | 187 | tlb_entries = tlb_lld_4k[ENTRIES]; |
188 | |||
213 | /* Assume all of TLB entries was occupied by this task */ | 189 | /* Assume all of TLB entries was occupied by this task */ |
214 | act_entries = mm->total_vm > tlb_entries ? tlb_entries : mm->total_vm; | 190 | act_entries = tlb_entries >> tlb_flushall_shift; |
191 | act_entries = mm->total_vm > act_entries ? act_entries : mm->total_vm; | ||
192 | nr_base_pages = (end - start) >> PAGE_SHIFT; | ||
215 | 193 | ||
216 | /* tlb_flushall_shift is on balance point, details in commit log */ | 194 | /* tlb_flushall_shift is on balance point, details in commit log */ |
217 | if ((end - start) >> PAGE_SHIFT > act_entries >> tlb_flushall_shift) { | 195 | if (nr_base_pages > act_entries) { |
218 | count_vm_event(NR_TLB_LOCAL_FLUSH_ALL); | 196 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ALL); |
219 | local_flush_tlb(); | 197 | local_flush_tlb(); |
220 | } else { | 198 | } else { |
221 | if (has_large_page(mm, start, end)) { | ||
222 | local_flush_tlb(); | ||
223 | goto flush_all; | ||
224 | } | ||
225 | /* flush range by one by one 'invlpg' */ | 199 | /* flush range by one by one 'invlpg' */ |
226 | for (addr = start; addr < end; addr += PAGE_SIZE) { | 200 | for (addr = start; addr < end; addr += PAGE_SIZE) { |
227 | count_vm_event(NR_TLB_LOCAL_FLUSH_ONE); | 201 | count_vm_tlb_event(NR_TLB_LOCAL_FLUSH_ONE); |
228 | __flush_tlb_single(addr); | 202 | __flush_tlb_single(addr); |
229 | } | 203 | } |
230 | 204 | ||
@@ -262,7 +236,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long start) | |||
262 | 236 | ||
263 | static void do_flush_tlb_all(void *info) | 237 | static void do_flush_tlb_all(void *info) |
264 | { | 238 | { |
265 | count_vm_event(NR_TLB_REMOTE_FLUSH_RECEIVED); | 239 | count_vm_tlb_event(NR_TLB_REMOTE_FLUSH_RECEIVED); |
266 | __flush_tlb_all(); | 240 | __flush_tlb_all(); |
267 | if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_LAZY) | 241 | if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_LAZY) |
268 | leave_mm(smp_processor_id()); | 242 | leave_mm(smp_processor_id()); |
@@ -270,7 +244,7 @@ static void do_flush_tlb_all(void *info) | |||
270 | 244 | ||
271 | void flush_tlb_all(void) | 245 | void flush_tlb_all(void) |
272 | { | 246 | { |
273 | count_vm_event(NR_TLB_REMOTE_FLUSH); | 247 | count_vm_tlb_event(NR_TLB_REMOTE_FLUSH); |
274 | on_each_cpu(do_flush_tlb_all, NULL, 1); | 248 | on_each_cpu(do_flush_tlb_all, NULL, 1); |
275 | } | 249 | } |
276 | 250 | ||
diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c index 7145ec63c520..f15103dff4b4 100644 --- a/arch/x86/platform/efi/efi-bgrt.c +++ b/arch/x86/platform/efi/efi-bgrt.c | |||
@@ -42,14 +42,15 @@ void __init efi_bgrt_init(void) | |||
42 | 42 | ||
43 | if (bgrt_tab->header.length < sizeof(*bgrt_tab)) | 43 | if (bgrt_tab->header.length < sizeof(*bgrt_tab)) |
44 | return; | 44 | return; |
45 | if (bgrt_tab->version != 1) | 45 | if (bgrt_tab->version != 1 || bgrt_tab->status != 1) |
46 | return; | 46 | return; |
47 | if (bgrt_tab->image_type != 0 || !bgrt_tab->image_address) | 47 | if (bgrt_tab->image_type != 0 || !bgrt_tab->image_address) |
48 | return; | 48 | return; |
49 | 49 | ||
50 | image = efi_lookup_mapped_addr(bgrt_tab->image_address); | 50 | image = efi_lookup_mapped_addr(bgrt_tab->image_address); |
51 | if (!image) { | 51 | if (!image) { |
52 | image = ioremap(bgrt_tab->image_address, sizeof(bmp_header)); | 52 | image = early_memremap(bgrt_tab->image_address, |
53 | sizeof(bmp_header)); | ||
53 | ioremapped = true; | 54 | ioremapped = true; |
54 | if (!image) | 55 | if (!image) |
55 | return; | 56 | return; |
@@ -57,7 +58,7 @@ void __init efi_bgrt_init(void) | |||
57 | 58 | ||
58 | memcpy_fromio(&bmp_header, image, sizeof(bmp_header)); | 59 | memcpy_fromio(&bmp_header, image, sizeof(bmp_header)); |
59 | if (ioremapped) | 60 | if (ioremapped) |
60 | iounmap(image); | 61 | early_iounmap(image, sizeof(bmp_header)); |
61 | bgrt_image_size = bmp_header.size; | 62 | bgrt_image_size = bmp_header.size; |
62 | 63 | ||
63 | bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL); | 64 | bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL); |
@@ -65,7 +66,8 @@ void __init efi_bgrt_init(void) | |||
65 | return; | 66 | return; |
66 | 67 | ||
67 | if (ioremapped) { | 68 | if (ioremapped) { |
68 | image = ioremap(bgrt_tab->image_address, bmp_header.size); | 69 | image = early_memremap(bgrt_tab->image_address, |
70 | bmp_header.size); | ||
69 | if (!image) { | 71 | if (!image) { |
70 | kfree(bgrt_image); | 72 | kfree(bgrt_image); |
71 | bgrt_image = NULL; | 73 | bgrt_image = NULL; |
@@ -75,5 +77,5 @@ void __init efi_bgrt_init(void) | |||
75 | 77 | ||
76 | memcpy_fromio(bgrt_image, image, bgrt_image_size); | 78 | memcpy_fromio(bgrt_image, image, bgrt_image_size); |
77 | if (ioremapped) | 79 | if (ioremapped) |
78 | iounmap(image); | 80 | early_iounmap(image, bmp_header.size); |
79 | } | 81 | } |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index d62ec87a2b26..1a201ac7cef8 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -792,7 +792,7 @@ void __init efi_set_executable(efi_memory_desc_t *md, bool executable) | |||
792 | set_memory_nx(addr, npages); | 792 | set_memory_nx(addr, npages); |
793 | } | 793 | } |
794 | 794 | ||
795 | static void __init runtime_code_page_mkexec(void) | 795 | void __init runtime_code_page_mkexec(void) |
796 | { | 796 | { |
797 | efi_memory_desc_t *md; | 797 | efi_memory_desc_t *md; |
798 | void *p; | 798 | void *p; |
@@ -1069,8 +1069,7 @@ void __init efi_enter_virtual_mode(void) | |||
1069 | efi.update_capsule = virt_efi_update_capsule; | 1069 | efi.update_capsule = virt_efi_update_capsule; |
1070 | efi.query_capsule_caps = virt_efi_query_capsule_caps; | 1070 | efi.query_capsule_caps = virt_efi_query_capsule_caps; |
1071 | 1071 | ||
1072 | if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX)) | 1072 | efi_runtime_mkexec(); |
1073 | runtime_code_page_mkexec(); | ||
1074 | 1073 | ||
1075 | kfree(new_memmap); | 1074 | kfree(new_memmap); |
1076 | 1075 | ||
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index 249b183cf417..0b74cdf7f816 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c | |||
@@ -77,3 +77,9 @@ void efi_call_phys_epilog(void) | |||
77 | 77 | ||
78 | local_irq_restore(efi_rt_eflags); | 78 | local_irq_restore(efi_rt_eflags); |
79 | } | 79 | } |
80 | |||
81 | void __init efi_runtime_mkexec(void) | ||
82 | { | ||
83 | if (__supported_pte_mask & _PAGE_NX) | ||
84 | runtime_code_page_mkexec(); | ||
85 | } | ||
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 6284f158a47d..0c2a234fef1e 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
@@ -233,3 +233,12 @@ void __init parse_efi_setup(u64 phys_addr, u32 data_len) | |||
233 | { | 233 | { |
234 | efi_setup = phys_addr + sizeof(struct setup_data); | 234 | efi_setup = phys_addr + sizeof(struct setup_data); |
235 | } | 235 | } |
236 | |||
237 | void __init efi_runtime_mkexec(void) | ||
238 | { | ||
239 | if (!efi_enabled(EFI_OLD_MEMMAP)) | ||
240 | return; | ||
241 | |||
242 | if (__supported_pte_mask & _PAGE_NX) | ||
243 | runtime_code_page_mkexec(); | ||
244 | } | ||
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index a4d7b647867f..201d09a7c46b 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1473,6 +1473,18 @@ static void xen_pvh_set_cr_flags(int cpu) | |||
1473 | * X86_CR0_TS, X86_CR0_PE, X86_CR0_ET are set by Xen for HVM guests | 1473 | * X86_CR0_TS, X86_CR0_PE, X86_CR0_ET are set by Xen for HVM guests |
1474 | * (which PVH shared codepaths), while X86_CR0_PG is for PVH. */ | 1474 | * (which PVH shared codepaths), while X86_CR0_PG is for PVH. */ |
1475 | write_cr0(read_cr0() | X86_CR0_MP | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM); | 1475 | write_cr0(read_cr0() | X86_CR0_MP | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM); |
1476 | |||
1477 | if (!cpu) | ||
1478 | return; | ||
1479 | /* | ||
1480 | * For BSP, PSE PGE are set in probe_page_size_mask(), for APs | ||
1481 | * set them here. For all, OSFXSR OSXMMEXCPT are set in fpu_init. | ||
1482 | */ | ||
1483 | if (cpu_has_pse) | ||
1484 | set_in_cr4(X86_CR4_PSE); | ||
1485 | |||
1486 | if (cpu_has_pge) | ||
1487 | set_in_cr4(X86_CR4_PGE); | ||
1476 | } | 1488 | } |
1477 | 1489 | ||
1478 | /* | 1490 | /* |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 2423ef04ffea..256282e7888b 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -365,7 +365,7 @@ void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, | |||
365 | /* Assume pteval_t is equivalent to all the other *val_t types. */ | 365 | /* Assume pteval_t is equivalent to all the other *val_t types. */ |
366 | static pteval_t pte_mfn_to_pfn(pteval_t val) | 366 | static pteval_t pte_mfn_to_pfn(pteval_t val) |
367 | { | 367 | { |
368 | if (val & _PAGE_PRESENT) { | 368 | if (pteval_present(val)) { |
369 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 369 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
370 | unsigned long pfn = mfn_to_pfn(mfn); | 370 | unsigned long pfn = mfn_to_pfn(mfn); |
371 | 371 | ||
@@ -381,7 +381,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) | |||
381 | 381 | ||
382 | static pteval_t pte_pfn_to_mfn(pteval_t val) | 382 | static pteval_t pte_pfn_to_mfn(pteval_t val) |
383 | { | 383 | { |
384 | if (val & _PAGE_PRESENT) { | 384 | if (pteval_present(val)) { |
385 | unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 385 | unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
386 | pteval_t flags = val & PTE_FLAGS_MASK; | 386 | pteval_t flags = val & PTE_FLAGS_MASK; |
387 | unsigned long mfn; | 387 | unsigned long mfn; |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 8009acbe41e4..696c694986d0 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -899,6 +899,13 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
899 | "m2p_add_override: pfn %lx not mapped", pfn)) | 899 | "m2p_add_override: pfn %lx not mapped", pfn)) |
900 | return -EINVAL; | 900 | return -EINVAL; |
901 | } | 901 | } |
902 | WARN_ON(PagePrivate(page)); | ||
903 | SetPagePrivate(page); | ||
904 | set_page_private(page, mfn); | ||
905 | page->index = pfn_to_mfn(pfn); | ||
906 | |||
907 | if (unlikely(!set_phys_to_machine(pfn, FOREIGN_FRAME(mfn)))) | ||
908 | return -ENOMEM; | ||
902 | 909 | ||
903 | if (kmap_op != NULL) { | 910 | if (kmap_op != NULL) { |
904 | if (!PageHighMem(page)) { | 911 | if (!PageHighMem(page)) { |
@@ -937,16 +944,19 @@ int m2p_add_override(unsigned long mfn, struct page *page, | |||
937 | } | 944 | } |
938 | EXPORT_SYMBOL_GPL(m2p_add_override); | 945 | EXPORT_SYMBOL_GPL(m2p_add_override); |
939 | int m2p_remove_override(struct page *page, | 946 | int m2p_remove_override(struct page *page, |
940 | struct gnttab_map_grant_ref *kmap_op, | 947 | struct gnttab_map_grant_ref *kmap_op) |
941 | unsigned long mfn) | ||
942 | { | 948 | { |
943 | unsigned long flags; | 949 | unsigned long flags; |
950 | unsigned long mfn; | ||
944 | unsigned long pfn; | 951 | unsigned long pfn; |
945 | unsigned long uninitialized_var(address); | 952 | unsigned long uninitialized_var(address); |
946 | unsigned level; | 953 | unsigned level; |
947 | pte_t *ptep = NULL; | 954 | pte_t *ptep = NULL; |
948 | 955 | ||
949 | pfn = page_to_pfn(page); | 956 | pfn = page_to_pfn(page); |
957 | mfn = get_phys_to_machine(pfn); | ||
958 | if (mfn == INVALID_P2M_ENTRY || !(mfn & FOREIGN_FRAME_BIT)) | ||
959 | return -EINVAL; | ||
950 | 960 | ||
951 | if (!PageHighMem(page)) { | 961 | if (!PageHighMem(page)) { |
952 | address = (unsigned long)__va(pfn << PAGE_SHIFT); | 962 | address = (unsigned long)__va(pfn << PAGE_SHIFT); |
@@ -960,7 +970,10 @@ int m2p_remove_override(struct page *page, | |||
960 | spin_lock_irqsave(&m2p_override_lock, flags); | 970 | spin_lock_irqsave(&m2p_override_lock, flags); |
961 | list_del(&page->lru); | 971 | list_del(&page->lru); |
962 | spin_unlock_irqrestore(&m2p_override_lock, flags); | 972 | spin_unlock_irqrestore(&m2p_override_lock, flags); |
973 | WARN_ON(!PagePrivate(page)); | ||
974 | ClearPagePrivate(page); | ||
963 | 975 | ||
976 | set_phys_to_machine(pfn, page->index); | ||
964 | if (kmap_op != NULL) { | 977 | if (kmap_op != NULL) { |
965 | if (!PageHighMem(page)) { | 978 | if (!PageHighMem(page)) { |
966 | struct multicall_space mcs; | 979 | struct multicall_space mcs; |