@@ -28,6 +28,8 @@ config ARCH_VEXPRESS_CA9X4
depends on VEXPRESS_ORIGINAL_MEMORY_MAP
select CPU_V7
select ARM_GIC
+ select LOCAL_TIMER_DEVICES
+ select ARM_SMP_TWD
select ARM_ERRATA_720789
select ARM_ERRATA_751472
select ARM_ERRATA_753970
@@ -15,7 +15,6 @@
#include <asm/hardware/gic.h>
#include <asm/pmu.h>
#include <asm/smp_scu.h>
-#include <asm/smp_twd.h>
#include <mach/ct-ca9x4.h>
@@ -49,11 +48,32 @@ static struct map_desc ct_ca9x4_io_desc[] __initdata = {
},
};
+static struct resource ct_ca9x4_twd_resources[] = {
+ {
+ .start = A9_MPCORE_TWD,
+ .end = A9_MPCORE_TWD + 0x10,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IRQ_LOCALTIMER,
+ .end = IRQ_LOCALTIMER,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device ct_ca9x4_twd_device = {
+ .name = "arm_smp_twd",
+ .id = -1,
+ .resource = ct_ca9x4_twd_resources,
+ .num_resources = ARRAY_SIZE(ct_ca9x4_twd_resources),
+};
+
+static struct platform_device *ct_ca9x4_early_devices[] = {
+ &ct_ca9x4_twd_device,
+};
+
static void __init ct_ca9x4_map_io(void)
{
-#ifdef CONFIG_LOCAL_TIMERS
- twd_base = MMIO_P2V(A9_MPCORE_TWD);
-#endif
iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
}
@@ -192,6 +212,8 @@ static struct platform_device pmu_device = {
static void __init ct_ca9x4_init_early(void)
{
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
+ early_platform_add_devices(ct_ca9x4_early_devices,
+ ARRAY_SIZE(ct_ca9x4_early_devices));
}
static void __init ct_ca9x4_init(void)
Convert the vexpress platform (actually the CA9x4 tile) to use the new arm_smp_twd driver. Add the platform device and register it as early platform device. Tested on a VExpress. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> --- arch/arm/mach-vexpress/Kconfig | 2 ++ arch/arm/mach-vexpress/ct-ca9x4.c | 30 ++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-)