diff options
author | Sebastien Requiem <sebastien@kolios.dk> | 2010-02-23 08:51:24 -0500 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2010-02-23 17:10:08 -0500 |
commit | c499546f43f2c31b681271ef7db922839fcde5fe (patch) | |
tree | d0b2c61938057dfa82153b29aba5f847d089ffa6 /arch/arm/mach-mv78xx0 | |
parent | ee40ceab234d34abdfeb9922d0f1a18bfa7efdaf (diff) |
[ARM] MV78xx0: Support for Buffalo WXL (Terastation Duo)
* Modification of Kconfig to add the Option
* 1 new file : buffalo-wxl-setup.c
This file is inspired from the db-78xx0-setup.c already present.
The following is done:
- Configure MPP Lines for the plateform (see my patch for MPP)
This is taken from the stock kernel provided by buffalotech (the vendor)
- GigaBit Ethernet
- Sata
- Uart are initiallized in a different way than on the dev board as we
have one core only.
- USB
The kernel has been running for some days now on my plateform.
Signed-off-by: Sebastien Requiem <sebastien@kolios.dk>
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mach-mv78xx0')
-rw-r--r-- | arch/arm/mach-mv78xx0/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | 155 |
3 files changed, 162 insertions, 0 deletions
diff --git a/arch/arm/mach-mv78xx0/Kconfig b/arch/arm/mach-mv78xx0/Kconfig index 6fbe68fe4412..f2d309d0619e 100644 --- a/arch/arm/mach-mv78xx0/Kconfig +++ b/arch/arm/mach-mv78xx0/Kconfig | |||
@@ -14,6 +14,12 @@ config MACH_RD78X00_MASA | |||
14 | Say 'Y' here if you want your kernel to support the | 14 | Say 'Y' here if you want your kernel to support the |
15 | Marvell RD-78x00-mASA Reference Design. | 15 | Marvell RD-78x00-mASA Reference Design. |
16 | 16 | ||
17 | config MACH_TERASTATION_WXL | ||
18 | bool "Buffalo WLX (Terastation Duo) NAS" | ||
19 | help | ||
20 | Say 'Y' here if you want your kernel to support the | ||
21 | Buffalo WXL Nas. | ||
22 | |||
17 | endmenu | 23 | endmenu |
18 | 24 | ||
19 | endif | 25 | endif |
diff --git a/arch/arm/mach-mv78xx0/Makefile b/arch/arm/mach-mv78xx0/Makefile index 4948eeeda5aa..67a13f9bfe64 100644 --- a/arch/arm/mach-mv78xx0/Makefile +++ b/arch/arm/mach-mv78xx0/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | obj-y += common.o addr-map.o mpp.o irq.o pcie.o | 1 | obj-y += common.o addr-map.o mpp.o irq.o pcie.o |
2 | obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o | 2 | obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o |
3 | obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o | 3 | obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o |
4 | obj-$(CONFIG_MACH_TERASTATION_WXL) += buffalo-wxl-setup.o | ||
diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c new file mode 100644 index 000000000000..61e5e583603b --- /dev/null +++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mv78xx0/buffalo-wxl-setup.c | ||
3 | * | ||
4 | * Buffalo WXL (Terastation Duo) Setup routines | ||
5 | * | ||
6 | * sebastien requiem <sebastien@requiem.fr> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/ata_platform.h> | ||
17 | #include <linux/mv643xx_eth.h> | ||
18 | #include <linux/ethtool.h> | ||
19 | #include <linux/i2c.h> | ||
20 | #include <mach/mv78xx0.h> | ||
21 | #include <asm/mach-types.h> | ||
22 | #include <asm/mach/arch.h> | ||
23 | #include "common.h" | ||
24 | #include "mpp.h" | ||
25 | |||
26 | |||
27 | /* This arch has 2 Giga Ethernet */ | ||
28 | |||
29 | static struct mv643xx_eth_platform_data db78x00_ge00_data = { | ||
30 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
31 | }; | ||
32 | |||
33 | static struct mv643xx_eth_platform_data db78x00_ge01_data = { | ||
34 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
35 | }; | ||
36 | |||
37 | |||
38 | /* 2 SATA controller supporting HotPlug */ | ||
39 | |||
40 | static struct mv_sata_platform_data db78x00_sata_data = { | ||
41 | .n_ports = 2, | ||
42 | }; | ||
43 | |||
44 | static struct i2c_board_info __initdata db78x00_i2c_rtc = { | ||
45 | I2C_BOARD_INFO("ds1338", 0x68), | ||
46 | }; | ||
47 | |||
48 | |||
49 | static unsigned int wxl_mpp_config[] __initdata = { | ||
50 | MPP0_GE1_TXCLK, | ||
51 | MPP1_GE1_TXCTL, | ||
52 | MPP2_GE1_RXCTL, | ||
53 | MPP3_GE1_RXCLK, | ||
54 | MPP4_GE1_TXD0, | ||
55 | MPP5_GE1_TXD1, | ||
56 | MPP6_GE1_TXD2, | ||
57 | MPP7_GE1_TXD3, | ||
58 | MPP8_GE1_RXD0, | ||
59 | MPP9_GE1_RXD1, | ||
60 | MPP10_GE1_RXD2, | ||
61 | MPP11_GE1_RXD3, | ||
62 | MPP12_GPIO, | ||
63 | MPP13_SYSRST_OUTn, | ||
64 | MPP14_SATA1_ACTn, | ||
65 | MPP15_SATA0_ACTn, | ||
66 | MPP16_GPIO, | ||
67 | MPP17_GPIO, | ||
68 | MPP18_GPIO, | ||
69 | MPP19_GPIO, | ||
70 | MPP20_GPIO, | ||
71 | MPP21_GPIO, | ||
72 | MPP22_GPIO, | ||
73 | MPP23_GPIO, | ||
74 | MPP24_UA2_TXD, | ||
75 | MPP25_UA2_RXD, | ||
76 | MPP26_UA2_CTSn, | ||
77 | MPP27_UA2_RTSn, | ||
78 | MPP28_GPIO, | ||
79 | MPP29_SYSRST_OUTn, | ||
80 | MPP30_GPIO, | ||
81 | MPP31_GPIO, | ||
82 | MPP32_GPIO, | ||
83 | MPP33_GPIO, | ||
84 | MPP34_GPIO, | ||
85 | MPP35_GPIO, | ||
86 | MPP36_GPIO, | ||
87 | MPP37_GPIO, | ||
88 | MPP38_GPIO, | ||
89 | MPP39_GPIO, | ||
90 | MPP40_UNUSED, | ||
91 | MPP41_UNUSED, | ||
92 | MPP42_UNUSED, | ||
93 | MPP43_UNUSED, | ||
94 | MPP44_UNUSED, | ||
95 | MPP45_UNUSED, | ||
96 | MPP46_UNUSED, | ||
97 | MPP47_UNUSED, | ||
98 | MPP48_SATA1_ACTn, | ||
99 | MPP49_SATA0_ACTn, | ||
100 | 0 | ||
101 | }; | ||
102 | |||
103 | |||
104 | static void __init wxl_init(void) | ||
105 | { | ||
106 | /* | ||
107 | * Basic MV78xx0 setup. Needs to be called early. | ||
108 | */ | ||
109 | mv78xx0_init(); | ||
110 | mv78xx0_mpp_conf(wxl_mpp_config); | ||
111 | |||
112 | /* | ||
113 | * Partition on-chip peripherals between the two CPU cores. | ||
114 | */ | ||
115 | mv78xx0_ehci0_init(); | ||
116 | mv78xx0_ehci1_init(); | ||
117 | mv78xx0_ehci2_init(); | ||
118 | mv78xx0_ge00_init(&db78x00_ge00_data); | ||
119 | mv78xx0_ge01_init(&db78x00_ge01_data); | ||
120 | mv78xx0_sata_init(&db78x00_sata_data); | ||
121 | mv78xx0_uart0_init(); | ||
122 | mv78xx0_uart1_init(); | ||
123 | mv78xx0_uart2_init(); | ||
124 | mv78xx0_uart3_init(); | ||
125 | mv78xx0_i2c_init(); | ||
126 | i2c_register_board_info(0, &db78x00_i2c_rtc, 1); | ||
127 | } | ||
128 | |||
129 | static int __init wxl_pci_init(void) | ||
130 | { | ||
131 | if (machine_is_terastation_wxl()) { | ||
132 | /* | ||
133 | * Assign the x16 PCIe slot on the board to CPU core | ||
134 | * #0, and let CPU core #1 have the four x1 slots. | ||
135 | */ | ||
136 | if (mv78xx0_core_index() == 0) | ||
137 | mv78xx0_pcie_init(0, 1); | ||
138 | else | ||
139 | mv78xx0_pcie_init(1, 0); | ||
140 | } | ||
141 | |||
142 | return 0; | ||
143 | } | ||
144 | subsys_initcall(wxl_pci_init); | ||
145 | |||
146 | MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL") | ||
147 | /* Maintainer: Sebastien Requiem <sebastien@requiem.fr> */ | ||
148 | .phys_io = MV78XX0_REGS_PHYS_BASE, | ||
149 | .io_pg_offst = ((MV78XX0_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
150 | .boot_params = 0x00000100, | ||
151 | .init_machine = wxl_init, | ||
152 | .map_io = mv78xx0_map_io, | ||
153 | .init_irq = mv78xx0_init_irq, | ||
154 | .timer = &mv78xx0_timer, | ||
155 | MACHINE_END | ||