aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/ts209-setup.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-04-21 23:37:12 -0400
committerLennert Buytenhek <buytenh@marvell.com>2008-06-22 16:44:45 -0400
commit044f6c7c449ae8ba0353b032706b098a7ad5e304 (patch)
tree527bebfce6634c7d24a9521272142c67be182679 /arch/arm/mach-orion5x/ts209-setup.c
parent6eef84a5496c678ab27b72bec0fc785c9cee063b (diff)
[ARM] Orion: move EHCI/I2C/UART peripheral init into board code
This patch moves initialisation of EHCI/I2C/UART platform devices from the common orion5x_init() into the board support code. The rationale behind this is that only the board support code knows whether certain peripherals have been brought out on the board, and not initialising peripherals that haven't been brought out is desirable for example: - to reduce user confusion (e.g. seeing both 'eth0' and 'eth1' appear while there is only one ethernet port on the board); and - to allow for future power savings (peripherals that have not been brought out can be clock gated off entirely). Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Acked-by: Russell King <linux@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-orion5x/ts209-setup.c')
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 5374b6edb9a1..b62fdb6cf6cb 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -332,16 +332,9 @@ static struct mv_sata_platform_data qnap_ts209_sata_data = {
332 332
333 * General Setup 333 * General Setup
334 ****************************************************************************/ 334 ****************************************************************************/
335
336static struct platform_device *qnap_ts209_devices[] __initdata = {
337 &qnap_ts209_nor_flash,
338 &qnap_ts209_button_device,
339};
340
341/* 335/*
342 * QNAP TS-[12]09 specific power off method via UART1-attached PIC 336 * QNAP TS-[12]09 specific power off method via UART1-attached PIC
343 */ 337 */
344
345#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2)) 338#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
346 339
347static void qnap_ts209_power_off(void) 340static void qnap_ts209_power_off(void)
@@ -372,12 +365,6 @@ static void __init qnap_ts209_init(void)
372 orion5x_init(); 365 orion5x_init();
373 366
374 /* 367 /*
375 * Setup flash mapping
376 */
377 orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
378 QNAP_TS209_NOR_BOOT_SIZE);
379
380 /*
381 * Open a special address decode windows for the PCIe WA. 368 * Open a special address decode windows for the PCIe WA.
382 */ 369 */
383 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE, 370 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
@@ -411,11 +398,22 @@ static void __init qnap_ts209_init(void)
411 orion5x_write(MPP_16_19_CTRL, 0x5500); 398 orion5x_write(MPP_16_19_CTRL, 0x5500);
412 orion5x_gpio_set_valid_pins(0x3cc0fff); 399 orion5x_gpio_set_valid_pins(0x3cc0fff);
413 400
414 /* register ts209 specific power-off method */ 401 /*
415 pm_power_off = qnap_ts209_power_off; 402 * Configure peripherals.
403 */
404 orion5x_ehci0_init();
405 orion5x_ehci1_init();
406 ts209_find_mac_addr();
407 orion5x_eth_init(&qnap_ts209_eth_data);
408 orion5x_i2c_init();
409 orion5x_sata_init(&qnap_ts209_sata_data);
410 orion5x_uart0_init();
411
412 orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
413 QNAP_TS209_NOR_BOOT_SIZE);
414 platform_device_register(&qnap_ts209_nor_flash);
416 415
417 platform_add_devices(qnap_ts209_devices, 416 platform_device_register(&qnap_ts209_button_device);
418 ARRAY_SIZE(qnap_ts209_devices));
419 417
420 /* Get RTC IRQ and register the chip */ 418 /* Get RTC IRQ and register the chip */
421 if (gpio_request(TS209_RTC_GPIO, "rtc") == 0) { 419 if (gpio_request(TS209_RTC_GPIO, "rtc") == 0) {
@@ -428,10 +426,8 @@ static void __init qnap_ts209_init(void)
428 pr_warning("qnap_ts209_init: failed to get RTC IRQ\n"); 426 pr_warning("qnap_ts209_init: failed to get RTC IRQ\n");
429 i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1); 427 i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
430 428
431 ts209_find_mac_addr(); 429 /* register ts209 specific power-off method */
432 orion5x_eth_init(&qnap_ts209_eth_data); 430 pm_power_off = qnap_ts209_power_off;
433
434 orion5x_sata_init(&qnap_ts209_sata_data);
435} 431}
436 432
437MACHINE_START(TS209, "QNAP TS-109/TS-209") 433MACHINE_START(TS209, "QNAP TS-109/TS-209")