Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mips: pci-mt7620: fix bridge register access

Host bridge registers and PCI RC control registers have different
memory base. pcie_m32() is used to write the RC control registers
instead of bridge registers. This patch introduces bridge_m32()
and use it to operate bridge registers to fix the access issue.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Shiji Yang and committed by
Thomas Bogendoerfer
3dbb0827 c7dd395d

+12 -3
+12 -3
arch/mips/pci/pci-mt7620.c
··· 87 87 return ioread32(bridge_base + reg); 88 88 } 89 89 90 + static inline void bridge_m32(u32 clr, u32 set, unsigned reg) 91 + { 92 + u32 val = bridge_r32(reg); 93 + 94 + val &= ~clr; 95 + val |= set; 96 + bridge_w32(val, reg); 97 + } 98 + 90 99 static inline void pcie_w32(u32 val, unsigned reg) 91 100 { 92 101 iowrite32(val, pcie_base + reg); ··· 237 228 pcie_phy(0x68, 0xB4); 238 229 239 230 /* put core into reset */ 240 - pcie_m32(0, PCIRST, RALINK_PCI_PCICFG_ADDR); 231 + bridge_m32(PCIRST, PCIRST, RALINK_PCI_PCICFG_ADDR); 241 232 reset_control_assert(rstpcie0); 242 233 243 234 /* disable power and all clocks */ ··· 327 318 mdelay(50); 328 319 329 320 /* enable write access */ 330 - pcie_m32(PCIRST, 0, RALINK_PCI_PCICFG_ADDR); 321 + bridge_m32(PCIRST, 0, RALINK_PCI_PCICFG_ADDR); 331 322 mdelay(100); 332 323 333 324 /* check if there is a card present */ ··· 349 340 pcie_w32(0x06040001, RALINK_PCI0_CLASS); 350 341 351 342 /* enable interrupts */ 352 - pcie_m32(0, PCIINT2, RALINK_PCI_PCIENA); 343 + bridge_m32(PCIINT2, PCIINT2, RALINK_PCI_PCIENA); 353 344 354 345 /* voodoo from the SDK driver */ 355 346 pci_config_read(NULL, 0, 4, 4, &val);