aboutsummaryrefslogtreecommitdiff
path: root/drivers/bcma
diff options
context:
space:
mode:
authorNathan Hintz <nlhintz@hotmail.com>2013-01-12 02:46:16 -0800
committerJohn W. Linville <linville@tuxdriver.com>2013-01-14 15:10:41 -0500
commitb09e9abd091a4ed1e638a810b25c6577b4621b12 (patch)
tree5bffbd6931d08a03b28efa376e2fc5907f718325 /drivers/bcma
parent447d7e25be462329268f279bef2f6faa986a5185 (diff)
bcma: add support for 1 and 2 byte extended config space access
The sanity checks allow 1 and 2 byte reads/writes of the extended PCI config space to proceed; however, the code only supports 4 byte reads/writes. This patch adds support for 1 and 2 byte reads/writes of the extended PCI config space. Signed-off-by: Nathan Hintz <nlhintz@hotmail.com> Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/driver_pci_host.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index c0cb0620ab6..f92124c2999 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -101,7 +101,7 @@ static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
*/
if (off >= PCI_CONFIG_SPACE_SIZE) {
addr = (func << 12);
- addr |= (off & 0x0FFF);
+ addr |= (off & 0x0FFC);
val = bcma_pcie_read_config(pc, addr);
} else {
addr = BCMA_CORE_PCI_PCICFG0;
@@ -164,7 +164,11 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
/* accesses to config registers with offsets >= 256
* requires indirect access.
*/
- if (off < PCI_CONFIG_SPACE_SIZE) {
+ if (off >= PCI_CONFIG_SPACE_SIZE) {
+ addr = (func << 12);
+ addr |= (off & 0x0FFC);
+ val = bcma_pcie_read_config(pc, addr);
+ } else {
addr = BCMA_CORE_PCI_PCICFG0;
addr |= (func << 8);
addr |= (off & 0xfc);
@@ -202,13 +206,10 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
/* accesses to config registers with offsets >= 256
* requires indirect access.
*/
- if (off >= PCI_CONFIG_SPACE_SIZE) {
- addr = (func << 12);
- addr |= (off & 0x0FFF);
+ if (off >= PCI_CONFIG_SPACE_SIZE)
bcma_pcie_write_config(pc, addr, val);
- } else {
+ else
pcicore_write32(pc, addr, val);
- }
} else {
writel(val, mmio);