aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-07-13 03:52:01 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2006-07-13 04:41:43 -0400
commita749690ecf7ab55aa46df1698bcee3ec110612df (patch)
tree2e86beded7bc9e6b2dc6c37a78a1a4c44e6687c1
parent3da27289a8ecc688fc62c0961dfe89d392370480 (diff)
[POWERPC] iseries: Use device tree /system-id in /proc/iSeries/config
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> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 622a30149b48..efeb6ae9df64 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -41,8 +41,8 @@
41 41
42#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/uaccess.h> 43#include <asm/uaccess.h>
44#include <asm/prom.h>
44#include <asm/iseries/hv_types.h> 45#include <asm/iseries/hv_types.h>
45#include <asm/iseries/it_exp_vpd_panel.h>
46#include <asm/iseries/hv_lp_event.h> 46#include <asm/iseries/hv_lp_event.h>
47#include <asm/iseries/hv_lp_config.h> 47#include <asm/iseries/hv_lp_config.h>
48#include <asm/iseries/mf.h> 48#include <asm/iseries/mf.h>
@@ -116,6 +116,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
116 dma_addr_t handle; 116 dma_addr_t handle;
117 HvLpEvent_Rc hvrc; 117 HvLpEvent_Rc hvrc;
118 DECLARE_MUTEX_LOCKED(Semaphore); 118 DECLARE_MUTEX_LOCKED(Semaphore);
119 struct device_node *node;
119 120
120 buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL); 121 buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL);
121 if (!buf) 122 if (!buf)
@@ -143,20 +144,26 @@ static int proc_viopath_show(struct seq_file *m, void *v)
143 144
144 buf[HW_PAGE_SIZE-1] = '\0'; 145 buf[HW_PAGE_SIZE-1] = '\0';
145 seq_printf(m, "%s", buf); 146 seq_printf(m, "%s", buf);
146 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
147 seq_printf(m, "SRLNBR=%c%c%c%c%c%c%c\n",
148 e2a(xItExtVpdPanel.mfgID[2]),
149 e2a(xItExtVpdPanel.mfgID[3]),
150 e2a(xItExtVpdPanel.systemSerial[1]),
151 e2a(xItExtVpdPanel.systemSerial[2]),
152 e2a(xItExtVpdPanel.systemSerial[3]),
153 e2a(xItExtVpdPanel.systemSerial[4]),
154 e2a(xItExtVpdPanel.systemSerial[5]));
155 147
156 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE, 148 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE,
157 DMA_FROM_DEVICE); 149 DMA_FROM_DEVICE);
158 kfree(buf); 150 kfree(buf);
159 151
152 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
153
154 node = of_find_node_by_path("/");
155 buf = NULL;
156 if (node != NULL)
157 buf = get_property(node, "system-id", NULL);
158
159 if (buf == NULL)
160 seq_printf(m, "SRLNBR=<UNKNOWN>\n");
161 else
162 /* Skip "IBM," on front of serial number, see dt.c */
163 seq_printf(m, "SRLNBR=%s\n", buf + 4);
164
165 of_node_put(node);
166
160 return 0; 167 return 0;
161} 168}
162 169