From patchwork Tue Apr 27 13:14:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 95427 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3RDFTPK027598 for ; Tue, 27 Apr 2010 13:15:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971Ab0D0NP1 (ORCPT ); Tue, 27 Apr 2010 09:15:27 -0400 Received: from smtp.nokia.com ([192.100.122.233]:17679 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055Ab0D0NP0 (ORCPT ); Tue, 27 Apr 2010 09:15:26 -0400 Received: from esebh105.NOE.Nokia.com (esebh105.ntc.nokia.com [172.21.138.211]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o3RDF5x4027317; Tue, 27 Apr 2010 16:15:19 +0300 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 27 Apr 2010 16:15:05 +0300 Received: from mgw-sa02.ext.nokia.com ([147.243.1.48]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 27 Apr 2010 16:15:04 +0300 Received: from manganga.research.nokia.com (esdhcp04199.research.nokia.com [172.21.41.99]) by mgw-sa02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o3RDEuIB006638; Tue, 27 Apr 2010 16:15:03 +0300 From: Eduardo Valentin To: linux-arm-kernel@lists.infradead.org, Linux-OMAP Cc: ext Tony Lindgren , ext Kevin Hilman , "\\\"De-Schrijver Peter (Nokia-D/Helsinki)\\\"" , santosh.shilimkar@ti.com, Eduardo Valentin Subject: [PATCHv2 4/4] OMAP3: PM: export chip IDCODE, Production ID and Die ID Date: Tue, 27 Apr 2010 16:14:15 +0300 Message-Id: <1272374055-9656-5-git-send-email-eduardo.valentin@nokia.com> X-Mailer: git-send-email 1.7.0.4.361.g8b5fe.dirty In-Reply-To: <1272374055-9656-1-git-send-email-eduardo.valentin@nokia.com> References: <1272374055-9656-1-git-send-email-eduardo.valentin@nokia.com> X-OriginalArrivalTime: 27 Apr 2010 13:15:04.0632 (UTC) FILETIME=[A6862B80:01CAE60B] X-Nokia-AV: Clean 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, 27 Apr 2010 13:15:29 +0000 (UTC) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 839b21b..6a84e6c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1809,6 +1809,8 @@ and is between 256 and 4096 characters. It is defined in the file waiting for the ACK, so if this is set too high interrupts *may* be lost! + omap3_die_id [OMAP] Append DIE ID info under /proc/cpuinfo + omap_mux= [OMAP] Override bootloader pin multiplexing. Format: ... For example, to override I2C bus2: diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 2455dcc..462c23a 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -169,3 +169,13 @@ config OMAP3_SDRC_AC_TIMING wish to say no. Selecting yes without understanding what is going on could result in system crashes; +config OMAP3_EXPORT_DIE_ID + bool "Export DIE ID code under /proc/cpuinfo" + depends on ARCH_OMAP3 + default n + help + Say Y here if you need DIE ID code to be exported via /proc/cpuinfo + in production systems. You will need also to explicitly flag it by + appending the "omap3_die_id" parameter to your boot command line. + + diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 75e36a5..14c1fa8 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -76,6 +76,10 @@ EXPORT_SYMBOL(omap_type); /*----------------------------------------------------------------------------*/ #define OMAP_TAP_IDCODE 0x0204 +#define OMAP_TAP_PROD_ID_0 0x0208 +#define OMAP_TAP_PROD_ID_1 0x020c +#define OMAP_TAP_PROD_ID_2 0x0210 +#define OMAP_TAP_PROD_ID_3 0x0214 #define OMAP_TAP_DIE_ID_0 0x0218 #define OMAP_TAP_DIE_ID_1 0x021C #define OMAP_TAP_DIE_ID_2 0x0220 @@ -306,6 +310,7 @@ void __init omap4_check_revision(void) void __init omap3_cpuinfo(void) { + int sz; u8 rev = GET_OMAP_REVISION(); char cpu_name[16], cpu_rev[16]; @@ -375,7 +380,36 @@ void __init omap3_cpuinfo(void) OMAP3_SHOW_FEATURE(192mhz_clk); printk(")\n"); + + /* Append OMAP3 IDCODE, Production ID system_soc_info */ + sz = strlen(system_soc_info); + snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz, + "\n\tIDCODE\t: %08x\n\tPr. ID\t: %08x %08x %08x %08x", + read_tap_reg(OMAP_TAP_IDCODE), + read_tap_reg(OMAP_TAP_PROD_ID_0), + read_tap_reg(OMAP_TAP_PROD_ID_1), + read_tap_reg(OMAP_TAP_PROD_ID_2), + read_tap_reg(OMAP_TAP_PROD_ID_3)); + +} + +#ifdef CONFIG_OMAP3_EXPORT_DIE_ID +static int __init omap3_die_id_setup(char *s) +{ + int sz; + + sz = strlen(system_soc_info); + snprintf(system_soc_info + sz, SYSTEM_SOC_INFO_SIZE - sz, + "\n\tDie ID\t: %08x %08x %08x %08x", + read_tap_reg(OMAP_TAP_DIE_ID_0), + read_tap_reg(OMAP_TAP_DIE_ID_1), + read_tap_reg(OMAP_TAP_DIE_ID_2), + read_tap_reg(OMAP_TAP_DIE_ID_3)); + + return 1; } +__setup("omap3_die_id", omap3_die_id_setup); +#endif /* * Try to detect the exact revision of the omap we're running on