diff options
author | John Crispin <blogic@openwrt.org> | 2015-11-04 21:56:23 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-11-11 02:38:24 -0500 |
commit | 08b3c894e56580b8ed3e601212a25bda974c3cc2 (patch) | |
tree | 925ec1e00898411c4e729ee661c1823791a24de8 | |
parent | 9eb8c69e0b00d5e7970a682454180780b6a3d020 (diff) |
MIPS: lantiq: Disable xbar fpi burst mode
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11458/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/lantiq/xway/sysctrl.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c index 7b3a01456014..80554e8f6037 100644 --- a/arch/mips/lantiq/xway/sysctrl.c +++ b/arch/mips/lantiq/xway/sysctrl.c | |||
@@ -145,7 +145,15 @@ static u32 pmu_clk_cr_b[] = { | |||
145 | #define pmu_w32(x, y) ltq_w32((x), pmu_membase + (y)) | 145 | #define pmu_w32(x, y) ltq_w32((x), pmu_membase + (y)) |
146 | #define pmu_r32(x) ltq_r32(pmu_membase + (x)) | 146 | #define pmu_r32(x) ltq_r32(pmu_membase + (x)) |
147 | 147 | ||
148 | #define XBAR_ALWAYS_LAST 0x430 | ||
149 | #define XBAR_FPI_BURST_EN BIT(1) | ||
150 | #define XBAR_AHB_BURST_EN BIT(2) | ||
151 | |||
152 | #define xbar_w32(x, y) ltq_w32((x), ltq_xbar_membase + (y)) | ||
153 | #define xbar_r32(x) ltq_r32(ltq_xbar_membase + (x)) | ||
154 | |||
148 | static void __iomem *pmu_membase; | 155 | static void __iomem *pmu_membase; |
156 | static void __iomem *ltq_xbar_membase; | ||
149 | void __iomem *ltq_cgu_membase; | 157 | void __iomem *ltq_cgu_membase; |
150 | void __iomem *ltq_ebu_membase; | 158 | void __iomem *ltq_ebu_membase; |
151 | 159 | ||
@@ -285,6 +293,16 @@ static void pci_ext_disable(struct clk *clk) | |||
285 | ltq_cgu_w32((1 << 31) | (1 << 30), pcicr); | 293 | ltq_cgu_w32((1 << 31) | (1 << 30), pcicr); |
286 | } | 294 | } |
287 | 295 | ||
296 | static void xbar_fpi_burst_disable(void) | ||
297 | { | ||
298 | u32 reg; | ||
299 | |||
300 | /* bit 1 as 1 --burst; bit 1 as 0 -- single */ | ||
301 | reg = xbar_r32(XBAR_ALWAYS_LAST); | ||
302 | reg &= ~XBAR_FPI_BURST_EN; | ||
303 | xbar_w32(reg, XBAR_ALWAYS_LAST); | ||
304 | } | ||
305 | |||
288 | /* enable a clockout source */ | 306 | /* enable a clockout source */ |
289 | static int clkout_enable(struct clk *clk) | 307 | static int clkout_enable(struct clk *clk) |
290 | { | 308 | { |
@@ -441,6 +459,26 @@ void __init ltq_soc_init(void) | |||
441 | if (!pmu_membase || !ltq_cgu_membase || !ltq_ebu_membase) | 459 | if (!pmu_membase || !ltq_cgu_membase || !ltq_ebu_membase) |
442 | panic("Failed to remap core resources"); | 460 | panic("Failed to remap core resources"); |
443 | 461 | ||
462 | if (of_machine_is_compatible("lantiq,vr9")) { | ||
463 | struct resource res_xbar; | ||
464 | struct device_node *np_xbar = | ||
465 | of_find_compatible_node(NULL, NULL, | ||
466 | "lantiq,xbar-xway"); | ||
467 | |||
468 | if (!np_xbar) | ||
469 | panic("Failed to load xbar nodes from devicetree"); | ||
470 | if (of_address_to_resource(np_pmu, 0, &res_xbar)) | ||
471 | panic("Failed to get xbar resources"); | ||
472 | if (request_mem_region(res_xbar.start, resource_size(&res_xbar), | ||
473 | res_xbar.name) < 0) | ||
474 | panic("Failed to get xbar resources"); | ||
475 | |||
476 | ltq_xbar_membase = ioremap_nocache(res_xbar.start, | ||
477 | resource_size(&res_xbar)); | ||
478 | if (!ltq_xbar_membase) | ||
479 | panic("Failed to remap xbar resources"); | ||
480 | } | ||
481 | |||
444 | /* make sure to unprotect the memory region where flash is located */ | 482 | /* make sure to unprotect the memory region where flash is located */ |
445 | ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_BUSCON0) & ~EBU_WRDIS, LTQ_EBU_BUSCON0); | 483 | ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_BUSCON0) & ~EBU_WRDIS, LTQ_EBU_BUSCON0); |
446 | 484 | ||
@@ -567,4 +605,7 @@ void __init ltq_soc_init(void) | |||
567 | clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE); | 605 | clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE); |
568 | clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0); | 606 | clkdev_add_pmu("1e100400.serial", NULL, 1, 0, PMU_ASC0); |
569 | } | 607 | } |
608 | |||
609 | if (of_machine_is_compatible("lantiq,vr9")) | ||
610 | xbar_fpi_burst_disable(); | ||
570 | } | 611 | } |