diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 51051750969e52..10fede16c588fc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -320,6 +320,8 @@ config ARCH_BCM2708 bool "Broadcom BCM2708 family" select CPU_V6 select ARM_AMBA + select CLKSRC_MMIO + select CLKSRC_OF if OF select HAVE_SCHED_CLOCK select NEED_MACH_GPIO_H select NEED_MACH_MEMORY_H diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi index 0d474273877f30..57d4c5680df98d 100644 --- a/arch/arm/boot/dts/bcm2708.dtsi +++ b/arch/arm/boot/dts/bcm2708.dtsi @@ -12,6 +12,13 @@ soc { ranges = <0x7e000000 0x20000000 0x01000000>; + timer@7e003000 { + compatible = "brcm,bcm2835-system-timer"; + reg = <0x7e003000 0x1000>; + interrupts = <1 0>, <1 1>, <1 2>, <1 3>; + clock-frequency = <1000000>; + }; + arm-pmu { compatible = "arm,arm1176-pmu"; }; diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c index 937c2d30b8e336..08d278647085d9 100644 --- a/arch/arm/mach-bcm2708/bcm2708.c +++ b/arch/arm/mach-bcm2708/bcm2708.c @@ -843,7 +843,6 @@ static void __init bcm2708_dt_init(void) { int ret; - of_clk_init(NULL); ret = of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); if (ret) { pr_err("of_platform_populate failed: %d\n", ret); @@ -1043,6 +1042,12 @@ static struct delay_timer bcm2708_delay_timer = { static void __init bcm2708_timer_init(void) { + if (of_have_populated_dt()) { + of_clk_init(NULL); + clocksource_of_init(); + return; + } + /* init high res timer */ bcm2708_clocksource_init(); diff --git a/arch/arm/mach-bcm2708/include/mach/platform.h b/arch/arm/mach-bcm2708/include/mach/platform.h index 69674e92fec517..0c57a5786ac306 100644 --- a/arch/arm/mach-bcm2708/include/mach/platform.h +++ b/arch/arm/mach-bcm2708/include/mach/platform.h @@ -183,7 +183,6 @@ #define MAXIRQNUM (32 + 32 + 20) #define MAXFIQNUM (32 + 32 + 20) -#define MAX_TIMER 2 #define MAX_PERIOD 699050 #define TICKS_PER_uSEC 1 diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index f228354961ca6f..6712c515d4e6b3 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -19,7 +19,7 @@ obj-$(CONFIG_CLKSRC_NOMADIK_MTU) += nomadik-mtu.o obj-$(CONFIG_CLKSRC_DBX500_PRCMU) += clksrc-dbx500-prcmu.o obj-$(CONFIG_ARMADA_370_XP_TIMER) += time-armada-370-xp.o obj-$(CONFIG_ORION_TIMER) += time-orion.o -obj-$(CONFIG_ARCH_BCM2835) += bcm2835_timer.o +obj-$(CONFIG_ARCH_BCM2835)$(CONFIG_ARCH_BCM2708) += bcm2835_timer.o obj-$(CONFIG_ARCH_CLPS711X) += clps711x-timer.o obj-$(CONFIG_ARCH_ATLAS7) += timer-atlas7.o obj-$(CONFIG_ARCH_MOXART) += moxart_timer.o