From 84a34344ea1f2f313d84a9fb4cb685b65a6ec26d Mon Sep 17 00:00:00 2001 From: Lauri Leukkunen Date: Wed, 10 Dec 2008 17:36:31 -0800 Subject: ARM: OMAP2: Use omap_rev() instead of system_rev system_rev is meant for board revision, this patch changes all relevant instances to use the new omap_rev() function liberating system_rev to be used with ATAG_REVISION as it has been designed. Signed-off-by: Lauri Leukkunen Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/clock34xx.c | 2 +- arch/arm/mach-omap2/id.c | 34 +++++++++++++++++++++------------- 2 files changed, 22 insertions(+), 14 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index 3c2f665742f7..31bb7010bd48 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c @@ -475,7 +475,7 @@ int __init omap2_clk_init(void) * Update this if there are further clock changes between ES2 * and production parts */ - if (system_rev == OMAP3430_REV_ES1_0) { + if (omap_rev() == OMAP3430_REV_ES1_0) { /* No 3430ES1-only rates exist, so no RATE_IN_3430ES1 */ cpu_clkflg |= CLOCK_IN_OMAP3430ES1; } else { diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index d4e3a38e347c..b0f8e7d62798 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -23,6 +23,14 @@ #include static struct omap_chip_id omap_chip; +static unsigned int omap_revision; + + +unsigned int omap_rev(void) +{ + return omap_revision; +} +EXPORT_SYMBOL(omap_rev); /** * omap_chip_is - test whether currently running OMAP matches a chip type @@ -50,7 +58,7 @@ EXPORT_SYMBOL(omap_chip_is); struct omap_id { u16 hawkeye; /* Silicon type (Hawkeye id) */ u8 dev; /* Device type from production_id reg */ - u32 type; /* Combined type id copied to system_rev */ + u32 type; /* Combined type id copied to omap_revision */ }; /* Register values to detect the OMAP version */ @@ -116,9 +124,9 @@ void __init omap24xx_check_revision(void) j = i; } - pr_info("OMAP%04x", system_rev >> 16); - if ((system_rev >> 8) & 0x0f) - pr_info("ES%x", (system_rev >> 12) & 0xf); + pr_info("OMAP%04x", omap_rev() >> 16); + if ((omap_rev() >> 8) & 0x0f) + pr_info("ES%x", (omap_rev() >> 12) & 0xf); pr_info("\n"); } @@ -136,7 +144,7 @@ void __init omap34xx_check_revision(void) */ cpuid = read_cpuid(CPUID_ID); if ((((cpuid >> 4) & 0xfff) == 0xc08) && ((cpuid & 0xf) == 0x0)) { - system_rev = OMAP3430_REV_ES1_0; + omap_revision = OMAP3430_REV_ES1_0; goto out; } @@ -153,26 +161,26 @@ void __init omap34xx_check_revision(void) if (hawkeye == 0xb7ae) { switch (rev) { case 0: - system_rev = OMAP3430_REV_ES2_0; + omap_revision = OMAP3430_REV_ES2_0; rev_name = "ES2.0"; break; case 2: - system_rev = OMAP3430_REV_ES2_1; + omap_revision = OMAP3430_REV_ES2_1; rev_name = "ES2.1"; break; case 3: - system_rev = OMAP3430_REV_ES3_0; + omap_revision = OMAP3430_REV_ES3_0; rev_name = "ES3.0"; break; default: /* Use the latest known revision as default */ - system_rev = OMAP3430_REV_ES3_0; + omap_revision = OMAP3430_REV_ES3_0; rev_name = "Unknown revision\n"; } } out: - pr_info("OMAP%04x %s\n", system_rev >> 16, rev_name); + pr_info("OMAP%04x %s\n", omap_rev() >> 16, rev_name); } /* @@ -203,9 +211,9 @@ void __init omap2_check_revision(void) omap_chip.oc |= CHIP_IS_OMAP2420; } else if (cpu_is_omap343x()) { omap_chip.oc = CHIP_IS_OMAP3430; - if (system_rev == OMAP3430_REV_ES1_0) + if (omap_rev() == OMAP3430_REV_ES1_0) omap_chip.oc |= CHIP_IS_OMAP3430ES1; - else if (system_rev > OMAP3430_REV_ES1_0) + else if (omap_rev() > OMAP3430_REV_ES1_0) omap_chip.oc |= CHIP_IS_OMAP3430ES2; } else { pr_err("Uninitialized omap_chip, please fix!\n"); @@ -221,7 +229,7 @@ void __init omap2_check_revision(void) */ void __init omap2_set_globals_tap(struct omap_globals *omap2_globals) { - system_rev = omap2_globals->class; + omap_revision = omap2_globals->class; tap_base = omap2_globals->tap; if (cpu_is_omap34xx()) -- cgit v1.2.2