3 * QNAP TS-11x/TS-21x 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_ts219_i2c_rtc
= {
30 I2C_BOARD_INFO("s35390a", 0x30),
33 static struct mv643xx_eth_platform_data qnap_ts219_ge00_data
= {
34 .phy_addr
= MV643XX_ETH_PHY_ADDR(8),
37 static struct mv_sata_platform_data qnap_ts219_sata_data
= {
41 static struct gpio_keys_button qnap_ts219_buttons
[] = {
56 static struct gpio_keys_platform_data qnap_ts219_button_data
= {
57 .buttons
= qnap_ts219_buttons
,
58 .nbuttons
= ARRAY_SIZE(qnap_ts219_buttons
),
61 static struct platform_device qnap_ts219_button_device
= {
66 .platform_data
= &qnap_ts219_button_data
,
70 static unsigned int qnap_ts219_mpp_config
[] __initdata
= {
81 MPP13_UART1_TXD
, /* PIC controller */
82 MPP14_UART1_RXD
, /* PIC controller */
83 MPP15_GPIO
, /* USB Copy button */
84 MPP16_GPIO
, /* Reset button */
85 MPP36_GPIO
, /* RAM: 0: 256 MB, 1: 512 MB */
89 static void __init
qnap_ts219_init(void)
92 * Basic setup. Needs to be called early.
95 kirkwood_mpp_conf(qnap_ts219_mpp_config
);
97 kirkwood_uart0_init();
98 kirkwood_uart1_init(); /* A PIC controller is connected here. */
99 qnap_tsx1x_register_flash();
101 i2c_register_board_info(0, &qnap_ts219_i2c_rtc
, 1);
102 kirkwood_ge00_init(&qnap_ts219_ge00_data
);
103 kirkwood_sata_init(&qnap_ts219_sata_data
);
104 kirkwood_ehci_init();
105 platform_device_register(&qnap_ts219_button_device
);
107 pm_power_off
= qnap_tsx1x_power_off
;
111 static int __init
ts219_pci_init(void)
113 if (machine_is_ts219())
114 kirkwood_pcie_init();
118 subsys_initcall(ts219_pci_init
);
120 MACHINE_START(TS219
, "QNAP TS-119/TS-219")
121 /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
122 .phys_io
= KIRKWOOD_REGS_PHYS_BASE
,
123 .io_pg_offst
= ((KIRKWOOD_REGS_VIRT_BASE
) >> 18) & 0xfffc,
124 .boot_params
= 0x00000100,
125 .init_machine
= qnap_ts219_init
,
126 .map_io
= kirkwood_map_io
,
127 .init_irq
= kirkwood_init_irq
,
128 .timer
= &kirkwood_timer
,