Commit 4312a7ef authored by Stephen Boyd's avatar Stephen Boyd Committed by David Brown
Browse files

ARM: msm: Allow timer.c to compile on multiple targets



The timer code relies on #defines from mach/iomap.h, cpu_is_*()
checks, and a global irq #define. All this makes this file
impossible to compile in a mult-target build. Therefore, make a
sys_timer struct for each SoC so that machine descriptors can
reference the correct timer. Then go through and replace all the
defines with raw values that are passed to a common
initialization function.

This paves the way to adding DT support to this code as well as
allows us to compile this file on multiple targets at the same
time.

Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarDavid Brown <davidb@codeaurora.org>
parent 66a89509
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include <linux/mtd/partitions.h>

#include "devices.h"
#include "common.h"

static struct resource smc91x_resources[] = {
	[0] = {
@@ -66,8 +67,6 @@ static struct platform_device *devices[] __initdata = {
	&smc91x_device,
};

extern struct sys_timer msm_timer;

static void __init halibut_init_early(void)
{
	arch_ioremap_caller = __msm_ioremap_caller;
@@ -107,5 +106,5 @@ MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
	.init_irq	= halibut_init_irq,
	.init_machine	= halibut_init,
	.init_late	= halibut_init_late,
	.timer		= &msm_timer,
	.timer		= &msm7x01_timer,
MACHINE_END
+4 −5
Original line number Diff line number Diff line
@@ -38,8 +38,7 @@
#include "devices.h"
#include "gpiomux.h"
#include "proc_comm.h"

extern struct sys_timer msm_timer;
#include "common.h"

static void __init msm7x30_fixup(struct tag *tag, char **cmdline,
		struct meminfo *mi)
@@ -132,7 +131,7 @@ MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
	.init_irq = msm7x30_init_irq,
	.init_machine = msm7x30_init,
	.init_late = msm7x30_init_late,
	.timer = &msm_timer,
	.timer = &msm7x30_timer,
MACHINE_END

MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
@@ -143,7 +142,7 @@ MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
	.init_irq = msm7x30_init_irq,
	.init_machine = msm7x30_init,
	.init_late = msm7x30_init_late,
	.timer = &msm_timer,
	.timer = &msm7x30_timer,
MACHINE_END

MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
@@ -154,5 +153,5 @@ MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
	.init_irq = msm7x30_init_irq,
	.init_machine = msm7x30_init,
	.init_late = msm7x30_init_late,
	.timer = &msm_timer,
	.timer = &msm7x30_timer,
MACHINE_END
+3 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <mach/msm_iomap.h>

#include "devices.h"
#include "common.h"

static void __init msm8960_fixup(struct tag *tag, char **cmdline,
		struct meminfo *mi)
@@ -90,7 +91,7 @@ MACHINE_START(MSM8960_SIM, "QCT MSM8960 SIMULATOR")
	.reserve = msm8960_reserve,
	.map_io = msm8960_map_io,
	.init_irq = msm8960_init_irq,
	.timer = &msm_timer,
	.timer = &msm8960_timer,
	.handle_irq = gic_handle_irq,
	.init_machine = msm8960_sim_init,
	.init_late = msm8960_init_late,
@@ -101,7 +102,7 @@ MACHINE_START(MSM8960_RUMI3, "QCT MSM8960 RUMI3")
	.reserve = msm8960_reserve,
	.map_io = msm8960_map_io,
	.init_irq = msm8960_init_irq,
	.timer = &msm_timer,
	.timer = &msm8960_timer,
	.handle_irq = gic_handle_irq,
	.init_machine = msm8960_rumi3_init,
	.init_late = msm8960_init_late,
+6 −5
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

#include <mach/board.h>
#include <mach/msm_iomap.h>
#include "common.h"

static void __init msm8x60_fixup(struct tag *tag, char **cmdline,
		struct meminfo *mi)
@@ -114,7 +115,7 @@ MACHINE_START(MSM8X60_RUMI3, "QCT MSM8X60 RUMI3")
	.handle_irq = gic_handle_irq,
	.init_machine = msm8x60_init,
	.init_late = msm8x60_init_late,
	.timer = &msm_timer,
	.timer = &msm8x60_timer,
MACHINE_END

MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
@@ -125,7 +126,7 @@ MACHINE_START(MSM8X60_SURF, "QCT MSM8X60 SURF")
	.handle_irq = gic_handle_irq,
	.init_machine = msm8x60_init,
	.init_late = msm8x60_init_late,
	.timer = &msm_timer,
	.timer = &msm8x60_timer,
MACHINE_END

MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
@@ -136,7 +137,7 @@ MACHINE_START(MSM8X60_SIM, "QCT MSM8X60 SIMULATOR")
	.handle_irq = gic_handle_irq,
	.init_machine = msm8x60_init,
	.init_late = msm8x60_init_late,
	.timer = &msm_timer,
	.timer = &msm8x60_timer,
MACHINE_END

MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
@@ -147,7 +148,7 @@ MACHINE_START(MSM8X60_FFA, "QCT MSM8X60 FFA")
	.handle_irq = gic_handle_irq,
	.init_machine = msm8x60_init,
	.init_late = msm8x60_init_late,
	.timer = &msm_timer,
	.timer = &msm8x60_timer,
MACHINE_END

#ifdef CONFIG_OF
@@ -158,7 +159,7 @@ DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)")
	.handle_irq = gic_handle_irq,
	.init_machine = msm8x60_dt_init,
	.init_late = msm8x60_init_late,
	.timer = &msm_timer,
	.timer = &msm8x60_timer,
	.dt_compat = msm8x60_fluid_match,
MACHINE_END
#endif /* CONFIG_OF */
+3 −4
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@
#include <mach/mmc.h>

#include "devices.h"

extern struct sys_timer msm_timer;
#include "common.h"

static const resource_size_t qsd8x50_surf_smc91x_base __initdata = 0x70000300;
static const unsigned        qsd8x50_surf_smc91x_gpio __initdata = 156;
@@ -201,7 +200,7 @@ MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
	.init_irq = qsd8x50_init_irq,
	.init_machine = qsd8x50_init,
	.init_late = qsd8x50_init_late,
	.timer = &msm_timer,
	.timer = &qsd8x50_timer,
MACHINE_END

MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
@@ -210,5 +209,5 @@ MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
	.init_irq = qsd8x50_init_irq,
	.init_machine = qsd8x50_init,
	.init_late = qsd8x50_init_late,
	.timer = &msm_timer,
	.timer = &qsd8x50_timer,
MACHINE_END
Loading