• Home
  • Raw
  • Download

Lines Matching +full:data +full:- +full:bus

2  * Copyright (c) 2003-2012 Broadcom Corporation
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
50 #include <asm/netlogic/mips-extns.h>
52 #include <asm/netlogic/xlp-hal/iomap.h>
53 #include <asm/netlogic/xlp-hal/xlp.h>
54 #include <asm/netlogic/xlp-hal/pic.h>
55 #include <asm/netlogic/xlp-hal/pcibus.h>
56 #include <asm/netlogic/xlp-hal/bridge.h>
60 #define pci_cfg_addr(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off)) argument
63 static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn, in pci_cfg_read_32bit() argument
66 u32 data; in pci_cfg_read_32bit() local
72 if (bus->number == 0) { in pci_cfg_read_32bit()
73 /* Scan only existing nodes - uboot bug? */ in pci_cfg_read_32bit()
77 } else if (bus->parent->number == 0) { /* SoC bus */ in pci_cfg_read_32bit()
83 } else if (bus->number == 0 && PCI_SLOT(devfn) == 1 && where == 0x954) { in pci_cfg_read_32bit()
87 pci_cfg_addr(bus->number, devfn, where)); in pci_cfg_read_32bit()
88 data = *cfgaddr; in pci_cfg_read_32bit()
89 return data; in pci_cfg_read_32bit()
92 static inline void pci_cfg_write_32bit(struct pci_bus *bus, unsigned int devfn, in pci_cfg_write_32bit() argument
93 int where, u32 data) in pci_cfg_write_32bit() argument
98 pci_cfg_addr(bus->number, devfn, where & ~3)); in pci_cfg_write_32bit()
99 *cfgaddr = data; in pci_cfg_write_32bit()
102 static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn, in nlm_pcibios_read() argument
105 u32 data; in nlm_pcibios_read() local
112 data = pci_cfg_read_32bit(bus, devfn, where); in nlm_pcibios_read()
115 *val = (data >> ((where & 3) << 3)) & 0xff; in nlm_pcibios_read()
117 *val = (data >> ((where & 3) << 3)) & 0xffff; in nlm_pcibios_read()
119 *val = data; in nlm_pcibios_read()
125 static int nlm_pcibios_write(struct pci_bus *bus, unsigned int devfn, in nlm_pcibios_write() argument
128 u32 data; in nlm_pcibios_write() local
135 data = pci_cfg_read_32bit(bus, devfn, where); in nlm_pcibios_write()
138 data = (data & ~(0xff << ((where & 3) << 3))) | in nlm_pcibios_write()
141 data = (data & ~(0xffff << ((where & 3) << 3))) | in nlm_pcibios_write()
144 data = val; in nlm_pcibios_write()
146 pci_cfg_write_32bit(bus, devfn, where, data); in nlm_pcibios_write()
181 struct pci_bus *bus, *p; in xlp_get_pcie_link() local
183 bus = dev->bus; in xlp_get_pcie_link()
186 /* find bus with grand parent number == 0 */ in xlp_get_pcie_link()
187 for (p = bus->parent; p && p->parent && p->parent->number != 0; in xlp_get_pcie_link()
188 p = p->parent) in xlp_get_pcie_link()
189 bus = p; in xlp_get_pcie_link()
190 return (p && p->parent) ? bus->self : NULL; in xlp_get_pcie_link()
192 /* Find the bridge on bus 0 */ in xlp_get_pcie_link()
193 for (p = bus->parent; p && p->number != 0; p = p->parent) in xlp_get_pcie_link()
194 bus = p; in xlp_get_pcie_link()
196 return p ? bus->self : NULL; in xlp_get_pcie_link()
203 return PCI_FUNC(lnkdev->bus->self->devfn); in xlp_socdev_to_node()
205 return PCI_SLOT(lnkdev->devfn) / 8; in xlp_socdev_to_node()
221 lnkfunc = PCI_FUNC(lnkdev->devfn); in pcibios_map_irq()
234 * If big-endian, enable hardware byteswap on the PCIe bridges.
285 /* Swap configuration not needed in little-endian mode */
314 /* put in intpin and irq - u-boot does not */ in pcibios_init()
319 pr_info("XLP PCIe: Link %d-%d initialized.\n", n, link); in pcibios_init()