diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-01-25 07:41:19 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-29 03:54:43 -0500 |
commit | 8be08a39d498d5d93ff5149276e34ccb4ec3757f (patch) | |
tree | 9c78047b907bb21e9eb0e5ee6cfece01190e8c07 | |
parent | b504075f5903b969a54ef3a6ae994c0872edb259 (diff) |
bcma: implement host code support for PCIe Gen 2 devices
This is stil incomplete, so we don't add PCI IDs of new devices yet.
Purpose of this patch is to allow testing & adjusting rest of the code.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r-- | drivers/bcma/host_pci.c | 6 | ||||
-rw-r--r-- | include/linux/bcma/bcma.h | 1 | ||||
-rw-r--r-- | include/linux/bcma/bcma_regs.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c index cd9161a8b3a1..53c6a8a58859 100644 --- a/drivers/bcma/host_pci.c +++ b/drivers/bcma/host_pci.c | |||
@@ -13,10 +13,12 @@ | |||
13 | 13 | ||
14 | static void bcma_host_pci_switch_core(struct bcma_device *core) | 14 | static void bcma_host_pci_switch_core(struct bcma_device *core) |
15 | { | 15 | { |
16 | int win2 = core->bus->host_is_pcie2 ? | ||
17 | BCMA_PCIE2_BAR0_WIN2 : BCMA_PCI_BAR0_WIN2; | ||
18 | |||
16 | pci_write_config_dword(core->bus->host_pci, BCMA_PCI_BAR0_WIN, | 19 | pci_write_config_dword(core->bus->host_pci, BCMA_PCI_BAR0_WIN, |
17 | core->addr); | 20 | core->addr); |
18 | pci_write_config_dword(core->bus->host_pci, BCMA_PCI_BAR0_WIN2, | 21 | pci_write_config_dword(core->bus->host_pci, win2, core->wrap); |
19 | core->wrap); | ||
20 | core->bus->mapped_core = core; | 22 | core->bus->mapped_core = core; |
21 | bcma_debug(core->bus, "Switched to core: 0x%X\n", core->id.id); | 23 | bcma_debug(core->bus, "Switched to core: 0x%X\n", core->id.id); |
22 | } | 24 | } |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index eb1c6a47b67f..994739da827f 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -318,6 +318,7 @@ struct bcma_bus { | |||
318 | const struct bcma_host_ops *ops; | 318 | const struct bcma_host_ops *ops; |
319 | 319 | ||
320 | enum bcma_hosttype hosttype; | 320 | enum bcma_hosttype hosttype; |
321 | bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */ | ||
321 | union { | 322 | union { |
322 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ | 323 | /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ |
323 | struct pci_dev *host_pci; | 324 | struct pci_dev *host_pci; |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index e64ae7bf80a1..ebd5c1fcdea4 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -64,6 +64,8 @@ | |||
64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ | 64 | #define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ |
65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ | 65 | #define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ |
66 | 66 | ||
67 | #define BCMA_PCIE2_BAR0_WIN2 0x70 | ||
68 | |||
67 | /* SiliconBackplane Address Map. | 69 | /* SiliconBackplane Address Map. |
68 | * All regions may not exist on all chips. | 70 | * All regions may not exist on all chips. |
69 | */ | 71 | */ |