diff options
-rw-r--r-- | arch/arm/configs/kirkwood_defconfig | 20 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 40 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/include/mach/kirkwood.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/mpp.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/ts219-setup.c | 220 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/ts78xx-fpga.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-orion5x/ts78xx-setup.c | 7 | ||||
-rw-r--r-- | arch/arm/tools/mach-types | 10 | ||||
-rw-r--r-- | drivers/rtc/rtc-mv.c | 11 |
12 files changed, 321 insertions, 11 deletions
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 9ed4e1b86674..c367ae44012e 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig | |||
@@ -180,6 +180,7 @@ CONFIG_MACH_DB88F6281_BP=y | |||
180 | CONFIG_MACH_RD88F6192_NAS=y | 180 | CONFIG_MACH_RD88F6192_NAS=y |
181 | CONFIG_MACH_RD88F6281=y | 181 | CONFIG_MACH_RD88F6281=y |
182 | CONFIG_MACH_SHEEVAPLUG=y | 182 | CONFIG_MACH_SHEEVAPLUG=y |
183 | CONFIG_MACH_TS219=y | ||
183 | CONFIG_PLAT_ORION=y | 184 | CONFIG_PLAT_ORION=y |
184 | 185 | ||
185 | # | 186 | # |
@@ -852,13 +853,20 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y | |||
852 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | 853 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 |
853 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | 854 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 |
854 | # CONFIG_INPUT_JOYDEV is not set | 855 | # CONFIG_INPUT_JOYDEV is not set |
855 | # CONFIG_INPUT_EVDEV is not set | 856 | CONFIG_INPUT_EVDEV=y |
856 | # CONFIG_INPUT_EVBUG is not set | 857 | # CONFIG_INPUT_EVBUG is not set |
857 | 858 | ||
858 | # | 859 | # |
859 | # Input Device Drivers | 860 | # Input Device Drivers |
860 | # | 861 | # |
861 | # CONFIG_INPUT_KEYBOARD is not set | 862 | CONFIG_INPUT_KEYBOARD=y |
863 | CONFIG_KEYBOARD_ATKBD=y | ||
864 | # CONFIG_KEYBOARD_SUNKBD is not set | ||
865 | # CONFIG_KEYBOARD_LKKBD is not set | ||
866 | # CONFIG_KEYBOARD_XTKBD is not set | ||
867 | # CONFIG_KEYBOARD_NEWTON is not set | ||
868 | # CONFIG_KEYBOARD_STOWAWAY is not set | ||
869 | CONFIG_KEYBOARD_GPIO=y | ||
862 | # CONFIG_INPUT_MOUSE is not set | 870 | # CONFIG_INPUT_MOUSE is not set |
863 | # CONFIG_INPUT_JOYSTICK is not set | 871 | # CONFIG_INPUT_JOYSTICK is not set |
864 | # CONFIG_INPUT_TABLET is not set | 872 | # CONFIG_INPUT_TABLET is not set |
@@ -868,7 +876,11 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | |||
868 | # | 876 | # |
869 | # Hardware I/O ports | 877 | # Hardware I/O ports |
870 | # | 878 | # |
871 | # CONFIG_SERIO is not set | 879 | CONFIG_SERIO=y |
880 | CONFIG_SERIO_SERPORT=y | ||
881 | # CONFIG_SERIO_PCIPS2 is not set | ||
882 | CONFIG_SERIO_LIBPS2=y | ||
883 | # CONFIG_SERIO_RAW is not set | ||
872 | # CONFIG_GAMEPORT is not set | 884 | # CONFIG_GAMEPORT is not set |
873 | 885 | ||
874 | # | 886 | # |
@@ -1271,7 +1283,7 @@ CONFIG_RTC_INTF_DEV=y | |||
1271 | # CONFIG_RTC_DRV_PCF8563 is not set | 1283 | # CONFIG_RTC_DRV_PCF8563 is not set |
1272 | # CONFIG_RTC_DRV_PCF8583 is not set | 1284 | # CONFIG_RTC_DRV_PCF8583 is not set |
1273 | # CONFIG_RTC_DRV_M41T80 is not set | 1285 | # CONFIG_RTC_DRV_M41T80 is not set |
1274 | # CONFIG_RTC_DRV_S35390A is not set | 1286 | CONFIG_RTC_DRV_S35390A=y |
1275 | # CONFIG_RTC_DRV_FM3130 is not set | 1287 | # CONFIG_RTC_DRV_FM3130 is not set |
1276 | # CONFIG_RTC_DRV_RX8581 is not set | 1288 | # CONFIG_RTC_DRV_RX8581 is not set |
1277 | 1289 | ||
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 532443622a17..b5421cccd7e1 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -26,6 +26,12 @@ config MACH_SHEEVAPLUG | |||
26 | Say 'Y' here if you want your kernel to support the | 26 | Say 'Y' here if you want your kernel to support the |
27 | Marvell SheevaPlug Reference Board. | 27 | Marvell SheevaPlug Reference Board. |
28 | 28 | ||
29 | config MACH_TS219 | ||
30 | bool "QNAP TS-119 and TS-219 Turbo NAS" | ||
31 | help | ||
32 | Say 'Y' here if you want your kernel to support the | ||
33 | QNAP TS-119 and TS-219 Turbo NAS devices. | ||
34 | |||
29 | endmenu | 35 | endmenu |
30 | 36 | ||
31 | endif | 37 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index de81b4b5bd33..8f03c9b9bdd9 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -4,3 +4,4 @@ obj-$(CONFIG_MACH_DB88F6281_BP) += db88f6281-bp-setup.o | |||
4 | obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o | 4 | obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o |
5 | obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o | 5 | obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o |
6 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o | 6 | obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o |
7 | obj-$(CONFIG_MACH_TS219) += ts219-setup.o | ||
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 9f012551794d..19b03f62c3f4 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/serial_8250.h> | 14 | #include <linux/serial_8250.h> |
15 | #include <linux/mbus.h> | 15 | #include <linux/mbus.h> |
16 | #include <linux/mv643xx_eth.h> | 16 | #include <linux/mv643xx_eth.h> |
17 | #include <linux/mv643xx_i2c.h> | ||
17 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
18 | #include <linux/spi/orion_spi.h> | 19 | #include <linux/spi/orion_spi.h> |
19 | #include <net/dsa.h> | 20 | #include <net/dsa.h> |
@@ -371,6 +372,45 @@ void __init kirkwood_spi_init() | |||
371 | 372 | ||
372 | 373 | ||
373 | /***************************************************************************** | 374 | /***************************************************************************** |
375 | * I2C | ||
376 | ****************************************************************************/ | ||
377 | static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = { | ||
378 | .freq_m = 8, /* assumes 166 MHz TCLK */ | ||
379 | .freq_n = 3, | ||
380 | .timeout = 1000, /* Default timeout of 1 second */ | ||
381 | }; | ||
382 | |||
383 | static struct resource kirkwood_i2c_resources[] = { | ||
384 | { | ||
385 | .name = "i2c", | ||
386 | .start = I2C_PHYS_BASE, | ||
387 | .end = I2C_PHYS_BASE + 0x1f, | ||
388 | .flags = IORESOURCE_MEM, | ||
389 | }, { | ||
390 | .name = "i2c", | ||
391 | .start = IRQ_KIRKWOOD_TWSI, | ||
392 | .end = IRQ_KIRKWOOD_TWSI, | ||
393 | .flags = IORESOURCE_IRQ, | ||
394 | }, | ||
395 | }; | ||
396 | |||
397 | static struct platform_device kirkwood_i2c = { | ||
398 | .name = MV64XXX_I2C_CTLR_NAME, | ||
399 | .id = 0, | ||
400 | .num_resources = ARRAY_SIZE(kirkwood_i2c_resources), | ||
401 | .resource = kirkwood_i2c_resources, | ||
402 | .dev = { | ||
403 | .platform_data = &kirkwood_i2c_pdata, | ||
404 | }, | ||
405 | }; | ||
406 | |||
407 | void __init kirkwood_i2c_init(void) | ||
408 | { | ||
409 | platform_device_register(&kirkwood_i2c); | ||
410 | } | ||
411 | |||
412 | |||
413 | /***************************************************************************** | ||
374 | * UART0 | 414 | * UART0 |
375 | ****************************************************************************/ | 415 | ****************************************************************************/ |
376 | static struct plat_serial8250_port kirkwood_uart0_data[] = { | 416 | static struct plat_serial8250_port kirkwood_uart0_data[] = { |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 9e5282684d58..6ee88406f381 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -37,9 +37,11 @@ void kirkwood_pcie_init(void); | |||
37 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); | 37 | void kirkwood_sata_init(struct mv_sata_platform_data *sata_data); |
38 | void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data); | 38 | void kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data); |
39 | void kirkwood_spi_init(void); | 39 | void kirkwood_spi_init(void); |
40 | void kirkwood_i2c_init(void); | ||
40 | void kirkwood_uart0_init(void); | 41 | void kirkwood_uart0_init(void); |
41 | void kirkwood_uart1_init(void); | 42 | void kirkwood_uart1_init(void); |
42 | 43 | ||
44 | extern int kirkwood_tclk; | ||
43 | extern struct sys_timer kirkwood_timer; | 45 | extern struct sys_timer kirkwood_timer; |
44 | 46 | ||
45 | 47 | ||
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index d3db30fe763b..38c986853590 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h | |||
@@ -93,6 +93,7 @@ | |||
93 | #define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034) | 93 | #define DEVICE_ID (DEV_BUS_VIRT_BASE | 0x0034) |
94 | #define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300) | 94 | #define RTC_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0300) |
95 | #define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600) | 95 | #define SPI_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x0600) |
96 | #define I2C_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x1000) | ||
96 | #define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) | 97 | #define UART0_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2000) |
97 | #define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) | 98 | #define UART0_VIRT_BASE (DEV_BUS_VIRT_BASE | 0x2000) |
98 | #define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) | 99 | #define UART1_PHYS_BASE (DEV_BUS_PHYS_BASE | 0x2100) |
diff --git a/arch/arm/mach-kirkwood/mpp.h b/arch/arm/mach-kirkwood/mpp.h index 45cccb743107..e021a80c2caf 100644 --- a/arch/arm/mach-kirkwood/mpp.h +++ b/arch/arm/mach-kirkwood/mpp.h | |||
@@ -90,13 +90,13 @@ | |||
90 | 90 | ||
91 | #define MPP10_GPO MPP( 10, 0x0, 0, 1, 1, 1, 1, 1 ) | 91 | #define MPP10_GPO MPP( 10, 0x0, 0, 1, 1, 1, 1, 1 ) |
92 | #define MPP10_SPI_SCK MPP( 10, 0x2, 0, 1, 1, 1, 1, 1 ) | 92 | #define MPP10_SPI_SCK MPP( 10, 0x2, 0, 1, 1, 1, 1, 1 ) |
93 | #define MPP10_UArt0_TXD MPP( 10, 0X3, 0, 1, 1, 1, 1, 1 ) | 93 | #define MPP10_UART0_TXD MPP( 10, 0X3, 0, 1, 1, 1, 1, 1 ) |
94 | #define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 1, 0, 0, 1, 1 ) | 94 | #define MPP10_SATA1_ACTn MPP( 10, 0x5, 0, 1, 0, 0, 1, 1 ) |
95 | #define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 1, 1, 1, 1, 1 ) | 95 | #define MPP10_PTP_TRIG_GEN MPP( 10, 0xc, 0, 1, 1, 1, 1, 1 ) |
96 | 96 | ||
97 | #define MPP11_GPIO MPP( 11, 0x0, 1, 1, 1, 1, 1, 1 ) | 97 | #define MPP11_GPIO MPP( 11, 0x0, 1, 1, 1, 1, 1, 1 ) |
98 | #define MPP11_SPI_MISO MPP( 11, 0x2, 1, 0, 1, 1, 1, 1 ) | 98 | #define MPP11_SPI_MISO MPP( 11, 0x2, 1, 0, 1, 1, 1, 1 ) |
99 | #define MPP11_UArt0_RXD MPP( 11, 0x3, 1, 0, 1, 1, 1, 1 ) | 99 | #define MPP11_UART0_RXD MPP( 11, 0x3, 1, 0, 1, 1, 1, 1 ) |
100 | #define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 1, 0, 1, 1, 1, 1 ) | 100 | #define MPP11_PTP_EVENT_REQ MPP( 11, 0x4, 1, 0, 1, 1, 1, 1 ) |
101 | #define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 1, 1, 1, 1, 1 ) | 101 | #define MPP11_PTP_TRIG_GEN MPP( 11, 0xc, 0, 1, 1, 1, 1, 1 ) |
102 | #define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 ) | 102 | #define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 ) |
diff --git a/arch/arm/mach-kirkwood/ts219-setup.c b/arch/arm/mach-kirkwood/ts219-setup.c new file mode 100644 index 000000000000..dda5743cf3e0 --- /dev/null +++ b/arch/arm/mach-kirkwood/ts219-setup.c | |||
@@ -0,0 +1,220 @@ | |||
1 | /* | ||
2 | * | ||
3 | * QNAP TS-119/TS-219 Turbo NAS Board Setup | ||
4 | * | ||
5 | * Copyright (C) 2009 Martin Michlmayr <tbm@cyrius.com> | ||
6 | * Copyright (C) 2008 Byron Bradley <byron.bbradley@gmail.com> | ||
7 | * | ||
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. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/mtd/physmap.h> | ||
18 | #include <linux/spi/flash.h> | ||
19 | #include <linux/spi/spi.h> | ||
20 | #include <linux/spi/orion_spi.h> | ||
21 | #include <linux/i2c.h> | ||
22 | #include <linux/mv643xx_eth.h> | ||
23 | #include <linux/ata_platform.h> | ||
24 | #include <linux/gpio_keys.h> | ||
25 | #include <linux/input.h> | ||
26 | #include <linux/timex.h> | ||
27 | #include <linux/serial_reg.h> | ||
28 | #include <linux/pci.h> | ||
29 | #include <asm/mach-types.h> | ||
30 | #include <asm/mach/arch.h> | ||
31 | #include <mach/kirkwood.h> | ||
32 | #include "common.h" | ||
33 | #include "mpp.h" | ||
34 | |||
35 | /**************************************************************************** | ||
36 | * 16 MiB NOR flash. The struct mtd_partition is not in the same order as the | ||
37 | * partitions on the device because we want to keep compatability with | ||
38 | * the QNAP firmware. | ||
39 | * Layout as used by QNAP: | ||
40 | * 0x00000000-0x00080000 : "U-Boot" | ||
41 | * 0x00200000-0x00400000 : "Kernel" | ||
42 | * 0x00400000-0x00d00000 : "RootFS" | ||
43 | * 0x00d00000-0x01000000 : "RootFS2" | ||
44 | * 0x00080000-0x000c0000 : "U-Boot Config" | ||
45 | * 0x000c0000-0x00200000 : "NAS Config" | ||
46 | * | ||
47 | * We'll use "RootFS1" instead of "RootFS" to stay compatible with the layout | ||
48 | * used by the QNAP TS-109/TS-209. | ||
49 | * | ||
50 | ***************************************************************************/ | ||
51 | |||
52 | static struct mtd_partition qnap_ts219_partitions[] = { | ||
53 | { | ||
54 | .name = "U-Boot", | ||
55 | .size = 0x00080000, | ||
56 | .offset = 0, | ||
57 | .mask_flags = MTD_WRITEABLE, | ||
58 | }, { | ||
59 | .name = "Kernel", | ||
60 | .size = 0x00200000, | ||
61 | .offset = 0x00200000, | ||
62 | }, { | ||
63 | .name = "RootFS1", | ||
64 | .size = 0x00900000, | ||
65 | .offset = 0x00400000, | ||
66 | }, { | ||
67 | .name = "RootFS2", | ||
68 | .size = 0x00300000, | ||
69 | .offset = 0x00d00000, | ||
70 | }, { | ||
71 | .name = "U-Boot Config", | ||
72 | .size = 0x00040000, | ||
73 | .offset = 0x00080000, | ||
74 | }, { | ||
75 | .name = "NAS Config", | ||
76 | .size = 0x00140000, | ||
77 | .offset = 0x000c0000, | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | static const struct flash_platform_data qnap_ts219_flash = { | ||
82 | .type = "m25p128", | ||
83 | .name = "spi_flash", | ||
84 | .parts = qnap_ts219_partitions, | ||
85 | .nr_parts = ARRAY_SIZE(qnap_ts219_partitions), | ||
86 | }; | ||
87 | |||
88 | static struct spi_board_info __initdata qnap_ts219_spi_slave_info[] = { | ||
89 | { | ||
90 | .modalias = "m25p80", | ||
91 | .platform_data = &qnap_ts219_flash, | ||
92 | .irq = -1, | ||
93 | .max_speed_hz = 20000000, | ||
94 | .bus_num = 0, | ||
95 | .chip_select = 0, | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | static struct i2c_board_info __initdata qnap_ts219_i2c_rtc = { | ||
100 | I2C_BOARD_INFO("s35390a", 0x30), | ||
101 | }; | ||
102 | |||
103 | static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { | ||
104 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
105 | }; | ||
106 | |||
107 | static struct mv_sata_platform_data qnap_ts219_sata_data = { | ||
108 | .n_ports = 2, | ||
109 | }; | ||
110 | |||
111 | static struct gpio_keys_button qnap_ts219_buttons[] = { | ||
112 | { | ||
113 | .code = KEY_COPY, | ||
114 | .gpio = 15, | ||
115 | .desc = "USB Copy", | ||
116 | .active_low = 1, | ||
117 | }, | ||
118 | { | ||
119 | .code = KEY_RESTART, | ||
120 | .gpio = 16, | ||
121 | .desc = "Reset", | ||
122 | .active_low = 1, | ||
123 | }, | ||
124 | }; | ||
125 | |||
126 | static struct gpio_keys_platform_data qnap_ts219_button_data = { | ||
127 | .buttons = qnap_ts219_buttons, | ||
128 | .nbuttons = ARRAY_SIZE(qnap_ts219_buttons), | ||
129 | }; | ||
130 | |||
131 | static struct platform_device qnap_ts219_button_device = { | ||
132 | .name = "gpio-keys", | ||
133 | .id = -1, | ||
134 | .num_resources = 0, | ||
135 | .dev = { | ||
136 | .platform_data = &qnap_ts219_button_data, | ||
137 | } | ||
138 | }; | ||
139 | |||
140 | static unsigned int qnap_ts219_mpp_config[] __initdata = { | ||
141 | MPP0_SPI_SCn, | ||
142 | MPP1_SPI_MOSI, | ||
143 | MPP2_SPI_SCK, | ||
144 | MPP3_SPI_MISO, | ||
145 | MPP8_TW_SDA, | ||
146 | MPP9_TW_SCK, | ||
147 | MPP10_UART0_TXD, | ||
148 | MPP11_UART0_RXD, | ||
149 | MPP13_UART1_TXD, /* PIC controller */ | ||
150 | MPP14_UART1_RXD, /* PIC controller */ | ||
151 | MPP15_GPIO, /* USB Copy button */ | ||
152 | MPP16_GPIO, /* Reset button */ | ||
153 | MPP20_SATA1_ACTn, | ||
154 | MPP21_SATA0_ACTn, | ||
155 | MPP22_SATA1_PRESENTn, | ||
156 | MPP23_SATA0_PRESENTn, | ||
157 | 0 | ||
158 | }; | ||
159 | |||
160 | |||
161 | /***************************************************************************** | ||
162 | * QNAP TS-x19 specific power off method via UART1-attached PIC | ||
163 | ****************************************************************************/ | ||
164 | |||
165 | #define UART1_REG(x) (UART1_VIRT_BASE + ((UART_##x) << 2)) | ||
166 | |||
167 | void qnap_ts219_power_off(void) | ||
168 | { | ||
169 | /* 19200 baud divisor */ | ||
170 | const unsigned divisor = ((kirkwood_tclk + (8 * 19200)) / (16 * 19200)); | ||
171 | |||
172 | pr_info("%s: triggering power-off...\n", __func__); | ||
173 | |||
174 | /* hijack UART1 and reset into sane state (19200,8n1) */ | ||
175 | writel(0x83, UART1_REG(LCR)); | ||
176 | writel(divisor & 0xff, UART1_REG(DLL)); | ||
177 | writel((divisor >> 8) & 0xff, UART1_REG(DLM)); | ||
178 | writel(0x03, UART1_REG(LCR)); | ||
179 | writel(0x00, UART1_REG(IER)); | ||
180 | writel(0x00, UART1_REG(FCR)); | ||
181 | writel(0x00, UART1_REG(MCR)); | ||
182 | |||
183 | /* send the power-off command 'A' to PIC */ | ||
184 | writel('A', UART1_REG(TX)); | ||
185 | } | ||
186 | |||
187 | static void __init qnap_ts219_init(void) | ||
188 | { | ||
189 | /* | ||
190 | * Basic setup. Needs to be called early. | ||
191 | */ | ||
192 | kirkwood_init(); | ||
193 | kirkwood_mpp_conf(qnap_ts219_mpp_config); | ||
194 | |||
195 | kirkwood_uart0_init(); | ||
196 | kirkwood_uart1_init(); /* A PIC controller is connected here. */ | ||
197 | spi_register_board_info(qnap_ts219_spi_slave_info, | ||
198 | ARRAY_SIZE(qnap_ts219_spi_slave_info)); | ||
199 | kirkwood_spi_init(); | ||
200 | kirkwood_i2c_init(); | ||
201 | i2c_register_board_info(0, &qnap_ts219_i2c_rtc, 1); | ||
202 | kirkwood_ge00_init(&qnap_ts219_ge00_data); | ||
203 | kirkwood_sata_init(&qnap_ts219_sata_data); | ||
204 | kirkwood_ehci_init(); | ||
205 | platform_device_register(&qnap_ts219_button_device); | ||
206 | |||
207 | pm_power_off = qnap_ts219_power_off; | ||
208 | |||
209 | } | ||
210 | |||
211 | MACHINE_START(TS219, "QNAP TS-119/TS-219") | ||
212 | /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */ | ||
213 | .phys_io = KIRKWOOD_REGS_PHYS_BASE, | ||
214 | .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, | ||
215 | .boot_params = 0x00000100, | ||
216 | .init_machine = qnap_ts219_init, | ||
217 | .map_io = kirkwood_map_io, | ||
218 | .init_irq = kirkwood_init_irq, | ||
219 | .timer = &kirkwood_timer, | ||
220 | MACHINE_END | ||
diff --git a/arch/arm/mach-orion5x/ts78xx-fpga.h b/arch/arm/mach-orion5x/ts78xx-fpga.h index 0a314ddef658..0f9cdf458952 100644 --- a/arch/arm/mach-orion5x/ts78xx-fpga.h +++ b/arch/arm/mach-orion5x/ts78xx-fpga.h | |||
@@ -6,8 +6,14 @@ | |||
6 | */ | 6 | */ |
7 | enum fpga_ids { | 7 | enum fpga_ids { |
8 | /* Technologic Systems */ | 8 | /* Technologic Systems */ |
9 | TS7800_REV_B2 = FPGAID(0x00b480, 0x02), | 9 | TS7800_REV_1 = FPGAID(0x00b480, 0x01), |
10 | TS7800_REV_B3 = FPGAID(0x00b480, 0x03), | 10 | TS7800_REV_2 = FPGAID(0x00b480, 0x02), |
11 | TS7800_REV_3 = FPGAID(0x00b480, 0x03), | ||
12 | TS7800_REV_4 = FPGAID(0x00b480, 0x04), | ||
13 | TS7800_REV_5 = FPGAID(0x00b480, 0x05), | ||
14 | |||
15 | /* Unaffordable & Expensive */ | ||
16 | UAE_DUMMY = FPGAID(0xffffff, 0x01), | ||
11 | }; | 17 | }; |
12 | 18 | ||
13 | struct fpga_device { | 19 | struct fpga_device { |
diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c index f5191ddea085..9a6b397f972d 100644 --- a/arch/arm/mach-orion5x/ts78xx-setup.c +++ b/arch/arm/mach-orion5x/ts78xx-setup.c | |||
@@ -282,8 +282,11 @@ static void ts78xx_fpga_supports(void) | |||
282 | { | 282 | { |
283 | /* TODO: put this 'table' into ts78xx-fpga.h */ | 283 | /* TODO: put this 'table' into ts78xx-fpga.h */ |
284 | switch (ts78xx_fpga.id) { | 284 | switch (ts78xx_fpga.id) { |
285 | case TS7800_REV_B2: | 285 | case TS7800_REV_1: |
286 | case TS7800_REV_B3: | 286 | case TS7800_REV_2: |
287 | case TS7800_REV_3: | ||
288 | case TS7800_REV_4: | ||
289 | case TS7800_REV_5: | ||
287 | ts78xx_fpga.supports.ts_rtc.present = 1; | 290 | ts78xx_fpga.supports.ts_rtc.present = 1; |
288 | ts78xx_fpga.supports.ts_nand.present = 1; | 291 | ts78xx_fpga.supports.ts_nand.present = 1; |
289 | break; | 292 | break; |
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index b4211d8b2ac7..945e0d237a1d 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -12,7 +12,7 @@ | |||
12 | # | 12 | # |
13 | # http://www.arm.linux.org.uk/developer/machines/?action=new | 13 | # http://www.arm.linux.org.uk/developer/machines/?action=new |
14 | # | 14 | # |
15 | # Last update: Thu Mar 12 18:01:45 2009 | 15 | # Last update: Mon Mar 23 20:09:01 2009 |
16 | # | 16 | # |
17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
18 | # | 18 | # |
@@ -2124,3 +2124,11 @@ mx27wallace MACH_MX27WALLACE MX27WALLACE 2133 | |||
2124 | fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134 | 2124 | fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134 |
2125 | rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135 | 2125 | rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135 |
2126 | smallogger MACH_SMALLOGGER SMALLOGGER 2136 | 2126 | smallogger MACH_SMALLOGGER SMALLOGGER 2136 |
2127 | ccw9p9215 MACH_CCW9P9215 CCW9P9215 2137 | ||
2128 | dm355_leopard MACH_DM355_LEOPARD DM355_LEOPARD 2138 | ||
2129 | ts219 MACH_TS219 TS219 2139 | ||
2130 | tny_a9263 MACH_TNY_A9263 TNY_A9263 2140 | ||
2131 | apollo MACH_APOLLO APOLLO 2141 | ||
2132 | at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 | ||
2133 | spc300 MACH_SPC300 SPC300 2143 | ||
2134 | eko MACH_EKO EKO 2144 | ||
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 45f12dcd3716..e0263d2005ee 100644 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/bcd.h> | 12 | #include <linux/bcd.h> |
13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/delay.h> | ||
15 | 16 | ||
16 | 17 | ||
17 | #define RTC_TIME_REG_OFFS 0 | 18 | #define RTC_TIME_REG_OFFS 0 |
@@ -119,6 +120,16 @@ static int __init mv_rtc_probe(struct platform_device *pdev) | |||
119 | return -EINVAL; | 120 | return -EINVAL; |
120 | } | 121 | } |
121 | 122 | ||
123 | /* make sure it is actually functional */ | ||
124 | if (rtc_time == 0x01000000) { | ||
125 | ssleep(1); | ||
126 | rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS); | ||
127 | if (rtc_time == 0x01000000) { | ||
128 | dev_err(&pdev->dev, "internal RTC not ticking\n"); | ||
129 | return -ENODEV; | ||
130 | } | ||
131 | } | ||
132 | |||
122 | platform_set_drvdata(pdev, pdata); | 133 | platform_set_drvdata(pdev, pdata); |
123 | pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, | 134 | pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, |
124 | &mv_rtc_ops, THIS_MODULE); | 135 | &mv_rtc_ops, THIS_MODULE); |