diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-06-20 23:21:20 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-07-12 11:24:08 +0200 |
commit | f15601d62bf1348c1dc9fe3455b277a652db1c6e (patch) | |
tree | 8d4a25cce6964b31a9138bf15dc187aa38328aa0 /arch/arm/mach-ux500/id.c | |
parent | cd1dc431d02afda521bed53b7c87a678a3ac246f (diff) |
ARM: ux500: call ux500_setup_id later
ux500_setup_id is currently called from u8500_map_io(), which is
really early, but nothing relies on the ID any more, other than
a printk message that is not really all that important to
have early during boot.
If we move the call to ux500_setup_id() into ux500_soc_device_init(),
that file becomes usuable almost entirely standalone, and we can kill
off the u8500_map_io() callback as it just does the default
debug_ll_io_init() now.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/id.c')
-rw-r--r-- | arch/arm/mach-ux500/id.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/arm/mach-ux500/id.c b/arch/arm/mach-ux500/id.c index 17f80ef44c58..983004d0fef2 100644 --- a/arch/arm/mach-ux500/id.c +++ b/arch/arm/mach-ux500/id.c @@ -37,21 +37,16 @@ static struct dbx500_asic_id dbx500_id; static unsigned int __init ux500_read_asicid(phys_addr_t addr) { - phys_addr_t base = addr & ~0xfff; - struct map_desc desc = { - .virtual = (unsigned long)UX500_VIRT_ROM, - .pfn = __phys_to_pfn(base), - .length = SZ_16K, - .type = MT_DEVICE, - }; + void __iomem *virt = ioremap(addr, 4); + unsigned int asicid; - iotable_init(&desc, 1); + if (!virt) + return 0; - /* As in devicemaps_init() */ - local_flush_tlb_all(); - flush_cache_all(); + asicid = readl(virt); + iounmap(virt); - return readl(UX500_VIRT_ROM + (addr & 0xfff)); + return asicid; } static void ux500_print_soc_info(unsigned int asicid) @@ -86,7 +81,7 @@ static unsigned int partnumber(unsigned int asicid) * DB9540 0x413fc090 0xFFFFDBF4 0x009540xx */ -void __init ux500_setup_id(void) +static void __init ux500_setup_id(void) { unsigned int cpuid = read_cpuid_id(); unsigned int asicid = 0; @@ -197,6 +192,8 @@ struct device * __init ux500_soc_device_init(void) struct soc_device *soc_dev; struct soc_device_attribute *soc_dev_attr; + ux500_setup_id(); + soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) return ERR_PTR(-ENOMEM); |