aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/iseries')
-rw-r--r--arch/powerpc/platforms/iseries/Kconfig8
-rw-r--r--arch/powerpc/platforms/iseries/dt.c45
-rw-r--r--arch/powerpc/platforms/iseries/hvlpconfig.c13
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c19
-rw-r--r--arch/powerpc/platforms/iseries/it_exp_vpd_panel.h51
-rw-r--r--arch/powerpc/platforms/iseries/it_lp_naca.h80
-rw-r--r--arch/powerpc/platforms/iseries/lpardata.c6
-rw-r--r--arch/powerpc/platforms/iseries/lpevents.c2
-rw-r--r--arch/powerpc/platforms/iseries/main_store.h126
-rw-r--r--arch/powerpc/platforms/iseries/pci.c289
-rw-r--r--arch/powerpc/platforms/iseries/setup.c1
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c28
-rw-r--r--arch/powerpc/platforms/iseries/vpdinfo.c22
13 files changed, 540 insertions, 150 deletions
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
index 3d957a30c8c2..887b68804e6d 100644
--- a/arch/powerpc/platforms/iseries/Kconfig
+++ b/arch/powerpc/platforms/iseries/Kconfig
@@ -3,13 +3,17 @@ menu "iSeries device drivers"
3 depends on PPC_ISERIES 3 depends on PPC_ISERIES
4 4
5config VIOCONS 5config VIOCONS
6 tristate "iSeries Virtual Console Support" 6 tristate "iSeries Virtual Console Support (Obsolete)"
7 help
8 This is the old virtual console driver for legacy iSeries.
9 You should use the iSeries Hypervisor Virtual Console
10 support instead.
7 11
8config VIODASD 12config VIODASD
9 tristate "iSeries Virtual I/O disk support" 13 tristate "iSeries Virtual I/O disk support"
10 help 14 help
11 If you are running on an iSeries system and you want to use 15 If you are running on an iSeries system and you want to use
12 virtual disks created and managed by OS/400, say Y. 16 virtual disks created and managed by OS/400, say Y.
13 17
14config VIOCD 18config VIOCD
15 tristate "iSeries Virtual I/O CD support" 19 tristate "iSeries Virtual I/O CD support"
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c
index d194140c1ebf..e305deee7f44 100644
--- a/arch/powerpc/platforms/iseries/dt.c
+++ b/arch/powerpc/platforms/iseries/dt.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2005-2006 Michael Ellerman, IBM Corporation 2 * Copyright (C) 2005-2006 Michael Ellerman, IBM Corporation
3 * Copyright (C) 2000-2004, IBM Corporation
3 * 4 *
4 * Description: 5 * Description:
5 * This file contains all the routines to build a flattened device 6 * This file contains all the routines to build a flattened device
@@ -33,13 +34,13 @@
33#include <asm/iseries/hv_types.h> 34#include <asm/iseries/hv_types.h>
34#include <asm/iseries/hv_lp_config.h> 35#include <asm/iseries/hv_lp_config.h>
35#include <asm/iseries/hv_call_xm.h> 36#include <asm/iseries/hv_call_xm.h>
36#include <asm/iseries/it_exp_vpd_panel.h>
37#include <asm/udbg.h> 37#include <asm/udbg.h>
38 38
39#include "processor_vpd.h" 39#include "processor_vpd.h"
40#include "call_hpt.h" 40#include "call_hpt.h"
41#include "call_pci.h" 41#include "call_pci.h"
42#include "pci.h" 42#include "pci.h"
43#include "it_exp_vpd_panel.h"
43 44
44#ifdef DEBUG 45#ifdef DEBUG
45#define DBG(fmt...) udbg_printf(fmt) 46#define DBG(fmt...) udbg_printf(fmt)
@@ -76,6 +77,43 @@ static char __initdata device_type_pci[] = "pci";
76static char __initdata device_type_vdevice[] = "vdevice"; 77static char __initdata device_type_vdevice[] = "vdevice";
77static char __initdata device_type_vscsi[] = "vscsi"; 78static char __initdata device_type_vscsi[] = "vscsi";
78 79
80
81/* EBCDIC to ASCII conversion routines */
82
83static unsigned char __init e2a(unsigned char x)
84{
85 switch (x) {
86 case 0x81 ... 0x89:
87 return x - 0x81 + 'a';
88 case 0x91 ... 0x99:
89 return x - 0x91 + 'j';
90 case 0xA2 ... 0xA9:
91 return x - 0xA2 + 's';
92 case 0xC1 ... 0xC9:
93 return x - 0xC1 + 'A';
94 case 0xD1 ... 0xD9:
95 return x - 0xD1 + 'J';
96 case 0xE2 ... 0xE9:
97 return x - 0xE2 + 'S';
98 case 0xF0 ... 0xF9:
99 return x - 0xF0 + '0';
100 }
101 return ' ';
102}
103
104static unsigned char * __init strne2a(unsigned char *dest,
105 const unsigned char *src, size_t n)
106{
107 int i;
108
109 n = strnlen(src, n);
110
111 for (i = 0; i < n; i++)
112 dest[i] = e2a(src[i]);
113
114 return dest;
115}
116
79static struct iseries_flat_dt * __init dt_init(void) 117static struct iseries_flat_dt * __init dt_init(void)
80{ 118{
81 struct iseries_flat_dt *dt; 119 struct iseries_flat_dt *dt;
@@ -298,7 +336,8 @@ static void __init dt_vdevices(struct iseries_flat_dt *dt)
298 dt_prop_u32(dt, "#address-cells", 1); 336 dt_prop_u32(dt, "#address-cells", 1);
299 dt_prop_u32(dt, "#size-cells", 0); 337 dt_prop_u32(dt, "#size-cells", 0);
300 338
301 dt_do_vdevice(dt, "vty", reg, -1, device_type_serial, NULL, 1); 339 dt_do_vdevice(dt, "vty", reg, -1, device_type_serial,
340 "IBM,iSeries-vty", 1);
302 reg++; 341 reg++;
303 342
304 dt_do_vdevice(dt, "v-scsi", reg, -1, device_type_vscsi, 343 dt_do_vdevice(dt, "v-scsi", reg, -1, device_type_vscsi,
diff --git a/arch/powerpc/platforms/iseries/hvlpconfig.c b/arch/powerpc/platforms/iseries/hvlpconfig.c
index 663a1affb4bb..f0475f0b1853 100644
--- a/arch/powerpc/platforms/iseries/hvlpconfig.c
+++ b/arch/powerpc/platforms/iseries/hvlpconfig.c
@@ -18,9 +18,22 @@
18 18
19#include <linux/module.h> 19#include <linux/module.h>
20#include <asm/iseries/hv_lp_config.h> 20#include <asm/iseries/hv_lp_config.h>
21#include "it_lp_naca.h"
21 22
22HvLpIndex HvLpConfig_getLpIndex_outline(void) 23HvLpIndex HvLpConfig_getLpIndex_outline(void)
23{ 24{
24 return HvLpConfig_getLpIndex(); 25 return HvLpConfig_getLpIndex();
25} 26}
26EXPORT_SYMBOL(HvLpConfig_getLpIndex_outline); 27EXPORT_SYMBOL(HvLpConfig_getLpIndex_outline);
28
29HvLpIndex HvLpConfig_getLpIndex(void)
30{
31 return itLpNaca.xLpIndex;
32}
33EXPORT_SYMBOL(HvLpConfig_getLpIndex);
34
35HvLpIndex HvLpConfig_getPrimaryLpIndex(void)
36{
37 return itLpNaca.xPrimaryLpIndex;
38}
39EXPORT_SYMBOL_GPL(HvLpConfig_getPrimaryLpIndex);
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index e3bd2015f2c9..f4cbbcf8773a 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -88,6 +88,23 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages)
88} 88}
89 89
90/* 90/*
91 * Structure passed to HvCallXm_getTceTableParms
92 */
93struct iommu_table_cb {
94 unsigned long itc_busno; /* Bus number for this tce table */
95 unsigned long itc_start; /* Will be NULL for secondary */
96 unsigned long itc_totalsize; /* Size (in pages) of whole table */
97 unsigned long itc_offset; /* Index into real tce table of the
98 start of our section */
99 unsigned long itc_size; /* Size (in pages) of our section */
100 unsigned long itc_index; /* Index of this tce table */
101 unsigned short itc_maxtables; /* Max num of tables for partition */
102 unsigned char itc_virtbus; /* Flag to indicate virtual bus */
103 unsigned char itc_slotno; /* IOA Tce Slot Index */
104 unsigned char itc_rsvd[4];
105};
106
107/*
91 * Call Hv with the architected data structure to get TCE table info. 108 * Call Hv with the architected data structure to get TCE table info.
92 * info. Put the returned data into the Linux representation of the 109 * info. Put the returned data into the Linux representation of the
93 * TCE table data. 110 * TCE table data.
@@ -162,7 +179,7 @@ void iommu_devnode_init_iSeries(struct device_node *dn)
162{ 179{
163 struct iommu_table *tbl; 180 struct iommu_table *tbl;
164 struct pci_dn *pdn = PCI_DN(dn); 181 struct pci_dn *pdn = PCI_DN(dn);
165 u32 *lsn = (u32 *)get_property(dn, "linux,logical-slot-number", NULL); 182 const u32 *lsn = get_property(dn, "linux,logical-slot-number", NULL);
166 183
167 BUG_ON(lsn == NULL); 184 BUG_ON(lsn == NULL);
168 185
diff --git a/arch/powerpc/platforms/iseries/it_exp_vpd_panel.h b/arch/powerpc/platforms/iseries/it_exp_vpd_panel.h
new file mode 100644
index 000000000000..6de9097b7f57
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/it_exp_vpd_panel.h
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2002 Dave Boutcher IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _PLATFORMS_ISERIES_IT_EXT_VPD_PANEL_H
19#define _PLATFORMS_ISERIES_IT_EXT_VPD_PANEL_H
20
21/*
22 * This struct maps the panel information
23 *
24 * Warning:
25 * This data must match the architecture for the panel information
26 */
27
28#include <asm/types.h>
29
30struct ItExtVpdPanel {
31 /* Definition of the Extended Vpd On Panel Data Area */
32 char systemSerial[8];
33 char mfgID[4];
34 char reserved1[24];
35 char machineType[4];
36 char systemID[6];
37 char somUniqueCnt[4];
38 char serialNumberCount;
39 char reserved2[7];
40 u16 bbu3;
41 u16 bbu2;
42 u16 bbu1;
43 char xLocationLabel[8];
44 u8 xRsvd1[6];
45 u16 xFrameId;
46 u8 xRsvd2[48];
47};
48
49extern struct ItExtVpdPanel xItExtVpdPanel;
50
51#endif /* _PLATFORMS_ISERIES_IT_EXT_VPD_PANEL_H */
diff --git a/arch/powerpc/platforms/iseries/it_lp_naca.h b/arch/powerpc/platforms/iseries/it_lp_naca.h
new file mode 100644
index 000000000000..9bbf58986819
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/it_lp_naca.h
@@ -0,0 +1,80 @@
1/*
2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _PLATFORMS_ISERIES_IT_LP_NACA_H
19#define _PLATFORMS_ISERIES_IT_LP_NACA_H
20
21#include <linux/types.h>
22
23/*
24 * This control block contains the data that is shared between the
25 * hypervisor (PLIC) and the OS.
26 */
27
28struct ItLpNaca {
29// CACHE_LINE_1 0x0000 - 0x007F Contains read-only data
30 u32 xDesc; // Eye catcher x00-x03
31 u16 xSize; // Size of this class x04-x05
32 u16 xIntHdlrOffset; // Offset to IntHdlr array x06-x07
33 u8 xMaxIntHdlrEntries; // Number of entries in array x08-x08
34 u8 xPrimaryLpIndex; // LP Index of Primary x09-x09
35 u8 xServiceLpIndex; // LP Ind of Service Focal Pointx0A-x0A
36 u8 xLpIndex; // LP Index x0B-x0B
37 u16 xMaxLpQueues; // Number of allocated queues x0C-x0D
38 u16 xLpQueueOffset; // Offset to start of LP queues x0E-x0F
39 u8 xPirEnvironMode; // Piranha or hardware x10-x10
40 u8 xPirConsoleMode; // Piranha console indicator x11-x11
41 u8 xPirDasdMode; // Piranha dasd indicator x12-x12
42 u8 xRsvd1_0[5]; // Reserved for Piranha related x13-x17
43 u8 flags; // flags, see below x18-x1F
44 u8 xSpVpdFormat; // VPD areas are in CSP format ...
45 u8 xIntProcRatio; // Ratio of int procs to procs ...
46 u8 xRsvd1_2[5]; // Reserved ...
47 u16 xRsvd1_3; // Reserved x20-x21
48 u16 xPlicVrmIndex; // VRM index of PLIC x22-x23
49 u16 xMinSupportedSlicVrmInd;// Min supported OS VRM index x24-x25
50 u16 xMinCompatableSlicVrmInd;// Min compatible OS VRM index x26-x27
51 u64 xLoadAreaAddr; // ER address of load area x28-x2F
52 u32 xLoadAreaChunks; // Chunks for the load area x30-x33
53 u32 xPaseSysCallCRMask; // Mask used to test CR before x34-x37
54 // doing an ASR switch on PASE
55 // system call.
56 u64 xSlicSegmentTablePtr; // Pointer to Slic seg table. x38-x3f
57 u8 xRsvd1_4[64]; // x40-x7F
58
59// CACHE_LINE_2 0x0080 - 0x00FF Contains local read-write data
60 u8 xRsvd2_0[128]; // Reserved x00-x7F
61
62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators
63// NB: Padding required to keep xInterrruptHdlr at x300 which is required
64// for v4r4 PLIC.
65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F
66 u8 xRsvd3_0[384]; // Reserved 180-2FF
67
68// CACHE_LINE_7-8 0x0300 - 0x03FF Contains the address of the OS interrupt
69// handlers
70 u64 xInterruptHdlr[32]; // Interrupt handlers 300-x3FF
71};
72
73extern struct ItLpNaca itLpNaca;
74
75#define ITLPNACA_LPAR 0x80 /* Is LPAR installed on the system */
76#define ITLPNACA_PARTITIONED 0x40 /* Is the system partitioned */
77#define ITLPNACA_HWSYNCEDTBS 0x20 /* Hardware synced TBs */
78#define ITLPNACA_HMTINT 0x10 /* Utilize MHT for interrupts */
79
80#endif /* _PLATFORMS_ISERIES_IT_LP_NACA_H */
diff --git a/arch/powerpc/platforms/iseries/lpardata.c b/arch/powerpc/platforms/iseries/lpardata.c
index a7769445d6c7..8162049bb04d 100644
--- a/arch/powerpc/platforms/iseries/lpardata.c
+++ b/arch/powerpc/platforms/iseries/lpardata.c
@@ -13,12 +13,10 @@
13#include <asm/processor.h> 13#include <asm/processor.h>
14#include <asm/ptrace.h> 14#include <asm/ptrace.h>
15#include <asm/abs_addr.h> 15#include <asm/abs_addr.h>
16#include <asm/iseries/it_lp_naca.h>
17#include <asm/lppaca.h> 16#include <asm/lppaca.h>
18#include <asm/iseries/it_lp_reg_save.h> 17#include <asm/iseries/it_lp_reg_save.h>
19#include <asm/paca.h> 18#include <asm/paca.h>
20#include <asm/iseries/lpar_map.h> 19#include <asm/iseries/lpar_map.h>
21#include <asm/iseries/it_exp_vpd_panel.h>
22#include <asm/iseries/it_lp_queue.h> 20#include <asm/iseries/it_lp_queue.h>
23 21
24#include "naca.h" 22#include "naca.h"
@@ -27,6 +25,8 @@
27#include "ipl_parms.h" 25#include "ipl_parms.h"
28#include "processor_vpd.h" 26#include "processor_vpd.h"
29#include "release_data.h" 27#include "release_data.h"
28#include "it_exp_vpd_panel.h"
29#include "it_lp_naca.h"
30 30
31/* The HvReleaseData is the root of the information shared between 31/* The HvReleaseData is the root of the information shared between
32 * the hypervisor and Linux. 32 * the hypervisor and Linux.
@@ -127,14 +127,12 @@ struct ItLpNaca itLpNaca = {
127 (u64)instruction_access_slb_iSeries /* 0x480 I-SLB */ 127 (u64)instruction_access_slb_iSeries /* 0x480 I-SLB */
128 } 128 }
129}; 129};
130EXPORT_SYMBOL(itLpNaca);
131 130
132/* May be filled in by the hypervisor so cannot end up in the BSS */ 131/* May be filled in by the hypervisor so cannot end up in the BSS */
133struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data"))); 132struct ItIplParmsReal xItIplParmsReal __attribute__((__section__(".data")));
134 133
135/* May be filled in by the hypervisor so cannot end up in the BSS */ 134/* May be filled in by the hypervisor so cannot end up in the BSS */
136struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data"))); 135struct ItExtVpdPanel xItExtVpdPanel __attribute__((__section__(".data")));
137EXPORT_SYMBOL(xItExtVpdPanel);
138 136
139#define maxPhysicalProcessors 32 137#define maxPhysicalProcessors 32
140 138
diff --git a/arch/powerpc/platforms/iseries/lpevents.c b/arch/powerpc/platforms/iseries/lpevents.c
index 2a9f81ea27d6..98c1c2440aad 100644
--- a/arch/powerpc/platforms/iseries/lpevents.c
+++ b/arch/powerpc/platforms/iseries/lpevents.c
@@ -20,7 +20,7 @@
20#include <asm/iseries/it_lp_queue.h> 20#include <asm/iseries/it_lp_queue.h>
21#include <asm/iseries/hv_lp_event.h> 21#include <asm/iseries/hv_lp_event.h>
22#include <asm/iseries/hv_call_event.h> 22#include <asm/iseries/hv_call_event.h>
23#include <asm/iseries/it_lp_naca.h> 23#include "it_lp_naca.h"
24 24
25/* 25/*
26 * The LpQueue is used to pass event data from the hypervisor to 26 * The LpQueue is used to pass event data from the hypervisor to
diff --git a/arch/powerpc/platforms/iseries/main_store.h b/arch/powerpc/platforms/iseries/main_store.h
index 74f6889f834f..1a7a3f50e40b 100644
--- a/arch/powerpc/platforms/iseries/main_store.h
+++ b/arch/powerpc/platforms/iseries/main_store.h
@@ -61,9 +61,9 @@ struct IoHriMainStoreSegment4 {
61}; 61};
62 62
63/* Main Store VPD for Power4 */ 63/* Main Store VPD for Power4 */
64struct IoHriMainStoreChipInfo1 { 64struct __attribute((packed)) IoHriMainStoreChipInfo1 {
65 u32 chipMfgID __attribute((packed)); 65 u32 chipMfgID;
66 char chipECLevel[4] __attribute((packed)); 66 char chipECLevel[4];
67}; 67};
68 68
69struct IoHriMainStoreVpdIdData { 69struct IoHriMainStoreVpdIdData {
@@ -73,72 +73,72 @@ struct IoHriMainStoreVpdIdData {
73 char serialNumber[12]; 73 char serialNumber[12];
74}; 74};
75 75
76struct IoHriMainStoreVpdFruData { 76struct __attribute((packed)) IoHriMainStoreVpdFruData {
77 char fruLabel[8] __attribute((packed)); 77 char fruLabel[8];
78 u8 numberOfSlots __attribute((packed)); 78 u8 numberOfSlots;
79 u8 pluggingType __attribute((packed)); 79 u8 pluggingType;
80 u16 slotMapIndex __attribute((packed)); 80 u16 slotMapIndex;
81}; 81};
82 82
83struct IoHriMainStoreAdrRangeBlock { 83struct __attribute((packed)) IoHriMainStoreAdrRangeBlock {
84 void *blockStart __attribute((packed)); 84 void *blockStart;
85 void *blockEnd __attribute((packed)); 85 void *blockEnd;
86 u32 blockProcChipId __attribute((packed)); 86 u32 blockProcChipId;
87}; 87};
88 88
89#define MaxAreaAdrRangeBlocks 4 89#define MaxAreaAdrRangeBlocks 4
90 90
91struct IoHriMainStoreArea4 { 91struct __attribute((packed)) IoHriMainStoreArea4 {
92 u32 msVpdFormat __attribute((packed)); 92 u32 msVpdFormat;
93 u8 containedVpdType __attribute((packed)); 93 u8 containedVpdType;
94 u8 reserved1 __attribute((packed)); 94 u8 reserved1;
95 u16 reserved2 __attribute((packed)); 95 u16 reserved2;
96 96
97 u64 msExists __attribute((packed)); 97 u64 msExists;
98 u64 msFunctional __attribute((packed)); 98 u64 msFunctional;
99 99
100 u32 memorySize __attribute((packed)); 100 u32 memorySize;
101 u32 procNodeId __attribute((packed)); 101 u32 procNodeId;
102 102
103 u32 numAdrRangeBlocks __attribute((packed)); 103 u32 numAdrRangeBlocks;
104 struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks] __attribute((packed)); 104 struct IoHriMainStoreAdrRangeBlock xAdrRangeBlock[MaxAreaAdrRangeBlocks];
105 105
106 struct IoHriMainStoreChipInfo1 chipInfo0 __attribute((packed)); 106 struct IoHriMainStoreChipInfo1 chipInfo0;
107 struct IoHriMainStoreChipInfo1 chipInfo1 __attribute((packed)); 107 struct IoHriMainStoreChipInfo1 chipInfo1;
108 struct IoHriMainStoreChipInfo1 chipInfo2 __attribute((packed)); 108 struct IoHriMainStoreChipInfo1 chipInfo2;
109 struct IoHriMainStoreChipInfo1 chipInfo3 __attribute((packed)); 109 struct IoHriMainStoreChipInfo1 chipInfo3;
110 struct IoHriMainStoreChipInfo1 chipInfo4 __attribute((packed)); 110 struct IoHriMainStoreChipInfo1 chipInfo4;
111 struct IoHriMainStoreChipInfo1 chipInfo5 __attribute((packed)); 111 struct IoHriMainStoreChipInfo1 chipInfo5;
112 struct IoHriMainStoreChipInfo1 chipInfo6 __attribute((packed)); 112 struct IoHriMainStoreChipInfo1 chipInfo6;
113 struct IoHriMainStoreChipInfo1 chipInfo7 __attribute((packed)); 113 struct IoHriMainStoreChipInfo1 chipInfo7;
114 114
115 void *msRamAreaArray __attribute((packed)); 115 void *msRamAreaArray;
116 u32 msRamAreaArrayNumEntries __attribute((packed)); 116 u32 msRamAreaArrayNumEntries;
117 u32 msRamAreaArrayEntrySize __attribute((packed)); 117 u32 msRamAreaArrayEntrySize;
118 118
119 u32 numaDimmExists __attribute((packed)); 119 u32 numaDimmExists;
120 u32 numaDimmFunctional __attribute((packed)); 120 u32 numaDimmFunctional;
121 void *numaDimmArray __attribute((packed)); 121 void *numaDimmArray;
122 u32 numaDimmArrayNumEntries __attribute((packed)); 122 u32 numaDimmArrayNumEntries;
123 u32 numaDimmArrayEntrySize __attribute((packed)); 123 u32 numaDimmArrayEntrySize;
124 124
125 struct IoHriMainStoreVpdIdData idData __attribute((packed)); 125 struct IoHriMainStoreVpdIdData idData;
126 126
127 u64 powerData __attribute((packed)); 127 u64 powerData;
128 u64 cardAssemblyPartNum __attribute((packed)); 128 u64 cardAssemblyPartNum;
129 u64 chipSerialNum __attribute((packed)); 129 u64 chipSerialNum;
130 130
131 u64 reserved3 __attribute((packed)); 131 u64 reserved3;
132 char reserved4[16] __attribute((packed)); 132 char reserved4[16];
133 133
134 struct IoHriMainStoreVpdFruData fruData __attribute((packed)); 134 struct IoHriMainStoreVpdFruData fruData;
135 135
136 u8 vpdPortNum __attribute((packed)); 136 u8 vpdPortNum;
137 u8 reserved5 __attribute((packed)); 137 u8 reserved5;
138 u8 frameId __attribute((packed)); 138 u8 frameId;
139 u8 rackUnit __attribute((packed)); 139 u8 rackUnit;
140 char asciiKeywordVpd[256] __attribute((packed)); 140 char asciiKeywordVpd[256];
141 u32 reserved6 __attribute((packed)); 141 u32 reserved6;
142}; 142};
143 143
144 144
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 35bcc98111f5..3eb12065df23 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -34,6 +34,7 @@
34#include <asm/pci-bridge.h> 34#include <asm/pci-bridge.h>
35#include <asm/iommu.h> 35#include <asm/iommu.h>
36#include <asm/abs_addr.h> 36#include <asm/abs_addr.h>
37#include <asm/firmware.h>
37 38
38#include <asm/iseries/hv_call_xm.h> 39#include <asm/iseries/hv_call_xm.h>
39#include <asm/iseries/mf.h> 40#include <asm/iseries/mf.h>
@@ -176,12 +177,12 @@ void iSeries_pcibios_init(void)
176 } 177 }
177 while ((node = of_get_next_child(root, node)) != NULL) { 178 while ((node = of_get_next_child(root, node)) != NULL) {
178 HvBusNumber bus; 179 HvBusNumber bus;
179 u32 *busp; 180 const u32 *busp;
180 181
181 if ((node->type == NULL) || (strcmp(node->type, "pci") != 0)) 182 if ((node->type == NULL) || (strcmp(node->type, "pci") != 0))
182 continue; 183 continue;
183 184
184 busp = (u32 *)get_property(node, "bus-range", NULL); 185 busp = get_property(node, "bus-range", NULL);
185 if (busp == NULL) 186 if (busp == NULL)
186 continue; 187 continue;
187 bus = *busp; 188 bus = *busp;
@@ -221,10 +222,9 @@ void __init iSeries_pci_final_fixup(void)
221 222
222 if (node != NULL) { 223 if (node != NULL) {
223 struct pci_dn *pdn = PCI_DN(node); 224 struct pci_dn *pdn = PCI_DN(node);
224 u32 *agent; 225 const u32 *agent;
225 226
226 agent = (u32 *)get_property(node, "linux,agent-id", 227 agent = get_property(node, "linux,agent-id", NULL);
227 NULL);
228 if ((pdn != NULL) && (agent != NULL)) { 228 if ((pdn != NULL) && (agent != NULL)) {
229 u8 irq = iSeries_allocate_IRQ(pdn->busno, 0, 229 u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
230 pdn->bussubno); 230 pdn->bussubno);
@@ -271,46 +271,6 @@ void pcibios_fixup_resources(struct pci_dev *pdev)
271} 271}
272 272
273/* 273/*
274 * I/0 Memory copy MUST use mmio commands on iSeries
275 * To do; For performance, include the hv call directly
276 */
277void iSeries_memset_io(volatile void __iomem *dest, char c, size_t Count)
278{
279 u8 ByteValue = c;
280 long NumberOfBytes = Count;
281
282 while (NumberOfBytes > 0) {
283 iSeries_Write_Byte(ByteValue, dest++);
284 -- NumberOfBytes;
285 }
286}
287EXPORT_SYMBOL(iSeries_memset_io);
288
289void iSeries_memcpy_toio(volatile void __iomem *dest, void *source, size_t count)
290{
291 char *src = source;
292 long NumberOfBytes = count;
293
294 while (NumberOfBytes > 0) {
295 iSeries_Write_Byte(*src++, dest++);
296 -- NumberOfBytes;
297 }
298}
299EXPORT_SYMBOL(iSeries_memcpy_toio);
300
301void iSeries_memcpy_fromio(void *dest, const volatile void __iomem *src, size_t count)
302{
303 char *dst = dest;
304 long NumberOfBytes = count;
305
306 while (NumberOfBytes > 0) {
307 *dst++ = iSeries_Read_Byte(src++);
308 -- NumberOfBytes;
309 }
310}
311EXPORT_SYMBOL(iSeries_memcpy_fromio);
312
313/*
314 * Look down the chain to find the matching Device Device 274 * Look down the chain to find the matching Device Device
315 */ 275 */
316static struct device_node *find_Device_Node(int bus, int devfn) 276static struct device_node *find_Device_Node(int bus, int devfn)
@@ -492,7 +452,7 @@ static inline struct device_node *xlate_iomm_address(
492 * iSeries_Read_Word = Read Word (16 bit) 452 * iSeries_Read_Word = Read Word (16 bit)
493 * iSeries_Read_Long = Read Long (32 bit) 453 * iSeries_Read_Long = Read Long (32 bit)
494 */ 454 */
495u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress) 455static u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
496{ 456{
497 u64 BarOffset; 457 u64 BarOffset;
498 u64 dsa; 458 u64 dsa;
@@ -519,9 +479,8 @@ u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
519 479
520 return (u8)ret.value; 480 return (u8)ret.value;
521} 481}
522EXPORT_SYMBOL(iSeries_Read_Byte);
523 482
524u16 iSeries_Read_Word(const volatile void __iomem *IoAddress) 483static u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
525{ 484{
526 u64 BarOffset; 485 u64 BarOffset;
527 u64 dsa; 486 u64 dsa;
@@ -549,9 +508,8 @@ u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
549 508
550 return swab16((u16)ret.value); 509 return swab16((u16)ret.value);
551} 510}
552EXPORT_SYMBOL(iSeries_Read_Word);
553 511
554u32 iSeries_Read_Long(const volatile void __iomem *IoAddress) 512static u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
555{ 513{
556 u64 BarOffset; 514 u64 BarOffset;
557 u64 dsa; 515 u64 dsa;
@@ -579,7 +537,6 @@ u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
579 537
580 return swab32((u32)ret.value); 538 return swab32((u32)ret.value);
581} 539}
582EXPORT_SYMBOL(iSeries_Read_Long);
583 540
584/* 541/*
585 * Write MM I/O Instructions for the iSeries 542 * Write MM I/O Instructions for the iSeries
@@ -588,7 +545,7 @@ EXPORT_SYMBOL(iSeries_Read_Long);
588 * iSeries_Write_Word = Write Word(16 bit) 545 * iSeries_Write_Word = Write Word(16 bit)
589 * iSeries_Write_Long = Write Long(32 bit) 546 * iSeries_Write_Long = Write Long(32 bit)
590 */ 547 */
591void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress) 548static void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
592{ 549{
593 u64 BarOffset; 550 u64 BarOffset;
594 u64 dsa; 551 u64 dsa;
@@ -613,9 +570,8 @@ void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
613 rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0); 570 rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
614 } while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0); 571 } while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0);
615} 572}
616EXPORT_SYMBOL(iSeries_Write_Byte);
617 573
618void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress) 574static void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
619{ 575{
620 u64 BarOffset; 576 u64 BarOffset;
621 u64 dsa; 577 u64 dsa;
@@ -640,9 +596,8 @@ void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
640 rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, swab16(data), 0); 596 rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, swab16(data), 0);
641 } while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0); 597 } while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0);
642} 598}
643EXPORT_SYMBOL(iSeries_Write_Word);
644 599
645void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress) 600static void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
646{ 601{
647 u64 BarOffset; 602 u64 BarOffset;
648 u64 dsa; 603 u64 dsa;
@@ -667,4 +622,224 @@ void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
667 rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, swab32(data), 0); 622 rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, swab32(data), 0);
668 } while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0); 623 } while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0);
669} 624}
670EXPORT_SYMBOL(iSeries_Write_Long); 625
626extern unsigned char __raw_readb(const volatile void __iomem *addr)
627{
628 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
629
630 return *(volatile unsigned char __force *)addr;
631}
632EXPORT_SYMBOL(__raw_readb);
633
634extern unsigned short __raw_readw(const volatile void __iomem *addr)
635{
636 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
637
638 return *(volatile unsigned short __force *)addr;
639}
640EXPORT_SYMBOL(__raw_readw);
641
642extern unsigned int __raw_readl(const volatile void __iomem *addr)
643{
644 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
645
646 return *(volatile unsigned int __force *)addr;
647}
648EXPORT_SYMBOL(__raw_readl);
649
650extern unsigned long __raw_readq(const volatile void __iomem *addr)
651{
652 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
653
654 return *(volatile unsigned long __force *)addr;
655}
656EXPORT_SYMBOL(__raw_readq);
657
658extern void __raw_writeb(unsigned char v, volatile void __iomem *addr)
659{
660 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
661
662 *(volatile unsigned char __force *)addr = v;
663}
664EXPORT_SYMBOL(__raw_writeb);
665
666extern void __raw_writew(unsigned short v, volatile void __iomem *addr)
667{
668 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
669
670 *(volatile unsigned short __force *)addr = v;
671}
672EXPORT_SYMBOL(__raw_writew);
673
674extern void __raw_writel(unsigned int v, volatile void __iomem *addr)
675{
676 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
677
678 *(volatile unsigned int __force *)addr = v;
679}
680EXPORT_SYMBOL(__raw_writel);
681
682extern void __raw_writeq(unsigned long v, volatile void __iomem *addr)
683{
684 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
685
686 *(volatile unsigned long __force *)addr = v;
687}
688EXPORT_SYMBOL(__raw_writeq);
689
690int in_8(const volatile unsigned char __iomem *addr)
691{
692 if (firmware_has_feature(FW_FEATURE_ISERIES))
693 return iSeries_Read_Byte(addr);
694 return __in_8(addr);
695}
696EXPORT_SYMBOL(in_8);
697
698void out_8(volatile unsigned char __iomem *addr, int val)
699{
700 if (firmware_has_feature(FW_FEATURE_ISERIES))
701 iSeries_Write_Byte(val, addr);
702 else
703 __out_8(addr, val);
704}
705EXPORT_SYMBOL(out_8);
706
707int in_le16(const volatile unsigned short __iomem *addr)
708{
709 if (firmware_has_feature(FW_FEATURE_ISERIES))
710 return iSeries_Read_Word(addr);
711 return __in_le16(addr);
712}
713EXPORT_SYMBOL(in_le16);
714
715int in_be16(const volatile unsigned short __iomem *addr)
716{
717 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
718
719 return __in_be16(addr);
720}
721EXPORT_SYMBOL(in_be16);
722
723void out_le16(volatile unsigned short __iomem *addr, int val)
724{
725 if (firmware_has_feature(FW_FEATURE_ISERIES))
726 iSeries_Write_Word(val, addr);
727 else
728 __out_le16(addr, val);
729}
730EXPORT_SYMBOL(out_le16);
731
732void out_be16(volatile unsigned short __iomem *addr, int val)
733{
734 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
735
736 __out_be16(addr, val);
737}
738EXPORT_SYMBOL(out_be16);
739
740unsigned in_le32(const volatile unsigned __iomem *addr)
741{
742 if (firmware_has_feature(FW_FEATURE_ISERIES))
743 return iSeries_Read_Long(addr);
744 return __in_le32(addr);
745}
746EXPORT_SYMBOL(in_le32);
747
748unsigned in_be32(const volatile unsigned __iomem *addr)
749{
750 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
751
752 return __in_be32(addr);
753}
754EXPORT_SYMBOL(in_be32);
755
756void out_le32(volatile unsigned __iomem *addr, int val)
757{
758 if (firmware_has_feature(FW_FEATURE_ISERIES))
759 iSeries_Write_Long(val, addr);
760 else
761 __out_le32(addr, val);
762}
763EXPORT_SYMBOL(out_le32);
764
765void out_be32(volatile unsigned __iomem *addr, int val)
766{
767 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
768
769 __out_be32(addr, val);
770}
771EXPORT_SYMBOL(out_be32);
772
773unsigned long in_le64(const volatile unsigned long __iomem *addr)
774{
775 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
776
777 return __in_le64(addr);
778}
779EXPORT_SYMBOL(in_le64);
780
781unsigned long in_be64(const volatile unsigned long __iomem *addr)
782{
783 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
784
785 return __in_be64(addr);
786}
787EXPORT_SYMBOL(in_be64);
788
789void out_le64(volatile unsigned long __iomem *addr, unsigned long val)
790{
791 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
792
793 __out_le64(addr, val);
794}
795EXPORT_SYMBOL(out_le64);
796
797void out_be64(volatile unsigned long __iomem *addr, unsigned long val)
798{
799 BUG_ON(firmware_has_feature(FW_FEATURE_ISERIES));
800
801 __out_be64(addr, val);
802}
803EXPORT_SYMBOL(out_be64);
804
805void memset_io(volatile void __iomem *addr, int c, unsigned long n)
806{
807 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
808 volatile char __iomem *d = addr;
809
810 while (n-- > 0) {
811 iSeries_Write_Byte(c, d++);
812 }
813 } else
814 eeh_memset_io(addr, c, n);
815}
816EXPORT_SYMBOL(memset_io);
817
818void memcpy_fromio(void *dest, const volatile void __iomem *src,
819 unsigned long n)
820{
821 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
822 char *d = dest;
823 const volatile char __iomem *s = src;
824
825 while (n-- > 0) {
826 *d++ = iSeries_Read_Byte(s++);
827 }
828 } else
829 eeh_memcpy_fromio(dest, src, n);
830}
831EXPORT_SYMBOL(memcpy_fromio);
832
833void memcpy_toio(volatile void __iomem *dest, const void *src, unsigned long n)
834{
835 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
836 const char *s = src;
837 volatile char __iomem *d = dest;
838
839 while (n-- > 0) {
840 iSeries_Write_Byte(*s++, d++);
841 }
842 } else
843 eeh_memcpy_toio(dest, src, n);
844}
845EXPORT_SYMBOL(memcpy_toio);
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index c9605d773a77..7f1953066ff8 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -59,6 +59,7 @@
59#include "irq.h" 59#include "irq.h"
60#include "vpd_areas.h" 60#include "vpd_areas.h"
61#include "processor_vpd.h" 61#include "processor_vpd.h"
62#include "it_lp_naca.h"
62#include "main_store.h" 63#include "main_store.h"
63#include "call_sm.h" 64#include "call_sm.h"
64#include "call_hpt.h" 65#include "call_hpt.h"
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 622a30149b48..9baa4ee82592 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,8 @@ 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;
120 const char *sysid;
119 121
120 buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL); 122 buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL);
121 if (!buf) 123 if (!buf)
@@ -143,20 +145,26 @@ static int proc_viopath_show(struct seq_file *m, void *v)
143 145
144 buf[HW_PAGE_SIZE-1] = '\0'; 146 buf[HW_PAGE_SIZE-1] = '\0';
145 seq_printf(m, "%s", buf); 147 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 148
156 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE, 149 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE,
157 DMA_FROM_DEVICE); 150 DMA_FROM_DEVICE);
158 kfree(buf); 151 kfree(buf);
159 152
153 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
154
155 node = of_find_node_by_path("/");
156 sysid = NULL;
157 if (node != NULL)
158 sysid = get_property(node, "system-id", NULL);
159
160 if (sysid == NULL)
161 seq_printf(m, "SRLNBR=<UNKNOWN>\n");
162 else
163 /* Skip "IBM," on front of serial number, see dt.c */
164 seq_printf(m, "SRLNBR=%s\n", sysid + 4);
165
166 of_node_put(node);
167
160 return 0; 168 return 0;
161} 169}
162 170
diff --git a/arch/powerpc/platforms/iseries/vpdinfo.c b/arch/powerpc/platforms/iseries/vpdinfo.c
index 23a6d1e5b429..9f83878a0c2e 100644
--- a/arch/powerpc/platforms/iseries/vpdinfo.c
+++ b/arch/powerpc/platforms/iseries/vpdinfo.c
@@ -188,7 +188,7 @@ static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
188{ 188{
189 u8 *TagPtr = VpdData; 189 u8 *TagPtr = VpdData;
190 int DataLen = VpdDataLen - 3; 190 int DataLen = VpdDataLen - 3;
191 u8 PhbId; 191 u8 PhbId = 0xff;
192 192
193 while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) { 193 while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
194 int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256); 194 int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);
@@ -205,15 +205,16 @@ static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
205 } 205 }
206} 206}
207 207
208static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent, 208static int __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
209 u8 *frame, char card[4]) 209 u8 *frame, char card[4])
210{ 210{
211 int status = 0;
211 int BusVpdLen = 0; 212 int BusVpdLen = 0;
212 u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL); 213 u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
213 214
214 if (BusVpdPtr == NULL) { 215 if (BusVpdPtr == NULL) {
215 printk("PCI: Bus VPD Buffer allocation failure.\n"); 216 printk("PCI: Bus VPD Buffer allocation failure.\n");
216 return; 217 return 0;
217 } 218 }
218 BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr), 219 BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
219 BUS_VPDSIZE); 220 BUS_VPDSIZE);
@@ -228,8 +229,10 @@ static void __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
228 goto out_free; 229 goto out_free;
229 } 230 }
230 iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card); 231 iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
232 status = 1;
231out_free: 233out_free:
232 kfree(BusVpdPtr); 234 kfree(BusVpdPtr);
235 return status;
233} 236}
234 237
235/* 238/*
@@ -246,7 +249,7 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
246 struct device_node *DevNode = PciDev->sysdata; 249 struct device_node *DevNode = PciDev->sysdata;
247 struct pci_dn *pdn; 250 struct pci_dn *pdn;
248 u16 bus; 251 u16 bus;
249 u8 frame; 252 u8 frame = 0;
250 char card[4]; 253 char card[4];
251 HvSubBusNumber subbus; 254 HvSubBusNumber subbus;
252 HvAgentId agent; 255 HvAgentId agent;
@@ -262,10 +265,11 @@ void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
262 subbus = pdn->bussubno; 265 subbus = pdn->bussubno;
263 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus), 266 agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
264 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)); 267 ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
265 iSeries_Get_Location_Code(bus, agent, &frame, card);
266 268
267 printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, Card %4s ", 269 if (iSeries_Get_Location_Code(bus, agent, &frame, card)) {
268 count, bus, PCI_SLOT(PciDev->devfn), PciDev->vendor, 270 printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, "
269 frame, card); 271 "Card %4s 0x%04X\n", count, bus,
270 printk("0x%04X\n", (int)(PciDev->class >> 8)); 272 PCI_SLOT(PciDev->devfn), PciDev->vendor, frame,
273 card, (int)(PciDev->class >> 8));
274 }
271} 275}