From patchwork Thu Aug 27 17:37:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 511371 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 0A5CC1401C7 for ; Fri, 28 Aug 2015 03:37:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5434B4B74D; Thu, 27 Aug 2015 19:37:53 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id I8fsu1030Mlc; Thu, 27 Aug 2015 19:37:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F3D54B758; Thu, 27 Aug 2015 19:37:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F2CD4B723 for ; Thu, 27 Aug 2015 19:37:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tMOOzvWFTEAH for ; Thu, 27 Aug 2015 19:37:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gagarine.paulk.fr (gagarine.paulk.fr [109.190.93.129]) by theia.denx.de (Postfix) with ESMTPS id E51E54B719 for ; Thu, 27 Aug 2015 19:37:36 +0200 (CEST) Received: by gagarine.paulk.fr (Postfix, from userid 65534) id 283F81FFF1; Thu, 27 Aug 2015 19:37:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on gagarine.paulk.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from localhost.localdomain (collins [192.168.1.129]) by gagarine.paulk.fr (Postfix) with ESMTP id E0C991FF68; Thu, 27 Aug 2015 19:37:27 +0200 (CEST) From: Paul Kocialkowski To: u-boot@lists.denx.de Date: Thu, 27 Aug 2015 19:37:10 +0200 Message-Id: <1440697034-28698-3-git-send-email-contact@paulk.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1440697034-28698-1-git-send-email-contact@paulk.fr> References: <1440697034-28698-1-git-send-email-contact@paulk.fr> Cc: Tom Rini Subject: [U-Boot] [PATCH 3/7] omap4: omap_die_id support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Tom Rini --- arch/arm/cpu/armv7/omap4/hwinit.c | 8 ++++++++ arch/arm/cpu/armv7/omap4/prcm-regs.c | 5 ++++- arch/arm/include/asm/arch-omap4/omap.h | 4 ---- board/ti/panda/panda.c | 9 +++------ 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/arch/arm/cpu/armv7/omap4/hwinit.c b/arch/arm/cpu/armv7/omap4/hwinit.c index a68947f..7c6638c 100644 --- a/arch/arm/cpu/armv7/omap4/hwinit.c +++ b/arch/arm/cpu/armv7/omap4/hwinit.c @@ -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) { diff --git a/arch/arm/cpu/armv7/omap4/prcm-regs.c b/arch/arm/cpu/armv7/omap4/prcm-regs.c index 8698ec7..a09581e 100644 --- a/arch/arm/cpu/armv7/omap4/prcm-regs.c +++ b/arch/arm/cpu/armv7/omap4/prcm-regs.c @@ -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, diff --git a/arch/arm/include/asm/arch-omap4/omap.h b/arch/arm/include/asm/arch-omap4/omap.h index 12b1a09..4712722 100644 --- a/arch/arm/include/asm/arch-omap4/omap.h +++ b/arch/arm/include/asm/arch-omap4/omap.h @@ -33,10 +33,6 @@ /* 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 diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c index 783ba35..79ec69e 100644 --- a/board/ti/panda/panda.c +++ b/board/ti/panda/panda.c @@ -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; }