diff options
| author | Kan-Ru Chen <kanru@0xlab.org> | 2010-08-02 07:21:41 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2010-08-02 07:21:41 -0400 |
| commit | 2e130fc3d4fd5b38ee5d3c0a5c7f9fb85bce698e (patch) | |
| tree | c0d9f4d97d17d74e71f5fde9534fdc6380a914ed | |
| parent | ad0c63f1d623ea9d3e0c0521d5ce9cd522c4e1f0 (diff) | |
omap: Add new interface omap_get_die_id
Allow DIE id to be get and used by others.
Signed-off-by: Kan-Ru Chen <kanru@0xlab.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap2/id.c | 10 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/include/mach/id.h | 22 |
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index ccaa1ed8e0f1..d079ccfa294e 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | #include <plat/control.h> | 25 | #include <plat/control.h> |
| 26 | #include <plat/cpu.h> | 26 | #include <plat/cpu.h> |
| 27 | 27 | ||
| 28 | #include <mach/id.h> | ||
| 29 | |||
| 28 | static struct omap_chip_id omap_chip; | 30 | static struct omap_chip_id omap_chip; |
| 29 | static unsigned int omap_revision; | 31 | static unsigned int omap_revision; |
| 30 | 32 | ||
| @@ -102,6 +104,14 @@ static struct omap_id omap_ids[] __initdata = { | |||
| 102 | static void __iomem *tap_base; | 104 | static void __iomem *tap_base; |
| 103 | static u16 tap_prod_id; | 105 | static u16 tap_prod_id; |
| 104 | 106 | ||
| 107 | void omap_get_die_id(struct omap_die_id *odi) | ||
| 108 | { | ||
| 109 | odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0); | ||
| 110 | odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1); | ||
| 111 | odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2); | ||
| 112 | odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); | ||
| 113 | } | ||
| 114 | |||
| 105 | static void __init omap24xx_check_revision(void) | 115 | static void __init omap24xx_check_revision(void) |
| 106 | { | 116 | { |
| 107 | int i, j; | 117 | int i, j; |
diff --git a/arch/arm/mach-omap2/include/mach/id.h b/arch/arm/mach-omap2/include/mach/id.h new file mode 100644 index 000000000000..02ed3aa56f1e --- /dev/null +++ b/arch/arm/mach-omap2/include/mach/id.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * OMAP2 CPU identification code | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Kan-Ru Chen <kanru@0xlab.org> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef OMAP2_ARCH_ID_H | ||
| 11 | #define OMAP2_ARCH_ID_H | ||
| 12 | |||
| 13 | struct omap_die_id { | ||
| 14 | u32 id_0; | ||
| 15 | u32 id_1; | ||
| 16 | u32 id_2; | ||
| 17 | u32 id_3; | ||
| 18 | }; | ||
| 19 | |||
| 20 | void omap_get_die_id(struct omap_die_id *odi); | ||
| 21 | |||
| 22 | #endif | ||
