aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-orion5x/ts209-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-orion5x/ts209-setup.c')
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c103
1 files changed, 53 insertions, 50 deletions
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 9afb41ee6e07..5374b6edb9a1 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -47,52 +47,54 @@
47 ***************************************************************************/ 47 ***************************************************************************/
48static struct mtd_partition qnap_ts209_partitions[] = { 48static struct mtd_partition qnap_ts209_partitions[] = {
49 { 49 {
50 .name = "U-Boot", 50 .name = "U-Boot",
51 .size = 0x00080000, 51 .size = 0x00080000,
52 .offset = 0x00780000, 52 .offset = 0x00780000,
53 .mask_flags = MTD_WRITEABLE, 53 .mask_flags = MTD_WRITEABLE,
54 }, { 54 }, {
55 .name = "Kernel", 55 .name = "Kernel",
56 .size = 0x00200000, 56 .size = 0x00200000,
57 .offset = 0, 57 .offset = 0,
58 }, { 58 }, {
59 .name = "RootFS1", 59 .name = "RootFS1",
60 .size = 0x00400000, 60 .size = 0x00400000,
61 .offset = 0x00200000, 61 .offset = 0x00200000,
62 }, { 62 }, {
63 .name = "RootFS2", 63 .name = "RootFS2",
64 .size = 0x00100000, 64 .size = 0x00100000,
65 .offset = 0x00600000, 65 .offset = 0x00600000,
66 }, { 66 }, {
67 .name = "U-Boot Config", 67 .name = "U-Boot Config",
68 .size = 0x00020000, 68 .size = 0x00020000,
69 .offset = 0x00760000, 69 .offset = 0x00760000,
70 }, { 70 }, {
71 .name = "NAS Config", 71 .name = "NAS Config",
72 .size = 0x00060000, 72 .size = 0x00060000,
73 .offset = 0x00700000, 73 .offset = 0x00700000,
74 .mask_flags = MTD_WRITEABLE, 74 .mask_flags = MTD_WRITEABLE,
75 } 75 },
76}; 76};
77 77
78static struct physmap_flash_data qnap_ts209_nor_flash_data = { 78static struct physmap_flash_data qnap_ts209_nor_flash_data = {
79 .width = 1, 79 .width = 1,
80 .parts = qnap_ts209_partitions, 80 .parts = qnap_ts209_partitions,
81 .nr_parts = ARRAY_SIZE(qnap_ts209_partitions) 81 .nr_parts = ARRAY_SIZE(qnap_ts209_partitions)
82}; 82};
83 83
84static struct resource qnap_ts209_nor_flash_resource = { 84static struct resource qnap_ts209_nor_flash_resource = {
85 .flags = IORESOURCE_MEM, 85 .flags = IORESOURCE_MEM,
86 .start = QNAP_TS209_NOR_BOOT_BASE, 86 .start = QNAP_TS209_NOR_BOOT_BASE,
87 .end = QNAP_TS209_NOR_BOOT_BASE + QNAP_TS209_NOR_BOOT_SIZE - 1, 87 .end = QNAP_TS209_NOR_BOOT_BASE + QNAP_TS209_NOR_BOOT_SIZE - 1,
88}; 88};
89 89
90static struct platform_device qnap_ts209_nor_flash = { 90static struct platform_device qnap_ts209_nor_flash = {
91 .name = "physmap-flash", 91 .name = "physmap-flash",
92 .id = 0, 92 .id = 0,
93 .dev = { .platform_data = &qnap_ts209_nor_flash_data, }, 93 .dev = {
94 .resource = &qnap_ts209_nor_flash_resource, 94 .platform_data = &qnap_ts209_nor_flash_data,
95 .num_resources = 1, 95 },
96 .resource = &qnap_ts209_nor_flash_resource,
97 .num_resources = 1,
96}; 98};
97 99
98/***************************************************************************** 100/*****************************************************************************
@@ -164,12 +166,12 @@ static int __init qnap_ts209_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
164} 166}
165 167
166static struct hw_pci qnap_ts209_pci __initdata = { 168static struct hw_pci qnap_ts209_pci __initdata = {
167 .nr_controllers = 2, 169 .nr_controllers = 2,
168 .preinit = qnap_ts209_pci_preinit, 170 .preinit = qnap_ts209_pci_preinit,
169 .swizzle = pci_std_swizzle, 171 .swizzle = pci_std_swizzle,
170 .setup = orion5x_pci_sys_setup, 172 .setup = orion5x_pci_sys_setup,
171 .scan = orion5x_pci_sys_scan_bus, 173 .scan = orion5x_pci_sys_scan_bus,
172 .map_irq = qnap_ts209_pci_map_irq, 174 .map_irq = qnap_ts209_pci_map_irq,
173}; 175};
174 176
175static int __init qnap_ts209_pci_init(void) 177static int __init qnap_ts209_pci_init(void)
@@ -187,8 +189,8 @@ subsys_initcall(qnap_ts209_pci_init);
187 ****************************************************************************/ 189 ****************************************************************************/
188 190
189static struct mv643xx_eth_platform_data qnap_ts209_eth_data = { 191static struct mv643xx_eth_platform_data qnap_ts209_eth_data = {
190 .phy_addr = 8, 192 .phy_addr = 8,
191 .force_phy_addr = 1, 193 .force_phy_addr = 1,
192}; 194};
193 195
194static int __init parse_hex_nibble(char n) 196static int __init parse_hex_nibble(char n)
@@ -280,7 +282,7 @@ static void __init ts209_find_mac_addr(void)
280 282
281static struct i2c_board_info __initdata qnap_ts209_i2c_rtc = { 283static struct i2c_board_info __initdata qnap_ts209_i2c_rtc = {
282 I2C_BOARD_INFO("s35390a", 0x30), 284 I2C_BOARD_INFO("s35390a", 0x30),
283 .irq = 0, 285 .irq = 0,
284}; 286};
285 287
286/**************************************************************************** 288/****************************************************************************
@@ -297,32 +299,33 @@ static struct gpio_keys_button qnap_ts209_buttons[] = {
297 .gpio = QNAP_TS209_GPIO_KEY_MEDIA, 299 .gpio = QNAP_TS209_GPIO_KEY_MEDIA,
298 .desc = "USB Copy Button", 300 .desc = "USB Copy Button",
299 .active_low = 1, 301 .active_low = 1,
300 }, 302 }, {
301 {
302 .code = KEY_POWER, 303 .code = KEY_POWER,
303 .gpio = QNAP_TS209_GPIO_KEY_RESET, 304 .gpio = QNAP_TS209_GPIO_KEY_RESET,
304 .desc = "Reset Button", 305 .desc = "Reset Button",
305 .active_low = 1, 306 .active_low = 1,
306 } 307 },
307}; 308};
308 309
309static struct gpio_keys_platform_data qnap_ts209_button_data = { 310static struct gpio_keys_platform_data qnap_ts209_button_data = {
310 .buttons = qnap_ts209_buttons, 311 .buttons = qnap_ts209_buttons,
311 .nbuttons = ARRAY_SIZE(qnap_ts209_buttons), 312 .nbuttons = ARRAY_SIZE(qnap_ts209_buttons),
312}; 313};
313 314
314static struct platform_device qnap_ts209_button_device = { 315static struct platform_device qnap_ts209_button_device = {
315 .name = "gpio-keys", 316 .name = "gpio-keys",
316 .id = -1, 317 .id = -1,
317 .num_resources = 0, 318 .num_resources = 0,
318 .dev = { .platform_data = &qnap_ts209_button_data, }, 319 .dev = {
320 .platform_data = &qnap_ts209_button_data,
321 },
319}; 322};
320 323
321/***************************************************************************** 324/*****************************************************************************
322 * SATA 325 * SATA
323 ****************************************************************************/ 326 ****************************************************************************/
324static struct mv_sata_platform_data qnap_ts209_sata_data = { 327static struct mv_sata_platform_data qnap_ts209_sata_data = {
325 .n_ports = 2, 328 .n_ports = 2,
326}; 329};
327 330
328/***************************************************************************** 331/*****************************************************************************
@@ -339,7 +342,7 @@ static struct platform_device *qnap_ts209_devices[] __initdata = {
339 * QNAP TS-[12]09 specific power off method via UART1-attached PIC 342 * QNAP TS-[12]09 specific power off method via UART1-attached PIC
340 */ 343 */
341 344
342#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2)) 345#define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2))
343 346
344static void qnap_ts209_power_off(void) 347static void qnap_ts209_power_off(void)
345{ 348{
@@ -372,7 +375,7 @@ static void __init qnap_ts209_init(void)
372 * Setup flash mapping 375 * Setup flash mapping
373 */ 376 */
374 orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE, 377 orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
375 QNAP_TS209_NOR_BOOT_SIZE); 378 QNAP_TS209_NOR_BOOT_SIZE);
376 379
377 /* 380 /*
378 * Open a special address decode windows for the PCIe WA. 381 * Open a special address decode windows for the PCIe WA.
@@ -432,7 +435,7 @@ static void __init qnap_ts209_init(void)
432} 435}
433 436
434MACHINE_START(TS209, "QNAP TS-109/TS-209") 437MACHINE_START(TS209, "QNAP TS-109/TS-209")
435 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */ 438 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
436 .phys_io = ORION5X_REGS_PHYS_BASE, 439 .phys_io = ORION5X_REGS_PHYS_BASE,
437 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC, 440 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
438 .boot_params = 0x00000100, 441 .boot_params = 0x00000100,