diff options
author | Olof Johansson <olof@lixom.net> | 2014-07-08 01:08:30 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-08 01:08:30 -0400 |
commit | bdd18e8f76e33151a850906c8353222bd06a49e6 (patch) | |
tree | 2a2d0e77d8d4409bcc0e137c1ec8cc1e3be08a98 | |
parent | 4c834452aad01531db949414f94f817a86348d59 (diff) | |
parent | 5f65c5bd58bf027eb2bacc2294a98e7aea81c630 (diff) |
Merge tag 'renesas-boards-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards
Merge "Renesas ARM Based SoC Boards Updates for v3.17" from Simon Horman:
- armadillo800eva LED support
- Remove now unnecessary work arounds for c\lock issues
- Enable R-Car Gen2 CMA code
* tag 'renesas-boards-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: Enable R-Car Gen2 CMA code in board files
ARM: shmobile: armadillo800eva reference: Spelling s/ED/LED/
ARM: shmobile: armadillo800eva legacy: Add LED support
ARM: shmobile: lager-reference: Remove workarounds for core clock issues
ARM: shmobile: koelsch-reference: Remove workarounds for core clock issues
Signed-off-by: Olof Johansson <olof@lixom.net>
73 files changed, 383 insertions, 191 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 798073057e51..b25cc7979754 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -12,6 +12,8 @@ menuconfig ARCH_SHMOBILE_MULTI | |||
12 | select NO_IOPORT_MAP | 12 | select NO_IOPORT_MAP |
13 | select PINCTRL | 13 | select PINCTRL |
14 | select ARCH_REQUIRE_GPIOLIB | 14 | select ARCH_REQUIRE_GPIOLIB |
15 | select ARCH_HAS_CPUFREQ | ||
16 | select ARCH_HAS_OPP | ||
15 | 17 | ||
16 | if ARCH_SHMOBILE_MULTI | 18 | if ARCH_SHMOBILE_MULTI |
17 | 19 | ||
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 38d5fe825e93..9c0ad3e115a6 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o | |||
53 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o | 53 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o |
54 | obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o | 54 | obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o |
55 | obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o | 55 | obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o |
56 | obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o | ||
56 | 57 | ||
57 | # Board objects | 58 | # Board objects |
58 | ifdef CONFIG_ARCH_SHMOBILE_MULTI | 59 | ifdef CONFIG_ARCH_SHMOBILE_MULTI |
diff --git a/arch/arm/mach-shmobile/board-ape6evm-reference.c b/arch/arm/mach-shmobile/board-ape6evm-reference.c index 3276afcf3cc9..76e4ff14be68 100644 --- a/arch/arm/mach-shmobile/board-ape6evm-reference.c +++ b/arch/arm/mach-shmobile/board-ape6evm-reference.c | |||
@@ -24,10 +24,10 @@ | |||
24 | #include <linux/pinctrl/machine.h> | 24 | #include <linux/pinctrl/machine.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/sh_clk.h> | 26 | #include <linux/sh_clk.h> |
27 | #include <mach/common.h> | ||
28 | #include <mach/r8a73a4.h> | 27 | #include <mach/r8a73a4.h> |
29 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
30 | #include "common.h" | ||
31 | 31 | ||
32 | static void __init ape6evm_add_standard_devices(void) | 32 | static void __init ape6evm_add_standard_devices(void) |
33 | { | 33 | { |
diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index fe071a9130b7..8f8da25310e7 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c | |||
@@ -33,11 +33,11 @@ | |||
33 | #include <linux/regulator/machine.h> | 33 | #include <linux/regulator/machine.h> |
34 | #include <linux/sh_clk.h> | 34 | #include <linux/sh_clk.h> |
35 | #include <linux/smsc911x.h> | 35 | #include <linux/smsc911x.h> |
36 | #include <mach/common.h> | ||
37 | #include <mach/irqs.h> | ||
38 | #include <mach/r8a73a4.h> | 36 | #include <mach/r8a73a4.h> |
39 | #include <asm/mach-types.h> | 37 | #include <asm/mach-types.h> |
40 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
39 | #include "common.h" | ||
40 | #include "irqs.h" | ||
41 | 41 | ||
42 | /* LEDS */ | 42 | /* LEDS */ |
43 | static struct gpio_led ape6evm_leds[] = { | 43 | static struct gpio_led ape6evm_leds[] = { |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c index f660fbb96e0b..0ae49823e67f 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c | |||
@@ -24,10 +24,10 @@ | |||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/gpio.h> | 25 | #include <linux/gpio.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <mach/common.h> | ||
28 | #include <mach/r8a7740.h> | 27 | #include <mach/r8a7740.h> |
29 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
30 | #include <asm/hardware/cache-l2x0.h> | 29 | #include <asm/hardware/cache-l2x0.h> |
30 | #include "common.h" | ||
31 | 31 | ||
32 | /* | 32 | /* |
33 | * CON1 Camera Module | 33 | * CON1 Camera Module |
@@ -53,11 +53,11 @@ | |||
53 | * CON22 Serial | 53 | * CON22 Serial |
54 | * CON23 LAN | 54 | * CON23 LAN |
55 | * CON24 USB3 | 55 | * CON24 USB3 |
56 | * LED1 Camera LED(Yellow) | 56 | * LED1 Camera LED (Yellow) |
57 | * LED2 Power LED (Green) | 57 | * LED2 Power LED (Green) |
58 | * ED3-LED6 User LED(Yellow) | 58 | * LED3-LED6 User LED (Yellow) |
59 | * LED7 LAN link LED(Green) | 59 | * LED7 LAN link LED (Green) |
60 | * LED8 LAN activity LED(Yellow) | 60 | * LED8 LAN activity LED (Yellow) |
61 | */ | 61 | */ |
62 | 62 | ||
63 | /* | 63 | /* |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 30fcac73a540..395638da837c 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -45,8 +45,6 @@ | |||
45 | #include <linux/mmc/sh_mobile_sdhi.h> | 45 | #include <linux/mmc/sh_mobile_sdhi.h> |
46 | #include <linux/i2c-gpio.h> | 46 | #include <linux/i2c-gpio.h> |
47 | #include <linux/reboot.h> | 47 | #include <linux/reboot.h> |
48 | #include <mach/common.h> | ||
49 | #include <mach/irqs.h> | ||
50 | #include <mach/r8a7740.h> | 48 | #include <mach/r8a7740.h> |
51 | #include <media/mt9t112.h> | 49 | #include <media/mt9t112.h> |
52 | #include <media/sh_mobile_ceu.h> | 50 | #include <media/sh_mobile_ceu.h> |
@@ -61,7 +59,9 @@ | |||
61 | #include <video/sh_mobile_hdmi.h> | 59 | #include <video/sh_mobile_hdmi.h> |
62 | #include <sound/sh_fsi.h> | 60 | #include <sound/sh_fsi.h> |
63 | #include <sound/simple_card.h> | 61 | #include <sound/simple_card.h> |
64 | 62 | #include "common.h" | |
63 | #include "irqs.h" | ||
64 | #include "pm-rmobile.h" | ||
65 | #include "sh-gpio.h" | 65 | #include "sh-gpio.h" |
66 | 66 | ||
67 | /* | 67 | /* |
@@ -578,6 +578,40 @@ static struct platform_device hdmi_lcdc_device = { | |||
578 | }, | 578 | }, |
579 | }; | 579 | }; |
580 | 580 | ||
581 | /* LEDS */ | ||
582 | static struct gpio_led gpio_leds[] = { | ||
583 | { | ||
584 | .name = "LED3", | ||
585 | .gpio = 102, | ||
586 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
587 | }, { | ||
588 | .name = "LED4", | ||
589 | .gpio = 111, | ||
590 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
591 | }, { | ||
592 | .name = "LED5", | ||
593 | .gpio = 110, | ||
594 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
595 | }, { | ||
596 | .name = "LED6", | ||
597 | .gpio = 177, | ||
598 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
599 | }, | ||
600 | }; | ||
601 | |||
602 | static struct gpio_led_platform_data leds_gpio_info = { | ||
603 | .leds = gpio_leds, | ||
604 | .num_leds = ARRAY_SIZE(gpio_leds), | ||
605 | }; | ||
606 | |||
607 | static struct platform_device leds_gpio_device = { | ||
608 | .name = "leds-gpio", | ||
609 | .id = -1, | ||
610 | .dev = { | ||
611 | .platform_data = &leds_gpio_info, | ||
612 | }, | ||
613 | }; | ||
614 | |||
581 | /* GPIO KEY */ | 615 | /* GPIO KEY */ |
582 | #define GPIO_KEY(c, g, d, ...) \ | 616 | #define GPIO_KEY(c, g, d, ...) \ |
583 | { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ } | 617 | { .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ } |
@@ -1069,6 +1103,7 @@ static struct platform_device *eva_devices[] __initdata = { | |||
1069 | &lcdc0_device, | 1103 | &lcdc0_device, |
1070 | &pwm_device, | 1104 | &pwm_device, |
1071 | &pwm_backlight_device, | 1105 | &pwm_backlight_device, |
1106 | &leds_gpio_device, | ||
1072 | &gpio_keys_device, | 1107 | &gpio_keys_device, |
1073 | &sh_eth_device, | 1108 | &sh_eth_device, |
1074 | &vcc_sdhi0, | 1109 | &vcc_sdhi0, |
diff --git a/arch/arm/mach-shmobile/board-bockw-reference.c b/arch/arm/mach-shmobile/board-bockw-reference.c index 027373f8de82..91ff3a27ccc7 100644 --- a/arch/arm/mach-shmobile/board-bockw-reference.c +++ b/arch/arm/mach-shmobile/board-bockw-reference.c | |||
@@ -19,9 +19,9 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/of_platform.h> | 21 | #include <linux/of_platform.h> |
22 | #include <mach/common.h> | ||
23 | #include <mach/r8a7778.h> | 22 | #include <mach/r8a7778.h> |
24 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
24 | #include "common.h" | ||
25 | 25 | ||
26 | /* | 26 | /* |
27 | * see board-bock.c for checking detail of dip-switch | 27 | * see board-bock.c for checking detail of dip-switch |
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index f444be2f241e..8cb057f95c44 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c | |||
@@ -35,12 +35,12 @@ | |||
35 | #include <linux/spi/flash.h> | 35 | #include <linux/spi/flash.h> |
36 | #include <linux/usb/renesas_usbhs.h> | 36 | #include <linux/usb/renesas_usbhs.h> |
37 | #include <media/soc_camera.h> | 37 | #include <media/soc_camera.h> |
38 | #include <mach/common.h> | ||
39 | #include <mach/irqs.h> | ||
40 | #include <mach/r8a7778.h> | 38 | #include <mach/r8a7778.h> |
41 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
42 | #include <sound/rcar_snd.h> | 40 | #include <sound/rcar_snd.h> |
43 | #include <sound/simple_card.h> | 41 | #include <sound/simple_card.h> |
42 | #include "common.h" | ||
43 | #include "irqs.h" | ||
44 | 44 | ||
45 | #define FPGA 0x18200000 | 45 | #define FPGA 0x18200000 |
46 | #define IRQ0MR 0x30 | 46 | #define IRQ0MR 0x30 |
diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c index 2ff6ad6e608e..d341ef09ec37 100644 --- a/arch/arm/mach-shmobile/board-genmai-reference.c +++ b/arch/arm/mach-shmobile/board-genmai-reference.c | |||
@@ -20,11 +20,11 @@ | |||
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <mach/clock.h> | ||
24 | #include <mach/common.h> | ||
25 | #include <mach/r7s72100.h> | 23 | #include <mach/r7s72100.h> |
26 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
26 | #include "clock.h" | ||
27 | #include "common.h" | ||
28 | 28 | ||
29 | /* | 29 | /* |
30 | * This is a really crude hack to provide clkdev support to platform | 30 | * This is a really crude hack to provide clkdev support to platform |
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c index c94201ee8596..f0a8eca7d10d 100644 --- a/arch/arm/mach-shmobile/board-genmai.c +++ b/arch/arm/mach-shmobile/board-genmai.c | |||
@@ -25,11 +25,11 @@ | |||
25 | #include <linux/sh_eth.h> | 25 | #include <linux/sh_eth.h> |
26 | #include <linux/spi/rspi.h> | 26 | #include <linux/spi/rspi.h> |
27 | #include <linux/spi/spi.h> | 27 | #include <linux/spi/spi.h> |
28 | #include <mach/common.h> | ||
29 | #include <mach/irqs.h> | ||
30 | #include <mach/r7s72100.h> | 28 | #include <mach/r7s72100.h> |
31 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | #include "common.h" | ||
32 | #include "irqs.h" | ||
33 | 33 | ||
34 | /* Ether */ | 34 | /* Ether */ |
35 | static const struct sh_eth_plat_data ether_pdata __initconst = { | 35 | static const struct sh_eth_plat_data ether_pdata __initconst = { |
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index d322a162b4b0..5e0375fdc6f7 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c | |||
@@ -23,12 +23,12 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
25 | #include <linux/platform_data/rcar-du.h> | 25 | #include <linux/platform_data/rcar-du.h> |
26 | #include <mach/clock.h> | ||
27 | #include <mach/common.h> | ||
28 | #include <mach/irqs.h> | ||
29 | #include <mach/rcar-gen2.h> | ||
30 | #include <mach/r8a7791.h> | 26 | #include <mach/r8a7791.h> |
31 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
28 | #include "clock.h" | ||
29 | #include "common.h" | ||
30 | #include "irqs.h" | ||
31 | #include "rcar-gen2.h" | ||
32 | 32 | ||
33 | /* DU */ | 33 | /* DU */ |
34 | static struct rcar_du_encoder_data koelsch_du_encoders[] = { | 34 | static struct rcar_du_encoder_data koelsch_du_encoders[] = { |
@@ -92,24 +92,9 @@ static const struct clk_name clk_names[] __initconst = { | |||
92 | { "lvds0", "lvds.0", "rcar-du-r8a7791" }, | 92 | { "lvds0", "lvds.0", "rcar-du-r8a7791" }, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | /* | ||
96 | * This is a really crude hack to work around core platform clock issues | ||
97 | */ | ||
98 | static const struct clk_name clk_enables[] __initconst = { | ||
99 | { "ether", NULL, "ee700000.ethernet" }, | ||
100 | { "i2c2", NULL, "e6530000.i2c" }, | ||
101 | { "msiof0", NULL, "e6e20000.spi" }, | ||
102 | { "qspi_mod", NULL, "e6b10000.spi" }, | ||
103 | { "sdhi0", NULL, "ee100000.sd" }, | ||
104 | { "sdhi1", NULL, "ee140000.sd" }, | ||
105 | { "sdhi2", NULL, "ee160000.sd" }, | ||
106 | { "thermal", NULL, "e61f0000.thermal" }, | ||
107 | }; | ||
108 | |||
109 | static void __init koelsch_add_standard_devices(void) | 95 | static void __init koelsch_add_standard_devices(void) |
110 | { | 96 | { |
111 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); | 97 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); |
112 | shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true); | ||
113 | r8a7791_add_dt_devices(); | 98 | r8a7791_add_dt_devices(); |
114 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 99 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
115 | 100 | ||
@@ -128,5 +113,6 @@ DT_MACHINE_START(KOELSCH_DT, "koelsch") | |||
128 | .init_time = rcar_gen2_timer_init, | 113 | .init_time = rcar_gen2_timer_init, |
129 | .init_machine = koelsch_add_standard_devices, | 114 | .init_machine = koelsch_add_standard_devices, |
130 | .init_late = shmobile_init_late, | 115 | .init_late = shmobile_init_late, |
116 | .reserve = rcar_gen2_reserve, | ||
131 | .dt_compat = koelsch_boards_compat_dt, | 117 | .dt_compat = koelsch_boards_compat_dt, |
132 | MACHINE_END | 118 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index c6c68892caa3..db4b8a311c75 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -45,12 +45,12 @@ | |||
45 | #include <linux/spi/flash.h> | 45 | #include <linux/spi/flash.h> |
46 | #include <linux/spi/rspi.h> | 46 | #include <linux/spi/rspi.h> |
47 | #include <linux/spi/spi.h> | 47 | #include <linux/spi/spi.h> |
48 | #include <mach/common.h> | ||
49 | #include <mach/irqs.h> | ||
50 | #include <mach/r8a7791.h> | 48 | #include <mach/r8a7791.h> |
51 | #include <mach/rcar-gen2.h> | ||
52 | #include <asm/mach-types.h> | 49 | #include <asm/mach-types.h> |
53 | #include <asm/mach/arch.h> | 50 | #include <asm/mach/arch.h> |
51 | #include "common.h" | ||
52 | #include "irqs.h" | ||
53 | #include "rcar-gen2.h" | ||
54 | 54 | ||
55 | /* DU */ | 55 | /* DU */ |
56 | static struct rcar_du_encoder_data koelsch_du_encoders[] = { | 56 | static struct rcar_du_encoder_data koelsch_du_encoders[] = { |
@@ -526,5 +526,6 @@ DT_MACHINE_START(KOELSCH_DT, "koelsch") | |||
526 | .init_time = rcar_gen2_timer_init, | 526 | .init_time = rcar_gen2_timer_init, |
527 | .init_machine = koelsch_init, | 527 | .init_machine = koelsch_init, |
528 | .init_late = shmobile_init_late, | 528 | .init_late = shmobile_init_late, |
529 | .reserve = rcar_gen2_reserve, | ||
529 | .dt_compat = koelsch_boards_compat_dt, | 530 | .dt_compat = koelsch_boards_compat_dt, |
530 | MACHINE_END | 531 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c index a735a1d80c28..e6285de6bc87 100644 --- a/arch/arm/mach-shmobile/board-kzm9g-reference.c +++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c | |||
@@ -26,10 +26,10 @@ | |||
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/of_platform.h> | 27 | #include <linux/of_platform.h> |
28 | #include <mach/sh73a0.h> | 28 | #include <mach/sh73a0.h> |
29 | #include <mach/common.h> | ||
30 | #include <asm/hardware/cache-l2x0.h> | 29 | #include <asm/hardware/cache-l2x0.h> |
31 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
32 | #include "common.h" | ||
33 | 33 | ||
34 | static void __init kzm_init(void) | 34 | static void __init kzm_init(void) |
35 | { | 35 | { |
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index f94ec8ca42c1..fff330f74925 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
@@ -43,13 +43,13 @@ | |||
43 | #include <linux/videodev2.h> | 43 | #include <linux/videodev2.h> |
44 | #include <sound/sh_fsi.h> | 44 | #include <sound/sh_fsi.h> |
45 | #include <sound/simple_card.h> | 45 | #include <sound/simple_card.h> |
46 | #include <mach/irqs.h> | ||
47 | #include <mach/sh73a0.h> | 46 | #include <mach/sh73a0.h> |
48 | #include <mach/common.h> | ||
49 | #include <asm/hardware/cache-l2x0.h> | 47 | #include <asm/hardware/cache-l2x0.h> |
50 | #include <asm/mach-types.h> | 48 | #include <asm/mach-types.h> |
51 | #include <asm/mach/arch.h> | 49 | #include <asm/mach/arch.h> |
52 | #include <video/sh_mobile_lcdc.h> | 50 | #include <video/sh_mobile_lcdc.h> |
51 | #include "common.h" | ||
52 | #include "irqs.h" | ||
53 | 53 | ||
54 | /* | 54 | /* |
55 | * external GPIO | 55 | * external GPIO |
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c index 749832e3f33c..c5e656e3bae3 100644 --- a/arch/arm/mach-shmobile/board-lager-reference.c +++ b/arch/arm/mach-shmobile/board-lager-reference.c | |||
@@ -22,12 +22,12 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
24 | #include <linux/platform_data/rcar-du.h> | 24 | #include <linux/platform_data/rcar-du.h> |
25 | #include <mach/clock.h> | ||
26 | #include <mach/common.h> | ||
27 | #include <mach/irqs.h> | ||
28 | #include <mach/rcar-gen2.h> | ||
29 | #include <mach/r8a7790.h> | 25 | #include <mach/r8a7790.h> |
30 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
27 | #include "clock.h" | ||
28 | #include "common.h" | ||
29 | #include "irqs.h" | ||
30 | #include "rcar-gen2.h" | ||
31 | 31 | ||
32 | /* DU */ | 32 | /* DU */ |
33 | static struct rcar_du_encoder_data lager_du_encoders[] = { | 33 | static struct rcar_du_encoder_data lager_du_encoders[] = { |
@@ -98,23 +98,9 @@ static const struct clk_name clk_names[] __initconst = { | |||
98 | { "lvds1", "lvds.1", "rcar-du-r8a7790" }, | 98 | { "lvds1", "lvds.1", "rcar-du-r8a7790" }, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | /* | ||
102 | * This is a really crude hack to work around core platform clock issues | ||
103 | */ | ||
104 | static const struct clk_name clk_enables[] __initconst = { | ||
105 | { "ether", NULL, "ee700000.ethernet" }, | ||
106 | { "msiof1", NULL, "e6e10000.spi" }, | ||
107 | { "mmcif1", NULL, "ee220000.mmc" }, | ||
108 | { "qspi_mod", NULL, "e6b10000.spi" }, | ||
109 | { "sdhi0", NULL, "ee100000.sd" }, | ||
110 | { "sdhi2", NULL, "ee140000.sd" }, | ||
111 | { "thermal", NULL, "e61f0000.thermal" }, | ||
112 | }; | ||
113 | |||
114 | static void __init lager_add_standard_devices(void) | 101 | static void __init lager_add_standard_devices(void) |
115 | { | 102 | { |
116 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); | 103 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); |
117 | shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true); | ||
118 | r8a7790_add_dt_devices(); | 104 | r8a7790_add_dt_devices(); |
119 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 105 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
120 | 106 | ||
@@ -133,5 +119,6 @@ DT_MACHINE_START(LAGER_DT, "lager") | |||
133 | .init_time = rcar_gen2_timer_init, | 119 | .init_time = rcar_gen2_timer_init, |
134 | .init_machine = lager_add_standard_devices, | 120 | .init_machine = lager_add_standard_devices, |
135 | .init_late = shmobile_init_late, | 121 | .init_late = shmobile_init_late, |
122 | .reserve = rcar_gen2_reserve, | ||
136 | .dt_compat = lager_boards_compat_dt, | 123 | .dt_compat = lager_boards_compat_dt, |
137 | MACHINE_END | 124 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index f8b1e05463cc..a51d202cddcf 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -45,8 +45,6 @@ | |||
45 | #include <linux/sh_eth.h> | 45 | #include <linux/sh_eth.h> |
46 | #include <linux/usb/phy.h> | 46 | #include <linux/usb/phy.h> |
47 | #include <linux/usb/renesas_usbhs.h> | 47 | #include <linux/usb/renesas_usbhs.h> |
48 | #include <mach/common.h> | ||
49 | #include <mach/irqs.h> | ||
50 | #include <mach/r8a7790.h> | 48 | #include <mach/r8a7790.h> |
51 | #include <media/soc_camera.h> | 49 | #include <media/soc_camera.h> |
52 | #include <asm/mach-types.h> | 50 | #include <asm/mach-types.h> |
@@ -58,6 +56,9 @@ | |||
58 | #include <linux/spi/spi.h> | 56 | #include <linux/spi/spi.h> |
59 | #include <sound/rcar_snd.h> | 57 | #include <sound/rcar_snd.h> |
60 | #include <sound/simple_card.h> | 58 | #include <sound/simple_card.h> |
59 | #include "common.h" | ||
60 | #include "irqs.h" | ||
61 | #include "rcar-gen2.h" | ||
61 | 62 | ||
62 | /* | 63 | /* |
63 | * SSI-AK4643 | 64 | * SSI-AK4643 |
@@ -890,5 +891,6 @@ DT_MACHINE_START(LAGER_DT, "lager") | |||
890 | .init_time = rcar_gen2_timer_init, | 891 | .init_time = rcar_gen2_timer_init, |
891 | .init_machine = lager_init, | 892 | .init_machine = lager_init, |
892 | .init_late = shmobile_init_late, | 893 | .init_late = shmobile_init_late, |
894 | .reserve = rcar_gen2_reserve, | ||
893 | .dt_compat = lager_boards_compat_dt, | 895 | .dt_compat = lager_boards_compat_dt, |
894 | MACHINE_END | 896 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 0ff4d8e45cf7..0ece865cbc4d 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #include <linux/regulator/fixed.h> | 47 | #include <linux/regulator/fixed.h> |
48 | #include <linux/regulator/machine.h> | 48 | #include <linux/regulator/machine.h> |
49 | #include <linux/smsc911x.h> | 49 | #include <linux/smsc911x.h> |
50 | #include <linux/sh_intc.h> | 50 | #include <linux/sh_clk.h> |
51 | #include <linux/tca6416_keypad.h> | 51 | #include <linux/tca6416_keypad.h> |
52 | #include <linux/usb/renesas_usbhs.h> | 52 | #include <linux/usb/renesas_usbhs.h> |
53 | #include <linux/dma-mapping.h> | 53 | #include <linux/dma-mapping.h> |
@@ -58,14 +58,12 @@ | |||
58 | #include <media/soc_camera_platform.h> | 58 | #include <media/soc_camera_platform.h> |
59 | #include <sound/sh_fsi.h> | 59 | #include <sound/sh_fsi.h> |
60 | #include <sound/simple_card.h> | 60 | #include <sound/simple_card.h> |
61 | |||
62 | #include <mach/common.h> | ||
63 | #include <mach/irqs.h> | ||
64 | #include <mach/sh7372.h> | 61 | #include <mach/sh7372.h> |
65 | |||
66 | #include <asm/mach/arch.h> | 62 | #include <asm/mach/arch.h> |
67 | #include <asm/mach-types.h> | 63 | #include <asm/mach-types.h> |
68 | 64 | #include "common.h" | |
65 | #include "irqs.h" | ||
66 | #include "pm-rmobile.h" | ||
69 | #include "sh-gpio.h" | 67 | #include "sh-gpio.h" |
70 | 68 | ||
71 | /* | 69 | /* |
diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 2773936bf7dc..94bd57203ff5 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c | |||
@@ -20,10 +20,10 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <mach/r8a7779.h> | 22 | #include <mach/r8a7779.h> |
23 | #include <mach/common.h> | ||
24 | #include <mach/irqs.h> | ||
25 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
26 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
25 | #include "common.h" | ||
26 | #include "irqs.h" | ||
27 | 27 | ||
28 | static void __init marzen_init(void) | 28 | static void __init marzen_init(void) |
29 | { | 29 | { |
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index d832a4477b4b..fe445ef49fb9 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
@@ -43,11 +43,11 @@ | |||
43 | #include <linux/mfd/tmio.h> | 43 | #include <linux/mfd/tmio.h> |
44 | #include <media/soc_camera.h> | 44 | #include <media/soc_camera.h> |
45 | #include <mach/r8a7779.h> | 45 | #include <mach/r8a7779.h> |
46 | #include <mach/common.h> | ||
47 | #include <mach/irqs.h> | ||
48 | #include <asm/mach-types.h> | 46 | #include <asm/mach-types.h> |
49 | #include <asm/mach/arch.h> | 47 | #include <asm/mach/arch.h> |
50 | #include <asm/traps.h> | 48 | #include <asm/traps.h> |
49 | #include "common.h" | ||
50 | #include "irqs.h" | ||
51 | 51 | ||
52 | /* Fixed 3.3V regulator to be used by SDHI0 */ | 52 | /* Fixed 3.3V regulator to be used by SDHI0 */ |
53 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = { | 53 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = { |
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c index df187484de5d..457dab0f8fc9 100644 --- a/arch/arm/mach-shmobile/clock-r7s72100.c +++ b/arch/arm/mach-shmobile/clock-r7s72100.c | |||
@@ -19,8 +19,8 @@ | |||
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/sh_clk.h> | 20 | #include <linux/sh_clk.h> |
21 | #include <linux/clkdev.h> | 21 | #include <linux/clkdev.h> |
22 | #include <mach/common.h> | ||
23 | #include <mach/r7s72100.h> | 22 | #include <mach/r7s72100.h> |
23 | #include "common.h" | ||
24 | 24 | ||
25 | /* Frequency Control Registers */ | 25 | /* Frequency Control Registers */ |
26 | #define FRQCR 0xfcfe0010 | 26 | #define FRQCR 0xfcfe0010 |
diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c index b5bc22c6a858..0f431498229b 100644 --- a/arch/arm/mach-shmobile/clock-r8a73a4.c +++ b/arch/arm/mach-shmobile/clock-r8a73a4.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/sh_clk.h> | 23 | #include <linux/sh_clk.h> |
24 | #include <linux/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <mach/clock.h> | 25 | #include "common.h" |
26 | #include <mach/common.h> | 26 | #include "clock.h" |
27 | 27 | ||
28 | #define CPG_BASE 0xe6150000 | 28 | #define CPG_BASE 0xe6150000 |
29 | #define CPG_LEN 0x270 | 29 | #define CPG_LEN 0x270 |
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c index 50931e3c97c7..ffefec53b058 100644 --- a/arch/arm/mach-shmobile/clock-r8a7740.c +++ b/arch/arm/mach-shmobile/clock-r8a7740.c | |||
@@ -22,9 +22,9 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/sh_clk.h> | 23 | #include <linux/sh_clk.h> |
24 | #include <linux/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <mach/clock.h> | ||
26 | #include <mach/common.h> | ||
27 | #include <mach/r8a7740.h> | 25 | #include <mach/r8a7740.h> |
26 | #include "clock.h" | ||
27 | #include "common.h" | ||
28 | 28 | ||
29 | /* | 29 | /* |
30 | * | MDx | XTAL1/EXTAL1 | System | EXTALR | | 30 | * | MDx | XTAL1/EXTAL1 | System | EXTALR | |
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index 13f8f3ab8840..16bbc94a1520 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c | |||
@@ -39,8 +39,8 @@ | |||
39 | #include <linux/io.h> | 39 | #include <linux/io.h> |
40 | #include <linux/sh_clk.h> | 40 | #include <linux/sh_clk.h> |
41 | #include <linux/clkdev.h> | 41 | #include <linux/clkdev.h> |
42 | #include <mach/clock.h> | 42 | #include "clock.h" |
43 | #include <mach/common.h> | 43 | #include "common.h" |
44 | 44 | ||
45 | #define MSTPCR0 IOMEM(0xffc80030) | 45 | #define MSTPCR0 IOMEM(0xffc80030) |
46 | #define MSTPCR1 IOMEM(0xffc80034) | 46 | #define MSTPCR1 IOMEM(0xffc80034) |
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index a13298bd37a8..d81539a26dbd 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/sh_clk.h> | 24 | #include <linux/sh_clk.h> |
25 | #include <linux/clkdev.h> | 25 | #include <linux/clkdev.h> |
26 | #include <mach/clock.h> | 26 | #include "clock.h" |
27 | #include <mach/common.h> | 27 | #include "common.h" |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * MD1 = 1 MD1 = 0 | 30 | * MD1 = 1 MD1 = 0 |
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c index 296a057109e4..ca980669806f 100644 --- a/arch/arm/mach-shmobile/clock-r8a7790.c +++ b/arch/arm/mach-shmobile/clock-r8a7790.c | |||
@@ -22,9 +22,10 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/sh_clk.h> | 23 | #include <linux/sh_clk.h> |
24 | #include <linux/clkdev.h> | 24 | #include <linux/clkdev.h> |
25 | #include <mach/clock.h> | ||
26 | #include <mach/common.h> | ||
27 | #include <mach/r8a7790.h> | 25 | #include <mach/r8a7790.h> |
26 | #include "clock.h" | ||
27 | #include "common.h" | ||
28 | #include "rcar-gen2.h" | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * MD EXTAL PLL0 PLL1 PLL3 | 31 | * MD EXTAL PLL0 PLL1 PLL3 |
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c index e2fdfcc14436..10e193d707f5 100644 --- a/arch/arm/mach-shmobile/clock-r8a7791.c +++ b/arch/arm/mach-shmobile/clock-r8a7791.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/sh_clk.h> | 24 | #include <linux/sh_clk.h> |
25 | #include <linux/clkdev.h> | 25 | #include <linux/clkdev.h> |
26 | #include <mach/clock.h> | 26 | #include "clock.h" |
27 | #include <mach/common.h> | 27 | #include "common.h" |
28 | #include <mach/rcar-gen2.h> | 28 | #include "rcar-gen2.h" |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * MD EXTAL PLL0 PLL1 PLL3 | 31 | * MD EXTAL PLL0 PLL1 PLL3 |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index d16d9ca7f79e..7071676145c4 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -21,8 +21,8 @@ | |||
21 | #include <linux/io.h> | 21 | #include <linux/io.h> |
22 | #include <linux/sh_clk.h> | 22 | #include <linux/sh_clk.h> |
23 | #include <linux/clkdev.h> | 23 | #include <linux/clkdev.h> |
24 | #include <mach/clock.h> | 24 | #include "clock.h" |
25 | #include <mach/common.h> | 25 | #include "common.h" |
26 | 26 | ||
27 | /* SH7372 registers */ | 27 | /* SH7372 registers */ |
28 | #define FRQCRA IOMEM(0xe6150000) | 28 | #define FRQCRA IOMEM(0xe6150000) |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 0d9cd1fe0212..37f48383e05a 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -22,8 +22,8 @@ | |||
22 | #include <linux/sh_clk.h> | 22 | #include <linux/sh_clk.h> |
23 | #include <linux/clkdev.h> | 23 | #include <linux/clkdev.h> |
24 | #include <asm/processor.h> | 24 | #include <asm/processor.h> |
25 | #include <mach/clock.h> | 25 | #include "clock.h" |
26 | #include <mach/common.h> | 26 | #include "common.h" |
27 | 27 | ||
28 | #define FRQCRA IOMEM(0xe6150000) | 28 | #define FRQCRA IOMEM(0xe6150000) |
29 | #define FRQCRB IOMEM(0xe6150004) | 29 | #define FRQCRB IOMEM(0xe6150004) |
diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c index e7232a0373b9..806f94038cc4 100644 --- a/arch/arm/mach-shmobile/clock.c +++ b/arch/arm/mach-shmobile/clock.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #ifdef CONFIG_COMMON_CLK | 25 | #ifdef CONFIG_COMMON_CLK |
26 | #include <linux/clk.h> | 26 | #include <linux/clk.h> |
27 | #include <linux/clkdev.h> | 27 | #include <linux/clkdev.h> |
28 | #include <mach/clock.h> | 28 | #include "clock.h" |
29 | 29 | ||
30 | void __init shmobile_clk_workaround(const struct clk_name *clks, | 30 | void __init shmobile_clk_workaround(const struct clk_name *clks, |
31 | int nr_clks, bool enable) | 31 | int nr_clks, bool enable) |
@@ -49,8 +49,8 @@ void __init shmobile_clk_workaround(const struct clk_name *clks, | |||
49 | #else /* CONFIG_COMMON_CLK */ | 49 | #else /* CONFIG_COMMON_CLK */ |
50 | #include <linux/sh_clk.h> | 50 | #include <linux/sh_clk.h> |
51 | #include <linux/export.h> | 51 | #include <linux/export.h> |
52 | #include <mach/clock.h> | 52 | #include "clock.h" |
53 | #include <mach/common.h> | 53 | #include "common.h" |
54 | 54 | ||
55 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk) | 55 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk) |
56 | { | 56 | { |
diff --git a/arch/arm/mach-shmobile/include/mach/clock.h b/arch/arm/mach-shmobile/clock.h index 31b6417463e6..31b6417463e6 100644 --- a/arch/arm/mach-shmobile/include/mach/clock.h +++ b/arch/arm/mach-shmobile/clock.h | |||
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/common.h index f7a360edcc35..1e811999557d 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/common.h | |||
@@ -35,8 +35,10 @@ extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); | |||
35 | 35 | ||
36 | #ifdef CONFIG_SUSPEND | 36 | #ifdef CONFIG_SUSPEND |
37 | int shmobile_suspend_init(void); | 37 | int shmobile_suspend_init(void); |
38 | void shmobile_smp_apmu_suspend_init(void); | ||
38 | #else | 39 | #else |
39 | static inline int shmobile_suspend_init(void) { return 0; } | 40 | static inline int shmobile_suspend_init(void) { return 0; } |
41 | static inline void shmobile_smp_apmu_suspend_init(void) { } | ||
40 | #endif | 42 | #endif |
41 | 43 | ||
42 | #ifdef CONFIG_CPU_IDLE | 44 | #ifdef CONFIG_CPU_IDLE |
diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c index 9411a5bf4fd6..f2e79f2376e1 100644 --- a/arch/arm/mach-shmobile/console.c +++ b/arch/arm/mach-shmobile/console.c | |||
@@ -19,8 +19,8 @@ | |||
19 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <mach/common.h> | ||
23 | #include <asm/mach/map.h> | 22 | #include <asm/mach/map.h> |
23 | #include "common.h" | ||
24 | 24 | ||
25 | void __init shmobile_setup_console(void) | 25 | void __init shmobile_setup_console(void) |
26 | { | 26 | { |
diff --git a/arch/arm/mach-shmobile/include/mach/dma-register.h b/arch/arm/mach-shmobile/dma-register.h index 97c40bd9b94f..97c40bd9b94f 100644 --- a/arch/arm/mach-shmobile/include/mach/dma-register.h +++ b/arch/arm/mach-shmobile/dma-register.h | |||
diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h index d241bfd6926d..5aee83f079e2 100644 --- a/arch/arm/mach-shmobile/include/mach/irqs.h +++ b/arch/arm/mach-shmobile/include/mach/irqs.h | |||
@@ -1,24 +1,10 @@ | |||
1 | #ifndef __ASM_MACH_IRQS_H | 1 | #ifndef __ASM_MACH_IRQS_H |
2 | #define __ASM_MACH_IRQS_H | 2 | #define __ASM_MACH_IRQS_H |
3 | 3 | ||
4 | #include <linux/sh_intc.h> | 4 | /* Stuck here until drivers/pinctl/sh-pfc gets rid of legacy code */ |
5 | |||
6 | /* GIC */ | ||
7 | #define gic_spi(nr) ((nr) + 32) | ||
8 | #define gic_iid(nr) (nr) /* ICCIAR / interrupt ID */ | ||
9 | |||
10 | /* INTCS */ | ||
11 | #define INTCS_VECT_BASE 0x3400 | ||
12 | #define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect)) | ||
13 | #define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt)) | ||
14 | 5 | ||
15 | /* External IRQ pins */ | 6 | /* External IRQ pins */ |
16 | #define IRQPIN_BASE 2000 | 7 | #define IRQPIN_BASE 2000 |
17 | #define irq_pin(nr) ((nr) + IRQPIN_BASE) | 8 | #define irq_pin(nr) ((nr) + IRQPIN_BASE) |
18 | 9 | ||
19 | /* GPIO IRQ */ | ||
20 | #define _GPIO_IRQ_BASE 2500 | ||
21 | #define GPIO_IRQ_BASE(x) (_GPIO_IRQ_BASE + (32 * x)) | ||
22 | #define GPIO_IRQ(x, y) (_GPIO_IRQ_BASE + (32 * x) + y) | ||
23 | |||
24 | #endif /* __ASM_MACH_IRQS_H */ | 10 | #endif /* __ASM_MACH_IRQS_H */ |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h index 5e3c9ec06303..1d1a5fd78b6b 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7740.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h | |||
@@ -19,8 +19,6 @@ | |||
19 | #ifndef __ASM_R8A7740_H__ | 19 | #ifndef __ASM_R8A7740_H__ |
20 | #define __ASM_R8A7740_H__ | 20 | #define __ASM_R8A7740_H__ |
21 | 21 | ||
22 | #include <mach/pm-rmobile.h> | ||
23 | |||
24 | /* | 22 | /* |
25 | * MD_CKx pin | 23 | * MD_CKx pin |
26 | */ | 24 | */ |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h index 88eeceaf1088..def10a29e09a 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h | |||
@@ -2,8 +2,6 @@ | |||
2 | #define __ASM_R8A7779_H__ | 2 | #define __ASM_R8A7779_H__ |
3 | 3 | ||
4 | #include <linux/sh_clk.h> | 4 | #include <linux/sh_clk.h> |
5 | #include <linux/pm_domain.h> | ||
6 | #include <mach/pm-rcar.h> | ||
7 | 5 | ||
8 | /* HPB-DMA slave IDs */ | 6 | /* HPB-DMA slave IDs */ |
9 | enum { | 7 | enum { |
@@ -12,16 +10,6 @@ enum { | |||
12 | HPBDMA_SLAVE_SDHI0_RX, | 10 | HPBDMA_SLAVE_SDHI0_RX, |
13 | }; | 11 | }; |
14 | 12 | ||
15 | struct r8a7779_pm_domain { | ||
16 | struct generic_pm_domain genpd; | ||
17 | struct rcar_sysc_ch ch; | ||
18 | }; | ||
19 | |||
20 | static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) | ||
21 | { | ||
22 | return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; | ||
23 | } | ||
24 | |||
25 | extern void r8a7779_init_delay(void); | 13 | extern void r8a7779_init_delay(void); |
26 | extern void r8a7779_init_irq_extpin(int irlm); | 14 | extern void r8a7779_init_irq_extpin(int irlm); |
27 | extern void r8a7779_init_irq_extpin_dt(int irlm); | 15 | extern void r8a7779_init_irq_extpin_dt(int irlm); |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7790.h b/arch/arm/mach-shmobile/include/mach/r8a7790.h index 0b95babe84ba..d7555440fc7b 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7790.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7790.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __ASM_R8A7790_H__ | 1 | #ifndef __ASM_R8A7790_H__ |
2 | #define __ASM_R8A7790_H__ | 2 | #define __ASM_R8A7790_H__ |
3 | 3 | ||
4 | #include <mach/rcar-gen2.h> | ||
5 | |||
6 | /* DMA slave IDs */ | 4 | /* DMA slave IDs */ |
7 | enum { | 5 | enum { |
8 | RCAR_DMA_SLAVE_INVALID, | 6 | RCAR_DMA_SLAVE_INVALID, |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h index 664274cc4b64..86eae7bceb6f 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h | |||
@@ -5,6 +5,7 @@ void r8a7791_add_standard_devices(void); | |||
5 | void r8a7791_add_dt_devices(void); | 5 | void r8a7791_add_dt_devices(void); |
6 | void r8a7791_clock_init(void); | 6 | void r8a7791_clock_init(void); |
7 | void r8a7791_pinmux_init(void); | 7 | void r8a7791_pinmux_init(void); |
8 | void r8a7791_pm_init(void); | ||
8 | extern struct smp_operations r8a7791_smp_ops; | 9 | extern struct smp_operations r8a7791_smp_ops; |
9 | 10 | ||
10 | #endif /* __ASM_R8A7791_H__ */ | 11 | #endif /* __ASM_R8A7791_H__ */ |
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h index 854a9f0ca040..4ad960d5075b 100644 --- a/arch/arm/mach-shmobile/include/mach/sh7372.h +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h | |||
@@ -11,10 +11,6 @@ | |||
11 | #ifndef __ASM_SH7372_H__ | 11 | #ifndef __ASM_SH7372_H__ |
12 | #define __ASM_SH7372_H__ | 12 | #define __ASM_SH7372_H__ |
13 | 13 | ||
14 | #include <linux/sh_clk.h> | ||
15 | #include <linux/pm_domain.h> | ||
16 | #include <mach/pm-rmobile.h> | ||
17 | |||
18 | /* DMA slave IDs */ | 14 | /* DMA slave IDs */ |
19 | enum { | 15 | enum { |
20 | SHDMA_SLAVE_INVALID, | 16 | SHDMA_SLAVE_INVALID, |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index a91caad7db7c..e2af00b1bd9d 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
@@ -22,11 +22,10 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/sh_intc.h> | ||
26 | #include <mach/intc.h> | ||
27 | #include <mach/irqs.h> | ||
28 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
29 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
27 | #include "intc.h" | ||
28 | #include "irqs.h" | ||
30 | 29 | ||
31 | enum { | 30 | enum { |
32 | UNUSED_INTCA = 0, | 31 | UNUSED_INTCA = 0, |
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c index 19a26f4579b3..1a8f9a7af983 100644 --- a/arch/arm/mach-shmobile/intc-sh73a0.c +++ b/arch/arm/mach-shmobile/intc-sh73a0.c | |||
@@ -22,14 +22,13 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/sh_intc.h> | ||
26 | #include <linux/irqchip.h> | 25 | #include <linux/irqchip.h> |
27 | #include <linux/irqchip/arm-gic.h> | 26 | #include <linux/irqchip/arm-gic.h> |
28 | #include <mach/intc.h> | ||
29 | #include <mach/irqs.h> | ||
30 | #include <mach/sh73a0.h> | 27 | #include <mach/sh73a0.h> |
31 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
30 | #include "intc.h" | ||
31 | #include "irqs.h" | ||
33 | 32 | ||
34 | enum { | 33 | enum { |
35 | UNUSED = 0, | 34 | UNUSED = 0, |
diff --git a/arch/arm/mach-shmobile/include/mach/intc.h b/arch/arm/mach-shmobile/intc.h index a5603c76cfe0..a5603c76cfe0 100644 --- a/arch/arm/mach-shmobile/include/mach/intc.h +++ b/arch/arm/mach-shmobile/intc.h | |||
diff --git a/arch/arm/mach-shmobile/irqs.h b/arch/arm/mach-shmobile/irqs.h new file mode 100644 index 000000000000..4ff2d2aa94f0 --- /dev/null +++ b/arch/arm/mach-shmobile/irqs.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef __SHMOBILE_IRQS_H | ||
2 | #define __SHMOBILE_IRQS_H | ||
3 | |||
4 | #include <linux/sh_intc.h> | ||
5 | #include <mach/irqs.h> | ||
6 | |||
7 | /* GIC */ | ||
8 | #define gic_spi(nr) ((nr) + 32) | ||
9 | #define gic_iid(nr) (nr) /* ICCIAR / interrupt ID */ | ||
10 | |||
11 | /* INTCS */ | ||
12 | #define INTCS_VECT_BASE 0x3400 | ||
13 | #define INTCS_VECT(n, vect) INTC_VECT((n), INTCS_VECT_BASE + (vect)) | ||
14 | #define intcs_evt2irq(evt) evt2irq(INTCS_VECT_BASE + (evt)) | ||
15 | |||
16 | /* GPIO IRQ */ | ||
17 | #define _GPIO_IRQ_BASE 2500 | ||
18 | #define GPIO_IRQ_BASE(x) (_GPIO_IRQ_BASE + (32 * x)) | ||
19 | #define GPIO_IRQ(x, y) (_GPIO_IRQ_BASE + (32 * x) + y) | ||
20 | |||
21 | #endif /* __SHMOBILE_IRQS_H */ | ||
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 8cb641c00fdb..590e35c22a60 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c | |||
@@ -7,16 +7,20 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <linux/cpu_pm.h> | ||
10 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/io.h> | 13 | #include <linux/io.h> |
13 | #include <linux/ioport.h> | 14 | #include <linux/ioport.h> |
14 | #include <linux/of_address.h> | 15 | #include <linux/of_address.h> |
15 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | #include <linux/suspend.h> | ||
16 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
17 | #include <asm/cp15.h> | 19 | #include <asm/cp15.h> |
20 | #include <asm/proc-fns.h> | ||
18 | #include <asm/smp_plat.h> | 21 | #include <asm/smp_plat.h> |
19 | #include <mach/common.h> | 22 | #include <asm/suspend.h> |
23 | #include "common.h" | ||
20 | 24 | ||
21 | static struct { | 25 | static struct { |
22 | void __iomem *iomem; | 26 | void __iomem *iomem; |
@@ -141,7 +145,7 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
141 | return apmu_wrap(cpu, apmu_power_on); | 145 | return apmu_wrap(cpu, apmu_power_on); |
142 | } | 146 | } |
143 | 147 | ||
144 | #ifdef CONFIG_HOTPLUG_CPU | 148 | #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) |
145 | /* nicked from arch/arm/mach-exynos/hotplug.c */ | 149 | /* nicked from arch/arm/mach-exynos/hotplug.c */ |
146 | static inline void cpu_enter_lowpower_a15(void) | 150 | static inline void cpu_enter_lowpower_a15(void) |
147 | { | 151 | { |
@@ -172,16 +176,40 @@ static inline void cpu_enter_lowpower_a15(void) | |||
172 | dsb(); | 176 | dsb(); |
173 | } | 177 | } |
174 | 178 | ||
175 | void shmobile_smp_apmu_cpu_die(unsigned int cpu) | 179 | void shmobile_smp_apmu_cpu_shutdown(unsigned int cpu) |
176 | { | 180 | { |
177 | /* For this particular CPU deregister boot vector */ | ||
178 | shmobile_smp_hook(cpu, 0, 0); | ||
179 | 181 | ||
180 | /* Select next sleep mode using the APMU */ | 182 | /* Select next sleep mode using the APMU */ |
181 | apmu_wrap(cpu, apmu_power_off); | 183 | apmu_wrap(cpu, apmu_power_off); |
182 | 184 | ||
183 | /* Do ARM specific CPU shutdown */ | 185 | /* Do ARM specific CPU shutdown */ |
184 | cpu_enter_lowpower_a15(); | 186 | cpu_enter_lowpower_a15(); |
187 | } | ||
188 | |||
189 | static inline void cpu_leave_lowpower(void) | ||
190 | { | ||
191 | unsigned int v; | ||
192 | |||
193 | asm volatile("mrc p15, 0, %0, c1, c0, 0\n" | ||
194 | " orr %0, %0, %1\n" | ||
195 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
196 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
197 | " orr %0, %0, %2\n" | ||
198 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
199 | : "=&r" (v) | ||
200 | : "Ir" (CR_C), "Ir" (0x40) | ||
201 | : "cc"); | ||
202 | } | ||
203 | #endif | ||
204 | |||
205 | #if defined(CONFIG_HOTPLUG_CPU) | ||
206 | void shmobile_smp_apmu_cpu_die(unsigned int cpu) | ||
207 | { | ||
208 | /* For this particular CPU deregister boot vector */ | ||
209 | shmobile_smp_hook(cpu, 0, 0); | ||
210 | |||
211 | /* Shutdown CPU core */ | ||
212 | shmobile_smp_apmu_cpu_shutdown(cpu); | ||
185 | 213 | ||
186 | /* jump to shared mach-shmobile sleep / reset code */ | 214 | /* jump to shared mach-shmobile sleep / reset code */ |
187 | shmobile_smp_sleep(); | 215 | shmobile_smp_sleep(); |
@@ -192,3 +220,27 @@ int shmobile_smp_apmu_cpu_kill(unsigned int cpu) | |||
192 | return apmu_wrap(cpu, apmu_power_off_poll); | 220 | return apmu_wrap(cpu, apmu_power_off_poll); |
193 | } | 221 | } |
194 | #endif | 222 | #endif |
223 | |||
224 | #if defined(CONFIG_SUSPEND) | ||
225 | static int shmobile_smp_apmu_do_suspend(unsigned long cpu) | ||
226 | { | ||
227 | shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0); | ||
228 | shmobile_smp_apmu_cpu_shutdown(cpu); | ||
229 | cpu_do_idle(); /* WFI selects Core Standby */ | ||
230 | return 1; | ||
231 | } | ||
232 | |||
233 | static int shmobile_smp_apmu_enter_suspend(suspend_state_t state) | ||
234 | { | ||
235 | cpu_suspend(smp_processor_id(), shmobile_smp_apmu_do_suspend); | ||
236 | cpu_leave_lowpower(); | ||
237 | return 0; | ||
238 | } | ||
239 | |||
240 | void shmobile_smp_apmu_suspend_init(void) | ||
241 | { | ||
242 | shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend; | ||
243 | } | ||
244 | #else | ||
245 | void shmobile_smp_apmu_suspend_init(void) {} | ||
246 | #endif | ||
diff --git a/arch/arm/mach-shmobile/platsmp-scu.c b/arch/arm/mach-shmobile/platsmp-scu.c index 673ad6e80869..64663110ab6c 100644 --- a/arch/arm/mach-shmobile/platsmp-scu.c +++ b/arch/arm/mach-shmobile/platsmp-scu.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
16 | #include <asm/smp_plat.h> | 16 | #include <asm/smp_plat.h> |
17 | #include <asm/smp_scu.h> | 17 | #include <asm/smp_scu.h> |
18 | #include <mach/common.h> | 18 | #include "common.h" |
19 | 19 | ||
20 | static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb, | 20 | static int shmobile_smp_scu_notifier_call(struct notifier_block *nfb, |
21 | unsigned long action, void *hcpu) | 21 | unsigned long action, void *hcpu) |
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c index 9ebc246b8d7d..3923e09e966d 100644 --- a/arch/arm/mach-shmobile/platsmp.c +++ b/arch/arm/mach-shmobile/platsmp.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <asm/cacheflush.h> | 14 | #include <asm/cacheflush.h> |
15 | #include <asm/smp_plat.h> | 15 | #include <asm/smp_plat.h> |
16 | #include <mach/common.h> | 16 | #include "common.h" |
17 | 17 | ||
18 | extern unsigned long shmobile_smp_fn[]; | 18 | extern unsigned long shmobile_smp_fn[]; |
19 | extern unsigned long shmobile_smp_arg[]; | 19 | extern unsigned long shmobile_smp_arg[]; |
diff --git a/arch/arm/mach-shmobile/pm-r8a7740.c b/arch/arm/mach-shmobile/pm-r8a7740.c index 40b87aa1d448..a0d44d537fa0 100644 --- a/arch/arm/mach-shmobile/pm-r8a7740.c +++ b/arch/arm/mach-shmobile/pm-r8a7740.c | |||
@@ -10,8 +10,8 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/console.h> | 11 | #include <linux/console.h> |
12 | #include <linux/suspend.h> | 12 | #include <linux/suspend.h> |
13 | #include <mach/pm-rmobile.h> | 13 | #include "common.h" |
14 | #include <mach/common.h> | 14 | #include "pm-rmobile.h" |
15 | 15 | ||
16 | #ifdef CONFIG_PM | 16 | #ifdef CONFIG_PM |
17 | static int r8a7740_pd_a4s_suspend(void) | 17 | static int r8a7740_pd_a4s_suspend(void) |
diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c index d6fe189b2df6..f0f36cb5ffe7 100644 --- a/arch/arm/mach-shmobile/pm-r8a7779.c +++ b/arch/arm/mach-shmobile/pm-r8a7779.c | |||
@@ -13,20 +13,31 @@ | |||
13 | #include <linux/suspend.h> | 13 | #include <linux/suspend.h> |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/pm_clock.h> | 15 | #include <linux/pm_clock.h> |
16 | #include <linux/pm_domain.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
18 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
19 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
20 | #include <linux/console.h> | 21 | #include <linux/console.h> |
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | #include <mach/common.h> | ||
23 | #include <mach/pm-rcar.h> | ||
24 | #include <mach/r8a7779.h> | 23 | #include <mach/r8a7779.h> |
24 | #include "common.h" | ||
25 | #include "pm-rcar.h" | ||
25 | 26 | ||
26 | /* SYSC */ | 27 | /* SYSC */ |
27 | #define SYSCIER 0x0c | 28 | #define SYSCIER 0x0c |
28 | #define SYSCIMR 0x10 | 29 | #define SYSCIMR 0x10 |
29 | 30 | ||
31 | struct r8a7779_pm_domain { | ||
32 | struct generic_pm_domain genpd; | ||
33 | struct rcar_sysc_ch ch; | ||
34 | }; | ||
35 | |||
36 | static inline struct rcar_sysc_ch *to_r8a7779_ch(struct generic_pm_domain *d) | ||
37 | { | ||
38 | return &container_of(d, struct r8a7779_pm_domain, genpd)->ch; | ||
39 | } | ||
40 | |||
30 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) | 41 | #if defined(CONFIG_PM) || defined(CONFIG_SMP) |
31 | 42 | ||
32 | static void __init r8a7779_sysc_init(void) | 43 | static void __init r8a7779_sysc_init(void) |
diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index fc82839e2c2a..0f1090d851e7 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c | |||
@@ -12,8 +12,8 @@ | |||
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <asm/io.h> | 14 | #include <asm/io.h> |
15 | #include <mach/pm-rcar.h> | ||
16 | #include <mach/r8a7790.h> | 15 | #include <mach/r8a7790.h> |
16 | #include "pm-rcar.h" | ||
17 | 17 | ||
18 | /* SYSC */ | 18 | /* SYSC */ |
19 | #define SYSCIER 0x0c | 19 | #define SYSCIER 0x0c |
diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c new file mode 100644 index 000000000000..15190875d507 --- /dev/null +++ b/arch/arm/mach-shmobile/pm-r8a7791.c | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * r8a7791 Power management support | ||
3 | * | ||
4 | * Copyright (C) 2014 Renesas Electronics Corporation | ||
5 | * Copyright (C) 2011 Renesas Solutions Corp. | ||
6 | * Copyright (C) 2011 Magnus Damm | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file "COPYING" in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | |||
13 | #include <asm/io.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <mach/r8a7791.h> | ||
16 | #include "pm-rcar.h" | ||
17 | |||
18 | /* SYSC */ | ||
19 | #define SYSCIER 0x0c | ||
20 | #define SYSCIMR 0x10 | ||
21 | |||
22 | #if defined(CONFIG_SMP) | ||
23 | |||
24 | static void __init r8a7791_sysc_init(void) | ||
25 | { | ||
26 | void __iomem *base = rcar_sysc_init(0xe6180000); | ||
27 | |||
28 | /* enable all interrupt sources, but do not use interrupt handler */ | ||
29 | iowrite32(0x0131000e, base + SYSCIER); | ||
30 | iowrite32(0, base + SYSCIMR); | ||
31 | } | ||
32 | |||
33 | #else /* CONFIG_SMP */ | ||
34 | |||
35 | static inline void r8a7791_sysc_init(void) {} | ||
36 | |||
37 | #endif /* CONFIG_SMP */ | ||
38 | |||
39 | void __init r8a7791_pm_init(void) | ||
40 | { | ||
41 | static int once; | ||
42 | |||
43 | if (once++) | ||
44 | return; | ||
45 | |||
46 | r8a7791_sysc_init(); | ||
47 | } | ||
diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c index 1f465a12d1b1..34b8a5674f85 100644 --- a/arch/arm/mach-shmobile/pm-rcar.c +++ b/arch/arm/mach-shmobile/pm-rcar.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <mach/pm-rcar.h> | 16 | #include "pm-rcar.h" |
17 | 17 | ||
18 | /* SYSC */ | 18 | /* SYSC */ |
19 | #define SYSCSR 0x00 | 19 | #define SYSCSR 0x00 |
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rcar.h b/arch/arm/mach-shmobile/pm-rcar.h index ef3a1ef628f1..ef3a1ef628f1 100644 --- a/arch/arm/mach-shmobile/include/mach/pm-rcar.h +++ b/arch/arm/mach-shmobile/pm-rcar.h | |||
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index f710235aff2f..ebdd16e94a84 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
18 | #include <linux/pm_clock.h> | 18 | #include <linux/pm_clock.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | #include <mach/pm-rmobile.h> | 20 | #include "pm-rmobile.h" |
21 | 21 | ||
22 | /* SYSC */ | 22 | /* SYSC */ |
23 | #define SPDCR IOMEM(0xe6180008) | 23 | #define SPDCR IOMEM(0xe6180008) |
diff --git a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h b/arch/arm/mach-shmobile/pm-rmobile.h index 690553a06887..690553a06887 100644 --- a/arch/arm/mach-shmobile/include/mach/pm-rmobile.h +++ b/arch/arm/mach-shmobile/pm-rmobile.h | |||
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index 0de75fd394b9..7ef9a0126780 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c | |||
@@ -25,9 +25,9 @@ | |||
25 | #include <asm/io.h> | 25 | #include <asm/io.h> |
26 | #include <asm/tlbflush.h> | 26 | #include <asm/tlbflush.h> |
27 | #include <asm/suspend.h> | 27 | #include <asm/suspend.h> |
28 | #include <mach/common.h> | ||
29 | #include <mach/sh7372.h> | 28 | #include <mach/sh7372.h> |
30 | #include <mach/pm-rmobile.h> | 29 | #include "common.h" |
30 | #include "pm-rmobile.h" | ||
31 | 31 | ||
32 | /* DBG */ | 32 | /* DBG */ |
33 | #define DBGREG1 IOMEM(0xe6100020) | 33 | #define DBGREG1 IOMEM(0xe6100020) |
diff --git a/arch/arm/mach-shmobile/pm-sh73a0.c b/arch/arm/mach-shmobile/pm-sh73a0.c index 99086e98fbbc..a7e466817965 100644 --- a/arch/arm/mach-shmobile/pm-sh73a0.c +++ b/arch/arm/mach-shmobile/pm-sh73a0.c | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/suspend.h> | 11 | #include <linux/suspend.h> |
12 | #include <mach/common.h> | 12 | #include "common.h" |
13 | 13 | ||
14 | #ifdef CONFIG_SUSPEND | 14 | #ifdef CONFIG_SUSPEND |
15 | static int sh73a0_enter_suspend(suspend_state_t suspend_state) | 15 | static int sh73a0_enter_suspend(suspend_state_t suspend_state) |
diff --git a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h index 43f606eb2d82..ce53cb5f53a1 100644 --- a/arch/arm/mach-shmobile/include/mach/rcar-gen2.h +++ b/arch/arm/mach-shmobile/rcar-gen2.h | |||
@@ -4,5 +4,6 @@ | |||
4 | void rcar_gen2_timer_init(void); | 4 | void rcar_gen2_timer_init(void); |
5 | #define MD(nr) BIT(nr) | 5 | #define MD(nr) BIT(nr) |
6 | u32 rcar_gen2_read_mode_pins(void); | 6 | u32 rcar_gen2_read_mode_pins(void); |
7 | void rcar_gen2_reserve(void); | ||
7 | 8 | ||
8 | #endif /* __ASM_RCAR_GEN2_H__ */ | 9 | #endif /* __ASM_RCAR_GEN2_H__ */ |
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index d953ff6e78a2..6e4ffa74dad4 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c | |||
@@ -20,10 +20,10 @@ | |||
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <mach/common.h> | ||
24 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
26 | #include "common.h" | ||
27 | 27 | ||
28 | static struct map_desc emev2_io_desc[] __initdata = { | 28 | static struct map_desc emev2_io_desc[] __initdata = { |
29 | #ifdef CONFIG_SMP | 29 | #ifdef CONFIG_SMP |
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c index 412e179429cd..17a74d355c5d 100644 --- a/arch/arm/mach-shmobile/setup-r7s72100.c +++ b/arch/arm/mach-shmobile/setup-r7s72100.c | |||
@@ -22,10 +22,10 @@ | |||
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
24 | #include <linux/sh_timer.h> | 24 | #include <linux/sh_timer.h> |
25 | #include <mach/common.h> | ||
26 | #include <mach/irqs.h> | ||
27 | #include <mach/r7s72100.h> | 25 | #include <mach/r7s72100.h> |
28 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
27 | #include "common.h" | ||
28 | #include "irqs.h" | ||
29 | 29 | ||
30 | static struct resource mtu2_resources[] __initdata = { | 30 | static struct resource mtu2_resources[] __initdata = { |
31 | DEFINE_RES_MEM(0xfcff0000, 0x400), | 31 | DEFINE_RES_MEM(0xfcff0000, 0x400), |
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c index 9333770cfac2..da94d9b9292e 100644 --- a/arch/arm/mach-shmobile/setup-r8a73a4.c +++ b/arch/arm/mach-shmobile/setup-r8a73a4.c | |||
@@ -24,11 +24,11 @@ | |||
24 | #include <linux/serial_sci.h> | 24 | #include <linux/serial_sci.h> |
25 | #include <linux/sh_dma.h> | 25 | #include <linux/sh_dma.h> |
26 | #include <linux/sh_timer.h> | 26 | #include <linux/sh_timer.h> |
27 | #include <mach/common.h> | ||
28 | #include <mach/dma-register.h> | ||
29 | #include <mach/irqs.h> | ||
30 | #include <mach/r8a73a4.h> | 27 | #include <mach/r8a73a4.h> |
31 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
29 | #include "common.h" | ||
30 | #include "dma-register.h" | ||
31 | #include "irqs.h" | ||
32 | 32 | ||
33 | static const struct resource pfc_resources[] = { | 33 | static const struct resource pfc_resources[] = { |
34 | DEFINE_RES_MEM(0xe6050000, 0x9000), | 34 | DEFINE_RES_MEM(0xe6050000, 0x9000), |
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 35dec233301e..10170b3560c2 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -31,15 +31,15 @@ | |||
31 | #include <linux/sh_dma.h> | 31 | #include <linux/sh_dma.h> |
32 | #include <linux/sh_timer.h> | 32 | #include <linux/sh_timer.h> |
33 | #include <linux/platform_data/sh_ipmmu.h> | 33 | #include <linux/platform_data/sh_ipmmu.h> |
34 | #include <mach/dma-register.h> | ||
35 | #include <mach/r8a7740.h> | 34 | #include <mach/r8a7740.h> |
36 | #include <mach/pm-rmobile.h> | ||
37 | #include <mach/common.h> | ||
38 | #include <mach/irqs.h> | ||
39 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
40 | #include <asm/mach/map.h> | 36 | #include <asm/mach/map.h> |
41 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
42 | #include <asm/mach/time.h> | 38 | #include <asm/mach/time.h> |
39 | #include "common.h" | ||
40 | #include "dma-register.h" | ||
41 | #include "irqs.h" | ||
42 | #include "pm-rmobile.h" | ||
43 | 43 | ||
44 | static struct map_desc r8a7740_io_desc[] __initdata = { | 44 | static struct map_desc r8a7740_io_desc[] __initdata = { |
45 | /* | 45 | /* |
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index d311ef903b39..d9f4529d8e40 100644 --- a/arch/arm/mach-shmobile/setup-r8a7778.c +++ b/arch/arm/mach-shmobile/setup-r8a7778.c | |||
@@ -37,11 +37,11 @@ | |||
37 | #include <linux/usb/ehci_pdriver.h> | 37 | #include <linux/usb/ehci_pdriver.h> |
38 | #include <linux/usb/ohci_pdriver.h> | 38 | #include <linux/usb/ohci_pdriver.h> |
39 | #include <linux/dma-mapping.h> | 39 | #include <linux/dma-mapping.h> |
40 | #include <mach/irqs.h> | ||
41 | #include <mach/r8a7778.h> | 40 | #include <mach/r8a7778.h> |
42 | #include <mach/common.h> | ||
43 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
44 | #include <asm/hardware/cache-l2x0.h> | 42 | #include <asm/hardware/cache-l2x0.h> |
43 | #include "common.h" | ||
44 | #include "irqs.h" | ||
45 | 45 | ||
46 | /* SCIF */ | 46 | /* SCIF */ |
47 | #define R8A7778_SCIF(index, baseaddr, irq) \ | 47 | #define R8A7778_SCIF(index, baseaddr, irq) \ |
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index aba4ed652d54..86ec4b625a78 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
@@ -40,14 +40,14 @@ | |||
40 | #include <linux/usb/ehci_pdriver.h> | 40 | #include <linux/usb/ehci_pdriver.h> |
41 | #include <linux/usb/ohci_pdriver.h> | 41 | #include <linux/usb/ohci_pdriver.h> |
42 | #include <linux/pm_runtime.h> | 42 | #include <linux/pm_runtime.h> |
43 | #include <mach/irqs.h> | ||
44 | #include <mach/r8a7779.h> | 43 | #include <mach/r8a7779.h> |
45 | #include <mach/common.h> | ||
46 | #include <asm/mach-types.h> | 44 | #include <asm/mach-types.h> |
47 | #include <asm/mach/arch.h> | 45 | #include <asm/mach/arch.h> |
48 | #include <asm/mach/time.h> | 46 | #include <asm/mach/time.h> |
49 | #include <asm/mach/map.h> | 47 | #include <asm/mach/map.h> |
50 | #include <asm/hardware/cache-l2x0.h> | 48 | #include <asm/hardware/cache-l2x0.h> |
49 | #include "common.h" | ||
50 | #include "irqs.h" | ||
51 | 51 | ||
52 | static struct map_desc r8a7779_io_desc[] __initdata = { | 52 | static struct map_desc r8a7779_io_desc[] __initdata = { |
53 | /* 2M entity map for 0xf0000000 (MPCORE) */ | 53 | /* 2M entity map for 0xf0000000 (MPCORE) */ |
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index 6bd08b127fa4..e1907686ace4 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c | |||
@@ -26,11 +26,12 @@ | |||
26 | #include <linux/serial_sci.h> | 26 | #include <linux/serial_sci.h> |
27 | #include <linux/sh_dma.h> | 27 | #include <linux/sh_dma.h> |
28 | #include <linux/sh_timer.h> | 28 | #include <linux/sh_timer.h> |
29 | #include <mach/common.h> | ||
30 | #include <mach/dma-register.h> | ||
31 | #include <mach/irqs.h> | ||
32 | #include <mach/r8a7790.h> | 29 | #include <mach/r8a7790.h> |
33 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | #include "common.h" | ||
32 | #include "dma-register.h" | ||
33 | #include "irqs.h" | ||
34 | #include "rcar-gen2.h" | ||
34 | 35 | ||
35 | /* Audio-DMAC */ | 36 | /* Audio-DMAC */ |
36 | #define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \ | 37 | #define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \ |
@@ -325,6 +326,8 @@ DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)") | |||
325 | .smp = smp_ops(r8a7790_smp_ops), | 326 | .smp = smp_ops(r8a7790_smp_ops), |
326 | .init_early = r8a7790_init_early, | 327 | .init_early = r8a7790_init_early, |
327 | .init_time = rcar_gen2_timer_init, | 328 | .init_time = rcar_gen2_timer_init, |
329 | .init_late = shmobile_init_late, | ||
330 | .reserve = rcar_gen2_reserve, | ||
328 | .dt_compat = r8a7790_boards_compat_dt, | 331 | .dt_compat = r8a7790_boards_compat_dt, |
329 | MACHINE_END | 332 | MACHINE_END |
330 | #endif /* CONFIG_USE_OF */ | 333 | #endif /* CONFIG_USE_OF */ |
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index 04a96ddb3224..7e970d005f7f 100644 --- a/arch/arm/mach-shmobile/setup-r8a7791.c +++ b/arch/arm/mach-shmobile/setup-r8a7791.c | |||
@@ -26,11 +26,11 @@ | |||
26 | #include <linux/platform_data/irq-renesas-irqc.h> | 26 | #include <linux/platform_data/irq-renesas-irqc.h> |
27 | #include <linux/serial_sci.h> | 27 | #include <linux/serial_sci.h> |
28 | #include <linux/sh_timer.h> | 28 | #include <linux/sh_timer.h> |
29 | #include <mach/common.h> | ||
30 | #include <mach/irqs.h> | ||
31 | #include <mach/r8a7791.h> | 29 | #include <mach/r8a7791.h> |
32 | #include <mach/rcar-gen2.h> | ||
33 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | #include "common.h" | ||
32 | #include "irqs.h" | ||
33 | #include "rcar-gen2.h" | ||
34 | 34 | ||
35 | static const struct resource pfc_resources[] __initconst = { | 35 | static const struct resource pfc_resources[] __initconst = { |
36 | DEFINE_RES_MEM(0xe6060000, 0x250), | 36 | DEFINE_RES_MEM(0xe6060000, 0x250), |
@@ -217,6 +217,8 @@ DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") | |||
217 | .smp = smp_ops(r8a7791_smp_ops), | 217 | .smp = smp_ops(r8a7791_smp_ops), |
218 | .init_early = shmobile_init_delay, | 218 | .init_early = shmobile_init_delay, |
219 | .init_time = rcar_gen2_timer_init, | 219 | .init_time = rcar_gen2_timer_init, |
220 | .init_late = shmobile_init_late, | ||
221 | .reserve = rcar_gen2_reserve, | ||
220 | .dt_compat = r8a7791_boards_compat_dt, | 222 | .dt_compat = r8a7791_boards_compat_dt, |
221 | MACHINE_END | 223 | MACHINE_END |
222 | #endif /* CONFIG_USE_OF */ | 224 | #endif /* CONFIG_USE_OF */ |
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 542c5a47173f..73fb2a659d9f 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c | |||
@@ -20,11 +20,14 @@ | |||
20 | 20 | ||
21 | #include <linux/clk/shmobile.h> | 21 | #include <linux/clk/shmobile.h> |
22 | #include <linux/clocksource.h> | 22 | #include <linux/clocksource.h> |
23 | #include <linux/device.h> | ||
24 | #include <linux/dma-contiguous.h> | ||
23 | #include <linux/io.h> | 25 | #include <linux/io.h> |
24 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
25 | #include <mach/common.h> | 27 | #include <linux/of_fdt.h> |
26 | #include <mach/rcar-gen2.h> | ||
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
29 | #include "common.h" | ||
30 | #include "rcar-gen2.h" | ||
28 | 31 | ||
29 | #define MODEMR 0xe6160060 | 32 | #define MODEMR 0xe6160060 |
30 | 33 | ||
@@ -110,3 +113,72 @@ void __init rcar_gen2_timer_init(void) | |||
110 | #endif | 113 | #endif |
111 | clocksource_of_init(); | 114 | clocksource_of_init(); |
112 | } | 115 | } |
116 | |||
117 | struct memory_reserve_config { | ||
118 | u64 reserved; | ||
119 | u64 base, size; | ||
120 | }; | ||
121 | |||
122 | static int __init rcar_gen2_scan_mem(unsigned long node, const char *uname, | ||
123 | int depth, void *data) | ||
124 | { | ||
125 | const char *type = of_get_flat_dt_prop(node, "device_type", NULL); | ||
126 | const __be32 *reg, *endp; | ||
127 | int l; | ||
128 | struct memory_reserve_config *mrc = data; | ||
129 | u64 lpae_start = 1ULL << 32; | ||
130 | |||
131 | /* We are scanning "memory" nodes only */ | ||
132 | if (type == NULL || strcmp(type, "memory")) | ||
133 | return 0; | ||
134 | |||
135 | reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l); | ||
136 | if (reg == NULL) | ||
137 | reg = of_get_flat_dt_prop(node, "reg", &l); | ||
138 | if (reg == NULL) | ||
139 | return 0; | ||
140 | |||
141 | endp = reg + (l / sizeof(__be32)); | ||
142 | while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) { | ||
143 | u64 base, size; | ||
144 | |||
145 | base = dt_mem_next_cell(dt_root_addr_cells, ®); | ||
146 | size = dt_mem_next_cell(dt_root_size_cells, ®); | ||
147 | |||
148 | if (base >= lpae_start) | ||
149 | continue; | ||
150 | |||
151 | if ((base + size) >= lpae_start) | ||
152 | size = lpae_start - base; | ||
153 | |||
154 | if (size < mrc->reserved) | ||
155 | continue; | ||
156 | |||
157 | if (base < mrc->base) | ||
158 | continue; | ||
159 | |||
160 | /* keep the area at top near the 32-bit legacy limit */ | ||
161 | mrc->base = base + size - mrc->reserved; | ||
162 | mrc->size = mrc->reserved; | ||
163 | } | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | |||
168 | struct cma *rcar_gen2_dma_contiguous; | ||
169 | |||
170 | void __init rcar_gen2_reserve(void) | ||
171 | { | ||
172 | struct memory_reserve_config mrc; | ||
173 | |||
174 | /* reserve 256 MiB at the top of the physical legacy 32-bit space */ | ||
175 | memset(&mrc, 0, sizeof(mrc)); | ||
176 | mrc.reserved = SZ_256M; | ||
177 | |||
178 | of_scan_flat_dt(rcar_gen2_scan_mem, &mrc); | ||
179 | #ifdef CONFIG_DMA_CMA | ||
180 | if (mrc.size) | ||
181 | dma_contiguous_reserve_area(mrc.size, mrc.base, 0, | ||
182 | &rcar_gen2_dma_contiguous); | ||
183 | #endif | ||
184 | } | ||
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 2a8b9f2a2f54..5571f867c611 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c | |||
@@ -29,19 +29,19 @@ | |||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/serial_sci.h> | 30 | #include <linux/serial_sci.h> |
31 | #include <linux/sh_dma.h> | 31 | #include <linux/sh_dma.h> |
32 | #include <linux/sh_intc.h> | ||
33 | #include <linux/sh_timer.h> | 32 | #include <linux/sh_timer.h> |
34 | #include <linux/pm_domain.h> | 33 | #include <linux/pm_domain.h> |
35 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
36 | #include <linux/platform_data/sh_ipmmu.h> | 35 | #include <linux/platform_data/sh_ipmmu.h> |
37 | #include <mach/dma-register.h> | ||
38 | #include <mach/irqs.h> | ||
39 | #include <mach/sh7372.h> | 36 | #include <mach/sh7372.h> |
40 | #include <mach/common.h> | ||
41 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
42 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
43 | #include <asm/mach/arch.h> | 39 | #include <asm/mach/arch.h> |
44 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
41 | #include "common.h" | ||
42 | #include "dma-register.h" | ||
43 | #include "irqs.h" | ||
44 | #include "pm-rmobile.h" | ||
45 | 45 | ||
46 | static struct map_desc sh7372_io_desc[] __initdata = { | 46 | static struct map_desc sh7372_io_desc[] __initdata = { |
47 | /* create a 1:1 entity map for 0xe6xxxxxx | 47 | /* create a 1:1 entity map for 0xe6xxxxxx |
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index ad00724a2269..b30bbee6dc65 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c | |||
@@ -29,18 +29,17 @@ | |||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <linux/serial_sci.h> | 30 | #include <linux/serial_sci.h> |
31 | #include <linux/sh_dma.h> | 31 | #include <linux/sh_dma.h> |
32 | #include <linux/sh_intc.h> | ||
33 | #include <linux/sh_timer.h> | 32 | #include <linux/sh_timer.h> |
34 | #include <linux/platform_data/sh_ipmmu.h> | 33 | #include <linux/platform_data/sh_ipmmu.h> |
35 | #include <linux/platform_data/irq-renesas-intc-irqpin.h> | 34 | #include <linux/platform_data/irq-renesas-intc-irqpin.h> |
36 | #include <mach/dma-register.h> | ||
37 | #include <mach/irqs.h> | ||
38 | #include <mach/sh73a0.h> | 35 | #include <mach/sh73a0.h> |
39 | #include <mach/common.h> | ||
40 | #include <asm/mach-types.h> | 36 | #include <asm/mach-types.h> |
41 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
42 | #include <asm/mach/arch.h> | 38 | #include <asm/mach/arch.h> |
43 | #include <asm/mach/time.h> | 39 | #include <asm/mach/time.h> |
40 | #include "common.h" | ||
41 | #include "dma-register.h" | ||
42 | #include "irqs.h" | ||
44 | 43 | ||
45 | static struct map_desc sh73a0_io_desc[] __initdata = { | 44 | static struct map_desc sh73a0_io_desc[] __initdata = { |
46 | /* create a 1:1 entity map for 0xe6xxxxxx | 45 | /* create a 1:1 entity map for 0xe6xxxxxx |
diff --git a/arch/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c index 2dfd748da7f3..6ff1df1df9a7 100644 --- a/arch/arm/mach-shmobile/smp-emev2.c +++ b/arch/arm/mach-shmobile/smp-emev2.c | |||
@@ -23,9 +23,9 @@ | |||
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <mach/common.h> | ||
27 | #include <asm/smp_plat.h> | 26 | #include <asm/smp_plat.h> |
28 | #include <asm/smp_scu.h> | 27 | #include <asm/smp_scu.h> |
28 | #include "common.h" | ||
29 | 29 | ||
30 | #define EMEV2_SCU_BASE 0x1e000000 | 30 | #define EMEV2_SCU_BASE 0x1e000000 |
31 | #define EMEV2_SMU_BASE 0xe0110000 | 31 | #define EMEV2_SMU_BASE 0xe0110000 |
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index e7a3201473d0..c230fc0c3fef 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c | |||
@@ -23,13 +23,13 @@ | |||
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <mach/common.h> | ||
27 | #include <mach/pm-rcar.h> | ||
28 | #include <mach/r8a7779.h> | 26 | #include <mach/r8a7779.h> |
29 | #include <asm/cacheflush.h> | 27 | #include <asm/cacheflush.h> |
30 | #include <asm/smp_plat.h> | 28 | #include <asm/smp_plat.h> |
31 | #include <asm/smp_scu.h> | 29 | #include <asm/smp_scu.h> |
32 | #include <asm/smp_twd.h> | 30 | #include <asm/smp_twd.h> |
31 | #include "common.h" | ||
32 | #include "pm-rcar.h" | ||
33 | 33 | ||
34 | #define AVECR IOMEM(0xfe700040) | 34 | #define AVECR IOMEM(0xfe700040) |
35 | #define R8A7779_SCU_BASE 0xf0000000 | 35 | #define R8A7779_SCU_BASE 0xf0000000 |
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 591052799e8f..7590e2b6e2fa 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c | |||
@@ -18,9 +18,9 @@ | |||
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <asm/smp_plat.h> | 20 | #include <asm/smp_plat.h> |
21 | #include <mach/common.h> | ||
22 | #include <mach/pm-rcar.h> | ||
23 | #include <mach/r8a7790.h> | 21 | #include <mach/r8a7790.h> |
22 | #include "common.h" | ||
23 | #include "pm-rcar.h" | ||
24 | 24 | ||
25 | #define RST 0xe6160000 | 25 | #define RST 0xe6160000 |
26 | #define CA15BAR 0x0020 | 26 | #define CA15BAR 0x0020 |
@@ -69,6 +69,7 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) | |||
69 | 69 | ||
70 | /* turn on power to SCU */ | 70 | /* turn on power to SCU */ |
71 | r8a7790_pm_init(); | 71 | r8a7790_pm_init(); |
72 | shmobile_smp_apmu_suspend_init(); | ||
72 | rcar_sysc_power_up(&r8a7790_ca15_scu); | 73 | rcar_sysc_power_up(&r8a7790_ca15_scu); |
73 | rcar_sysc_power_up(&r8a7790_ca7_scu); | 74 | rcar_sysc_power_up(&r8a7790_ca7_scu); |
74 | } | 75 | } |
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index ec979529f30f..c6543b6ec759 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c | |||
@@ -18,9 +18,9 @@ | |||
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <asm/smp_plat.h> | 20 | #include <asm/smp_plat.h> |
21 | #include <mach/common.h> | ||
22 | #include <mach/r8a7791.h> | 21 | #include <mach/r8a7791.h> |
23 | #include <mach/rcar-gen2.h> | 22 | #include "common.h" |
23 | #include "rcar-gen2.h" | ||
24 | 24 | ||
25 | #define RST 0xe6160000 | 25 | #define RST 0xe6160000 |
26 | #define CA15BAR 0x0020 | 26 | #define CA15BAR 0x0020 |
@@ -50,6 +50,9 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) | |||
50 | writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, | 50 | writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, |
51 | p + CA15RESCNT); | 51 | p + CA15RESCNT); |
52 | iounmap(p); | 52 | iounmap(p); |
53 | |||
54 | r8a7791_pm_init(); | ||
55 | shmobile_smp_apmu_suspend_init(); | ||
53 | } | 56 | } |
54 | 57 | ||
55 | static int r8a7791_smp_boot_secondary(unsigned int cpu, | 58 | static int r8a7791_smp_boot_secondary(unsigned int cpu, |
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c index 13ba36a6831f..bf4aff99ed1c 100644 --- a/arch/arm/mach-shmobile/smp-sh73a0.c +++ b/arch/arm/mach-shmobile/smp-sh73a0.c | |||
@@ -22,10 +22,10 @@ | |||
22 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <mach/common.h> | ||
26 | #include <mach/sh73a0.h> | 25 | #include <mach/sh73a0.h> |
27 | #include <asm/smp_plat.h> | 26 | #include <asm/smp_plat.h> |
28 | #include <asm/smp_twd.h> | 27 | #include <asm/smp_twd.h> |
28 | #include "common.h" | ||
29 | 29 | ||
30 | #define WUPCR IOMEM(0xe6151010) | 30 | #define WUPCR IOMEM(0xe6151010) |
31 | #define SRESCR IOMEM(0xe6151018) | 31 | #define SRESCR IOMEM(0xe6151018) |