aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-05-25 04:04:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-05-29 05:49:34 -0400
commite01c0d6d8cf29c1c11725837b265598cab687952 (patch)
treee2ac5e8ecc91f1af3367f42fa5d514ad04980993 /arch/sparc64
parent22d6a1cba3e9ec9baf8ce4d8dd1d088e112a64f1 (diff)
[SPARC64]: Negotiate hypervisor API for PCI services.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/pci_sun4v.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c
index 62e4d047dbc0..6b3fe2c1d65e 100644
--- a/arch/sparc64/kernel/pci_sun4v.c
+++ b/arch/sparc64/kernel/pci_sun4v.c
@@ -27,6 +27,9 @@
27 27
28#include "pci_sun4v.h" 28#include "pci_sun4v.h"
29 29
30static unsigned long vpci_major = 1;
31static unsigned long vpci_minor = 1;
32
30#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64)) 33#define PGLIST_NENTS (PAGE_SIZE / sizeof(u64))
31 34
32struct iommu_batch { 35struct iommu_batch {
@@ -1162,6 +1165,7 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node
1162 1165
1163void sun4v_pci_init(struct device_node *dp, char *model_name) 1166void sun4v_pci_init(struct device_node *dp, char *model_name)
1164{ 1167{
1168 static int hvapi_negotiated = 0;
1165 struct pci_controller_info *p; 1169 struct pci_controller_info *p;
1166 struct pci_pbm_info *pbm; 1170 struct pci_pbm_info *pbm;
1167 struct iommu *iommu; 1171 struct iommu *iommu;
@@ -1170,6 +1174,20 @@ void sun4v_pci_init(struct device_node *dp, char *model_name)
1170 u32 devhandle; 1174 u32 devhandle;
1171 int i; 1175 int i;
1172 1176
1177 if (!hvapi_negotiated++) {
1178 int err = sun4v_hvapi_register(HV_GRP_PCI,
1179 vpci_major,
1180 &vpci_minor);
1181
1182 if (err) {
1183 prom_printf("SUN4V_PCI: Could not register hvapi, "
1184 "err=%d\n", err);
1185 prom_halt();
1186 }
1187 printk("SUN4V_PCI: Registered hvapi major[%lu] minor[%lu]\n",
1188 vpci_major, vpci_minor);
1189 }
1190
1173 prop = of_find_property(dp, "reg", NULL); 1191 prop = of_find_property(dp, "reg", NULL);
1174 regs = prop->value; 1192 regs = prop->value;
1175 1193