.. | .. |
---|
10 | 10 | |
---|
11 | 11 | #include <linux/clk.h> |
---|
12 | 12 | #include <linux/gpio/consumer.h> |
---|
13 | | -#include <linux/iopoll.h> |
---|
14 | 13 | #include <linux/miscdevice.h> |
---|
15 | 14 | #include <linux/mfd/syscon.h> |
---|
16 | 15 | #include <linux/module.h> |
---|
.. | .. |
---|
207 | 206 | struct device_node *np = dev->of_node; |
---|
208 | 207 | void *addr; |
---|
209 | 208 | struct resource *dbi_base; |
---|
210 | | - struct resource *apb_base; |
---|
211 | 209 | struct device_node *mem; |
---|
212 | 210 | struct resource reg; |
---|
213 | 211 | char name[8]; |
---|
.. | .. |
---|
223 | 221 | rockchip->pci.dbi_base = devm_ioremap_resource(dev, dbi_base); |
---|
224 | 222 | if (IS_ERR(rockchip->pci.dbi_base)) |
---|
225 | 223 | return PTR_ERR(rockchip->pci.dbi_base); |
---|
| 224 | + rockchip->pci.atu_base = rockchip->pci.dbi_base + DEFAULT_DBI_ATU_OFFSET; |
---|
226 | 225 | rockchip->dbi_base_physical = dbi_base->start; |
---|
227 | 226 | |
---|
228 | | - apb_base = platform_get_resource_byname(pdev, IORESOURCE_MEM, |
---|
229 | | - "pcie-apb"); |
---|
230 | | - if (!apb_base) { |
---|
| 227 | + rockchip->apb_base = devm_platform_ioremap_resource_byname(pdev, "pcie-apb"); |
---|
| 228 | + if (!rockchip->apb_base) { |
---|
231 | 229 | dev_err(dev, "get pcie-apb failed\n"); |
---|
232 | 230 | return -ENODEV; |
---|
233 | 231 | } |
---|
234 | | - rockchip->apb_base = devm_ioremap_resource(dev, apb_base); |
---|
235 | | - if (IS_ERR(rockchip->apb_base)) |
---|
236 | | - return PTR_ERR(rockchip->apb_base); |
---|
237 | 232 | |
---|
238 | 233 | rockchip->rst_gpio = devm_gpiod_get_optional(dev, "reset", |
---|
239 | 234 | GPIOD_OUT_HIGH); |
---|
.. | .. |
---|
580 | 575 | |
---|
581 | 576 | as_type = DW_PCIE_AS_MEM; |
---|
582 | 577 | |
---|
583 | | - ret = dw_pcie_prog_inbound_atu(pci, free_win, bar, cpu_addr, as_type); |
---|
| 578 | + ret = dw_pcie_prog_inbound_atu(pci, 0, free_win, bar, cpu_addr, as_type); |
---|
584 | 579 | if (ret < 0) { |
---|
585 | 580 | dev_err(pci->dev, "Failed to program IB window\n"); |
---|
586 | 581 | return ret; |
---|