diff options
Diffstat (limited to 'drivers/pci/controller/pci-aardvark.c')
-rw-r--r-- | drivers/pci/controller/pci-aardvark.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 7b363437d851..c9c72595bd20 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c | |||
@@ -111,24 +111,6 @@ | |||
111 | #define PCIE_MSI_MASK_REG (CONTROL_BASE_ADDR + 0x5C) | 111 | #define PCIE_MSI_MASK_REG (CONTROL_BASE_ADDR + 0x5C) |
112 | #define PCIE_MSI_PAYLOAD_REG (CONTROL_BASE_ADDR + 0x9C) | 112 | #define PCIE_MSI_PAYLOAD_REG (CONTROL_BASE_ADDR + 0x9C) |
113 | 113 | ||
114 | /* PCIe window configuration */ | ||
115 | #define OB_WIN_BASE_ADDR 0x4c00 | ||
116 | #define OB_WIN_BLOCK_SIZE 0x20 | ||
117 | #define OB_WIN_REG_ADDR(win, offset) (OB_WIN_BASE_ADDR + \ | ||
118 | OB_WIN_BLOCK_SIZE * (win) + \ | ||
119 | (offset)) | ||
120 | #define OB_WIN_MATCH_LS(win) OB_WIN_REG_ADDR(win, 0x00) | ||
121 | #define OB_WIN_MATCH_MS(win) OB_WIN_REG_ADDR(win, 0x04) | ||
122 | #define OB_WIN_REMAP_LS(win) OB_WIN_REG_ADDR(win, 0x08) | ||
123 | #define OB_WIN_REMAP_MS(win) OB_WIN_REG_ADDR(win, 0x0c) | ||
124 | #define OB_WIN_MASK_LS(win) OB_WIN_REG_ADDR(win, 0x10) | ||
125 | #define OB_WIN_MASK_MS(win) OB_WIN_REG_ADDR(win, 0x14) | ||
126 | #define OB_WIN_ACTIONS(win) OB_WIN_REG_ADDR(win, 0x18) | ||
127 | |||
128 | /* PCIe window types */ | ||
129 | #define OB_PCIE_MEM 0x0 | ||
130 | #define OB_PCIE_IO 0x4 | ||
131 | |||
132 | /* LMI registers base address and register offsets */ | 114 | /* LMI registers base address and register offsets */ |
133 | #define LMI_BASE_ADDR 0x6000 | 115 | #define LMI_BASE_ADDR 0x6000 |
134 | #define CFG_REG (LMI_BASE_ADDR + 0x0) | 116 | #define CFG_REG (LMI_BASE_ADDR + 0x0) |
@@ -247,34 +229,9 @@ static int advk_pcie_wait_for_link(struct advk_pcie *pcie) | |||
247 | return -ETIMEDOUT; | 229 | return -ETIMEDOUT; |
248 | } | 230 | } |
249 | 231 | ||
250 | /* | ||
251 | * Set PCIe address window register which could be used for memory | ||
252 | * mapping. | ||
253 | */ | ||
254 | static void advk_pcie_set_ob_win(struct advk_pcie *pcie, | ||
255 | u32 win_num, u32 match_ms, | ||
256 | u32 match_ls, u32 mask_ms, | ||
257 | u32 mask_ls, u32 remap_ms, | ||
258 | u32 remap_ls, u32 action) | ||
259 | { | ||
260 | advk_writel(pcie, match_ls, OB_WIN_MATCH_LS(win_num)); | ||
261 | advk_writel(pcie, match_ms, OB_WIN_MATCH_MS(win_num)); | ||
262 | advk_writel(pcie, mask_ms, OB_WIN_MASK_MS(win_num)); | ||
263 | advk_writel(pcie, mask_ls, OB_WIN_MASK_LS(win_num)); | ||
264 | advk_writel(pcie, remap_ms, OB_WIN_REMAP_MS(win_num)); | ||
265 | advk_writel(pcie, remap_ls, OB_WIN_REMAP_LS(win_num)); | ||
266 | advk_writel(pcie, action, OB_WIN_ACTIONS(win_num)); | ||
267 | advk_writel(pcie, match_ls | BIT(0), OB_WIN_MATCH_LS(win_num)); | ||
268 | } | ||
269 | |||
270 | static void advk_pcie_setup_hw(struct advk_pcie *pcie) | 232 | static void advk_pcie_setup_hw(struct advk_pcie *pcie) |
271 | { | 233 | { |
272 | u32 reg; | 234 | u32 reg; |
273 | int i; | ||
274 | |||
275 | /* Point PCIe unit MBUS decode windows to DRAM space */ | ||
276 | for (i = 0; i < 8; i++) | ||
277 | advk_pcie_set_ob_win(pcie, i, 0, 0, 0, 0, 0, 0, 0); | ||
278 | 235 | ||
279 | /* Set to Direct mode */ | 236 | /* Set to Direct mode */ |
280 | reg = advk_readl(pcie, CTRL_CONFIG_REG); | 237 | reg = advk_readl(pcie, CTRL_CONFIG_REG); |
@@ -852,12 +809,6 @@ static int advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie) | |||
852 | 809 | ||
853 | switch (resource_type(res)) { | 810 | switch (resource_type(res)) { |
854 | case IORESOURCE_IO: | 811 | case IORESOURCE_IO: |
855 | advk_pcie_set_ob_win(pcie, 1, | ||
856 | upper_32_bits(res->start), | ||
857 | lower_32_bits(res->start), | ||
858 | 0, 0xF8000000, 0, | ||
859 | lower_32_bits(res->start), | ||
860 | OB_PCIE_IO); | ||
861 | err = pci_remap_iospace(res, iobase); | 812 | err = pci_remap_iospace(res, iobase); |
862 | if (err) { | 813 | if (err) { |
863 | dev_warn(dev, "error %d: failed to map resource %pR\n", | 814 | dev_warn(dev, "error %d: failed to map resource %pR\n", |
@@ -866,12 +817,6 @@ static int advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie) | |||
866 | } | 817 | } |
867 | break; | 818 | break; |
868 | case IORESOURCE_MEM: | 819 | case IORESOURCE_MEM: |
869 | advk_pcie_set_ob_win(pcie, 0, | ||
870 | upper_32_bits(res->start), | ||
871 | lower_32_bits(res->start), | ||
872 | 0x0, 0xF8000000, 0, | ||
873 | lower_32_bits(res->start), | ||
874 | (2 << 20) | OB_PCIE_MEM); | ||
875 | res_valid |= !(res->flags & IORESOURCE_PREFETCH); | 820 | res_valid |= !(res->flags & IORESOURCE_PREFETCH); |
876 | break; | 821 | break; |
877 | case IORESOURCE_BUS: | 822 | case IORESOURCE_BUS: |