diff options
author | Olof Johansson <olof@lixom.net> | 2013-04-18 01:26:15 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-04-18 01:26:25 -0400 |
commit | 8b85143e5dc428e8023bd741dfa9ec2e64ff4525 (patch) | |
tree | c7bdc555c5ac39c8ce6850e575e3906666cc05d2 /arch/arm/mach-kirkwood | |
parent | 567b1b0839150e8d701553cbb586365b1f2ed36c (diff) | |
parent | da497f6fbaa190d34907ecc9dd85cfc62ba9f5a2 (diff) |
Merge tag 'soc_for_v3.10' of git://git.infradead.org/users/jcooper/linux into next/soc2
From Jason Cooper:
mvebu soc changes for v3.10
- use the mvebu-mbus driver
- prep for LPAE support
Depends:
- mvebu/cleanup (tags/cleanup_for_v3.10)
- mvebu/drivers (tags/drivers_for_v3.10)
* tag 'soc_for_v3.10' of git://git.infradead.org/users/jcooper/linux:
ARM: mvebu: Align the internal registers virtual base to support LPAE
ARM: mvebu: Limit the DMA zone when LPAE is selected
arm: plat-orion: remove addr-map code
arm: mach-mv78xx0: convert to use the mvebu-mbus driver
arm: mach-orion5x: convert to use mvebu-mbus driver
arm: mach-dove: convert to use mvebu-mbus driver
arm: mach-kirkwood: convert to use mvebu-mbus driver
arm: mach-mvebu: convert to use mvebu-mbus driver
bus: mvebu: fix mistake in PCIe window target attribute for Kirkwood
bus: mvebu-mbus: Restore checking for coherency fabric hardware
ARM: Orion: add dbg_show function to gpio-orion driver
bus: introduce an Marvell EBU MBus driver
arm: mach-orion5x: use mv_mbus_dram_info() in PCI code
arm: plat-orion: use mv_mbus_dram_info() in PCIe code
arm: plat-orion: only build addr-map.c when needed
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-kirkwood')
-rw-r--r-- | arch/arm/mach-kirkwood/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/addr-map.c | 91 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-dt.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/kirkwood.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/pcie.c | 1 |
7 files changed, 44 insertions, 99 deletions
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 4cc4bee4d0cf..d805f8078fa3 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | obj-y += common.o addr-map.o irq.o pcie.o mpp.o | 1 | obj-y += common.o irq.o pcie.o mpp.o |
2 | 2 | ||
3 | obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o | 3 | obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o |
4 | obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o | 4 | obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o |
diff --git a/arch/arm/mach-kirkwood/addr-map.c b/arch/arm/mach-kirkwood/addr-map.c deleted file mode 100644 index 8f0d162a1e1d..000000000000 --- a/arch/arm/mach-kirkwood/addr-map.c +++ /dev/null | |||
@@ -1,91 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/addr-map.c | ||
3 | * | ||
4 | * Address map functions for Marvell Kirkwood SoCs | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/mbus.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <mach/hardware.h> | ||
16 | #include <plat/addr-map.h> | ||
17 | #include "common.h" | ||
18 | |||
19 | /* | ||
20 | * Generic Address Decode Windows bit settings | ||
21 | */ | ||
22 | #define TARGET_DEV_BUS 1 | ||
23 | #define TARGET_SRAM 3 | ||
24 | #define TARGET_PCIE 4 | ||
25 | #define ATTR_DEV_SPI_ROM 0x1e | ||
26 | #define ATTR_DEV_BOOT 0x1d | ||
27 | #define ATTR_DEV_NAND 0x2f | ||
28 | #define ATTR_DEV_CS3 0x37 | ||
29 | #define ATTR_DEV_CS2 0x3b | ||
30 | #define ATTR_DEV_CS1 0x3d | ||
31 | #define ATTR_DEV_CS0 0x3e | ||
32 | #define ATTR_PCIE_IO 0xe0 | ||
33 | #define ATTR_PCIE_MEM 0xe8 | ||
34 | #define ATTR_PCIE1_IO 0xd0 | ||
35 | #define ATTR_PCIE1_MEM 0xd8 | ||
36 | #define ATTR_SRAM 0x01 | ||
37 | |||
38 | /* | ||
39 | * Description of the windows needed by the platform code | ||
40 | */ | ||
41 | static struct __initdata orion_addr_map_cfg addr_map_cfg = { | ||
42 | .num_wins = 8, | ||
43 | .remappable_wins = 4, | ||
44 | .bridge_virt_base = BRIDGE_VIRT_BASE, | ||
45 | }; | ||
46 | |||
47 | static const struct __initdata orion_addr_map_info addr_map_info[] = { | ||
48 | /* | ||
49 | * Windows for PCIe IO+MEM space. | ||
50 | */ | ||
51 | { 0, KIRKWOOD_PCIE_IO_PHYS_BASE, KIRKWOOD_PCIE_IO_SIZE, | ||
52 | TARGET_PCIE, ATTR_PCIE_IO, KIRKWOOD_PCIE_IO_BUS_BASE | ||
53 | }, | ||
54 | { 1, KIRKWOOD_PCIE_MEM_PHYS_BASE, KIRKWOOD_PCIE_MEM_SIZE, | ||
55 | TARGET_PCIE, ATTR_PCIE_MEM, KIRKWOOD_PCIE_MEM_BUS_BASE | ||
56 | }, | ||
57 | { 2, KIRKWOOD_PCIE1_IO_PHYS_BASE, KIRKWOOD_PCIE1_IO_SIZE, | ||
58 | TARGET_PCIE, ATTR_PCIE1_IO, KIRKWOOD_PCIE1_IO_BUS_BASE | ||
59 | }, | ||
60 | { 3, KIRKWOOD_PCIE1_MEM_PHYS_BASE, KIRKWOOD_PCIE1_MEM_SIZE, | ||
61 | TARGET_PCIE, ATTR_PCIE1_MEM, KIRKWOOD_PCIE1_MEM_BUS_BASE | ||
62 | }, | ||
63 | /* | ||
64 | * Window for NAND controller. | ||
65 | */ | ||
66 | { 4, KIRKWOOD_NAND_MEM_PHYS_BASE, KIRKWOOD_NAND_MEM_SIZE, | ||
67 | TARGET_DEV_BUS, ATTR_DEV_NAND, -1 | ||
68 | }, | ||
69 | /* | ||
70 | * Window for SRAM. | ||
71 | */ | ||
72 | { 5, KIRKWOOD_SRAM_PHYS_BASE, KIRKWOOD_SRAM_SIZE, | ||
73 | TARGET_SRAM, ATTR_SRAM, -1 | ||
74 | }, | ||
75 | /* End marker */ | ||
76 | { -1, 0, 0, 0, 0, 0 } | ||
77 | }; | ||
78 | |||
79 | void __init kirkwood_setup_cpu_mbus(void) | ||
80 | { | ||
81 | /* | ||
82 | * Disable, clear and configure windows. | ||
83 | */ | ||
84 | orion_config_wins(&addr_map_cfg, addr_map_info); | ||
85 | |||
86 | /* | ||
87 | * Setup MBUS dram target info. | ||
88 | */ | ||
89 | orion_setup_cpu_mbus_target(&addr_map_cfg, | ||
90 | (void __iomem *) DDR_WINDOW_CPU_BASE); | ||
91 | } | ||
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index d367aa6b47bb..f5437c27dc2a 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -93,7 +93,7 @@ static void __init kirkwood_dt_init(void) | |||
93 | */ | 93 | */ |
94 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); | 94 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
95 | 95 | ||
96 | kirkwood_setup_cpu_mbus(); | 96 | kirkwood_setup_wins(); |
97 | 97 | ||
98 | kirkwood_l2_init(); | 98 | kirkwood_l2_init(); |
99 | 99 | ||
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 49792a0cd2d3..c2cae69e6d2b 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/platform_data/usb-ehci-orion.h> | 33 | #include <linux/platform_data/usb-ehci-orion.h> |
34 | #include <plat/common.h> | 34 | #include <plat/common.h> |
35 | #include <plat/time.h> | 35 | #include <plat/time.h> |
36 | #include <plat/addr-map.h> | ||
37 | #include <linux/platform_data/dma-mv_xor.h> | 36 | #include <linux/platform_data/dma-mv_xor.h> |
38 | #include "common.h" | 37 | #include "common.h" |
39 | 38 | ||
@@ -535,6 +534,9 @@ void __init kirkwood_init_early(void) | |||
535 | * the allocations won't fail. | 534 | * the allocations won't fail. |
536 | */ | 535 | */ |
537 | init_dma_coherent_pool_size(SZ_1M); | 536 | init_dma_coherent_pool_size(SZ_1M); |
537 | mvebu_mbus_init("marvell,kirkwood-mbus", | ||
538 | BRIDGE_WINS_BASE, BRIDGE_WINS_SZ, | ||
539 | DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ); | ||
538 | } | 540 | } |
539 | 541 | ||
540 | int kirkwood_tclk; | 542 | int kirkwood_tclk; |
@@ -650,6 +652,38 @@ char * __init kirkwood_id(void) | |||
650 | } | 652 | } |
651 | } | 653 | } |
652 | 654 | ||
655 | void __init kirkwood_setup_wins(void) | ||
656 | { | ||
657 | /* | ||
658 | * The PCIe windows will no longer be statically allocated | ||
659 | * here once Kirkwood is migrated to the pci-mvebu driver. | ||
660 | */ | ||
661 | mvebu_mbus_add_window_remap_flags("pcie0.0", | ||
662 | KIRKWOOD_PCIE_IO_PHYS_BASE, | ||
663 | KIRKWOOD_PCIE_IO_SIZE, | ||
664 | KIRKWOOD_PCIE_IO_BUS_BASE, | ||
665 | MVEBU_MBUS_PCI_IO); | ||
666 | mvebu_mbus_add_window_remap_flags("pcie0.0", | ||
667 | KIRKWOOD_PCIE_MEM_PHYS_BASE, | ||
668 | KIRKWOOD_PCIE_MEM_SIZE, | ||
669 | MVEBU_MBUS_NO_REMAP, | ||
670 | MVEBU_MBUS_PCI_MEM); | ||
671 | mvebu_mbus_add_window_remap_flags("pcie1.0", | ||
672 | KIRKWOOD_PCIE1_IO_PHYS_BASE, | ||
673 | KIRKWOOD_PCIE1_IO_SIZE, | ||
674 | KIRKWOOD_PCIE1_IO_BUS_BASE, | ||
675 | MVEBU_MBUS_PCI_IO); | ||
676 | mvebu_mbus_add_window_remap_flags("pcie1.0", | ||
677 | KIRKWOOD_PCIE1_MEM_PHYS_BASE, | ||
678 | KIRKWOOD_PCIE1_MEM_SIZE, | ||
679 | MVEBU_MBUS_NO_REMAP, | ||
680 | MVEBU_MBUS_PCI_MEM); | ||
681 | mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE, | ||
682 | KIRKWOOD_NAND_MEM_SIZE); | ||
683 | mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE, | ||
684 | KIRKWOOD_SRAM_SIZE); | ||
685 | } | ||
686 | |||
653 | void __init kirkwood_l2_init(void) | 687 | void __init kirkwood_l2_init(void) |
654 | { | 688 | { |
655 | #ifdef CONFIG_CACHE_FEROCEON_L2 | 689 | #ifdef CONFIG_CACHE_FEROCEON_L2 |
@@ -675,7 +709,7 @@ void __init kirkwood_init(void) | |||
675 | */ | 709 | */ |
676 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); | 710 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
677 | 711 | ||
678 | kirkwood_setup_cpu_mbus(); | 712 | kirkwood_setup_wins(); |
679 | 713 | ||
680 | kirkwood_l2_init(); | 714 | kirkwood_l2_init(); |
681 | 715 | ||
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 5ed70565c843..e24f74305b34 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -30,7 +30,7 @@ void kirkwood_init(void); | |||
30 | void kirkwood_init_early(void); | 30 | void kirkwood_init_early(void); |
31 | void kirkwood_init_irq(void); | 31 | void kirkwood_init_irq(void); |
32 | 32 | ||
33 | void kirkwood_setup_cpu_mbus(void); | 33 | void kirkwood_setup_wins(void); |
34 | 34 | ||
35 | void kirkwood_enable_pcie(void); | 35 | void kirkwood_enable_pcie(void); |
36 | void kirkwood_pcie_id(u32 *dev, u32 *rev); | 36 | void kirkwood_pcie_id(u32 *dev, u32 *rev); |
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index a05563a31c95..92976cef3910 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -60,8 +60,9 @@ | |||
60 | * Register Map | 60 | * Register Map |
61 | */ | 61 | */ |
62 | #define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000) | 62 | #define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x00000) |
63 | #define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000) | 63 | #define DDR_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x00000) |
64 | #define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE + 0x1500) | 64 | #define DDR_WINDOW_CPU_BASE (DDR_PHYS_BASE + 0x1500) |
65 | #define DDR_WINDOW_CPU_SZ (0x20) | ||
65 | #define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418) | 66 | #define DDR_OPERATION_BASE (DDR_PHYS_BASE + 0x1418) |
66 | 67 | ||
67 | #define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000) | 68 | #define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x10000) |
@@ -80,6 +81,8 @@ | |||
80 | 81 | ||
81 | #define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x20000) | 82 | #define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE + 0x20000) |
82 | #define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000) | 83 | #define BRIDGE_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x20000) |
84 | #define BRIDGE_WINS_BASE (BRIDGE_PHYS_BASE) | ||
85 | #define BRIDGE_WINS_SZ (0x80) | ||
83 | 86 | ||
84 | #define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x30000) | 87 | #define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE + 0x30000) |
85 | 88 | ||
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c index d96ad4c09972..7f43e6c2f8c0 100644 --- a/arch/arm/mach-kirkwood/pcie.c +++ b/arch/arm/mach-kirkwood/pcie.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <asm/mach/pci.h> | 17 | #include <asm/mach/pci.h> |
18 | #include <plat/pcie.h> | 18 | #include <plat/pcie.h> |
19 | #include <mach/bridge-regs.h> | 19 | #include <mach/bridge-regs.h> |
20 | #include <plat/addr-map.h> | ||
21 | #include "common.h" | 20 | #include "common.h" |
22 | 21 | ||
23 | static void kirkwood_enable_pcie_clk(const char *port) | 22 | static void kirkwood_enable_pcie_clk(const char *port) |