9 #include <asm/sn/types.h>
10 #include <asm/sn/addrs.h>
16 #include <linux/slab.h>
17 #include <linux/export.h>
32 .data = { 0x2c, 0xc6, 0xa6, 0xfe, 0x9c, 0x44, 0xda, 0x11,
33 0xa2, 0x7c, 0x08, 0x00, 0x69, 0x13, 0xea, 0x51 },
84 "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
85 "(0x%x) failed for: %s\n", status,
97 "sn_acpi_hubdev_init: Invalid vendor data length: "
110 *hubdev = *hubdev_ptr;
141 "acpi_get_vendor_resource() failed (0x%x) for: %s\n",
142 __func__, status, (
char *)name_buffer.
pointer);
152 "%s: Invalid vendor data length %d\n",
161 return prom_bussoft_ptr;
177 struct sn_irq_info *
irq_info, *irq_info_prom;
178 struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;
193 "%s: acpi_get_vendor_resource() failed (0x%x) for: %s\n",
194 __func__, status, (
char *)name_buffer.
pointer);
202 sizeof(
struct pci_devdev_info *)) {
205 "%s: Invalid vendor data length: %d for: %s\n",
213 pcidev_ptr = kzalloc(
sizeof(
struct pcidev_info),
GFP_KERNEL);
215 panic(
"%s: Unable to alloc memory for pcidev_info", __func__);
218 pcidev_prom_ptr =
__va(addr);
219 memcpy(pcidev_ptr, pcidev_prom_ptr,
sizeof(
struct pcidev_info));
222 irq_info = kzalloc(
sizeof(
struct sn_irq_info),
GFP_KERNEL);
224 panic(
"%s: Unable to alloc memory for sn_irq_info", __func__);
228 memcpy(irq_info, irq_info_prom,
sizeof(
struct sn_irq_info));
231 *pcidev_info = pcidev_ptr;
232 *sn_irq_info = irq_info;
242 unsigned long long adr;
257 child = device_handle;
262 "(0x%x) for: %s\n", __func__, status,
264 panic(
"%s: Unable to find host devfn\n", __func__);
266 if (parent == rootbus_handle)
272 __func__, (
char *)name_buffer.
pointer);
279 __func__, status, (
char *)name_buffer.
pointer);
280 panic(
"%s: Unable to find host devfn\n", __func__);
285 slot = (adr >> 16) & 0xffff;
286 function = adr & 0xffff;
300 find_matching_device(
acpi_handle handle,
u32 lvl,
void *context,
void **rv)
302 unsigned long long bbn = -1;
303 unsigned long long adr;
319 "%s: acpi_get_parent() failed (0x%x) for: %s\n",
320 __func__, status, (
char *)name_buffer.
pointer);
329 "%s: Failed to find _BBN in parent of: %s\n",
330 __func__, (
char *)name_buffer.
pointer);
335 slot = (adr >> 16) & 0xffff;
336 function = adr & 0xffff;
338 if ((info->
devfn == devfn) && (info->
bus == bbn)) {
354 struct sn_irq_info **sn_irq_info)
356 unsigned int host_devfn;
371 "%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
380 __func__, (
char *)name_buffer.
pointer);
390 pcidev_match.
bus = dev->
bus->number;
395 find_matching_device,
NULL, &pcidev_match,
NULL);
397 if (!pcidev_match.
handle) {
399 "%s: Could not find matching ACPI device for %s.\n",
400 __func__, pci_name(dev));
404 if (sn_extract_device_info(pcidev_match.
handle, pcidev_info, sn_irq_info))
408 host_devfn = get_host_devfn(pcidev_match.
handle, rootbus_handle);
409 (*pcidev_info)->pdi_slot_host_handle =
430 struct pcidev_info *pcidev_info =
NULL;
431 struct sn_irq_info *sn_irq_info =
NULL;
435 panic(
"%s: Failure obtaining pcidev_info for %s\n",
436 __func__, pci_name(dev));
451 (
unsigned long) addr + image_size - 1;
472 prom_bussoft_ptr = sn_get_bussoft_ptr(bus);
473 if (prom_bussoft_ptr ==
NULL) {
475 "%s: 0x%04x:0x%02x Unable to "
476 "obtain prom_bussoft_ptr\n",
506 status = sal_ioif_init(&result);
507 if (status || result)
508 panic(
"sal_ioif_init failed: [%lx] %s\n",