diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-08-25 17:40:56 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@linaro.org> | 2012-03-19 08:54:27 +0100 |
commit | f2cc99bf21de36b1314933f773cfdbf332034909 (patch) | |
tree | a6c3c93a9477389e6ebc3522b3f78cf6d96514a8 /arch/arm/mach-ux500/cpu-db5500.c | |
parent | a3df85cf5244f04a8d09f45121cebe314bee60aa (diff) |
u5500: add cpu_is_u5500v2()
ST-Ericsson Linux next: -
ST-Ericsson ID: 349062
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: Ic91697eb0e133fa288d65cf5a21206a78c27d5ab
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25780
Reviewed-by: QATEST
Reviewed-by: Linus WALLEIJ <linus.walleij@stericsson.com>
-------
Manually applied the patch during migration to 3.0 kernel
Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500/cpu-db5500.c')
-rw-r--r-- | arch/arm/mach-ux500/cpu-db5500.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/cpu-db5500.c b/arch/arm/mach-ux500/cpu-db5500.c index bfdda1b877b..91496ffcda9 100644 --- a/arch/arm/mach-ux500/cpu-db5500.c +++ b/arch/arm/mach-ux500/cpu-db5500.c @@ -12,7 +12,8 @@ #include <asm/pmu.h> #include <asm/mach/map.h> -#include <asm/pmu.h> +#include <asm/cacheflush.h> +#include <asm/tlbflush.h> #include <linux/gpio.h> @@ -169,6 +170,38 @@ static void __init db5500_add_gpios(void) IRQ_DB5500_GPIO0, &pdata); } +static u8 db5500_revision; + +bool cpu_is_u5500v1() +{ + return db5500_revision == 0xA0; +} + +bool cpu_is_u5500v2() +{ + return db5500_revision == 0xB0; +} + +static void db5500_rev_init(void) +{ + const char *version = "UNKNOWN"; + unsigned int asicid; + + /* As in devicemaps_init() */ + local_flush_tlb_all(); + flush_cache_all(); + + asicid = readl_relaxed(__io_address(U5500_ASIC_ID_ADDRESS)); + db5500_revision = asicid & 0xff; + + if (cpu_is_u5500v1()) + version = "1.0"; + else if (cpu_is_u5500v2()) + version = "2.0"; + + pr_info("DB5500 v%s [%#010x]\n", version, asicid); +} + void __init u5500_map_io(void) { /* @@ -181,6 +214,8 @@ void __init u5500_map_io(void) iotable_init(u5500_io_desc, ARRAY_SIZE(u5500_io_desc)); _PRCMU_BASE = __io_address(U5500_PRCMU_BASE); + + db5500_rev_init(); } static void __init db5500_pmu_init(void) |