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

Commit a920360f authored by Hemant Pedanekar's avatar Hemant Pedanekar Committed by Tony Lindgren
Browse files

ARM: OMAP: TI81XX: Prepare for addition of TI814X support



This patch updates existing macros, functions used for TI816X, to enable
addition of other SoCs belonging to TI81XX family (e.g., TI814X).

The approach taken is to use TI81XX/ti81xx for code/data going to be common
across all TI81XX devices.

cpu_is_ti81xx() is introduced to handle code common across TI81XX devices.

In addition, ti8168_evm_map_io() is now replaced with ti81xx_map_io() and moved
in mach-omap2/common.c as same will be used for TI814X and is not board
specific.

Signed-off-by: default avatarHemant Pedanekar <hemantp@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent ec023e46
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -76,8 +76,8 @@ config SOC_OMAP3430
	default y
	default y
	select ARCH_OMAP_OTG
	select ARCH_OMAP_OTG


config SOC_OMAPTI816X
config SOC_OMAPTI81XX
	bool "TI816X support"
	bool "TI81XX support"
	depends on ARCH_OMAP3
	depends on ARCH_OMAP3
	default y
	default y


@@ -319,7 +319,7 @@ config MACH_OMAP_3630SDP


config MACH_TI8168EVM
config MACH_TI8168EVM
	bool "TI8168 Evaluation Module"
	bool "TI8168 Evaluation Module"
	depends on SOC_OMAPTI816X
	depends on SOC_OMAPTI81XX
	default y
	default y


config MACH_OMAP_4430SDP
config MACH_OMAP_4430SDP
+3 −8
Original line number Original line Diff line number Diff line
@@ -35,17 +35,12 @@ static void __init ti8168_evm_init(void)
	omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
	omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);
}
}


static void __init ti8168_evm_map_io(void)
{
	omapti816x_map_common_io();
}

MACHINE_START(TI8168EVM, "ti8168evm")
MACHINE_START(TI8168EVM, "ti8168evm")
	/* Maintainer: Texas Instruments */
	/* Maintainer: Texas Instruments */
	.atag_offset	= 0x100,
	.atag_offset	= 0x100,
	.map_io		= ti8168_evm_map_io,
	.map_io		= ti81xx_map_io,
	.init_early	= ti816x_init_early,
	.init_early	= ti81xx_init_early,
	.init_irq	= ti816x_init_irq,
	.init_irq	= ti81xx_init_irq,
	.timer		= &omap3_timer,
	.timer		= &omap3_timer,
	.init_machine	= ti8168_evm_init,
	.init_machine	= ti8168_evm_init,
MACHINE_END
MACHINE_END
+1 −1
Original line number Original line Diff line number Diff line
@@ -3602,7 +3602,7 @@ int __init omap3xxx_clk_init(void)
	 * Lock DPLL5 -- here only until other device init code can
	 * Lock DPLL5 -- here only until other device init code can
	 * handle this
	 * handle this
	 */
	 */
	if (!cpu_is_ti816x() && (omap_rev() >= OMAP3430_REV_ES2_0))
	if (!cpu_is_ti81xx() && (omap_rev() >= OMAP3430_REV_ES2_0))
		omap3_clk_lock_dpll5();
		omap3_clk_lock_dpll5();


	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
	/* Avoid sleeping during omap3_core_dpll_m2_set_rate() */
+17 −12
Original line number Original line Diff line number Diff line
@@ -110,27 +110,32 @@ void __init omap3_map_io(void)


/*
/*
 * Adjust TAP register base such that omap3_check_revision accesses the correct
 * Adjust TAP register base such that omap3_check_revision accesses the correct
 * TI816X register for checking device ID (it adds 0x204 to tap base while
 * TI81XX register for checking device ID (it adds 0x204 to tap base while
 * TI816X DEVICE ID register is at offset 0x600 from control base).
 * TI81XX DEVICE ID register is at offset 0x600 from control base).
 */
 */
