diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-02 12:31:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-02 12:31:45 -0400 |
commit | 97b1007a2924aaa9126398623f6755a8c3c6a616 (patch) | |
tree | b65c6edb631256e64bb3c72f083fa1be048de097 /arch/arm/mach-omap2/id.c | |
parent | dfab34aa61a0f8c14a67d7b4c1dae28e57ba592d (diff) | |
parent | e0d20b69d3fa74a21ec363989612bddd58b930b8 (diff) |
Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform updates from Olof Johansson:
"This branch contains part 1 of the platform updates for 3.10. Among
the highlights:
- Support for the new Atmel Cortex-A5 based platforms (SAMA5D3)
- New support for CSR SiRFatlas6 SoCs
- A handful of updates for NVidia T114 (a.k.a. Tegra 4)
- A bunch of updates for the shmobile platforms
- A handful of updates for davinci
- A few updates for Qualcomm MSM
- Plus a handful of other patches, defconfig updates, etc."
* tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (135 commits)
ARM: tegra: pm: fix build error w/o PM_SLEEP
ARM: davinci: ensure global variables are declared
ARM: davinci: sram.c: fix incorrect type in assignment
ARM: davinci: da8xx dt: make file local symbols static
ARM: davinci: da8xx: add remoteproc support
ARM: socfpga: Upgrade clk driver for socfpga to make use of dts clock entries
ARM: socfpga: Add clock entries into device tree
ARM: socfpga: Enable soft reset
ARM: EXYNOS: replace cpumask by the corresponding macro
ARM: EXYNOS: handle properly the return values
ARM: EXYNOS: factor out the idle states
ARM: OMAP4: Enable fix for Cortex-A9 erratas
ARM: OMAP2+: Export SoC information to userspace
ARM: OMAP2+: SoC name and revision unification
ARM: OMAP2+: Move common part of late init into common function
ARM: tegra: pm: remove duplicated include from pm.c
ARM: davinci: da850: override mmc DT node device name
ARM: davinci: da850: add mmc DT entries
mmc: davinci_mmc: add DT support
ARM: SAMSUNG: check processor type before cache restoration in resume
...
Diffstat (limited to 'arch/arm/mach-omap2/id.c')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 95 |
1 files changed, 87 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index ff0bc9e51aa7..2fb17caa8683 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -18,6 +18,11 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/slab.h> | ||
22 | |||
23 | #ifdef CONFIG_SOC_BUS | ||
24 | #include <linux/sys_soc.h> | ||
25 | #endif | ||
21 | 26 | ||
22 | #include <asm/cputype.h> | 27 | #include <asm/cputype.h> |
23 | 28 | ||
@@ -31,8 +36,11 @@ | |||
31 | #define OMAP4_SILICON_TYPE_STANDARD 0x01 | 36 | #define OMAP4_SILICON_TYPE_STANDARD 0x01 |
32 | #define OMAP4_SILICON_TYPE_PERFORMANCE 0x02 | 37 | #define OMAP4_SILICON_TYPE_PERFORMANCE 0x02 |
33 | 38 | ||
39 | #define OMAP_SOC_MAX_NAME_LENGTH 16 | ||
40 | |||
34 | static unsigned int omap_revision; | 41 | static unsigned int omap_revision; |
35 | static const char *cpu_rev; | 42 | static char soc_name[OMAP_SOC_MAX_NAME_LENGTH]; |
43 | static char soc_rev[OMAP_SOC_MAX_NAME_LENGTH]; | ||
36 | u32 omap_features; | 44 | u32 omap_features; |
37 | 45 | ||
38 | unsigned int omap_rev(void) | 46 | unsigned int omap_rev(void) |
@@ -169,9 +177,12 @@ void __init omap2xxx_check_revision(void) | |||
169 | j = i; | 177 | j = i; |
170 | } | 178 | } |
171 | 179 | ||
172 | pr_info("OMAP%04x", omap_rev() >> 16); | 180 | sprintf(soc_name, "OMAP%04x", omap_rev() >> 16); |
181 | sprintf(soc_rev, "ES%x", (omap_rev() >> 12) & 0xf); | ||
182 | |||
183 | pr_info("%s", soc_name); | ||
173 | if ((omap_rev() >> 8) & 0x0f) | 184 | if ((omap_rev() >> 8) & 0x0f) |
174 | pr_info("ES%x", (omap_rev() >> 12) & 0xf); | 185 | pr_info("%s", soc_rev); |
175 | pr_info("\n"); | 186 | pr_info("\n"); |
176 | } | 187 | } |
177 | 188 | ||
@@ -211,8 +222,10 @@ static void __init omap3_cpuinfo(void) | |||
211 | cpu_name = "OMAP3503"; | 222 | cpu_name = "OMAP3503"; |
212 | } | 223 | } |
213 | 224 | ||
225 | sprintf(soc_name, "%s", cpu_name); | ||
226 | |||
214 | /* Print verbose information */ | 227 | /* Print verbose information */ |
215 | pr_info("%s ES%s (", cpu_name, cpu_rev); | 228 | pr_info("%s %s (", soc_name, soc_rev); |
216 | 229 | ||
217 | OMAP3_SHOW_FEATURE(l2cache); | 230 | OMAP3_SHOW_FEATURE(l2cache); |
218 | OMAP3_SHOW_FEATURE(iva); | 231 | OMAP3_SHOW_FEATURE(iva); |
@@ -291,6 +304,7 @@ void __init ti81xx_check_features(void) | |||
291 | 304 | ||
292 | void __init omap3xxx_check_revision(void) | 305 | void __init omap3xxx_check_revision(void) |
293 | { | 306 | { |
307 | const char *cpu_rev; | ||
294 | u32 cpuid, idcode; | 308 | u32 cpuid, idcode; |
295 | u16 hawkeye; | 309 | u16 hawkeye; |
296 | u8 rev; | 310 | u8 rev; |
@@ -438,6 +452,7 @@ void __init omap3xxx_check_revision(void) | |||
438 | cpu_rev = "1.2"; | 452 | cpu_rev = "1.2"; |
439 | pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n"); | 453 | pr_warn("Warning: unknown chip type; assuming OMAP3630ES1.2\n"); |
440 | } | 454 | } |
455 | sprintf(soc_rev, "ES%s", cpu_rev); | ||
441 | } | 456 | } |
442 | 457 | ||
443 | void __init omap4xxx_check_revision(void) | 458 | void __init omap4xxx_check_revision(void) |
@@ -512,8 +527,10 @@ void __init omap4xxx_check_revision(void) | |||
512 | omap_revision = OMAP4430_REV_ES2_3; | 527 | omap_revision = OMAP4430_REV_ES2_3; |
513 | } | 528 | } |
514 | 529 | ||
515 | pr_info("OMAP%04x ES%d.%d\n", omap_rev() >> 16, | 530 | sprintf(soc_name, "OMAP%04x", omap_rev() >> 16); |
516 | ((omap_rev() >> 12) & 0xf), ((omap_rev() >> 8) & 0xf)); | 531 | sprintf(soc_rev, "ES%d.%d", (omap_rev() >> 12) & 0xf, |
532 | (omap_rev() >> 8) & 0xf); | ||
533 | pr_info("%s %s\n", soc_name, soc_rev); | ||
517 | } | 534 | } |
518 | 535 | ||
519 | void __init omap5xxx_check_revision(void) | 536 | void __init omap5xxx_check_revision(void) |
@@ -553,8 +570,10 @@ void __init omap5xxx_check_revision(void) | |||
553 | omap_revision = OMAP5430_REV_ES2_0; | 570 | omap_revision = OMAP5430_REV_ES2_0; |
554 | } | 571 | } |
555 | 572 | ||
556 | pr_info("OMAP%04x ES%d.0\n", | 573 | sprintf(soc_name, "OMAP%04x", omap_rev() >> 16); |
557 | omap_rev() >> 16, ((omap_rev() >> 12) & 0xf)); | 574 | sprintf(soc_rev, "ES%d.0", (omap_rev() >> 12) & 0xf); |
575 | |||
576 | pr_info("%s %s\n", soc_name, soc_rev); | ||
558 | } | 577 | } |
559 | 578 | ||
560 | /* | 579 | /* |
@@ -575,3 +594,63 @@ void __init omap2_set_globals_tap(u32 class, void __iomem *tap) | |||
575 | else | 594 | else |
576 | tap_prod_id = 0x0208; | 595 | tap_prod_id = 0x0208; |
577 | } | 596 | } |
597 | |||
598 | #ifdef CONFIG_SOC_BUS | ||
599 | |||
600 | static const char const *omap_types[] = { | ||
601 | [OMAP2_DEVICE_TYPE_TEST] = "TST", | ||
602 | [OMAP2_DEVICE_TYPE_EMU] = "EMU", | ||
603 | [OMAP2_DEVICE_TYPE_SEC] = "HS", | ||
604 | [OMAP2_DEVICE_TYPE_GP] = "GP", | ||
605 | [OMAP2_DEVICE_TYPE_BAD] = "BAD", | ||
606 | }; | ||
607 | |||
608 | static const char * __init omap_get_family(void) | ||
609 | { | ||
610 | if (cpu_is_omap24xx()) | ||
611 | return kasprintf(GFP_KERNEL, "OMAP2"); | ||
612 | else if (cpu_is_omap34xx()) | ||
613 | return kasprintf(GFP_KERNEL, "OMAP3"); | ||
614 | else if (cpu_is_omap44xx()) | ||
615 | return kasprintf(GFP_KERNEL, "OMAP4"); | ||
616 | else if (soc_is_omap54xx()) | ||
617 | return kasprintf(GFP_KERNEL, "OMAP5"); | ||
618 | else | ||
619 | return kasprintf(GFP_KERNEL, "Unknown"); | ||
620 | } | ||
621 | |||
622 | static ssize_t omap_get_type(struct device *dev, | ||
623 | struct device_attribute *attr, | ||
624 | char *buf) | ||
625 | { | ||
626 | return sprintf(buf, "%s\n", omap_types[omap_type()]); | ||
627 | } | ||
628 | |||
629 | static struct device_attribute omap_soc_attr = | ||
630 | __ATTR(type, S_IRUGO, omap_get_type, NULL); | ||
631 | |||
632 | void __init omap_soc_device_init(void) | ||
633 | { | ||
634 | struct device *parent; | ||
635 | struct soc_device *soc_dev; | ||
636 | struct soc_device_attribute *soc_dev_attr; | ||
637 | |||
638 | soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); | ||
639 | if (!soc_dev_attr) | ||
640 | return; | ||
641 | |||
642 | soc_dev_attr->machine = soc_name; | ||
643 | soc_dev_attr->family = omap_get_family(); | ||
644 | soc_dev_attr->revision = soc_rev; | ||
645 | |||
646 | soc_dev = soc_device_register(soc_dev_attr); | ||
647 | if (IS_ERR_OR_NULL(soc_dev)) { | ||
648 | kfree(soc_dev_attr); | ||
649 | return; | ||
650 | } | ||
651 | |||
652 | parent = soc_device_to_device(soc_dev); | ||
653 | if (!IS_ERR_OR_NULL(parent)) | ||
654 | device_create_file(parent, &omap_soc_attr); | ||
655 | } | ||
656 | #endif /* CONFIG_SOC_BUS */ | ||