ARM: mach-shmobile: sh7372 clock framework support V2
Magnus Damm
maintainerPATCH 2/2 ARM: mach-shmobile: sh7372 clock framework support V2
From: Magnus Damm <[email protected]>
This patch is V2 of clock framework tables/code for sh7372. MSTP are included for KEYSC, SCIF, IIC, USB, SDHI and UIO.
Signed-off-by Magnus Damm <[email protected]>
---
arch/arm/mach-shmobile/Kconfig | 1 arch/arm/mach-shmobile/Makefile | 2 arch/arm/mach-shmobile/board-ap4evb.c | 16 - arch/arm/mach-shmobile/clock-sh7372.c | 387 ++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 1 arch/arm/mach-shmobile/setup-sh7372.c | 8 6 files changed, 404 insertions(+), 11 deletions(-)
arch/arm/mach-shmobile/Kconfig +1 -0
@@ -23,6 +23,7 @@ config ARCH_SH7372 select CPU_V7 select HAVE_CLK select COMMON_CLKDEV + select SH_CLK_CPG select GENERIC_TIME select GENERIC_CLOCKEVENTS
arch/arm/mach-shmobile/Makefile +1 -1
@@ -8,7 +8,7 @@ obj-y := timer.o console.o memory.o c # CPU objects obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7367.o intc-sh7377.o -obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7367.o intc-sh7372.o +obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o # Pinmux setup pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o
arch/arm/mach-shmobile/board-ap4evb.c +13 -3
@@ -39,6 +39,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> +#include <asm/mach/time.h> /* * Address Interface BusWidth note
@@ -328,9 +329,8 @@ static void __init ap4evb_map_io(void) {iotable_init (ap4evb_io_desc,ARRAY_SIZE (ap4evb_io_desc)); -/* setup early devices, clocks and console here as well */ +/* setup early devices and console here as well */ sh7372_add_early_devices (); -sh7367_clock_init ();/* use g3 clocks for now */ shmobile_setup_console (); }
@@ -419,11 +419,21 @@ static void __init ap4evb_init(void)platform_add_devices (ap4evb_devices,ARRAY_SIZE (ap4evb_devices)); } +static void __init ap4evb_timer_init (void ) +{ +sh7372_clock_init (); + shmobile_timer.init (); +} + +static struct sys_timer ap4evb_timer = { + .init = ap4evb_timer_init, +}; +MACHINE_START (AP4EVB ,"ap4evb" ) .phys_io = 0xe6000000, .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc, .map_io = ap4evb_map_io, .init_irq = sh7372_init_irq, .init_machine = ap4evb_init, - .timer = &shmobile_timer, + .timer = &ap4evb_timer,MACHINE_END
arch/arm/mach-shmobile/clock-sh7372.c new file +387 -0
387 lines not on this page · raw message
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -24,6 +24,7 @@ extern void sh7377_pinmux_init(void);extern void sh7372_init_irq (void );extern void sh7372_add_early_devices (void );extern void sh7372_add_standard_devices (void ); +extern void sh7372_clock_init (void );extern void sh7372_pinmux_init (void );#endif /* __ARCH_MACH_COMMON_H */
arch/arm/mach-shmobile/setup-sh7372.c +1 -7
@@ -145,7 +145,7 @@ static struct sh_timer_config cmt10_plat .name = "CMT10", .channel_offset = 0x10, .timer_bit = 0, - .clk = "r_clk", + .clk = "cmt1", .clockevent_rating = 125, .clocksource_rating = 125, };
@@ -490,14 +490,8 @@ void __init sh7372_add_standard_devices( ARRAY_SIZE(sh7372_devices)); } -#define SMSTPCR3 0xe615013c -#define SMSTPCR3_CMT1 (1 << 29) -void __init sh7372_add_early_devices (void ) { -/* enable clock to CMT1 */ -__raw_writel (__raw_readl (SMSTPCR3 ) & ~SMSTPCR3_CMT1 ,SMSTPCR3 ); -early_platform_add_devices (sh7372_early_devices,ARRAY_SIZE (sh7372_early_devices)); }