From 7952717adb69efc1d2443a1858f96d23c2fb93e0 Mon Sep 17 00:00:00 2001 From: Tetsuyuki Kobayashi Date: Fri, 20 Jul 2012 15:16:30 +0900 Subject: ARM: shmobile: kzm9g: enable restarting Do soft-power-on-reset in sys_reboot system call. How to test this patch Execute "sudo reboot" from command line. The system will start shutdown sequence and finally reboot and U-Boot restarts. Cc: Nobuhiro Iwamatsu Cc: Kuninori Morimoto Signed-off-by: Tetsuyuki Kobayashi Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-kzm9g.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index 53b7ea92c32c..fd21fb6f9953 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c @@ -763,6 +763,13 @@ static void __init kzm_init(void) platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices)); } +static void kzm9g_restart(char mode, const char *cmd) +{ +#define RESCNT2 0xe6188020 + /* Do soft power on reset */ + writel((1 << 31), RESCNT2); +} + static const char *kzm9g_boards_compat_dt[] __initdata = { "renesas,kzm9g", NULL, @@ -777,5 +784,6 @@ DT_MACHINE_START(KZM9G_DT, "kzm9g") .init_machine = kzm_init, .init_late = shmobile_init_late, .timer = &shmobile_timer, + .restart = kzm9g_restart, .dt_compat = kzm9g_boards_compat_dt, MACHINE_END -- cgit v1.2.3-59-g8ed1b From 263510ec774b490dffbd0b8db7b723025cf560c9 Mon Sep 17 00:00:00 2001 From: Phil Edworthy Date: Mon, 6 Aug 2012 13:31:04 +0100 Subject: r8a7779: add SDHI clock support Signed-off-by: Phil Edworthy Tested-by: Kuninori Morimoto Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a7779.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index 339c62c824d5..3cafb6ab5e9a 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -86,11 +86,16 @@ static struct clk div4_clks[DIV4_NR] = { 0x0300, CLK_ENABLE_ON_INIT), }; -enum { MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, +enum { MSTP323, MSTP322, MSTP321, MSTP320, + MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, MSTP016, MSTP015, MSTP014, MSTP_NR }; static struct clk mstp_clks[MSTP_NR] = { + [MSTP323] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 23, 0), /* SDHI0 */ + [MSTP322] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 22, 0), /* SDHI1 */ + [MSTP321] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 21, 0), /* SDHI2 */ + [MSTP320] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR3, 20, 0), /* SDHI3 */ [MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), /* SCIF0 */ [MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), /* SCIF1 */ [MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), /* SCIF2 */ @@ -149,6 +154,10 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ + CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP323]), /* SDHI0 */ + CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ + CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ + CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP320]), /* SDHI3 */ }; void __init r8a7779_clock_init(void) -- cgit v1.2.3-59-g8ed1b From f23f5be0ed87f1c53420086c936385d0a80c7e4d Mon Sep 17 00:00:00 2001 From: Tetsuyuki Kobayashi Date: Thu, 6 Sep 2012 20:14:06 +0900 Subject: ARM: shmobile: sh73a0: enable PMU(Performance Monitoring Unit) This patch enables PMU(Performance Monitoring Unit) for sh73a0. Signed-off-by: Tetsuyuki Kobayashi Signed-off-by: Simon Horman --- arch/arm/configs/kzm9g_defconfig | 1 + arch/arm/mach-shmobile/setup-sh73a0.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig index 2388c8610627..5d0c66708960 100644 --- a/arch/arm/configs/kzm9g_defconfig +++ b/arch/arm/configs/kzm9g_defconfig @@ -14,6 +14,7 @@ CONFIG_NAMESPACES=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL_SYSCALL=y CONFIG_EMBEDDED=y +CONFIG_PERF_EVENTS=y CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_FORCE_LOAD=y diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c index d230af656fc9..38ed2ddd3265 100644 --- a/arch/arm/mach-shmobile/setup-sh73a0.c +++ b/arch/arm/mach-shmobile/setup-sh73a0.c @@ -734,6 +734,26 @@ static struct platform_device mpdma0_device = { }, }; +static struct resource pmu_resources[] = { + [0] = { + .start = gic_spi(55), + .end = gic_spi(55), + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = gic_spi(56), + .end = gic_spi(56), + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device pmu_device = { + .name = "arm-pmu", + .id = -1, + .num_resources = ARRAY_SIZE(pmu_resources), + .resource = pmu_resources, +}; + static struct platform_device *sh73a0_early_devices[] __initdata = { &scif0_device, &scif1_device, @@ -757,6 +777,7 @@ static struct platform_device *sh73a0_late_devices[] __initdata = { &i2c4_device, &dma0_device, &mpdma0_device, + &pmu_device, }; #define SRCR2 0xe61580b0 -- cgit v1.2.3-59-g8ed1b From e433d4440bf7dd5955a4616cfb9bffd1ec6ab839 Mon Sep 17 00:00:00 2001 From: Tetsuyuki Kobayashi Date: Thu, 6 Sep 2012 20:14:07 +0900 Subject: ARM: shmobile: emev2: enable PMU(Performance Monitoring Unit) This patch enables PMU(Performance Monitoring Unit) for emev2. Signed-off-by: Tetsuyuki Kobayashi Signed-off-by: Simon Horman --- arch/arm/configs/kzm9d_defconfig | 1 + arch/arm/mach-shmobile/setup-emev2.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/configs/kzm9d_defconfig b/arch/arm/configs/kzm9d_defconfig index 26146ffea1a5..8c49df66cac3 100644 --- a/arch/arm/configs/kzm9d_defconfig +++ b/arch/arm/configs/kzm9d_defconfig @@ -8,6 +8,7 @@ CONFIG_LOG_BUF_SHIFT=16 CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL_SYSCALL=y CONFIG_EMBEDDED=y +CONFIG_PERF_EVENTS=y CONFIG_SLAB=y # CONFIG_BLK_DEV_BSG is not set # CONFIG_IOSCHED_DEADLINE is not set diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index dae9aa68bb09..61446f30e397 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c @@ -356,6 +356,26 @@ static struct platform_device gio4_device = { }, }; +static struct resource pmu_resources[] = { + [0] = { + .start = 152, + .end = 152, + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = 153, + .end = 153, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device pmu_device = { + .name = "arm-pmu", + .id = -1, + .num_resources = ARRAY_SIZE(pmu_resources), + .resource = pmu_resources, +}; + static struct platform_device *emev2_early_devices[] __initdata = { &uart0_device, &uart1_device, @@ -370,6 +390,7 @@ static struct platform_device *emev2_late_devices[] __initdata = { &gio2_device, &gio3_device, &gio4_device, + &pmu_device, }; void __init emev2_add_standard_devices(void) -- cgit v1.2.3-59-g8ed1b From 28901c1fed11dfeab65f640878e85a9b61d311ed Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Sun, 23 Sep 2012 22:41:21 +0000 Subject: ARM: shmobile: add new __iomem annotation for new code While we fixed up all instances that were already present in v3.6, this one came in through new code. Without this patch, building kzm9g_defconfig results in: arch/arm/mach-shmobile/board-kzm9g.c: In function 'kzm9g_restart': arch/arm/mach-shmobile/board-kzm9g.c:781:2: warning: passing argument 2 of '__raw_writel' makes pointer from integer without a cast [enabled by default] Signed-off-by: Arnd Bergmann Cc: Nobuhiro Iwamatsu Cc: Kuninori Morimoto Cc: Tetsuyuki Kobayashi Cc: Simon Horman --- arch/arm/mach-shmobile/board-kzm9g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index fd21fb6f9953..5d792e475306 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c @@ -765,7 +765,7 @@ static void __init kzm_init(void) static void kzm9g_restart(char mode, const char *cmd) { -#define RESCNT2 0xe6188020 +#define RESCNT2 IOMEM(0xe6188020) /* Do soft power on reset */ writel((1 << 31), RESCNT2); } -- cgit v1.2.3-59-g8ed1b