diff options
Diffstat (limited to 'arch/arm/mach-kirkwood/ts41x-setup.c')
-rw-r--r-- | arch/arm/mach-kirkwood/ts41x-setup.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c index 2e14afef07a2..d5d009970705 100644 --- a/arch/arm/mach-kirkwood/ts41x-setup.c +++ b/arch/arm/mach-kirkwood/ts41x-setup.c | |||
@@ -27,6 +27,10 @@ | |||
27 | #include "mpp.h" | 27 | #include "mpp.h" |
28 | #include "tsx1x-common.h" | 28 | #include "tsx1x-common.h" |
29 | 29 | ||
30 | /* for the PCIe reset workaround */ | ||
31 | #include <plat/pcie.h> | ||
32 | |||
33 | |||
30 | #define QNAP_TS41X_JUMPER_JP1 45 | 34 | #define QNAP_TS41X_JUMPER_JP1 45 |
31 | 35 | ||
32 | static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = { | 36 | static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = { |
@@ -115,6 +119,8 @@ static unsigned int qnap_ts41x_mpp_config[] __initdata = { | |||
115 | 119 | ||
116 | static void __init qnap_ts41x_init(void) | 120 | static void __init qnap_ts41x_init(void) |
117 | { | 121 | { |
122 | u32 dev, rev; | ||
123 | |||
118 | /* | 124 | /* |
119 | * Basic setup. Needs to be called early. | 125 | * Basic setup. Needs to be called early. |
120 | */ | 126 | */ |
@@ -126,8 +132,15 @@ static void __init qnap_ts41x_init(void) | |||
126 | qnap_tsx1x_register_flash(); | 132 | qnap_tsx1x_register_flash(); |
127 | kirkwood_i2c_init(); | 133 | kirkwood_i2c_init(); |
128 | i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1); | 134 | i2c_register_board_info(0, &qnap_ts41x_i2c_rtc, 1); |
135 | |||
136 | kirkwood_pcie_id(&dev, &rev); | ||
137 | if (dev == MV88F6282_DEV_ID) { | ||
138 | qnap_ts41x_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); | ||
139 | qnap_ts41x_ge01_data.phy_addr = MV643XX_ETH_PHY_ADDR(1); | ||
140 | } | ||
129 | kirkwood_ge00_init(&qnap_ts41x_ge00_data); | 141 | kirkwood_ge00_init(&qnap_ts41x_ge00_data); |
130 | kirkwood_ge01_init(&qnap_ts41x_ge01_data); | 142 | kirkwood_ge01_init(&qnap_ts41x_ge01_data); |
143 | |||
131 | kirkwood_sata_init(&qnap_ts41x_sata_data); | 144 | kirkwood_sata_init(&qnap_ts41x_sata_data); |
132 | kirkwood_ehci_init(); | 145 | kirkwood_ehci_init(); |
133 | platform_device_register(&qnap_ts41x_button_device); | 146 | platform_device_register(&qnap_ts41x_button_device); |
@@ -140,8 +153,22 @@ static void __init qnap_ts41x_init(void) | |||
140 | 153 | ||
141 | static int __init ts41x_pci_init(void) | 154 | static int __init ts41x_pci_init(void) |
142 | { | 155 | { |
143 | if (machine_is_ts41x()) | 156 | if (machine_is_ts41x()) { |
144 | kirkwood_pcie_init(KW_PCIE0); | 157 | u32 dev, rev; |
158 | |||
159 | /* | ||
160 | * Without this explicit reset, the PCIe SATA controller | ||
161 | * (Marvell 88sx7042/sata_mv) is known to stop working | ||
162 | * after a few minutes. | ||
163 | */ | ||
164 | orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE); | ||
165 | |||
166 | kirkwood_pcie_id(&dev, &rev); | ||
167 | if (dev == MV88F6282_DEV_ID) | ||
168 | kirkwood_pcie_init(KW_PCIE1 | KW_PCIE0); | ||
169 | else | ||
170 | kirkwood_pcie_init(KW_PCIE0); | ||
171 | } | ||
145 | 172 | ||
146 | return 0; | 173 | return 0; |
147 | } | 174 | } |
@@ -149,11 +176,10 @@ subsys_initcall(ts41x_pci_init); | |||
149 | 176 | ||
150 | MACHINE_START(TS41X, "QNAP TS-41x") | 177 | MACHINE_START(TS41X, "QNAP TS-41x") |
151 | /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */ | 178 | /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */ |
152 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
153 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
154 | .boot_params = 0x00000100, | 179 | .boot_params = 0x00000100, |
155 | .init_machine = qnap_ts41x_init, | 180 | .init_machine = qnap_ts41x_init, |
156 | .map_io = kirkwood_map_io, | 181 | .map_io = kirkwood_map_io, |
182 | .init_early = kirkwood_init_early, | ||
157 | .init_irq = kirkwood_init_irq, | 183 | .init_irq = kirkwood_init_irq, |
158 | .timer = &kirkwood_timer, | 184 | .timer = &kirkwood_timer, |
159 | MACHINE_END | 185 | MACHINE_END |