diff options
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 18 |
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 | ||
30 | static unsigned long vpci_major = 1; | ||
31 | static unsigned long vpci_minor = 1; | ||
32 | |||
30 | #define PGLIST_NENTS (PAGE_SIZE / sizeof(u64)) | 33 | #define PGLIST_NENTS (PAGE_SIZE / sizeof(u64)) |
31 | 34 | ||
32 | struct iommu_batch { | 35 | struct iommu_batch { |
@@ -1162,6 +1165,7 @@ static void pci_sun4v_pbm_init(struct pci_controller_info *p, struct device_node | |||
1162 | 1165 | ||
1163 | void sun4v_pci_init(struct device_node *dp, char *model_name) | 1166 | void 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 | ||