#define TI816X_TAP_BASE		(TI816X_CTRL_BASE + \
#define TI81XX_TAP_BASE		(TI81XX_CTRL_BASE + \
				TI816X_CONTROL_DEVICE_ID - 0x204)
				TI81XX_CONTROL_DEVICE_ID - 0x204)


static struct omap_globals ti816x_globals = {
static struct omap_globals ti81xx_globals = {
	.class  = OMAP343X_CLASS,
	.class  = OMAP343X_CLASS,
	.tap    = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
	.tap    = OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE),
	.ctrl   = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE),
	.ctrl   = OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
	.prm    = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
	.prm    = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
	.cm     = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
	.cm     = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
};
};


void __init omap2_set_globals_ti816x(void)
void __init omap2_set_globals_ti81xx(void)
{
{
	__omap2_set_globals(&ti816x_globals);
	__omap2_set_globals(&ti81xx_globals);
}

void __init ti81xx_map_io(void)
{
	omapti81xx_map_common_io();
}
}


#define AM33XX_TAP_BASE		(AM33XX_CTRL_BASE + \
#define AM33XX_TAP_BASE		(AM33XX_CTRL_BASE + \
				TI816X_CONTROL_DEVICE_ID - 0x204)
				TI81XX_CONTROL_DEVICE_ID - 0x204)


static struct omap_globals am33xx_globals = {
static struct omap_globals am33xx_globals = {
	.class  = AM335X_CLASS,
	.class  = AM335X_CLASS,
+7 −6
Original line number Original line Diff line number Diff line
@@ -52,10 +52,10 @@ static inline void omap34xx_map_common_io(void)
}
}
#endif
#endif


#ifdef CONFIG_SOC_OMAPTI816X
#ifdef CONFIG_SOC_OMAPTI81XX
extern void omapti816x_map_common_io(void);
extern void omapti81xx_map_common_io(void);
#else
#else
static inline void omapti816x_map_common_io(void)
static inline void omapti81xx_map_common_io(void)
{
{
}
}
#endif
#endif
@@ -90,7 +90,7 @@ void omap35xx_init_early(void);
void omap3630_init_early(void);
void omap3630_init_early(void);
void omap3_init_early(void);	/* Do not use this one */
void omap3_init_early(void);	/* Do not use this one */
void am35xx_init_early(void);
void am35xx_init_early(void);
void ti816x_init_early(void);
void ti81xx_init_early(void);
void omap4430_init_early(void);
void omap4430_init_early(void);


/*
/*
@@ -114,7 +114,7 @@ void omap2_set_globals_242x(void);
void omap2_set_globals_243x(void);
void omap2_set_globals_243x(void);
void omap2_set_globals_3xxx(void);
void omap2_set_globals_3xxx(void);
void omap2_set_globals_443x(void);
void omap2_set_globals_443x(void);
void omap2_set_globals_ti816x(void);
void omap2_set_globals_ti81xx(void);
void omap2_set_globals_am33xx(void);
void omap2_set_globals_am33xx(void);


/* These get called from omap2_set_globals_xxxx(), do not call these */
/* These get called from omap2_set_globals_xxxx(), do not call these */
@@ -128,6 +128,7 @@ void omap243x_map_io(void);
void omap3_map_io(void);
void omap3_map_io(void);
void am33xx_map_io(void);
void am33xx_map_io(void);
void omap4_map_io(void);
void omap4_map_io(void);
void ti81xx_map_io(void);


/**
/**
 * omap_test_timeout - busy-loop, testing a condition
 * omap_test_timeout - busy-loop, testing a condition
@@ -156,7 +157,7 @@ extern struct device *omap4_get_dsp_device(void);


void omap2_init_irq(void);
void omap2_init_irq(void);
void omap3_init_irq(void);
void omap3_init_irq(void);
void ti816x_init_irq(void);
void ti81xx_init_irq(void);
extern int omap_irq_pending(void);
extern int omap_irq_pending(void);
void omap_intc_save_context(void);
void omap_intc_save_context(void);
void omap_intc_restore_context(void);
void omap_intc_restore_context(void);
Loading