omap: Add new interface omap_get_die_id
authorKan-Ru Chen <kanru@0xlab.org>
Mon, 2 Aug 2010 11:21:41 +0000 (14:21 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 2 Aug 2010 11:21:41 +0000 (14:21 +0300)
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>
arch/arm/mach-omap2/id.c
arch/arm/mach-omap2/include/mach/id.h [new file with mode: 0644]

index ccaa1ed8e0f189cc36ee1867f9d27803c8ff4cc6..d079ccfa294e50d0b7ae2a514a0acf7ffabd5c28 100644 (file)
@@ -25,6 +25,8 @@
 #include <plat/control.h>
 #include <plat/cpu.h>
 
+#include <mach/id.h>
+
 static struct omap_chip_id omap_chip;
 static unsigned int omap_revision;
 
@@ -102,6 +104,14 @@ static struct omap_id omap_ids[] __initdata = {
 static void __iomem *tap_base;
 static u16 tap_prod_id;
 
+void omap_get_die_id(struct omap_die_id *odi)
+{
+       odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_0);
+       odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_1);
+       odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_2);
+       odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3);
+}
+
 static void __init omap24xx_check_revision(void)
 {
        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 (file)
index 0000000..02ed3aa
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * OMAP2 CPU identification code
+ *
+ * Copyright (C) 2010 Kan-Ru Chen <kanru@0xlab.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef OMAP2_ARCH_ID_H
+#define OMAP2_ARCH_ID_H
+
+struct omap_die_id {
+       u32 id_0;
+       u32 id_1;
+       u32 id_2;
+       u32 id_3;
+};
+
+void omap_get_die_id(struct omap_die_id *odi);
+
+#endif