linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] iseries: Use device tree /system-id in /proc/iSeries/config
@ 2006-07-13  7:52 Michael Ellerman
  2006-07-13  7:52 ` [PATCH 2/7] iseries: Move e2a()/strne2a() into their only caller Michael Ellerman
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Michael Ellerman @ 2006-07-13  7:52 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev

We export a bunch of info in /proc/iSeries/config. Currently we pull it
directly out of some iSeries specific structs, but we could use the device
tree instead, this saves decoding it twice and is a little neater.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---

 arch/powerpc/platforms/iseries/viopath.c |   27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

Index: to-merge/arch/powerpc/platforms/iseries/viopath.c
===================================================================
--- to-merge.orig/arch/powerpc/platforms/iseries/viopath.c
+++ to-merge/arch/powerpc/platforms/iseries/viopath.c
@@ -41,8 +41,8 @@
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/prom.h>
 #include <asm/iseries/hv_types.h>
-#include <asm/iseries/it_exp_vpd_panel.h>
 #include <asm/iseries/hv_lp_event.h>
 #include <asm/iseries/hv_lp_config.h>
 #include <asm/iseries/mf.h>
@@ -116,6 +116,7 @@ static int proc_viopath_show(struct seq_
 	dma_addr_t handle;
 	HvLpEvent_Rc hvrc;
 	DECLARE_MUTEX_LOCKED(Semaphore);
+	struct device_node *node;
 
 	buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL);
 	if (!buf)
@@ -143,20 +144,26 @@ static int proc_viopath_show(struct seq_
 
 	buf[HW_PAGE_SIZE-1] = '\0';
 	seq_printf(m, "%s", buf);
-	seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
-	seq_printf(m, "SRLNBR=%c%c%c%c%c%c%c\n",
-		   e2a(xItExtVpdPanel.mfgID[2]),
-		   e2a(xItExtVpdPanel.mfgID[3]),
-		   e2a(xItExtVpdPanel.systemSerial[1]),
-		   e2a(xItExtVpdPanel.systemSerial[2]),
-		   e2a(xItExtVpdPanel.systemSerial[3]),
-		   e2a(xItExtVpdPanel.systemSerial[4]),
-		   e2a(xItExtVpdPanel.systemSerial[5]));
 
 	dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE,
 			 DMA_FROM_DEVICE);
 	kfree(buf);
 
+	seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
+
+	node = of_find_node_by_path("/");
+	buf = NULL;
+	if (node != NULL)
+		buf = get_property(node, "system-id", NULL);
+
+	if (buf == NULL)
+		seq_printf(m, "SRLNBR=<UNKNOWN>\n");
+	else
+		/* Skip "IBM," on front of serial number, see dt.c */
+		seq_printf(m, "SRLNBR=%s\n", buf + 4);
+
+	of_node_put(node);
+
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-07-14  4:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-13  7:52 [PATCH 1/7] iseries: Use device tree /system-id in /proc/iSeries/config Michael Ellerman
2006-07-13  7:52 ` [PATCH 2/7] iseries: Move e2a()/strne2a() into their only caller Michael Ellerman
2006-07-13  7:52 ` [PATCH 3/7] iseries: Cleanup e2a() and strne2a() Michael Ellerman
2006-07-13  7:52 ` [PATCH 4/7] iseries: Make ItExtVpdPanel private to iSeries Michael Ellerman
2006-07-13  7:52 ` [PATCH 5/7] iseries: Make HvLpConfig_get(Primary)LpIndex functions Michael Ellerman
2006-07-13  7:52 ` [PATCH 6/7] iseries: Move ItLpNaca into platforms/iseries Michael Ellerman
2006-07-13  7:52 ` [PATCH 7/7] iseries: Move iommu_table_cb " Michael Ellerman
2006-07-14  4:25   ` [PATCH] " Michael Ellerman
2006-07-13  8:30 ` [PATCH 1/7] iseries: Use device tree /system-id in /proc/iSeries/config Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).