aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig4
-rw-r--r--arch/arm/Kconfig.debug114
-rw-r--r--arch/arm/boot/dts/at91rm9200.dtsi12
-rw-r--r--arch/arm/boot/dts/at91rm9200ek.dts4
-rw-r--r--arch/arm/boot/dts/at91sam9260.dtsi5
-rw-r--r--arch/arm/boot/dts/at91sam9261.dtsi5
-rw-r--r--arch/arm/boot/dts/at91sam9263.dtsi12
-rw-r--r--arch/arm/boot/dts/at91sam9g20.dtsi9
-rw-r--r--arch/arm/boot/dts/at91sam9g45.dtsi7
-rw-r--r--arch/arm/boot/dts/at91sam9n12.dtsi12
-rw-r--r--arch/arm/boot/dts/at91sam9rl.dtsi5
-rw-r--r--arch/arm/boot/dts/at91sam9x5.dtsi5
-rw-r--r--arch/arm/boot/dts/at91sam9xe.dtsi60
-rw-r--r--arch/arm/boot/dts/ethernut5.dts2
-rw-r--r--arch/arm/boot/dts/sama5d3.dtsi34
-rw-r--r--arch/arm/boot/dts/sama5d3xcm.dtsi1
-rw-r--r--arch/arm/boot/dts/sama5d3xmb.dtsi40
-rw-r--r--arch/arm/boot/dts/sama5d4.dtsi10
-rw-r--r--arch/arm/boot/dts/tegra124-jetson-tk1.dts7
-rw-r--r--arch/arm/configs/at91_dt_defconfig10
-rw-r--r--arch/arm/include/debug/digicolor.S35
-rw-r--r--arch/arm/include/debug/msm.S6
-rw-r--r--arch/arm/include/debug/sirf.S30
-rw-r--r--arch/arm/mach-at91/Kconfig112
-rw-r--r--arch/arm/mach-at91/Makefile18
-rw-r--r--arch/arm/mach-at91/at91rm9200.c66
-rw-r--r--arch/arm/mach-at91/at91sam9.c87
-rw-r--r--arch/arm/mach-at91/at91sam9260.c59
-rw-r--r--arch/arm/mach-at91/at91sam9261.c40
-rw-r--r--arch/arm/mach-at91/at91sam9263.c37
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c36
-rw-r--r--arch/arm/mach-at91/at91sam9n12.c26
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c49
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c26
-rw-r--r--arch/arm/mach-at91/board-dt-rm9200.c43
-rw-r--r--arch/arm/mach-at91/board-dt-sam9.c36
-rw-r--r--arch/arm/mach-at91/generic.h20
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h52
-rw-r--r--arch/arm/mach-at91/include/mach/system_rev.h27
-rw-r--r--arch/arm/mach-at91/pm.c160
-rw-r--r--arch/arm/mach-at91/pm_slowclock.S9
-rw-r--r--arch/arm/mach-at91/sama5.c (renamed from arch/arm/mach-at91/board-dt-sama5.c)46
-rw-r--r--arch/arm/mach-at91/sama5d3.c35
-rw-r--r--arch/arm/mach-at91/sama5d4.c64
-rw-r--r--arch/arm/mach-at91/setup.c97
-rw-r--r--arch/arm/mach-at91/soc.h77
-rw-r--r--arch/arm/mach-bcm/platsmp-brcmstb.c85
-rw-r--r--arch/arm/mach-digicolor/Kconfig7
-rw-r--r--arch/arm/mach-digicolor/Makefile1
-rw-r--r--arch/arm/mach-digicolor/digicolor.c18
-rw-r--r--arch/arm/mach-exynos/exynos.c1
-rw-r--r--arch/arm/mach-exynos/regs-pmu.h3
-rw-r--r--arch/arm/mach-exynos/suspend.c77
-rw-r--r--arch/arm/mach-hisi/Kconfig8
-rw-r--r--arch/arm/mach-hisi/core.h5
-rw-r--r--arch/arm/mach-hisi/headsmp.S2
-rw-r--r--arch/arm/mach-hisi/hisilicon.c10
-rw-r--r--arch/arm/mach-hisi/hotplug.c31
-rw-r--r--arch/arm/mach-hisi/platsmp.c56
-rw-r--r--arch/arm/mach-imx/Makefile3
-rw-r--r--arch/arm/mach-imx/clk-gate2.c23
-rw-r--r--arch/arm/mach-imx/clk-imx6q.c2
-rw-r--r--arch/arm/mach-imx/clk-pllv3.c10
-rw-r--r--arch/arm/mach-imx/clk-vf610.c8
-rw-r--r--arch/arm/mach-imx/clk.h1
-rw-r--r--arch/arm/mach-imx/common.h4
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6sx.c105
-rw-r--r--arch/arm/mach-imx/cpuidle.h5
-rw-r--r--arch/arm/mach-imx/gpc.c25
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c2
-rw-r--r--arch/arm/mach-imx/mach-imx6sx.c2
-rw-r--r--arch/arm/mach-imx/mach-vf610.c5
-rw-r--r--arch/arm/mach-imx/pm-imx6.c7
-rw-r--r--arch/arm/mach-mediatek/Kconfig22
-rw-r--r--arch/arm/mach-mvebu/coherency.c58
-rw-r--r--arch/arm/mach-mvebu/mvebu-soc-id.h18
-rw-r--r--arch/arm/mach-omap2/Makefile4
-rw-r--r--arch/arm/mach-omap2/board-generic.c36
-rw-r--r--arch/arm/mach-omap2/clockdomain.h1
-rw-r--r--arch/arm/mach-omap2/clockdomains81xx_data.c194
-rw-r--r--arch/arm/mach-omap2/cm81xx.h61
-rw-r--r--arch/arm/mach-omap2/io.c82
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.h1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_81xx_data.c1136
-rw-r--r--arch/arm/mach-prima2/Kconfig22
-rw-r--r--arch/arm/mach-prima2/Makefile1
-rw-r--r--arch/arm/mach-prima2/common.c22
-rw-r--r--arch/arm/mach-prima2/lluart.c35
-rw-r--r--arch/arm/mach-prima2/platsmp.c52
-rw-r--r--arch/arm/mach-prima2/rstc.c41
-rw-r--r--arch/arm/mach-prima2/rtciobrg.c1
-rw-r--r--arch/arm/mach-qcom/Kconfig3
-rw-r--r--arch/arm/mach-qcom/scm-boot.c10
-rw-r--r--arch/arm/mach-qcom/scm-boot.h4
-rw-r--r--arch/arm/mach-qcom/scm.c85
-rw-r--r--arch/arm/mach-rockchip/Makefile1
-rw-r--r--arch/arm/mach-rockchip/pm.c260
-rw-r--r--arch/arm/mach-rockchip/pm.h99
-rw-r--r--arch/arm/mach-rockchip/rockchip.c4
-rw-r--r--arch/arm/mach-rockchip/sleep.S73
-rw-r--r--arch/arm/mach-shmobile/Kconfig8
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c10
-rw-r--r--arch/arm/mach-shmobile/pm-r8a7740.c14
-rw-r--r--arch/arm/mach-shmobile/pm-rmobile.c314
-rw-r--r--arch/arm/mach-shmobile/pm-rmobile.h3
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c11
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c4
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7779.c2
-rw-r--r--arch/arm/mach-sti/board-dt.c1
-rw-r--r--arch/arm/mach-sunxi/platsmp.c2
-rw-r--r--arch/arm/mach-sunxi/sunxi.c11
-rw-r--r--arch/arm/mach-tegra/Kconfig4
-rw-r--r--arch/arm/mach-zynq/Kconfig2
-rw-r--r--arch/arm/mach-zynq/common.c2
-rw-r--r--arch/arm/mach-zynq/pm.c2
-rw-r--r--arch/arm/mach-zynq/slcr.c35
-rw-r--r--arch/arm/plat-samsung/cpu.c4
118 files changed, 3617 insertions, 1297 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0850fc0f9658..9f1f09a2bc9b 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -860,6 +860,8 @@ source "arch/arm/mach-cns3xxx/Kconfig"
860 860
861source "arch/arm/mach-davinci/Kconfig" 861source "arch/arm/mach-davinci/Kconfig"
862 862
863source "arch/arm/mach-digicolor/Kconfig"
864
863source "arch/arm/mach-dove/Kconfig" 865source "arch/arm/mach-dove/Kconfig"
864 866
865source "arch/arm/mach-ep93xx/Kconfig" 867source "arch/arm/mach-ep93xx/Kconfig"
@@ -1493,7 +1495,7 @@ config ARM_PSCI
1493# selected platforms. 1495# selected platforms.
1494config ARCH_NR_GPIO 1496config ARCH_NR_GPIO
1495 int 1497 int
1496 default 1024 if ARCH_SHMOBILE || ARCH_TEGRA 1498 default 1024 if ARCH_SHMOBILE || ARCH_TEGRA || ARCH_ZYNQ
1497 default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \ 1499 default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || \
1498 SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 1500 SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210
1499 default 416 if ARCH_SUNXI 1501 default 416 if ARCH_SUNXI
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 8fecefe881cd..970de7518341 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -117,17 +117,20 @@ choice
117 config AT91_DEBUG_LL_DBGU0 117 config AT91_DEBUG_LL_DBGU0
118 bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12" 118 bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
119 select DEBUG_AT91_UART 119 select DEBUG_AT91_UART
120 depends on HAVE_AT91_DBGU0 120 depends on ARCH_AT91
121 depends on SOC_AT91RM9200 || SOC_AT91SAM9
121 122
122 config AT91_DEBUG_LL_DBGU1 123 config AT91_DEBUG_LL_DBGU1
123 bool "Kernel low-level debugging on 9263, 9g45 and sama5d3" 124 bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
124 select DEBUG_AT91_UART 125 select DEBUG_AT91_UART
125 depends on HAVE_AT91_DBGU1 126 depends on ARCH_AT91
127 depends on SOC_AT91SAM9 || SOC_SAMA5
126 128
127 config AT91_DEBUG_LL_DBGU2 129 config AT91_DEBUG_LL_DBGU2
128 bool "Kernel low-level debugging on sama5d4" 130 bool "Kernel low-level debugging on sama5d4"
129 select DEBUG_AT91_UART 131 select DEBUG_AT91_UART
130 depends on HAVE_AT91_DBGU2 132 depends on ARCH_AT91
133 depends on SOC_SAMA5
131 134
132 config DEBUG_BCM2835 135 config DEBUG_BCM2835
133 bool "Kernel low-level debugging on BCM2835 PL011 UART" 136 bool "Kernel low-level debugging on BCM2835 PL011 UART"
@@ -244,6 +247,13 @@ choice
244 Say Y here if you want the debug print routines to direct 247 Say Y here if you want the debug print routines to direct
245 their output to the serial port in the DC21285 (Footbridge). 248 their output to the serial port in the DC21285 (Footbridge).
246 249
250 config DEBUG_DIGICOLOR_UA0
251 bool "Kernel low-level debugging messages via Digicolor UA0"
252 depends on ARCH_DIGICOLOR
253 help
254 Say Y here if you want the debug print routines to direct
255 their output to the UA0 serial port in the CX92755.
256
247 config DEBUG_FOOTBRIDGE_COM1 257 config DEBUG_FOOTBRIDGE_COM1
248 bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1" 258 bool "Kernel low-level debugging messages via footbridge 8250 at PCI COM1"
249 depends on FOOTBRIDGE 259 depends on FOOTBRIDGE
@@ -275,6 +285,14 @@ choice
275 Say Y here if you want the debug print routines to direct 285 Say Y here if you want the debug print routines to direct
276 their output to the UART on Highbank based devices. 286 their output to the UART on Highbank based devices.
277 287
288 config DEBUG_HIP01_UART
289 bool "Hisilicon Hip01 Debug UART"
290 depends on ARCH_HIP01
291 select DEBUG_UART_8250
292 help
293 Say Y here if you want kernel low-level debugging support
294 on HIP01 UART.
295
278 config DEBUG_HIP04_UART 296 config DEBUG_HIP04_UART
279 bool "Hisilicon HiP04 Debug UART" 297 bool "Hisilicon HiP04 Debug UART"
280 depends on ARCH_HIP04 298 depends on ARCH_HIP04
@@ -437,7 +455,7 @@ choice
437 Say Y here if you want the debug print routines to direct 455 Say Y here if you want the debug print routines to direct
438 their output to the serial port on MSM devices. 456 their output to the serial port on MSM devices.
439 457
440 ARCH DEBUG_UART_PHYS DEBUG_UART_BASE # 458 ARCH DEBUG_UART_PHYS DEBUG_UART_VIRT #
441 MSM7X00A, QSD8X50 0xa9a00000 0xe1000000 UART1 459 MSM7X00A, QSD8X50 0xa9a00000 0xe1000000 UART1
442 MSM7X00A, QSD8X50 0xa9b00000 0xe1000000 UART2 460 MSM7X00A, QSD8X50 0xa9b00000 0xe1000000 UART2
443 MSM7X00A, QSD8X50 0xa9c00000 0xe1000000 UART3 461 MSM7X00A, QSD8X50 0xa9c00000 0xe1000000 UART3
@@ -456,7 +474,8 @@ choice
456 Say Y here if you want the debug print routines to direct 474 Say Y here if you want the debug print routines to direct
457 their output to the serial port on Qualcomm devices. 475 their output to the serial port on Qualcomm devices.
458 476
459 ARCH DEBUG_UART_PHYS DEBUG_UART_BASE 477 ARCH DEBUG_UART_PHYS DEBUG_UART_VIRT
478 APQ8064 0x16640000 0xf0040000
460 APQ8084 0xf995e000 0xfa75e000 479 APQ8084 0xf995e000 0xfa75e000
461 MSM8X60 0x19c40000 0xf0040000 480 MSM8X60 0x19c40000 0xf0040000
462 MSM8960 0x16440000 0xf0040000 481 MSM8960 0x16440000 0xf0040000
@@ -465,13 +484,13 @@ choice
465 Please adjust DEBUG_UART_PHYS and DEBUG_UART_BASE configuration 484 Please adjust DEBUG_UART_PHYS and DEBUG_UART_BASE configuration
466 options based on your needs. 485 options based on your needs.
467 486
468 config DEBUG_MVEBU_UART 487 config DEBUG_MVEBU_UART0
469 bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)" 488 bool "Kernel low-level debugging messages via MVEBU UART0 (old bootloaders)"
470 depends on ARCH_MVEBU 489 depends on ARCH_MVEBU
471 select DEBUG_UART_8250 490 select DEBUG_UART_8250
472 help 491 help
473 Say Y here if you want kernel low-level debugging support 492 Say Y here if you want kernel low-level debugging support
474 on MVEBU based platforms. 493 on MVEBU based platforms on UART0.
475 494
476 This option should be used with the old bootloaders 495 This option should be used with the old bootloaders
477 that left the internal registers mapped at 496 that left the internal registers mapped at
@@ -484,13 +503,28 @@ choice
484 when u-boot hands over to the kernel, the system 503 when u-boot hands over to the kernel, the system
485 silently crashes, with no serial output at all. 504 silently crashes, with no serial output at all.
486 505
487 config DEBUG_MVEBU_UART_ALTERNATE 506 config DEBUG_MVEBU_UART0_ALTERNATE
488 bool "Kernel low-level debugging messages via MVEBU UART (new bootloaders)" 507 bool "Kernel low-level debugging messages via MVEBU UART0 (new bootloaders)"
508 depends on ARCH_MVEBU
509 select DEBUG_UART_8250
510 help
511 Say Y here if you want kernel low-level debugging support
512 on MVEBU based platforms on UART0.
513
514 This option should be used with the new bootloaders
515 that remap the internal registers at 0xf1000000.
516
517 If the wrong DEBUG_MVEBU_UART* option is selected,
518 when u-boot hands over to the kernel, the system
519 silently crashes, with no serial output at all.
520
521 config DEBUG_MVEBU_UART1_ALTERNATE
522 bool "Kernel low-level debugging messages via MVEBU UART1 (new bootloaders)"
489 depends on ARCH_MVEBU 523 depends on ARCH_MVEBU
490 select DEBUG_UART_8250 524 select DEBUG_UART_8250
491 help 525 help
492 Say Y here if you want kernel low-level debugging support 526 Say Y here if you want kernel low-level debugging support
493 on MVEBU based platforms. 527 on MVEBU based platforms on UART1.
494 528
495 This option should be used with the new bootloaders 529 This option should be used with the new bootloaders
496 that remap the internal registers at 0xf1000000. 530 that remap the internal registers at 0xf1000000.
@@ -981,16 +1015,28 @@ choice
981 config DEBUG_SIRFPRIMA2_UART1 1015 config DEBUG_SIRFPRIMA2_UART1
982 bool "Kernel low-level debugging messages via SiRFprimaII UART1" 1016 bool "Kernel low-level debugging messages via SiRFprimaII UART1"
983 depends on ARCH_PRIMA2 1017 depends on ARCH_PRIMA2
1018 select DEBUG_SIRFSOC_UART
984 help 1019 help
985 Say Y here if you want the debug print routines to direct 1020 Say Y here if you want the debug print routines to direct
986 their output to the uart1 port on SiRFprimaII devices. 1021 their output to the uart1 port on SiRFprimaII devices.
987 1022
988 config DEBUG_SIRFMARCO_UART1 1023 config DEBUG_SIRFATLAS7_UART0
989 bool "Kernel low-level debugging messages via SiRFmarco UART1" 1024 bool "Kernel low-level debugging messages via SiRFatlas7 UART0"
990 depends on ARCH_MARCO 1025 depends on ARCH_ATLAS7
1026 select DEBUG_SIRFSOC_UART
991 help 1027 help
992 Say Y here if you want the debug print routines to direct 1028 Say Y here if you want the debug print routines to direct
993 their output to the uart1 port on SiRFmarco devices. 1029 their output to the uart0 port on SiRFATLAS7 devices.The uart0
1030 is used on SiRFATLAS7 as a extra debug port.sometimes an extra
1031 debug port can be very useful.
1032
1033 config DEBUG_SIRFATLAS7_UART1
1034 bool "Kernel low-level debugging messages via SiRFatlas7 UART1"
1035 depends on ARCH_ATLAS7
1036 select DEBUG_SIRFSOC_UART
1037 help
1038 Say Y here if you want the debug print routines to direct
1039 their output to the uart1 port on SiRFATLAS7 devices.
994 1040
995 config STIH41X_DEBUG_ASC2 1041 config STIH41X_DEBUG_ASC2
996 bool "Use StiH415/416 ASC2 UART for low-level debug" 1042 bool "Use StiH415/416 ASC2 UART for low-level debug"
@@ -1038,7 +1084,7 @@ choice
1038 for Mediatek mt6589 based platforms on UART0. 1084 for Mediatek mt6589 based platforms on UART0.
1039 1085
1040 config DEBUG_MT8127_UART0 1086 config DEBUG_MT8127_UART0
1041 bool "Mediatek mt8127 UART0" 1087 bool "Mediatek mt8127/mt6592 UART0"
1042 depends on ARCH_MEDIATEK 1088 depends on ARCH_MEDIATEK
1043 select DEBUG_UART_8250 1089 select DEBUG_UART_8250
1044 help 1090 help
@@ -1165,6 +1211,10 @@ choice
1165 1211
1166endchoice 1212endchoice
1167 1213
1214config DEBUG_AT91_UART
1215 bool
1216 depends on ARCH_AT91
1217
1168config DEBUG_EXYNOS_UART 1218config DEBUG_EXYNOS_UART
1169 bool 1219 bool
1170 1220
@@ -1217,12 +1267,15 @@ config DEBUG_STI_UART
1217 bool 1267 bool
1218 depends on ARCH_STI 1268 depends on ARCH_STI
1219 1269
1270config DEBUG_SIRFSOC_UART
1271 bool
1272 depends on ARCH_SIRF
1273
1220config DEBUG_LL_INCLUDE 1274config DEBUG_LL_INCLUDE
1221 string 1275 string
1222 default "debug/sa1100.S" if DEBUG_SA1100 1276 default "debug/sa1100.S" if DEBUG_SA1100
1223 default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250 1277 default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
1224 default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \ 1278 default "debug/at91.S" if DEBUG_AT91_UART
1225 AT91_DEBUG_LL_DBGU2
1226 default "debug/asm9260.S" if DEBUG_ASM9260_UART 1279 default "debug/asm9260.S" if DEBUG_ASM9260_UART
1227 default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2 1280 default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2
1228 default "debug/meson.S" if DEBUG_MESON_UARTAO 1281 default "debug/meson.S" if DEBUG_MESON_UARTAO
@@ -1255,7 +1308,7 @@ config DEBUG_LL_INCLUDE
1255 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4 1308 default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4
1256 default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART 1309 default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART
1257 default "debug/s5pv210.S" if DEBUG_S5PV210_UART 1310 default "debug/s5pv210.S" if DEBUG_S5PV210_UART
1258 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 1311 default "debug/sirf.S" if DEBUG_SIRFSOC_UART
1259 default "debug/sti.S" if DEBUG_STI_UART 1312 default "debug/sti.S" if DEBUG_STI_UART
1260 default "debug/tegra.S" if DEBUG_TEGRA_UART 1313 default "debug/tegra.S" if DEBUG_TEGRA_UART
1261 default "debug/ux500.S" if DEBUG_UX500_UART 1314 default "debug/ux500.S" if DEBUG_UX500_UART
@@ -1264,6 +1317,7 @@ config DEBUG_LL_INCLUDE
1264 default "debug/vt8500.S" if DEBUG_VT8500_UART0 1317 default "debug/vt8500.S" if DEBUG_VT8500_UART0
1265 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 1318 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
1266 default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX 1319 default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX
1320 default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0
1267 default "mach/debug-macro.S" 1321 default "mach/debug-macro.S"
1268 1322
1269# Compatibility options for PL01x 1323# Compatibility options for PL01x
@@ -1307,7 +1361,10 @@ config DEBUG_UART_PHYS
1307 default 0x11009000 if DEBUG_MT8135_UART3 1361 default 0x11009000 if DEBUG_MT8135_UART3
1308 default 0x16000000 if ARCH_INTEGRATOR 1362 default 0x16000000 if ARCH_INTEGRATOR
1309 default 0x18000300 if DEBUG_BCM_5301X 1363 default 0x18000300 if DEBUG_BCM_5301X
1364 default 0x18010000 if DEBUG_SIRFATLAS7_UART0
1365 default 0x18020000 if DEBUG_SIRFATLAS7_UART1
1310 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1 1366 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
1367 default 0x20001000 if DEBUG_HIP01_UART
1311 default 0x20060000 if DEBUG_RK29_UART0 1368 default 0x20060000 if DEBUG_RK29_UART0
1312 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 1369 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
1313 default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 1370 default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3
@@ -1332,12 +1389,13 @@ config DEBUG_UART_PHYS
1332 default 0x808c0000 if ARCH_EP93XX 1389 default 0x808c0000 if ARCH_EP93XX
1333 default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART 1390 default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
1334 default 0xa9a00000 if DEBUG_MSM_UART 1391 default 0xa9a00000 if DEBUG_MSM_UART
1392 default 0xb0060000 if DEBUG_SIRFPRIMA2_UART1
1335 default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX 1393 default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX
1336 default 0xc0013000 if DEBUG_U300_UART 1394 default 0xc0013000 if DEBUG_U300_UART
1337 default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 1395 default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
1338 default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN 1396 default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
1339 default 0xd0000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX 1397 default 0xd0000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
1340 default 0xd0012000 if DEBUG_MVEBU_UART 1398 default 0xd0012000 if DEBUG_MVEBU_UART0
1341 default 0xc81004c0 if DEBUG_MESON_UARTAO 1399 default 0xc81004c0 if DEBUG_MESON_UARTAO
1342 default 0xd4017000 if DEBUG_MMP_UART2 1400 default 0xd4017000 if DEBUG_MMP_UART2
1343 default 0xd4018000 if DEBUG_MMP_UART3 1401 default 0xd4018000 if DEBUG_MMP_UART3
@@ -1351,7 +1409,8 @@ config DEBUG_UART_PHYS
1351 default 0xe8008000 if DEBUG_R7S72100_SCIF2 1409 default 0xe8008000 if DEBUG_R7S72100_SCIF2
1352 default 0xf0000be0 if ARCH_EBSA110 1410 default 0xf0000be0 if ARCH_EBSA110
1353 default 0xf040ab00 if DEBUG_BRCMSTB_UART 1411 default 0xf040ab00 if DEBUG_BRCMSTB_UART
1354 default 0xf1012000 if DEBUG_MVEBU_UART_ALTERNATE 1412 default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
1413 default 0xf1012100 if DEBUG_MVEBU_UART1_ALTERNATE
1355 default 0xf1012000 if ARCH_DOVE || ARCH_MV78XX0 || \ 1414 default 0xf1012000 if ARCH_DOVE || ARCH_MV78XX0 || \
1356 ARCH_ORION5X 1415 ARCH_ORION5X
1357 default 0xf7fc9000 if DEBUG_BERLIN_UART 1416 default 0xf7fc9000 if DEBUG_BERLIN_UART
@@ -1380,7 +1439,8 @@ config DEBUG_UART_PHYS
1380 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \ 1439 DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
1381 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \ 1440 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
1382 DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \ 1441 DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
1383 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART 1442 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
1443 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
1384 1444
1385config DEBUG_UART_VIRT 1445config DEBUG_UART_VIRT
1386 hex "Virtual base address of debug UART" 1446 hex "Virtual base address of debug UART"
@@ -1438,8 +1498,12 @@ config DEBUG_UART_VIRT
1438 default 0xfeb30c00 if DEBUG_KEYSTONE_UART0 1498 default 0xfeb30c00 if DEBUG_KEYSTONE_UART0
1439 default 0xfeb31000 if DEBUG_KEYSTONE_UART1 1499 default 0xfeb31000 if DEBUG_KEYSTONE_UART1
1440 default 0xfec02000 if DEBUG_SOCFPGA_UART 1500 default 0xfec02000 if DEBUG_SOCFPGA_UART
1441 default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE 1501 default 0xfec12000 if DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE
1502 default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE
1503 default 0xfec10000 if DEBUG_SIRFATLAS7_UART0
1442 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0 1504 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0
1505 default 0xfec20000 if DEBUG_SIRFATLAS7_UART1
1506 default 0xfec60000 if DEBUG_SIRFPRIMA2_UART1
1443 default 0xfec90000 if DEBUG_RK32_UART2 1507 default 0xfec90000 if DEBUG_RK32_UART2
1444 default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1 1508 default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1
1445 default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2 1509 default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2
@@ -1458,12 +1522,14 @@ config DEBUG_UART_VIRT
1458 default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3 1522 default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3
1459 default 0xfefff700 if ARCH_IOP33X 1523 default 0xfefff700 if ARCH_IOP33X
1460 default 0xff003000 if DEBUG_U300_UART 1524 default 0xff003000 if DEBUG_U300_UART
1525 default 0xffd01000 if DEBUG_HIP01_UART
1461 default DEBUG_UART_PHYS if !MMU 1526 default DEBUG_UART_PHYS if !MMU
1462 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ 1527 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
1463 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ 1528 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
1464 DEBUG_MSM_UART || DEBUG_NETX_UART || \ 1529 DEBUG_MSM_UART || DEBUG_NETX_UART || \
1465 DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \ 1530 DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
1466 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART 1531 DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
1532 DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
1467 1533
1468config DEBUG_UART_8250_SHIFT 1534config DEBUG_UART_8250_SHIFT
1469 int "Register offset shift for the 8250 debug UART" 1535 int "Register offset shift for the 8250 debug UART"
diff --git a/arch/arm/boot/dts/at91rm9200.dtsi b/arch/arm/boot/dts/at91rm9200.dtsi
index 6c97d4af61ee..21c2b504f977 100644
--- a/arch/arm/boot/dts/at91rm9200.dtsi
+++ b/arch/arm/boot/dts/at91rm9200.dtsi
@@ -66,6 +66,11 @@
66 }; 66 };
67 }; 67 };
68 68
69 sram: sram@00200000 {
70 compatible = "mmio-sram";
71 reg = <0x00200000 0x4000>;
72 };
73
69 ahb { 74 ahb {
70 compatible = "simple-bus"; 75 compatible = "simple-bus";
71 #address-cells = <1>; 76 #address-cells = <1>;
@@ -356,6 +361,13 @@
356 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; 361 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
357 }; 362 };
358 363
364 rtc: rtc@fffffe00 {
365 compatible = "atmel,at91rm9200-rtc";
366 reg = <0xfffffe00 0x40>;
367 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
368 status = "disabled";
369 };
370
359 tcb0: timer@fffa0000 { 371 tcb0: timer@fffa0000 {
360 compatible = "atmel,at91rm9200-tcb"; 372 compatible = "atmel,at91rm9200-tcb";
361 reg = <0xfffa0000 0x100>; 373 reg = <0xfffa0000 0x100>;
diff --git a/arch/arm/boot/dts/at91rm9200ek.dts b/arch/arm/boot/dts/at91rm9200ek.dts
index 43eb779dd6f6..2a5d21247d7e 100644
--- a/arch/arm/boot/dts/at91rm9200ek.dts
+++ b/arch/arm/boot/dts/at91rm9200ek.dts
@@ -77,6 +77,10 @@
77 dbgu: serial@fffff200 { 77 dbgu: serial@fffff200 {
78 status = "okay"; 78 status = "okay";
79 }; 79 };
80
81 rtc: rtc@fffffe00 {
82 status = "okay";
83 };
80 }; 84 };
81 85
82 usb0: ohci@00300000 { 86 usb0: ohci@00300000 {
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index dd1313cbc314..fff0ee69aab4 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -69,6 +69,11 @@
69 }; 69 };
70 }; 70 };
71 71
72 sram0: sram@002ff000 {
73 compatible = "mmio-sram";
74 reg = <0x002ff000 0x2000>;
75 };
76
72 ahb { 77 ahb {
73 compatible = "simple-bus"; 78 compatible = "simple-bus";
74 #address-cells = <1>; 79 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi
index cdb9ed612109..e247b0b5fdab 100644
--- a/arch/arm/boot/dts/at91sam9261.dtsi
+++ b/arch/arm/boot/dts/at91sam9261.dtsi
@@ -60,6 +60,11 @@
60 }; 60 };
61 }; 61 };
62 62
63 sram: sram@00300000 {
64 compatible = "mmio-sram";
65 reg = <0x00300000 0x28000>;
66 };
67
63 ahb { 68 ahb {
64 compatible = "simple-bus"; 69 compatible = "simple-bus";
65 #address-cells = <1>; 70 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index e8c6c600a5b6..e087a93bea26 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -62,6 +62,16 @@
62 }; 62 };
63 }; 63 };
64 64
65 sram0: sram@00300000 {
66 compatible = "mmio-sram";
67 reg = <0x00300000 0x14000>;
68 };
69
70 sram1: sram@00500000 {
71 compatible = "mmio-sram";
72 reg = <0x00300000 0x4000>;
73 };
74
65 ahb { 75 ahb {
66 compatible = "simple-bus"; 76 compatible = "simple-bus";
67 #address-cells = <1>; 77 #address-cells = <1>;
@@ -294,7 +304,7 @@
294 reg = <17>; 304 reg = <17>;
295 }; 305 };
296 306
297 ac91_clk: ac97_clk { 307 ac97_clk: ac97_clk {
298 #clock-cells = <0>; 308 #clock-cells = <0>;
299 reg = <18>; 309 reg = <18>;
300 }; 310 };
diff --git a/arch/arm/boot/dts/at91sam9g20.dtsi b/arch/arm/boot/dts/at91sam9g20.dtsi
index a50ee587a7af..f59301618163 100644
--- a/arch/arm/boot/dts/at91sam9g20.dtsi
+++ b/arch/arm/boot/dts/at91sam9g20.dtsi
@@ -16,6 +16,15 @@
16 reg = <0x20000000 0x08000000>; 16 reg = <0x20000000 0x08000000>;
17 }; 17 };
18 18
19 sram0: sram@002ff000 {
20 status = "disabled";
21 };
22
23 sram1: sram@002fc000 {
24 compatible = "mmio-sram";
25 reg = <0x002fc000 0x8000>;
26 };
27
19 ahb { 28 ahb {
20 apb { 29 apb {
21 i2c0: i2c@fffac000 { 30 i2c0: i2c@fffac000 {
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 2a8da8a884b4..ee80aa9c0759 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -74,6 +74,11 @@
74 }; 74 };
75 }; 75 };
76 76
77 sram: sram@00300000 {
78 compatible = "mmio-sram";
79 reg = <0x00300000 0x10000>;
80 };
81
77 ahb { 82 ahb {
78 compatible = "simple-bus"; 83 compatible = "simple-bus";
79 #address-cells = <1>; 84 #address-cells = <1>;
@@ -1287,7 +1292,6 @@
1287 compatible = "atmel,at91rm9200-ohci", "usb-ohci"; 1292 compatible = "atmel,at91rm9200-ohci", "usb-ohci";
1288 reg = <0x00700000 0x100000>; 1293 reg = <0x00700000 0x100000>;
1289 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; 1294 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
1290 //TODO
1291 clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; 1295 clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
1292 clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck"; 1296 clock-names = "usb_clk", "ohci_clk", "hclk", "uhpck";
1293 status = "disabled"; 1297 status = "disabled";
@@ -1297,7 +1301,6 @@
1297 compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; 1301 compatible = "atmel,at91sam9g45-ehci", "usb-ehci";
1298 reg = <0x00800000 0x100000>; 1302 reg = <0x00800000 0x100000>;
1299 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; 1303 interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>;
1300 //TODO
1301 clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; 1304 clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
1302 clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck"; 1305 clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck";
1303 status = "disabled"; 1306 status = "disabled";
diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi
index 68eb9aded164..c2666a7cb5b1 100644
--- a/arch/arm/boot/dts/at91sam9n12.dtsi
+++ b/arch/arm/boot/dts/at91sam9n12.dtsi
@@ -64,6 +64,11 @@
64 }; 64 };
65 }; 65 };
66 66
67 sram: sram@00300000 {
68 compatible = "mmio-sram";
69 reg = <0x00300000 0x8000>;
70 };
71
67 ahb { 72 ahb {
68 compatible = "simple-bus"; 73 compatible = "simple-bus";
69 #address-cells = <1>; 74 #address-cells = <1>;
@@ -893,6 +898,13 @@
893 status = "disabled"; 898 status = "disabled";
894 }; 899 };
895 900
901 rtc@fffffeb0 {
902 compatible = "atmel,at91rm9200-rtc";
903 reg = <0xfffffeb0 0x40>;
904 interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
905 status = "disabled";
906 };
907
896 pwm0: pwm@f8034000 { 908 pwm0: pwm@f8034000 {
897 compatible = "atmel,at91sam9rl-pwm"; 909 compatible = "atmel,at91sam9rl-pwm";
898 reg = <0xf8034000 0x300>; 910 reg = <0xf8034000 0x300>;
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi
index 72424371413e..40f645b8fe25 100644
--- a/arch/arm/boot/dts/at91sam9rl.dtsi
+++ b/arch/arm/boot/dts/at91sam9rl.dtsi
@@ -70,6 +70,11 @@
70 }; 70 };
71 }; 71 };
72 72
73 sram: sram@00300000 {
74 compatible = "mmio-sram";
75 reg = <0x00300000 0x10000>;
76 };
77
73 ahb { 78 ahb {
74 compatible = "simple-bus"; 79 compatible = "simple-bus";
75 #address-cells = <1>; 80 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index bbb3ba65165f..818dabdd8c0e 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -72,6 +72,11 @@
72 }; 72 };
73 }; 73 };
74 74
75 sram: sram@00300000 {
76 compatible = "mmio-sram";
77 reg = <0x00300000 0x8000>;
78 };
79
75 ahb { 80 ahb {
76 compatible = "simple-bus"; 81 compatible = "simple-bus";
77 #address-cells = <1>; 82 #address-cells = <1>;
diff --git a/arch/arm/boot/dts/at91sam9xe.dtsi b/arch/arm/boot/dts/at91sam9xe.dtsi
new file mode 100644
index 000000000000..0278f63b2daf
--- /dev/null
+++ b/arch/arm/boot/dts/at91sam9xe.dtsi
@@ -0,0 +1,60 @@
1/*
2 * at91sam9xe.dtsi - Device Tree Include file for AT91SAM9XE family SoC
3 *
4 * Copyright (C) 2015 Atmel,
5 * 2015 Alexandre Belloni <alexandre.Belloni@free-electrons.com>
6 *
7 * This file is dual-licensed: you can use it either under the terms
8 * of the GPL or the X11 license, at your option. Note that this dual
9 * licensing only applies to this file, and not this project as a
10 * whole.
11 *
12 * a) This file is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
16 *
17 * This file is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * Or, alternatively,
23 *
24 * b) Permission is hereby granted, free of charge, to any person
25 * obtaining a copy of this software and associated documentation
26 * files (the "Software"), to deal in the Software without
27 * restriction, including without limitation the rights to use,
28 * copy, modify, merge, publish, distribute, sublicense, and/or
29 * sell copies of the Software, and to permit persons to whom the
30 * Software is furnished to do so, subject to the following
31 * conditions:
32 *
33 * The above copyright notice and this permission notice shall be
34 * included in all copies or substantial portions of the Software.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43 * OTHER DEALINGS IN THE SOFTWARE.
44 */
45
46#include "at91sam9260.dtsi"
47
48/ {
49 model = "Atmel AT91SAM9XE family SoC";
50 compatible = "atmel,at91sam9xe", "atmel,at91sam9260";
51
52 sram0: sram@002ff000 {
53 status = "disabled";
54 };
55
56 sram1: sram@00300000 {
57 compatible = "mmio-sram";
58 reg = <0x00300000 0x4000>;
59 };
60};
diff --git a/arch/arm/boot/dts/ethernut5.dts b/arch/arm/boot/dts/ethernut5.dts
index 8f941c2db7c6..243044343ee8 100644
--- a/arch/arm/boot/dts/ethernut5.dts
+++ b/arch/arm/boot/dts/ethernut5.dts
@@ -6,7 +6,7 @@
6 * Licensed under GPLv2. 6 * Licensed under GPLv2.
7 */ 7 */
8/dts-v1/; 8/dts-v1/;
9#include "at91sam9260.dtsi" 9#include "at91sam9xe.dtsi"
10 10
11/ { 11/ {
12 model = "Ethernut 5"; 12 model = "Ethernut 5";
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index 5f4144d1e3a1..261311bdf65b 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -78,6 +78,11 @@
78 }; 78 };
79 }; 79 };
80 80
81 sram: sram@00300000 {
82 compatible = "mmio-sram";
83 reg = <0x00300000 0x20000>;
84 };
85
81 ahb { 86 ahb {
82 compatible = "simple-bus"; 87 compatible = "simple-bus";
83 #address-cells = <1>; 88 #address-cells = <1>;
@@ -214,7 +219,20 @@
214 compatible = "atmel,at91sam9g45-isi"; 219 compatible = "atmel,at91sam9g45-isi";
215 reg = <0xf0034000 0x4000>; 220 reg = <0xf0034000 0x4000>;
216 interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>; 221 interrupts = <37 IRQ_TYPE_LEVEL_HIGH 5>;
222 pinctrl-names = "default";
223 pinctrl-0 = <&pinctrl_isi_data_0_7>;
224 clocks = <&isi_clk>;
225 clock-names = "isi_clk";
217 status = "disabled"; 226 status = "disabled";
227 port {
228 #address-cells = <1>;
229 #size-cells = <0>;
230 };
231 };
232
233 sfr: sfr@f0038000 {
234 compatible = "atmel,sama5d3-sfr", "syscon";
235 reg = <0xf0038000 0x60>;
218 }; 236 };
219 237
220 mmc1: mmc@f8000000 { 238 mmc1: mmc@f8000000 {
@@ -545,7 +563,7 @@
545 }; 563 };
546 564
547 isi { 565 isi {
548 pinctrl_isi: isi-0 { 566 pinctrl_isi_data_0_7: isi-0-data-0-7 {
549 atmel,pins = 567 atmel,pins =
550 <AT91_PIOA 16 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA16 periph C ISI_D0, conflicts with LCDDAT16 */ 568 <AT91_PIOA 16 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA16 periph C ISI_D0, conflicts with LCDDAT16 */
551 AT91_PIOA 17 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA17 periph C ISI_D1, conflicts with LCDDAT17 */ 569 AT91_PIOA 17 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA17 periph C ISI_D1, conflicts with LCDDAT17 */
@@ -557,13 +575,19 @@
557 AT91_PIOA 23 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA23 periph C ISI_D7, conflicts with LCDDAT23, PWML1 */ 575 AT91_PIOA 23 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA23 periph C ISI_D7, conflicts with LCDDAT23, PWML1 */
558 AT91_PIOC 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC30 periph C ISI_PCK, conflicts with UTXD0 */ 576 AT91_PIOC 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC30 periph C ISI_PCK, conflicts with UTXD0 */
559 AT91_PIOA 31 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA31 periph C ISI_HSYNC, conflicts with TWCK0, UTXD1 */ 577 AT91_PIOA 31 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA31 periph C ISI_HSYNC, conflicts with TWCK0, UTXD1 */
560 AT91_PIOA 30 AT91_PERIPH_C AT91_PINCTRL_NONE /* PA30 periph C ISI_VSYNC, conflicts with TWD0, URXD1 */ 578 AT91_PIOA 30 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PA30 periph C ISI_VSYNC, conflicts with TWD0, URXD1 */
561 AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC29 periph C ISI_PD8, conflicts with URXD0, PWMFI2 */ 579 };
580
581 pinctrl_isi_data_8_9: isi-0-data-8-9 {
582 atmel,pins =
583 <AT91_PIOC 29 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC29 periph C ISI_PD8, conflicts with URXD0, PWMFI2 */
562 AT91_PIOC 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC28 periph C ISI_PD9, conflicts with SPI1_NPCS3, PWMFI0 */ 584 AT91_PIOC 28 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC28 periph C ISI_PD9, conflicts with SPI1_NPCS3, PWMFI0 */
563 }; 585 };
564 pinctrl_isi_pck_as_mck: isi_pck_as_mck-0 { 586
587 pinctrl_isi_data_10_11: isi-0-data-10-11 {
565 atmel,pins = 588 atmel,pins =
566 <AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD31 periph B ISI_MCK */ 589 <AT91_PIOC 27 AT91_PERIPH_C AT91_PINCTRL_NONE /* PC27 periph C ISI_PD10, conflicts with SPI1_NPCS2, TWCK1 */
590 AT91_PIOC 26 AT91_PERIPH_C AT91_PINCTRL_NONE>; /* PC26 periph C ISI_PD11, conflicts with SPI1_NPCS1, TWD1 */
567 }; 591 };
568 }; 592 };
569 593
diff --git a/arch/arm/boot/dts/sama5d3xcm.dtsi b/arch/arm/boot/dts/sama5d3xcm.dtsi
index cfcd200b0c17..7d6babdab039 100644
--- a/arch/arm/boot/dts/sama5d3xcm.dtsi
+++ b/arch/arm/boot/dts/sama5d3xcm.dtsi
@@ -122,6 +122,7 @@
122 d2 { 122 d2 {
123 label = "d2"; 123 label = "d2";
124 gpios = <&pioE 25 GPIO_ACTIVE_LOW>; /* PE25, conflicts with A25, RXD2 */ 124 gpios = <&pioE 25 GPIO_ACTIVE_LOW>; /* PE25, conflicts with A25, RXD2 */
125 linux,default-trigger = "heartbeat";
125 }; 126 };
126 }; 127 };
127}; 128};
diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi
index 77e03655aca3..be2ccc53abb5 100644
--- a/arch/arm/boot/dts/sama5d3xmb.dtsi
+++ b/arch/arm/boot/dts/sama5d3xmb.dtsi
@@ -52,6 +52,29 @@
52 }; 52 };
53 }; 53 };
54 54
55 i2c1: i2c@f0018000 {
56 ov2640: camera@0x30 {
57 compatible = "ovti,ov2640";
58 reg = <0x30>;
59 pinctrl-names = "default";
60 pinctrl-0 = <&pinctrl_pck1_as_isi_mck &pinctrl_sensor_power &pinctrl_sensor_reset>;
61 resetb-gpios = <&pioE 24 GPIO_ACTIVE_LOW>;
62 pwdn-gpios = <&pioE 29 GPIO_ACTIVE_HIGH>;
63 /* use pck1 for the master clock of ov2640 */
64 clocks = <&pck1>;
65 clock-names = "xvclk";
66 assigned-clocks = <&pck1>;
67 assigned-clock-rates = <25000000>;
68
69 port {
70 ov2640_0: endpoint {
71 remote-endpoint = <&isi_0>;
72 bus-width = <8>;
73 };
74 };
75 };
76 };
77
55 usart1: serial@f0020000 { 78 usart1: serial@f0020000 {
56 dmas = <0>, <0>; /* Do not use DMA for usart1 */ 79 dmas = <0>, <0>; /* Do not use DMA for usart1 */
57 pinctrl-names = "default"; 80 pinctrl-names = "default";
@@ -60,8 +83,12 @@
60 }; 83 };
61 84
62 isi: isi@f0034000 { 85 isi: isi@f0034000 {
63 pinctrl-names = "default"; 86 port {
64 pinctrl-0 = <&pinctrl_isi &pinctrl_isi_pck_as_mck &pinctrl_isi_power &pinctrl_isi_reset>; 87 isi_0: endpoint {
88 remote-endpoint = <&ov2640_0>;
89 bus-width = <8>;
90 };
91 };
65 }; 92 };
66 93
67 mmc1: mmc@f8000000 { 94 mmc1: mmc@f8000000 {
@@ -117,12 +144,17 @@
117 <AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD30 periph B */ 144 <AT91_PIOD 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD30 periph B */
118 }; 145 };
119 146
120 pinctrl_isi_reset: isi_reset-0 { 147 pinctrl_pck1_as_isi_mck: pck1_as_isi_mck-0 {
148 atmel,pins =
149 <AT91_PIOD 31 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PD31 periph B ISI_MCK */
150 };
151
152 pinctrl_sensor_reset: sensor_reset-0 {
121 atmel,pins = 153 atmel,pins =
122 <AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE24 gpio */ 154 <AT91_PIOE 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE24 gpio */
123 }; 155 };
124 156
125 pinctrl_isi_power: isi_power-0 { 157 pinctrl_sensor_power: sensor_power-0 {
126 atmel,pins = 158 atmel,pins =
127 <AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE29 gpio */ 159 <AT91_PIOE 29 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; /* PE29 gpio */
128 }; 160 };
diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi
index b94995d1889f..2a31d66164ac 100644
--- a/arch/arm/boot/dts/sama5d4.dtsi
+++ b/arch/arm/boot/dts/sama5d4.dtsi
@@ -103,6 +103,11 @@
103 }; 103 };
104 }; 104 };
105 105
106 ns_sram: sram@00210000 {
107 compatible = "mmio-sram";
108 reg = <0x00210000 0x10000>;
109 };
110
106 ahb { 111 ahb {
107 compatible = "simple-bus"; 112 compatible = "simple-bus";
108 #address-cells = <1>; 113 #address-cells = <1>;
@@ -870,6 +875,11 @@
870 status = "disabled"; 875 status = "disabled";
871 }; 876 };
872 877
878 sfr: sfr@f8028000 {
879 compatible = "atmel,sama5d4-sfr", "syscon";
880 reg = <0xf8028000 0x60>;
881 };
882
873 mmc1: mmc@fc000000 { 883 mmc1: mmc@fc000000 {
874 compatible = "atmel,hsmci"; 884 compatible = "atmel,hsmci";
875 reg = <0xfc000000 0x600>; 885 reg = <0xfc000000 0x600>;
diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
index 4eb540be368f..dbfaba09703a 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
@@ -1673,6 +1673,13 @@
1673 nvidia,core-pwr-off-time = <61036>; 1673 nvidia,core-pwr-off-time = <61036>;
1674 nvidia,core-power-req-active-high; 1674 nvidia,core-power-req-active-high;
1675 nvidia,sys-clock-req-active-high; 1675 nvidia,sys-clock-req-active-high;
1676
1677 i2c-thermtrip {
1678 nvidia,i2c-controller-id = <4>;
1679 nvidia,bus-addr = <0x40>;
1680 nvidia,reg-addr = <0x36>;
1681 nvidia,reg-data = <0x2>;
1682 };
1676 }; 1683 };
1677 1684
1678 /* Serial ATA */ 1685 /* Serial ATA */
diff --git a/arch/arm/configs/at91_dt_defconfig b/arch/arm/configs/at91_dt_defconfig
index a67375f24b21..f2670f638e97 100644
--- a/arch/arm/configs/at91_dt_defconfig
+++ b/arch/arm/configs/at91_dt_defconfig
@@ -15,15 +15,7 @@ CONFIG_MODULE_UNLOAD=y
15# CONFIG_IOSCHED_CFQ is not set 15# CONFIG_IOSCHED_CFQ is not set
16CONFIG_ARCH_AT91=y 16CONFIG_ARCH_AT91=y
17CONFIG_SOC_AT91RM9200=y 17CONFIG_SOC_AT91RM9200=y
18CONFIG_SOC_AT91SAM9260=y 18CONFIG_SOC_AT91SAM9=y
19CONFIG_SOC_AT91SAM9261=y
20CONFIG_SOC_AT91SAM9263=y
21CONFIG_SOC_AT91SAM9RL=y
22CONFIG_SOC_AT91SAM9G45=y
23CONFIG_SOC_AT91SAM9X5=y
24CONFIG_SOC_AT91SAM9N12=y
25CONFIG_MACH_AT91RM9200_DT=y
26CONFIG_MACH_AT91SAM9_DT=y
27CONFIG_AT91_TIMER_HZ=128 19CONFIG_AT91_TIMER_HZ=128
28CONFIG_AEABI=y 20CONFIG_AEABI=y
29CONFIG_UACCESS_WITH_MEMCPY=y 21CONFIG_UACCESS_WITH_MEMCPY=y
diff --git a/arch/arm/include/debug/digicolor.S b/arch/arm/include/debug/digicolor.S
new file mode 100644
index 000000000000..c9517150766a
--- /dev/null
+++ b/arch/arm/include/debug/digicolor.S
@@ -0,0 +1,35 @@
1/*
2 * Debugging macro include header for Conexant Digicolor USART
3 *
4 * Copyright (C) 2014 Paradox Innovation Ltd.
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
12#define UA0_STATUS 0x0742
13#define UA0_EMI_REC 0x0744
14
15#define UA0_STATUS_TX_READY 0x40
16
17#ifdef CONFIG_DEBUG_UART_PHYS
18 .macro addruart, rp, rv, tmp
19 ldr \rp, =CONFIG_DEBUG_UART_PHYS
20 ldr \rv, =CONFIG_DEBUG_UART_VIRT
21 .endm
22#endif
23
24 .macro senduart,rd,rx
25 strb \rd, [\rx, #UA0_EMI_REC]
26 .endm
27
28 .macro waituart,rd,rx
29 .endm
30
31 .macro busyuart,rd,rx
321001: ldrb \rd, [\rx, #UA0_STATUS]
33 tst \rd, #UA0_STATUS_TX_READY
34 beq 1001b
35 .endm
diff --git a/arch/arm/include/debug/msm.S b/arch/arm/include/debug/msm.S
index 9ef57612811d..e55a9426b496 100644
--- a/arch/arm/include/debug/msm.S
+++ b/arch/arm/include/debug/msm.S
@@ -23,6 +23,7 @@
23 .endm 23 .endm
24 24
25 .macro senduart, rd, rx 25 .macro senduart, rd, rx
26ARM_BE8(rev \rd, \rd )
26#ifdef CONFIG_DEBUG_QCOM_UARTDM 27#ifdef CONFIG_DEBUG_QCOM_UARTDM
27 @ Write the 1 character to UARTDM_TF 28 @ Write the 1 character to UARTDM_TF
28 str \rd, [\rx, #0x70] 29 str \rd, [\rx, #0x70]
@@ -35,24 +36,29 @@
35#ifdef CONFIG_DEBUG_QCOM_UARTDM 36#ifdef CONFIG_DEBUG_QCOM_UARTDM
36 @ check for TX_EMT in UARTDM_SR 37 @ check for TX_EMT in UARTDM_SR
37 ldr \rd, [\rx, #0x08] 38 ldr \rd, [\rx, #0x08]
39ARM_BE8(rev \rd, \rd )
38 tst \rd, #0x08 40 tst \rd, #0x08
39 bne 1002f 41 bne 1002f
40 @ wait for TXREADY in UARTDM_ISR 42 @ wait for TXREADY in UARTDM_ISR
411001: ldr \rd, [\rx, #0x14] 431001: ldr \rd, [\rx, #0x14]
44ARM_BE8(rev \rd, \rd )
42 tst \rd, #0x80 45 tst \rd, #0x80
43 beq 1001b 46 beq 1001b
441002: 471002:
45 @ Clear TX_READY by writing to the UARTDM_CR register 48 @ Clear TX_READY by writing to the UARTDM_CR register
46 mov \rd, #0x300 49 mov \rd, #0x300
50ARM_BE8(rev \rd, \rd )
47 str \rd, [\rx, #0x10] 51 str \rd, [\rx, #0x10]
48 @ Write 0x1 to NCF register 52 @ Write 0x1 to NCF register
49 mov \rd, #0x1 53 mov \rd, #0x1
54ARM_BE8(rev \rd, \rd )
50 str \rd, [\rx, #0x40] 55 str \rd, [\rx, #0x40]
51 @ UARTDM reg. Read to induce delay 56 @ UARTDM reg. Read to induce delay
52 ldr \rd, [\rx, #0x08] 57 ldr \rd, [\rx, #0x08]
53#else 58#else
54 @ wait for TX_READY 59 @ wait for TX_READY
551001: ldr \rd, [\rx, #0x08] 601001: ldr \rd, [\rx, #0x08]
61ARM_BE8(rev \rd, \rd )
56 tst \rd, #0x04 62 tst \rd, #0x04
57 beq 1001b 63 beq 1001b
58#endif 64#endif
diff --git a/arch/arm/include/debug/sirf.S b/arch/arm/include/debug/sirf.S
index dbf250cf18e6..630f231f2f37 100644
--- a/arch/arm/include/debug/sirf.S
+++ b/arch/arm/include/debug/sirf.S
@@ -6,37 +6,33 @@
6 * Licensed under GPLv2 or later. 6 * Licensed under GPLv2 or later.
7 */ 7 */
8 8
9#if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1) 9#define SIRF_LLUART_TXFIFO_STATUS 0x0114
10#define SIRFSOC_UART1_PA_BASE 0xb0060000 10#define SIRF_LLUART_TXFIFO_DATA 0x0118
11#elif defined(CONFIG_DEBUG_SIRFMARCO_UART1)
12#define SIRFSOC_UART1_PA_BASE 0xcc060000
13#else
14#define SIRFSOC_UART1_PA_BASE 0
15#endif
16 11
17#define SIRFSOC_UART1_VA_BASE 0xFEC60000 12#define SIRF_LLUART_TXFIFO_FULL (1 << 5)
18 13
19#define SIRFSOC_UART_TXFIFO_STATUS 0x0114 14#ifdef CONFIG_DEBUG_SIRFATLAS7_UART0
20#define SIRFSOC_UART_TXFIFO_DATA 0x0118 15#define SIRF_LLUART_TXFIFO_EMPTY (1 << 8)
16#else
17#define SIRF_LLUART_TXFIFO_EMPTY (1 << 6)
18#endif
21 19
22#define SIRFSOC_UART1_TXFIFO_FULL (1 << 5)
23#define SIRFSOC_UART1_TXFIFO_EMPTY (1 << 6)
24 20
25 .macro addruart, rp, rv, tmp 21 .macro addruart, rp, rv, tmp
26 ldr \rp, =SIRFSOC_UART1_PA_BASE @ physical 22 ldr \rp, =CONFIG_DEBUG_UART_PHYS @ physical
27 ldr \rv, =SIRFSOC_UART1_VA_BASE @ virtual 23 ldr \rv, =CONFIG_DEBUG_UART_VIRT @ virtual
28 .endm 24 .endm
29 25
30 .macro senduart,rd,rx 26 .macro senduart,rd,rx
31 str \rd, [\rx, #SIRFSOC_UART_TXFIFO_DATA] 27 str \rd, [\rx, #SIRF_LLUART_TXFIFO_DATA]
32 .endm 28 .endm
33 29
34 .macro busyuart,rd,rx 30 .macro busyuart,rd,rx
35 .endm 31 .endm
36 32
37 .macro waituart,rd,rx 33 .macro waituart,rd,rx
381001: ldr \rd, [\rx, #SIRFSOC_UART_TXFIFO_STATUS] 341001: ldr \rd, [\rx, #SIRF_LLUART_TXFIFO_STATUS]
39 tst \rd, #SIRFSOC_UART1_TXFIFO_EMPTY 35 tst \rd, #SIRF_LLUART_TXFIFO_EMPTY
40 beq 1001b 36 beq 1001b
41 .endm 37 .endm
42 38
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index cec0fb5d621a..c6740e359a44 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -6,15 +6,6 @@ config HAVE_AT91_UTMI
6config HAVE_AT91_USB_CLK 6config HAVE_AT91_USB_CLK
7 bool 7 bool
8 8
9config HAVE_AT91_DBGU0
10 bool
11
12config HAVE_AT91_DBGU1
13 bool
14
15config HAVE_AT91_DBGU2
16 bool
17
18config COMMON_CLK_AT91 9config COMMON_CLK_AT91
19 bool 10 bool
20 select COMMON_CLK 11 select COMMON_CLK
@@ -25,15 +16,6 @@ config HAVE_AT91_SMD
25config HAVE_AT91_H32MX 16config HAVE_AT91_H32MX
26 bool 17 bool
27 18
28config SOC_AT91SAM9
29 bool
30 select ATMEL_AIC_IRQ
31 select COMMON_CLK_AT91
32 select CPU_ARM926T
33 select GENERIC_CLOCKEVENTS
34 select MEMORY
35 select ATMEL_SDRAMC
36
37config SOC_SAMA5 19config SOC_SAMA5
38 bool 20 bool
39 select ATMEL_AIC5_IRQ 21 select ATMEL_AIC5_IRQ
@@ -70,7 +52,6 @@ config SOC_SAMA5D3
70 bool "SAMA5D3 family" 52 bool "SAMA5D3 family"
71 select SOC_SAMA5 53 select SOC_SAMA5
72 select HAVE_FB_ATMEL 54 select HAVE_FB_ATMEL
73 select HAVE_AT91_DBGU1
74 select HAVE_AT91_UTMI 55 select HAVE_AT91_UTMI
75 select HAVE_AT91_SMD 56 select HAVE_AT91_SMD
76 select HAVE_AT91_USB_CLK 57 select HAVE_AT91_USB_CLK
@@ -81,7 +62,6 @@ config SOC_SAMA5D3
81config SOC_SAMA5D4 62config SOC_SAMA5D4
82 bool "SAMA5D4 family" 63 bool "SAMA5D4 family"
83 select SOC_SAMA5 64 select SOC_SAMA5
84 select HAVE_AT91_DBGU2
85 select CLKSRC_MMIO 65 select CLKSRC_MMIO
86 select CACHE_L2X0 66 select CACHE_L2X0
87 select CACHE_PL310 67 select CACHE_PL310
@@ -101,83 +81,45 @@ config SOC_AT91RM9200
101 select COMMON_CLK_AT91 81 select COMMON_CLK_AT91
102 select CPU_ARM920T 82 select CPU_ARM920T
103 select GENERIC_CLOCKEVENTS 83 select GENERIC_CLOCKEVENTS
104 select HAVE_AT91_DBGU0
105 select HAVE_AT91_USB_CLK
106
107config SOC_AT91SAM9260
108 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
109 select HAVE_AT91_DBGU0
110 select SOC_AT91SAM9
111 select HAVE_AT91_USB_CLK
112 help
113 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
114 or AT91SAM9G20 SoC.
115
116config SOC_AT91SAM9261
117 bool "AT91SAM9261 or AT91SAM9G10"
118 select HAVE_AT91_DBGU0
119 select HAVE_FB_ATMEL
120 select SOC_AT91SAM9
121 select HAVE_AT91_USB_CLK
122 help
123 Select this if you are using one of Atmel's AT91SAM9261 or AT91SAM9G10 SoC.
124
125config SOC_AT91SAM9263
126 bool "AT91SAM9263"
127 select HAVE_AT91_DBGU1
128 select HAVE_FB_ATMEL
129 select SOC_AT91SAM9
130 select HAVE_AT91_USB_CLK
131
132config SOC_AT91SAM9RL
133 bool "AT91SAM9RL"
134 select HAVE_AT91_DBGU0
135 select HAVE_FB_ATMEL
136 select SOC_AT91SAM9
137 select HAVE_AT91_UTMI
138
139config SOC_AT91SAM9G45
140 bool "AT91SAM9G45 or AT91SAM9M10 families"
141 select HAVE_AT91_DBGU1
142 select HAVE_FB_ATMEL
143 select SOC_AT91SAM9
144 select HAVE_AT91_UTMI
145 select HAVE_AT91_USB_CLK 84 select HAVE_AT91_USB_CLK
146 help
147 Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
148 This support covers AT91SAM9G45, AT91SAM9G46, AT91SAM9M10 and AT91SAM9M11.
149 85
150config SOC_AT91SAM9X5 86config SOC_AT91SAM9
151 bool "AT91SAM9x5 family" 87 bool "AT91SAM9"
152 select HAVE_AT91_DBGU0 88 select ATMEL_AIC_IRQ
153 select HAVE_FB_ATMEL 89 select ATMEL_SDRAMC
154 select SOC_AT91SAM9 90 select COMMON_CLK_AT91
155 select HAVE_AT91_UTMI 91 select CPU_ARM926T
92 select GENERIC_CLOCKEVENTS
156 select HAVE_AT91_SMD 93 select HAVE_AT91_SMD
157 select HAVE_AT91_USB_CLK 94 select HAVE_AT91_USB_CLK
158 help 95 select HAVE_AT91_UTMI
159 Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
160 This means that your SAM9 name finishes with a '5' (except if it is
161 AT91SAM9G45!).
162 This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35
163 and AT91SAM9X35.
164
165config SOC_AT91SAM9N12
166 bool "AT91SAM9N12 family"
167 select HAVE_AT91_DBGU0
168 select HAVE_FB_ATMEL 96 select HAVE_FB_ATMEL
169 select SOC_AT91SAM9 97 select MEMORY
170 select HAVE_AT91_USB_CLK
171 help 98 help
172 Select this if you are using Atmel's AT91SAM9N12 SoC. 99 Select this if you are using one of those Atmel SoC:
173 100 AT91SAM9260
174# ---------------------------------------------------------- 101 AT91SAM9261
102 AT91SAM9263
103 AT91SAM9G15
104 AT91SAM9G20
105 AT91SAM9G25
106 AT91SAM9G35
107 AT91SAM9G45
108 AT91SAM9G46
109 AT91SAM9M10
110 AT91SAM9M11
111 AT91SAM9N12
112 AT91SAM9RL
113 AT91SAM9X25
114 AT91SAM9X35
115 AT91SAM9XE
175endif # SOC_SAM_V4_V5 116endif # SOC_SAM_V4_V5
176 117
177comment "AT91 Feature Selections" 118comment "AT91 Feature Selections"
178 119
179config AT91_SLOW_CLOCK 120config AT91_SLOW_CLOCK
180 bool "Suspend-to-RAM disables main oscillator" 121 bool "Suspend-to-RAM disables main oscillator"
122 select SRAM
181 depends on SUSPEND 123 depends on SUSPEND
182 help 124 help
183 Select this if you want Suspend-to-RAM to save the most power 125 Select this if you want Suspend-to-RAM to save the most power
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 8ef7d9a2e855..827fdbcce1c7 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -8,22 +8,8 @@ obj-$(CONFIG_SOC_AT91SAM9) += sam9_smc.o
8 8
9# CPU-specific support 9# CPU-specific support
10obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o at91rm9200_time.o 10obj-$(CONFIG_SOC_AT91RM9200) += at91rm9200.o at91rm9200_time.o
11obj-$(CONFIG_SOC_AT91SAM9260) += at91sam9260.o 11obj-$(CONFIG_SOC_AT91SAM9) += at91sam9.o
12obj-$(CONFIG_SOC_AT91SAM9261) += at91sam9261.o 12obj-$(CONFIG_SOC_SAMA5) += sama5.o
13obj-$(CONFIG_SOC_AT91SAM9263) += at91sam9263.o
14obj-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45.o
15obj-$(CONFIG_SOC_AT91SAM9N12) += at91sam9n12.o
16obj-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5.o
17obj-$(CONFIG_SOC_AT91SAM9RL) += at91sam9rl.o
18obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o
19obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o
20
21# AT91SAM board with device-tree
22obj-$(CONFIG_SOC_AT91RM9200) += board-dt-rm9200.o
23obj-$(CONFIG_SOC_AT91SAM9) += board-dt-sam9.o
24
25# SAMA5 board with device-tree
26obj-$(CONFIG_SOC_SAMA5) += board-dt-sama5.o
27 13
28# Power Management 14# Power Management
29obj-$(CONFIG_PM) += pm.o 15obj-$(CONFIG_PM) += pm.o
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index b52916947535..8fcfb70f7124 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -1,35 +1,33 @@
1/* 1/*
2 * arch/arm/mach-at91/at91rm9200.c 2 * Setup code for AT91RM9200
3 * 3 *
4 * Copyright (C) 2005 SAN People 4 * Copyright (C) 2011 Atmel,
5 * 5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 * This program is free software; you can redistribute it and/or modify 6 * 2012 Joachim Eastwood <manabian@gmail.com>
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * 7 *
8 * Licensed under GPLv2 or later.
11 */ 9 */
12 10
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/clk/at91_pmc.h> 14#include <linux/gpio.h>
15#include <linux/of.h>
16#include <linux/of_irq.h>
17#include <linux/of_platform.h>
18#include <linux/clk-provider.h>
15 19
20#include <asm/setup.h>
21#include <asm/irq.h>
22#include <asm/mach/arch.h>
16#include <asm/mach/map.h> 23#include <asm/mach/map.h>
24#include <asm/mach/irq.h>
17#include <asm/system_misc.h> 25#include <asm/system_misc.h>
26
18#include <mach/at91_st.h> 27#include <mach/at91_st.h>
19#include <mach/hardware.h>
20 28
21#include "soc.h"
22#include "generic.h" 29#include "generic.h"
23 30
24static void at91rm9200_idle(void)
25{
26 /*
27 * Disable the processor clock. The processor will be automatically
28 * re-enabled by an interrupt or by a reset.
29 */
30 at91_pmc_write(AT91_PMC_SCDR, AT91_PMC_PCK);
31}
32
33static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd) 31static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
34{ 32{
35 /* 33 /*
@@ -39,23 +37,31 @@ static void at91rm9200_restart(enum reboot_mode reboot_mode, const char *cmd)
39 at91_st_write(AT91_ST_CR, AT91_ST_WDRST); 37 at91_st_write(AT91_ST_CR, AT91_ST_WDRST);
40} 38}
41 39
42/* -------------------------------------------------------------------- 40static void __init at91rm9200_dt_timer_init(void)
43 * AT91RM9200 processor initialization
44 * -------------------------------------------------------------------- */
45static void __init at91rm9200_map_io(void)
46{ 41{
47 /* Map peripherals */ 42 of_clk_init(NULL);
48 at91_init_sram(0, AT91RM9200_SRAM_BASE, AT91RM9200_SRAM_SIZE); 43 at91rm9200_timer_init();
49} 44}
50 45
51static void __init at91rm9200_initialize(void) 46static void __init at91rm9200_dt_device_init(void)
52{ 47{
48 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
49
53 arm_pm_idle = at91rm9200_idle; 50 arm_pm_idle = at91rm9200_idle;
54 arm_pm_restart = at91rm9200_restart; 51 arm_pm_restart = at91rm9200_restart;
52 at91rm9200_pm_init();
55} 53}
56 54
57 55
58AT91_SOC_START(at91rm9200) 56
59 .map_io = at91rm9200_map_io, 57static const char *at91rm9200_dt_board_compat[] __initconst = {
60 .init = at91rm9200_initialize, 58 "atmel,at91rm9200",
61AT91_SOC_END 59 NULL
60};
61
62DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200")
63 .init_time = at91rm9200_dt_timer_init,
64 .map_io = at91_map_io,
65 .init_machine = at91rm9200_dt_device_init,
66 .dt_compat = at91rm9200_dt_board_compat,
67MACHINE_END
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
new file mode 100644
index 000000000000..56e3ba73ec40
--- /dev/null
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -0,0 +1,87 @@
1/*
2 * Setup code for AT91SAM9
3 *
4 * Copyright (C) 2011 Atmel,
5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9
10#include <linux/types.h>
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/gpio.h>
14#include <linux/of.h>
15#include <linux/of_irq.h>
16#include <linux/of_platform.h>
17#include <linux/clk-provider.h>
18
19#include <asm/system_misc.h>
20#include <asm/setup.h>
21#include <asm/irq.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/map.h>
24#include <asm/mach/irq.h>
25
26#include "generic.h"
27
28static void __init at91sam9_dt_device_init(void)
29{
30 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
31
32 arm_pm_idle = at91sam9_idle;
33 at91sam9260_pm_init();
34}
35
36static const char *at91_dt_board_compat[] __initconst = {
37 "atmel,at91sam9",
38 NULL
39};
40
41DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9")
42 /* Maintainer: Atmel */
43 .map_io = at91_map_io,
44 .init_machine = at91sam9_dt_device_init,
45 .dt_compat = at91_dt_board_compat,
46MACHINE_END
47
48static void __init at91sam9g45_dt_device_init(void)
49{
50 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
51
52 arm_pm_idle = at91sam9_idle;
53 at91sam9g45_pm_init();
54}
55
56static const char *at91sam9g45_board_compat[] __initconst = {
57 "atmel,at91sam9g45",
58 NULL
59};
60
61DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
62 /* Maintainer: Atmel */
63 .map_io = at91_map_io,
64 .init_machine = at91sam9g45_dt_device_init,
65 .dt_compat = at91sam9g45_board_compat,
66MACHINE_END
67
68static void __init at91sam9x5_dt_device_init(void)
69{
70 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
71
72 arm_pm_idle = at91sam9_idle;
73 at91sam9x5_pm_init();
74}
75
76static const char *at91sam9x5_board_compat[] __initconst = {
77 "atmel,at91sam9x5",
78 "atmel,at91sam9n12",
79 NULL
80};
81
82DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9")
83 /* Maintainer: Atmel */
84 .map_io = at91_map_io,
85 .init_machine = at91sam9x5_dt_device_init,
86 .dt_compat = at91sam9x5_board_compat,
87MACHINE_END
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
deleted file mode 100644
index 34e2abe82ae4..000000000000
--- a/arch/arm/mach-at91/at91sam9260.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * arch/arm/mach-at91/at91sam9260.c
3 *
4 * Copyright (C) 2006 SAN People
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#include <asm/system_misc.h>
14#include <mach/cpu.h>
15#include <mach/at91_dbgu.h>
16#include <mach/hardware.h>
17
18#include "soc.h"
19#include "generic.h"
20
21/* --------------------------------------------------------------------
22 * AT91SAM9260 processor initialization
23 * -------------------------------------------------------------------- */
24
25static void __init at91sam9xe_map_io(void)
26{
27 unsigned long sram_size;
28
29 switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) {
30 case AT91_CIDR_SRAMSIZ_32K:
31 sram_size = 2 * SZ_16K;
32 break;
33 case AT91_CIDR_SRAMSIZ_16K:
34 default:
35 sram_size = SZ_16K;
36 }
37
38 at91_init_sram(0, AT91SAM9XE_SRAM_BASE, sram_size);
39}
40
41static void __init at91sam9260_map_io(void)
42{
43 if (cpu_is_at91sam9xe())
44 at91sam9xe_map_io();
45 else if (cpu_is_at91sam9g20())
46 at91_init_sram(0, AT91SAM9G20_SRAM_BASE, AT91SAM9G20_SRAM_SIZE);
47 else
48 at91_init_sram(0, AT91SAM9260_SRAM_BASE, AT91SAM9260_SRAM_SIZE);
49}
50
51static void __init at91sam9260_initialize(void)
52{
53 arm_pm_idle = at91sam9_idle;
54}
55
56AT91_SOC_START(at91sam9260)
57 .map_io = at91sam9260_map_io,
58 .init = at91sam9260_initialize,
59AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
deleted file mode 100644
index 47878b849975..000000000000
--- a/arch/arm/mach-at91/at91sam9261.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * arch/arm/mach-at91/at91sam9261.c
3 *
4 * Copyright (C) 2005 SAN People
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#include <asm/system_misc.h>
14#include <mach/cpu.h>
15#include <mach/hardware.h>
16
17#include "soc.h"
18#include "generic.h"
19
20/* --------------------------------------------------------------------
21 * AT91SAM9261 processor initialization
22 * -------------------------------------------------------------------- */
23
24static void __init at91sam9261_map_io(void)
25{
26 if (cpu_is_at91sam9g10())
27 at91_init_sram(0, AT91SAM9G10_SRAM_BASE, AT91SAM9G10_SRAM_SIZE);
28 else
29 at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE);
30}
31
32static void __init at91sam9261_initialize(void)
33{
34 arm_pm_idle = at91sam9_idle;
35}
36
37AT91_SOC_START(at91sam9261)
38 .map_io = at91sam9261_map_io,
39 .init = at91sam9261_initialize,
40AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
deleted file mode 100644
index aabcb66145d0..000000000000
--- a/arch/arm/mach-at91/at91sam9263.c
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * arch/arm/mach-at91/at91sam9263.c
3 *
4 * Copyright (C) 2007 Atmel Corporation.
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#include <asm/system_misc.h>
14#include <mach/hardware.h>
15
16#include "soc.h"
17#include "generic.h"
18
19/* --------------------------------------------------------------------
20 * AT91SAM9263 processor initialization
21 * -------------------------------------------------------------------- */
22
23static void __init at91sam9263_map_io(void)
24{
25 at91_init_sram(0, AT91SAM9263_SRAM0_BASE, AT91SAM9263_SRAM0_SIZE);
26 at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE);
27}
28
29static void __init at91sam9263_initialize(void)
30{
31 arm_pm_idle = at91sam9_idle;
32}
33
34AT91_SOC_START(at91sam9263)
35 .map_io = at91sam9263_map_io,
36 .init = at91sam9263_initialize,
37AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
deleted file mode 100644
index 000166777a8d..000000000000
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Chip-specific setup code for the AT91SAM9G45 family
3 *
4 * Copyright (C) 2009 Atmel Corporation.
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 as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 */
12
13#include <asm/system_misc.h>
14#include <mach/hardware.h>
15
16#include "soc.h"
17#include "generic.h"
18
19/* --------------------------------------------------------------------
20 * AT91SAM9G45 processor initialization
21 * -------------------------------------------------------------------- */
22
23static void __init at91sam9g45_map_io(void)
24{
25 at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE);
26}
27
28static void __init at91sam9g45_initialize(void)
29{
30 arm_pm_idle = at91sam9_idle;
31}
32
33AT91_SOC_START(at91sam9g45)
34 .map_io = at91sam9g45_map_io,
35 .init = at91sam9g45_initialize,
36AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c
deleted file mode 100644
index 0135f868ea4f..000000000000
--- a/arch/arm/mach-at91/at91sam9n12.c
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * SoC specific setup code for the AT91SAM9N12
3 *
4 * Copyright (C) 2012 Atmel Corporation.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <asm/system_misc.h>
10#include <mach/hardware.h>
11
12#include "soc.h"
13#include "generic.h"
14
15/* --------------------------------------------------------------------
16 * AT91SAM9N12 processor initialization
17 * -------------------------------------------------------------------- */
18
19static void __init at91sam9n12_map_io(void)
20{
21 at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE);
22}
23
24AT91_SOC_START(at91sam9n12)
25 .map_io = at91sam9n12_map_io,
26AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
deleted file mode 100644
index 1babfb27694a..000000000000
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * arch/arm/mach-at91/at91sam9rl.c
3 *
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2007 Atmel Corporation
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
9 * more details.
10 */
11
12#include <asm/system_misc.h>
13#include <mach/cpu.h>
14#include <mach/at91_dbgu.h>
15#include <mach/hardware.h>
16
17#include "soc.h"
18#include "generic.h"
19
20/* --------------------------------------------------------------------
21 * AT91SAM9RL processor initialization
22 * -------------------------------------------------------------------- */
23
24static void __init at91sam9rl_map_io(void)
25{
26 unsigned long sram_size;
27
28 switch (at91_soc_initdata.cidr & AT91_CIDR_SRAMSIZ) {
29 case AT91_CIDR_SRAMSIZ_32K:
30 sram_size = 2 * SZ_16K;
31 break;
32 case AT91_CIDR_SRAMSIZ_16K:
33 default:
34 sram_size = SZ_16K;
35 }
36
37 /* Map SRAM */
38 at91_init_sram(0, AT91SAM9RL_SRAM_BASE, sram_size);
39}
40
41static void __init at91sam9rl_initialize(void)
42{
43 arm_pm_idle = at91sam9_idle;
44}
45
46AT91_SOC_START(at91sam9rl)
47 .map_io = at91sam9rl_map_io,
48 .init = at91sam9rl_initialize,
49AT91_SOC_END
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
deleted file mode 100644
index aa17520ccb0a..000000000000
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Chip-specific setup code for the AT91SAM9x5 family
3 *
4 * Copyright (C) 2010-2012 Atmel Corporation.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <asm/system_misc.h>
10#include <mach/hardware.h>
11
12#include "soc.h"
13#include "generic.h"
14
15/* --------------------------------------------------------------------
16 * AT91SAM9x5 processor initialization
17 * -------------------------------------------------------------------- */
18
19static void __init at91sam9x5_map_io(void)
20{
21 at91_init_sram(0, AT91SAM9X5_SRAM_BASE, AT91SAM9X5_SRAM_SIZE);
22}
23
24AT91_SOC_START(at91sam9x5)
25 .map_io = at91sam9x5_map_io,
26AT91_SOC_END
diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c
deleted file mode 100644
index a15ab6f8de00..000000000000
--- a/arch/arm/mach-at91/board-dt-rm9200.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Setup code for AT91RM9200 Evaluation Kits with Device Tree support
3 *
4 * Copyright (C) 2011 Atmel,
5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 * 2012 Joachim Eastwood <manabian@gmail.com>
7 *
8 * Licensed under GPLv2 or later.
9 */
10
11#include <linux/types.h>
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/gpio.h>
15#include <linux/of.h>
16#include <linux/of_irq.h>
17#include <linux/clk-provider.h>
18
19#include <asm/setup.h>
20#include <asm/irq.h>
21#include <asm/mach/arch.h>
22#include <asm/mach/map.h>
23#include <asm/mach/irq.h>
24
25#include "generic.h"
26
27static void __init at91rm9200_dt_timer_init(void)
28{
29 of_clk_init(NULL);
30 at91rm9200_timer_init();
31}
32
33static const char *at91rm9200_dt_board_compat[] __initdata = {
34 "atmel,at91rm9200",
35 NULL
36};
37
38DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)")
39 .init_time = at91rm9200_dt_timer_init,
40 .map_io = at91_map_io,
41 .init_early = at91_dt_initialize,
42 .dt_compat = at91rm9200_dt_board_compat,
43MACHINE_END
diff --git a/arch/arm/mach-at91/board-dt-sam9.c b/arch/arm/mach-at91/board-dt-sam9.c
deleted file mode 100644
index f99246aa9b38..000000000000
--- a/arch/arm/mach-at91/board-dt-sam9.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Setup code for AT91SAM Evaluation Kits with Device Tree support
3 *
4 * Copyright (C) 2011 Atmel,
5 * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9
10#include <linux/types.h>
11#include <linux/init.h>
12#include <linux/module.h>
13#include <linux/gpio.h>
14#include <linux/of.h>
15#include <linux/of_irq.h>
16#include <linux/clk-provider.h>
17
18#include <asm/setup.h>
19#include <asm/irq.h>
20#include <asm/mach/arch.h>
21#include <asm/mach/map.h>
22#include <asm/mach/irq.h>
23
24#include "generic.h"
25
26static const char *at91_dt_board_compat[] __initdata = {
27 "atmel,at91sam9",
28 NULL
29};
30
31DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM (Device Tree)")
32 /* Maintainer: Atmel */
33 .map_io = at91_map_io,
34 .init_early = at91_dt_initialize,
35 .dt_compat = at91_dt_board_compat,
36MACHINE_END
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 54f3837a0a4d..a6e726a6e0b5 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -17,18 +17,28 @@
17 /* Map io */ 17 /* Map io */
18extern void __init at91_map_io(void); 18extern void __init at91_map_io(void);
19extern void __init at91_alt_map_io(void); 19extern void __init at91_alt_map_io(void);
20extern void __init at91_init_sram(int bank, unsigned long base,
21 unsigned int length);
22
23 /* Processors */
24extern void __init at91_dt_initialize(void);
25 20
26 /* Timer */ 21 /* Timer */
27extern void at91rm9200_timer_init(void); 22extern void at91rm9200_timer_init(void);
28 23
29/* idle */ 24/* idle */
25extern void at91rm9200_idle(void);
30extern void at91sam9_idle(void); 26extern void at91sam9_idle(void);
31 27
32/* Matrix */ 28/* Matrix */
33extern void at91_ioremap_matrix(u32 base_addr); 29extern void at91_ioremap_matrix(u32 base_addr);
30
31
32#ifdef CONFIG_PM
33extern void __init at91rm9200_pm_init(void);
34extern void __init at91sam9260_pm_init(void);
35extern void __init at91sam9g45_pm_init(void);
36extern void __init at91sam9x5_pm_init(void);
37#else
38void __init at91rm9200_pm_init(void) { }
39void __init at91sam9260_pm_init(void) { }
40void __init at91sam9g45_pm_init(void) { }
41void __init at91sam9x5_pm_init(void) { }
42#endif
43
34#endif /* _AT91_GENERIC_H */ 44#endif /* _AT91_GENERIC_H */
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index 61914fb35f5d..ce7c80a44983 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -152,69 +152,45 @@ static inline int at91_soc_is_detected(void)
152#define cpu_is_at91rm9200_pqfp() (0) 152#define cpu_is_at91rm9200_pqfp() (0)
153#endif 153#endif
154 154
155#ifdef CONFIG_SOC_AT91SAM9260 155#ifdef CONFIG_SOC_AT91SAM9
156#define cpu_is_at91sam9xe() (at91_soc_initdata.subtype == AT91_SOC_SAM9XE) 156#define cpu_is_at91sam9xe() (at91_soc_initdata.subtype == AT91_SOC_SAM9XE)
157#define cpu_is_at91sam9260() (at91_soc_initdata.type == AT91_SOC_SAM9260) 157#define cpu_is_at91sam9260() (at91_soc_initdata.type == AT91_SOC_SAM9260)
158#define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20) 158#define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20)
159#else
160#define cpu_is_at91sam9xe() (0)
161#define cpu_is_at91sam9260() (0)
162#define cpu_is_at91sam9g20() (0)
163#endif
164
165#ifdef CONFIG_SOC_AT91SAM9261
166#define cpu_is_at91sam9261() (at91_soc_initdata.type == AT91_SOC_SAM9261) 159#define cpu_is_at91sam9261() (at91_soc_initdata.type == AT91_SOC_SAM9261)
167#define cpu_is_at91sam9g10() (at91_soc_initdata.type == AT91_SOC_SAM9G10) 160#define cpu_is_at91sam9g10() (at91_soc_initdata.type == AT91_SOC_SAM9G10)
168#else
169#define cpu_is_at91sam9261() (0)
170#define cpu_is_at91sam9g10() (0)
171#endif
172
173#ifdef CONFIG_SOC_AT91SAM9263
174#define cpu_is_at91sam9263() (at91_soc_initdata.type == AT91_SOC_SAM9263) 161#define cpu_is_at91sam9263() (at91_soc_initdata.type == AT91_SOC_SAM9263)
175#else
176#define cpu_is_at91sam9263() (0)
177#endif
178
179#ifdef CONFIG_SOC_AT91SAM9RL
180#define cpu_is_at91sam9rl() (at91_soc_initdata.type == AT91_SOC_SAM9RL) 162#define cpu_is_at91sam9rl() (at91_soc_initdata.type == AT91_SOC_SAM9RL)
181#else
182#define cpu_is_at91sam9rl() (0)
183#endif
184
185#ifdef CONFIG_SOC_AT91SAM9G45
186#define cpu_is_at91sam9g45() (at91_soc_initdata.type == AT91_SOC_SAM9G45) 163#define cpu_is_at91sam9g45() (at91_soc_initdata.type == AT91_SOC_SAM9G45)
187#define cpu_is_at91sam9g45es() (at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES) 164#define cpu_is_at91sam9g45es() (at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES)
188#define cpu_is_at91sam9m10() (at91_soc_initdata.subtype == AT91_SOC_SAM9M10) 165#define cpu_is_at91sam9m10() (at91_soc_initdata.subtype == AT91_SOC_SAM9M10)
189#define cpu_is_at91sam9g46() (at91_soc_initdata.subtype == AT91_SOC_SAM9G46) 166#define cpu_is_at91sam9g46() (at91_soc_initdata.subtype == AT91_SOC_SAM9G46)
190#define cpu_is_at91sam9m11() (at91_soc_initdata.subtype == AT91_SOC_SAM9M11) 167#define cpu_is_at91sam9m11() (at91_soc_initdata.subtype == AT91_SOC_SAM9M11)
191#else
192#define cpu_is_at91sam9g45() (0)
193#define cpu_is_at91sam9g45es() (0)
194#define cpu_is_at91sam9m10() (0)
195#define cpu_is_at91sam9g46() (0)
196#define cpu_is_at91sam9m11() (0)
197#endif
198
199#ifdef CONFIG_SOC_AT91SAM9X5
200#define cpu_is_at91sam9x5() (at91_soc_initdata.type == AT91_SOC_SAM9X5) 168#define cpu_is_at91sam9x5() (at91_soc_initdata.type == AT91_SOC_SAM9X5)
201#define cpu_is_at91sam9g15() (at91_soc_initdata.subtype == AT91_SOC_SAM9G15) 169#define cpu_is_at91sam9g15() (at91_soc_initdata.subtype == AT91_SOC_SAM9G15)
202#define cpu_is_at91sam9g35() (at91_soc_initdata.subtype == AT91_SOC_SAM9G35) 170#define cpu_is_at91sam9g35() (at91_soc_initdata.subtype == AT91_SOC_SAM9G35)
203#define cpu_is_at91sam9x35() (at91_soc_initdata.subtype == AT91_SOC_SAM9X35) 171#define cpu_is_at91sam9x35() (at91_soc_initdata.subtype == AT91_SOC_SAM9X35)
204#define cpu_is_at91sam9g25() (at91_soc_initdata.subtype == AT91_SOC_SAM9G25) 172#define cpu_is_at91sam9g25() (at91_soc_initdata.subtype == AT91_SOC_SAM9G25)
205#define cpu_is_at91sam9x25() (at91_soc_initdata.subtype == AT91_SOC_SAM9X25) 173#define cpu_is_at91sam9x25() (at91_soc_initdata.subtype == AT91_SOC_SAM9X25)
174#define cpu_is_at91sam9n12() (at91_soc_initdata.type == AT91_SOC_SAM9N12)
206#else 175#else
176#define cpu_is_at91sam9xe() (0)
177#define cpu_is_at91sam9260() (0)
178#define cpu_is_at91sam9g20() (0)
179#define cpu_is_at91sam9261() (0)
180#define cpu_is_at91sam9g10() (0)
181#define cpu_is_at91sam9263() (0)
182#define cpu_is_at91sam9rl() (0)
183#define cpu_is_at91sam9g45() (0)
184#define cpu_is_at91sam9g45es() (0)
185#define cpu_is_at91sam9m10() (0)
186#define cpu_is_at91sam9g46() (0)
187#define cpu_is_at91sam9m11() (0)
207#define cpu_is_at91sam9x5() (0) 188#define cpu_is_at91sam9x5() (0)
208#define cpu_is_at91sam9g15() (0) 189#define cpu_is_at91sam9g15() (0)
209#define cpu_is_at91sam9g35() (0) 190#define cpu_is_at91sam9g35() (0)
210#define cpu_is_at91sam9x35() (0) 191#define cpu_is_at91sam9x35() (0)
211#define cpu_is_at91sam9g25() (0) 192#define cpu_is_at91sam9g25() (0)
212#define cpu_is_at91sam9x25() (0) 193#define cpu_is_at91sam9x25() (0)
213#endif
214
215#ifdef CONFIG_SOC_AT91SAM9N12
216#define cpu_is_at91sam9n12() (at91_soc_initdata.type == AT91_SOC_SAM9N12)
217#else
218#define cpu_is_at91sam9n12() (0) 194#define cpu_is_at91sam9n12() (0)
219#endif 195#endif
220 196
diff --git a/arch/arm/mach-at91/include/mach/system_rev.h b/arch/arm/mach-at91/include/mach/system_rev.h
deleted file mode 100644
index ef79a9aafc08..000000000000
--- a/arch/arm/mach-at91/include/mach/system_rev.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
3 *
4 * Under GPLv2 only
5 */
6
7#ifndef __ARCH_SYSTEM_REV_H__
8#define __ARCH_SYSTEM_REV_H__
9
10#include <asm/system_info.h>
11
12/*
13 * board revision encoding
14 * mach specific
15 * the 16-31 bit are reserved for at91 generic information
16 *
17 * bit 31:
18 * 0 => nand 8 bit
19 * 1 => nand 16 bit
20 */
21#define BOARD_HAVE_NAND_16BIT (1 << 31)
22static inline int board_have_nand_16bit(void)
23{
24 return (system_rev & BOARD_HAVE_NAND_16BIT) ? 1 : 0;
25}
26
27#endif /* __ARCH_SYSTEM_REV_H__ */
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 9b15169a1c62..af8d8afc2e12 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -14,9 +14,13 @@
14#include <linux/suspend.h> 14#include <linux/suspend.h>
15#include <linux/sched.h> 15#include <linux/sched.h>
16#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
17#include <linux/genalloc.h>
17#include <linux/interrupt.h> 18#include <linux/interrupt.h>
18#include <linux/sysfs.h> 19#include <linux/sysfs.h>
19#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/of.h>
22#include <linux/of_platform.h>
23#include <linux/of_address.h>
20#include <linux/platform_device.h> 24#include <linux/platform_device.h>
21#include <linux/io.h> 25#include <linux/io.h>
22#include <linux/clk/at91_pmc.h> 26#include <linux/clk/at91_pmc.h>
@@ -32,7 +36,13 @@
32#include "generic.h" 36#include "generic.h"
33#include "pm.h" 37#include "pm.h"
34 38
39static struct {
40 unsigned long uhp_udp_mask;
41 int memctrl;
42} at91_pm_data;
43
35static void (*at91_pm_standby)(void); 44static void (*at91_pm_standby)(void);
45void __iomem *at91_ramc_base[2];
36 46
37static int at91_pm_valid_state(suspend_state_t state) 47static int at91_pm_valid_state(suspend_state_t state)
38{ 48{
@@ -71,17 +81,9 @@ static int at91_pm_verify_clocks(void)
71 scsr = at91_pmc_read(AT91_PMC_SCSR); 81 scsr = at91_pmc_read(AT91_PMC_SCSR);
72 82
73 /* USB must not be using PLLB */ 83 /* USB must not be using PLLB */
74 if (cpu_is_at91rm9200()) { 84 if ((scsr & at91_pm_data.uhp_udp_mask) != 0) {
75 if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { 85 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
76 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); 86 return 0;
77 return 0;
78 }
79 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263()
80 || cpu_is_at91sam9g20() || cpu_is_at91sam9g10()) {
81 if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) {
82 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
83 return 0;
84 }
85 } 87 }
86 88
87 /* PCK0..PCK3 must be disabled, or configured to use clk32k */ 89 /* PCK0..PCK3 must be disabled, or configured to use clk32k */
@@ -149,18 +151,13 @@ static int at91_pm_enter(suspend_state_t state)
149 * turning off the main oscillator; reverse on wakeup. 151 * turning off the main oscillator; reverse on wakeup.
150 */ 152 */
151 if (slow_clock) { 153 if (slow_clock) {
152 int memctrl = AT91_MEMCTRL_SDRAMC;
153
154 if (cpu_is_at91rm9200())
155 memctrl = AT91_MEMCTRL_MC;
156 else if (cpu_is_at91sam9g45())
157 memctrl = AT91_MEMCTRL_DDRSDR;
158#ifdef CONFIG_AT91_SLOW_CLOCK 154#ifdef CONFIG_AT91_SLOW_CLOCK
159 /* copy slow_clock handler to SRAM, and call it */ 155 /* copy slow_clock handler to SRAM, and call it */
160 memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz); 156 memcpy(slow_clock, at91_slow_clock, at91_slow_clock_sz);
161#endif 157#endif
162 slow_clock(at91_pmc_base, at91_ramc_base[0], 158 slow_clock(at91_pmc_base, at91_ramc_base[0],
163 at91_ramc_base[1], memctrl); 159 at91_ramc_base[1],
160 at91_pm_data.memctrl);
164 break; 161 break;
165 } else { 162 } else {
166 pr_info("AT91: PM - no slow clock mode enabled ...\n"); 163 pr_info("AT91: PM - no slow clock mode enabled ...\n");
@@ -229,23 +226,134 @@ void at91_pm_set_standby(void (*at91_standby)(void))
229 } 226 }
230} 227}
231 228
232static int __init at91_pm_init(void) 229static struct of_device_id ramc_ids[] = {
230 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
231 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
232 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
233 { .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
234 { /*sentinel*/ }
235};
236
237static void at91_dt_ramc(void)
233{ 238{
239 struct device_node *np;
240 const struct of_device_id *of_id;
241 int idx = 0;
242 const void *standby = NULL;
243
244 for_each_matching_node_and_match(np, ramc_ids, &of_id) {
245 at91_ramc_base[idx] = of_iomap(np, 0);
246 if (!at91_ramc_base[idx])
247 panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
248
249 if (!standby)
250 standby = of_id->data;
251
252 idx++;
253 }
254
255 if (!idx)
256 panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
257
258 if (!standby) {
259 pr_warn("ramc no standby function available\n");
260 return;
261 }
262
263 at91_pm_set_standby(standby);
264}
265
234#ifdef CONFIG_AT91_SLOW_CLOCK 266#ifdef CONFIG_AT91_SLOW_CLOCK
235 slow_clock = (void *) (AT91_IO_VIRT_BASE - at91_slow_clock_sz); 267static void __init at91_pm_sram_init(void)
268{
269 struct gen_pool *sram_pool;
270 phys_addr_t sram_pbase;
271 unsigned long sram_base;
272 struct device_node *node;
273 struct platform_device *pdev;
274
275 node = of_find_compatible_node(NULL, NULL, "mmio-sram");
276 if (!node) {
277 pr_warn("%s: failed to find sram node!\n", __func__);
278 return;
279 }
280
281 pdev = of_find_device_by_node(node);
282 if (!pdev) {
283 pr_warn("%s: failed to find sram device!\n", __func__);
284 goto put_node;
285 }
286
287 sram_pool = dev_get_gen_pool(&pdev->dev);
288 if (!sram_pool) {
289 pr_warn("%s: sram pool unavailable!\n", __func__);
290 goto put_node;
291 }
292
293 sram_base = gen_pool_alloc(sram_pool, at91_slow_clock_sz);
294 if (!sram_base) {
295 pr_warn("%s: unable to alloc ocram!\n", __func__);
296 goto put_node;
297 }
298
299 sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base);
300 slow_clock = __arm_ioremap_exec(sram_pbase, at91_slow_clock_sz, false);
301
302put_node:
303 of_node_put(node);
304}
305#endif
306
307
308static void __init at91_pm_init(void)
309{
310#ifdef CONFIG_AT91_SLOW_CLOCK
311 at91_pm_sram_init();
236#endif 312#endif
237 313
238 pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : "")); 314 pr_info("AT91: Power Management%s\n", (slow_clock ? " (with slow clock mode)" : ""));
239 315
240 /* AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. */
241 if (cpu_is_at91rm9200())
242 at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
243
244 if (at91_cpuidle_device.dev.platform_data) 316 if (at91_cpuidle_device.dev.platform_data)
245 platform_device_register(&at91_cpuidle_device); 317 platform_device_register(&at91_cpuidle_device);
246 318
247 suspend_set_ops(&at91_pm_ops); 319 suspend_set_ops(&at91_pm_ops);
320}
248 321
249 return 0; 322void __init at91rm9200_pm_init(void)
323{
324 at91_dt_ramc();
325
326 /*
327 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh.
328 */
329 at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0);
330
331 at91_pm_data.uhp_udp_mask = AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP;
332 at91_pm_data.memctrl = AT91_MEMCTRL_MC;
333
334 at91_pm_init();
335}
336
337void __init at91sam9260_pm_init(void)
338{
339 at91_dt_ramc();
340 at91_pm_data.memctrl = AT91_MEMCTRL_SDRAMC;
341 at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
342 return at91_pm_init();
343}
344
345void __init at91sam9g45_pm_init(void)
346{
347 at91_dt_ramc();
348 at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP;
349 at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
350 return at91_pm_init();
351}
352
353void __init at91sam9x5_pm_init(void)
354{
355 at91_dt_ramc();
356 at91_pm_data.uhp_udp_mask = AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP;
357 at91_pm_data.memctrl = AT91_MEMCTRL_DDRSDR;
358 return at91_pm_init();
250} 359}
251arch_initcall(at91_pm_init);
diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 20018779bae7..556151e85ec4 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -17,15 +17,6 @@
17#include <mach/hardware.h> 17#include <mach/hardware.h>
18#include <mach/at91_ramc.h> 18#include <mach/at91_ramc.h>
19 19
20
21#ifdef CONFIG_SOC_AT91SAM9263
22/*
23 * FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
24 * handle those cases both here and in the Suspend-To-RAM support.
25 */
26#warning Assuming EB1 SDRAM controller is *NOT* used
27#endif
28
29/* 20/*
30 * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master 21 * When SLOWDOWN_MASTER_CLOCK is defined we will also slow down the Master
31 * clock during suspend by adjusting its prescalar and divisor. 22 * clock during suspend by adjusting its prescalar and divisor.
diff --git a/arch/arm/mach-at91/board-dt-sama5.c b/arch/arm/mach-at91/sama5.c
index 97f7367d32b8..03dcb441f3d2 100644
--- a/arch/arm/mach-at91/board-dt-sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Setup code for SAMA5 Evaluation Kits with Device Tree support 2 * Setup code for SAMA5
3 * 3 *
4 * Copyright (C) 2013 Atmel, 4 * Copyright (C) 2013 Atmel,
5 * 2013 Ludovic Desroches <ludovic.desroches@atmel.com> 5 * 2013 Ludovic Desroches <ludovic.desroches@atmel.com>
@@ -19,6 +19,8 @@
19#include <linux/clk-provider.h> 19#include <linux/clk-provider.h>
20#include <linux/phy.h> 20#include <linux/phy.h>
21 21
22#include <mach/hardware.h>
23
22#include <asm/setup.h> 24#include <asm/setup.h>
23#include <asm/irq.h> 25#include <asm/irq.h>
24#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
@@ -47,6 +49,7 @@ static void __init sama5_dt_device_init(void)
47 } 49 }
48 50
49 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 51 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
52 at91sam9x5_pm_init();
50} 53}
51 54
52static const char *sama5_dt_board_compat[] __initconst = { 55static const char *sama5_dt_board_compat[] __initconst = {
@@ -54,23 +57,54 @@ static const char *sama5_dt_board_compat[] __initconst = {
54 NULL 57 NULL
55}; 58};
56 59
57DT_MACHINE_START(sama5_dt, "Atmel SAMA5 (Device Tree)") 60DT_MACHINE_START(sama5_dt, "Atmel SAMA5")
58 /* Maintainer: Atmel */ 61 /* Maintainer: Atmel */
59 .map_io = at91_map_io, 62 .map_io = at91_map_io,
60 .init_early = at91_dt_initialize,
61 .init_machine = sama5_dt_device_init, 63 .init_machine = sama5_dt_device_init,
62 .dt_compat = sama5_dt_board_compat, 64 .dt_compat = sama5_dt_board_compat,
63MACHINE_END 65MACHINE_END
64 66
67static struct map_desc at91_io_desc[] __initdata = {
68 {
69 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
70 .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC),
71 .length = SZ_512,
72 .type = MT_DEVICE,
73 },
74 {
75 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC),
76 .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC),
77 .length = SZ_512,
78 .type = MT_DEVICE,
79 },
80 { /* On sama5d4, we use USART3 as serial console */
81 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3),
82 .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3),
83 .length = SZ_256,
84 .type = MT_DEVICE,
85 },
86 { /* A bunch of peripheral with fine grained IO space */
87 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2),
88 .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2),
89 .length = SZ_2K,
90 .type = MT_DEVICE,
91 },
92};
93
94static void __init sama5_alt_map_io(void)
95{
96 at91_alt_map_io();
97 iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
98}
99
65static const char *sama5_alt_dt_board_compat[] __initconst = { 100static const char *sama5_alt_dt_board_compat[] __initconst = {
66 "atmel,sama5d4", 101 "atmel,sama5d4",
67 NULL 102 NULL
68}; 103};
69 104
70DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5 (Device Tree)") 105DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
71 /* Maintainer: Atmel */ 106 /* Maintainer: Atmel */
72 .map_io = at91_alt_map_io, 107 .map_io = sama5_alt_map_io,
73 .init_early = at91_dt_initialize,
74 .init_machine = sama5_dt_device_init, 108 .init_machine = sama5_dt_device_init,
75 .dt_compat = sama5_alt_dt_board_compat, 109 .dt_compat = sama5_alt_dt_board_compat,
76 .l2c_aux_mask = ~0UL, 110 .l2c_aux_mask = ~0UL,
diff --git a/arch/arm/mach-at91/sama5d3.c b/arch/arm/mach-at91/sama5d3.c
deleted file mode 100644
index ae58feada72b..000000000000
--- a/arch/arm/mach-at91/sama5d3.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Chip-specific setup code for the SAMA5D3 family
3 *
4 * Copyright (C) 2013 Atmel,
5 * 2013 Ludovic Desroches <ludovic.desroches@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9
10#include <linux/module.h>
11#include <linux/dma-mapping.h>
12#include <linux/clk/at91_pmc.h>
13
14#include <asm/irq.h>
15#include <asm/mach/arch.h>
16#include <asm/mach/map.h>
17#include <mach/sama5d3.h>
18#include <mach/cpu.h>
19
20#include "soc.h"
21#include "generic.h"
22#include "sam9_smc.h"
23
24/* --------------------------------------------------------------------
25 * AT91SAM9x5 processor initialization
26 * -------------------------------------------------------------------- */
27
28static void __init sama5d3_map_io(void)
29{
30 at91_init_sram(0, SAMA5D3_SRAM_BASE, SAMA5D3_SRAM_SIZE);
31}
32
33AT91_SOC_START(sama5d3)
34 .map_io = sama5d3_map_io,
35AT91_SOC_END
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c
deleted file mode 100644
index 7638509639f4..000000000000
--- a/arch/arm/mach-at91/sama5d4.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/*
2 * Chip-specific setup code for the SAMA5D4 family
3 *
4 * Copyright (C) 2013 Atmel Corporation,
5 * Nicolas Ferre <nicolas.ferre@atmel.com>
6 *
7 * Licensed under GPLv2 or later.
8 */
9
10#include <linux/module.h>
11#include <linux/dma-mapping.h>
12#include <linux/clk/at91_pmc.h>
13
14#include <asm/irq.h>
15#include <asm/mach/arch.h>
16#include <asm/mach/map.h>
17#include <mach/sama5d4.h>
18#include <mach/cpu.h>
19#include <mach/hardware.h>
20
21#include "soc.h"
22#include "generic.h"
23#include "sam9_smc.h"
24
25/* --------------------------------------------------------------------
26 * Processor initialization
27 * -------------------------------------------------------------------- */
28static struct map_desc at91_io_desc[] __initdata = {
29 {
30 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_MPDDRC),
31 .pfn = __phys_to_pfn(SAMA5D4_BASE_MPDDRC),
32 .length = SZ_512,
33 .type = MT_DEVICE,
34 },
35 {
36 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_PMC),
37 .pfn = __phys_to_pfn(SAMA5D4_BASE_PMC),
38 .length = SZ_512,
39 .type = MT_DEVICE,
40 },
41 { /* On sama5d4, we use USART3 as serial console */
42 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_USART3),
43 .pfn = __phys_to_pfn(SAMA5D4_BASE_USART3),
44 .length = SZ_256,
45 .type = MT_DEVICE,
46 },
47 { /* A bunch of peripheral with fine grained IO space */
48 .virtual = (unsigned long)AT91_ALT_IO_P2V(SAMA5D4_BASE_SYS2),
49 .pfn = __phys_to_pfn(SAMA5D4_BASE_SYS2),
50 .length = SZ_2K,
51 .type = MT_DEVICE,
52 },
53};
54
55
56static void __init sama5d4_map_io(void)
57{
58 iotable_init(at91_io_desc, ARRAY_SIZE(at91_io_desc));
59 at91_init_sram(0, SAMA5D4_NS_SRAM_BASE, SAMA5D4_NS_SRAM_SIZE);
60}
61
62AT91_SOC_START(sama5d4)
63 .map_io = sama5d4_map_io,
64AT91_SOC_END
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index e3c21b458bb8..4e58bc90ed21 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -22,38 +22,12 @@
22#include <mach/cpu.h> 22#include <mach/cpu.h>
23#include <mach/at91_dbgu.h> 23#include <mach/at91_dbgu.h>
24 24
25#include "soc.h"
26#include "generic.h" 25#include "generic.h"
27#include "pm.h" 26#include "pm.h"
28 27
29struct at91_init_soc __initdata at91_boot_soc;
30
31struct at91_socinfo at91_soc_initdata; 28struct at91_socinfo at91_soc_initdata;
32EXPORT_SYMBOL(at91_soc_initdata); 29EXPORT_SYMBOL(at91_soc_initdata);
33 30
34void __iomem *at91_ramc_base[2];
35EXPORT_SYMBOL_GPL(at91_ramc_base);
36
37static struct map_desc sram_desc[2] __initdata;
38
39void __init at91_init_sram(int bank, unsigned long base, unsigned int length)
40{
41 struct map_desc *desc = &sram_desc[bank];
42
43 desc->virtual = (unsigned long)AT91_IO_VIRT_BASE - length;
44 if (bank > 0)
45 desc->virtual -= sram_desc[bank - 1].length;
46
47 desc->pfn = __phys_to_pfn(base);
48 desc->length = length;
49 desc->type = MT_MEMORY_RWX_NONCACHED;
50
51 pr_info("sram at 0x%lx of 0x%x mapped at 0x%lx\n",
52 base, length, desc->virtual);
53
54 iotable_init(desc, 1);
55}
56
57static struct map_desc at91_io_desc __initdata __maybe_unused = { 31static struct map_desc at91_io_desc __initdata __maybe_unused = {
58 .virtual = (unsigned long)AT91_VA_BASE_SYS, 32 .virtual = (unsigned long)AT91_VA_BASE_SYS,
59 .pfn = __phys_to_pfn(AT91_BASE_SYS), 33 .pfn = __phys_to_pfn(AT91_BASE_SYS),
@@ -80,61 +54,51 @@ static void __init soc_detect(u32 dbgu_base)
80 at91_soc_initdata.type = AT91_SOC_RM9200; 54 at91_soc_initdata.type = AT91_SOC_RM9200;
81 if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN) 55 if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
82 at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; 56 at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
83 at91_boot_soc = at91rm9200_soc;
84 break; 57 break;
85 58
86 case ARCH_ID_AT91SAM9260: 59 case ARCH_ID_AT91SAM9260:
87 at91_soc_initdata.type = AT91_SOC_SAM9260; 60 at91_soc_initdata.type = AT91_SOC_SAM9260;
88 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 61 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
89 at91_boot_soc = at91sam9260_soc;
90 break; 62 break;
91 63
92 case ARCH_ID_AT91SAM9261: 64 case ARCH_ID_AT91SAM9261:
93 at91_soc_initdata.type = AT91_SOC_SAM9261; 65 at91_soc_initdata.type = AT91_SOC_SAM9261;
94 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 66 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
95 at91_boot_soc = at91sam9261_soc;
96 break; 67 break;
97 68
98 case ARCH_ID_AT91SAM9263: 69 case ARCH_ID_AT91SAM9263:
99 at91_soc_initdata.type = AT91_SOC_SAM9263; 70 at91_soc_initdata.type = AT91_SOC_SAM9263;
100 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 71 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
101 at91_boot_soc = at91sam9263_soc;
102 break; 72 break;
103 73
104 case ARCH_ID_AT91SAM9G20: 74 case ARCH_ID_AT91SAM9G20:
105 at91_soc_initdata.type = AT91_SOC_SAM9G20; 75 at91_soc_initdata.type = AT91_SOC_SAM9G20;
106 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 76 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
107 at91_boot_soc = at91sam9260_soc;
108 break; 77 break;
109 78
110 case ARCH_ID_AT91SAM9G45: 79 case ARCH_ID_AT91SAM9G45:
111 at91_soc_initdata.type = AT91_SOC_SAM9G45; 80 at91_soc_initdata.type = AT91_SOC_SAM9G45;
112 if (cidr == ARCH_ID_AT91SAM9G45ES) 81 if (cidr == ARCH_ID_AT91SAM9G45ES)
113 at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES; 82 at91_soc_initdata.subtype = AT91_SOC_SAM9G45ES;
114 at91_boot_soc = at91sam9g45_soc;
115 break; 83 break;
116 84
117 case ARCH_ID_AT91SAM9RL64: 85 case ARCH_ID_AT91SAM9RL64:
118 at91_soc_initdata.type = AT91_SOC_SAM9RL; 86 at91_soc_initdata.type = AT91_SOC_SAM9RL;
119 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 87 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
120 at91_boot_soc = at91sam9rl_soc;
121 break; 88 break;
122 89
123 case ARCH_ID_AT91SAM9X5: 90 case ARCH_ID_AT91SAM9X5:
124 at91_soc_initdata.type = AT91_SOC_SAM9X5; 91 at91_soc_initdata.type = AT91_SOC_SAM9X5;
125 at91_boot_soc = at91sam9x5_soc;
126 break; 92 break;
127 93
128 case ARCH_ID_AT91SAM9N12: 94 case ARCH_ID_AT91SAM9N12:
129 at91_soc_initdata.type = AT91_SOC_SAM9N12; 95 at91_soc_initdata.type = AT91_SOC_SAM9N12;
130 at91_boot_soc = at91sam9n12_soc;
131 break; 96 break;
132 97
133 case ARCH_ID_SAMA5: 98 case ARCH_ID_SAMA5:
134 at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 99 at91_soc_initdata.exid = __raw_readl(AT91_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
135 if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) { 100 if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
136 at91_soc_initdata.type = AT91_SOC_SAMA5D3; 101 at91_soc_initdata.type = AT91_SOC_SAMA5D3;
137 at91_boot_soc = sama5d3_soc;
138 } 102 }
139 break; 103 break;
140 } 104 }
@@ -143,13 +107,11 @@ static void __init soc_detect(u32 dbgu_base)
143 if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { 107 if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
144 at91_soc_initdata.type = AT91_SOC_SAM9G10; 108 at91_soc_initdata.type = AT91_SOC_SAM9G10;
145 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; 109 at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
146 at91_boot_soc = at91sam9261_soc;
147 } 110 }
148 /* at91sam9xe */ 111 /* at91sam9xe */
149 else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) { 112 else if ((cidr & AT91_CIDR_ARCH) == ARCH_FAMILY_AT91SAM9XE) {
150 at91_soc_initdata.type = AT91_SOC_SAM9260; 113 at91_soc_initdata.type = AT91_SOC_SAM9260;
151 at91_soc_initdata.subtype = AT91_SOC_SAM9XE; 114 at91_soc_initdata.subtype = AT91_SOC_SAM9XE;
152 at91_boot_soc = at91sam9260_soc;
153 } 115 }
154 116
155 if (!at91_soc_is_detected()) 117 if (!at91_soc_is_detected())
@@ -229,10 +191,8 @@ static void __init alt_soc_detect(u32 dbgu_base)
229 at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID); 191 at91_soc_initdata.exid = __raw_readl(AT91_ALT_IO_P2V(dbgu_base) + AT91_DBGU_EXID);
230 if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) { 192 if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D3) {
231 at91_soc_initdata.type = AT91_SOC_SAMA5D3; 193 at91_soc_initdata.type = AT91_SOC_SAMA5D3;
232 at91_boot_soc = sama5d3_soc;
233 } else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) { 194 } else if (at91_soc_initdata.exid & ARCH_EXID_SAMA5D4) {
234 at91_soc_initdata.type = AT91_SOC_SAMA5D4; 195 at91_soc_initdata.type = AT91_SOC_SAMA5D4;
235 at91_boot_soc = sama5d4_soc;
236 } 196 }
237 break; 197 break;
238 } 198 }
@@ -338,12 +298,6 @@ void __init at91_map_io(void)
338 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE) 298 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
339 pr_info("Detected soc subtype: %s\n", 299 pr_info("Detected soc subtype: %s\n",
340 at91_get_soc_subtype(&at91_soc_initdata)); 300 at91_get_soc_subtype(&at91_soc_initdata));
341
342 if (!at91_soc_is_enabled())
343 panic(pr_fmt("Soc not enabled"));
344
345 if (at91_boot_soc.map_io)
346 at91_boot_soc.map_io();
347} 301}
348 302
349void __init at91_alt_map_io(void) 303void __init at91_alt_map_io(void)
@@ -363,12 +317,6 @@ void __init at91_alt_map_io(void)
363 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE) 317 if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
364 pr_info("AT91: Detected soc subtype: %s\n", 318 pr_info("AT91: Detected soc subtype: %s\n",
365 at91_get_soc_subtype(&at91_soc_initdata)); 319 at91_get_soc_subtype(&at91_soc_initdata));
366
367 if (!at91_soc_is_enabled())
368 panic("AT91: Soc not enabled");
369
370 if (at91_boot_soc.map_io)
371 at91_boot_soc.map_io();
372} 320}
373 321
374void __iomem *at91_matrix_base; 322void __iomem *at91_matrix_base;
@@ -380,48 +328,3 @@ void __init at91_ioremap_matrix(u32 base_addr)
380 if (!at91_matrix_base) 328 if (!at91_matrix_base)
381 panic(pr_fmt("Impossible to ioremap at91_matrix_base\n")); 329 panic(pr_fmt("Impossible to ioremap at91_matrix_base\n"));
382} 330}
383
384static struct of_device_id ramc_ids[] = {
385 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
386 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
387 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
388 { .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
389 { /*sentinel*/ }
390};
391
392static void at91_dt_ramc(void)
393{
394 struct device_node *np;
395 const struct of_device_id *of_id;
396 int idx = 0;
397 const void *standby = NULL;
398
399 for_each_matching_node_and_match(np, ramc_ids, &of_id) {
400 at91_ramc_base[idx] = of_iomap(np, 0);
401 if (!at91_ramc_base[idx])
402 panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
403
404 if (!standby)
405 standby = of_id->data;
406
407 idx++;
408 }
409
410 if (!idx)
411 panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
412
413 if (!standby) {
414 pr_warn("ramc no standby function available\n");
415 return;
416 }
417
418 at91_pm_set_standby(standby);
419}
420
421void __init at91_dt_initialize(void)
422{
423 at91_dt_ramc();
424
425 if (at91_boot_soc.init)
426 at91_boot_soc.init();
427}
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
deleted file mode 100644
index ae6c0b2f1146..000000000000
--- a/arch/arm/mach-at91/soc.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
3 *
4 * Under GPLv2
5 */
6
7struct at91_init_soc {
8 int builtin;
9 void (*map_io)(void);
10 void (*init)(void);
11};
12
13extern struct at91_init_soc at91_boot_soc;
14extern struct at91_init_soc at91rm9200_soc;
15extern struct at91_init_soc at91sam9260_soc;
16extern struct at91_init_soc at91sam9261_soc;
17extern struct at91_init_soc at91sam9263_soc;
18extern struct at91_init_soc at91sam9g45_soc;
19extern struct at91_init_soc at91sam9rl_soc;
20extern struct at91_init_soc at91sam9x5_soc;
21extern struct at91_init_soc at91sam9n12_soc;
22extern struct at91_init_soc sama5d3_soc;
23extern struct at91_init_soc sama5d4_soc;
24
25#define AT91_SOC_START(_name) \
26struct at91_init_soc __initdata _name##_soc \
27 __used \
28 = { \
29 .builtin = 1, \
30
31#define AT91_SOC_END \
32};
33
34static inline int at91_soc_is_enabled(void)
35{
36 return at91_boot_soc.builtin;
37}
38
39#if !defined(CONFIG_SOC_AT91RM9200)
40#define at91rm9200_soc at91_boot_soc
41#endif
42
43#if !defined(CONFIG_SOC_AT91SAM9260)
44#define at91sam9260_soc at91_boot_soc
45#endif
46
47#if !defined(CONFIG_SOC_AT91SAM9261)
48#define at91sam9261_soc at91_boot_soc
49#endif
50
51#if !defined(CONFIG_SOC_AT91SAM9263)
52#define at91sam9263_soc at91_boot_soc
53#endif
54
55#if !defined(CONFIG_SOC_AT91SAM9G45)
56#define at91sam9g45_soc at91_boot_soc
57#endif
58
59#if !defined(CONFIG_SOC_AT91SAM9RL)
60#define at91sam9rl_soc at91_boot_soc
61#endif
62
63#if !defined(CONFIG_SOC_AT91SAM9X5)
64#define at91sam9x5_soc at91_boot_soc
65#endif
66
67#if !defined(CONFIG_SOC_AT91SAM9N12)
68#define at91sam9n12_soc at91_boot_soc
69#endif
70
71#if !defined(CONFIG_SOC_SAMA5D3)
72#define sama5d3_soc at91_boot_soc
73#endif
74
75#if !defined(CONFIG_SOC_SAMA5D4)
76#define sama5d4_soc at91_boot_soc
77#endif
diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c b/arch/arm/mach-bcm/platsmp-brcmstb.c
index 31c87a284a34..e209e6fc7caf 100644
--- a/arch/arm/mach-bcm/platsmp-brcmstb.c
+++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
@@ -17,6 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/jiffies.h>
20#include <linux/of_address.h> 21#include <linux/of_address.h>
21#include <linux/of_platform.h> 22#include <linux/of_platform.h>
22#include <linux/printk.h> 23#include <linux/printk.h>
@@ -94,10 +95,35 @@ static u32 pwr_ctrl_rd(u32 cpu)
94 return readl_relaxed(base); 95 return readl_relaxed(base);
95} 96}
96 97
97static void pwr_ctrl_wr(u32 cpu, u32 val) 98static void pwr_ctrl_set(unsigned int cpu, u32 val, u32 mask)
98{ 99{
99 void __iomem *base = pwr_ctrl_get_base(cpu); 100 void __iomem *base = pwr_ctrl_get_base(cpu);
100 writel(val, base); 101 writel((readl(base) & mask) | val, base);
102}
103
104static void pwr_ctrl_clr(unsigned int cpu, u32 val, u32 mask)
105{
106 void __iomem *base = pwr_ctrl_get_base(cpu);
107 writel((readl(base) & mask) & ~val, base);
108}
109
110#define POLL_TMOUT_MS 500
111static int pwr_ctrl_wait_tmout(unsigned int cpu, u32 set, u32 mask)
112{
113 const unsigned long timeo = jiffies + msecs_to_jiffies(POLL_TMOUT_MS);
114 u32 tmp;
115
116 do {
117 tmp = pwr_ctrl_rd(cpu) & mask;
118 if (!set == !tmp)
119 return 0;
120 } while (time_before(jiffies, timeo));
121
122 tmp = pwr_ctrl_rd(cpu) & mask;
123 if (!set == !tmp)
124 return 0;
125
126 return -ETIMEDOUT;
101} 127}
102 128
103static void cpu_rst_cfg_set(u32 cpu, int set) 129static void cpu_rst_cfg_set(u32 cpu, int set)
@@ -139,15 +165,22 @@ static void brcmstb_cpu_power_on(u32 cpu)
139 * The secondary cores power was cut, so we must go through 165 * The secondary cores power was cut, so we must go through
140 * power-on initialization. 166 * power-on initialization.
141 */ 167 */
142 u32 tmp; 168 pwr_ctrl_set(cpu, ZONE_MAN_ISO_CNTL_MASK, 0xffffff00);
169 pwr_ctrl_set(cpu, ZONE_MANUAL_CONTROL_MASK, -1);
170 pwr_ctrl_set(cpu, ZONE_RESERVED_1_MASK, -1);
143 171
144 /* Request zone power up */ 172 pwr_ctrl_set(cpu, ZONE_MAN_MEM_PWR_MASK, -1);
145 pwr_ctrl_wr(cpu, ZONE_PWR_UP_REQ_MASK);
146 173
147 /* Wait for the power up FSM to complete */ 174 if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_MEM_PWR_STATE_MASK))
148 do { 175 panic("ZONE_MEM_PWR_STATE_MASK set timeout");
149 tmp = pwr_ctrl_rd(cpu); 176
150 } while (!(tmp & ZONE_PWR_ON_STATE_MASK)); 177 pwr_ctrl_set(cpu, ZONE_MAN_CLKEN_MASK, -1);
178
179 if (pwr_ctrl_wait_tmout(cpu, 1, ZONE_DPG_PWR_STATE_MASK))
180 panic("ZONE_DPG_PWR_STATE_MASK set timeout");
181
182 pwr_ctrl_clr(cpu, ZONE_MAN_ISO_CNTL_MASK, -1);
183 pwr_ctrl_set(cpu, ZONE_MAN_RESET_CNTL_MASK, -1);
151} 184}
152 185
153static int brcmstb_cpu_get_power_state(u32 cpu) 186static int brcmstb_cpu_get_power_state(u32 cpu)
@@ -174,25 +207,33 @@ static void brcmstb_cpu_die(u32 cpu)
174 207
175static int brcmstb_cpu_kill(u32 cpu) 208static int brcmstb_cpu_kill(u32 cpu)
176{ 209{
177 u32 tmp; 210 /*
211 * Ordinarily, the hardware forbids power-down of CPU0 (which is good
212 * because it is the boot CPU), but this is not true when using BPCM
213 * manual mode. Consequently, we must avoid turning off CPU0 here to
214 * ensure that TI2C master reset will work.
215 */
216 if (cpu == 0) {
217 pr_warn("SMP: refusing to power off CPU0\n");
218 return 1;
219 }
178 220
179 while (per_cpu_sw_state_rd(cpu)) 221 while (per_cpu_sw_state_rd(cpu))
180 ; 222 ;
181 223
182 /* Program zone reset */ 224 pwr_ctrl_set(cpu, ZONE_MANUAL_CONTROL_MASK, -1);
183 pwr_ctrl_wr(cpu, ZONE_RESET_STATE_MASK | ZONE_BLK_RST_ASSERT_MASK | 225 pwr_ctrl_clr(cpu, ZONE_MAN_RESET_CNTL_MASK, -1);
184 ZONE_PWR_DN_REQ_MASK); 226 pwr_ctrl_clr(cpu, ZONE_MAN_CLKEN_MASK, -1);
227 pwr_ctrl_set(cpu, ZONE_MAN_ISO_CNTL_MASK, -1);
228 pwr_ctrl_clr(cpu, ZONE_MAN_MEM_PWR_MASK, -1);
185 229
186 /* Verify zone reset */ 230 if (pwr_ctrl_wait_tmout(cpu, 0, ZONE_MEM_PWR_STATE_MASK))
187 tmp = pwr_ctrl_rd(cpu); 231 panic("ZONE_MEM_PWR_STATE_MASK clear timeout");
188 if (!(tmp & ZONE_RESET_STATE_MASK))
189 pr_err("%s: Zone reset bit for CPU %d not asserted!\n",
190 __func__, cpu);
191 232
192 /* Wait for power down */ 233 pwr_ctrl_clr(cpu, ZONE_RESERVED_1_MASK, -1);
193 do { 234
194 tmp = pwr_ctrl_rd(cpu); 235 if (pwr_ctrl_wait_tmout(cpu, 0, ZONE_DPG_PWR_STATE_MASK))
195 } while (!(tmp & ZONE_PWR_OFF_STATE_MASK)); 236 panic("ZONE_DPG_PWR_STATE_MASK clear timeout");
196 237
197 /* Flush pipeline before resetting CPU */ 238 /* Flush pipeline before resetting CPU */
198 mb(); 239 mb();
diff --git a/arch/arm/mach-digicolor/Kconfig b/arch/arm/mach-digicolor/Kconfig
new file mode 100644
index 000000000000..4f36d8d2bc57
--- /dev/null
+++ b/arch/arm/mach-digicolor/Kconfig
@@ -0,0 +1,7 @@
1config ARCH_DIGICOLOR
2 bool "Conexant Digicolor SoC Support"
3 depends on ARCH_MULTI_V7
4 select CLKSRC_MMIO
5 select DIGICOLOR_TIMER
6 select GENERIC_IRQ_CHIP
7 select MFD_SYSCON
diff --git a/arch/arm/mach-digicolor/Makefile b/arch/arm/mach-digicolor/Makefile
new file mode 100644
index 000000000000..3d8a1d228408
--- /dev/null
+++ b/arch/arm/mach-digicolor/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_ARCH_DIGICOLOR) += digicolor.o
diff --git a/arch/arm/mach-digicolor/digicolor.c b/arch/arm/mach-digicolor/digicolor.c
new file mode 100644
index 000000000000..cfc88d1caa47
--- /dev/null
+++ b/arch/arm/mach-digicolor/digicolor.c
@@ -0,0 +1,18 @@
1/*
2 * Support for Conexant Digicolor SoCs
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 <asm/mach/arch.h>
10
11static const char *digicolor_dt_compat[] __initconst = {
12 "cnxt,cx92755",
13 NULL,
14};
15
16DT_MACHINE_START(DIGICOLOR, "Conexant Digicolor (Flattened Device Tree)")
17 .dt_compat = digicolor_dt_compat,
18MACHINE_END
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 2c844393cc4b..78eca99b98d1 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -247,6 +247,7 @@ static void __init exynos_reserve(void)
247 "samsung,mfc-v5", 247 "samsung,mfc-v5",
248 "samsung,mfc-v6", 248 "samsung,mfc-v6",
249 "samsung,mfc-v7", 249 "samsung,mfc-v7",
250 "samsung,mfc-v8",
250 }; 251 };
251 252
252 for (i = 0; i < ARRAY_SIZE(mfc_mem); i++) 253 for (i = 0; i < ARRAY_SIZE(mfc_mem); i++)
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index b5f4406fc1b5..eb461e1c325a 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -160,12 +160,14 @@
160#define EXYNOS5_L2RSTDISABLE_VALUE BIT(3) 160#define EXYNOS5_L2RSTDISABLE_VALUE BIT(3)
161 161
162#define S5P_PAD_RET_MAUDIO_OPTION 0x3028 162#define S5P_PAD_RET_MAUDIO_OPTION 0x3028
163#define S5P_PAD_RET_MMC2_OPTION 0x30c8
163#define S5P_PAD_RET_GPIO_OPTION 0x3108 164#define S5P_PAD_RET_GPIO_OPTION 0x3108
164#define S5P_PAD_RET_UART_OPTION 0x3128 165#define S5P_PAD_RET_UART_OPTION 0x3128
165#define S5P_PAD_RET_MMCA_OPTION 0x3148 166#define S5P_PAD_RET_MMCA_OPTION 0x3148
166#define S5P_PAD_RET_MMCB_OPTION 0x3168 167#define S5P_PAD_RET_MMCB_OPTION 0x3168
167#define S5P_PAD_RET_EBIA_OPTION 0x3188 168#define S5P_PAD_RET_EBIA_OPTION 0x3188
168#define S5P_PAD_RET_EBIB_OPTION 0x31A8 169#define S5P_PAD_RET_EBIB_OPTION 0x31A8
170#define S5P_PAD_RET_SPI_OPTION 0x31c8
169 171
170#define S5P_PS_HOLD_CONTROL 0x330C 172#define S5P_PS_HOLD_CONTROL 0x330C
171#define S5P_PS_HOLD_EN (1 << 31) 173#define S5P_PS_HOLD_EN (1 << 31)
@@ -326,6 +328,7 @@
326 (EXYNOS3_ARM_CORE0_OPTION + ((_nr) * 0x80)) 328 (EXYNOS3_ARM_CORE0_OPTION + ((_nr) * 0x80))
327 329
328#define EXYNOS3_ARM_COMMON_OPTION 0x2408 330#define EXYNOS3_ARM_COMMON_OPTION 0x2408
331#define EXYNOS3_ARM_L2_OPTION 0x2608
329#define EXYNOS3_TOP_PWR_OPTION 0x2C48 332#define EXYNOS3_TOP_PWR_OPTION 0x2C48
330#define EXYNOS3_CORE_TOP_PWR_OPTION 0x2CA8 333#define EXYNOS3_CORE_TOP_PWR_OPTION 0x2CA8
331#define EXYNOS3_XUSBXTI_DURATION 0x341C 334#define EXYNOS3_XUSBXTI_DURATION 0x341C
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index 342797b9bf3b..82e6b6fba23f 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -86,6 +86,12 @@ static unsigned int exynos_pmu_spare3;
86 86
87static u32 exynos_irqwake_intmask = 0xffffffff; 87static u32 exynos_irqwake_intmask = 0xffffffff;
88 88
89static const struct exynos_wkup_irq exynos3250_wkup_irq[] = {
90 { 73, BIT(1) }, /* RTC alarm */
91 { 74, BIT(2) }, /* RTC tick */
92 { /* sentinel */ },
93};
94
89static const struct exynos_wkup_irq exynos4_wkup_irq[] = { 95static const struct exynos_wkup_irq exynos4_wkup_irq[] = {
90 { 76, BIT(1) }, /* RTC alarm */ 96 { 76, BIT(1) }, /* RTC alarm */
91 { 77, BIT(2) }, /* RTC tick */ 97 { 77, BIT(2) }, /* RTC tick */
@@ -109,6 +115,19 @@ unsigned int exynos_release_ret_regs[] = {
109 REG_TABLE_END, 115 REG_TABLE_END,
110}; 116};
111 117
118unsigned int exynos3250_release_ret_regs[] = {
119 S5P_PAD_RET_MAUDIO_OPTION,
120 S5P_PAD_RET_GPIO_OPTION,
121 S5P_PAD_RET_UART_OPTION,
122 S5P_PAD_RET_MMCA_OPTION,
123 S5P_PAD_RET_MMCB_OPTION,
124 S5P_PAD_RET_EBIA_OPTION,
125 S5P_PAD_RET_EBIB_OPTION,
126 S5P_PAD_RET_MMC2_OPTION,
127 S5P_PAD_RET_SPI_OPTION,
128 REG_TABLE_END,
129};
130
112unsigned int exynos5420_release_ret_regs[] = { 131unsigned int exynos5420_release_ret_regs[] = {
113 EXYNOS_PAD_RET_DRAM_OPTION, 132 EXYNOS_PAD_RET_DRAM_OPTION,
114 EXYNOS_PAD_RET_MAUDIO_OPTION, 133 EXYNOS_PAD_RET_MAUDIO_OPTION,
@@ -168,6 +187,12 @@ static int exynos_cpu_suspend(unsigned long arg)
168 return exynos_cpu_do_idle(); 187 return exynos_cpu_do_idle();
169} 188}
170 189
190static int exynos3250_cpu_suspend(unsigned long arg)
191{
192 flush_cache_all();
193 return exynos_cpu_do_idle();
194}
195
171static int exynos5420_cpu_suspend(unsigned long arg) 196static int exynos5420_cpu_suspend(unsigned long arg)
172{ 197{
173 /* MCPM works with HW CPU identifiers */ 198 /* MCPM works with HW CPU identifiers */
@@ -225,6 +250,23 @@ static void exynos_pm_prepare(void)
225 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0); 250 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
226} 251}
227 252
253static void exynos3250_pm_prepare(void)
254{
255 unsigned int tmp;
256
257 /* Set wake-up mask registers */
258 exynos_pm_set_wakeup_mask();
259
260 tmp = pmu_raw_readl(EXYNOS3_ARM_L2_OPTION);
261 tmp &= ~EXYNOS5_OPTION_USE_RETENTION;
262 pmu_raw_writel(tmp, EXYNOS3_ARM_L2_OPTION);
263
264 exynos_pm_enter_sleep_mode();
265
266 /* ensure at least INFORM0 has the resume address */
267 pmu_raw_writel(virt_to_phys(exynos_cpu_resume), S5P_INFORM0);
268}
269
228static void exynos5420_pm_prepare(void) 270static void exynos5420_pm_prepare(void)
229{ 271{
230 unsigned int tmp; 272 unsigned int tmp;
@@ -339,6 +381,28 @@ early_wakeup:
339 pmu_raw_writel(0x0, S5P_INFORM1); 381 pmu_raw_writel(0x0, S5P_INFORM1);
340} 382}
341 383
384static void exynos3250_pm_resume(void)
385{
386 u32 cpuid = read_cpuid_part();
387
388 if (exynos_pm_central_resume())
389 goto early_wakeup;
390
391 /* For release retention */
392 exynos_pm_release_retention();
393
394 pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION);
395
396 if (call_firmware_op(resume) == -ENOSYS
397 && cpuid == ARM_CPU_PART_CORTEX_A9)
398 exynos_cpu_restore_register();
399
400early_wakeup:
401
402 /* Clear SLEEP mode set in INFORM1 */
403 pmu_raw_writel(0x0, S5P_INFORM1);
404}
405
342static void exynos5420_prepare_pm_resume(void) 406static void exynos5420_prepare_pm_resume(void)
343{ 407{
344 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM)) 408 if (IS_ENABLED(CONFIG_EXYNOS5420_MCPM))
@@ -478,6 +542,16 @@ static const struct platform_suspend_ops exynos_suspend_ops = {
478 .valid = suspend_valid_only_mem, 542 .valid = suspend_valid_only_mem,
479}; 543};
480 544
545static const struct exynos_pm_data exynos3250_pm_data = {
546 .wkup_irq = exynos3250_wkup_irq,
547 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
548 .release_ret_regs = exynos3250_release_ret_regs,
549 .pm_suspend = exynos_pm_suspend,
550 .pm_resume = exynos3250_pm_resume,
551 .pm_prepare = exynos3250_pm_prepare,
552 .cpu_suspend = exynos3250_cpu_suspend,
553};
554
481static const struct exynos_pm_data exynos4_pm_data = { 555static const struct exynos_pm_data exynos4_pm_data = {
482 .wkup_irq = exynos4_wkup_irq, 556 .wkup_irq = exynos4_wkup_irq,
483 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), 557 .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)),
@@ -511,6 +585,9 @@ static struct exynos_pm_data exynos5420_pm_data = {
511 585
512static struct of_device_id exynos_pmu_of_device_ids[] = { 586static struct of_device_id exynos_pmu_of_device_ids[] = {
513 { 587 {
588 .compatible = "samsung,exynos3250-pmu",
589 .data = &exynos3250_pm_data,
590 }, {
514 .compatible = "samsung,exynos4210-pmu", 591 .compatible = "samsung,exynos4210-pmu",
515 .data = &exynos4_pm_data, 592 .data = &exynos4_pm_data,
516 }, { 593 }, {
diff --git a/arch/arm/mach-hisi/Kconfig b/arch/arm/mach-hisi/Kconfig
index cd19433f76d3..83061ad0e282 100644
--- a/arch/arm/mach-hisi/Kconfig
+++ b/arch/arm/mach-hisi/Kconfig
@@ -22,6 +22,14 @@ config ARCH_HI3xxx
22 help 22 help
23 Support for Hisilicon Hi36xx SoC family 23 Support for Hisilicon Hi36xx SoC family
24 24
25config ARCH_HIP01
26 bool "Hisilicon HIP01 family" if ARCH_MULTI_V7
27 select HAVE_ARM_SCU if SMP
28 select HAVE_ARM_TWD if SMP
29 select ARM_GLOBAL_TIMER
30 help
31 Support for Hisilicon HIP01 SoC family
32
25config ARCH_HIP04 33config ARCH_HIP04
26 bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7 34 bool "Hisilicon HiP04 Cortex A15 family" if ARCH_MULTI_V7
27 select ARM_ERRATA_798181 if SMP 35 select ARM_ERRATA_798181 if SMP
diff --git a/arch/arm/mach-hisi/core.h b/arch/arm/mach-hisi/core.h
index 88b1f487d065..92a682d8e939 100644
--- a/arch/arm/mach-hisi/core.h
+++ b/arch/arm/mach-hisi/core.h
@@ -12,9 +12,12 @@ extern void hi3xxx_cpu_die(unsigned int cpu);
12extern int hi3xxx_cpu_kill(unsigned int cpu); 12extern int hi3xxx_cpu_kill(unsigned int cpu);
13extern void hi3xxx_set_cpu(int cpu, bool enable); 13extern void hi3xxx_set_cpu(int cpu, bool enable);
14 14
15extern void hix5hd2_secondary_startup(void); 15extern void hisi_secondary_startup(void);
16extern struct smp_operations hix5hd2_smp_ops; 16extern struct smp_operations hix5hd2_smp_ops;
17extern void hix5hd2_set_cpu(int cpu, bool enable); 17extern void hix5hd2_set_cpu(int cpu, bool enable);
18extern void hix5hd2_cpu_die(unsigned int cpu); 18extern void hix5hd2_cpu_die(unsigned int cpu);
19 19
20extern struct smp_operations hip01_smp_ops;
21extern void hip01_set_cpu(int cpu, bool enable);
22extern void hip01_cpu_die(unsigned int cpu);
20#endif 23#endif
diff --git a/arch/arm/mach-hisi/headsmp.S b/arch/arm/mach-hisi/headsmp.S
index 278889c00b77..81e35b159e75 100644
--- a/arch/arm/mach-hisi/headsmp.S
+++ b/arch/arm/mach-hisi/headsmp.S
@@ -11,6 +11,6 @@
11 11
12 __CPUINIT 12 __CPUINIT
13 13
14ENTRY(hix5hd2_secondary_startup) 14ENTRY(hisi_secondary_startup)
15 bl v7_invalidate_l1 15 bl v7_invalidate_l1
16 b secondary_startup 16 b secondary_startup
diff --git a/arch/arm/mach-hisi/hisilicon.c b/arch/arm/mach-hisi/hisilicon.c
index 7744c351bbfd..76b907078b58 100644
--- a/arch/arm/mach-hisi/hisilicon.c
+++ b/arch/arm/mach-hisi/hisilicon.c
@@ -72,3 +72,13 @@ static const char *hip04_compat[] __initconst = {
72DT_MACHINE_START(HIP04, "Hisilicon HiP04 (Flattened Device Tree)") 72DT_MACHINE_START(HIP04, "Hisilicon HiP04 (Flattened Device Tree)")
73 .dt_compat = hip04_compat, 73 .dt_compat = hip04_compat,
74MACHINE_END 74MACHINE_END
75
76static const char *hip01_compat[] __initconst = {
77 "hisilicon,hip01",
78 "hisilicon,hip01-ca9x2",
79 NULL,
80};
81
82DT_MACHINE_START(HIP01, "Hisilicon HIP01 (Flattened Device Tree)")
83 .dt_compat = hip01_compat,
84MACHINE_END
diff --git a/arch/arm/mach-hisi/hotplug.c b/arch/arm/mach-hisi/hotplug.c
index 84e6919f68c7..a129aae72602 100644
--- a/arch/arm/mach-hisi/hotplug.c
+++ b/arch/arm/mach-hisi/hotplug.c
@@ -65,6 +65,9 @@
65#define PMC0_CPU1_PMC_ENABLE (1 << 7) 65#define PMC0_CPU1_PMC_ENABLE (1 << 7)
66#define PMC0_CPU1_POWERDOWN (1 << 3) 66#define PMC0_CPU1_POWERDOWN (1 << 3)
67 67
68#define HIP01_PERI9 0x50
69#define PERI9_CPU1_RESET (1 << 1)
70
68enum { 71enum {
69 HI3620_CTRL, 72 HI3620_CTRL,
70 ERROR_CTRL, 73 ERROR_CTRL,
@@ -209,6 +212,34 @@ void hix5hd2_set_cpu(int cpu, bool enable)
209 } 212 }
210} 213}
211 214
215void hip01_set_cpu(int cpu, bool enable)
216{
217 unsigned int temp;
218 struct device_node *np;
219
220 if (!ctrl_base) {
221 np = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl");
222 if (np)
223 ctrl_base = of_iomap(np, 0);
224 else
225 BUG();
226 }
227
228 if (enable) {
229 /* reset on CPU1 */
230 temp = readl_relaxed(ctrl_base + HIP01_PERI9);
231 temp |= PERI9_CPU1_RESET;
232 writel_relaxed(temp, ctrl_base + HIP01_PERI9);
233
234 udelay(50);
235
236 /* unreset on CPU1 */
237 temp = readl_relaxed(ctrl_base + HIP01_PERI9);
238 temp &= ~PERI9_CPU1_RESET;
239 writel_relaxed(temp, ctrl_base + HIP01_PERI9);
240 }
241}
242
212static inline void cpu_enter_lowpower(void) 243static inline void cpu_enter_lowpower(void)
213{ 244{
214 unsigned int v; 245 unsigned int v;
diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 575dd8285f1f..8880c8e8b296 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -10,10 +10,12 @@
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/io.h> 11#include <linux/io.h>
12#include <linux/of_address.h> 12#include <linux/of_address.h>
13#include <linux/delay.h>
13 14
14#include <asm/cacheflush.h> 15#include <asm/cacheflush.h>
15#include <asm/smp_plat.h> 16#include <asm/smp_plat.h>
16#include <asm/smp_scu.h> 17#include <asm/smp_scu.h>
18#include <asm/mach/map.h>
17 19
18#include "core.h" 20#include "core.h"
19 21
@@ -96,7 +98,7 @@ struct smp_operations hi3xxx_smp_ops __initdata = {
96#endif 98#endif
97}; 99};
98 100
99static void __init hix5hd2_smp_prepare_cpus(unsigned int max_cpus) 101static void __init hisi_common_smp_prepare_cpus(unsigned int max_cpus)
100{ 102{
101 hisi_enable_scu_a9(); 103 hisi_enable_scu_a9();
102} 104}
@@ -116,7 +118,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct task_struct *idle)
116{ 118{
117 phys_addr_t jumpaddr; 119 phys_addr_t jumpaddr;
118 120
119 jumpaddr = virt_to_phys(hix5hd2_secondary_startup); 121 jumpaddr = virt_to_phys(hisi_secondary_startup);
120 hix5hd2_set_scu_boot_addr(HIX5HD2_BOOT_ADDRESS, jumpaddr); 122 hix5hd2_set_scu_boot_addr(HIX5HD2_BOOT_ADDRESS, jumpaddr);
121 hix5hd2_set_cpu(cpu, true); 123 hix5hd2_set_cpu(cpu, true);
122 arch_send_wakeup_ipi_mask(cpumask_of(cpu)); 124 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
@@ -125,12 +127,60 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct task_struct *idle)
125 127
126 128
127struct smp_operations hix5hd2_smp_ops __initdata = { 129struct smp_operations hix5hd2_smp_ops __initdata = {
128 .smp_prepare_cpus = hix5hd2_smp_prepare_cpus, 130 .smp_prepare_cpus = hisi_common_smp_prepare_cpus,
129 .smp_boot_secondary = hix5hd2_boot_secondary, 131 .smp_boot_secondary = hix5hd2_boot_secondary,
130#ifdef CONFIG_HOTPLUG_CPU 132#ifdef CONFIG_HOTPLUG_CPU
131 .cpu_die = hix5hd2_cpu_die, 133 .cpu_die = hix5hd2_cpu_die,
132#endif 134#endif
133}; 135};
134 136
137
138#define SC_SCTL_REMAP_CLR 0x00000100
139#define HIP01_BOOT_ADDRESS 0x80000000
140#define REG_SC_CTRL 0x000
141
142void hip01_set_boot_addr(phys_addr_t start_addr, phys_addr_t jump_addr)
143{
144 void __iomem *virt;
145
146 virt = phys_to_virt(start_addr);
147
148 writel_relaxed(0xe51ff004, virt);
149 writel_relaxed(jump_addr, virt + 4);
150}
151
152static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle)
153{
154 phys_addr_t jumpaddr;
155 unsigned int remap_reg_value = 0;
156 struct device_node *node;
157
158
159 jumpaddr = virt_to_phys(hisi_secondary_startup);
160 hip01_set_boot_addr(HIP01_BOOT_ADDRESS, jumpaddr);
161
162 node = of_find_compatible_node(NULL, NULL, "hisilicon,hip01-sysctrl");
163 if (WARN_ON(!node))
164 return -1;
165 ctrl_base = of_iomap(node, 0);
166
167 /* set the secondary core boot from DDR */
168 remap_reg_value = readl_relaxed(ctrl_base + REG_SC_CTRL);
169 barrier();
170 remap_reg_value |= SC_SCTL_REMAP_CLR;
171 barrier();
172 writel_relaxed(remap_reg_value, ctrl_base + REG_SC_CTRL);
173
174 hip01_set_cpu(cpu, true);
175
176 return 0;
177}
178
179struct smp_operations hip01_smp_ops __initdata = {
180 .smp_prepare_cpus = hisi_common_smp_prepare_cpus,
181 .smp_boot_secondary = hip01_boot_secondary,
182};
183
135CPU_METHOD_OF_DECLARE(hi3xxx_smp, "hisilicon,hi3620-smp", &hi3xxx_smp_ops); 184CPU_METHOD_OF_DECLARE(hi3xxx_smp, "hisilicon,hi3620-smp", &hi3xxx_smp_ops);
136CPU_METHOD_OF_DECLARE(hix5hd2_smp, "hisilicon,hix5hd2-smp", &hix5hd2_smp_ops); 185CPU_METHOD_OF_DECLARE(hix5hd2_smp, "hisilicon,hix5hd2-smp", &hix5hd2_smp_ops);
186CPU_METHOD_OF_DECLARE(hip01_smp, "hisilicon,hip01-smp", &hip01_smp_ops);
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index f5ac685a29fc..8d1b10180908 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -32,8 +32,7 @@ ifeq ($(CONFIG_CPU_IDLE),y)
32obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o 32obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o
33obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o 33obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o
34obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o 34obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o
35# i.MX6SX reuses i.MX6Q cpuidle driver 35obj-$(CONFIG_SOC_IMX6SX) += cpuidle-imx6sx.o
36obj-$(CONFIG_SOC_IMX6SX) += cpuidle-imx6q.o
37endif 36endif
38 37
39ifdef CONFIG_SND_IMX_SOC 38ifdef CONFIG_SND_IMX_SOC
diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c
index 5a75cdc81891..8935bff99fe7 100644
--- a/arch/arm/mach-imx/clk-gate2.c
+++ b/arch/arm/mach-imx/clk-gate2.c
@@ -96,15 +96,30 @@ static int clk_gate2_is_enabled(struct clk_hw *hw)
96{ 96{
97 struct clk_gate2 *gate = to_clk_gate2(hw); 97 struct clk_gate2 *gate = to_clk_gate2(hw);
98 98
99 if (gate->share_count) 99 return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
100 return !!__clk_get_enable_count(hw->clk); 100}
101 else 101
102 return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx); 102static void clk_gate2_disable_unused(struct clk_hw *hw)
103{
104 struct clk_gate2 *gate = to_clk_gate2(hw);
105 unsigned long flags = 0;
106 u32 reg;
107
108 spin_lock_irqsave(gate->lock, flags);
109
110 if (!gate->share_count || *gate->share_count == 0) {
111 reg = readl(gate->reg);
112 reg &= ~(3 << gate->bit_idx);
113 writel(reg, gate->reg);
114 }
115
116 spin_unlock_irqrestore(gate->lock, flags);
103} 117}
104 118
105static struct clk_ops clk_gate2_ops = { 119static struct clk_ops clk_gate2_ops = {
106 .enable = clk_gate2_enable, 120 .enable = clk_gate2_enable,
107 .disable = clk_gate2_disable, 121 .disable = clk_gate2_disable,
122 .disable_unused = clk_gate2_disable_unused,
108 .is_enabled = clk_gate2_is_enabled, 123 .is_enabled = clk_gate2_is_enabled,
109}; 124};
110 125
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c
index 2daef619d053..d04a430607b8 100644
--- a/arch/arm/mach-imx/clk-imx6q.c
+++ b/arch/arm/mach-imx/clk-imx6q.c
@@ -386,7 +386,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
386 clk[IMX6Q_CLK_ECSPI5] = imx_clk_gate2("ecspi5", "ecspi_root", base + 0x6c, 8); 386 clk[IMX6Q_CLK_ECSPI5] = imx_clk_gate2("ecspi5", "ecspi_root", base + 0x6c, 8);
387 clk[IMX6QDL_CLK_ENET] = imx_clk_gate2("enet", "ipg", base + 0x6c, 10); 387 clk[IMX6QDL_CLK_ENET] = imx_clk_gate2("enet", "ipg", base + 0x6c, 10);
388 clk[IMX6QDL_CLK_ESAI_EXTAL] = imx_clk_gate2_shared("esai_extal", "esai_podf", base + 0x6c, 16, &share_count_esai); 388 clk[IMX6QDL_CLK_ESAI_EXTAL] = imx_clk_gate2_shared("esai_extal", "esai_podf", base + 0x6c, 16, &share_count_esai);
389 clk[IMX6QDL_CLK_ESAI_IPG] = imx_clk_gate2_shared("esai_ipg", "ipg", base + 0x6c, 16, &share_count_esai); 389 clk[IMX6QDL_CLK_ESAI_IPG] = imx_clk_gate2_shared("esai_ipg", "ahb", base + 0x6c, 16, &share_count_esai);
390 clk[IMX6QDL_CLK_ESAI_MEM] = imx_clk_gate2_shared("esai_mem", "ahb", base + 0x6c, 16, &share_count_esai); 390 clk[IMX6QDL_CLK_ESAI_MEM] = imx_clk_gate2_shared("esai_mem", "ahb", base + 0x6c, 16, &share_count_esai);
391 clk[IMX6QDL_CLK_GPT_IPG] = imx_clk_gate2("gpt_ipg", "ipg", base + 0x6c, 20); 391 clk[IMX6QDL_CLK_GPT_IPG] = imx_clk_gate2("gpt_ipg", "ipg", base + 0x6c, 20);
392 clk[IMX6QDL_CLK_GPT_IPG_PER] = imx_clk_gate2("gpt_ipg_per", "ipg_per", base + 0x6c, 22); 392 clk[IMX6QDL_CLK_GPT_IPG_PER] = imx_clk_gate2("gpt_ipg_per", "ipg_per", base + 0x6c, 22);
diff --git a/arch/arm/mach-imx/clk-pllv3.c b/arch/arm/mach-imx/clk-pllv3.c
index 0ad6e5442fd8..641ebc508920 100644
--- a/arch/arm/mach-imx/clk-pllv3.c
+++ b/arch/arm/mach-imx/clk-pllv3.c
@@ -31,6 +31,7 @@
31 * @base: base address of PLL registers 31 * @base: base address of PLL registers
32 * @powerup_set: set POWER bit to power up the PLL 32 * @powerup_set: set POWER bit to power up the PLL
33 * @div_mask: mask of divider bits 33 * @div_mask: mask of divider bits
34 * @div_shift: shift of divider bits
34 * 35 *
35 * IMX PLL clock version 3, found on i.MX6 series. Divider for pllv3 36 * IMX PLL clock version 3, found on i.MX6 series. Divider for pllv3
36 * is actually a multiplier, and always sits at bit 0. 37 * is actually a multiplier, and always sits at bit 0.
@@ -40,6 +41,7 @@ struct clk_pllv3 {
40 void __iomem *base; 41 void __iomem *base;
41 bool powerup_set; 42 bool powerup_set;
42 u32 div_mask; 43 u32 div_mask;
44 u32 div_shift;
43}; 45};
44 46
45#define to_clk_pllv3(_hw) container_of(_hw, struct clk_pllv3, hw) 47#define to_clk_pllv3(_hw) container_of(_hw, struct clk_pllv3, hw)
@@ -97,7 +99,7 @@ static unsigned long clk_pllv3_recalc_rate(struct clk_hw *hw,
97 unsigned long parent_rate) 99 unsigned long parent_rate)
98{ 100{
99 struct clk_pllv3 *pll = to_clk_pllv3(hw); 101 struct clk_pllv3 *pll = to_clk_pllv3(hw);
100 u32 div = readl_relaxed(pll->base) & pll->div_mask; 102 u32 div = (readl_relaxed(pll->base) >> pll->div_shift) & pll->div_mask;
101 103
102 return (div == 1) ? parent_rate * 22 : parent_rate * 20; 104 return (div == 1) ? parent_rate * 22 : parent_rate * 20;
103} 105}
@@ -125,8 +127,8 @@ static int clk_pllv3_set_rate(struct clk_hw *hw, unsigned long rate,
125 return -EINVAL; 127 return -EINVAL;
126 128
127 val = readl_relaxed(pll->base); 129 val = readl_relaxed(pll->base);
128 val &= ~pll->div_mask; 130 val &= ~(pll->div_mask << pll->div_shift);
129 val |= div; 131 val |= (div << pll->div_shift);
130 writel_relaxed(val, pll->base); 132 writel_relaxed(val, pll->base);
131 133
132 return clk_pllv3_wait_lock(pll); 134 return clk_pllv3_wait_lock(pll);
@@ -295,6 +297,8 @@ struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
295 case IMX_PLLV3_SYS: 297 case IMX_PLLV3_SYS:
296 ops = &clk_pllv3_sys_ops; 298 ops = &clk_pllv3_sys_ops;
297 break; 299 break;
300 case IMX_PLLV3_USB_VF610:
301 pll->div_shift = 1;
298 case IMX_PLLV3_USB: 302 case IMX_PLLV3_USB:
299 ops = &clk_pllv3_ops; 303 ops = &clk_pllv3_ops;
300 pll->powerup_set = true; 304 pll->powerup_set = true;
diff --git a/arch/arm/mach-imx/clk-vf610.c b/arch/arm/mach-imx/clk-vf610.c
index 5937ddee1a99..61876ed6e11e 100644
--- a/arch/arm/mach-imx/clk-vf610.c
+++ b/arch/arm/mach-imx/clk-vf610.c
@@ -172,11 +172,11 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
172 172
173 clk[VF610_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll1", "pll1_bypass_src", PLL1_CTRL, 0x1); 173 clk[VF610_CLK_PLL1] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll1", "pll1_bypass_src", PLL1_CTRL, 0x1);
174 clk[VF610_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", PLL2_CTRL, 0x1); 174 clk[VF610_CLK_PLL2] = imx_clk_pllv3(IMX_PLLV3_GENERIC, "pll2", "pll2_bypass_src", PLL2_CTRL, 0x1);
175 clk[VF610_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB, "pll3", "pll3_bypass_src", PLL3_CTRL, 0x1); 175 clk[VF610_CLK_PLL3] = imx_clk_pllv3(IMX_PLLV3_USB_VF610, "pll3", "pll3_bypass_src", PLL3_CTRL, 0x2);
176 clk[VF610_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV, "pll4", "pll4_bypass_src", PLL4_CTRL, 0x7f); 176 clk[VF610_CLK_PLL4] = imx_clk_pllv3(IMX_PLLV3_AV, "pll4", "pll4_bypass_src", PLL4_CTRL, 0x7f);
177 clk[VF610_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_ENET, "pll5", "pll5_bypass_src", PLL5_CTRL, 0x3); 177 clk[VF610_CLK_PLL5] = imx_clk_pllv3(IMX_PLLV3_ENET, "pll5", "pll5_bypass_src", PLL5_CTRL, 0x3);
178 clk[VF610_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_AV, "pll6", "pll6_bypass_src", PLL6_CTRL, 0x7f); 178 clk[VF610_CLK_PLL6] = imx_clk_pllv3(IMX_PLLV3_AV, "pll6", "pll6_bypass_src", PLL6_CTRL, 0x7f);
179 clk[VF610_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB, "pll7", "pll7_bypass_src", PLL7_CTRL, 0x1); 179 clk[VF610_CLK_PLL7] = imx_clk_pllv3(IMX_PLLV3_USB_VF610, "pll7", "pll7_bypass_src", PLL7_CTRL, 0x2);
180 180
181 clk[VF610_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", PLL1_CTRL, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT); 181 clk[VF610_PLL1_BYPASS] = imx_clk_mux_flags("pll1_bypass", PLL1_CTRL, 16, 1, pll1_bypass_sels, ARRAY_SIZE(pll1_bypass_sels), CLK_SET_RATE_PARENT);
182 clk[VF610_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", PLL2_CTRL, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT); 182 clk[VF610_PLL2_BYPASS] = imx_clk_mux_flags("pll2_bypass", PLL2_CTRL, 16, 1, pll2_bypass_sels, ARRAY_SIZE(pll2_bypass_sels), CLK_SET_RATE_PARENT);
@@ -267,6 +267,8 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
267 clk[VF610_CLK_UART1] = imx_clk_gate2("uart1", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(8)); 267 clk[VF610_CLK_UART1] = imx_clk_gate2("uart1", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(8));
268 clk[VF610_CLK_UART2] = imx_clk_gate2("uart2", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(9)); 268 clk[VF610_CLK_UART2] = imx_clk_gate2("uart2", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(9));
269 clk[VF610_CLK_UART3] = imx_clk_gate2("uart3", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(10)); 269 clk[VF610_CLK_UART3] = imx_clk_gate2("uart3", "ipg_bus", CCM_CCGR0, CCM_CCGRx_CGn(10));
270 clk[VF610_CLK_UART4] = imx_clk_gate2("uart4", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(9));
271 clk[VF610_CLK_UART5] = imx_clk_gate2("uart5", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(10));
270 272
271 clk[VF610_CLK_I2C0] = imx_clk_gate2("i2c0", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(6)); 273 clk[VF610_CLK_I2C0] = imx_clk_gate2("i2c0", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(6));
272 clk[VF610_CLK_I2C1] = imx_clk_gate2("i2c1", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(7)); 274 clk[VF610_CLK_I2C1] = imx_clk_gate2("i2c1", "ipg_bus", CCM_CCGR4, CCM_CCGRx_CGn(7));
@@ -380,6 +382,8 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
380 clk[VF610_CLK_DMAMUX2] = imx_clk_gate2("dmamux2", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(1)); 382 clk[VF610_CLK_DMAMUX2] = imx_clk_gate2("dmamux2", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(1));
381 clk[VF610_CLK_DMAMUX3] = imx_clk_gate2("dmamux3", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(2)); 383 clk[VF610_CLK_DMAMUX3] = imx_clk_gate2("dmamux3", "platform_bus", CCM_CCGR6, CCM_CCGRx_CGn(2));
382 384
385 clk[VF610_CLK_SNVS] = imx_clk_gate2("snvs-rtc", "ipg_bus", CCM_CCGR6, CCM_CCGRx_CGn(7));
386
383 imx_check_clocks(clk, ARRAY_SIZE(clk)); 387 imx_check_clocks(clk, ARRAY_SIZE(clk));
384 388
385 clk_set_parent(clk[VF610_CLK_QSPI0_SEL], clk[VF610_CLK_PLL1_PFD4]); 389 clk_set_parent(clk[VF610_CLK_QSPI0_SEL], clk[VF610_CLK_PLL1_PFD4]);
diff --git a/arch/arm/mach-imx/clk.h b/arch/arm/mach-imx/clk.h
index 5ef82e2f8fc5..6a07903a28bc 100644
--- a/arch/arm/mach-imx/clk.h
+++ b/arch/arm/mach-imx/clk.h
@@ -20,6 +20,7 @@ enum imx_pllv3_type {
20 IMX_PLLV3_GENERIC, 20 IMX_PLLV3_GENERIC,
21 IMX_PLLV3_SYS, 21 IMX_PLLV3_SYS,
22 IMX_PLLV3_USB, 22 IMX_PLLV3_USB,
23 IMX_PLLV3_USB_VF610,
23 IMX_PLLV3_AV, 24 IMX_PLLV3_AV,
24 IMX_PLLV3_ENET, 25 IMX_PLLV3_ENET,
25}; 26};
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h
index cfcdb623d78f..1028b6c505c4 100644
--- a/arch/arm/mach-imx/common.h
+++ b/arch/arm/mach-imx/common.h
@@ -70,6 +70,10 @@ void imx_set_soc_revision(unsigned int rev);
70unsigned int imx_get_soc_revision(void); 70unsigned int imx_get_soc_revision(void);
71void imx_init_revision_from_anatop(void); 71void imx_init_revision_from_anatop(void);
72struct device *imx_soc_device_init(void); 72struct device *imx_soc_device_init(void);
73void imx6_enable_rbc(bool enable);
74void imx_gpc_set_arm_power_in_lpm(bool power_off);
75void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw);
76void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw);
73 77
74enum mxc_cpu_pwr_mode { 78enum mxc_cpu_pwr_mode {
75 WAIT_CLOCKED, /* wfi only */ 79 WAIT_CLOCKED, /* wfi only */
diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c
new file mode 100644
index 000000000000..5a36722b089d
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
@@ -0,0 +1,105 @@
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/cpu_pm.h>
11#include <linux/module.h>
12#include <asm/cpuidle.h>
13#include <asm/proc-fns.h>
14#include <asm/suspend.h>
15
16#include "common.h"
17#include "cpuidle.h"
18
19static int imx6sx_idle_finish(unsigned long val)
20{
21 cpu_do_idle();
22
23 return 0;
24}
25
26static int imx6sx_enter_wait(struct cpuidle_device *dev,
27 struct cpuidle_driver *drv, int index)
28{
29 imx6q_set_lpm(WAIT_UNCLOCKED);
30
31 switch (index) {
32 case 1:
33 cpu_do_idle();
34 break;
35 case 2:
36 imx6_enable_rbc(true);
37 imx_gpc_set_arm_power_in_lpm(true);
38 imx_set_cpu_jump(0, v7_cpu_resume);
39 /* Need to notify there is a cpu pm operation. */
40 cpu_pm_enter();
41 cpu_cluster_pm_enter();
42
43 cpu_suspend(0, imx6sx_idle_finish);
44
45 cpu_cluster_pm_exit();
46 cpu_pm_exit();
47 imx_gpc_set_arm_power_in_lpm(false);
48 imx6_enable_rbc(false);
49 break;
50 default:
51 break;
52 }
53
54 imx6q_set_lpm(WAIT_CLOCKED);
55
56 return index;
57}
58
59static struct cpuidle_driver imx6sx_cpuidle_driver = {
60 .name = "imx6sx_cpuidle",
61 .owner = THIS_MODULE,
62 .states = {
63 /* WFI */
64 ARM_CPUIDLE_WFI_STATE,
65 /* WAIT */
66 {
67 .exit_latency = 50,
68 .target_residency = 75,
69 .flags = CPUIDLE_FLAG_TIMER_STOP,
70 .enter = imx6sx_enter_wait,
71 .name = "WAIT",
72 .desc = "Clock off",
73 },
74 /* WAIT + ARM power off */
75 {
76 /*
77 * ARM gating 31us * 5 + RBC clear 65us
78 * and some margin for SW execution, here set it
79 * to 300us.
80 */
81 .exit_latency = 300,
82 .target_residency = 500,
83 .enter = imx6sx_enter_wait,
84 .name = "LOW-POWER-IDLE",
85 .desc = "ARM power off",
86 },
87 },
88 .state_count = 3,
89 .safe_state_index = 0,
90};
91
92int __init imx6sx_cpuidle_init(void)
93{
94 imx6_enable_rbc(false);
95 /*
96 * set ARM power up/down timing to the fastest,
97 * sw2iso and sw can be set to one 32K cycle = 31us
98 * except for power up sw2iso which need to be
99 * larger than LDO ramp up time.
100 */
101 imx_gpc_set_arm_power_up_timing(2, 1);
102 imx_gpc_set_arm_power_down_timing(1, 1);
103
104 return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
105}
diff --git a/arch/arm/mach-imx/cpuidle.h b/arch/arm/mach-imx/cpuidle.h
index 24e33670417c..f9140128ba05 100644
--- a/arch/arm/mach-imx/cpuidle.h
+++ b/arch/arm/mach-imx/cpuidle.h
@@ -14,6 +14,7 @@
14extern int imx5_cpuidle_init(void); 14extern int imx5_cpuidle_init(void);
15extern int imx6q_cpuidle_init(void); 15extern int imx6q_cpuidle_init(void);
16extern int imx6sl_cpuidle_init(void); 16extern int imx6sl_cpuidle_init(void);
17extern int imx6sx_cpuidle_init(void);
17#else 18#else
18static inline int imx5_cpuidle_init(void) 19static inline int imx5_cpuidle_init(void)
19{ 20{
@@ -27,4 +28,8 @@ static inline int imx6sl_cpuidle_init(void)
27{ 28{
28 return 0; 29 return 0;
29} 30}
31static inline int imx6sx_cpuidle_init(void)
32{
33 return 0;
34}
30#endif 35#endif
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 5f3602ec74fa..745caa18ab2c 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -20,6 +20,10 @@
20 20
21#define GPC_IMR1 0x008 21#define GPC_IMR1 0x008
22#define GPC_PGC_CPU_PDN 0x2a0 22#define GPC_PGC_CPU_PDN 0x2a0
23#define GPC_PGC_CPU_PUPSCR 0x2a4
24#define GPC_PGC_CPU_PDNSCR 0x2a8
25#define GPC_PGC_SW2ISO_SHIFT 0x8
26#define GPC_PGC_SW_SHIFT 0x0
23 27
24#define IMR_NUM 4 28#define IMR_NUM 4
25 29
@@ -27,6 +31,23 @@ static void __iomem *gpc_base;
27static u32 gpc_wake_irqs[IMR_NUM]; 31static u32 gpc_wake_irqs[IMR_NUM];
28static u32 gpc_saved_imrs[IMR_NUM]; 32static u32 gpc_saved_imrs[IMR_NUM];
29 33
34void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw)
35{
36 writel_relaxed((sw2iso << GPC_PGC_SW2ISO_SHIFT) |
37 (sw << GPC_PGC_SW_SHIFT), gpc_base + GPC_PGC_CPU_PUPSCR);
38}
39
40void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw)
41{
42 writel_relaxed((sw2iso << GPC_PGC_SW2ISO_SHIFT) |
43 (sw << GPC_PGC_SW_SHIFT), gpc_base + GPC_PGC_CPU_PDNSCR);
44}
45
46void imx_gpc_set_arm_power_in_lpm(bool power_off)
47{
48 writel_relaxed(power_off, gpc_base + GPC_PGC_CPU_PDN);
49}
50
30void imx_gpc_pre_suspend(bool arm_power_off) 51void imx_gpc_pre_suspend(bool arm_power_off)
31{ 52{
32 void __iomem *reg_imr1 = gpc_base + GPC_IMR1; 53 void __iomem *reg_imr1 = gpc_base + GPC_IMR1;
@@ -34,7 +55,7 @@ void imx_gpc_pre_suspend(bool arm_power_off)
34 55
35 /* Tell GPC to power off ARM core when suspend */ 56 /* Tell GPC to power off ARM core when suspend */
36 if (arm_power_off) 57 if (arm_power_off)
37 writel_relaxed(0x1, gpc_base + GPC_PGC_CPU_PDN); 58 imx_gpc_set_arm_power_in_lpm(arm_power_off);
38 59
39 for (i = 0; i < IMR_NUM; i++) { 60 for (i = 0; i < IMR_NUM; i++) {
40 gpc_saved_imrs[i] = readl_relaxed(reg_imr1 + i * 4); 61 gpc_saved_imrs[i] = readl_relaxed(reg_imr1 + i * 4);
@@ -48,7 +69,7 @@ void imx_gpc_post_resume(void)
48 int i; 69 int i;
49 70
50 /* Keep ARM core powered on for other low-power modes */ 71 /* Keep ARM core powered on for other low-power modes */
51 writel_relaxed(0x0, gpc_base + GPC_PGC_CPU_PDN); 72 imx_gpc_set_arm_power_in_lpm(false);
52 73
53 for (i = 0; i < IMR_NUM; i++) 74 for (i = 0; i < IMR_NUM; i++)
54 writel_relaxed(gpc_saved_imrs[i], reg_imr1 + i * 4); 75 writel_relaxed(gpc_saved_imrs[i], reg_imr1 + i * 4);
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 5057d61298b7..4ad6e473cf83 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -329,7 +329,7 @@ static void __init imx6q_opp_check_speed_grading(struct device *cpu_dev)
329 if (dev_pm_opp_disable(cpu_dev, 852000000)) 329 if (dev_pm_opp_disable(cpu_dev, 852000000))
330 pr_warn("failed to disable 852 MHz OPP\n"); 330 pr_warn("failed to disable 852 MHz OPP\n");
331 } 331 }
332 332 iounmap(base);
333put_node: 333put_node:
334 of_node_put(np); 334 of_node_put(np);
335} 335}
diff --git a/arch/arm/mach-imx/mach-imx6sx.c b/arch/arm/mach-imx/mach-imx6sx.c
index 7a96c6577234..66988eb6a3a4 100644
--- a/arch/arm/mach-imx/mach-imx6sx.c
+++ b/arch/arm/mach-imx/mach-imx6sx.c
@@ -90,7 +90,7 @@ static void __init imx6sx_init_irq(void)
90 90
91static void __init imx6sx_init_late(void) 91static void __init imx6sx_init_late(void)
92{ 92{
93 imx6q_cpuidle_init(); 93 imx6sx_cpuidle_init();
94 94
95 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) 95 if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ))
96 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); 96 platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0);
diff --git a/arch/arm/mach-imx/mach-vf610.c b/arch/arm/mach-imx/mach-vf610.c
index c11ab6a1dc87..2e7c75b66fe0 100644
--- a/arch/arm/mach-imx/mach-vf610.c
+++ b/arch/arm/mach-imx/mach-vf610.c
@@ -13,11 +13,14 @@
13#include <asm/hardware/cache-l2x0.h> 13#include <asm/hardware/cache-l2x0.h>
14 14
15static const char * const vf610_dt_compat[] __initconst = { 15static const char * const vf610_dt_compat[] __initconst = {
16 "fsl,vf500",
17 "fsl,vf510",
18 "fsl,vf600",
16 "fsl,vf610", 19 "fsl,vf610",
17 NULL, 20 NULL,
18}; 21};
19 22
20DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF610 (Device Tree)") 23DT_MACHINE_START(VYBRID_VF610, "Freescale Vybrid VF5xx/VF6xx (Device Tree)")
21 .l2c_aux_val = 0, 24 .l2c_aux_val = 0,
22 .l2c_aux_mask = ~0, 25 .l2c_aux_mask = ~0,
23 .dt_compat = vf610_dt_compat, 26 .dt_compat = vf610_dt_compat,
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index 5d2c1bd5f5ef..46fd695203c7 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -205,7 +205,7 @@ void imx6q_set_int_mem_clk_lpm(bool enable)
205 writel_relaxed(val, ccm_base + CGPR); 205 writel_relaxed(val, ccm_base + CGPR);
206} 206}
207 207
208static void imx6q_enable_rbc(bool enable) 208void imx6_enable_rbc(bool enable)
209{ 209{
210 u32 val; 210 u32 val;
211 211
@@ -359,17 +359,16 @@ static int imx6q_pm_enter(suspend_state_t state)
359 * RBC setting, so we do NOT need to do that here. 359 * RBC setting, so we do NOT need to do that here.
360 */ 360 */
361 if (!imx6_suspend_in_ocram_fn) 361 if (!imx6_suspend_in_ocram_fn)
362 imx6q_enable_rbc(true); 362 imx6_enable_rbc(true);
363 imx_gpc_pre_suspend(true); 363 imx_gpc_pre_suspend(true);
364 imx_anatop_pre_suspend(); 364 imx_anatop_pre_suspend();
365 imx_set_cpu_jump(0, v7_cpu_resume);
366 /* Zzz ... */ 365 /* Zzz ... */
367 cpu_suspend(0, imx6q_suspend_finish); 366 cpu_suspend(0, imx6q_suspend_finish);
368 if (cpu_is_imx6q() || cpu_is_imx6dl()) 367 if (cpu_is_imx6q() || cpu_is_imx6dl())
369 imx_smp_prepare(); 368 imx_smp_prepare();
370 imx_anatop_post_resume(); 369 imx_anatop_post_resume();
371 imx_gpc_post_resume(); 370 imx_gpc_post_resume();
372 imx6q_enable_rbc(false); 371 imx6_enable_rbc(false);
373 imx6q_enable_wb(false); 372 imx6q_enable_wb(false);
374 imx6q_set_int_mem_clk_lpm(true); 373 imx6q_set_int_mem_clk_lpm(true);
375 imx6q_set_lpm(WAIT_CLOCKED); 374 imx6q_set_lpm(WAIT_CLOCKED);
diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index f73f588f649c..f7e463ca0287 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -1,6 +1,26 @@
1config ARCH_MEDIATEK 1menuconfig ARCH_MEDIATEK
2 bool "Mediatek MT65xx & MT81xx SoC" if ARCH_MULTI_V7 2 bool "Mediatek MT65xx & MT81xx SoC" if ARCH_MULTI_V7
3 select ARM_GIC 3 select ARM_GIC
4 select MTK_TIMER 4 select MTK_TIMER
5 help 5 help
6 Support for Mediatek MT65xx & MT81xx SoCs 6 Support for Mediatek MT65xx & MT81xx SoCs
7
8if ARCH_MEDIATEK
9
10config MACH_MT6589
11 bool "MediaTek MT6589 SoCs support"
12 default ARCH_MEDIATEK
13
14config MACH_MT6592
15 bool "MediaTek MT6592 SoCs support"
16 default ARCH_MEDIATEK
17
18config MACH_MT8127
19 bool "MediaTek MT8127 SoCs support"
20 default ARCH_MEDIATEK
21
22config MACH_MT8135
23 bool "MediaTek MT8135 SoCs support"
24 default ARCH_MEDIATEK
25
26endif
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index ccef8806bb58..b5895f040caa 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -33,6 +33,7 @@
33#include <asm/smp_plat.h> 33#include <asm/smp_plat.h>
34#include <asm/cacheflush.h> 34#include <asm/cacheflush.h>
35#include <asm/mach/map.h> 35#include <asm/mach/map.h>
36#include <asm/dma-mapping.h>
36#include "coherency.h" 37#include "coherency.h"
37#include "mvebu-soc-id.h" 38#include "mvebu-soc-id.h"
38 39
@@ -76,54 +77,6 @@ int set_cpu_coherent(void)
76 return ll_enable_coherency(); 77 return ll_enable_coherency();
77} 78}
78 79
79static inline void mvebu_hwcc_sync_io_barrier(void)
80{
81 writel(0x1, coherency_cpu_base + IO_SYNC_BARRIER_CTL_OFFSET);
82 while (readl(coherency_cpu_base + IO_SYNC_BARRIER_CTL_OFFSET) & 0x1);
83}
84
85static dma_addr_t mvebu_hwcc_dma_map_page(struct device *dev, struct page *page,
86 unsigned long offset, size_t size,
87 enum dma_data_direction dir,
88 struct dma_attrs *attrs)
89{
90 if (dir != DMA_TO_DEVICE)
91 mvebu_hwcc_sync_io_barrier();
92 return pfn_to_dma(dev, page_to_pfn(page)) + offset;
93}
94
95
96static void mvebu_hwcc_dma_unmap_page(struct device *dev, dma_addr_t dma_handle,
97 size_t size, enum dma_data_direction dir,
98 struct dma_attrs *attrs)
99{
100 if (dir != DMA_TO_DEVICE)
101 mvebu_hwcc_sync_io_barrier();
102}
103
104static void mvebu_hwcc_dma_sync(struct device *dev, dma_addr_t dma_handle,
105 size_t size, enum dma_data_direction dir)
106{
107 if (dir != DMA_TO_DEVICE)
108 mvebu_hwcc_sync_io_barrier();
109}
110
111static struct dma_map_ops mvebu_hwcc_dma_ops = {
112 .alloc = arm_dma_alloc,
113 .free = arm_dma_free,
114 .mmap = arm_dma_mmap,
115 .map_page = mvebu_hwcc_dma_map_page,
116 .unmap_page = mvebu_hwcc_dma_unmap_page,
117 .get_sgtable = arm_dma_get_sgtable,
118 .map_sg = arm_dma_map_sg,
119 .unmap_sg = arm_dma_unmap_sg,
120 .sync_single_for_cpu = mvebu_hwcc_dma_sync,
121 .sync_single_for_device = mvebu_hwcc_dma_sync,
122 .sync_sg_for_cpu = arm_dma_sync_sg_for_cpu,
123 .sync_sg_for_device = arm_dma_sync_sg_for_device,
124 .set_dma_mask = arm_dma_set_mask,
125};
126
127static int mvebu_hwcc_notifier(struct notifier_block *nb, 80static int mvebu_hwcc_notifier(struct notifier_block *nb,
128 unsigned long event, void *__dev) 81 unsigned long event, void *__dev)
129{ 82{
@@ -131,7 +84,7 @@ static int mvebu_hwcc_notifier(struct notifier_block *nb,
131 84
132 if (event != BUS_NOTIFY_ADD_DEVICE) 85 if (event != BUS_NOTIFY_ADD_DEVICE)
133 return NOTIFY_DONE; 86 return NOTIFY_DONE;
134 set_dma_ops(dev, &mvebu_hwcc_dma_ops); 87 set_dma_ops(dev, &arm_coherent_dma_ops);
135 88
136 return NOTIFY_OK; 89 return NOTIFY_OK;
137} 90}
@@ -253,14 +206,9 @@ static int coherency_type(void)
253 return type; 206 return type;
254} 207}
255 208
256/*
257 * As a precaution, we currently completely disable hardware I/O
258 * coherency, until enough testing is done with automatic I/O
259 * synchronization barriers to validate that it is a proper solution.
260 */
261int coherency_available(void) 209int coherency_available(void)
262{ 210{
263 return false; 211 return coherency_type() != COHERENCY_FABRIC_TYPE_NONE;
264} 212}
265 213
266int __init coherency_init(void) 214int __init coherency_init(void)
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.h b/arch/arm/mach-mvebu/mvebu-soc-id.h
index c16bb68ca81f..e124a0b82a3e 100644
--- a/arch/arm/mach-mvebu/mvebu-soc-id.h
+++ b/arch/arm/mach-mvebu/mvebu-soc-id.h
@@ -20,10 +20,28 @@
20#define MV78XX0_A0_REV 0x1 20#define MV78XX0_A0_REV 0x1
21#define MV78XX0_B0_REV 0x2 21#define MV78XX0_B0_REV 0x2
22 22
23/* Amada 370 ID */
24#define ARMADA_370_DEV_ID 0x6710
25
26/* Amada 370 Revision */
27#define ARMADA_370_A1_REV 0x1
28
29/* Armada 375 ID */
30#define ARMADA_375_DEV_ID 0x6720
31
23/* Armada 375 */ 32/* Armada 375 */
24#define ARMADA_375_Z1_REV 0x0 33#define ARMADA_375_Z1_REV 0x0
25#define ARMADA_375_A0_REV 0x3 34#define ARMADA_375_A0_REV 0x3
26 35
36/* Armada 38x ID */
37#define ARMADA_380_DEV_ID 0x6810
38#define ARMADA_385_DEV_ID 0x6820
39#define ARMADA_388_DEV_ID 0x6828
40
41/* Armada 38x Revision */
42#define ARMADA_38x_Z1_REV 0x0
43#define ARMADA_38x_A0_REV 0x4
44
27#ifdef CONFIG_ARCH_MVEBU 45#ifdef CONFIG_ARCH_MVEBU
28int mvebu_get_soc_id(u32 *dev, u32 *rev); 46int mvebu_get_soc_id(u32 *dev, u32 *rev);
29#else 47#else
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index fb78744f546b..00d5d8f9f150 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -121,6 +121,7 @@ obj-$(CONFIG_ARCH_OMAP4) += $(omap-prcm-4-5-common)
121obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common) 121obj-$(CONFIG_SOC_OMAP5) += $(omap-prcm-4-5-common)
122obj-$(CONFIG_SOC_DRA7XX) += $(omap-prcm-4-5-common) 122obj-$(CONFIG_SOC_DRA7XX) += $(omap-prcm-4-5-common)
123am33xx-43xx-prcm-common += prm33xx.o cm33xx.o 123am33xx-43xx-prcm-common += prm33xx.o cm33xx.o
124obj-$(CONFIG_SOC_TI81XX) += $(am33xx-43xx-prcm-common)
124obj-$(CONFIG_SOC_AM33XX) += $(am33xx-43xx-prcm-common) 125obj-$(CONFIG_SOC_AM33XX) += $(am33xx-43xx-prcm-common)
125obj-$(CONFIG_SOC_AM43XX) += $(omap-prcm-4-5-common) \ 126obj-$(CONFIG_SOC_AM43XX) += $(omap-prcm-4-5-common) \
126 $(am33xx-43xx-prcm-common) 127 $(am33xx-43xx-prcm-common)
@@ -171,6 +172,8 @@ obj-$(CONFIG_ARCH_OMAP4) += $(clockdomain-common)
171obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o 172obj-$(CONFIG_ARCH_OMAP4) += clockdomains44xx_data.o
172obj-$(CONFIG_SOC_AM33XX) += $(clockdomain-common) 173obj-$(CONFIG_SOC_AM33XX) += $(clockdomain-common)
173obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o 174obj-$(CONFIG_SOC_AM33XX) += clockdomains33xx_data.o
175obj-$(CONFIG_SOC_TI81XX) += $(clockdomain-common)
176obj-$(CONFIG_SOC_TI81XX) += clockdomains81xx_data.o
174obj-$(CONFIG_SOC_AM43XX) += $(clockdomain-common) 177obj-$(CONFIG_SOC_AM43XX) += $(clockdomain-common)
175obj-$(CONFIG_SOC_AM43XX) += clockdomains43xx_data.o 178obj-$(CONFIG_SOC_AM43XX) += clockdomains43xx_data.o
176obj-$(CONFIG_SOC_OMAP5) += $(clockdomain-common) 179obj-$(CONFIG_SOC_OMAP5) += $(clockdomain-common)
@@ -223,6 +226,7 @@ obj-$(CONFIG_SOC_AM33XX) += omap_hwmod_33xx_43xx_ipblock_data.o
223obj-$(CONFIG_SOC_AM43XX) += omap_hwmod_43xx_data.o 226obj-$(CONFIG_SOC_AM43XX) += omap_hwmod_43xx_data.o
224obj-$(CONFIG_SOC_AM43XX) += omap_hwmod_33xx_43xx_interconnect_data.o 227obj-$(CONFIG_SOC_AM43XX) += omap_hwmod_33xx_43xx_interconnect_data.o
225obj-$(CONFIG_SOC_AM43XX) += omap_hwmod_33xx_43xx_ipblock_data.o 228obj-$(CONFIG_SOC_AM43XX) += omap_hwmod_33xx_43xx_ipblock_data.o
229obj-$(CONFIG_SOC_TI81XX) += omap_hwmod_81xx_data.o
226obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o 230obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o
227obj-$(CONFIG_SOC_OMAP5) += omap_hwmod_54xx_data.o 231obj-$(CONFIG_SOC_OMAP5) += omap_hwmod_54xx_data.o
228obj-$(CONFIG_SOC_DRA7XX) += omap_hwmod_7xx_data.o 232obj-$(CONFIG_SOC_DRA7XX) += omap_hwmod_7xx_data.o
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 42b7f4c9169b..34ff14b7beab 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -162,6 +162,42 @@ DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
162MACHINE_END 162MACHINE_END
163#endif 163#endif
164 164
165#ifdef CONFIG_SOC_TI81XX
166static const char *const ti814x_boards_compat[] __initconst = {
167 "ti,dm8148",
168 "ti,dm814",
169 NULL,
170};
171
172DT_MACHINE_START(TI81XX_DT, "Generic ti814x (Flattened Device Tree)")
173 .reserve = omap_reserve,
174 .map_io = ti81xx_map_io,
175 .init_early = ti814x_init_early,
176 .init_machine = omap_generic_init,
177 .init_late = ti81xx_init_late,
178 .init_time = omap3_gptimer_timer_init,
179 .dt_compat = ti814x_boards_compat,
180 .restart = ti81xx_restart,
181MACHINE_END
182
183static const char *const ti816x_boards_compat[] __initconst = {
184 "ti,dm8168",
185 "ti,dm816",
186 NULL,
187};
188
189DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
190 .reserve = omap_reserve,
191 .map_io = ti81xx_map_io,
192 .init_early = ti816x_init_early,
193 .init_machine = omap_generic_init,
194 .init_late = ti81xx_init_late,
195 .init_time = omap3_gptimer_timer_init,
196 .dt_compat = ti816x_boards_compat,
197 .restart = ti81xx_restart,
198MACHINE_END
199#endif
200
165#ifdef CONFIG_SOC_AM33XX 201#ifdef CONFIG_SOC_AM33XX
166static const char *const am33xx_boards_compat[] __initconst = { 202static const char *const am33xx_boards_compat[] __initconst = {
167 "ti,am33xx", 203 "ti,am33xx",
diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
index 82c37b1becc4..77bab5fb6814 100644
--- a/arch/arm/mach-omap2/clockdomain.h
+++ b/arch/arm/mach-omap2/clockdomain.h
@@ -216,6 +216,7 @@ extern void __init omap242x_clockdomains_init(void);
216extern void __init omap243x_clockdomains_init(void); 216extern void __init omap243x_clockdomains_init(void);
217extern void __init omap3xxx_clockdomains_init(void); 217extern void __init omap3xxx_clockdomains_init(void);
218extern void __init am33xx_clockdomains_init(void); 218extern void __init am33xx_clockdomains_init(void);
219extern void __init ti81xx_clockdomains_init(void);
219extern void __init omap44xx_clockdomains_init(void); 220extern void __init omap44xx_clockdomains_init(void);
220extern void __init omap54xx_clockdomains_init(void); 221extern void __init omap54xx_clockdomains_init(void);
221extern void __init dra7xx_clockdomains_init(void); 222extern void __init dra7xx_clockdomains_init(void);
diff --git a/arch/arm/mach-omap2/clockdomains81xx_data.c b/arch/arm/mach-omap2/clockdomains81xx_data.c
new file mode 100644
index 000000000000..ce2a82001d0d
--- /dev/null
+++ b/arch/arm/mach-omap2/clockdomains81xx_data.c
@@ -0,0 +1,194 @@
1/*
2 * TI81XX Clock Domain data.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_81XX_H
18#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_81XX_H
19
20#include <linux/kernel.h>
21#include <linux/io.h>
22
23#include "clockdomain.h"
24#include "cm81xx.h"
25
26/*
27 * Note that 814x seems to have HWSUP_SWSUP for many clockdomains
28 * while 816x does not. According to the TRM, 816x only has HWSUP
29 * for ALWON_L3_FAST. Also note that the TI tree clockdomains81xx.h
30 * seems to have the related ifdef the wrong way around claiming
31 * 816x supports HWSUP while 814x does not. For now, we only set
32 * HWSUP for ALWON_L3_FAST as that seems to be supported for both
33 * dm814x and dm816x.
34 */
35
36/* Common for 81xx */
37
38static struct clockdomain alwon_l3_slow_81xx_clkdm = {
39 .name = "alwon_l3s_clkdm",
40 .pwrdm = { .name = "alwon_pwrdm" },
41 .cm_inst = TI81XX_CM_ALWON_MOD,
42 .clkdm_offs = TI81XX_CM_ALWON_L3_SLOW_CLKDM,
43 .flags = CLKDM_CAN_SWSUP,
44};
45
46static struct clockdomain alwon_l3_med_81xx_clkdm = {
47 .name = "alwon_l3_med_clkdm",
48 .pwrdm = { .name = "alwon_pwrdm" },
49 .cm_inst = TI81XX_CM_ALWON_MOD,
50 .clkdm_offs = TI81XX_CM_ALWON_L3_MED_CLKDM,
51 .flags = CLKDM_CAN_SWSUP,
52};
53
54static struct clockdomain alwon_l3_fast_81xx_clkdm = {
55 .name = "alwon_l3_fast_clkdm",
56 .pwrdm = { .name = "alwon_pwrdm" },
57 .cm_inst = TI81XX_CM_ALWON_MOD,
58 .clkdm_offs = TI81XX_CM_ALWON_L3_FAST_CLKDM,
59 .flags = CLKDM_CAN_HWSUP_SWSUP,
60};
61
62static struct clockdomain alwon_ethernet_81xx_clkdm = {
63 .name = "alwon_ethernet_clkdm",
64 .pwrdm = { .name = "alwon_pwrdm" },
65 .cm_inst = TI81XX_CM_ALWON_MOD,
66 .clkdm_offs = TI81XX_CM_ETHERNET_CLKDM,
67 .flags = CLKDM_CAN_SWSUP,
68};
69
70static struct clockdomain mmu_81xx_clkdm = {
71 .name = "mmu_clkdm",
72 .pwrdm = { .name = "alwon_pwrdm" },
73 .cm_inst = TI81XX_CM_ALWON_MOD,
74 .clkdm_offs = TI81XX_CM_MMU_CLKDM,
75 .flags = CLKDM_CAN_SWSUP,
76};
77
78static struct clockdomain mmu_cfg_81xx_clkdm = {
79 .name = "mmu_cfg_clkdm",
80 .pwrdm = { .name = "alwon_pwrdm" },
81 .cm_inst = TI81XX_CM_ALWON_MOD,
82 .clkdm_offs = TI81XX_CM_MMUCFG_CLKDM,
83 .flags = CLKDM_CAN_SWSUP,
84};
85
86/* 816x only */
87
88static struct clockdomain alwon_mpu_816x_clkdm = {
89 .name = "alwon_mpu_clkdm",
90 .pwrdm = { .name = "alwon_pwrdm" },
91 .cm_inst = TI81XX_CM_ALWON_MOD,
92 .clkdm_offs = TI81XX_CM_ALWON_MPU_CLKDM,
93 .flags = CLKDM_CAN_SWSUP,
94};
95
96static struct clockdomain active_gem_816x_clkdm = {
97 .name = "active_gem_clkdm",
98 .pwrdm = { .name = "active_pwrdm" },
99 .cm_inst = TI816X_CM_ACTIVE_MOD,
100 .clkdm_offs = TI816X_CM_ACTIVE_GEM_CLKDM,
101 .flags = CLKDM_CAN_SWSUP,
102};
103
104static struct clockdomain ivahd0_816x_clkdm = {
105 .name = "ivahd0_clkdm",
106 .pwrdm = { .name = "ivahd0_pwrdm" },
107 .cm_inst = TI816X_CM_IVAHD0_MOD,
108 .clkdm_offs = TI816X_CM_IVAHD0_CLKDM,
109 .flags = CLKDM_CAN_SWSUP,
110};
111
112static struct clockdomain ivahd1_816x_clkdm = {
113 .name = "ivahd1_clkdm",
114 .pwrdm = { .name = "ivahd1_pwrdm" },
115 .cm_inst = TI816X_CM_IVAHD1_MOD,
116 .clkdm_offs = TI816X_CM_IVAHD1_CLKDM,
117 .flags = CLKDM_CAN_SWSUP,
118};
119
120static struct clockdomain ivahd2_816x_clkdm = {
121 .name = "ivahd2_clkdm",
122 .pwrdm = { .name = "ivahd2_pwrdm" },
123 .cm_inst = TI816X_CM_IVAHD2_MOD,
124 .clkdm_offs = TI816X_CM_IVAHD2_CLKDM,
125 .flags = CLKDM_CAN_SWSUP,
126};
127
128static struct clockdomain sgx_816x_clkdm = {
129 .name = "sgx_clkdm",
130 .pwrdm = { .name = "sgx_pwrdm" },
131 .cm_inst = TI816X_CM_SGX_MOD,
132 .clkdm_offs = TI816X_CM_SGX_CLKDM,
133 .flags = CLKDM_CAN_SWSUP,
134};
135
136static struct clockdomain default_l3_med_816x_clkdm = {
137 .name = "default_l3_med_clkdm",
138 .pwrdm = { .name = "default_pwrdm" },
139 .cm_inst = TI816X_CM_DEFAULT_MOD,
140 .clkdm_offs = TI816X_CM_DEFAULT_L3_MED_CLKDM,
141 .flags = CLKDM_CAN_SWSUP,
142};
143
144static struct clockdomain default_ducati_816x_clkdm = {
145 .name = "default_ducati_clkdm",
146 .pwrdm = { .name = "default_pwrdm" },
147 .cm_inst = TI816X_CM_DEFAULT_MOD,
148 .clkdm_offs = TI816X_CM_DEFAULT_DUCATI_CLKDM,
149 .flags = CLKDM_CAN_SWSUP,
150};
151
152static struct clockdomain default_pci_816x_clkdm = {
153 .name = "default_pci_clkdm",
154 .pwrdm = { .name = "default_pwrdm" },
155 .cm_inst = TI816X_CM_DEFAULT_MOD,
156 .clkdm_offs = TI816X_CM_DEFAULT_PCI_CLKDM,
157 .flags = CLKDM_CAN_SWSUP,
158};
159
160static struct clockdomain default_l3_slow_816x_clkdm = {
161 .name = "default_l3_slow_clkdm",
162 .pwrdm = { .name = "default_pwrdm" },
163 .cm_inst = TI816X_CM_DEFAULT_MOD,
164 .clkdm_offs = TI816X_CM_DEFAULT_L3_SLOW_CLKDM,
165 .flags = CLKDM_CAN_SWSUP,
166};
167
168static struct clockdomain *clockdomains_ti81xx[] __initdata = {
169 &alwon_mpu_816x_clkdm,
170 &alwon_l3_slow_81xx_clkdm,
171 &alwon_l3_med_81xx_clkdm,
172 &alwon_l3_fast_81xx_clkdm,
173 &alwon_ethernet_81xx_clkdm,
174 &mmu_81xx_clkdm,
175 &mmu_cfg_81xx_clkdm,
176 &active_gem_816x_clkdm,
177 &ivahd0_816x_clkdm,
178 &ivahd1_816x_clkdm,
179 &ivahd2_816x_clkdm,
180 &sgx_816x_clkdm,
181 &default_l3_med_816x_clkdm,
182 &default_ducati_816x_clkdm,
183 &default_pci_816x_clkdm,
184 &default_l3_slow_816x_clkdm,
185 NULL,
186};
187
188void __init ti81xx_clockdomains_init(void)
189{
190 clkdm_register_platform_funcs(&am33xx_clkdm_operations);
191 clkdm_register_clkdms(clockdomains_ti81xx);
192 clkdm_complete_init();
193}
194#endif
diff --git a/arch/arm/mach-omap2/cm81xx.h b/arch/arm/mach-omap2/cm81xx.h
new file mode 100644
index 000000000000..45cb407da222
--- /dev/null
+++ b/arch/arm/mach-omap2/cm81xx.h
@@ -0,0 +1,61 @@
1/*
2 * Clock domain register offsets for TI81XX.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __ARCH_ARM_MACH_OMAP2_CM_TI81XX_H
18#define __ARCH_ARM_MACH_OMAP2_CM_TI81XX_H
19
20/* TI81XX common CM module offsets */
21#define TI81XX_CM_ALWON_MOD 0x1400 /* 1KB */
22
23/* TI816X CM module offsets */
24#define TI816X_CM_ACTIVE_MOD 0x0400 /* 256B */
25#define TI816X_CM_DEFAULT_MOD 0x0500 /* 256B */
26#define TI816X_CM_IVAHD0_MOD 0x0600 /* 256B */
27#define TI816X_CM_IVAHD1_MOD 0x0700 /* 256B */
28#define TI816X_CM_IVAHD2_MOD 0x0800 /* 256B */
29#define TI816X_CM_SGX_MOD 0x0900 /* 256B */
30
31/* ALWON */
32#define TI81XX_CM_ALWON_L3_SLOW_CLKDM 0x0000
33#define TI81XX_CM_ALWON_L3_MED_CLKDM 0x0004
34#define TI81XX_CM_ETHERNET_CLKDM 0x0004
35#define TI81XX_CM_MMU_CLKDM 0x000C
36#define TI81XX_CM_MMUCFG_CLKDM 0x0010
37#define TI81XX_CM_ALWON_MPU_CLKDM 0x001C
38#define TI81XX_CM_ALWON_L3_FAST_CLKDM 0x0030
39
40/* ACTIVE */
41#define TI816X_CM_ACTIVE_GEM_CLKDM 0x0000
42
43/* IVAHD0 */
44#define TI816X_CM_IVAHD0_CLKDM 0x0000
45
46/* IVAHD1 */
47#define TI816X_CM_IVAHD1_CLKDM 0x0000
48
49/* IVAHD2 */
50#define TI816X_CM_IVAHD2_CLKDM 0x0000
51
52/* SGX */
53#define TI816X_CM_SGX_CLKDM 0x0000
54
55/* DEFAULT */
56#define TI816X_CM_DEFAULT_L3_MED_CLKDM 0x0004
57#define TI816X_CM_DEFAULT_PCI_CLKDM 0x0010
58#define TI816X_CM_DEFAULT_L3_SLOW_CLKDM 0x0014
59#define TI816X_CM_DEFAULT_DUCATI_CLKDM 0x0018
60
61#endif
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index e4a5630149e1..e60780f05374 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -492,44 +492,6 @@ void __init am35xx_init_early(void)
492 omap_clk_soc_init = am35xx_dt_clk_init; 492 omap_clk_soc_init = am35xx_dt_clk_init;
493} 493}
494 494
495void __init ti814x_init_early(void)
496{
497 omap2_set_globals_tap(TI814X_CLASS,
498 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
499 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
500 NULL);
501 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
502 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
503 omap3xxx_check_revision();
504 ti81xx_check_features();
505 omap3xxx_voltagedomains_init();
506 omap3xxx_powerdomains_init();
507 omap3xxx_clockdomains_init();
508 omap3xxx_hwmod_init();
509 omap_hwmod_init_postsetup();
510 if (of_have_populated_dt())
511 omap_clk_soc_init = ti81xx_dt_clk_init;
512}
513
514void __init ti816x_init_early(void)
515{
516 omap2_set_globals_tap(TI816X_CLASS,
517 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
518 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
519 NULL);
520 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
521 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
522 omap3xxx_check_revision();
523 ti81xx_check_features();
524 omap3xxx_voltagedomains_init();
525 omap3xxx_powerdomains_init();
526 omap3xxx_clockdomains_init();
527 omap3xxx_hwmod_init();
528 omap_hwmod_init_postsetup();
529 if (of_have_populated_dt())
530 omap_clk_soc_init = ti81xx_dt_clk_init;
531}
532
533void __init omap3_init_late(void) 495void __init omap3_init_late(void)
534{ 496{
535 omap_common_late_init(); 497 omap_common_late_init();
@@ -572,6 +534,50 @@ void __init ti81xx_init_late(void)
572} 534}
573#endif 535#endif
574 536
537#ifdef CONFIG_SOC_TI81XX
538void __init ti814x_init_early(void)
539{
540 omap2_set_globals_tap(TI814X_CLASS,
541 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
542 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
543 NULL);
544 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
545 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
546 omap3xxx_check_revision();
547 ti81xx_check_features();
548 am33xx_prm_init();
549 am33xx_cm_init();
550 omap3xxx_voltagedomains_init();
551 omap3xxx_powerdomains_init();
552 ti81xx_clockdomains_init();
553 ti81xx_hwmod_init();
554 omap_hwmod_init_postsetup();
555 if (of_have_populated_dt())
556 omap_clk_soc_init = ti81xx_dt_clk_init;
557}
558
559void __init ti816x_init_early(void)
560{
561 omap2_set_globals_tap(TI816X_CLASS,
562 OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE));
563 omap2_set_globals_control(OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
564 NULL);
565 omap2_set_globals_prm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE));
566 omap2_set_globals_cm(OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE), NULL);
567 omap3xxx_check_revision();
568 ti81xx_check_features();
569 am33xx_prm_init();
570 am33xx_cm_init();
571 omap3xxx_voltagedomains_init();
572 omap3xxx_powerdomains_init();
573 ti81xx_clockdomains_init();
574 ti81xx_hwmod_init();
575 omap_hwmod_init_postsetup();
576 if (of_have_populated_dt())
577 omap_clk_soc_init = ti81xx_dt_clk_init;
578}
579#endif
580
575#ifdef CONFIG_SOC_AM33XX 581#ifdef CONFIG_SOC_AM33XX
576void __init am33xx_init_early(void) 582void __init am33xx_init_early(void)
577{ 583{
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index bb41dc2b580e..92afb723dcfc 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3916,7 +3916,7 @@ void __init omap_hwmod_init(void)
3916 soc_ops.deassert_hardreset = _omap4_deassert_hardreset; 3916 soc_ops.deassert_hardreset = _omap4_deassert_hardreset;
3917 soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted; 3917 soc_ops.is_hardreset_asserted = _omap4_is_hardreset_asserted;
3918 soc_ops.init_clkdm = _init_clkdm; 3918 soc_ops.init_clkdm = _init_clkdm;
3919 } else if (soc_is_am33xx()) { 3919 } else if (cpu_is_ti816x() || soc_is_am33xx()) {
3920 soc_ops.enable_module = _omap4_enable_module; 3920 soc_ops.enable_module = _omap4_enable_module;
3921 soc_ops.disable_module = _omap4_disable_module; 3921 soc_ops.disable_module = _omap4_disable_module;
3922 soc_ops.wait_target_ready = _omap4_wait_target_ready; 3922 soc_ops.wait_target_ready = _omap4_wait_target_ready;
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index fcfdd85aad62..9d4bec6ee742 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -748,6 +748,7 @@ extern int omap3xxx_hwmod_init(void);
748extern int omap44xx_hwmod_init(void); 748extern int omap44xx_hwmod_init(void);
749extern int omap54xx_hwmod_init(void); 749extern int omap54xx_hwmod_init(void);
750extern int am33xx_hwmod_init(void); 750extern int am33xx_hwmod_init(void);
751extern int ti81xx_hwmod_init(void);
751extern int dra7xx_hwmod_init(void); 752extern int dra7xx_hwmod_init(void);
752int am43xx_hwmod_init(void); 753int am43xx_hwmod_init(void);
753 754
diff --git a/arch/arm/mach-omap2/omap_hwmod_81xx_data.c b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
new file mode 100644
index 000000000000..cab1eb61ac96
--- /dev/null
+++ b/arch/arm/mach-omap2/omap_hwmod_81xx_data.c
@@ -0,0 +1,1136 @@
1/*
2 * DM81xx hwmod data.
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc. - http://www.ti.com/
5 * Copyright (C) 2013 SKTB SKiT, http://www.skitlab.ru/
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation version 2.
10 *
11 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12 * kind, whether express or implied; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/platform_data/gpio-omap.h>
19#include <linux/platform_data/hsmmc-omap.h>
20#include <linux/platform_data/spi-omap2-mcspi.h>
21#include <plat/dmtimer.h>
22
23#include "omap_hwmod_common_data.h"
24#include "cm81xx.h"
25#include "ti81xx.h"
26#include "wd_timer.h"
27
28/*
29 * DM816X hardware modules integration data
30 *
31 * Note: This is incomplete and at present, not generated from h/w database.
32 */
33
34/*
35 * The alwon .clkctrl_offs field is offset from the CM_ALWON, that's
36 * TRM 18.7.17 CM_ALWON device register values minus 0x1400.
37 */
38#define DM816X_DM_ALWON_BASE 0x1400
39#define DM816X_CM_ALWON_MCASP0_CLKCTRL (0x1540 - DM816X_DM_ALWON_BASE)
40#define DM816X_CM_ALWON_MCASP1_CLKCTRL (0x1544 - DM816X_DM_ALWON_BASE)
41#define DM816X_CM_ALWON_MCASP2_CLKCTRL (0x1548 - DM816X_DM_ALWON_BASE)
42#define DM816X_CM_ALWON_MCBSP_CLKCTRL (0x154c - DM816X_DM_ALWON_BASE)
43#define DM816X_CM_ALWON_UART_0_CLKCTRL (0x1550 - DM816X_DM_ALWON_BASE)
44#define DM816X_CM_ALWON_UART_1_CLKCTRL (0x1554 - DM816X_DM_ALWON_BASE)
45#define DM816X_CM_ALWON_UART_2_CLKCTRL (0x1558 - DM816X_DM_ALWON_BASE)
46#define DM816X_CM_ALWON_GPIO_0_CLKCTRL (0x155c - DM816X_DM_ALWON_BASE)
47#define DM816X_CM_ALWON_GPIO_1_CLKCTRL (0x1560 - DM816X_DM_ALWON_BASE)
48#define DM816X_CM_ALWON_I2C_0_CLKCTRL (0x1564 - DM816X_DM_ALWON_BASE)
49#define DM816X_CM_ALWON_I2C_1_CLKCTRL (0x1568 - DM816X_DM_ALWON_BASE)
50#define DM816X_CM_ALWON_TIMER_1_CLKCTRL (0x1570 - DM816X_DM_ALWON_BASE)
51#define DM816X_CM_ALWON_TIMER_2_CLKCTRL (0x1574 - DM816X_DM_ALWON_BASE)
52#define DM816X_CM_ALWON_TIMER_3_CLKCTRL (0x1578 - DM816X_DM_ALWON_BASE)
53#define DM816X_CM_ALWON_TIMER_4_CLKCTRL (0x157c - DM816X_DM_ALWON_BASE)
54#define DM816X_CM_ALWON_TIMER_5_CLKCTRL (0x1580 - DM816X_DM_ALWON_BASE)
55#define DM816X_CM_ALWON_TIMER_6_CLKCTRL (0x1584 - DM816X_DM_ALWON_BASE)
56#define DM816X_CM_ALWON_TIMER_7_CLKCTRL (0x1588 - DM816X_DM_ALWON_BASE)
57#define DM816X_CM_ALWON_WDTIMER_CLKCTRL (0x158c - DM816X_DM_ALWON_BASE)
58#define DM816X_CM_ALWON_SPI_CLKCTRL (0x1590 - DM816X_DM_ALWON_BASE)
59#define DM816X_CM_ALWON_MAILBOX_CLKCTRL (0x1594 - DM816X_DM_ALWON_BASE)
60#define DM816X_CM_ALWON_SPINBOX_CLKCTRL (0x1598 - DM816X_DM_ALWON_BASE)
61#define DM816X_CM_ALWON_MMUDATA_CLKCTRL (0x159c - DM816X_DM_ALWON_BASE)
62#define DM816X_CM_ALWON_MMUCFG_CLKCTRL (0x15a8 - DM816X_DM_ALWON_BASE)
63#define DM816X_CM_ALWON_SDIO_CLKCTRL (0x15b0 - DM816X_DM_ALWON_BASE)
64#define DM816X_CM_ALWON_OCMC_0_CLKCTRL (0x15b4 - DM816X_DM_ALWON_BASE)
65#define DM816X_CM_ALWON_OCMC_1_CLKCTRL (0x15b8 - DM816X_DM_ALWON_BASE)
66#define DM816X_CM_ALWON_CONTRL_CLKCTRL (0x15c4 - DM816X_DM_ALWON_BASE)
67#define DM816X_CM_ALWON_GPMC_CLKCTRL (0x15d0 - DM816X_DM_ALWON_BASE)
68#define DM816X_CM_ALWON_ETHERNET_0_CLKCTRL (0x15d4 - DM816X_DM_ALWON_BASE)
69#define DM816X_CM_ALWON_ETHERNET_1_CLKCTRL (0x15d8 - DM816X_DM_ALWON_BASE)
70#define DM816X_CM_ALWON_MPU_CLKCTRL (0x15dc - DM816X_DM_ALWON_BASE)
71#define DM816X_CM_ALWON_L3_CLKCTRL (0x15e4 - DM816X_DM_ALWON_BASE)
72#define DM816X_CM_ALWON_L4HS_CLKCTRL (0x15e8 - DM816X_DM_ALWON_BASE)
73#define DM816X_CM_ALWON_L4LS_CLKCTRL (0x15ec - DM816X_DM_ALWON_BASE)
74#define DM816X_CM_ALWON_RTC_CLKCTRL (0x15f0 - DM816X_DM_ALWON_BASE)
75#define DM816X_CM_ALWON_TPCC_CLKCTRL (0x15f4 - DM816X_DM_ALWON_BASE)
76#define DM816X_CM_ALWON_TPTC0_CLKCTRL (0x15f8 - DM816X_DM_ALWON_BASE)
77#define DM816X_CM_ALWON_TPTC1_CLKCTRL (0x15fc - DM816X_DM_ALWON_BASE)
78#define DM816X_CM_ALWON_TPTC2_CLKCTRL (0x1600 - DM816X_DM_ALWON_BASE)
79#define DM816X_CM_ALWON_TPTC3_CLKCTRL (0x1604 - DM816X_DM_ALWON_BASE)
80#define DM816X_CM_ALWON_SR_0_CLKCTRL (0x1608 - DM816X_DM_ALWON_BASE)
81#define DM816X_CM_ALWON_SR_1_CLKCTRL (0x160c - DM816X_DM_ALWON_BASE)
82
83/*
84 * The default .clkctrl_offs field is offset from CM_DEFAULT, that's
85 * TRM 18.7.6 CM_DEFAULT device register values minus 0x500
86 */
87#define DM816X_CM_DEFAULT_OFFSET 0x500
88#define DM816X_CM_DEFAULT_USB_CLKCTRL (0x558 - DM816X_CM_DEFAULT_OFFSET)
89
90/* L3 Interconnect entries clocked at 125, 250 and 500MHz */
91static struct omap_hwmod dm816x_alwon_l3_slow_hwmod = {
92 .name = "alwon_l3_slow",
93 .clkdm_name = "alwon_l3s_clkdm",
94 .class = &l3_hwmod_class,
95 .flags = HWMOD_NO_IDLEST,
96};
97
98static struct omap_hwmod dm816x_default_l3_slow_hwmod = {
99 .name = "default_l3_slow",
100 .clkdm_name = "default_l3_slow_clkdm",
101 .class = &l3_hwmod_class,
102 .flags = HWMOD_NO_IDLEST,
103};
104
105static struct omap_hwmod dm816x_alwon_l3_med_hwmod = {
106 .name = "l3_med",
107 .clkdm_name = "alwon_l3_med_clkdm",
108 .class = &l3_hwmod_class,
109 .flags = HWMOD_NO_IDLEST,
110};
111
112static struct omap_hwmod dm816x_alwon_l3_fast_hwmod = {
113 .name = "l3_fast",
114 .clkdm_name = "alwon_l3_fast_clkdm",
115 .class = &l3_hwmod_class,
116 .flags = HWMOD_NO_IDLEST,
117};
118
119/*
120 * L4 standard peripherals, see TRM table 1-12 for devices using this.
121 * See TRM table 1-73 for devices using the 125MHz SYSCLK6 clock.
122 */
123static struct omap_hwmod dm816x_l4_ls_hwmod = {
124 .name = "l4_ls",
125 .clkdm_name = "alwon_l3s_clkdm",
126 .class = &l4_hwmod_class,
127};
128
129/*
130 * L4 high-speed peripherals. For devices using this, please see the TRM
131 * table 1-13. On dm816x, only EMAC, MDIO and SATA use this. See also TRM
132 * table 1-73 for devices using 250MHz SYSCLK5 clock.
133 */
134static struct omap_hwmod dm816x_l4_hs_hwmod = {
135 .name = "l4_hs",
136 .clkdm_name = "alwon_l3_med_clkdm",
137 .class = &l4_hwmod_class,
138};
139
140/* L3 slow -> L4 ls peripheral interface running at 125MHz */
141static struct omap_hwmod_ocp_if dm816x_alwon_l3_slow__l4_ls = {
142 .master = &dm816x_alwon_l3_slow_hwmod,
143 .slave = &dm816x_l4_ls_hwmod,
144 .user = OCP_USER_MPU,
145};
146
147/* L3 med -> L4 fast peripheral interface running at 250MHz */
148static struct omap_hwmod_ocp_if dm816x_alwon_l3_slow__l4_hs = {
149 .master = &dm816x_alwon_l3_med_hwmod,
150 .slave = &dm816x_l4_hs_hwmod,
151 .user = OCP_USER_MPU,
152};
153
154/* MPU */
155static struct omap_hwmod dm816x_mpu_hwmod = {
156 .name = "mpu",
157 .clkdm_name = "alwon_mpu_clkdm",
158 .class = &mpu_hwmod_class,
159 .flags = HWMOD_INIT_NO_IDLE,
160 .main_clk = "mpu_ck",
161 .prcm = {
162 .omap4 = {
163 .clkctrl_offs = DM816X_CM_ALWON_MPU_CLKCTRL,
164 .modulemode = MODULEMODE_SWCTRL,
165 },
166 },
167};
168
169static struct omap_hwmod_ocp_if dm816x_mpu__alwon_l3_slow = {
170 .master = &dm816x_mpu_hwmod,
171 .slave = &dm816x_alwon_l3_slow_hwmod,
172 .user = OCP_USER_MPU,
173};
174
175/* L3 med peripheral interface running at 250MHz */
176static struct omap_hwmod_ocp_if dm816x_mpu__alwon_l3_med = {
177 .master = &dm816x_mpu_hwmod,
178 .slave = &dm816x_alwon_l3_med_hwmod,
179 .user = OCP_USER_MPU,
180};
181
182/* UART common */
183static struct omap_hwmod_class_sysconfig uart_sysc = {
184 .rev_offs = 0x50,
185 .sysc_offs = 0x54,
186 .syss_offs = 0x58,
187 .sysc_flags = SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
188 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
189 SYSS_HAS_RESET_STATUS,
190 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
191 MSTANDBY_SMART_WKUP,
192 .sysc_fields = &omap_hwmod_sysc_type1,
193};
194
195static struct omap_hwmod_class uart_class = {
196 .name = "uart",
197 .sysc = &uart_sysc,
198};
199
200static struct omap_hwmod dm816x_uart1_hwmod = {
201 .name = "uart1",
202 .clkdm_name = "alwon_l3s_clkdm",
203 .main_clk = "sysclk10_ck",
204 .prcm = {
205 .omap4 = {
206 .clkctrl_offs = DM816X_CM_ALWON_UART_0_CLKCTRL,
207 .modulemode = MODULEMODE_SWCTRL,
208 },
209 },
210 .class = &uart_class,
211 .flags = DEBUG_TI81XXUART1_FLAGS,
212};
213
214static struct omap_hwmod_ocp_if dm816x_l4_ls__uart1 = {
215 .master = &dm816x_l4_ls_hwmod,
216 .slave = &dm816x_uart1_hwmod,
217 .clk = "sysclk6_ck",
218 .user = OCP_USER_MPU,
219};
220
221static struct omap_hwmod dm816x_uart2_hwmod = {
222 .name = "uart2",
223 .clkdm_name = "alwon_l3s_clkdm",
224 .main_clk = "sysclk10_ck",
225 .prcm = {
226 .omap4 = {
227 .clkctrl_offs = DM816X_CM_ALWON_UART_1_CLKCTRL,
228 .modulemode = MODULEMODE_SWCTRL,
229 },
230 },
231 .class = &uart_class,
232 .flags = DEBUG_TI81XXUART2_FLAGS,
233};
234
235static struct omap_hwmod_ocp_if dm816x_l4_ls__uart2 = {
236 .master = &dm816x_l4_ls_hwmod,
237 .slave = &dm816x_uart2_hwmod,
238 .clk = "sysclk6_ck",
239 .user = OCP_USER_MPU,
240};
241
242static struct omap_hwmod dm816x_uart3_hwmod = {
243 .name = "uart3",
244 .clkdm_name = "alwon_l3s_clkdm",
245 .main_clk = "sysclk10_ck",
246 .prcm = {
247 .omap4 = {
248 .clkctrl_offs = DM816X_CM_ALWON_UART_2_CLKCTRL,
249 .modulemode = MODULEMODE_SWCTRL,
250 },
251 },
252 .class = &uart_class,
253 .flags = DEBUG_TI81XXUART3_FLAGS,
254};
255
256static struct omap_hwmod_ocp_if dm816x_l4_ls__uart3 = {
257 .master = &dm816x_l4_ls_hwmod,
258 .slave = &dm816x_uart3_hwmod,
259 .clk = "sysclk6_ck",
260 .user = OCP_USER_MPU,
261};
262
263static struct omap_hwmod_class_sysconfig wd_timer_sysc = {
264 .rev_offs = 0x0,
265 .sysc_offs = 0x10,
266 .syss_offs = 0x14,
267 .sysc_flags = SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
268 SYSS_HAS_RESET_STATUS,
269 .sysc_fields = &omap_hwmod_sysc_type1,
270};
271
272static struct omap_hwmod_class wd_timer_class = {
273 .name = "wd_timer",
274 .sysc = &wd_timer_sysc,
275 .pre_shutdown = &omap2_wd_timer_disable,
276 .reset = &omap2_wd_timer_reset,
277};
278
279static struct omap_hwmod dm816x_wd_timer_hwmod = {
280 .name = "wd_timer",
281 .clkdm_name = "alwon_l3s_clkdm",
282 .main_clk = "sysclk18_ck",
283 .flags = HWMOD_NO_IDLEST,
284 .prcm = {
285 .omap4 = {
286 .clkctrl_offs = DM816X_CM_ALWON_WDTIMER_CLKCTRL,
287 .modulemode = MODULEMODE_SWCTRL,
288 },
289 },
290 .class = &wd_timer_class,
291};
292
293static struct omap_hwmod_ocp_if dm816x_l4_ls__wd_timer1 = {
294 .master = &dm816x_l4_ls_hwmod,
295 .slave = &dm816x_wd_timer_hwmod,
296 .clk = "sysclk6_ck",
297 .user = OCP_USER_MPU,
298};
299
300/* I2C common */
301static struct omap_hwmod_class_sysconfig i2c_sysc = {
302 .rev_offs = 0x0,
303 .sysc_offs = 0x10,
304 .syss_offs = 0x90,
305 .sysc_flags = SYSC_HAS_SIDLEMODE |
306 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
307 SYSC_HAS_AUTOIDLE,
308 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
309 .sysc_fields = &omap_hwmod_sysc_type1,
310};
311
312static struct omap_hwmod_class i2c_class = {
313 .name = "i2c",
314 .sysc = &i2c_sysc,
315};
316
317static struct omap_hwmod dm81xx_i2c1_hwmod = {
318 .name = "i2c1",
319 .clkdm_name = "alwon_l3s_clkdm",
320 .main_clk = "sysclk10_ck",
321 .prcm = {
322 .omap4 = {
323 .clkctrl_offs = DM816X_CM_ALWON_I2C_0_CLKCTRL,
324 .modulemode = MODULEMODE_SWCTRL,
325 },
326 },
327 .class = &i2c_class,
328};
329
330static struct omap_hwmod_ocp_if dm816x_l4_ls__i2c1 = {
331 .master = &dm816x_l4_ls_hwmod,
332 .slave = &dm81xx_i2c1_hwmod,
333 .clk = "sysclk6_ck",
334 .user = OCP_USER_MPU,
335};
336
337static struct omap_hwmod dm816x_i2c2_hwmod = {
338 .name = "i2c2",
339 .clkdm_name = "alwon_l3s_clkdm",
340 .main_clk = "sysclk10_ck",
341 .prcm = {
342 .omap4 = {
343 .clkctrl_offs = DM816X_CM_ALWON_I2C_1_CLKCTRL,
344 .modulemode = MODULEMODE_SWCTRL,
345 },
346 },
347 .class = &i2c_class,
348};
349
350static struct omap_hwmod_class_sysconfig dm81xx_elm_sysc = {
351 .rev_offs = 0x0000,
352 .sysc_offs = 0x0010,
353 .syss_offs = 0x0014,
354 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
355 SYSC_HAS_SOFTRESET |
356 SYSS_HAS_RESET_STATUS,
357 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
358 .sysc_fields = &omap_hwmod_sysc_type1,
359};
360
361static struct omap_hwmod_ocp_if dm816x_l4_ls__i2c2 = {
362 .master = &dm816x_l4_ls_hwmod,
363 .slave = &dm816x_i2c2_hwmod,
364 .clk = "sysclk6_ck",
365 .user = OCP_USER_MPU,
366};
367
368static struct omap_hwmod_class dm81xx_elm_hwmod_class = {
369 .name = "elm",
370 .sysc = &dm81xx_elm_sysc,
371};
372
373static struct omap_hwmod dm81xx_elm_hwmod = {
374 .name = "elm",
375 .clkdm_name = "alwon_l3s_clkdm",
376 .class = &dm81xx_elm_hwmod_class,
377 .main_clk = "sysclk6_ck",
378};
379
380static struct omap_hwmod_ocp_if dm81xx_l4_ls__elm = {
381 .master = &dm816x_l4_ls_hwmod,
382 .slave = &dm81xx_elm_hwmod,
383 .user = OCP_USER_MPU,
384};
385
386static struct omap_hwmod_class_sysconfig dm81xx_gpio_sysc = {
387 .rev_offs = 0x0000,
388 .sysc_offs = 0x0010,
389 .syss_offs = 0x0114,
390 .sysc_flags = SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP |
391 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
392 SYSS_HAS_RESET_STATUS,
393 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
394 SIDLE_SMART_WKUP,
395 .sysc_fields = &omap_hwmod_sysc_type1,
396};
397
398static struct omap_hwmod_class dm81xx_gpio_hwmod_class = {
399 .name = "gpio",
400 .sysc = &dm81xx_gpio_sysc,
401 .rev = 2,
402};
403
404static struct omap_gpio_dev_attr gpio_dev_attr = {
405 .bank_width = 32,
406 .dbck_flag = true,
407};
408
409static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
410 { .role = "dbclk", .clk = "sysclk18_ck" },
411};
412
413static struct omap_hwmod dm81xx_gpio1_hwmod = {
414 .name = "gpio1",
415 .clkdm_name = "alwon_l3s_clkdm",
416 .class = &dm81xx_gpio_hwmod_class,
417 .main_clk = "sysclk6_ck",
418 .prcm = {
419 .omap4 = {
420 .clkctrl_offs = DM816X_CM_ALWON_GPIO_0_CLKCTRL,
421 .modulemode = MODULEMODE_SWCTRL,
422 },
423 },
424 .opt_clks = gpio1_opt_clks,
425 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
426 .dev_attr = &gpio_dev_attr,
427};
428
429static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio1 = {
430 .master = &dm816x_l4_ls_hwmod,
431 .slave = &dm81xx_gpio1_hwmod,
432 .user = OCP_USER_MPU,
433};
434
435static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
436 { .role = "dbclk", .clk = "sysclk18_ck" },
437};
438
439static struct omap_hwmod dm81xx_gpio2_hwmod = {
440 .name = "gpio2",
441 .clkdm_name = "alwon_l3s_clkdm",
442 .class = &dm81xx_gpio_hwmod_class,
443 .main_clk = "sysclk6_ck",
444 .prcm = {
445 .omap4 = {
446 .clkctrl_offs = DM816X_CM_ALWON_GPIO_1_CLKCTRL,
447 .modulemode = MODULEMODE_SWCTRL,
448 },
449 },
450 .opt_clks = gpio2_opt_clks,
451 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
452 .dev_attr = &gpio_dev_attr,
453};
454
455static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio2 = {
456 .master = &dm816x_l4_ls_hwmod,
457 .slave = &dm81xx_gpio2_hwmod,
458 .user = OCP_USER_MPU,
459};
460
461static struct omap_hwmod_class_sysconfig dm81xx_gpmc_sysc = {
462 .rev_offs = 0x0,
463 .sysc_offs = 0x10,
464 .syss_offs = 0x14,
465 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET |
466 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS,
467 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
468 .sysc_fields = &omap_hwmod_sysc_type1,
469};
470
471static struct omap_hwmod_class dm81xx_gpmc_hwmod_class = {
472 .name = "gpmc",
473 .sysc = &dm81xx_gpmc_sysc,
474};
475
476static struct omap_hwmod dm81xx_gpmc_hwmod = {
477 .name = "gpmc",
478 .clkdm_name = "alwon_l3s_clkdm",
479 .class = &dm81xx_gpmc_hwmod_class,
480 .main_clk = "sysclk6_ck",
481 .prcm = {
482 .omap4 = {
483 .clkctrl_offs = DM816X_CM_ALWON_GPMC_CLKCTRL,
484 .modulemode = MODULEMODE_SWCTRL,
485 },
486 },
487};
488
489struct omap_hwmod_ocp_if dm81xx_alwon_l3_slow__gpmc = {
490 .master = &dm816x_alwon_l3_slow_hwmod,
491 .slave = &dm81xx_gpmc_hwmod,
492 .user = OCP_USER_MPU,
493};
494
495static struct omap_hwmod_class_sysconfig dm81xx_usbhsotg_sysc = {
496 .rev_offs = 0x0,
497 .sysc_offs = 0x10,
498 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
499 SYSC_HAS_SOFTRESET,
500 .idlemodes = SIDLE_SMART | MSTANDBY_FORCE | MSTANDBY_SMART,
501 .sysc_fields = &omap_hwmod_sysc_type2,
502};
503
504static struct omap_hwmod_class dm81xx_usbotg_class = {
505 .name = "usbotg",
506 .sysc = &dm81xx_usbhsotg_sysc,
507};
508
509static struct omap_hwmod dm81xx_usbss_hwmod = {
510 .name = "usb_otg_hs",
511 .clkdm_name = "default_l3_slow_clkdm",
512 .main_clk = "sysclk6_ck",
513 .prcm = {
514 .omap4 = {
515 .clkctrl_offs = DM816X_CM_DEFAULT_USB_CLKCTRL,
516 .modulemode = MODULEMODE_SWCTRL,
517 },
518 },
519 .class = &dm81xx_usbotg_class,
520};
521
522static struct omap_hwmod_ocp_if dm81xx_default_l3_slow__usbss = {
523 .master = &dm816x_default_l3_slow_hwmod,
524 .slave = &dm81xx_usbss_hwmod,
525 .clk = "sysclk6_ck",
526 .user = OCP_USER_MPU,
527};
528
529static struct omap_hwmod_class_sysconfig dm816x_timer_sysc = {
530 .rev_offs = 0x0000,
531 .sysc_offs = 0x0010,
532 .syss_offs = 0x0014,
533 .sysc_flags = SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET,
534 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
535 SIDLE_SMART_WKUP,
536 .sysc_fields = &omap_hwmod_sysc_type2,
537};
538
539static struct omap_hwmod_class dm816x_timer_hwmod_class = {
540 .name = "timer",
541 .sysc = &dm816x_timer_sysc,
542};
543
544static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
545 .timer_capability = OMAP_TIMER_ALWON,
546};
547
548static struct omap_hwmod dm816x_timer1_hwmod = {
549 .name = "timer1",
550 .clkdm_name = "alwon_l3s_clkdm",
551 .main_clk = "timer1_fck",
552 .prcm = {
553 .omap4 = {
554 .clkctrl_offs = DM816X_CM_ALWON_TIMER_1_CLKCTRL,
555 .modulemode = MODULEMODE_SWCTRL,
556 },
557 },
558 .dev_attr = &capability_alwon_dev_attr,
559 .class = &dm816x_timer_hwmod_class,
560};
561
562static struct omap_hwmod_ocp_if dm816x_l4_ls__timer1 = {
563 .master = &dm816x_l4_ls_hwmod,
564 .slave = &dm816x_timer1_hwmod,
565 .clk = "sysclk6_ck",
566 .user = OCP_USER_MPU,
567};
568
569static struct omap_hwmod dm816x_timer2_hwmod = {
570 .name = "timer2",
571 .clkdm_name = "alwon_l3s_clkdm",
572 .main_clk = "timer2_fck",
573 .prcm = {
574 .omap4 = {
575 .clkctrl_offs = DM816X_CM_ALWON_TIMER_2_CLKCTRL,
576 .modulemode = MODULEMODE_SWCTRL,
577 },
578 },
579 .dev_attr = &capability_alwon_dev_attr,
580 .class = &dm816x_timer_hwmod_class,
581};
582
583static struct omap_hwmod_ocp_if dm816x_l4_ls__timer2 = {
584 .master = &dm816x_l4_ls_hwmod,
585 .slave = &dm816x_timer2_hwmod,
586 .clk = "sysclk6_ck",
587 .user = OCP_USER_MPU,
588};
589
590static struct omap_hwmod dm816x_timer3_hwmod = {
591 .name = "timer3",
592 .clkdm_name = "alwon_l3s_clkdm",
593 .main_clk = "timer3_fck",
594 .prcm = {
595 .omap4 = {
596 .clkctrl_offs = DM816X_CM_ALWON_TIMER_3_CLKCTRL,
597 .modulemode = MODULEMODE_SWCTRL,
598 },
599 },
600 .dev_attr = &capability_alwon_dev_attr,
601 .class = &dm816x_timer_hwmod_class,
602};
603
604static struct omap_hwmod_ocp_if dm816x_l4_ls__timer3 = {
605 .master = &dm816x_l4_ls_hwmod,
606 .slave = &dm816x_timer3_hwmod,
607 .clk = "sysclk6_ck",
608 .user = OCP_USER_MPU,
609};
610
611static struct omap_hwmod dm816x_timer4_hwmod = {
612 .name = "timer4",
613 .clkdm_name = "alwon_l3s_clkdm",
614 .main_clk = "timer4_fck",
615 .prcm = {
616 .omap4 = {
617 .clkctrl_offs = DM816X_CM_ALWON_TIMER_4_CLKCTRL,
618 .modulemode = MODULEMODE_SWCTRL,
619 },
620 },
621 .dev_attr = &capability_alwon_dev_attr,
622 .class = &dm816x_timer_hwmod_class,
623};
624
625static struct omap_hwmod_ocp_if dm816x_l4_ls__timer4 = {
626 .master = &dm816x_l4_ls_hwmod,
627 .slave = &dm816x_timer4_hwmod,
628 .clk = "sysclk6_ck",
629 .user = OCP_USER_MPU,
630};
631
632static struct omap_hwmod dm816x_timer5_hwmod = {
633 .name = "timer5",
634 .clkdm_name = "alwon_l3s_clkdm",
635 .main_clk = "timer5_fck",
636 .prcm = {
637 .omap4 = {
638 .clkctrl_offs = DM816X_CM_ALWON_TIMER_5_CLKCTRL,
639 .modulemode = MODULEMODE_SWCTRL,
640 },
641 },
642 .dev_attr = &capability_alwon_dev_attr,
643 .class = &dm816x_timer_hwmod_class,
644};
645
646static struct omap_hwmod_ocp_if dm816x_l4_ls__timer5 = {
647 .master = &dm816x_l4_ls_hwmod,
648 .slave = &dm816x_timer5_hwmod,
649 .clk = "sysclk6_ck",
650 .user = OCP_USER_MPU,
651};
652
653static struct omap_hwmod dm816x_timer6_hwmod = {
654 .name = "timer6",
655 .clkdm_name = "alwon_l3s_clkdm",
656 .main_clk = "timer6_fck",
657 .prcm = {
658 .omap4 = {
659 .clkctrl_offs = DM816X_CM_ALWON_TIMER_6_CLKCTRL,
660 .modulemode = MODULEMODE_SWCTRL,
661 },
662 },
663 .dev_attr = &capability_alwon_dev_attr,
664 .class = &dm816x_timer_hwmod_class,
665};
666
667static struct omap_hwmod_ocp_if dm816x_l4_ls__timer6 = {
668 .master = &dm816x_l4_ls_hwmod,
669 .slave = &dm816x_timer6_hwmod,
670 .clk = "sysclk6_ck",
671 .user = OCP_USER_MPU,
672};
673
674static struct omap_hwmod dm816x_timer7_hwmod = {
675 .name = "timer7",
676 .clkdm_name = "alwon_l3s_clkdm",
677 .main_clk = "timer7_fck",
678 .prcm = {
679 .omap4 = {
680 .clkctrl_offs = DM816X_CM_ALWON_TIMER_7_CLKCTRL,
681 .modulemode = MODULEMODE_SWCTRL,
682 },
683 },
684 .dev_attr = &capability_alwon_dev_attr,
685 .class = &dm816x_timer_hwmod_class,
686};
687
688static struct omap_hwmod_ocp_if dm816x_l4_ls__timer7 = {
689 .master = &dm816x_l4_ls_hwmod,
690 .slave = &dm816x_timer7_hwmod,
691 .clk = "sysclk6_ck",
692 .user = OCP_USER_MPU,
693};
694
695/* EMAC Ethernet */
696static struct omap_hwmod_class_sysconfig dm816x_emac_sysc = {
697 .rev_offs = 0x0,
698 .sysc_offs = 0x4,
699 .sysc_flags = SYSC_HAS_SOFTRESET,
700 .sysc_fields = &omap_hwmod_sysc_type2,
701};
702
703static struct omap_hwmod_class dm816x_emac_hwmod_class = {
704 .name = "emac",
705 .sysc = &dm816x_emac_sysc,
706};
707
708/*
709 * On dm816x the MDIO is within EMAC0. As the MDIO driver is a separate
710 * driver probed before EMAC0, we let MDIO do the clock idling.
711 */
712static struct omap_hwmod dm816x_emac0_hwmod = {
713 .name = "emac0",
714 .clkdm_name = "alwon_ethernet_clkdm",
715 .class = &dm816x_emac_hwmod_class,
716};
717
718static struct omap_hwmod_ocp_if dm816x_l4_hs__emac0 = {
719 .master = &dm816x_l4_hs_hwmod,
720 .slave = &dm816x_emac0_hwmod,
721 .clk = "sysclk5_ck",
722 .user = OCP_USER_MPU,
723};
724
725static struct omap_hwmod_class dm816x_mdio_hwmod_class = {
726 .name = "davinci_mdio",
727 .sysc = &dm816x_emac_sysc,
728};
729
730struct omap_hwmod dm816x_emac0_mdio_hwmod = {
731 .name = "davinci_mdio",
732 .class = &dm816x_mdio_hwmod_class,
733 .clkdm_name = "alwon_ethernet_clkdm",
734 .main_clk = "sysclk24_ck",
735 .flags = HWMOD_NO_IDLEST,
736 /*
737 * REVISIT: This should be moved to the emac0_hwmod
738 * once we have a better way to handle device slaves.
739 */
740 .prcm = {
741 .omap4 = {
742 .clkctrl_offs = DM816X_CM_ALWON_ETHERNET_0_CLKCTRL,
743 .modulemode = MODULEMODE_SWCTRL,
744 },
745 },
746};
747
748struct omap_hwmod_ocp_if dm816x_emac0__mdio = {
749 .master = &dm816x_l4_hs_hwmod,
750 .slave = &dm816x_emac0_mdio_hwmod,
751 .user = OCP_USER_MPU,
752};
753
754static struct omap_hwmod dm816x_emac1_hwmod = {
755 .name = "emac1",
756 .clkdm_name = "alwon_ethernet_clkdm",
757 .main_clk = "sysclk24_ck",
758 .flags = HWMOD_NO_IDLEST,
759 .prcm = {
760 .omap4 = {
761 .clkctrl_offs = DM816X_CM_ALWON_ETHERNET_1_CLKCTRL,
762 .modulemode = MODULEMODE_SWCTRL,
763 },
764 },
765 .class = &dm816x_emac_hwmod_class,
766};
767
768static struct omap_hwmod_ocp_if dm816x_l4_hs__emac1 = {
769 .master = &dm816x_l4_hs_hwmod,
770 .slave = &dm816x_emac1_hwmod,
771 .clk = "sysclk5_ck",
772 .user = OCP_USER_MPU,
773};
774
775static struct omap_hwmod_class_sysconfig dm816x_mmc_sysc = {
776 .rev_offs = 0x0,
777 .sysc_offs = 0x110,
778 .syss_offs = 0x114,
779 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
780 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
781 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS,
782 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
783 .sysc_fields = &omap_hwmod_sysc_type1,
784};
785
786static struct omap_hwmod_class dm816x_mmc_class = {
787 .name = "mmc",
788 .sysc = &dm816x_mmc_sysc,
789};
790
791static struct omap_hwmod_opt_clk dm816x_mmc1_opt_clks[] = {
792 { .role = "dbck", .clk = "sysclk18_ck", },
793};
794
795static struct omap_hsmmc_dev_attr mmc1_dev_attr = {
796 .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
797};
798
799static struct omap_hwmod dm816x_mmc1_hwmod = {
800 .name = "mmc1",
801 .clkdm_name = "alwon_l3s_clkdm",
802 .opt_clks = dm816x_mmc1_opt_clks,
803 .opt_clks_cnt = ARRAY_SIZE(dm816x_mmc1_opt_clks),
804 .main_clk = "sysclk10_ck",
805 .prcm = {
806 .omap4 = {
807 .clkctrl_offs = DM816X_CM_ALWON_SDIO_CLKCTRL,
808 .modulemode = MODULEMODE_SWCTRL,
809 },
810 },
811 .dev_attr = &mmc1_dev_attr,
812 .class = &dm816x_mmc_class,
813};
814
815static struct omap_hwmod_ocp_if dm816x_l4_ls__mmc1 = {
816 .master = &dm816x_l4_ls_hwmod,
817 .slave = &dm816x_mmc1_hwmod,
818 .clk = "sysclk6_ck",
819 .user = OCP_USER_MPU,
820 .flags = OMAP_FIREWALL_L4
821};
822
823static struct omap_hwmod_class_sysconfig dm816x_mcspi_sysc = {
824 .rev_offs = 0x0,
825 .sysc_offs = 0x110,
826 .syss_offs = 0x114,
827 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
828 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
829 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS,
830 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
831 .sysc_fields = &omap_hwmod_sysc_type1,
832};
833
834static struct omap_hwmod_class dm816x_mcspi_class = {
835 .name = "mcspi",
836 .sysc = &dm816x_mcspi_sysc,
837 .rev = OMAP3_MCSPI_REV,
838};
839
840static struct omap2_mcspi_dev_attr dm816x_mcspi1_dev_attr = {
841 .num_chipselect = 4,
842};
843
844static struct omap_hwmod dm816x_mcspi1_hwmod = {
845 .name = "mcspi1",
846 .clkdm_name = "alwon_l3s_clkdm",
847 .main_clk = "sysclk10_ck",
848 .prcm = {
849 .omap4 = {
850 .clkctrl_offs = DM816X_CM_ALWON_SPI_CLKCTRL,
851 .modulemode = MODULEMODE_SWCTRL,
852 },
853 },
854 .class = &dm816x_mcspi_class,
855 .dev_attr = &dm816x_mcspi1_dev_attr,
856};
857
858static struct omap_hwmod_ocp_if dm816x_l4_ls__mcspi1 = {
859 .master = &dm816x_l4_ls_hwmod,
860 .slave = &dm816x_mcspi1_hwmod,
861 .clk = "sysclk6_ck",
862 .user = OCP_USER_MPU,
863};
864
865static struct omap_hwmod_class_sysconfig dm816x_mailbox_sysc = {
866 .rev_offs = 0x000,
867 .sysc_offs = 0x010,
868 .syss_offs = 0x014,
869 .sysc_flags = SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
870 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE,
871 .idlemodes = SIDLE_FORCE | SIDLE_NO | SIDLE_SMART,
872 .sysc_fields = &omap_hwmod_sysc_type1,
873};
874
875static struct omap_hwmod_class dm816x_mailbox_hwmod_class = {
876 .name = "mailbox",
877 .sysc = &dm816x_mailbox_sysc,
878};
879
880static struct omap_hwmod dm816x_mailbox_hwmod = {
881 .name = "mailbox",
882 .clkdm_name = "alwon_l3s_clkdm",
883 .class = &dm816x_mailbox_hwmod_class,
884 .main_clk = "sysclk6_ck",
885 .prcm = {
886 .omap4 = {
887 .clkctrl_offs = DM816X_CM_ALWON_MAILBOX_CLKCTRL,
888 .modulemode = MODULEMODE_SWCTRL,
889 },
890 },
891};
892
893static struct omap_hwmod_ocp_if dm816x_l4_ls__mailbox = {
894 .master = &dm816x_l4_ls_hwmod,
895 .slave = &dm816x_mailbox_hwmod,
896 .user = OCP_USER_MPU,
897};
898
899static struct omap_hwmod_class dm816x_tpcc_hwmod_class = {
900 .name = "tpcc",
901};
902
903struct omap_hwmod dm816x_tpcc_hwmod = {
904 .name = "tpcc",
905 .class = &dm816x_tpcc_hwmod_class,
906 .clkdm_name = "alwon_l3s_clkdm",
907 .main_clk = "sysclk4_ck",
908 .prcm = {
909 .omap4 = {
910 .clkctrl_offs = DM816X_CM_ALWON_TPCC_CLKCTRL,
911 .modulemode = MODULEMODE_SWCTRL,
912 },
913 },
914};
915
916struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tpcc = {
917 .master = &dm816x_alwon_l3_fast_hwmod,
918 .slave = &dm816x_tpcc_hwmod,
919 .clk = "sysclk4_ck",
920 .user = OCP_USER_MPU,
921};
922
923static struct omap_hwmod_addr_space dm816x_tptc0_addr_space[] = {
924 {
925 .pa_start = 0x49800000,
926 .pa_end = 0x49800000 + SZ_8K - 1,
927 .flags = ADDR_TYPE_RT,
928 },
929 { },
930};
931
932static struct omap_hwmod_class dm816x_tptc0_hwmod_class = {
933 .name = "tptc0",
934};
935
936struct omap_hwmod dm816x_tptc0_hwmod = {
937 .name = "tptc0",
938 .class = &dm816x_tptc0_hwmod_class,
939 .clkdm_name = "alwon_l3s_clkdm",
940 .main_clk = "sysclk4_ck",
941 .prcm = {
942 .omap4 = {
943 .clkctrl_offs = DM816X_CM_ALWON_TPTC0_CLKCTRL,
944 .modulemode = MODULEMODE_SWCTRL,
945 },
946 },
947};
948
949struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc0 = {
950 .master = &dm816x_alwon_l3_fast_hwmod,
951 .slave = &dm816x_tptc0_hwmod,
952 .clk = "sysclk4_ck",
953 .addr = dm816x_tptc0_addr_space,
954 .user = OCP_USER_MPU,
955};
956
957struct omap_hwmod_ocp_if dm816x_tptc0__alwon_l3_fast = {
958 .master = &dm816x_tptc0_hwmod,
959 .slave = &dm816x_alwon_l3_fast_hwmod,
960 .clk = "sysclk4_ck",
961 .addr = dm816x_tptc0_addr_space,
962 .user = OCP_USER_MPU,
963};
964
965static struct omap_hwmod_addr_space dm816x_tptc1_addr_space[] = {
966 {
967 .pa_start = 0x49900000,
968 .pa_end = 0x49900000 + SZ_8K - 1,
969 .flags = ADDR_TYPE_RT,
970 },
971 { },
972};
973
974static struct omap_hwmod_class dm816x_tptc1_hwmod_class = {
975 .name = "tptc1",
976};
977
978struct omap_hwmod dm816x_tptc1_hwmod = {
979 .name = "tptc1",
980 .class = &dm816x_tptc1_hwmod_class,
981 .clkdm_name = "alwon_l3s_clkdm",
982 .main_clk = "sysclk4_ck",
983 .prcm = {
984 .omap4 = {
985 .clkctrl_offs = DM816X_CM_ALWON_TPTC1_CLKCTRL,
986 .modulemode = MODULEMODE_SWCTRL,
987 },
988 },
989};
990
991struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc1 = {
992 .master = &dm816x_alwon_l3_fast_hwmod,
993 .slave = &dm816x_tptc1_hwmod,
994 .clk = "sysclk4_ck",
995 .addr = dm816x_tptc1_addr_space,
996 .user = OCP_USER_MPU,
997};
998
999struct omap_hwmod_ocp_if dm816x_tptc1__alwon_l3_fast = {
1000 .master = &dm816x_tptc1_hwmod,
1001 .slave = &dm816x_alwon_l3_fast_hwmod,
1002 .clk = "sysclk4_ck",
1003 .addr = dm816x_tptc1_addr_space,
1004 .user = OCP_USER_MPU,
1005};
1006
1007static struct omap_hwmod_addr_space dm816x_tptc2_addr_space[] = {
1008 {
1009 .pa_start = 0x49a00000,
1010 .pa_end = 0x49a00000 + SZ_8K - 1,
1011 .flags = ADDR_TYPE_RT,
1012 },
1013 { },
1014};
1015
1016static struct omap_hwmod_class dm816x_tptc2_hwmod_class = {
1017 .name = "tptc2",
1018};
1019
1020struct omap_hwmod dm816x_tptc2_hwmod = {
1021 .name = "tptc2",
1022 .class = &dm816x_tptc2_hwmod_class,
1023 .clkdm_name = "alwon_l3s_clkdm",
1024 .main_clk = "sysclk4_ck",
1025 .prcm = {
1026 .omap4 = {
1027 .clkctrl_offs = DM816X_CM_ALWON_TPTC2_CLKCTRL,
1028 .modulemode = MODULEMODE_SWCTRL,
1029 },
1030 },
1031};
1032
1033struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc2 = {
1034 .master = &dm816x_alwon_l3_fast_hwmod,
1035 .slave = &dm816x_tptc2_hwmod,
1036 .clk = "sysclk4_ck",
1037 .addr = dm816x_tptc2_addr_space,
1038 .user = OCP_USER_MPU,
1039};
1040
1041struct omap_hwmod_ocp_if dm816x_tptc2__alwon_l3_fast = {
1042 .master = &dm816x_tptc2_hwmod,
1043 .slave = &dm816x_alwon_l3_fast_hwmod,
1044 .clk = "sysclk4_ck",
1045 .addr = dm816x_tptc2_addr_space,
1046 .user = OCP_USER_MPU,
1047};
1048
1049static struct omap_hwmod_addr_space dm816x_tptc3_addr_space[] = {
1050 {
1051 .pa_start = 0x49b00000,
1052 .pa_end = 0x49b00000 + SZ_8K - 1,
1053 .flags = ADDR_TYPE_RT,
1054 },
1055 { },
1056};
1057
1058static struct omap_hwmod_class dm816x_tptc3_hwmod_class = {
1059 .name = "tptc3",
1060};
1061
1062struct omap_hwmod dm816x_tptc3_hwmod = {
1063 .name = "tptc3",
1064 .class = &dm816x_tptc3_hwmod_class,
1065 .clkdm_name = "alwon_l3s_clkdm",
1066 .main_clk = "sysclk4_ck",
1067 .prcm = {
1068 .omap4 = {
1069 .clkctrl_offs = DM816X_CM_ALWON_TPTC3_CLKCTRL,
1070 .modulemode = MODULEMODE_SWCTRL,
1071 },
1072 },
1073};
1074
1075struct omap_hwmod_ocp_if dm816x_alwon_l3_fast__tptc3 = {
1076 .master = &dm816x_alwon_l3_fast_hwmod,
1077 .slave = &dm816x_tptc3_hwmod,
1078 .clk = "sysclk4_ck",
1079 .addr = dm816x_tptc3_addr_space,
1080 .user = OCP_USER_MPU,
1081};
1082
1083struct omap_hwmod_ocp_if dm816x_tptc3__alwon_l3_fast = {
1084 .master = &dm816x_tptc3_hwmod,
1085 .slave = &dm816x_alwon_l3_fast_hwmod,
1086 .clk = "sysclk4_ck",
1087 .addr = dm816x_tptc3_addr_space,
1088 .user = OCP_USER_MPU,
1089};
1090
1091static struct omap_hwmod_ocp_if *dm816x_hwmod_ocp_ifs[] __initdata = {
1092 &dm816x_mpu__alwon_l3_slow,
1093 &dm816x_mpu__alwon_l3_med,
1094 &dm816x_alwon_l3_slow__l4_ls,
1095 &dm816x_alwon_l3_slow__l4_hs,
1096 &dm816x_l4_ls__uart1,
1097 &dm816x_l4_ls__uart2,
1098 &dm816x_l4_ls__uart3,
1099 &dm816x_l4_ls__wd_timer1,
1100 &dm816x_l4_ls__i2c1,
1101 &dm816x_l4_ls__i2c2,
1102 &dm81xx_l4_ls__gpio1,
1103 &dm81xx_l4_ls__gpio2,
1104 &dm81xx_l4_ls__elm,
1105 &dm816x_l4_ls__mmc1,
1106 &dm816x_l4_ls__timer1,
1107 &dm816x_l4_ls__timer2,
1108 &dm816x_l4_ls__timer3,
1109 &dm816x_l4_ls__timer4,
1110 &dm816x_l4_ls__timer5,
1111 &dm816x_l4_ls__timer6,
1112 &dm816x_l4_ls__timer7,
1113 &dm816x_l4_ls__mcspi1,
1114 &dm816x_l4_ls__mailbox,
1115 &dm816x_l4_hs__emac0,
1116 &dm816x_emac0__mdio,
1117 &dm816x_l4_hs__emac1,
1118 &dm816x_alwon_l3_fast__tpcc,
1119 &dm816x_alwon_l3_fast__tptc0,
1120 &dm816x_alwon_l3_fast__tptc1,
1121 &dm816x_alwon_l3_fast__tptc2,
1122 &dm816x_alwon_l3_fast__tptc3,
1123 &dm816x_tptc0__alwon_l3_fast,
1124 &dm816x_tptc1__alwon_l3_fast,
1125 &dm816x_tptc2__alwon_l3_fast,
1126 &dm816x_tptc3__alwon_l3_fast,
1127 &dm81xx_alwon_l3_slow__gpmc,
1128 &dm81xx_default_l3_slow__usbss,
1129 NULL,
1130};
1131
1132int __init ti81xx_hwmod_init(void)
1133{
1134 omap_hwmod_init();
1135 return omap_hwmod_register_links(dm816x_hwmod_ocp_ifs);
1136}
diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 042f693ef423..a219dc310d5d 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -11,7 +11,7 @@ menuconfig ARCH_SIRF
11 11
12if ARCH_SIRF 12if ARCH_SIRF
13 13
14comment "CSR SiRF atlas6/primaII/Marco/Polo Specific Features" 14comment "CSR SiRF atlas6/primaII/Atlas7 Specific Features"
15 15
16config ARCH_ATLAS6 16config ARCH_ATLAS6
17 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform" 17 bool "CSR SiRFSoC ATLAS6 ARM Cortex A9 Platform"
@@ -20,6 +20,17 @@ config ARCH_ATLAS6
20 help 20 help
21 Support for CSR SiRFSoC ARM Cortex A9 Platform 21 Support for CSR SiRFSoC ARM Cortex A9 Platform
22 22
23config ARCH_ATLAS7
24 bool "CSR SiRFSoC ATLAS7 ARM Cortex A7 Platform"
25 default y
26 select ARM_GIC
27 select CPU_V7
28 select HAVE_ARM_SCU if SMP
29 select HAVE_SMP
30 select SMP_ON_UP if SMP
31 help
32 Support for CSR SiRFSoC ARM Cortex A7 Platform
33
23config ARCH_PRIMA2 34config ARCH_PRIMA2
24 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform" 35 bool "CSR SiRFSoC PRIMA2 ARM Cortex A9 Platform"
25 default y 36 default y
@@ -28,15 +39,6 @@ config ARCH_PRIMA2
28 help 39 help
29 Support for CSR SiRFSoC ARM Cortex A9 Platform 40 Support for CSR SiRFSoC ARM Cortex A9 Platform
30 41
31config ARCH_MARCO
32 bool "CSR SiRFSoC MARCO ARM Cortex A9 Platform"
33 default y
34 select ARM_GIC
35 select HAVE_ARM_SCU if SMP
36 select SMP_ON_UP if SMP
37 help
38 Support for CSR SiRFSoC ARM Cortex A9 Platform
39
40config SIRF_IRQ 42config SIRF_IRQ
41 bool 43 bool
42 44
diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index 8846e7d87ea5..d7d02b043449 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -1,7 +1,6 @@
1obj-y += rstc.o 1obj-y += rstc.o
2obj-y += common.o 2obj-y += common.o
3obj-y += rtciobrg.o 3obj-y += rtciobrg.o
4obj-$(CONFIG_DEBUG_LL) += lluart.o
5obj-$(CONFIG_SUSPEND) += pm.o sleep.o 4obj-$(CONFIG_SUSPEND) += pm.o sleep.o
6obj-$(CONFIG_SMP) += platsmp.o headsmp.o 5obj-$(CONFIG_SMP) += platsmp.o headsmp.o
7obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 6obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index a860ea27e8ae..0c819bb88418 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -20,12 +20,6 @@ static void __init sirfsoc_init_late(void)
20 sirfsoc_pm_init(); 20 sirfsoc_pm_init();
21} 21}
22 22
23static __init void sirfsoc_map_io(void)
24{
25 sirfsoc_map_lluart();
26 sirfsoc_map_scu();
27}
28
29#ifdef CONFIG_ARCH_ATLAS6 23#ifdef CONFIG_ARCH_ATLAS6
30static const char *atlas6_dt_match[] __initconst = { 24static const char *atlas6_dt_match[] __initconst = {
31 "sirf,atlas6", 25 "sirf,atlas6",
@@ -36,7 +30,6 @@ DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
36 /* Maintainer: Barry Song <baohua.song@csr.com> */ 30 /* Maintainer: Barry Song <baohua.song@csr.com> */
37 .l2c_aux_val = 0, 31 .l2c_aux_val = 0,
38 .l2c_aux_mask = ~0, 32 .l2c_aux_mask = ~0,
39 .map_io = sirfsoc_map_io,
40 .init_late = sirfsoc_init_late, 33 .init_late = sirfsoc_init_late,
41 .dt_compat = atlas6_dt_match, 34 .dt_compat = atlas6_dt_match,
42MACHINE_END 35MACHINE_END
@@ -52,26 +45,21 @@ DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
52 /* Maintainer: Barry Song <baohua.song@csr.com> */ 45 /* Maintainer: Barry Song <baohua.song@csr.com> */
53 .l2c_aux_val = 0, 46 .l2c_aux_val = 0,
54 .l2c_aux_mask = ~0, 47 .l2c_aux_mask = ~0,
55 .map_io = sirfsoc_map_io,
56 .dma_zone_size = SZ_256M, 48 .dma_zone_size = SZ_256M,
57 .init_late = sirfsoc_init_late, 49 .init_late = sirfsoc_init_late,
58 .dt_compat = prima2_dt_match, 50 .dt_compat = prima2_dt_match,
59MACHINE_END 51MACHINE_END
60#endif 52#endif
61 53
62#ifdef CONFIG_ARCH_MARCO 54#ifdef CONFIG_ARCH_ATLAS7
63static const char *marco_dt_match[] __initconst = { 55static const char *atlas7_dt_match[] __initdata = {
64 "sirf,marco", 56 "sirf,atlas7",
65 NULL 57 NULL
66}; 58};
67 59
68DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)") 60DT_MACHINE_START(ATLAS7_DT, "Generic ATLAS7 (Flattened Device Tree)")
69 /* Maintainer: Barry Song <baohua.song@csr.com> */ 61 /* Maintainer: Barry Song <baohua.song@csr.com> */
70 .l2c_aux_val = 0,
71 .l2c_aux_mask = ~0,
72 .smp = smp_ops(sirfsoc_smp_ops), 62 .smp = smp_ops(sirfsoc_smp_ops),
73 .map_io = sirfsoc_map_io, 63 .dt_compat = atlas7_dt_match,
74 .init_late = sirfsoc_init_late,
75 .dt_compat = marco_dt_match,
76MACHINE_END 64MACHINE_END
77#endif 65#endif
diff --git a/arch/arm/mach-prima2/lluart.c b/arch/arm/mach-prima2/lluart.c
deleted file mode 100644
index 99c0c927ca4a..000000000000
--- a/arch/arm/mach-prima2/lluart.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Static memory mapping for DEBUG_LL
3 *
4 * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#include <linux/kernel.h>
10#include <asm/page.h>
11#include <asm/mach/map.h>
12#include "common.h"
13
14#if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1)
15#define SIRFSOC_UART1_PA_BASE 0xb0060000
16#elif defined(CONFIG_DEBUG_SIRFMARCO_UART1)
17#define SIRFSOC_UART1_PA_BASE 0xcc060000
18#else
19#define SIRFSOC_UART1_PA_BASE 0
20#endif
21
22#define SIRFSOC_UART1_VA_BASE SIRFSOC_VA(0x060000)
23#define SIRFSOC_UART1_SIZE SZ_4K
24
25void __init sirfsoc_map_lluart(void)
26{
27 struct map_desc sirfsoc_lluart_map = {
28 .virtual = SIRFSOC_UART1_VA_BASE,
29 .pfn = __phys_to_pfn(SIRFSOC_UART1_PA_BASE),
30 .length = SIRFSOC_UART1_SIZE,
31 .type = MT_DEVICE,
32 };
33
34 iotable_init(&sirfsoc_lluart_map, 1);
35}
diff --git a/arch/arm/mach-prima2/platsmp.c b/arch/arm/mach-prima2/platsmp.c
index 335c12e92262..fc2b03c81e5f 100644
--- a/arch/arm/mach-prima2/platsmp.c
+++ b/arch/arm/mach-prima2/platsmp.c
@@ -20,30 +20,10 @@
20 20
21#include "common.h" 21#include "common.h"
22 22
23static void __iomem *scu_base; 23static void __iomem *clk_base;
24static void __iomem *rsc_base;
25 24
26static DEFINE_SPINLOCK(boot_lock); 25static DEFINE_SPINLOCK(boot_lock);
27 26
28static struct map_desc scu_io_desc __initdata = {
29 .length = SZ_4K,
30 .type = MT_DEVICE,
31};
32
33void __init sirfsoc_map_scu(void)
34{
35 unsigned long base;
36
37 /* Get SCU base */
38 asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
39
40 scu_io_desc.virtual = SIRFSOC_VA(base);
41 scu_io_desc.pfn = __phys_to_pfn(base);
42 iotable_init(&scu_io_desc, 1);
43
44 scu_base = (void __iomem *)SIRFSOC_VA(base);
45}
46
47static void sirfsoc_secondary_init(unsigned int cpu) 27static void sirfsoc_secondary_init(unsigned int cpu)
48{ 28{
49 /* 29 /*
@@ -60,8 +40,8 @@ static void sirfsoc_secondary_init(unsigned int cpu)
60 spin_unlock(&boot_lock); 40 spin_unlock(&boot_lock);
61} 41}
62 42
63static struct of_device_id rsc_ids[] = { 43static struct of_device_id clk_ids[] = {
64 { .compatible = "sirf,marco-rsc" }, 44 { .compatible = "sirf,atlas7-clkc" },
65 {}, 45 {},
66}; 46};
67 47
@@ -70,27 +50,27 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
70 unsigned long timeout; 50 unsigned long timeout;
71 struct device_node *np; 51 struct device_node *np;
72 52
73 np = of_find_matching_node(NULL, rsc_ids); 53 np = of_find_matching_node(NULL, clk_ids);
74 if (!np) 54 if (!np)
75 return -ENODEV; 55 return -ENODEV;
76 56
77 rsc_base = of_iomap(np, 0); 57 clk_base = of_iomap(np, 0);
78 if (!rsc_base) 58 if (!clk_base)
79 return -ENOMEM; 59 return -ENOMEM;
80 60
81 /* 61 /*
82 * write the address of secondary startup into the sram register 62 * write the address of secondary startup into the clkc register
83 * at offset 0x2C, then write the magic number 0x3CAF5D62 to the 63 * at offset 0x2bC, then write the magic number 0x3CAF5D62 to the
84 * RSC register at offset 0x28, which is what boot rom code is 64 * clkc register at offset 0x2b8, which is what boot rom code is
85 * waiting for. This would wake up the secondary core from WFE 65 * waiting for. This would wake up the secondary core from WFE
86 */ 66 */
87#define SIRFSOC_CPU1_JUMPADDR_OFFSET 0x2C 67#define SIRFSOC_CPU1_JUMPADDR_OFFSET 0x2bc
88 __raw_writel(virt_to_phys(sirfsoc_secondary_startup), 68 __raw_writel(virt_to_phys(sirfsoc_secondary_startup),
89 rsc_base + SIRFSOC_CPU1_JUMPADDR_OFFSET); 69 clk_base + SIRFSOC_CPU1_JUMPADDR_OFFSET);
90 70
91#define SIRFSOC_CPU1_WAKEMAGIC_OFFSET 0x28 71#define SIRFSOC_CPU1_WAKEMAGIC_OFFSET 0x2b8
92 __raw_writel(0x3CAF5D62, 72 __raw_writel(0x3CAF5D62,
93 rsc_base + SIRFSOC_CPU1_WAKEMAGIC_OFFSET); 73 clk_base + SIRFSOC_CPU1_WAKEMAGIC_OFFSET);
94 74
95 /* make sure write buffer is drained */ 75 /* make sure write buffer is drained */
96 mb(); 76 mb();
@@ -132,13 +112,7 @@ static int sirfsoc_boot_secondary(unsigned int cpu, struct task_struct *idle)
132 return pen_release != -1 ? -ENOSYS : 0; 112 return pen_release != -1 ? -ENOSYS : 0;
133} 113}
134 114
135static void __init sirfsoc_smp_prepare_cpus(unsigned int max_cpus)
136{
137 scu_enable(scu_base);
138}
139
140struct smp_operations sirfsoc_smp_ops __initdata = { 115struct smp_operations sirfsoc_smp_ops __initdata = {
141 .smp_prepare_cpus = sirfsoc_smp_prepare_cpus,
142 .smp_secondary_init = sirfsoc_secondary_init, 116 .smp_secondary_init = sirfsoc_secondary_init,
143 .smp_boot_secondary = sirfsoc_boot_secondary, 117 .smp_boot_secondary = sirfsoc_boot_secondary,
144#ifdef CONFIG_HOTPLUG_CPU 118#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index e1f1f86f6a95..7c251eb11d01 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -34,36 +34,20 @@ static int sirfsoc_reset_module(struct reset_controller_dev *rcdev,
34 34
35 mutex_lock(&rstc_lock); 35 mutex_lock(&rstc_lock);
36 36
37 if (of_device_is_compatible(rcdev->of_node, "sirf,prima2-rstc")) { 37 /*
38 /* 38 * Writing 1 to this bit resets corresponding block.
39 * Writing 1 to this bit resets corresponding block. 39 * Writing 0 to this bit de-asserts reset signal of the
40 * Writing 0 to this bit de-asserts reset signal of the 40 * corresponding block. datasheet doesn't require explicit
41 * corresponding block. datasheet doesn't require explicit 41 * delay between the set and clear of reset bit. it could
42 * delay between the set and clear of reset bit. it could 42 * be shorter if tests pass.
43 * be shorter if tests pass. 43 */
44 */ 44 writel(readl(sirfsoc_rstc_base +
45 writel(readl(sirfsoc_rstc_base +
46 (reset_bit / 32) * 4) | (1 << reset_bit), 45 (reset_bit / 32) * 4) | (1 << reset_bit),
47 sirfsoc_rstc_base + (reset_bit / 32) * 4); 46 sirfsoc_rstc_base + (reset_bit / 32) * 4);
48 msleep(20); 47 msleep(20);
49 writel(readl(sirfsoc_rstc_base + 48 writel(readl(sirfsoc_rstc_base +
50 (reset_bit / 32) * 4) & ~(1 << reset_bit), 49 (reset_bit / 32) * 4) & ~(1 << reset_bit),
51 sirfsoc_rstc_base + (reset_bit / 32) * 4); 50 sirfsoc_rstc_base + (reset_bit / 32) * 4);
52 } else {
53 /*
54 * For MARCO and POLO
55 * Writing 1 to SET register resets corresponding block.
56 * Writing 1 to CLEAR register de-asserts reset signal of the
57 * corresponding block.
58 * datasheet doesn't require explicit delay between the set and
59 * clear of reset bit. it could be shorter if tests pass.
60 */
61 writel(1 << reset_bit,
62 sirfsoc_rstc_base + (reset_bit / 32) * 8);
63 msleep(20);
64 writel(1 << reset_bit,
65 sirfsoc_rstc_base + (reset_bit / 32) * 8 + 4);
66 }
67 51
68 mutex_unlock(&rstc_lock); 52 mutex_unlock(&rstc_lock);
69 53
@@ -106,7 +90,6 @@ static int sirfsoc_rstc_probe(struct platform_device *pdev)
106 90
107static const struct of_device_id rstc_ids[] = { 91static const struct of_device_id rstc_ids[] = {
108 { .compatible = "sirf,prima2-rstc" }, 92 { .compatible = "sirf,prima2-rstc" },
109 { .compatible = "sirf,marco-rstc" },
110 {}, 93 {},
111}; 94};
112 95
diff --git a/arch/arm/mach-prima2/rtciobrg.c b/arch/arm/mach-prima2/rtciobrg.c
index 70a0b475062b..8f66d8f7ca75 100644
--- a/arch/arm/mach-prima2/rtciobrg.c
+++ b/arch/arm/mach-prima2/rtciobrg.c
@@ -104,7 +104,6 @@ EXPORT_SYMBOL_GPL(sirfsoc_rtc_iobrg_writel);
104 104
105static const struct of_device_id rtciobrg_ids[] = { 105static const struct of_device_id rtciobrg_ids[] = {
106 { .compatible = "sirf,prima2-rtciobg" }, 106 { .compatible = "sirf,prima2-rtciobg" },
107 { .compatible = "sirf,marco-rtciobg" },
108 {} 107 {}
109}; 108};
110 109
diff --git a/arch/arm/mach-qcom/Kconfig b/arch/arm/mach-qcom/Kconfig
index ee5697ba05bc..48003ea652b9 100644
--- a/arch/arm/mach-qcom/Kconfig
+++ b/arch/arm/mach-qcom/Kconfig
@@ -1,9 +1,8 @@
1menuconfig ARCH_QCOM 1menuconfig ARCH_QCOM
2 bool "Qualcomm Support" if ARCH_MULTI_V7 2 bool "Qualcomm Support" if ARCH_MULTI_V7
3 select ARCH_REQUIRE_GPIOLIB 3 select ARCH_SUPPORTS_BIG_ENDIAN
4 select ARM_GIC 4 select ARM_GIC
5 select ARM_AMBA 5 select ARM_AMBA
6 select CLKSRC_OF
7 select PINCTRL 6 select PINCTRL
8 select QCOM_SCM if SMP 7 select QCOM_SCM if SMP
9 help 8 help
diff --git a/arch/arm/mach-qcom/scm-boot.c b/arch/arm/mach-qcom/scm-boot.c
index 45cee3e469a5..e8ff7beb6218 100644
--- a/arch/arm/mach-qcom/scm-boot.c
+++ b/arch/arm/mach-qcom/scm-boot.c
@@ -24,15 +24,15 @@
24/* 24/*
25 * Set the cold/warm boot address for one of the CPU cores. 25 * Set the cold/warm boot address for one of the CPU cores.
26 */ 26 */
27int scm_set_boot_addr(phys_addr_t addr, int flags) 27int scm_set_boot_addr(u32 addr, int flags)
28{ 28{
29 struct { 29 struct {
30 unsigned int flags; 30 __le32 flags;
31 phys_addr_t addr; 31 __le32 addr;
32 } cmd; 32 } cmd;
33 33
34 cmd.addr = addr; 34 cmd.addr = cpu_to_le32(addr);
35 cmd.flags = flags; 35 cmd.flags = cpu_to_le32(flags);
36 return scm_call(SCM_SVC_BOOT, SCM_BOOT_ADDR, 36 return scm_call(SCM_SVC_BOOT, SCM_BOOT_ADDR,
37 &cmd, sizeof(cmd), NULL, 0); 37 &cmd, sizeof(cmd), NULL, 0);
38} 38}
diff --git a/arch/arm/mach-qcom/scm-boot.h b/arch/arm/mach-qcom/scm-boot.h
index 6aabb2428176..3e210fb818bb 100644
--- a/arch/arm/mach-qcom/scm-boot.h
+++ b/arch/arm/mach-qcom/scm-boot.h
@@ -18,7 +18,9 @@
18#define SCM_FLAG_COLDBOOT_CPU3 0x20 18#define SCM_FLAG_COLDBOOT_CPU3 0x20
19#define SCM_FLAG_WARMBOOT_CPU0 0x04 19#define SCM_FLAG_WARMBOOT_CPU0 0x04
20#define SCM_FLAG_WARMBOOT_CPU1 0x02 20#define SCM_FLAG_WARMBOOT_CPU1 0x02
21#define SCM_FLAG_WARMBOOT_CPU2 0x10
22#define SCM_FLAG_WARMBOOT_CPU3 0x40
21 23
22int scm_set_boot_addr(phys_addr_t addr, int flags); 24int scm_set_boot_addr(u32 addr, int flags);
23 25
24#endif 26#endif
diff --git a/arch/arm/mach-qcom/scm.c b/arch/arm/mach-qcom/scm.c
index c536fd6bf827..1d9cf18c7091 100644
--- a/arch/arm/mach-qcom/scm.c
+++ b/arch/arm/mach-qcom/scm.c
@@ -22,13 +22,11 @@
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/err.h> 23#include <linux/err.h>
24 24
25#include <asm/outercache.h>
25#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
26 27
27#include "scm.h" 28#include "scm.h"
28 29
29/* Cache line size for msm8x60 */
30#define CACHELINESIZE 32
31
32#define SCM_ENOMEM -5 30#define SCM_ENOMEM -5
33#define SCM_EOPNOTSUPP -4 31#define SCM_EOPNOTSUPP -4
34#define SCM_EINVAL_ADDR -3 32#define SCM_EINVAL_ADDR -3
@@ -63,11 +61,11 @@ static DEFINE_MUTEX(scm_lock);
63 * to access the buffers in a safe manner. 61 * to access the buffers in a safe manner.
64 */ 62 */
65struct scm_command { 63struct scm_command {
66 u32 len; 64 __le32 len;
67 u32 buf_offset; 65 __le32 buf_offset;
68 u32 resp_hdr_offset; 66 __le32 resp_hdr_offset;
69 u32 id; 67 __le32 id;
70 u32 buf[0]; 68 __le32 buf[0];
71}; 69};
72 70
73/** 71/**
@@ -77,9 +75,9 @@ struct scm_command {
77 * @is_complete: indicates if the command has finished processing 75 * @is_complete: indicates if the command has finished processing
78 */ 76 */
79struct scm_response { 77struct scm_response {
80 u32 len; 78 __le32 len;
81 u32 buf_offset; 79 __le32 buf_offset;
82 u32 is_complete; 80 __le32 is_complete;
83}; 81};
84 82
85/** 83/**
@@ -97,12 +95,14 @@ static struct scm_command *alloc_scm_command(size_t cmd_size, size_t resp_size)
97 struct scm_command *cmd; 95 struct scm_command *cmd;
98 size_t len = sizeof(*cmd) + sizeof(struct scm_response) + cmd_size + 96 size_t len = sizeof(*cmd) + sizeof(struct scm_response) + cmd_size +
99 resp_size; 97 resp_size;
98 u32 offset;
100 99
101 cmd = kzalloc(PAGE_ALIGN(len), GFP_KERNEL); 100 cmd = kzalloc(PAGE_ALIGN(len), GFP_KERNEL);
102 if (cmd) { 101 if (cmd) {
103 cmd->len = len; 102 cmd->len = cpu_to_le32(len);
104 cmd->buf_offset = offsetof(struct scm_command, buf); 103 offset = offsetof(struct scm_command, buf);
105 cmd->resp_hdr_offset = cmd->buf_offset + cmd_size; 104 cmd->buf_offset = cpu_to_le32(offset);
105 cmd->resp_hdr_offset = cpu_to_le32(offset + cmd_size);
106 } 106 }
107 return cmd; 107 return cmd;
108} 108}
@@ -127,7 +127,7 @@ static inline void free_scm_command(struct scm_command *cmd)
127static inline struct scm_response *scm_command_to_response( 127static inline struct scm_response *scm_command_to_response(
128 const struct scm_command *cmd) 128 const struct scm_command *cmd)
129{ 129{
130 return (void *)cmd + cmd->resp_hdr_offset; 130 return (void *)cmd + le32_to_cpu(cmd->resp_hdr_offset);
131} 131}
132 132
133/** 133/**
@@ -149,11 +149,12 @@ static inline void *scm_get_command_buffer(const struct scm_command *cmd)
149 */ 149 */
150static inline void *scm_get_response_buffer(const struct scm_response *rsp) 150static inline void *scm_get_response_buffer(const struct scm_response *rsp)
151{ 151{
152 return (void *)rsp + rsp->buf_offset; 152 return (void *)rsp + le32_to_cpu(rsp->buf_offset);
153} 153}
154 154
155static int scm_remap_error(int err) 155static int scm_remap_error(int err)
156{ 156{
157 pr_err("scm_call failed with error code %d\n", err);
157 switch (err) { 158 switch (err) {
158 case SCM_ERROR: 159 case SCM_ERROR:
159 return -EIO; 160 return -EIO;
@@ -198,11 +199,12 @@ static int __scm_call(const struct scm_command *cmd)
198 u32 cmd_addr = virt_to_phys(cmd); 199 u32 cmd_addr = virt_to_phys(cmd);
199 200
200 /* 201 /*
201 * Flush the entire cache here so callers don't have to remember 202 * Flush the command buffer so that the secure world sees
202 * to flush the cache when passing physical addresses to the secure 203 * the correct data.
203 * side in the buffer.
204 */ 204 */
205 flush_cache_all(); 205 __cpuc_flush_dcache_area((void *)cmd, cmd->len);
206 outer_flush_range(cmd_addr, cmd_addr + cmd->len);
207
206 ret = smc(cmd_addr); 208 ret = smc(cmd_addr);
207 if (ret < 0) 209 if (ret < 0)
208 ret = scm_remap_error(ret); 210 ret = scm_remap_error(ret);
@@ -210,6 +212,25 @@ static int __scm_call(const struct scm_command *cmd)
210 return ret; 212 return ret;
211} 213}
212 214
215static void scm_inv_range(unsigned long start, unsigned long end)
216{
217 u32 cacheline_size, ctr;
218
219 asm volatile("mrc p15, 0, %0, c0, c0, 1" : "=r" (ctr));
220 cacheline_size = 4 << ((ctr >> 16) & 0xf);
221
222 start = round_down(start, cacheline_size);
223 end = round_up(end, cacheline_size);
224 outer_inv_range(start, end);
225 while (start < end) {
226 asm ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start)
227 : "memory");
228 start += cacheline_size;
229 }
230 dsb();
231 isb();
232}
233
213/** 234/**
214 * scm_call() - Send an SCM command 235 * scm_call() - Send an SCM command
215 * @svc_id: service identifier 236 * @svc_id: service identifier
@@ -220,6 +241,13 @@ static int __scm_call(const struct scm_command *cmd)
220 * @resp_len: length of the response buffer 241 * @resp_len: length of the response buffer
221 * 242 *
222 * Sends a command to the SCM and waits for the command to finish processing. 243 * Sends a command to the SCM and waits for the command to finish processing.
244 *
245 * A note on cache maintenance:
246 * Note that any buffers that are expected to be accessed by the secure world
247 * must be flushed before invoking scm_call and invalidated in the cache
248 * immediately after scm_call returns. Cache maintenance on the command and
249 * response buffers is taken care of by scm_call; however, callers are
250 * responsible for any other cached buffers passed over to the secure world.
223 */ 251 */
224int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len, 252int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len,
225 void *resp_buf, size_t resp_len) 253 void *resp_buf, size_t resp_len)
@@ -227,12 +255,13 @@ int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len,
227 int ret; 255 int ret;
228 struct scm_command *cmd; 256 struct scm_command *cmd;
229 struct scm_response *rsp; 257 struct scm_response *rsp;
258 unsigned long start, end;
230 259
231 cmd = alloc_scm_command(cmd_len, resp_len); 260 cmd = alloc_scm_command(cmd_len, resp_len);
232 if (!cmd) 261 if (!cmd)
233 return -ENOMEM; 262 return -ENOMEM;
234 263
235 cmd->id = (svc_id << 10) | cmd_id; 264 cmd->id = cpu_to_le32((svc_id << 10) | cmd_id);
236 if (cmd_buf) 265 if (cmd_buf)
237 memcpy(scm_get_command_buffer(cmd), cmd_buf, cmd_len); 266 memcpy(scm_get_command_buffer(cmd), cmd_buf, cmd_len);
238 267
@@ -243,17 +272,15 @@ int scm_call(u32 svc_id, u32 cmd_id, const void *cmd_buf, size_t cmd_len,
243 goto out; 272 goto out;
244 273
245 rsp = scm_command_to_response(cmd); 274 rsp = scm_command_to_response(cmd);
275 start = (unsigned long)rsp;
276
246 do { 277 do {
247 u32 start = (u32)rsp; 278 scm_inv_range(start, start + sizeof(*rsp));
248 u32 end = (u32)scm_get_response_buffer(rsp) + resp_len;
249 start &= ~(CACHELINESIZE - 1);
250 while (start < end) {
251 asm ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start)
252 : "memory");
253 start += CACHELINESIZE;
254 }
255 } while (!rsp->is_complete); 279 } while (!rsp->is_complete);
256 280
281 end = (unsigned long)scm_get_response_buffer(rsp) + resp_len;
282 scm_inv_range(start, end);
283
257 if (resp_buf) 284 if (resp_buf)
258 memcpy(resp_buf, scm_get_response_buffer(rsp), resp_len); 285 memcpy(resp_buf, scm_get_response_buffer(rsp), resp_len);
259out: 286out:
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index b29d8ead4cf2..5c3a9b2de920 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -1,4 +1,5 @@
1CFLAGS_platsmp.o := -march=armv7-a 1CFLAGS_platsmp.o := -march=armv7-a
2 2
3obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o 3obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o
4obj-$(CONFIG_PM_SLEEP) += pm.o sleep.o
4obj-$(CONFIG_SMP) += headsmp.o platsmp.o 5obj-$(CONFIG_SMP) += headsmp.o platsmp.o
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
new file mode 100644
index 000000000000..50cb781aaa36
--- /dev/null
+++ b/arch/arm/mach-rockchip/pm.c
@@ -0,0 +1,260 @@
1/*
2 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
3 * Author: Tony Xie <tony.xie@rock-chips.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 */
15
16#include <linux/init.h>
17#include <linux/io.h>
18#include <linux/kernel.h>
19#include <linux/of.h>
20#include <linux/of_address.h>
21#include <linux/regmap.h>
22#include <linux/suspend.h>
23#include <linux/mfd/syscon.h>
24#include <linux/regulator/machine.h>
25
26#include <asm/cacheflush.h>
27#include <asm/tlbflush.h>
28#include <asm/suspend.h>
29
30#include "pm.h"
31
32/* These enum are option of low power mode */
33enum {
34 ROCKCHIP_ARM_OFF_LOGIC_NORMAL = 0,
35 ROCKCHIP_ARM_OFF_LOGIC_DEEP = 1,
36};
37
38struct rockchip_pm_data {
39 const struct platform_suspend_ops *ops;
40 int (*init)(struct device_node *np);
41};
42
43static void __iomem *rk3288_bootram_base;
44static phys_addr_t rk3288_bootram_phy;
45
46static struct regmap *pmu_regmap;
47static struct regmap *sgrf_regmap;
48
49static u32 rk3288_pmu_pwr_mode_con;
50static u32 rk3288_sgrf_soc_con0;
51
52static inline u32 rk3288_l2_config(void)
53{
54 u32 l2ctlr;
55
56 asm("mrc p15, 1, %0, c9, c0, 2" : "=r" (l2ctlr));
57 return l2ctlr;
58}
59
60static void rk3288_config_bootdata(void)
61{
62 rkpm_bootdata_cpusp = rk3288_bootram_phy + (SZ_4K - 8);
63 rkpm_bootdata_cpu_code = virt_to_phys(cpu_resume);
64
65 rkpm_bootdata_l2ctlr_f = 1;
66 rkpm_bootdata_l2ctlr = rk3288_l2_config();
67}
68
69static void rk3288_slp_mode_set(int level)
70{
71 u32 mode_set, mode_set1;
72
73 regmap_read(sgrf_regmap, RK3288_SGRF_SOC_CON0, &rk3288_sgrf_soc_con0);
74
75 regmap_read(pmu_regmap, RK3288_PMU_PWRMODE_CON,
76 &rk3288_pmu_pwr_mode_con);
77
78 /* set bit 8 so that system will resume to FAST_BOOT_ADDR */
79 regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0,
80 SGRF_FAST_BOOT_EN | SGRF_FAST_BOOT_EN_WRITE);
81
82 /* booting address of resuming system is from this register value */
83 regmap_write(sgrf_regmap, RK3288_SGRF_FAST_BOOT_ADDR,
84 rk3288_bootram_phy);
85
86 regmap_write(pmu_regmap, RK3288_PMU_WAKEUP_CFG1,
87 PMU_ARMINT_WAKEUP_EN);
88
89 mode_set = BIT(PMU_GLOBAL_INT_DISABLE) | BIT(PMU_L2FLUSH_EN) |
90 BIT(PMU_SREF0_ENTER_EN) | BIT(PMU_SREF1_ENTER_EN) |
91 BIT(PMU_DDR0_GATING_EN) | BIT(PMU_DDR1_GATING_EN) |
92 BIT(PMU_PWR_MODE_EN) | BIT(PMU_CHIP_PD_EN) |
93 BIT(PMU_SCU_EN);
94
95 mode_set1 = BIT(PMU_CLR_CORE) | BIT(PMU_CLR_CPUP);
96
97 if (level == ROCKCHIP_ARM_OFF_LOGIC_DEEP) {
98 /* arm off, logic deep sleep */
99 mode_set |= BIT(PMU_BUS_PD_EN) |
100 BIT(PMU_DDR1IO_RET_EN) | BIT(PMU_DDR0IO_RET_EN) |
101 BIT(PMU_OSC_24M_DIS) | BIT(PMU_PMU_USE_LF) |
102 BIT(PMU_ALIVE_USE_LF) | BIT(PMU_PLL_PD_EN);
103
104 mode_set1 |= BIT(PMU_CLR_ALIVE) | BIT(PMU_CLR_BUS) |
105 BIT(PMU_CLR_PERI) | BIT(PMU_CLR_DMA);
106 } else {
107 /*
108 * arm off, logic normal
109 * if pmu_clk_core_src_gate_en is not set,
110 * wakeup will be error
111 */
112 mode_set |= BIT(PMU_CLK_CORE_SRC_GATE_EN);
113 }
114
115 regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON, mode_set);
116 regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON1, mode_set1);
117}
118
119static void rk3288_slp_mode_set_resume(void)
120{
121 regmap_write(pmu_regmap, RK3288_PMU_PWRMODE_CON,
122 rk3288_pmu_pwr_mode_con);
123
124 regmap_write(sgrf_regmap, RK3288_SGRF_SOC_CON0,
125 rk3288_sgrf_soc_con0 | SGRF_FAST_BOOT_EN_WRITE);
126}
127
128static int rockchip_lpmode_enter(unsigned long arg)
129{
130 flush_cache_all();
131
132 cpu_do_idle();
133
134 pr_err("%s: Failed to suspend\n", __func__);
135
136 return 1;
137}
138
139static int rk3288_suspend_enter(suspend_state_t state)
140{
141 local_fiq_disable();
142
143 rk3288_slp_mode_set(ROCKCHIP_ARM_OFF_LOGIC_NORMAL);
144
145 cpu_suspend(0, rockchip_lpmode_enter);
146
147 rk3288_slp_mode_set_resume();
148
149 local_fiq_enable();
150
151 return 0;
152}
153
154static int rk3288_suspend_prepare(void)
155{
156 return regulator_suspend_prepare(PM_SUSPEND_MEM);
157}
158
159static void rk3288_suspend_finish(void)
160{
161 if (regulator_suspend_finish())
162 pr_err("%s: Suspend finish failed\n", __func__);
163}
164
165static int rk3288_suspend_init(struct device_node *np)
166{
167 struct device_node *sram_np;
168 struct resource res;
169 int ret;
170
171 pmu_regmap = syscon_node_to_regmap(np);
172 if (IS_ERR(pmu_regmap)) {
173 pr_err("%s: could not find pmu regmap\n", __func__);
174 return PTR_ERR(pmu_regmap);
175 }
176
177 sgrf_regmap = syscon_regmap_lookup_by_compatible(
178 "rockchip,rk3288-sgrf");
179 if (IS_ERR(sgrf_regmap)) {
180 pr_err("%s: could not find sgrf regmap\n", __func__);
181 return PTR_ERR(pmu_regmap);
182 }
183
184 sram_np = of_find_compatible_node(NULL, NULL,
185 "rockchip,rk3288-pmu-sram");
186 if (!sram_np) {
187 pr_err("%s: could not find bootram dt node\n", __func__);
188 return -ENODEV;
189 }
190
191 rk3288_bootram_base = of_iomap(sram_np, 0);
192 if (!rk3288_bootram_base) {
193 pr_err("%s: could not map bootram base\n", __func__);
194 return -ENOMEM;
195 }
196
197 ret = of_address_to_resource(sram_np, 0, &res);
198 if (ret) {
199 pr_err("%s: could not get bootram phy addr\n", __func__);
200 return ret;
201 }
202 rk3288_bootram_phy = res.start;
203
204 of_node_put(sram_np);
205
206 rk3288_config_bootdata();
207
208 /* copy resume code and data to bootsram */
209 memcpy(rk3288_bootram_base, rockchip_slp_cpu_resume,
210 rk3288_bootram_sz);
211
212 return 0;
213}
214
215static const struct platform_suspend_ops rk3288_suspend_ops = {
216 .enter = rk3288_suspend_enter,
217 .valid = suspend_valid_only_mem,
218 .prepare = rk3288_suspend_prepare,
219 .finish = rk3288_suspend_finish,
220};
221
222static const struct rockchip_pm_data rk3288_pm_data __initconst = {
223 .ops = &rk3288_suspend_ops,
224 .init = rk3288_suspend_init,
225};
226
227static const struct of_device_id rockchip_pmu_of_device_ids[] __initconst = {
228 {
229 .compatible = "rockchip,rk3288-pmu",
230 .data = &rk3288_pm_data,
231 },
232 { /* sentinel */ },
233};
234
235void __init rockchip_suspend_init(void)
236{
237 const struct rockchip_pm_data *pm_data;
238 const struct of_device_id *match;
239 struct device_node *np;
240 int ret;
241
242 np = of_find_matching_node_and_match(NULL, rockchip_pmu_of_device_ids,
243 &match);
244 if (!match) {
245 pr_err("Failed to find PMU node\n");
246 return;
247 }
248 pm_data = (struct rockchip_pm_data *) match->data;
249
250 if (pm_data->init) {
251 ret = pm_data->init(np);
252
253 if (ret) {
254 pr_err("%s: matches init error %d\n", __func__, ret);
255 return;
256 }
257 }
258
259 suspend_set_ops(pm_data->ops);
260}
diff --git a/arch/arm/mach-rockchip/pm.h b/arch/arm/mach-rockchip/pm.h
new file mode 100644
index 000000000000..7d752ff39f91
--- /dev/null
+++ b/arch/arm/mach-rockchip/pm.h
@@ -0,0 +1,99 @@
1/*
2 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
3 * Author: Tony Xie <tony.xie@rock-chips.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef __MACH_ROCKCHIP_PM_H
16#define __MACH_ROCKCHIP_PM_H
17
18extern unsigned long rkpm_bootdata_cpusp;
19extern unsigned long rkpm_bootdata_cpu_code;
20extern unsigned long rkpm_bootdata_l2ctlr_f;
21extern unsigned long rkpm_bootdata_l2ctlr;
22extern unsigned long rkpm_bootdata_ddr_code;
23extern unsigned long rkpm_bootdata_ddr_data;
24extern unsigned long rk3288_bootram_sz;
25
26void rockchip_slp_cpu_resume(void);
27void __init rockchip_suspend_init(void);
28
29/****** following is rk3288 defined **********/
30#define RK3288_PMU_WAKEUP_CFG0 0x00
31#define RK3288_PMU_WAKEUP_CFG1 0x04
32#define RK3288_PMU_PWRMODE_CON 0x18
33#define RK3288_PMU_OSC_CNT 0x20
34#define RK3288_PMU_PLL_CNT 0x24
35#define RK3288_PMU_STABL_CNT 0x28
36#define RK3288_PMU_DDR0IO_PWRON_CNT 0x2c
37#define RK3288_PMU_DDR1IO_PWRON_CNT 0x30
38#define RK3288_PMU_CORE_PWRDWN_CNT 0x34
39#define RK3288_PMU_CORE_PWRUP_CNT 0x38
40#define RK3288_PMU_GPU_PWRDWN_CNT 0x3c
41#define RK3288_PMU_GPU_PWRUP_CNT 0x40
42#define RK3288_PMU_WAKEUP_RST_CLR_CNT 0x44
43#define RK3288_PMU_PWRMODE_CON1 0x90
44
45#define RK3288_SGRF_SOC_CON0 (0x0000)
46#define RK3288_SGRF_FAST_BOOT_ADDR (0x0120)
47#define SGRF_FAST_BOOT_EN BIT(8)
48#define SGRF_FAST_BOOT_EN_WRITE BIT(24)
49
50#define RK3288_CRU_MODE_CON 0x50
51#define RK3288_CRU_SEL0_CON 0x60
52#define RK3288_CRU_SEL1_CON 0x64
53#define RK3288_CRU_SEL10_CON 0x88
54#define RK3288_CRU_SEL33_CON 0xe4
55#define RK3288_CRU_SEL37_CON 0xf4
56
57/* PMU_WAKEUP_CFG1 bits */
58#define PMU_ARMINT_WAKEUP_EN BIT(0)
59
60enum rk3288_pwr_mode_con {
61 PMU_PWR_MODE_EN = 0,
62 PMU_CLK_CORE_SRC_GATE_EN,
63 PMU_GLOBAL_INT_DISABLE,
64 PMU_L2FLUSH_EN,
65 PMU_BUS_PD_EN,
66 PMU_A12_0_PD_EN,
67 PMU_SCU_EN,
68 PMU_PLL_PD_EN,
69 PMU_CHIP_PD_EN, /* POWER OFF PIN ENABLE */
70 PMU_PWROFF_COMB,
71 PMU_ALIVE_USE_LF,
72 PMU_PMU_USE_LF,
73 PMU_OSC_24M_DIS,
74 PMU_INPUT_CLAMP_EN,
75 PMU_WAKEUP_RESET_EN,
76 PMU_SREF0_ENTER_EN,
77 PMU_SREF1_ENTER_EN,
78 PMU_DDR0IO_RET_EN,
79 PMU_DDR1IO_RET_EN,
80 PMU_DDR0_GATING_EN,
81 PMU_DDR1_GATING_EN,
82 PMU_DDR0IO_RET_DE_REQ,
83 PMU_DDR1IO_RET_DE_REQ
84};
85
86enum rk3288_pwr_mode_con1 {
87 PMU_CLR_BUS = 0,
88 PMU_CLR_CORE,
89 PMU_CLR_CPUP,
90 PMU_CLR_ALIVE,
91 PMU_CLR_DMA,
92 PMU_CLR_PERI,
93 PMU_CLR_GPU,
94 PMU_CLR_VIDEO,
95 PMU_CLR_HEVC,
96 PMU_CLR_VIO,
97};
98
99#endif /* __MACH_ROCKCHIP_PM_H */
diff --git a/arch/arm/mach-rockchip/rockchip.c b/arch/arm/mach-rockchip/rockchip.c
index a611f4852582..d360ec044b66 100644
--- a/arch/arm/mach-rockchip/rockchip.c
+++ b/arch/arm/mach-rockchip/rockchip.c
@@ -27,6 +27,7 @@
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
28#include <asm/hardware/cache-l2x0.h> 28#include <asm/hardware/cache-l2x0.h>
29#include "core.h" 29#include "core.h"
30#include "pm.h"
30 31
31#define RK3288_GRF_SOC_CON0 0x244 32#define RK3288_GRF_SOC_CON0 0x244
32 33
@@ -52,6 +53,7 @@ static void __init rockchip_timer_init(void)
52 53
53static void __init rockchip_dt_init(void) 54static void __init rockchip_dt_init(void)
54{ 55{
56 rockchip_suspend_init();
55 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 57 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
56 platform_device_register_simple("cpufreq-dt", 0, NULL, 0); 58 platform_device_register_simple("cpufreq-dt", 0, NULL, 0);
57} 59}
@@ -65,7 +67,7 @@ static const char * const rockchip_board_dt_compat[] = {
65 NULL, 67 NULL,
66}; 68};
67 69
68DT_MACHINE_START(ROCKCHIP_DT, "Rockchip Cortex-A9 (Device Tree)") 70DT_MACHINE_START(ROCKCHIP_DT, "Rockchip (Device Tree)")
69 .l2c_aux_val = 0, 71 .l2c_aux_val = 0,
70 .l2c_aux_mask = ~0, 72 .l2c_aux_mask = ~0,
71 .init_time = rockchip_timer_init, 73 .init_time = rockchip_timer_init,
diff --git a/arch/arm/mach-rockchip/sleep.S b/arch/arm/mach-rockchip/sleep.S
new file mode 100644
index 000000000000..2eec9a341f05
--- /dev/null
+++ b/arch/arm/mach-rockchip/sleep.S
@@ -0,0 +1,73 @@
1/*
2 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
3 * Author: Tony Xie <tony.xie@rock-chips.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 */
15
16#include <linux/linkage.h>
17#include <asm/assembler.h>
18#include <asm/memory.h>
19
20.data
21/*
22 * this code will be copied from
23 * ddr to sram for system resumeing.
24 * so it is ".data section".
25 */
26.align
27
28ENTRY(rockchip_slp_cpu_resume)
29 setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set svc, irqs off
30 mrc p15, 0, r1, c0, c0, 5
31 and r1, r1, #0xf
32 cmp r1, #0
33 /* olny cpu0 can continue to run, the others is halt here */
34 beq cpu0run
35secondary_loop:
36 wfe
37 b secondary_loop
38cpu0run:
39 ldr r3, rkpm_bootdata_l2ctlr_f
40 cmp r3, #0
41 beq sp_set
42 ldr r3, rkpm_bootdata_l2ctlr
43 mcr p15, 1, r3, c9, c0, 2
44sp_set:
45 ldr sp, rkpm_bootdata_cpusp
46 ldr r1, rkpm_bootdata_cpu_code
47 bx r1
48ENDPROC(rockchip_slp_cpu_resume)
49
50/* Parameters filled in by the kernel */
51
52/* Flag for whether to restore L2CTLR on resume */
53 .global rkpm_bootdata_l2ctlr_f
54rkpm_bootdata_l2ctlr_f:
55 .long 0
56
57/* Saved L2CTLR to restore on resume */
58 .global rkpm_bootdata_l2ctlr
59rkpm_bootdata_l2ctlr:
60 .long 0
61
62/* CPU resume SP addr */
63 .globl rkpm_bootdata_cpusp
64rkpm_bootdata_cpusp:
65 .long 0
66
67/* CPU resume function (physical address) */
68 .globl rkpm_bootdata_cpu_code
69rkpm_bootdata_cpu_code:
70 .long 0
71
72ENTRY(rk3288_bootram_sz)
73 .word . - rockchip_slp_cpu_resume
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index bb3d07504d8b..2f36c85eec4b 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -7,6 +7,7 @@ config PM_RCAR
7 7
8config PM_RMOBILE 8config PM_RMOBILE
9 bool 9 bool
10 select PM_GENERIC_DOMAINS
10 11
11config ARCH_RCAR_GEN1 12config ARCH_RCAR_GEN1
12 bool 13 bool
@@ -23,7 +24,7 @@ config ARCH_RCAR_GEN2
23 24
24config ARCH_RMOBILE 25config ARCH_RMOBILE
25 bool 26 bool
26 select PM_RMOBILE if PM && !ARCH_SHMOBILE_MULTI 27 select PM_RMOBILE if PM
27 select SYS_SUPPORTS_SH_CMT 28 select SYS_SUPPORTS_SH_CMT
28 select SYS_SUPPORTS_SH_TMU 29 select SYS_SUPPORTS_SH_TMU
29 30
@@ -51,6 +52,11 @@ config ARCH_R7S72100
51 bool "RZ/A1H (R7S72100)" 52 bool "RZ/A1H (R7S72100)"
52 select SYS_SUPPORTS_SH_MTU2 53 select SYS_SUPPORTS_SH_MTU2
53 54
55config ARCH_R8A73A4
56 bool "R-Mobile APE6 (R8A73A40)"
57 select ARCH_RMOBILE
58 select RENESAS_IRQC
59
54config ARCH_R8A7740 60config ARCH_R8A7740
55 bool "R-Mobile A1 (R8A77400)" 61 bool "R-Mobile A1 (R8A77400)"
56 select ARCH_RMOBILE 62 select ARCH_RMOBILE
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 6b4c1f313cc9..3855fb024fdb 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -553,6 +553,7 @@ enum { MSTP001,
553 MSTP314, MSTP313, MSTP312, MSTP311, 553 MSTP314, MSTP313, MSTP312, MSTP311,
554 MSTP304, MSTP303, MSTP302, MSTP301, MSTP300, 554 MSTP304, MSTP303, MSTP302, MSTP301, MSTP300,
555 MSTP411, MSTP410, MSTP403, 555 MSTP411, MSTP410, MSTP403,
556 MSTP508,
556 MSTP_NR }; 557 MSTP_NR };
557 558
558#define MSTP(_parent, _reg, _bit, _flags) \ 559#define MSTP(_parent, _reg, _bit, _flags) \
@@ -597,6 +598,7 @@ static struct clk mstp_clks[MSTP_NR] = {
597 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */ 598 [MSTP411] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 11, 0), /* IIC3 */
598 [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */ 599 [MSTP410] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 10, 0), /* IIC4 */
599 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ 600 [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */
601 [MSTP508] = MSTP(&div4_clks[DIV4_HP], SMSTPCR5, 8, 0), /* INTCA0 */
600}; 602};
601 603
602/* The lookups structure below includes duplicate entries for some clocks 604/* The lookups structure below includes duplicate entries for some clocks
@@ -677,6 +679,14 @@ static struct clk_lookup lookups[] = {
677 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */ 679 CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* I2C4 */
678 CLKDEV_DEV_ID("e6828000.i2c", &mstp_clks[MSTP410]), /* I2C4 */ 680 CLKDEV_DEV_ID("e6828000.i2c", &mstp_clks[MSTP410]), /* I2C4 */
679 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 681 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
682 CLKDEV_DEV_ID("renesas_intc_irqpin.0", &mstp_clks[MSTP508]), /* INTCA0 */
683 CLKDEV_DEV_ID("e6900000.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */
684 CLKDEV_DEV_ID("renesas_intc_irqpin.1", &mstp_clks[MSTP508]), /* INTCA0 */
685 CLKDEV_DEV_ID("e6900004.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */
686 CLKDEV_DEV_ID("renesas_intc_irqpin.2", &mstp_clks[MSTP508]), /* INTCA0 */
687 CLKDEV_DEV_ID("e6900008.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */
688 CLKDEV_DEV_ID("renesas_intc_irqpin.3", &mstp_clks[MSTP508]), /* INTCA0 */
689 CLKDEV_DEV_ID("e690000c.irqpin", &mstp_clks[MSTP508]), /* INTCA0 */
680 690
681 /* ICK */ 691 /* ICK */
682 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), 692 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]),
diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c
index ac2eecd6f5ea..34608fcf0648 100644
--- a/arch/arm/mach-shmobile/pm-r8a7740.c
+++ b/arch/arm/mach-shmobile/pm-r8a7740.c
@@ -9,10 +9,14 @@
9 * for more details. 9 * for more details.
10 */ 10 */
11#include <linux/console.h> 11#include <linux/console.h>
12#include <linux/io.h>
12#include <linux/suspend.h> 13#include <linux/suspend.h>
14
13#include "common.h" 15#include "common.h"
14#include "pm-rmobile.h" 16#include "pm-rmobile.h"
15 17
18#define SYSC_BASE IOMEM(0xe6180000)
19
16#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM) 20#if defined(CONFIG_PM) && !defined(CONFIG_ARCH_MULTIPLATFORM)
17static int r8a7740_pd_a3sm_suspend(void) 21static int r8a7740_pd_a3sm_suspend(void)
18{ 22{
@@ -45,41 +49,51 @@ static int r8a7740_pd_d4_suspend(void)
45static struct rmobile_pm_domain r8a7740_pm_domains[] = { 49static struct rmobile_pm_domain r8a7740_pm_domains[] = {
46 { 50 {
47 .genpd.name = "A4LC", 51 .genpd.name = "A4LC",
52 .base = SYSC_BASE,
48 .bit_shift = 1, 53 .bit_shift = 1,
49 }, { 54 }, {
50 .genpd.name = "A4MP", 55 .genpd.name = "A4MP",
56 .base = SYSC_BASE,
51 .bit_shift = 2, 57 .bit_shift = 2,
52 }, { 58 }, {
53 .genpd.name = "D4", 59 .genpd.name = "D4",
60 .base = SYSC_BASE,
54 .bit_shift = 3, 61 .bit_shift = 3,
55 .gov = &pm_domain_always_on_gov, 62 .gov = &pm_domain_always_on_gov,
56 .suspend = r8a7740_pd_d4_suspend, 63 .suspend = r8a7740_pd_d4_suspend,
57 }, { 64 }, {
58 .genpd.name = "A4R", 65 .genpd.name = "A4R",
66 .base = SYSC_BASE,
59 .bit_shift = 5, 67 .bit_shift = 5,
60 }, { 68 }, {
61 .genpd.name = "A3RV", 69 .genpd.name = "A3RV",
70 .base = SYSC_BASE,
62 .bit_shift = 6, 71 .bit_shift = 6,
63 }, { 72 }, {
64 .genpd.name = "A4S", 73 .genpd.name = "A4S",
74 .base = SYSC_BASE,
65 .bit_shift = 10, 75 .bit_shift = 10,
66 .no_debug = true, 76 .no_debug = true,
67 }, { 77 }, {
68 .genpd.name = "A3SP", 78 .genpd.name = "A3SP",
79 .base = SYSC_BASE,
69 .bit_shift = 11, 80 .bit_shift = 11,
70 .gov = &pm_domain_always_on_gov, 81 .gov = &pm_domain_always_on_gov,
71 .no_debug = true, 82 .no_debug = true,
72 .suspend = r8a7740_pd_a3sp_suspend, 83 .suspend = r8a7740_pd_a3sp_suspend,
73 }, { 84 }, {
74 .genpd.name = "A3SM", 85 .genpd.name = "A3SM",
86 .base = SYSC_BASE,
75 .bit_shift = 12, 87 .bit_shift = 12,
76 .gov = &pm_domain_always_on_gov, 88 .gov = &pm_domain_always_on_gov,
77 .suspend = r8a7740_pd_a3sm_suspend, 89 .suspend = r8a7740_pd_a3sm_suspend,
78 }, { 90 }, {
79 .genpd.name = "A3SG", 91 .genpd.name = "A3SG",
92 .base = SYSC_BASE,
80 .bit_shift = 13, 93 .bit_shift = 13,
81 }, { 94 }, {
82 .genpd.name = "A4SU", 95 .genpd.name = "A4SU",
96 .base = SYSC_BASE,
83 .bit_shift = 20, 97 .bit_shift = 20,
84 }, 98 },
85}; 99};
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c
index 6f7d56ecf969..95018209ff0b 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.c
+++ b/arch/arm/mach-shmobile/pm-rmobile.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Copyright (C) 2012 Renesas Solutions Corp. 4 * Copyright (C) 2012 Renesas Solutions Corp.
5 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 5 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 * Copyright (C) 2014 Glider bvba
6 * 7 *
7 * based on pm-sh7372.c 8 * based on pm-sh7372.c
8 * Copyright (C) 2011 Magnus Damm 9 * Copyright (C) 2011 Magnus Damm
@@ -13,16 +14,22 @@
13 */ 14 */
14#include <linux/console.h> 15#include <linux/console.h>
15#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/of.h>
18#include <linux/of_address.h>
19#include <linux/of_platform.h>
16#include <linux/platform_device.h> 20#include <linux/platform_device.h>
17#include <linux/pm.h> 21#include <linux/pm.h>
18#include <linux/pm_clock.h> 22#include <linux/pm_clock.h>
23#include <linux/slab.h>
24
19#include <asm/io.h> 25#include <asm/io.h>
26
20#include "pm-rmobile.h" 27#include "pm-rmobile.h"
21 28
22/* SYSC */ 29/* SYSC */
23#define SPDCR IOMEM(0xe6180008) 30#define SPDCR 0x08 /* SYS Power Down Control Register */
24#define SWUCR IOMEM(0xe6180014) 31#define SWUCR 0x14 /* SYS Wakeup Control Register */
25#define PSTR IOMEM(0xe6180080) 32#define PSTR 0x80 /* Power Status Register */
26 33
27#define PSTR_RETRIES 100 34#define PSTR_RETRIES 100
28#define PSTR_DELAY_US 10 35#define PSTR_DELAY_US 10
@@ -30,8 +37,12 @@
30static int rmobile_pd_power_down(struct generic_pm_domain *genpd) 37static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
31{ 38{
32 struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd); 39 struct rmobile_pm_domain *rmobile_pd = to_rmobile_pd(genpd);
33 unsigned int mask = 1 << rmobile_pd->bit_shift; 40 unsigned int mask;
41
42 if (rmobile_pd->bit_shift == ~0)
43 return -EBUSY;
34 44
45 mask = 1 << rmobile_pd->bit_shift;
35 if (rmobile_pd->suspend) { 46 if (rmobile_pd->suspend) {
36 int ret = rmobile_pd->suspend(); 47 int ret = rmobile_pd->suspend();
37 48
@@ -39,12 +50,12 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
39 return ret; 50 return ret;
40 } 51 }
41 52
42 if (__raw_readl(PSTR) & mask) { 53 if (__raw_readl(rmobile_pd->base + PSTR) & mask) {
43 unsigned int retry_count; 54 unsigned int retry_count;
44 __raw_writel(mask, SPDCR); 55 __raw_writel(mask, rmobile_pd->base + SPDCR);
45 56
46 for (retry_count = PSTR_RETRIES; retry_count; retry_count--) { 57 for (retry_count = PSTR_RETRIES; retry_count; retry_count--) {
47 if (!(__raw_readl(SPDCR) & mask)) 58 if (!(__raw_readl(rmobile_pd->base + SPDCR) & mask))
48 break; 59 break;
49 cpu_relax(); 60 cpu_relax();
50 } 61 }
@@ -52,7 +63,8 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
52 63
53 if (!rmobile_pd->no_debug) 64 if (!rmobile_pd->no_debug)
54 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", 65 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n",
55 genpd->name, mask, __raw_readl(PSTR)); 66 genpd->name, mask,
67 __raw_readl(rmobile_pd->base + PSTR));
56 68
57 return 0; 69 return 0;
58} 70}
@@ -60,17 +72,21 @@ static int rmobile_pd_power_down(struct generic_pm_domain *genpd)
60static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd, 72static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd,
61 bool do_resume) 73 bool do_resume)
62{ 74{
63 unsigned int mask = 1 << rmobile_pd->bit_shift; 75 unsigned int mask;
64 unsigned int retry_count; 76 unsigned int retry_count;
65 int ret = 0; 77 int ret = 0;
66 78
67 if (__raw_readl(PSTR) & mask) 79 if (rmobile_pd->bit_shift == ~0)
80 return 0;
81
82 mask = 1 << rmobile_pd->bit_shift;
83 if (__raw_readl(rmobile_pd->base + PSTR) & mask)
68 goto out; 84 goto out;
69 85
70 __raw_writel(mask, SWUCR); 86 __raw_writel(mask, rmobile_pd->base + SWUCR);
71 87
72 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) { 88 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) {
73 if (!(__raw_readl(SWUCR) & mask)) 89 if (!(__raw_readl(rmobile_pd->base + SWUCR) & mask))
74 break; 90 break;
75 if (retry_count > PSTR_RETRIES) 91 if (retry_count > PSTR_RETRIES)
76 udelay(PSTR_DELAY_US); 92 udelay(PSTR_DELAY_US);
@@ -82,7 +98,8 @@ static int __rmobile_pd_power_up(struct rmobile_pm_domain *rmobile_pd,
82 98
83 if (!rmobile_pd->no_debug) 99 if (!rmobile_pd->no_debug)
84 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", 100 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n",
85 rmobile_pd->genpd.name, mask, __raw_readl(PSTR)); 101 rmobile_pd->genpd.name, mask,
102 __raw_readl(rmobile_pd->base + PSTR));
86 103
87out: 104out:
88 if (ret == 0 && rmobile_pd->resume && do_resume) 105 if (ret == 0 && rmobile_pd->resume && do_resume)
@@ -101,6 +118,36 @@ static bool rmobile_pd_active_wakeup(struct device *dev)
101 return true; 118 return true;
102} 119}
103 120
121static int rmobile_pd_attach_dev(struct generic_pm_domain *domain,
122 struct device *dev)
123{
124 int error;
125
126 error = pm_clk_create(dev);
127 if (error) {
128 dev_err(dev, "pm_clk_create failed %d\n", error);
129 return error;
130 }
131
132 error = pm_clk_add(dev, NULL);
133 if (error) {
134 dev_err(dev, "pm_clk_add failed %d\n", error);
135 goto fail;
136 }
137
138 return 0;
139
140fail:
141 pm_clk_destroy(dev);
142 return error;
143}
144
145static void rmobile_pd_detach_dev(struct generic_pm_domain *domain,
146 struct device *dev)
147{
148 pm_clk_destroy(dev);
149}
150
104static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) 151static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
105{ 152{
106 struct generic_pm_domain *genpd = &rmobile_pd->genpd; 153 struct generic_pm_domain *genpd = &rmobile_pd->genpd;
@@ -111,9 +158,13 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd)
111 genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup; 158 genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup;
112 genpd->power_off = rmobile_pd_power_down; 159 genpd->power_off = rmobile_pd_power_down;
113 genpd->power_on = rmobile_pd_power_up; 160 genpd->power_on = rmobile_pd_power_up;
161 genpd->attach_dev = rmobile_pd_attach_dev;
162 genpd->detach_dev = rmobile_pd_detach_dev;
114 __rmobile_pd_power_up(rmobile_pd, false); 163 __rmobile_pd_power_up(rmobile_pd, false);
115} 164}
116 165
166#ifdef CONFIG_ARCH_SHMOBILE_LEGACY
167
117void rmobile_init_domains(struct rmobile_pm_domain domains[], int num) 168void rmobile_init_domains(struct rmobile_pm_domain domains[], int num)
118{ 169{
119 int j; 170 int j;
@@ -129,8 +180,6 @@ void rmobile_add_device_to_domain_td(const char *domain_name,
129 struct device *dev = &pdev->dev; 180 struct device *dev = &pdev->dev;
130 181
131 __pm_genpd_name_add_device(domain_name, dev, td); 182 __pm_genpd_name_add_device(domain_name, dev, td);
132 if (pm_clk_no_clocks(dev))
133 pm_clk_add(dev, NULL);
134} 183}
135 184
136void rmobile_add_devices_to_domains(struct pm_domain_device data[], 185void rmobile_add_devices_to_domains(struct pm_domain_device data[],
@@ -148,3 +197,238 @@ void rmobile_add_devices_to_domains(struct pm_domain_device data[],
148 rmobile_add_device_to_domain_td(data[j].domain_name, 197 rmobile_add_device_to_domain_td(data[j].domain_name,
149 data[j].pdev, &latencies); 198 data[j].pdev, &latencies);
150} 199}
200
201#else /* !CONFIG_ARCH_SHMOBILE_LEGACY */
202
203static int rmobile_pd_suspend_busy(void)
204{
205 /*
206 * This domain should not be turned off.
207 */
208 return -EBUSY;
209}
210
211static int rmobile_pd_suspend_console(void)
212{
213 /*
214 * Serial consoles make use of SCIF hardware located in this domain,
215 * hence keep the power domain on if "no_console_suspend" is set.
216 */
217 return console_suspend_enabled ? 0 : -EBUSY;
218}
219
220enum pd_types {
221 PD_NORMAL,
222 PD_CPU,
223 PD_CONSOLE,
224 PD_DEBUG,
225 PD_MEMCTL,
226};
227
228#define MAX_NUM_SPECIAL_PDS 16
229
230static struct special_pd {
231 struct device_node *pd;
232 enum pd_types type;
233} special_pds[MAX_NUM_SPECIAL_PDS] __initdata;
234
235static unsigned int num_special_pds __initdata;
236
237static const struct of_device_id special_ids[] __initconst = {
238 { .compatible = "arm,coresight-etm3x", .data = (void *)PD_DEBUG },
239 { .compatible = "renesas,dbsc-r8a73a4", .data = (void *)PD_MEMCTL, },
240 { .compatible = "renesas,dbsc3-r8a7740", .data = (void *)PD_MEMCTL, },
241 { .compatible = "renesas,sbsc-sh73a0", .data = (void *)PD_MEMCTL, },
242 { /* sentinel */ },
243};
244
245static void __init add_special_pd(struct device_node *np, enum pd_types type)
246{
247 unsigned int i;
248 struct device_node *pd;
249
250 pd = of_parse_phandle(np, "power-domains", 0);
251 if (!pd)
252 return;
253
254 for (i = 0; i < num_special_pds; i++)
255 if (pd == special_pds[i].pd && type == special_pds[i].type) {
256 of_node_put(pd);
257 return;
258 }
259
260 if (num_special_pds == ARRAY_SIZE(special_pds)) {
261 pr_warn("Too many special PM domains\n");
262 of_node_put(pd);
263 return;
264 }
265
266 pr_debug("Special PM domain %s type %d for %s\n", pd->name, type,
267 np->full_name);
268
269 special_pds[num_special_pds].pd = pd;
270 special_pds[num_special_pds].type = type;
271 num_special_pds++;
272}
273
274static void __init get_special_pds(void)
275{
276 struct device_node *np;
277 const struct of_device_id *id;
278
279 /* PM domains containing CPUs */
280 for_each_node_by_type(np, "cpu")
281 add_special_pd(np, PD_CPU);
282
283 /* PM domain containing console */
284 if (of_stdout)
285 add_special_pd(of_stdout, PD_CONSOLE);
286
287 /* PM domains containing other special devices */
288 for_each_matching_node_and_match(np, special_ids, &id)
289 add_special_pd(np, (enum pd_types)id->data);
290}
291
292static void __init put_special_pds(void)
293{
294 unsigned int i;
295
296 for (i = 0; i < num_special_pds; i++)
297 of_node_put(special_pds[i].pd);
298}
299
300static enum pd_types __init pd_type(const struct device_node *pd)
301{
302 unsigned int i;
303
304 for (i = 0; i < num_special_pds; i++)
305 if (pd == special_pds[i].pd)
306 return special_pds[i].type;
307
308 return PD_NORMAL;
309}
310
311static void __init rmobile_setup_pm_domain(struct device_node *np,
312 struct rmobile_pm_domain *pd)
313{
314 const char *name = pd->genpd.name;
315
316 switch (pd_type(np)) {
317 case PD_CPU:
318 /*
319 * This domain contains the CPU core and therefore it should
320 * only be turned off if the CPU is not in use.
321 */
322 pr_debug("PM domain %s contains CPU\n", name);
323 pd->gov = &pm_domain_always_on_gov;
324 pd->suspend = rmobile_pd_suspend_busy;
325 break;
326
327 case PD_CONSOLE:
328 pr_debug("PM domain %s contains serial console\n", name);
329 pd->gov = &pm_domain_always_on_gov;
330 pd->suspend = rmobile_pd_suspend_console;
331 break;
332
333 case PD_DEBUG:
334 /*
335 * This domain contains the Coresight-ETM hardware block and
336 * therefore it should only be turned off if the debug module
337 * is not in use.
338 */
339 pr_debug("PM domain %s contains Coresight-ETM\n", name);
340 pd->gov = &pm_domain_always_on_gov;
341 pd->suspend = rmobile_pd_suspend_busy;
342 break;
343
344 case PD_MEMCTL:
345 /*
346 * This domain contains a memory-controller and therefore it
347 * should only be turned off if memory is not in use.
348 */
349 pr_debug("PM domain %s contains MEMCTL\n", name);
350 pd->gov = &pm_domain_always_on_gov;
351 pd->suspend = rmobile_pd_suspend_busy;
352 break;
353
354 case PD_NORMAL:
355 break;
356 }
357
358 rmobile_init_pm_domain(pd);
359}
360
361static int __init rmobile_add_pm_domains(void __iomem *base,
362 struct device_node *parent,
363 struct generic_pm_domain *genpd_parent)
364{
365 struct device_node *np;
366
367 for_each_child_of_node(parent, np) {
368 struct rmobile_pm_domain *pd;
369 u32 idx = ~0;
370
371 if (of_property_read_u32(np, "reg", &idx)) {
372 /* always-on domain */
373 }
374
375 pd = kzalloc(sizeof(*pd), GFP_KERNEL);
376 if (!pd)
377 return -ENOMEM;
378
379 pd->genpd.name = np->name;
380 pd->base = base;
381 pd->bit_shift = idx;
382
383 rmobile_setup_pm_domain(np, pd);
384 if (genpd_parent)
385 pm_genpd_add_subdomain(genpd_parent, &pd->genpd);
386 of_genpd_add_provider_simple(np, &pd->genpd);
387
388 rmobile_add_pm_domains(base, np, &pd->genpd);
389 }
390 return 0;
391}
392
393static int __init rmobile_init_pm_domains(void)
394{
395 struct device_node *np, *pmd;
396 bool scanned = false;
397 void __iomem *base;
398 int ret = 0;
399
400 for_each_compatible_node(np, NULL, "renesas,sysc-rmobile") {
401 base = of_iomap(np, 0);
402 if (!base) {
403 pr_warn("%s cannot map reg 0\n", np->full_name);
404 continue;
405 }
406
407 pmd = of_get_child_by_name(np, "pm-domains");
408 if (!pmd) {
409 pr_warn("%s lacks pm-domains node\n", np->full_name);
410 continue;
411 }
412
413 if (!scanned) {
414 /* Find PM domains containing special blocks */
415 get_special_pds();
416 scanned = true;
417 }
418
419 ret = rmobile_add_pm_domains(base, pmd, NULL);
420 of_node_put(pmd);
421 if (ret) {
422 of_node_put(np);
423 break;
424 }
425 }
426
427 put_special_pds();
428
429 return ret;
430}
431
432core_initcall(rmobile_init_pm_domains);
433
434#endif /* !CONFIG_ARCH_SHMOBILE_LEGACY */
diff --git a/arch/arm/mach-shmobile/pm-rmobile.h b/arch/arm/mach-shmobile/pm-rmobile.h
index 8f66b343162b..53219786f539 100644
--- a/arch/arm/mach-shmobile/pm-rmobile.h
+++ b/arch/arm/mach-shmobile/pm-rmobile.h
@@ -21,6 +21,7 @@ struct rmobile_pm_domain {
21 struct dev_power_governor *gov; 21 struct dev_power_governor *gov;
22 int (*suspend)(void); 22 int (*suspend)(void);
23 void (*resume)(void); 23 void (*resume)(void);
24 void __iomem *base;
24 unsigned int bit_shift; 25 unsigned int bit_shift;
25 bool no_debug; 26 bool no_debug;
26}; 27};
@@ -36,7 +37,7 @@ struct pm_domain_device {
36 struct platform_device *pdev; 37 struct platform_device *pdev;
37}; 38};
38 39
39#ifdef CONFIG_PM_RMOBILE 40#if defined(CONFIG_PM_RMOBILE) && defined(CONFIG_ARCH_SHMOBILE_LEGACY)
40extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num); 41extern void rmobile_init_domains(struct rmobile_pm_domain domains[], int num);
41extern void rmobile_add_device_to_domain_td(const char *domain_name, 42extern void rmobile_add_device_to_domain_td(const char *domain_name,
42 struct platform_device *pdev, 43 struct platform_device *pdev,
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 0e37da654ed5..c0293ae4b013 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -45,6 +45,8 @@
45#define PLLC01STPCR IOMEM(0xe61500c8) 45#define PLLC01STPCR IOMEM(0xe61500c8)
46 46
47/* SYSC */ 47/* SYSC */
48#define SYSC_BASE IOMEM(0xe6180000)
49
48#define SBAR IOMEM(0xe6180020) 50#define SBAR IOMEM(0xe6180020)
49#define WUPRMSK IOMEM(0xe6180028) 51#define WUPRMSK IOMEM(0xe6180028)
50#define WUPSMSK IOMEM(0xe618002c) 52#define WUPSMSK IOMEM(0xe618002c)
@@ -118,24 +120,28 @@ static struct rmobile_pm_domain sh7372_pm_domains[] = {
118 .genpd.name = "A4LC", 120 .genpd.name = "A4LC",
119 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 121 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
120 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 122 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
123 .base = SYSC_BASE,
121 .bit_shift = 1, 124 .bit_shift = 1,
122 }, 125 },
123 { 126 {
124 .genpd.name = "A4MP", 127 .genpd.name = "A4MP",
125 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 128 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
126 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 129 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
130 .base = SYSC_BASE,
127 .bit_shift = 2, 131 .bit_shift = 2,
128 }, 132 },
129 { 133 {
130 .genpd.name = "D4", 134 .genpd.name = "D4",
131 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 135 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
132 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 136 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
137 .base = SYSC_BASE,
133 .bit_shift = 3, 138 .bit_shift = 3,
134 }, 139 },
135 { 140 {
136 .genpd.name = "A4R", 141 .genpd.name = "A4R",
137 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 142 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
138 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 143 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
144 .base = SYSC_BASE,
139 .bit_shift = 5, 145 .bit_shift = 5,
140 .suspend = sh7372_a4r_pd_suspend, 146 .suspend = sh7372_a4r_pd_suspend,
141 .resume = sh7372_intcs_resume, 147 .resume = sh7372_intcs_resume,
@@ -144,18 +150,21 @@ static struct rmobile_pm_domain sh7372_pm_domains[] = {
144 .genpd.name = "A3RV", 150 .genpd.name = "A3RV",
145 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 151 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
146 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 152 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
153 .base = SYSC_BASE,
147 .bit_shift = 6, 154 .bit_shift = 6,
148 }, 155 },
149 { 156 {
150 .genpd.name = "A3RI", 157 .genpd.name = "A3RI",
151 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 158 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
152 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 159 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
160 .base = SYSC_BASE,
153 .bit_shift = 8, 161 .bit_shift = 8,
154 }, 162 },
155 { 163 {
156 .genpd.name = "A4S", 164 .genpd.name = "A4S",
157 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 165 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
158 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 166 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
167 .base = SYSC_BASE,
159 .bit_shift = 10, 168 .bit_shift = 10,
160 .gov = &pm_domain_always_on_gov, 169 .gov = &pm_domain_always_on_gov,
161 .no_debug = true, 170 .no_debug = true,
@@ -166,6 +175,7 @@ static struct rmobile_pm_domain sh7372_pm_domains[] = {
166 .genpd.name = "A3SP", 175 .genpd.name = "A3SP",
167 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 176 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
168 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 177 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
178 .base = SYSC_BASE,
169 .bit_shift = 11, 179 .bit_shift = 11,
170 .gov = &pm_domain_always_on_gov, 180 .gov = &pm_domain_always_on_gov,
171 .no_debug = true, 181 .no_debug = true,
@@ -175,6 +185,7 @@ static struct rmobile_pm_domain sh7372_pm_domains[] = {
175 .genpd.name = "A3SG", 185 .genpd.name = "A3SG",
176 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 186 .genpd.power_on_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
177 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS, 187 .genpd.power_off_latency_ns = PM_DOMAIN_ON_OFF_LATENCY_NS,
188 .base = SYSC_BASE,
178 .bit_shift = 13, 189 .bit_shift = 13,
179 }, 190 },
180}; 191};
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index cc9470dfb1ce..d1fa625e61f5 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -52,15 +52,13 @@ void __init rcar_gen2_timer_init(void)
52{ 52{
53#if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK) 53#if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK)
54 u32 mode = rcar_gen2_read_mode_pins(); 54 u32 mode = rcar_gen2_read_mode_pins();
55 bool is_e2 = (bool)of_find_compatible_node(NULL, NULL,
56 "renesas,r8a7794");
57#endif 55#endif
58#ifdef CONFIG_ARM_ARCH_TIMER 56#ifdef CONFIG_ARM_ARCH_TIMER
59 void __iomem *base; 57 void __iomem *base;
60 int extal_mhz = 0; 58 int extal_mhz = 0;
61 u32 freq; 59 u32 freq;
62 60
63 if (is_e2) { 61 if (of_machine_is_compatible("renesas,r8a7794")) {
64 freq = 260000000 / 8; /* ZS / 8 */ 62 freq = 260000000 / 8; /* ZS / 8 */
65 /* CNTVOFF has to be initialized either from non-secure 63 /* CNTVOFF has to be initialized either from non-secure
66 * Hypervisor mode or secure Monitor mode with SCR.NS==1. 64 * Hypervisor mode or secure Monitor mode with SCR.NS==1.
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
index 3f761f839043..9fc280e24ef4 100644
--- a/arch/arm/mach-shmobile/smp-r8a7779.c
+++ b/arch/arm/mach-shmobile/smp-r8a7779.c
@@ -56,7 +56,7 @@ static struct rcar_sysc_ch *r8a7779_ch_cpu[4] = {
56 [3] = &r8a7779_ch_cpu3, 56 [3] = &r8a7779_ch_cpu3,
57}; 57};
58 58
59#ifdef CONFIG_HAVE_ARM_TWD 59#if defined(CONFIG_HAVE_ARM_TWD) && !defined(CONFIG_ARCH_MULTIPLATFORM)
60static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, R8A7779_SCU_BASE + 0x600, 29); 60static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, R8A7779_SCU_BASE + 0x600, 29);
61void __init r8a7779_register_twd(void) 61void __init r8a7779_register_twd(void)
62{ 62{
diff --git a/arch/arm/mach-sti/board-dt.c b/arch/arm/mach-sti/board-dt.c
index 3cf6ef8d4317..b067390cef4e 100644
--- a/arch/arm/mach-sti/board-dt.c
+++ b/arch/arm/mach-sti/board-dt.c
@@ -18,6 +18,7 @@ static const char *stih41x_dt_match[] __initdata = {
18 "st,stih415", 18 "st,stih415",
19 "st,stih416", 19 "st,stih416",
20 "st,stih407", 20 "st,stih407",
21 "st,stih418",
21 NULL 22 NULL
22}; 23};
23 24
diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c
index e44d028555a4..587b0468efcc 100644
--- a/arch/arm/mach-sunxi/platsmp.c
+++ b/arch/arm/mach-sunxi/platsmp.c
@@ -120,4 +120,4 @@ static struct smp_operations sun6i_smp_ops __initdata = {
120 .smp_prepare_cpus = sun6i_smp_prepare_cpus, 120 .smp_prepare_cpus = sun6i_smp_prepare_cpus,
121 .smp_boot_secondary = sun6i_smp_boot_secondary, 121 .smp_boot_secondary = sun6i_smp_boot_secondary,
122}; 122};
123CPU_METHOD_OF_DECLARE(sun6i_smp, "allwinner,sun6i-a31", &sun6i_smp_ops); 123CPU_METHOD_OF_DECLARE(sun6i_a31_smp, "allwinner,sun6i-a31", &sun6i_smp_ops);
diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index 1f986758784a..1bc811a74a9f 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -13,9 +13,15 @@
13#include <linux/clk-provider.h> 13#include <linux/clk-provider.h>
14#include <linux/clocksource.h> 14#include <linux/clocksource.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/platform_device.h>
16 17
17#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
18 19
20static void __init sunxi_dt_cpufreq_init(void)
21{
22 platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
23}
24
19static const char * const sunxi_board_dt_compat[] = { 25static const char * const sunxi_board_dt_compat[] = {
20 "allwinner,sun4i-a10", 26 "allwinner,sun4i-a10",
21 "allwinner,sun5i-a10s", 27 "allwinner,sun5i-a10s",
@@ -25,10 +31,12 @@ static const char * const sunxi_board_dt_compat[] = {
25 31
26DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)") 32DT_MACHINE_START(SUNXI_DT, "Allwinner A1X (Device Tree)")
27 .dt_compat = sunxi_board_dt_compat, 33 .dt_compat = sunxi_board_dt_compat,
34 .init_late = sunxi_dt_cpufreq_init,
28MACHINE_END 35MACHINE_END
29 36
30static const char * const sun6i_board_dt_compat[] = { 37static const char * const sun6i_board_dt_compat[] = {
31 "allwinner,sun6i-a31", 38 "allwinner,sun6i-a31",
39 "allwinner,sun6i-a31s",
32 NULL, 40 NULL,
33}; 41};
34 42
@@ -44,6 +52,7 @@ static void __init sun6i_timer_init(void)
44DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family") 52DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
45 .init_time = sun6i_timer_init, 53 .init_time = sun6i_timer_init,
46 .dt_compat = sun6i_board_dt_compat, 54 .dt_compat = sun6i_board_dt_compat,
55 .init_late = sunxi_dt_cpufreq_init,
47MACHINE_END 56MACHINE_END
48 57
49static const char * const sun7i_board_dt_compat[] = { 58static const char * const sun7i_board_dt_compat[] = {
@@ -53,6 +62,7 @@ static const char * const sun7i_board_dt_compat[] = {
53 62
54DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family") 63DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
55 .dt_compat = sun7i_board_dt_compat, 64 .dt_compat = sun7i_board_dt_compat,
65 .init_late = sunxi_dt_cpufreq_init,
56MACHINE_END 66MACHINE_END
57 67
58static const char * const sun8i_board_dt_compat[] = { 68static const char * const sun8i_board_dt_compat[] = {
@@ -62,6 +72,7 @@ static const char * const sun8i_board_dt_compat[] = {
62 72
63DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i (A23) Family") 73DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i (A23) Family")
64 .dt_compat = sun8i_board_dt_compat, 74 .dt_compat = sun8i_board_dt_compat,
75 .init_late = sunxi_dt_cpufreq_init,
65MACHINE_END 76MACHINE_END
66 77
67static const char * const sun9i_board_dt_compat[] = { 78static const char * const sun9i_board_dt_compat[] = {
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index d0be9a1ef6b8..5d1a318f1302 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -27,6 +27,7 @@ config ARCH_TEGRA_2x_SOC
27 select PINCTRL_TEGRA20 27 select PINCTRL_TEGRA20
28 select PL310_ERRATA_727915 if CACHE_L2X0 28 select PL310_ERRATA_727915 if CACHE_L2X0
29 select PL310_ERRATA_769419 if CACHE_L2X0 29 select PL310_ERRATA_769419 if CACHE_L2X0
30 select TEGRA_TIMER
30 help 31 help
31 Support for NVIDIA Tegra AP20 and T20 processors, based on the 32 Support for NVIDIA Tegra AP20 and T20 processors, based on the
32 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 33 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -37,6 +38,7 @@ config ARCH_TEGRA_3x_SOC
37 select ARM_ERRATA_764369 if SMP 38 select ARM_ERRATA_764369 if SMP
38 select PINCTRL_TEGRA30 39 select PINCTRL_TEGRA30
39 select PL310_ERRATA_769419 if CACHE_L2X0 40 select PL310_ERRATA_769419 if CACHE_L2X0
41 select TEGRA_TIMER
40 help 42 help
41 Support for NVIDIA Tegra T30 processor family, based on the 43 Support for NVIDIA Tegra T30 processor family, based on the
42 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 44 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -47,6 +49,7 @@ config ARCH_TEGRA_114_SOC
47 select ARM_L1_CACHE_SHIFT_6 49 select ARM_L1_CACHE_SHIFT_6
48 select HAVE_ARM_ARCH_TIMER 50 select HAVE_ARM_ARCH_TIMER
49 select PINCTRL_TEGRA114 51 select PINCTRL_TEGRA114
52 select TEGRA_TIMER
50 help 53 help
51 Support for NVIDIA Tegra T114 processor family, based on the 54 Support for NVIDIA Tegra T114 processor family, based on the
52 ARM CortexA15MP CPU 55 ARM CortexA15MP CPU
@@ -56,6 +59,7 @@ config ARCH_TEGRA_124_SOC
56 select ARM_L1_CACHE_SHIFT_6 59 select ARM_L1_CACHE_SHIFT_6
57 select HAVE_ARM_ARCH_TIMER 60 select HAVE_ARM_ARCH_TIMER
58 select PINCTRL_TEGRA124 61 select PINCTRL_TEGRA124
62 select TEGRA_TIMER
59 help 63 help
60 Support for NVIDIA Tegra T124 processor family, based on the 64 Support for NVIDIA Tegra T124 processor family, based on the
61 ARM CortexA15MP CPU 65 ARM CortexA15MP CPU
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index aaa5162c1509..78e5e007f52d 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -9,6 +9,8 @@ config ARCH_ZYNQ
9 select HAVE_ARM_TWD if SMP 9 select HAVE_ARM_TWD if SMP
10 select ICST 10 select ICST
11 select MFD_SYSCON 11 select MFD_SYSCON
12 select PINCTRL
13 select PINCTRL_ZYNQ
12 select SOC_BUS 14 select SOC_BUS
13 help 15 help
14 Support for Xilinx Zynq ARM Cortex A9 Platform 16 Support for Xilinx Zynq ARM Cortex A9 Platform
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 26f92c28d22b..c887196cfdbe 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -146,8 +146,6 @@ out:
146 146
147 platform_device_register(&zynq_cpuidle_device); 147 platform_device_register(&zynq_cpuidle_device);
148 platform_device_register_full(&devinfo); 148 platform_device_register_full(&devinfo);
149
150 zynq_slcr_init();
151} 149}
152 150
153static void __init zynq_timer_init(void) 151static void __init zynq_timer_init(void)
diff --git a/arch/arm/mach-zynq/pm.c b/arch/arm/mach-zynq/pm.c
index 911fcf865be8..fa44fc1b6dd5 100644
--- a/arch/arm/mach-zynq/pm.c
+++ b/arch/arm/mach-zynq/pm.c
@@ -61,7 +61,7 @@ static void __iomem *zynq_pm_ioremap(const char *comp)
61/** 61/**
62 * zynq_pm_late_init() - Power management init 62 * zynq_pm_late_init() - Power management init
63 * 63 *
64 * Initialization of power management related featurs and infrastructure. 64 * Initialization of power management related features and infrastructure.
65 */ 65 */
66void __init zynq_pm_late_init(void) 66void __init zynq_pm_late_init(void)
67{ 67{
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index d4cb50cf97c0..c3c24fd8b306 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -47,11 +47,6 @@ static struct regmap *zynq_slcr_regmap;
47 */ 47 */
48static int zynq_slcr_write(u32 val, u32 offset) 48static int zynq_slcr_write(u32 val, u32 offset)
49{ 49{
50 if (!zynq_slcr_regmap) {
51 writel(val, zynq_slcr_base + offset);
52 return 0;
53 }
54
55 return regmap_write(zynq_slcr_regmap, offset, val); 50 return regmap_write(zynq_slcr_regmap, offset, val);
56} 51}
57 52
@@ -65,12 +60,7 @@ static int zynq_slcr_write(u32 val, u32 offset)
65 */ 60 */
66static int zynq_slcr_read(u32 *val, u32 offset) 61static int zynq_slcr_read(u32 *val, u32 offset)
67{ 62{
68 if (zynq_slcr_regmap) 63 return regmap_read(zynq_slcr_regmap, offset, val);
69 return regmap_read(zynq_slcr_regmap, offset, val);
70
71 *val = readl(zynq_slcr_base + offset);
72
73 return 0;
74} 64}
75 65
76/** 66/**
@@ -196,23 +186,6 @@ void zynq_slcr_cpu_state_write(int cpu, bool die)
196} 186}
197 187
198/** 188/**
199 * zynq_slcr_init - Regular slcr driver init
200 * Return: 0 on success, negative errno otherwise.
201 *
202 * Called early during boot from platform code to remap SLCR area.
203 */
204int __init zynq_slcr_init(void)
205{
206 zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
207 if (IS_ERR(zynq_slcr_regmap)) {
208 pr_err("%s: failed to find zynq-slcr\n", __func__);
209 return -ENODEV;
210 }
211
212 return 0;
213}
214
215/**
216 * zynq_early_slcr_init - Early slcr init function 189 * zynq_early_slcr_init - Early slcr init function
217 * 190 *
218 * Return: 0 on success, negative errno otherwise. 191 * Return: 0 on success, negative errno otherwise.
@@ -237,6 +210,12 @@ int __init zynq_early_slcr_init(void)
237 210
238 np->data = (__force void *)zynq_slcr_base; 211 np->data = (__force void *)zynq_slcr_base;
239 212
213 zynq_slcr_regmap = syscon_regmap_lookup_by_compatible("xlnx,zynq-slcr");
214 if (IS_ERR(zynq_slcr_regmap)) {
215 pr_err("%s: failed to find zynq-slcr\n", __func__);
216 return -ENODEV;
217 }
218
240 /* unlock the SLCR so that registers can be changed */ 219 /* unlock the SLCR so that registers can be changed */
241 zynq_slcr_unlock(); 220 zynq_slcr_unlock();
242 221
diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index 360618ee39e5..71333bb61013 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -40,10 +40,14 @@ void __init s3c64xx_init_cpu(void)
40 } 40 }
41 41
42 samsung_cpu_rev = 0; 42 samsung_cpu_rev = 0;
43
44 pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
43} 45}
44 46
45void __init s5p_init_cpu(void __iomem *cpuid_addr) 47void __init s5p_init_cpu(void __iomem *cpuid_addr)
46{ 48{
47 samsung_cpu_id = __raw_readl(cpuid_addr); 49 samsung_cpu_id = __raw_readl(cpuid_addr);
48 samsung_cpu_rev = samsung_cpu_id & 0xFF; 50 samsung_cpu_rev = samsung_cpu_id & 0xFF;
51
52 pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
49} 53}