aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-05-15 09:37:01 -0400
committerJason Cooper <jason@lakedaemon.net>2013-05-27 12:02:13 -0400
commit0d0632f523fa040b307688ae421a1debf79af2d7 (patch)
tree70acd8920e5ba356890dcad0e81dafd679419f64 /arch
parent259e234608dbc6c6a673efb5d58a1c036eb9b47a (diff)
arm: kirkwood: convert db-88f6281/db-88f6282 to the Device Tree
This commit converts the Marvell DB-88F6281/DB-88F6282 board to the Device Tree. In fact, the code was supporting two different boards: one with the 6281 SoC variant, and one with the 6282 SoC variant. The difference between the two being that the 6281 has one PCIe interface, and the 6282 has two PCIe interfaces. In order to handle that with the Device Tree, we create a 'kirkwood-db.dtsi' file that contains the definitions common to both boards, and 'kirkwood-db-88f6281.dts' and 'kirkwood-db-88f6282.dts' for the definitions specific to each board. This is similar to what is done for the QNAP TS219 Kirkwood platform. We have kept one single Kconfig option, just like it was before. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/Makefile2
-rw-r--r--arch/arm/boot/dts/kirkwood-db-88f6281.dts30
-rw-r--r--arch/arm/boot/dts/kirkwood-db-88f6282.dts34
-rw-r--r--arch/arm/boot/dts/kirkwood-db.dtsi89
-rw-r--r--arch/arm/mach-kirkwood/Kconfig13
-rw-r--r--arch/arm/mach-kirkwood/Makefile2
-rw-r--r--arch/arm/mach-kirkwood/board-db88f628x-bp.c24
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c6
-rw-r--r--arch/arm/mach-kirkwood/common.h6
-rw-r--r--arch/arm/mach-kirkwood/db88f6281-bp-setup.c108
10 files changed, 199 insertions, 115 deletions
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9f7121e6ecf..cc53176056d6 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -64,6 +64,8 @@ dtb-$(CONFIG_ARCH_INTEGRATOR) += integratorap.dtb \
64 integratorcp.dtb 64 integratorcp.dtb
65dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb 65dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
66dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ 66dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
67 kirkwood-db-88f6281.dtb \
68 kirkwood-db-88f6282.dtb \
67 kirkwood-dns320.dtb \ 69 kirkwood-dns320.dtb \
68 kirkwood-dns325.dtb \ 70 kirkwood-dns325.dtb \
69 kirkwood-dockstar.dtb \ 71 kirkwood-dockstar.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-db-88f6281.dts b/arch/arm/boot/dts/kirkwood-db-88f6281.dts
new file mode 100644
index 000000000000..9d777edd1f36
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-db-88f6281.dts
@@ -0,0 +1,30 @@
1/*
2 * Marvell DB-88F6281-BP Development Board Setup
3 *
4 * Saeed Bishara <saeed@marvell.com>
5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12/dts-v1/;
13
14/include/ "kirkwood-db.dtsi"
15/include/ "kirkwood-6281.dtsi"
16
17/ {
18 model = "Marvell DB-88F6281-BP Development Board";
19 compatible = "marvell,db-88f6281-bp", "marvell,kirkwood-88f6281", "marvell,kirkwood";
20
21 ocp@f1000000 {
22 pcie-controller {
23 status = "okay";
24
25 pcie@1,0 {
26 status = "okay";
27 };
28 };
29 };
30};
diff --git a/arch/arm/boot/dts/kirkwood-db-88f6282.dts b/arch/arm/boot/dts/kirkwood-db-88f6282.dts
new file mode 100644
index 000000000000..f4c852886d23
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-db-88f6282.dts
@@ -0,0 +1,34 @@
1/*
2 * Marvell DB-88F6282-BP Development Board Setup
3 *
4 * Saeed Bishara <saeed@marvell.com>
5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12/dts-v1/;
13
14/include/ "kirkwood-db.dtsi"
15/include/ "kirkwood-6282.dtsi"
16
17/ {
18 model = "Marvell DB-88F6282-BP Development Board";
19 compatible = "marvell,db-88f6282-bp", "marvell,kirkwood-88f6282", "marvell,kirkwood";
20
21 ocp@f1000000 {
22 pcie-controller {
23 status = "okay";
24
25 pcie@1,0 {
26 status = "okay";
27 };
28
29 pcie@2,0 {
30 status = "okay";
31 };
32 };
33 };
34};
diff --git a/arch/arm/boot/dts/kirkwood-db.dtsi b/arch/arm/boot/dts/kirkwood-db.dtsi
new file mode 100644
index 000000000000..c87cfb816120
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-db.dtsi
@@ -0,0 +1,89 @@
1/*
2 * Marvell DB-{88F6281,88F6282}-BP Development Board Setup
3 *
4 * Saeed Bishara <saeed@marvell.com>
5 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 *
11 * This file contains the definitions that are common between the 6281
12 * and 6282 variants of the Marvell Kirkwood Development Board.
13 */
14
15/include/ "kirkwood.dtsi"
16
17/ {
18 memory {
19 device_type = "memory";
20 reg = <0x00000000 0x20000000>; /* 512 MB */
21 };
22
23 chosen {
24 bootargs = "console=ttyS0,115200n8 earlyprintk";
25 };
26
27 ocp@f1000000 {
28 pinctrl@10000 {
29 pmx_sdio_gpios: pmx-sdio-gpios {
30 marvell,pins = "mpp37", "mpp38";
31 marvell,function = "gpio";
32 };
33 };
34
35 serial@12000 {
36 pinctrl-0 = <&pmx_uart0>;
37 pinctrl-names = "default";
38 clock-frequency = <200000000>;
39 status = "ok";
40 };
41
42 nand@3000000 {
43 pinctrl-0 = <&pmx_nand>;
44 pinctrl-names = "default";
45 chip-delay = <25>;
46 status = "okay";
47
48 partition@0 {
49 label = "uboot";
50 reg = <0x0 0x100000>;
51 };
52
53 partition@100000 {
54 label = "uImage";
55 reg = <0x100000 0x400000>;
56 };
57
58 partition@500000 {
59 label = "root";
60 reg = <0x500000 0x1fb00000>;
61 };
62 };
63
64 sata@80000 {
65 nr-ports = <2>;
66 status = "okay";
67 };
68
69 ehci@50000 {
70 status = "okay";
71 };
72
73 mvsdio@90000 {
74 pinctrl-0 = <&pmx_sdio_gpios>;
75 pinctrl-names = "default";
76 wp-gpios = <&gpio1 5 0>;
77 cd-gpios = <&gpio1 6 0>;
78 status = "okay";
79 };
80
81 pcie-controller {
82 status = "okay";
83
84 pcie@1,0 {
85 status = "okay";
86 };
87 };
88 };
89};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 267ca95d4e78..b56bd3d7ece3 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -8,12 +8,6 @@ config MACH_D2NET_V2
8 Say 'Y' here if you want your kernel to support the 8 Say 'Y' here if you want your kernel to support the
9 LaCie d2 Network v2 NAS. 9 LaCie d2 Network v2 NAS.
10 10
11config MACH_DB88F6281_BP
12 bool "Marvell DB-88F6281-BP Development Board"
13 help
14 Say 'Y' here if you want your kernel to support the
15 Marvell DB-88F6281-BP Development Board.
16
17config MACH_DOCKSTAR 11config MACH_DOCKSTAR
18 bool "Seagate FreeAgent DockStar" 12 bool "Seagate FreeAgent DockStar"
19 help 13 help
@@ -153,6 +147,13 @@ config MACH_CLOUDBOX_DT
153 Say 'Y' here if you want your kernel to support the LaCie 147 Say 'Y' here if you want your kernel to support the LaCie
154 CloudBox NAS, using Flattened Device Tree. 148 CloudBox NAS, using Flattened Device Tree.
155 149
150config MACH_DB88F628X_BP_DT
151 bool "Marvell DB-88F628x-BP Development Board (Flattened Device Tree)"
152 help
153 Say 'Y' here if you want your kernel to support the Marvell
154 DB-88F6281-BP and DB-88F6282-BP Development Board (Flattened
155 Device Tree).
156
156config MACH_DLINK_KIRKWOOD_DT 157config MACH_DLINK_KIRKWOOD_DT
157 bool "D-Link Kirkwood-based NAS (Flattened Device Tree)" 158 bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
158 select ARCH_KIRKWOOD_DT 159 select ARCH_KIRKWOOD_DT
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index 794366e7f722..2fdc3a7ad226 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -1,7 +1,6 @@
1obj-y += common.o irq.o pcie.o mpp.o 1obj-y += common.o irq.o pcie.o mpp.o
2 2
3obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o 3obj-$(CONFIG_MACH_D2NET_V2) += d2net_v2-setup.o lacie_v2-common.o
4obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o
5obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o 4obj-$(CONFIG_MACH_DOCKSTAR) += dockstar-setup.o
6obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o 5obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o
7obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o 6obj-$(CONFIG_MACH_GURUPLUG) += guruplug-setup.o
@@ -21,6 +20,7 @@ obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
21 20
22obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 21obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
23obj-$(CONFIG_MACH_CLOUDBOX_DT) += board-ns2.o 22obj-$(CONFIG_MACH_CLOUDBOX_DT) += board-ns2.o
23obj-$(CONFIG_MACH_DB88F628X_BP_DT) += board-db88f628x-bp.o
24obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o 24obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o
25obj-$(CONFIG_MACH_DOCKSTAR_DT) += board-dockstar.o 25obj-$(CONFIG_MACH_DOCKSTAR_DT) += board-dockstar.o
26obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o 26obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o
diff --git a/arch/arm/mach-kirkwood/board-db88f628x-bp.c b/arch/arm/mach-kirkwood/board-db88f628x-bp.c
new file mode 100644
index 000000000000..2f574bc8ed40
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-db88f628x-bp.c
@@ -0,0 +1,24 @@
1/*
2 * Saeed Bishara <saeed@marvell.com>
3 *
4 * Marvell DB-88F628{1,2}-BP Development Board Setup
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/of.h>
14#include <linux/mv643xx_eth.h>
15#include "common.h"
16
17static struct mv643xx_eth_platform_data db88f628x_ge00_data = {
18 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
19};
20
21void __init db88f628x_init(void)
22{
23 kirkwood_ge00_init(&db88f628x_ge00_data);
24}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index e9647b80cb59..f5aed1f4b080 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -147,6 +147,10 @@ static void __init kirkwood_dt_init(void)
147 of_machine_is_compatible("lacie,netspace_v2")) 147 of_machine_is_compatible("lacie,netspace_v2"))
148 ns2_init(); 148 ns2_init();
149 149
150 if (of_machine_is_compatible("marvell,db-88f6281-bp") ||
151 of_machine_is_compatible("marvell,db-88f6282-bp"))
152 db88f628x_init();
153
150 if (of_machine_is_compatible("mpl,cec4")) 154 if (of_machine_is_compatible("mpl,cec4"))
151 mplcec4_init(); 155 mplcec4_init();
152 156
@@ -181,6 +185,8 @@ static const char * const kirkwood_dt_board_compat[] = {
181 "lacie,netspace_max_v2", 185 "lacie,netspace_max_v2",
182 "lacie,netspace_mini_v2", 186 "lacie,netspace_mini_v2",
183 "lacie,netspace_v2", 187 "lacie,netspace_v2",
188 "marvell,db-88f6281-bp",
189 "marvell,db-88f6282-bp",
184 "mpl,cec4", 190 "mpl,cec4",
185 "netgear,readynas-duo-v2", 191 "netgear,readynas-duo-v2",
186 "plathome,openblocks-a6", 192 "plathome,openblocks-a6",
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 21da3b1ebd7b..cbbc0b80d4a1 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -119,6 +119,12 @@ void km_kirkwood_init(void);
119static inline void km_kirkwood_init(void) {}; 119static inline void km_kirkwood_init(void) {};
120#endif 120#endif
121 121
122#ifdef CONFIG_MACH_DB88F628X_BP_DT
123void db88f628x_init(void);
124#else
125static inline void db88f628x_init(void) {};
126#endif
127
122#ifdef CONFIG_MACH_MPLCEC4_DT 128#ifdef CONFIG_MACH_MPLCEC4_DT
123void mplcec4_init(void); 129void mplcec4_init(void);
124#else 130#else
diff --git a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c b/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
deleted file mode 100644
index 5a369fe74754..000000000000
--- a/arch/arm/mach-kirkwood/db88f6281-bp-setup.c
+++ /dev/null
@@ -1,108 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/db88f6281-bp-setup.c
3 *
4 * Marvell DB-88F6281-BP Development Board Setup
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/sizes.h>
14#include <linux/platform_device.h>
15#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <mach/kirkwood.h>
21#include <linux/platform_data/mmc-mvsdio.h>
22#include "common.h"
23#include "mpp.h"
24
25static struct mtd_partition db88f6281_nand_parts[] = {
26 {
27 .name = "u-boot",
28 .offset = 0,
29 .size = SZ_1M
30 }, {
31 .name = "uImage",
32 .offset = MTDPART_OFS_NXTBLK,
33 .size = SZ_4M
34 }, {
35 .name = "root",
36 .offset = MTDPART_OFS_NXTBLK,
37 .size = MTDPART_SIZ_FULL
38 },
39};
40
41static struct mv643xx_eth_platform_data db88f6281_ge00_data = {
42 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
43};
44
45static struct mv_sata_platform_data db88f6281_sata_data = {
46 .n_ports = 2,
47};
48
49static struct mvsdio_platform_data db88f6281_mvsdio_data = {
50 .gpio_write_protect = 37,
51 .gpio_card_detect = 38,
52};
53
54static unsigned int db88f6281_mpp_config[] __initdata = {
55 MPP0_NF_IO2,
56 MPP1_NF_IO3,
57 MPP2_NF_IO4,
58 MPP3_NF_IO5,
59 MPP4_NF_IO6,
60 MPP5_NF_IO7,
61 MPP18_NF_IO0,
62 MPP19_NF_IO1,
63 MPP37_GPIO,
64 MPP38_GPIO,
65 0
66};
67
68static void __init db88f6281_init(void)
69{
70 /*
71 * Basic setup. Needs to be called early.
72 */
73 kirkwood_init();
74 kirkwood_mpp_conf(db88f6281_mpp_config);
75
76 kirkwood_nand_init(ARRAY_AND_SIZE(db88f6281_nand_parts), 25);
77 kirkwood_ehci_init();
78 kirkwood_ge00_init(&db88f6281_ge00_data);
79 kirkwood_sata_init(&db88f6281_sata_data);
80 kirkwood_uart0_init();
81 kirkwood_sdio_init(&db88f6281_mvsdio_data);
82}
83
84static int __init db88f6281_pci_init(void)
85{
86 if (machine_is_db88f6281_bp()) {
87 u32 dev, rev;
88
89 kirkwood_pcie_id(&dev, &rev);
90 if (dev == MV88F6282_DEV_ID)
91 kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0);
92 else
93 kirkwood_pcie_init(KW_PCIE0);
94 }
95 return 0;
96}
97subsys_initcall(db88f6281_pci_init);
98
99MACHINE_START(DB88F6281_BP, "Marvell DB-88F6281-BP Development Board")
100 /* Maintainer: Saeed Bishara <saeed@marvell.com> */
101 .atag_offset = 0x100,
102 .init_machine = db88f6281_init,
103 .map_io = kirkwood_map_io,
104 .init_early = kirkwood_init_early,
105 .init_irq = kirkwood_init_irq,
106 .init_time = kirkwood_timer_init,
107 .restart = kirkwood_restart,
108MACHINE_END