Lines Matching refs:pp

32 	struct pcie_port	pp;  member
144 #define to_spear13xx_pcie(x) container_of(x, struct spear13xx_pcie, pp)
146 static int spear13xx_pcie_establish_link(struct pcie_port *pp) in spear13xx_pcie_establish_link() argument
149 struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pp); in spear13xx_pcie_establish_link()
154 if (dw_pcie_link_up(pp)) { in spear13xx_pcie_establish_link()
155 dev_err(pp->dev, "link already up\n"); in spear13xx_pcie_establish_link()
159 dw_pcie_setup_rc(pp); in spear13xx_pcie_establish_link()
166 dw_pcie_cfg_read(pp->dbi_base + exp_cap_off + PCI_EXP_DEVCTL, 2, &val); in spear13xx_pcie_establish_link()
168 dw_pcie_cfg_write(pp->dbi_base + exp_cap_off + PCI_EXP_DEVCTL, 2, val); in spear13xx_pcie_establish_link()
170 dw_pcie_cfg_write(pp->dbi_base + PCI_VENDOR_ID, 2, 0x104A); in spear13xx_pcie_establish_link()
171 dw_pcie_cfg_write(pp->dbi_base + PCI_DEVICE_ID, 2, 0xCD80); in spear13xx_pcie_establish_link()
178 dw_pcie_cfg_read(pp->dbi_base + exp_cap_off + PCI_EXP_LNKCAP, in spear13xx_pcie_establish_link()
183 dw_pcie_cfg_write(pp->dbi_base + exp_cap_off + in spear13xx_pcie_establish_link()
187 dw_pcie_cfg_read(pp->dbi_base + exp_cap_off + PCI_EXP_LNKCTL2, in spear13xx_pcie_establish_link()
192 dw_pcie_cfg_write(pp->dbi_base + exp_cap_off + in spear13xx_pcie_establish_link()
205 if (dw_pcie_link_up(pp)) { in spear13xx_pcie_establish_link()
206 dev_info(pp->dev, "link up\n"); in spear13xx_pcie_establish_link()
212 dev_err(pp->dev, "link Fail\n"); in spear13xx_pcie_establish_link()
218 struct pcie_port *pp = arg; in spear13xx_pcie_irq_handler() local
219 struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pp); in spear13xx_pcie_irq_handler()
227 dw_handle_msi_irq(pp); in spear13xx_pcie_irq_handler()
235 static void spear13xx_pcie_enable_interrupts(struct pcie_port *pp) in spear13xx_pcie_enable_interrupts() argument
237 struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pp); in spear13xx_pcie_enable_interrupts()
242 dw_pcie_msi_init(pp); in spear13xx_pcie_enable_interrupts()
248 static int spear13xx_pcie_link_up(struct pcie_port *pp) in spear13xx_pcie_link_up() argument
250 struct spear13xx_pcie *spear13xx_pcie = to_spear13xx_pcie(pp); in spear13xx_pcie_link_up()
259 static void spear13xx_pcie_host_init(struct pcie_port *pp) in spear13xx_pcie_host_init() argument
261 spear13xx_pcie_establish_link(pp); in spear13xx_pcie_host_init()
262 spear13xx_pcie_enable_interrupts(pp); in spear13xx_pcie_host_init()
270 static int spear13xx_add_pcie_port(struct pcie_port *pp, in spear13xx_add_pcie_port() argument
276 pp->irq = platform_get_irq(pdev, 0); in spear13xx_add_pcie_port()
277 if (!pp->irq) { in spear13xx_add_pcie_port()
281 ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler, in spear13xx_add_pcie_port()
283 "spear1340-pcie", pp); in spear13xx_add_pcie_port()
285 dev_err(dev, "failed to request irq %d\n", pp->irq); in spear13xx_add_pcie_port()
289 pp->root_bus_nr = -1; in spear13xx_add_pcie_port()
290 pp->ops = &spear13xx_pcie_host_ops; in spear13xx_add_pcie_port()
292 ret = dw_pcie_host_init(pp); in spear13xx_add_pcie_port()
304 struct pcie_port *pp; in spear13xx_pcie_probe() local
337 pp = &spear13xx_pcie->pp; in spear13xx_pcie_probe()
339 pp->dev = dev; in spear13xx_pcie_probe()
342 pp->dbi_base = devm_ioremap_resource(dev, dbi_base); in spear13xx_pcie_probe()
343 if (IS_ERR(pp->dbi_base)) { in spear13xx_pcie_probe()
345 ret = PTR_ERR(pp->dbi_base); in spear13xx_pcie_probe()
348 spear13xx_pcie->app_base = pp->dbi_base + 0x2000; in spear13xx_pcie_probe()
353 ret = spear13xx_add_pcie_port(pp, pdev); in spear13xx_pcie_probe()