diff options
author | Anjali Singhai <anjali.singhai@intel.com> | 2015-02-26 11:15:39 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2015-03-05 10:15:28 -0500 |
commit | 232f47060ada14c4b77ce1f21eec9332b9234a87 (patch) | |
tree | 1afc622b35ea5bee43c658d2ce9cabfdabefbc17 /drivers/net/ethernet | |
parent | 5bbc330100285e56871a64d4148b9d3a1ac0f297 (diff) |
i40e: Ioremap changes
For future device support we do not want to map the whole CSR space since some
of it is mapped by other drivers with different mapping methods.
Note: As a side effect, the flash region (if exposed through the memory map)
gets unmapped too since it follows the future use region.
Change-ID: Ic729a2eacd692984220b1a415ff4fa0f98ea419a
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index c5137313b62a..ce3fbb87544e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -72,6 +72,7 @@ | |||
72 | 72 | ||
73 | #define I40E_MAX_NUM_DESCRIPTORS 4096 | 73 | #define I40E_MAX_NUM_DESCRIPTORS 4096 |
74 | #define I40E_MAX_REGISTER 0x800000 | 74 | #define I40E_MAX_REGISTER 0x800000 |
75 | #define I40E_MAX_CSR_SPACE (4 * 1024 * 1024 - 64 * 1024) | ||
75 | #define I40E_DEFAULT_NUM_DESCRIPTORS 512 | 76 | #define I40E_DEFAULT_NUM_DESCRIPTORS 512 |
76 | #define I40E_REQ_DESCRIPTOR_MULTIPLE 32 | 77 | #define I40E_REQ_DESCRIPTOR_MULTIPLE 32 |
77 | #define I40E_MIN_NUM_DESCRIPTORS 64 | 78 | #define I40E_MIN_NUM_DESCRIPTORS 64 |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 02b57c3aa4bb..f769005ea28c 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -9459,6 +9459,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
9459 | struct i40e_pf *pf; | 9459 | struct i40e_pf *pf; |
9460 | struct i40e_hw *hw; | 9460 | struct i40e_hw *hw; |
9461 | static u16 pfs_found; | 9461 | static u16 pfs_found; |
9462 | u32 ioremap_len; | ||
9462 | u16 link_status; | 9463 | u16 link_status; |
9463 | int err = 0; | 9464 | int err = 0; |
9464 | u32 len; | 9465 | u32 len; |
@@ -9507,8 +9508,11 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
9507 | 9508 | ||
9508 | hw = &pf->hw; | 9509 | hw = &pf->hw; |
9509 | hw->back = pf; | 9510 | hw->back = pf; |
9510 | hw->hw_addr = ioremap(pci_resource_start(pdev, 0), | 9511 | |
9511 | pci_resource_len(pdev, 0)); | 9512 | ioremap_len = min_t(int, pci_resource_len(pdev, 0), |
9513 | I40E_MAX_CSR_SPACE); | ||
9514 | |||
9515 | hw->hw_addr = ioremap(pci_resource_start(pdev, 0), ioremap_len); | ||
9512 | if (!hw->hw_addr) { | 9516 | if (!hw->hw_addr) { |
9513 | err = -EIO; | 9517 | err = -EIO; |
9514 | dev_info(&pdev->dev, "ioremap(0x%04x, 0x%04x) failed: 0x%x\n", | 9518 | dev_info(&pdev->dev, "ioremap(0x%04x, 0x%04x) failed: 0x%x\n", |