ARM: OMAP2+: split omap2/3/4_check_revision function
We need to detect the SoC revision early, but the SoC feature detection can be done later on. In order to allow further clean-up later on, this patch separates the SoC revision check from the SoC feature check. This patch doesn't change functionality or behavior of the code execution; it barely cleans up the code and splits into SoC specific implementation for Rev ID and feature detection. Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> [tony@atomide.com: updated comments] Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
50a01e6440
commit
4de34f3572
|
@ -112,7 +112,7 @@ void omap_get_die_id(struct omap_die_id *odi)
|
||||||
odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
|
odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init omap24xx_check_revision(void)
|
void __init omap2xxx_check_revision(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
u32 idcode, prod_id;
|
u32 idcode, prod_id;
|
||||||
|
@ -222,7 +222,7 @@ static void __init omap3_cpuinfo(void)
|
||||||
omap_features |= OMAP3_HAS_ ##feat; \
|
omap_features |= OMAP3_HAS_ ##feat; \
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init omap3_check_features(void)
|
void __init omap3xxx_check_features(void)
|
||||||
{
|
{
|
||||||
u32 status;
|
u32 status;
|
||||||
|
|
||||||
|
@ -249,9 +249,11 @@ static void __init omap3_check_features(void)
|
||||||
* TODO: Get additional info (where applicable)
|
* TODO: Get additional info (where applicable)
|
||||||
* e.g. Size of L2 cache.
|
* e.g. Size of L2 cache.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
omap3_cpuinfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init omap4_check_features(void)
|
void __init omap4xxx_check_features(void)
|
||||||
{
|
{
|
||||||
u32 si_type;
|
u32 si_type;
|
||||||
|
|
||||||
|
@ -276,12 +278,13 @@ static void __init omap4_check_features(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init ti81xx_check_features(void)
|
void __init ti81xx_check_features(void)
|
||||||
{
|
{
|
||||||
omap_features = OMAP3_HAS_NEON;
|
omap_features = OMAP3_HAS_NEON;
|
||||||
|
omap3_cpuinfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init omap3_check_revision(void)
|
void __init omap3xxx_check_revision(void)
|
||||||
{
|
{
|
||||||
u32 cpuid, idcode;
|
u32 cpuid, idcode;
|
||||||
u16 hawkeye;
|
u16 hawkeye;
|
||||||
|
@ -421,7 +424,7 @@ static void __init omap3_check_revision(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init omap4_check_revision(void)
|
void __init omap4xxx_check_revision(void)
|
||||||
{
|
{
|
||||||
u32 idcode;
|
u32 idcode;
|
||||||
u16 hawkeye;
|
u16 hawkeye;
|
||||||
|
@ -494,37 +497,6 @@ static void __init omap4_check_revision(void)
|
||||||
((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
|
((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Try to detect the exact revision of the omap we're running on
|
|
||||||
*/
|
|
||||||
void __init omap2_check_revision(void)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* At this point we have an idea about the processor revision set
|
|
||||||
* earlier with omap2_set_globals_tap().
|
|
||||||
*/
|
|
||||||
if (cpu_is_omap24xx()) {
|
|
||||||
omap24xx_check_revision();
|
|
||||||
} else if (cpu_is_omap34xx()) {
|
|
||||||
omap3_check_revision();
|
|
||||||
|
|
||||||
/* TI81XX doesn't have feature register */
|
|
||||||
if (!cpu_is_ti81xx())
|
|
||||||
omap3_check_features();
|
|
||||||
else
|
|
||||||
ti81xx_check_features();
|
|
||||||
|
|
||||||
omap3_cpuinfo();
|
|
||||||
return;
|
|
||||||
} else if (cpu_is_omap44xx()) {
|
|
||||||
omap4_check_revision();
|
|
||||||
omap4_check_features();
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
pr_err("OMAP revision unknown, please fix!\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up things for map_io and processor detection later on. Gets called
|
* Set up things for map_io and processor detection later on. Gets called
|
||||||
* pretty much first thing from board init. For multi-omap, this gets
|
* pretty much first thing from board init. For multi-omap, this gets
|
||||||
|
|
|
@ -342,7 +342,6 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
|
||||||
|
|
||||||
static void __init omap_common_init_early(void)
|
static void __init omap_common_init_early(void)
|
||||||
{
|
{
|
||||||
omap2_check_revision();
|
|
||||||
omap_init_consistent_dma_size();
|
omap_init_consistent_dma_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,6 +382,7 @@ static void __init omap_hwmod_init_postsetup(void)
|
||||||
void __init omap2420_init_early(void)
|
void __init omap2420_init_early(void)
|
||||||
{
|
{
|
||||||
omap2_set_globals_242x();
|
omap2_set_globals_242x();
|
||||||
|
omap2xxx_check_revision();
|
||||||
omap_common_init_early();
|
omap_common_init_early();
|
||||||
omap2xxx_voltagedomains_init();
|
omap2xxx_voltagedomains_init();
|
||||||
omap242x_powerdomains_init();
|
omap242x_powerdomains_init();
|
||||||
|
@ -395,6 +395,7 @@ void __init omap2420_init_early(void)
|
||||||
void __init omap2430_init_early(void)
|
void __init omap2430_init_early(void)
|
||||||
{
|
{
|
||||||
omap2_set_globals_243x();
|
omap2_set_globals_243x();
|
||||||
|
omap2xxx_check_revision();
|
||||||
omap_common_init_early();
|
omap_common_init_early();
|
||||||
omap2xxx_voltagedomains_init();
|
omap2xxx_voltagedomains_init();
|
||||||
omap243x_powerdomains_init();
|
omap243x_powerdomains_init();
|
||||||
|
@ -413,6 +414,8 @@ void __init omap2430_init_early(void)
|
||||||
void __init omap3_init_early(void)
|
void __init omap3_init_early(void)
|
||||||
{
|
{
|
||||||
omap2_set_globals_3xxx();
|
omap2_set_globals_3xxx();
|
||||||
|
omap3xxx_check_revision();
|
||||||
|
omap3xxx_check_features();
|
||||||
omap_common_init_early();
|
omap_common_init_early();
|
||||||
omap3xxx_voltagedomains_init();
|
omap3xxx_voltagedomains_init();
|
||||||
omap3xxx_powerdomains_init();
|
omap3xxx_powerdomains_init();
|
||||||
|
@ -445,6 +448,8 @@ void __init am35xx_init_early(void)
|
||||||
void __init ti81xx_init_early(void)
|
void __init ti81xx_init_early(void)
|
||||||
{
|
{
|
||||||
omap2_set_globals_ti81xx();
|
omap2_set_globals_ti81xx();
|
||||||
|
omap3xxx_check_revision();
|
||||||
|
ti81xx_check_features();
|
||||||
omap_common_init_early();
|
omap_common_init_early();
|
||||||
omap3xxx_voltagedomains_init();
|
omap3xxx_voltagedomains_init();
|
||||||
omap3xxx_powerdomains_init();
|
omap3xxx_powerdomains_init();
|
||||||
|
@ -459,6 +464,8 @@ void __init ti81xx_init_early(void)
|
||||||
void __init omap4430_init_early(void)
|
void __init omap4430_init_early(void)
|
||||||
{
|
{
|
||||||
omap2_set_globals_443x();
|
omap2_set_globals_443x();
|
||||||
|
omap4xxx_check_revision();
|
||||||
|
omap4xxx_check_features();
|
||||||
omap_common_init_early();
|
omap_common_init_early();
|
||||||
omap44xx_voltagedomains_init();
|
omap44xx_voltagedomains_init();
|
||||||
omap44xx_powerdomains_init();
|
omap44xx_powerdomains_init();
|
||||||
|
|
|
@ -451,7 +451,12 @@ IS_OMAP_TYPE(3517, 0x3517)
|
||||||
#define OMAP447X_CLASS 0x44700044
|
#define OMAP447X_CLASS 0x44700044
|
||||||
#define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8))
|
#define OMAP4470_REV_ES1_0 (OMAP447X_CLASS | (0x10 << 8))
|
||||||
|
|
||||||
void omap2_check_revision(void);
|
void omap2xxx_check_revision(void);
|
||||||
|
void omap3xxx_check_revision(void);
|
||||||
|
void omap4xxx_check_revision(void);
|
||||||
|
void omap3xxx_check_features(void);
|
||||||
|
void ti81xx_check_features(void);
|
||||||
|
void omap4xxx_check_features(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Runtime detection of OMAP3 features
|
* Runtime detection of OMAP3 features
|
||||||
|
|
Loading…
Reference in New Issue