ARM: mach-shmobile: initial sh7377 clock framework
Magnus Damm
maintainerPATCH 1/1 ARM: mach-shmobile: initial sh7377 clock framework
From: Magnus Damm <[email protected]>
Add initial sh7377 clock framework support to SH-Mobile ARM. The implementation is far from complete but is enough to dynamically deal with module stop bits for CMT1, SDHI and KEYSC.
The peripheral clock is kept as a static dummy clock to satisfy the code in sh-sci.c.
Clock parent selection and support for the rest of the module stop bits are still on the TODO.
Also, move the clock framework init time to later to deal with the fact that the new clock framework code is using kmalloc().
---
Applies on top of the earlier clock framework patches.
arch/arm/mach-shmobile/Kconfig | 2 arch/arm/mach-shmobile/Makefile | 2 arch/arm/mach-shmobile/board-g4evm.c | 19 + arch/arm/mach-shmobile/clock-sh7377.c | 283 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 5 files changed, 299 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/Kconfig +1 -1
@@ -14,7 +14,7 @@ config ARCH_SH7377 bool "SH-Mobile G4 (SH7377)" select CPU_V7 select HAVE_CLK - select COMMON_CLKDEV + select SH_CLK_CPG select GENERIC_TIME select GENERIC_CLOCKEVENTS
arch/arm/mach-shmobile/Makefile +14 -7
@@ -12,7 +12,7 @@ obj-$(CONFIG_ARCH_SH7372) += setup-sh737 # Clock framework clk-$(CONFIG_ARCH_SH7367) +-clk-$(CONFIG_ARCH_SH7377) ++clk-$(CONFIG_ARCH_SH7377) += clock-sh7377.o clk-$(CONFIG_ARCH_SH7372) += clock-sh7372.o obj-$(CONFIG_SH_CLK_CPG) += $(clk-y) clock.o --- 0001/arch/arm/mach-shmobile/board-g4evm.c +++ work/arch/arm/mach-shmobile/board-g4evm.c 2010-03-31 21:56:22.000000000 +0900
@@ -36,6 +36,7 @@ #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> +#include <asm/mach/time.h> static struct mtd_partition nor_flash_partitions[] = { {
@@ -191,9 +192,8 @@ static void __init g4evm_map_io(void) { iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc)); - /* setup early devices, clocks and console here as well */ + /* setup early devices and console here as well */ sh7377_add_early_devices(); - sh7367_clock_init(); /* use g3 clocks for now */ shmobile_setup_console(); }
@@ -229,9 +229,6 @@ static void __init g4evm_init(void) gpio_request(GPIO_FN_EXTLP, NULL); gpio_request(GPIO_FN_IDIN, NULL); - /* enable clock in SMSTPCR3 */ - __raw_writel(__raw_readl(0xe615013c) & ~(1 << 22), 0xe615013c); - /* setup USB phy */ __raw_writew(0x0200, 0xe605810a); /* USBCR1 */ __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
@@ -258,11 +255,21 @@ static void __init g4evm_init(void) platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices)); } +static void __init g4evm_timer_init(void) +{ + sh7377_clock_init(); + shmobile_timer.init(); +} + +static struct sys_timer g4evm_timer = { + .init = g4evm_timer_init, +}; + MACHINE_START(G4EVM, "g4evm") .phys_io = 0xe6000000, .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc, .map_io = g4evm_map_io, .init_irq = sh7377_init_irq, .init_machine = g4evm_init, - .timer = &shmobile_timer, + .timer = &g4evm_timer, MACHINE_END
arch/arm/mach-shmobile/clock-sh7377.c new file +283 -0
283 lines not on this page · raw message
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -13,6 +13,7 @@ extern void sh7367_pinmux_init(void);extern void sh7377_init_irq (void );extern void sh7377_add_early_devices (void );extern void sh7377_add_standard_devices (void ); +extern void sh7377_clock_init (void );extern void sh7377_pinmux_init (void );extern void sh7372_init_irq (void );
Magnus Damm
maintainerPATCH 1/1 ARM: mach-shmobile: initial sh7367 clock framework
From: Magnus Damm <[email protected]>
Add initial sh7367 clock framework support to SH-Mobile ARM. The implementation is far from complete but is enough to dynamically deal with module stop bits for CMT1, SDHI and KEYSC.
The peripheral clock is kept as a static dummy clock to satisfy the code in sh-sci.c.
Clock parent selection and support for the rest of the module stop bits are still on the TODO.
Also, move the clock framework init time to later to deal with the fact that the new clock framework code is using kmalloc().
As this is the last processor that depends on the clkdev code, also remove the clkdev.h header.
---
Applies on top of the earlier clock framework patches.
arch/arm/mach-shmobile/Kconfig | 2 arch/arm/mach-shmobile/Makefile | 4 arch/arm/mach-shmobile/board-g3evm.c | 19 + arch/arm/mach-shmobile/clock-sh7367.c | 274 ++++++++++++++++++++------ arch/arm/mach-shmobile/include/mach/clkdev.h | 7 5 files changed, 235 insertions(+), 71 deletions(-)
arch/arm/mach-shmobile/Kconfig +1 -1
@@ -6,7 +6,7 @@ config ARCH_SH7367 bool "SH-Mobile G3 (SH7367)" select CPU_V6 select HAVE_CLK - select COMMON_CLKDEV + select SH_CLK_CPG select GENERIC_TIME select GENERIC_CLOCKEVENTS
arch/arm/mach-shmobile/Makefile +0 -3
@@ -11,13 +11,11 @@ obj-$(CONFIG_ARCH_SH7377) += setup-sh737 obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o # Clock framework -clk-$(CONFIG_ARCH_SH7367) ++clk-$(CONFIG_ARCH_SH7367) += clock-sh7367.o clk-$(CONFIG_ARCH_SH7377) += clock-sh7377.o clk-$(CONFIG_ARCH_SH7372) += clock-sh7372.o obj-$(CONFIG_SH_CLK_CPG) += $(clk-y) clock.o -obj-$(CONFIG_COMMON_CLKDEV) += clock-sh7367.o - # Pinmux setup pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o pfc-$(CONFIG_ARCH_SH7377) := pfc-sh7377.o
arch/arm/mach-shmobile/board-g3evm.c +13 -6
@@ -37,6 +37,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> +#include <asm/mach/time.h> static struct mtd_partition nor_flash_partitions[] = { {
@@ -232,9 +233,8 @@ static void __init g3evm_map_io(void) {iotable_init (g3evm_io_desc,ARRAY_SIZE (g3evm_io_desc)); -/* setup early devices, clocks and console here as well */ +/* setup early devices and console here as well */ sh7367_add_early_devices (); -sh7367_clock_init ();shmobile_setup_console (); }
@@ -271,9 +271,6 @@ static void __init g3evm_init(void)gpio_request (GPIO_FN_EXTLP ,NULL );gpio_request (GPIO_FN_IDIN ,NULL ); -/* enable clock in SYMSTPCR2 */ -__raw_writel (__raw_readl (0xe6158048 ) & ~(1 <<22 ),0xe6158048 ); -/* setup USB phy */ __raw_writew (0x0300 ,0xe605810a );/* USBCR1 */ __raw_writew (0x00e0 ,0xe60581c0 );/* CPFCH */
@@ -323,11 +320,21 @@ static void __init g3evm_init(void)platform_add_devices (g3evm_devices,ARRAY_SIZE (g3evm_devices)); } +static void __init g3evm_timer_init (void ) +{ +sh7367_clock_init (); + shmobile_timer.init (); +} + +static struct sys_timer g3evm_timer = { + .init = g3evm_timer_init, +}; +MACHINE_START (G3EVM ,"g3evm" ) .phys_io = 0xe6000000, .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc, .map_io = g3evm_map_io, .init_irq = sh7367_init_irq, .init_machine = g3evm_init, - .timer = &shmobile_timer, + .timer = &g3evm_timer,MACHINE_END
arch/arm/mach-shmobile/clock-sh7367.c +220 -54
311 lines not on this page · raw message
arch/arm/mach-shmobile/include/mach/clkdev.h deleted +0 -7
@@ -1,7 +0,0 @@ -#ifndef __ASM_MACH_CLKDEV_H -#define __ASM_MACH_CLKDEV_H - -int __clk_get (struct clk *clk); -void __clk_put (struct clk *clk); - -#endif /* __ASM_MACH_CLKDEV_H */