3 * QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS Board Setup
5 * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com>
6 * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/platform_device.h>
17 #include <linux/i2c.h>
18 #include <linux/mv643xx_eth.h>
19 #include <linux/ata_platform.h>
20 #include <linux/gpio_keys.h>
21 #include <linux/input.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <mach/kirkwood.h>
27 #include "tsx1x-common.h"
29 static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc
= {
30 I2C_BOARD_INFO("s35390a", 0x30),
33 static struct mv643xx_eth_platform_data qnap_ts41x_ge00_data
= {
34 .phy_addr
= MV643XX_ETH_PHY_ADDR(8),
37 static struct mv643xx_eth_platform_data qnap_ts41x_ge01_data
= {
38 .phy_addr
= MV643XX_ETH_PHY_ADDR(0),
41 static struct mv_sata_platform_data qnap_ts41x_sata_data
= {
45 static struct gpio_keys_button qnap_ts41x_buttons
[] = {
60 static struct gpio_keys_platform_data qnap_ts41x_button_data
= {
61 .buttons
= qnap_ts41x_buttons
,
62 .nbuttons
= ARRAY_SIZE(qnap_ts41x_buttons
),
65 static struct platform_device qnap_ts41x_button_device
= {
70 .platform_data
= &qnap_ts41x_button_data
,
74 static unsigned int qnap_ts41x_mpp_config
[] __initdata
= {
85 MPP13_UART1_TXD
, /* PIC controller */
86 MPP14_UART1_RXD
, /* PIC controller */
101 MPP36_GPIO
, /* RAM: 0: 256 MB, 1: 512 MB */
102 MPP37_GPIO
, /* Reset button */
103 MPP43_GPIO
, /* USB Copy button */
104 MPP44_GPIO
, /* Board ID: 0: TS-419U, 1: TS-419 */
105 MPP45_GPIO
, /* JP1: 0: console, 1: LCD */
106 MPP46_GPIO
, /* External SATA HDD1 error indicator */
107 MPP47_GPIO
, /* External SATA HDD2 error indicator */
108 MPP48_GPIO
, /* External SATA HDD3 error indicator */
109 MPP49_GPIO
, /* External SATA HDD4 error indicator */
113 static void __init
qnap_ts41x_init(void)
116 * Basic setup. Needs to be called early.
119 kirkwood_mpp_conf(qnap_ts41x_mpp_config
);
121 kirkwood_uart0_init();
122 kirkwood_uart1_init(); /* A PIC controller is connected here. */
123 qnap_tsx1x_register_flash();
125 i2c_register_board_info(0, &qnap_ts41x_i2c_rtc
, 1);
126 kirkwood_ge00_init(&qnap_ts41x_ge00_data
);
127 kirkwood_ge01_init(&qnap_ts41x_ge01_data
);
128 kirkwood_sata_init(&qnap_ts41x_sata_data
);
129 kirkwood_ehci_init();
130 platform_device_register(&qnap_ts41x_button_device
);
132 pm_power_off
= qnap_tsx1x_power_off
;
136 static int __init
ts41x_pci_init(void)
138 if (machine_is_ts41x())
139 kirkwood_pcie_init();
143 subsys_initcall(ts41x_pci_init
);
145 MACHINE_START(TS41X
, "QNAP TS-41x")
146 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
147 .phys_io
= KIRKWOOD_REGS_PHYS_BASE
,
148 .io_pg_offst
= ((KIRKWOOD_REGS_VIRT_BASE
) >> 18) & 0xfffc,
149 .boot_params
= 0x00000100,
150 .init_machine
= qnap_ts41x_init
,
151 .map_io
= kirkwood_map_io
,
152 .init_irq
= kirkwood_init_irq
,
153 .timer
= &kirkwood_timer
,