diff options
author | Jon Mason <jon.mason@intel.com> | 2013-01-21 18:40:39 -0500 |
---|---|---|
committer | Jon Mason <jon.mason@intel.com> | 2013-09-03 17:48:53 -0400 |
commit | ac477afb0431386575ef453f50fa0052c3f0461b (patch) | |
tree | f32e9f650e68e345baee7919800d8b8e6da60d82 /drivers/ntb | |
parent | be4dac0fcacd7d62e0b4f7ff51a7032e197b62af (diff) |
NTB: Enable 32bit Support
Correct the issues on NTB that prevented it from working on x86_32 and
modify the Kconfig to allow it to be permitted to be used in that
environment as well.
Signed-off-by: Jon Mason <jon.mason@intel.com>
Diffstat (limited to 'drivers/ntb')
-rw-r--r-- | drivers/ntb/Kconfig | 2 | ||||
-rw-r--r-- | drivers/ntb/ntb_hw.c | 4 | ||||
-rw-r--r-- | drivers/ntb/ntb_hw.h | 17 |
3 files changed, 19 insertions, 4 deletions
diff --git a/drivers/ntb/Kconfig b/drivers/ntb/Kconfig index 37ee6495acc1..f69df793dbe2 100644 --- a/drivers/ntb/Kconfig +++ b/drivers/ntb/Kconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | config NTB | 1 | config NTB |
2 | tristate "Intel Non-Transparent Bridge support" | 2 | tristate "Intel Non-Transparent Bridge support" |
3 | depends on PCI | 3 | depends on PCI |
4 | depends on X86_64 | 4 | depends on X86 |
5 | help | 5 | help |
6 | The PCI-E Non-transparent bridge hardware is a point-to-point PCI-E bus | 6 | The PCI-E Non-transparent bridge hardware is a point-to-point PCI-E bus |
7 | connecting 2 systems. When configured, writes to the device's PCI | 7 | connecting 2 systems. When configured, writes to the device's PCI |
diff --git a/drivers/ntb/ntb_hw.c b/drivers/ntb/ntb_hw.c index 784446e1de05..ab34795cf125 100644 --- a/drivers/ntb/ntb_hw.c +++ b/drivers/ntb/ntb_hw.c | |||
@@ -376,7 +376,7 @@ void __iomem *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw) | |||
376 | * | 376 | * |
377 | * RETURNS: the size of the memory window or zero on error | 377 | * RETURNS: the size of the memory window or zero on error |
378 | */ | 378 | */ |
379 | resource_size_t ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw) | 379 | u64 ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw) |
380 | { | 380 | { |
381 | if (mw >= ntb_max_mw(ndev)) | 381 | if (mw >= ntb_max_mw(ndev)) |
382 | return 0; | 382 | return 0; |
@@ -1257,7 +1257,7 @@ static int ntb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1257 | ioremap_wc(pci_resource_start(pdev, MW_TO_BAR(i)), | 1257 | ioremap_wc(pci_resource_start(pdev, MW_TO_BAR(i)), |
1258 | ndev->mw[i].bar_sz); | 1258 | ndev->mw[i].bar_sz); |
1259 | dev_info(&pdev->dev, "MW %d size %llu\n", i, | 1259 | dev_info(&pdev->dev, "MW %d size %llu\n", i, |
1260 | pci_resource_len(pdev, MW_TO_BAR(i))); | 1260 | (unsigned long long) ndev->mw[i].bar_sz); |
1261 | if (!ndev->mw[i].vbase) { | 1261 | if (!ndev->mw[i].vbase) { |
1262 | dev_warn(&pdev->dev, "Cannot remap BAR %d\n", | 1262 | dev_warn(&pdev->dev, "Cannot remap BAR %d\n", |
1263 | MW_TO_BAR(i)); | 1263 | MW_TO_BAR(i)); |
diff --git a/drivers/ntb/ntb_hw.h b/drivers/ntb/ntb_hw.h index 591d4ff5d88e..d838bc13b956 100644 --- a/drivers/ntb/ntb_hw.h +++ b/drivers/ntb/ntb_hw.h | |||
@@ -62,6 +62,21 @@ | |||
62 | 62 | ||
63 | #define msix_table_size(control) ((control & PCI_MSIX_FLAGS_QSIZE)+1) | 63 | #define msix_table_size(control) ((control & PCI_MSIX_FLAGS_QSIZE)+1) |
64 | 64 | ||
65 | #ifndef readq | ||
66 | static inline u64 readq(void __iomem *addr) | ||
67 | { | ||
68 | return readl(addr) | (((u64) readl(addr + 4)) << 32LL); | ||
69 | } | ||
70 | #endif | ||
71 | |||
72 | #ifndef writeq | ||
73 | static inline void writeq(u64 val, void __iomem *addr) | ||
74 | { | ||
75 | writel(val & 0xffffffff, addr); | ||
76 | writel(val >> 32, addr + 4); | ||
77 | } | ||
78 | #endif | ||
79 | |||
65 | #define NTB_BAR_MMIO 0 | 80 | #define NTB_BAR_MMIO 0 |
66 | #define NTB_BAR_23 2 | 81 | #define NTB_BAR_23 2 |
67 | #define NTB_BAR_45 4 | 82 | #define NTB_BAR_45 4 |
@@ -226,7 +241,7 @@ int ntb_read_local_spad(struct ntb_device *ndev, unsigned int idx, u32 *val); | |||
226 | int ntb_write_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 val); | 241 | int ntb_write_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 val); |
227 | int ntb_read_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 *val); | 242 | int ntb_read_remote_spad(struct ntb_device *ndev, unsigned int idx, u32 *val); |
228 | void __iomem *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw); | 243 | void __iomem *ntb_get_mw_vbase(struct ntb_device *ndev, unsigned int mw); |
229 | resource_size_t ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw); | 244 | u64 ntb_get_mw_size(struct ntb_device *ndev, unsigned int mw); |
230 | void ntb_ring_sdb(struct ntb_device *ndev, unsigned int idx); | 245 | void ntb_ring_sdb(struct ntb_device *ndev, unsigned int idx); |
231 | void *ntb_find_transport(struct pci_dev *pdev); | 246 | void *ntb_find_transport(struct pci_dev *pdev); |
232 | 247 | ||