diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-08-25 17:40:56 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:02:05 +0200 |
commit | efd55585f630bc3d2a449251127bec8f227225a2 (patch) | |
tree | bae5776938a3d76b9e7772c5a285c73302b43aa2 /arch/arm/mach-ux500/cpu-db5500.c | |
parent | 7b75d68d0aa2e456d453421270161e214536f574 (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 6319bd431f5..dcc007fc2f8 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(struct device *parent) 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) |