From patchwork Mon May 10 10:37:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 98138 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 o4AAc28L006717 for ; Mon, 10 May 2010 10:38:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634Ab0EJKhU (ORCPT ); Mon, 10 May 2010 06:37:20 -0400 Received: from smtp.nokia.com ([192.100.122.233]:36832 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756604Ab0EJKhO (ORCPT ); Mon, 10 May 2010 06:37:14 -0400 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx06.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o4AAZpmh023982; Mon, 10 May 2010 13:35:56 +0300 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 May 2010 13:35:43 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 10 May 2010 13:35:42 +0300 Received: from manganga.research.nokia.com (esdhcp04199.research.nokia.com [172.21.41.99]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o4AAZPpY022644; Mon, 10 May 2010 13:35:36 +0300 From: Eduardo Valentin To: LKML , linux-arm-kernel@lists.infradead.org, Linux-OMAP Cc: Russell King , Andrew Morton , ext Tony Lindgren , ext Kevin Hilman , Peter De-Schrijver , santosh.shilimkar@ti.com, Ambresh , felipe.balbi@nokia.com, Eduardo Valentin Subject: [PATCHv4 3/4] mach-omap1: export omap1 info under /proc/socinfo Date: Mon, 10 May 2010 13:37:36 +0300 Message-Id: <1273487857-32281-4-git-send-email-eduardo.valentin@nokia.com> X-Mailer: git-send-email 1.7.0.4.361.g8b5fe.dirty In-Reply-To: <1273487857-32281-1-git-send-email-eduardo.valentin@nokia.com> References: <1273487857-32281-1-git-send-email-eduardo.valentin@nokia.com> X-OriginalArrivalTime: 10 May 2010 10:35:43.0353 (UTC) FILETIME=[8AED8690:01CAF02C] 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]); Mon, 10 May 2010 10:38:03 +0000 (UTC) diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index a0e3560..917892b 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #define OMAP_DIE_ID_0 0xfffe1800 @@ -118,9 +119,12 @@ static u8 __init omap_get_die_rev(void) return die_rev; } +#define SOCINFO_SZ 128 +static char socinfo[SOCINFO_SZ]; + void __init omap_check_revision(void) { - int i; + int i, sz; u16 jtag_id; u8 die_rev; u32 omap_id; @@ -194,11 +198,40 @@ void __init omap_check_revision(void) printk(KERN_INFO "Unknown OMAP cpu type: 0x%02x\n", cpu_type); } - printk(KERN_INFO "OMAP%04x", omap_revision >> 16); + sz = snprintf(socinfo, SOCINFO_SZ, "OMAP%04x", omap_revision >> 16); if ((omap_revision >> 8) & 0xff) - printk(KERN_INFO "%x", (omap_revision >> 8) & 0xff); - printk(KERN_INFO " revision %i handled as %02xxx id: %08x%08x\n", - die_rev, omap_revision & 0xff, system_serial_low, - system_serial_high); + snprintf(socinfo + sz, SOCINFO_SZ - sz, "%x", + (omap_revision >> 8) & 0xff); + pr_info("%s revision %i handled as %02xxx id: %08x%08x\n", + socinfo, die_rev, omap_revision & 0xff, system_serial_low, + system_serial_high); +} + +static int c_show(struct seq_file *m, void *v) +{ + seq_printf(m, "SoC\t: %s\n", socinfo); + + return 0; +} + +static void *c_start(struct seq_file *m, loff_t *pos) +{ + return *pos < 1 ? (void *)1 : NULL; } +static void *c_next(struct seq_file *m, void *v, loff_t *pos) +{ + ++*pos; + return NULL; +} + +static void c_stop(struct seq_file *m, void *v) +{ +} + +const struct seq_operations socinfo_op = { + .start = c_start, + .next = c_next, + .stop = c_stop, + .show = c_show +};