aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentin Longchamp <valentin.longchamp@keymile.com>2012-09-04 05:55:02 -0400
committerJason Cooper <jason@lakedaemon.net>2012-09-21 13:07:17 -0400
commit0510c8a014432b45f09509d1fb450922ec96b40d (patch)
tree82d01eea4ec0a5dfded7f000ad19055d135efaff
parent903234673f1421f5ad9a74bafca427b812f59c93 (diff)
ARM: initial DTS support for km_kirkwood
This is a first attempt to support the km_kirkwood reference design with a device tree. This km_kirkwood design is present in many Keymile products. It is based on the Marvell Bobcat SOC which integrates a Kirkwood CPU next to a big L2 Ethernet Switch. The Kirkwood in the SOC is very similar to the "normal" one, but there are a few differences. This initial support is minimal: the kernel can boot with network (ge0), serial port and NAND functional. Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> Cc: Holger Brunck <holger.brunck@keymile.com> Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
-rw-r--r--arch/arm/boot/dts/kirkwood-km_kirkwood.dts29
-rw-r--r--arch/arm/mach-kirkwood/Kconfig7
-rw-r--r--arch/arm/mach-kirkwood/Makefile1
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot1
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c4
-rw-r--r--arch/arm/mach-kirkwood/board-km_kirkwood.c57
-rw-r--r--arch/arm/mach-kirkwood/common.h6
7 files changed, 105 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
new file mode 100644
index 000000000000..75bdb93fed26
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
@@ -0,0 +1,29 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Keymile Kirkwood Reference Design";
7 compatible = "keymile,km_kirkwood", "marvell,kirkwood-98DX4122", "marvell,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x08000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "ok";
22 };
23
24 nand@3000000 {
25 status = "ok";
26 chip-delay = <25>;
27 };
28 };
29};
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index d033b7acead7..50bca5032b7e 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -123,6 +123,13 @@ config MACH_IOMEGA_IX2_200_DT
123 Say 'Y' here if you want your kernel to support the 123 Say 'Y' here if you want your kernel to support the
124 Iomega StorCenter ix2-200 (Flattened Device Tree). 124 Iomega StorCenter ix2-200 (Flattened Device Tree).
125 125
126config MACH_KM_KIRKWOOD_DT
127 bool "Keymile Kirkwood Reference Design (Flattened Device Tree)"
128 select ARCH_KIRKWOOD_DT
129 help
130 Say 'Y' here if you want your kernel to support the
131 Keymile Kirkwood Reference Desgin, using Flattened Device Tree.
132
126config MACH_TS219 133config MACH_TS219
127 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 134 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
128 help 135 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d809cd542a00..294779f892d9 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -30,3 +30,4 @@ obj-$(CONFIG_MACH_DOCKSTAR_DT) += board-dockstar.o
30obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o 30obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o
31obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o 31obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o
32obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o 32obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o
33obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 892ce4c8d36c..5edef8ef34bf 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -14,3 +14,4 @@ dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lschlv2.dtb
14dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb 14dtb-$(CONFIG_MACH_LSXL_DT) += kirkwood-lsxhl.dtb
15dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb 15dtb-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += kirkwood-iomega_ix2_200.dtb
16dtb-$(CONFIG_MACH_DOCKSTAR_DT) += kirkwood-dockstar.dtb 16dtb-$(CONFIG_MACH_DOCKSTAR_DT) += kirkwood-dockstar.dtb
17dtb-$(CONFIG_MACH_KM_KIRKWOOD_DT) += kirkwood-km_kirkwood.dtb
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 30a4caa2b76c..496554664e08 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -93,6 +93,9 @@ static void __init kirkwood_dt_init(void)
93 if (of_machine_is_compatible("iom,ix2-200")) 93 if (of_machine_is_compatible("iom,ix2-200"))
94 iomega_ix2_200_init(); 94 iomega_ix2_200_init();
95 95
96 if (of_machine_is_compatible("keymile,km_kirkwood"))
97 km_kirkwood_init();
98
96 of_platform_populate(NULL, kirkwood_dt_match_table, 99 of_platform_populate(NULL, kirkwood_dt_match_table,
97 kirkwood_auxdata_lookup, NULL); 100 kirkwood_auxdata_lookup, NULL);
98} 101}
@@ -108,6 +111,7 @@ static const char *kirkwood_dt_board_compat[] = {
108 "seagate,goflexnet", 111 "seagate,goflexnet",
109 "buffalo,lsxl", 112 "buffalo,lsxl",
110 "iom,ix2-200", 113 "iom,ix2-200",
114 "keymile,km_kirkwood",
111 NULL 115 NULL
112}; 116};
113 117
diff --git a/arch/arm/mach-kirkwood/board-km_kirkwood.c b/arch/arm/mach-kirkwood/board-km_kirkwood.c
new file mode 100644
index 000000000000..f7d32834b757
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-km_kirkwood.c
@@ -0,0 +1,57 @@
1/*
2 * Copyright 2012 2012 KEYMILE AG, CH-3097 Bern
3 * Valentin Longchamp <valentin.longchamp@keymile.com>
4 *
5 * arch/arm/mach-kirkwood/board-km_kirkwood.c
6 *
7 * Keymile km_kirkwood Reference Desing Init for drivers not converted to
8 * flattened device tree yet.
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/mv643xx_eth.h>
18#include <linux/clk.h>
19#include <linux/clk-private.h>
20#include "common.h"
21#include "mpp.h"
22
23static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = {
24 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
25};
26
27static unsigned int km_kirkwood_mpp_config[] __initdata = {
28 MPP8_GPIO, /* I2C SDA */
29 MPP9_GPIO, /* I2C SCL */
30 0
31};
32
33void __init km_kirkwood_init(void)
34{
35 struct clk *sata_clk;
36 /*
37 * Basic setup. Needs to be called early.
38 */
39 kirkwood_mpp_conf(km_kirkwood_mpp_config);
40
41 /*
42 * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing
43 * SATA bits (14-15) of the Clock Gating Control Register. Since these
44 * devices are also not present in this variant, their clocks get
45 * disabled because unused when clk_disable_unused() gets called.
46 * That's why we change the flags to these clocks to CLK_IGNORE_UNUSED
47 */
48 sata_clk = clk_get_sys("sata_mv.0", "0");
49 if (!IS_ERR(sata_clk))
50 sata_clk->flags |= CLK_IGNORE_UNUSED;
51 sata_clk = clk_get_sys("sata_mv.0", "1");
52 if (!IS_ERR(sata_clk))
53 sata_clk->flags |= CLK_IGNORE_UNUSED;
54
55 kirkwood_ehci_init();
56 kirkwood_ge00_init(&km_kirkwood_ge00_data);
57}
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index 8f2520fa0562..bcffd7ca1ca2 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -106,6 +106,12 @@ void iomega_ix2_200_init(void);
106static inline void iomega_ix2_200_init(void) {}; 106static inline void iomega_ix2_200_init(void) {};
107#endif 107#endif
108 108
109#ifdef CONFIG_MACH_KM_KIRKWOOD_DT
110void km_kirkwood_init(void);
111#else
112static inline void km_kirkwood_init(void) {};
113#endif
114
109/* early init functions not converted to fdt yet */ 115/* early init functions not converted to fdt yet */
110char *kirkwood_id(void); 116char *kirkwood_id(void);
111void kirkwood_l2_init(void); 117void kirkwood_l2_init(void);