]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
omap4: omap_die_id support
authorPaul Kocialkowski <contact@paulk.fr>
Thu, 27 Aug 2015 17:37:10 +0000 (19:37 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 22 Oct 2015 18:17:20 +0000 (14:17 -0400)
This introduces omap4 support for omap_die_id, which matches the common
omap_die_id definition. It replaces board-specific code to grab the die id bits.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/cpu/armv7/omap4/hwinit.c
arch/arm/cpu/armv7/omap4/prcm-regs.c
arch/arm/include/asm/arch-omap4/omap.h
board/ti/panda/panda.c

index a68947faf115f410507ddad6e70a2726adcf3fc9..7c6638ca80dc30ac72cd743d9d80344c4d561808 100644 (file)
@@ -156,6 +156,14 @@ void init_omap_revision(void)
        }
 }
 
+void omap_die_id(unsigned int *die_id)
+{
+       die_id[0] = readl((*ctrl)->control_std_fuse_die_id_0);
+       die_id[1] = readl((*ctrl)->control_std_fuse_die_id_1);
+       die_id[2] = readl((*ctrl)->control_std_fuse_die_id_2);
+       die_id[3] = readl((*ctrl)->control_std_fuse_die_id_3);
+}
+
 #ifndef CONFIG_SYS_L2CACHE_OFF
 void v7_outer_cache_enable(void)
 {
index 8698ec7a486d07d98d15456184b17c6c93225467..a09581e55b7e6aa75bb2dd051fd81ab0d13375d5 100644 (file)
@@ -280,7 +280,10 @@ struct prcm_regs const omap4_prcm = {
 
 struct omap_sys_ctrl_regs const omap4_ctrl = {
        .control_status                         = 0x4A0022C4,
-       .control_id_code                        = 0x4A002204,
+       .control_std_fuse_die_id_0              = 0x4A002200,
+       .control_std_fuse_die_id_1              = 0x4A002208,
+       .control_std_fuse_die_id_2              = 0x4A00220C,
+       .control_std_fuse_die_id_3              = 0x4A002210,
        .control_std_fuse_opp_bgap              = 0x4a002260,
        .control_status                         = 0x4a0022c4,
        .control_ldosram_iva_voltage_ctrl       = 0x4A002320,
index 12b1a094461ed49ffd2057d16ce8e9374e52f24a..47127229506c53242394fdc76ec2d610e20437f8 100644 (file)
 
 /* CONTROL_ID_CODE */
 #define CONTROL_ID_CODE                0x4A002204
-#define STD_FUSE_DIE_ID_0      0x4A002200
-#define STD_FUSE_DIE_ID_1      0x4A002208
-#define STD_FUSE_DIE_ID_2      0x4A00220c
-#define STD_FUSE_DIE_ID_3      0x4A002210
 
 #define OMAP4_CONTROL_ID_CODE_ES1_0    0x0B85202F
 #define OMAP4_CONTROL_ID_CODE_ES2_0    0x1B85202F
index 92e1b639a757881be3c761e626d52a8940c122f2..4de7ea1872b6a74b8d0d963e6ee325bffbeb2ea6 100644 (file)
@@ -209,7 +209,7 @@ int misc_init_r(void)
 {
        int phy_type;
        u32 auxclk, altclksrc;
-       u32 id[4];
+       unsigned int die_id[4] = { 0 };
 
        /* EHCI is not supported on ES1.0 */
        if (omap_revision() == OMAP4430_ES1_0)
@@ -263,11 +263,8 @@ int misc_init_r(void)
 
        writel(altclksrc, &scrm->altclksrc);
 
-       id[0] = readl(STD_FUSE_DIE_ID_0);
-       id[1] = readl(STD_FUSE_DIE_ID_1);
-       id[2] = readl(STD_FUSE_DIE_ID_2);
-       id[3] = readl(STD_FUSE_DIE_ID_3);
-       usb_fake_mac_from_die_id(id);
+       omap_die_id(die_id);
+       usb_fake_mac_from_die_id(die_id);
 
        return 0;
 }