Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05b5ca9b authored by Tony Lindgren's avatar Tony Lindgren
Browse files

omap1: Fix booting for 15xx and 730 with omap1_defconfig



For omap15xx and 730 we need to use the MPU timer
as the 32K timer is not available. For omap16xx
we want to use the 32K timer because of PM. Fix this
by allowing to build in both timers.

Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent f376ea17
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ config ARCH_OMAP730
	depends on ARCH_OMAP1
	bool "OMAP730 Based System"
	select CPU_ARM926T
	select OMAP_MPU_TIMER
	select ARCH_OMAP_OTG

config ARCH_OMAP850
@@ -22,6 +23,7 @@ config ARCH_OMAP15XX
	default y
	bool "OMAP15xx Based System"
	select CPU_ARM925T
	select OMAP_MPU_TIMER

config ARCH_OMAP16XX
	depends on ARCH_OMAP1
+1 −2
Original line number Diff line number Diff line
@@ -3,12 +3,11 @@
#

# Common support
obj-y := io.o id.o sram.o irq.o mux.o flash.o serial.o devices.o dma.o
obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o
obj-y += clock.o clock_data.o opp_data.o

obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o

obj-$(CONFIG_OMAP_MPU_TIMER)	+= time.o
obj-$(CONFIG_OMAP_32K_TIMER)	+= timer32k.o

# Power Management
+35 −13
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@

#include <plat/common.h>

#ifdef CONFIG_OMAP_MPU_TIMER

#define OMAP_MPU_TIMER_BASE		OMAP_MPU_TIMER1_BASE
#define OMAP_MPU_TIMER_OFFSET		0x100

@@ -236,12 +238,7 @@ static void __init omap_init_clocksource(unsigned long rate)
		printk(err, clocksource_mpu.name);
}

/*
 * ---------------------------------------------------------------------------
 * Timer initialization
 * ---------------------------------------------------------------------------
 */
static void __init omap_timer_init(void)
static void __init omap_mpu_timer_init(void)
{
	struct clk	*ck_ref = clk_get(NULL, "ck_ref");
	unsigned long	rate;
@@ -256,13 +253,38 @@ static void __init omap_timer_init(void)

	omap_init_mpu_timer(rate);
	omap_init_clocksource(rate);
}

#else
static inline void omap_mpu_timer_init(void)
{
	pr_err("Bogus timer, should not happen\n");
}
#endif	/* CONFIG_OMAP_MPU_TIMER */

static inline int omap_32k_timer_usable(void)
{
	int res = false;

	if (cpu_is_omap730() || cpu_is_omap15xx())
		return res;

#ifdef CONFIG_OMAP_32K_TIMER
	res = omap_32k_timer_init();
#endif

	return res;
}

/*
	 * XXX Since this file seems to deal mostly with the MPU timer,
	 * this doesn't seem like the correct place for the sync timer
	 * clocksource init.
 * ---------------------------------------------------------------------------
 * Timer initialization
 * ---------------------------------------------------------------------------
 */
	if (!cpu_is_omap7xx() && !cpu_is_omap15xx())
		omap_init_clocksource_32k();
static void __init omap_timer_init(void)
{
	if (!omap_32k_timer_usable())
		omap_mpu_timer_init();
}

struct sys_timer omap_timer = {
+6 −7
Original line number Diff line number Diff line
@@ -52,10 +52,9 @@
#include <asm/irq.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
#include <plat/common.h>
#include <plat/dmtimer.h>

struct sys_timer omap_timer;

/*
 * ---------------------------------------------------------------------------
 * 32KHz OS timer
@@ -181,14 +180,14 @@ static __init void omap_init_32k_timer(void)
 * Timer initialization
 * ---------------------------------------------------------------------------
 */
static void __init omap_timer_init(void)
bool __init omap_32k_timer_init(void)
{
	omap_init_clocksource_32k();

#ifdef CONFIG_OMAP_DM_TIMER
	omap_dm_timer_init();
#endif
	omap_init_32k_timer();
}

struct sys_timer omap_timer = {
	.init		= omap_timer_init,
};
	return true;
}
+2 −6
Original line number Diff line number Diff line
@@ -144,12 +144,9 @@ config OMAP_IOMMU_DEBUG
config OMAP_IOMMU_IVA2
	bool

choice
	prompt "System timer"
	default OMAP_32K_TIMER if !ARCH_OMAP15XX

config OMAP_MPU_TIMER
	bool "Use mpu timer"
	depends on ARCH_OMAP1
	help
	  Select this option if you want to use the OMAP mpu timer. This
	  timer provides more intra-tick resolution than the 32KHz timer,
@@ -158,6 +155,7 @@ config OMAP_MPU_TIMER
config OMAP_32K_TIMER
	bool "Use 32KHz timer"
	depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS
	default y if (ARCH_OMAP16XX || ARCH_OMAP2PLUS)
	help
	  Select this option if you want to enable the OMAP 32KHz timer.
	  This timer saves power compared to the OMAP_MPU_TIMER, and has
@@ -165,8 +163,6 @@ config OMAP_32K_TIMER
	  intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
	  currently only available for OMAP16XX, 24XX, 34XX and OMAP4.

endchoice

config OMAP3_L2_AUX_SECURE_SAVE_RESTORE
	bool "OMAP3 HS/EMU save and restore for L2 AUX control register"
	depends on ARCH_OMAP3 && PM
Loading