summaryrefslogtreecommitdiffstats
path: root/drivers/misc/hpilo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/hpilo.c')
-rw-r--r--drivers/misc/hpilo.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
index d6a901cd4222..fea8ff40440f 100644
--- a/drivers/misc/hpilo.c
+++ b/drivers/misc/hpilo.c
@@ -688,7 +688,8 @@ static void ilo_unmap_device(struct pci_dev *pdev, struct ilo_hwinfo *hw)
688 688
689static int ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw) 689static int ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw)
690{ 690{
691 int error = -ENOMEM; 691 int bar;
692 unsigned long off;
692 693
693 /* map the memory mapped i/o registers */ 694 /* map the memory mapped i/o registers */
694 hw->mmio_vaddr = pci_iomap(pdev, 1, 0); 695 hw->mmio_vaddr = pci_iomap(pdev, 1, 0);
@@ -698,7 +699,15 @@ static int ilo_map_device(struct pci_dev *pdev, struct ilo_hwinfo *hw)
698 } 699 }
699 700
700 /* map the adapter shared memory region */ 701 /* map the adapter shared memory region */
701 hw->ram_vaddr = pci_iomap(pdev, 2, max_ccb * ILOHW_CCB_SZ); 702 if (pdev->subsystem_device == 0x00E4) {
703 bar = 5;
704 /* Last 8k is reserved for CCBs */
705 off = pci_resource_len(pdev, bar) - 0x2000;
706 } else {
707 bar = 2;
708 off = 0;
709 }
710 hw->ram_vaddr = pci_iomap_range(pdev, bar, off, max_ccb * ILOHW_CCB_SZ);
702 if (hw->ram_vaddr == NULL) { 711 if (hw->ram_vaddr == NULL) {
703 dev_err(&pdev->dev, "Error mapping shared mem\n"); 712 dev_err(&pdev->dev, "Error mapping shared mem\n");
704 goto mmio_free; 713 goto mmio_free;
@@ -717,7 +726,7 @@ ram_free:
717mmio_free: 726mmio_free:
718 pci_iounmap(pdev, hw->mmio_vaddr); 727 pci_iounmap(pdev, hw->mmio_vaddr);
719out: 728out:
720 return error; 729 return -ENOMEM;
721} 730}
722 731
723static void ilo_remove(struct pci_dev *pdev) 732static void ilo_remove(struct pci_dev *pdev)
@@ -899,7 +908,7 @@ static void __exit ilo_exit(void)
899 class_destroy(ilo_class); 908 class_destroy(ilo_class);
900} 909}
901 910
902MODULE_VERSION("1.4.1"); 911MODULE_VERSION("1.5.0");
903MODULE_ALIAS(ILO_NAME); 912MODULE_ALIAS(ILO_NAME);
904MODULE_DESCRIPTION(ILO_NAME); 913MODULE_DESCRIPTION(ILO_NAME);
905MODULE_AUTHOR("David Altobelli <david.altobelli@hpe.com>"); 914MODULE_AUTHOR("David Altobelli <david.altobelli@hpe.com>");