From patchwork Tue Jul 6 01:10:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kan-Ru Chen X-Patchwork-Id: 110345 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o661Fjs5027510 for ; Tue, 6 Jul 2010 01:15:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745Ab0GFBPo (ORCPT ); Mon, 5 Jul 2010 21:15:44 -0400 Received: from cp20.secserverpros.com ([67.220.217.187]:60680 "EHLO cp20.secserverpros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754895Ab0GFBPl (ORCPT ); Mon, 5 Jul 2010 21:15:41 -0400 Received: from 61-30-10-70.static.tfn.net.tw ([61.30.10.70] helo=kanru.info) by cp20.secserverpros.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OVwl0-0006lT-KU for linux-omap@vger.kernel.org; Tue, 06 Jul 2010 01:15:32 +0000 Received: from kanru (uid 1000) (envelope-from kanru@kanru.info) id 1fb79 by kanru.info (DragonFly Mail Agent) Tue, 06 Jul 2010 09:10:14 +0800 From: Kan-Ru Chen To: linux-omap@vger.kernel.org Cc: Thomas Weber , Kan-Ru Chen , Tony Lindgren Subject: [PATCHv2 1/3] omap: Add new interface omap_get_die_id Date: Tue, 6 Jul 2010 09:10:02 +0800 Message-Id: <1278378604-15802-2-git-send-email-kanru@0xlab.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1278378604-15802-1-git-send-email-kanru@0xlab.org> References: <1278378604-15802-1-git-send-email-kanru@0xlab.org> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp20.secserverpros.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - kanru.info X-Source: X-Source-Args: X-Source-Dir: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 06 Jul 2010 01:15:45 +0000 (UTC) diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 37b8a1a..80bd1cd 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -25,6 +25,8 @@ #include #include +#include + 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); +} + 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 index 0000000..02ed3aa --- /dev/null +++ b/arch/arm/mach-omap2/include/mach/id.h @@ -0,0 +1,22 @@ +/* + * OMAP2 CPU identification code + * + * Copyright (C) 2010 Kan-Ru Chen + * + * 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