diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-03-16 16:13:43 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-03-16 16:13:43 -0400 |
commit | c899445f9783309ac73073282d4c0ae27f51fa9a (patch) | |
tree | 4b414caca7c3879c543d118af43d9c72cc279225 | |
parent | 5dab643cd67e1a791052d092ab447534937bf3f1 (diff) | |
parent | e871b87a1e978e618c75acd4ceb6cd4699728691 (diff) |
Merge branch 'kirkwood_dt_for_3.4_v3' of git://git.infradead.org/users/jcooper/linux-kirkwood into kirkwood/dt
* 'kirkwood_dt_for_3.4_v3' of git://git.infradead.org/users/jcooper/linux-kirkwood:
ARM: kirkwood: use devicetree for rtc-mv
ARM: kirkwood: rtc-mv devicetree bindings
ARM: kirkwood: fdt: define uart[01] as disabled, enable uart0
ARM: kirkwood: fdt: facilitate new boards during fdt migration
ARM: kirkwood: fdt: absorb kirkwood_init()
ARM: kirkwood: fdt: use mrvl ticker symbol
ARM: orion: wdt: use resource vice direct access
ARM: Kirkwood: Remove tclk from kirkwood_asoc_platform_data.
ARM: orion: spi: remove enable_clock_fix which is not used
-rw-r--r-- | arch/arm/boot/dts/kirkwood-dreamplug.dts | 13 | ||||
-rw-r--r-- | arch/arm/boot/dts/kirkwood.dtsi | 34 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-dreamplug.c | 152 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/board-dt.c | 151 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-kirkwood/common.h | 15 | ||||
-rw-r--r-- | arch/arm/plat-orion/common.c | 7 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/audio.h | 1 | ||||
-rw-r--r-- | drivers/rtc/rtc-mv.c | 9 | ||||
-rw-r--r-- | drivers/spi/spi-orion.c | 5 | ||||
-rw-r--r-- | drivers/watchdog/orion_wdt.c | 24 | ||||
-rw-r--r-- | include/linux/spi/orion_spi.h | 1 |
13 files changed, 264 insertions, 160 deletions
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts index 8a5dff807b45..a5376b84227f 100644 --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | / { | 5 | / { |
6 | model = "Globalscale Technologies Dreamplug"; | 6 | model = "Globalscale Technologies Dreamplug"; |
7 | compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | 7 | compatible = "globalscale,dreamplug-003-ds2001", "globalscale,dreamplug", "mrvl,kirkwood-88f6281", "mrvl,kirkwood"; |
8 | 8 | ||
9 | memory { | 9 | memory { |
10 | device_type = "memory"; | 10 | device_type = "memory"; |
@@ -15,11 +15,10 @@ | |||
15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | 15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | serial@f1012000 { | 18 | ocp@f1000000 { |
19 | compatible = "ns16550a"; | 19 | serial@12000 { |
20 | reg = <0xf1012000 0xff>; | 20 | clock-frequency = <200000000>; |
21 | reg-shift = <2>; | 21 | status = "ok"; |
22 | interrupts = <33>; | 22 | }; |
23 | clock-frequency = <200000000>; | ||
24 | }; | 23 | }; |
25 | }; | 24 | }; |
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi index 771c6bbeb29a..3474ef890945 100644 --- a/arch/arm/boot/dts/kirkwood.dtsi +++ b/arch/arm/boot/dts/kirkwood.dtsi | |||
@@ -1,6 +1,36 @@ | |||
1 | /include/ "skeleton.dtsi" | 1 | /include/ "skeleton.dtsi" |
2 | 2 | ||
3 | / { | 3 | / { |
4 | compatible = "marvell,kirkwood"; | 4 | compatible = "mrvl,kirkwood"; |
5 | }; | 5 | |
6 | ocp@f1000000 { | ||
7 | compatible = "simple-bus"; | ||
8 | ranges = <0 0xf1000000 0x1000000>; | ||
9 | #address-cells = <1>; | ||
10 | #size-cells = <1>; | ||
11 | |||
12 | serial@12000 { | ||
13 | compatible = "ns16550a"; | ||
14 | reg = <0x12000 0x100>; | ||
15 | reg-shift = <2>; | ||
16 | interrupts = <33>; | ||
17 | /* set clock-frequency in board dts */ | ||
18 | status = "disabled"; | ||
19 | }; | ||
6 | 20 | ||
21 | serial@12100 { | ||
22 | compatible = "ns16550a"; | ||
23 | reg = <0x12100 0x100>; | ||
24 | reg-shift = <2>; | ||
25 | interrupts = <34>; | ||
26 | /* set clock-frequency in board dts */ | ||
27 | status = "disabled"; | ||
28 | }; | ||
29 | |||
30 | rtc@10300 { | ||
31 | compatible = "mrvl,kirkwood-rtc", "mrvl,orion-rtc"; | ||
32 | reg = <0x10300 0x20>; | ||
33 | interrupts = <53>; | ||
34 | }; | ||
35 | }; | ||
36 | }; | ||
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index acbc5e1db06f..e299a9576bf0 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -21,3 +21,4 @@ obj-$(CONFIG_MACH_T5325) += t5325-setup.o | |||
21 | 21 | ||
22 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 22 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
23 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o | 23 | obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o |
24 | obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o | ||
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c new file mode 100644 index 000000000000..985453994dd3 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-dreamplug.c | |||
@@ -0,0 +1,152 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net> | ||
3 | * | ||
4 | * arch/arm/mach-kirkwood/board-dreamplug.c | ||
5 | * | ||
6 | * Marvell DreamPlug Reference Board Init for drivers not converted to | ||
7 | * flattened device tree yet. | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/mtd/partitions.h> | ||
18 | #include <linux/ata_platform.h> | ||
19 | #include <linux/mv643xx_eth.h> | ||
20 | #include <linux/of.h> | ||
21 | #include <linux/of_address.h> | ||
22 | #include <linux/of_fdt.h> | ||
23 | #include <linux/of_irq.h> | ||
24 | #include <linux/of_platform.h> | ||
25 | #include <linux/gpio.h> | ||
26 | #include <linux/leds.h> | ||
27 | #include <linux/mtd/physmap.h> | ||
28 | #include <linux/spi/flash.h> | ||
29 | #include <linux/spi/spi.h> | ||
30 | #include <linux/spi/orion_spi.h> | ||
31 | #include <asm/mach-types.h> | ||
32 | #include <asm/mach/arch.h> | ||
33 | #include <asm/mach/map.h> | ||
34 | #include <mach/kirkwood.h> | ||
35 | #include <mach/bridge-regs.h> | ||
36 | #include <plat/mvsdio.h> | ||
37 | #include "common.h" | ||
38 | #include "mpp.h" | ||
39 | |||
40 | struct mtd_partition dreamplug_partitions[] = { | ||
41 | { | ||
42 | .name = "u-boot", | ||
43 | .size = SZ_512K, | ||
44 | .offset = 0, | ||
45 | }, | ||
46 | { | ||
47 | .name = "u-boot env", | ||
48 | .size = SZ_64K, | ||
49 | .offset = SZ_512K + SZ_512K, | ||
50 | }, | ||
51 | { | ||
52 | .name = "dtb", | ||
53 | .size = SZ_64K, | ||
54 | .offset = SZ_512K + SZ_512K + SZ_512K, | ||
55 | }, | ||
56 | }; | ||
57 | |||
58 | static const struct flash_platform_data dreamplug_spi_slave_data = { | ||
59 | .type = "mx25l1606e", | ||
60 | .name = "spi_flash", | ||
61 | .parts = dreamplug_partitions, | ||
62 | .nr_parts = ARRAY_SIZE(dreamplug_partitions), | ||
63 | }; | ||
64 | |||
65 | static struct spi_board_info __initdata dreamplug_spi_slave_info[] = { | ||
66 | { | ||
67 | .modalias = "m25p80", | ||
68 | .platform_data = &dreamplug_spi_slave_data, | ||
69 | .irq = -1, | ||
70 | .max_speed_hz = 50000000, | ||
71 | .bus_num = 0, | ||
72 | .chip_select = 0, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | static struct mv643xx_eth_platform_data dreamplug_ge00_data = { | ||
77 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
78 | }; | ||
79 | |||
80 | static struct mv643xx_eth_platform_data dreamplug_ge01_data = { | ||
81 | .phy_addr = MV643XX_ETH_PHY_ADDR(1), | ||
82 | }; | ||
83 | |||
84 | static struct mv_sata_platform_data dreamplug_sata_data = { | ||
85 | .n_ports = 1, | ||
86 | }; | ||
87 | |||
88 | static struct mvsdio_platform_data dreamplug_mvsdio_data = { | ||
89 | /* unfortunately the CD signal has not been connected */ | ||
90 | }; | ||
91 | |||
92 | static struct gpio_led dreamplug_led_pins[] = { | ||
93 | { | ||
94 | .name = "dreamplug:blue:bluetooth", | ||
95 | .gpio = 47, | ||
96 | .active_low = 1, | ||
97 | }, | ||
98 | { | ||
99 | .name = "dreamplug:green:wifi", | ||
100 | .gpio = 48, | ||
101 | .active_low = 1, | ||
102 | }, | ||
103 | { | ||
104 | .name = "dreamplug:green:wifi_ap", | ||
105 | .gpio = 49, | ||
106 | .active_low = 1, | ||
107 | }, | ||
108 | }; | ||
109 | |||
110 | static struct gpio_led_platform_data dreamplug_led_data = { | ||
111 | .leds = dreamplug_led_pins, | ||
112 | .num_leds = ARRAY_SIZE(dreamplug_led_pins), | ||
113 | }; | ||
114 | |||
115 | static struct platform_device dreamplug_leds = { | ||
116 | .name = "leds-gpio", | ||
117 | .id = -1, | ||
118 | .dev = { | ||
119 | .platform_data = &dreamplug_led_data, | ||
120 | } | ||
121 | }; | ||
122 | |||
123 | static unsigned int dreamplug_mpp_config[] __initdata = { | ||
124 | MPP0_SPI_SCn, | ||
125 | MPP1_SPI_MOSI, | ||
126 | MPP2_SPI_SCK, | ||
127 | MPP3_SPI_MISO, | ||
128 | MPP47_GPIO, /* Bluetooth LED */ | ||
129 | MPP48_GPIO, /* Wifi LED */ | ||
130 | MPP49_GPIO, /* Wifi AP LED */ | ||
131 | 0 | ||
132 | }; | ||
133 | |||
134 | void __init dreamplug_init(void) | ||
135 | { | ||
136 | /* | ||
137 | * Basic setup. Needs to be called early. | ||
138 | */ | ||
139 | kirkwood_mpp_conf(dreamplug_mpp_config); | ||
140 | |||
141 | spi_register_board_info(dreamplug_spi_slave_info, | ||
142 | ARRAY_SIZE(dreamplug_spi_slave_info)); | ||
143 | kirkwood_spi_init(); | ||
144 | |||
145 | kirkwood_ehci_init(); | ||
146 | kirkwood_ge00_init(&dreamplug_ge00_data); | ||
147 | kirkwood_ge01_init(&dreamplug_ge01_data); | ||
148 | kirkwood_sata_init(&dreamplug_sata_data); | ||
149 | kirkwood_sdio_init(&dreamplug_mvsdio_data); | ||
150 | |||
151 | platform_device_register(&dreamplug_leds); | ||
152 | } | ||
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index fbe6405602ed..1c672d9e6656 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * arch/arm/mach-kirkwood/board-dt.c | 4 | * arch/arm/mach-kirkwood/board-dt.c |
5 | * | 5 | * |
6 | * Marvell DreamPlug Reference Board Setup | 6 | * Flattened Device Tree board initialization |
7 | * | 7 | * |
8 | * This file is licensed under the terms of the GNU General Public | 8 | * This file is licensed under the terms of the GNU General Public |
9 | * License version 2. This program is licensed "as is" without any | 9 | * License version 2. This program is licensed "as is" without any |
@@ -12,150 +12,45 @@ | |||
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/partitions.h> | ||
17 | #include <linux/ata_platform.h> | ||
18 | #include <linux/mv643xx_eth.h> | ||
19 | #include <linux/of.h> | 15 | #include <linux/of.h> |
20 | #include <linux/of_address.h> | ||
21 | #include <linux/of_fdt.h> | ||
22 | #include <linux/of_irq.h> | ||
23 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
24 | #include <linux/gpio.h> | ||
25 | #include <linux/leds.h> | ||
26 | #include <linux/mtd/physmap.h> | ||
27 | #include <linux/spi/flash.h> | ||
28 | #include <linux/spi/spi.h> | ||
29 | #include <linux/spi/orion_spi.h> | ||
30 | #include <asm/mach-types.h> | ||
31 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
32 | #include <mach/kirkwood.h> | 18 | #include <asm/mach/map.h> |
33 | #include <plat/mvsdio.h> | 19 | #include <mach/bridge-regs.h> |
34 | #include "common.h" | 20 | #include "common.h" |
35 | #include "mpp.h" | ||
36 | 21 | ||
37 | static struct of_device_id kirkwood_dt_match_table[] __initdata = { | 22 | static struct of_device_id kirkwood_dt_match_table[] __initdata = { |
38 | { .compatible = "simple-bus", }, | 23 | { .compatible = "simple-bus", }, |
39 | { } | 24 | { } |
40 | }; | 25 | }; |
41 | 26 | ||
42 | struct mtd_partition dreamplug_partitions[] = { | 27 | static void __init kirkwood_dt_init(void) |
43 | { | ||
44 | .name = "u-boot", | ||
45 | .size = SZ_512K, | ||
46 | .offset = 0, | ||
47 | }, | ||
48 | { | ||
49 | .name = "u-boot env", | ||
50 | .size = SZ_64K, | ||
51 | .offset = SZ_512K + SZ_512K, | ||
52 | }, | ||
53 | { | ||
54 | .name = "dtb", | ||
55 | .size = SZ_64K, | ||
56 | .offset = SZ_512K + SZ_512K + SZ_512K, | ||
57 | }, | ||
58 | }; | ||
59 | |||
60 | static const struct flash_platform_data dreamplug_spi_slave_data = { | ||
61 | .type = "mx25l1606e", | ||
62 | .name = "spi_flash", | ||
63 | .parts = dreamplug_partitions, | ||
64 | .nr_parts = ARRAY_SIZE(dreamplug_partitions), | ||
65 | }; | ||
66 | |||
67 | static struct spi_board_info __initdata dreamplug_spi_slave_info[] = { | ||
68 | { | ||
69 | .modalias = "m25p80", | ||
70 | .platform_data = &dreamplug_spi_slave_data, | ||
71 | .irq = -1, | ||
72 | .max_speed_hz = 50000000, | ||
73 | .bus_num = 0, | ||
74 | .chip_select = 0, | ||
75 | }, | ||
76 | }; | ||
77 | |||
78 | static struct mv643xx_eth_platform_data dreamplug_ge00_data = { | ||
79 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
80 | }; | ||
81 | |||
82 | static struct mv643xx_eth_platform_data dreamplug_ge01_data = { | ||
83 | .phy_addr = MV643XX_ETH_PHY_ADDR(1), | ||
84 | }; | ||
85 | |||
86 | static struct mv_sata_platform_data dreamplug_sata_data = { | ||
87 | .n_ports = 1, | ||
88 | }; | ||
89 | |||
90 | static struct mvsdio_platform_data dreamplug_mvsdio_data = { | ||
91 | /* unfortunately the CD signal has not been connected */ | ||
92 | }; | ||
93 | |||
94 | static struct gpio_led dreamplug_led_pins[] = { | ||
95 | { | ||
96 | .name = "dreamplug:blue:bluetooth", | ||
97 | .gpio = 47, | ||
98 | .active_low = 1, | ||
99 | }, | ||
100 | { | ||
101 | .name = "dreamplug:green:wifi", | ||
102 | .gpio = 48, | ||
103 | .active_low = 1, | ||
104 | }, | ||
105 | { | ||
106 | .name = "dreamplug:green:wifi_ap", | ||
107 | .gpio = 49, | ||
108 | .active_low = 1, | ||
109 | }, | ||
110 | }; | ||
111 | |||
112 | static struct gpio_led_platform_data dreamplug_led_data = { | ||
113 | .leds = dreamplug_led_pins, | ||
114 | .num_leds = ARRAY_SIZE(dreamplug_led_pins), | ||
115 | }; | ||
116 | |||
117 | static struct platform_device dreamplug_leds = { | ||
118 | .name = "leds-gpio", | ||
119 | .id = -1, | ||
120 | .dev = { | ||
121 | .platform_data = &dreamplug_led_data, | ||
122 | } | ||
123 | }; | ||
124 | |||
125 | static unsigned int dreamplug_mpp_config[] __initdata = { | ||
126 | MPP0_SPI_SCn, | ||
127 | MPP1_SPI_MOSI, | ||
128 | MPP2_SPI_SCK, | ||
129 | MPP3_SPI_MISO, | ||
130 | MPP47_GPIO, /* Bluetooth LED */ | ||
131 | MPP48_GPIO, /* Wifi LED */ | ||
132 | MPP49_GPIO, /* Wifi AP LED */ | ||
133 | 0 | ||
134 | }; | ||
135 | |||
136 | static void __init dreamplug_init(void) | ||
137 | { | 28 | { |
29 | pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk); | ||
30 | |||
138 | /* | 31 | /* |
139 | * Basic setup. Needs to be called early. | 32 | * Disable propagation of mbus errors to the CPU local bus, |
33 | * as this causes mbus errors (which can occur for example | ||
34 | * for PCI aborts) to throw CPU aborts, which we're not set | ||
35 | * up to deal with. | ||
140 | */ | 36 | */ |
141 | kirkwood_mpp_conf(dreamplug_mpp_config); | 37 | writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
142 | 38 | ||
143 | spi_register_board_info(dreamplug_spi_slave_info, | 39 | kirkwood_setup_cpu_mbus(); |
144 | ARRAY_SIZE(dreamplug_spi_slave_info)); | ||
145 | kirkwood_spi_init(); | ||
146 | 40 | ||
147 | kirkwood_ehci_init(); | 41 | #ifdef CONFIG_CACHE_FEROCEON_L2 |
148 | kirkwood_ge00_init(&dreamplug_ge00_data); | 42 | kirkwood_l2_init(); |
149 | kirkwood_ge01_init(&dreamplug_ge01_data); | 43 | #endif |
150 | kirkwood_sata_init(&dreamplug_sata_data); | ||
151 | kirkwood_sdio_init(&dreamplug_mvsdio_data); | ||
152 | 44 | ||
153 | platform_device_register(&dreamplug_leds); | 45 | /* internal devices that every board has */ |
154 | } | 46 | kirkwood_wdt_init(); |
47 | kirkwood_xor0_init(); | ||
48 | kirkwood_xor1_init(); | ||
49 | kirkwood_crypto_init(); | ||
155 | 50 | ||
156 | static void __init kirkwood_dt_init(void) | 51 | #ifdef CONFIG_KEXEC |
157 | { | 52 | kexec_reinit = kirkwood_enable_pcie; |
158 | kirkwood_init(); | 53 | #endif |
159 | 54 | ||
160 | if (of_machine_is_compatible("globalscale,dreamplug")) | 55 | if (of_machine_is_compatible("globalscale,dreamplug")) |
161 | dreamplug_init(); | 56 | dreamplug_init(); |
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 77d4852e19f2..a02cae881f2f 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -279,7 +279,7 @@ void __init kirkwood_crypto_init(void) | |||
279 | /***************************************************************************** | 279 | /***************************************************************************** |
280 | * XOR0 | 280 | * XOR0 |
281 | ****************************************************************************/ | 281 | ****************************************************************************/ |
282 | static void __init kirkwood_xor0_init(void) | 282 | void __init kirkwood_xor0_init(void) |
283 | { | 283 | { |
284 | kirkwood_clk_ctrl |= CGC_XOR0; | 284 | kirkwood_clk_ctrl |= CGC_XOR0; |
285 | 285 | ||
@@ -291,7 +291,7 @@ static void __init kirkwood_xor0_init(void) | |||
291 | /***************************************************************************** | 291 | /***************************************************************************** |
292 | * XOR1 | 292 | * XOR1 |
293 | ****************************************************************************/ | 293 | ****************************************************************************/ |
294 | static void __init kirkwood_xor1_init(void) | 294 | void __init kirkwood_xor1_init(void) |
295 | { | 295 | { |
296 | kirkwood_clk_ctrl |= CGC_XOR1; | 296 | kirkwood_clk_ctrl |= CGC_XOR1; |
297 | 297 | ||
@@ -303,7 +303,7 @@ static void __init kirkwood_xor1_init(void) | |||
303 | /***************************************************************************** | 303 | /***************************************************************************** |
304 | * Watchdog | 304 | * Watchdog |
305 | ****************************************************************************/ | 305 | ****************************************************************************/ |
306 | static void __init kirkwood_wdt_init(void) | 306 | void __init kirkwood_wdt_init(void) |
307 | { | 307 | { |
308 | orion_wdt_init(kirkwood_tclk); | 308 | orion_wdt_init(kirkwood_tclk); |
309 | } | 309 | } |
@@ -392,7 +392,7 @@ void __init kirkwood_audio_init(void) | |||
392 | /* | 392 | /* |
393 | * Identify device ID and revision. | 393 | * Identify device ID and revision. |
394 | */ | 394 | */ |
395 | static char * __init kirkwood_id(void) | 395 | char * __init kirkwood_id(void) |
396 | { | 396 | { |
397 | u32 dev, rev; | 397 | u32 dev, rev; |
398 | 398 | ||
@@ -435,7 +435,7 @@ static char * __init kirkwood_id(void) | |||
435 | } | 435 | } |
436 | } | 436 | } |
437 | 437 | ||
438 | static void __init kirkwood_l2_init(void) | 438 | void __init kirkwood_l2_init(void) |
439 | { | 439 | { |
440 | #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH | 440 | #ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH |
441 | writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG); | 441 | writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG); |
@@ -450,7 +450,6 @@ void __init kirkwood_init(void) | |||
450 | { | 450 | { |
451 | printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n", | 451 | printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n", |
452 | kirkwood_id(), kirkwood_tclk); | 452 | kirkwood_id(), kirkwood_tclk); |
453 | kirkwood_i2s_data.tclk = kirkwood_tclk; | ||
454 | 453 | ||
455 | /* | 454 | /* |
456 | * Disable propagation of mbus errors to the CPU local bus, | 455 | * Disable propagation of mbus errors to the CPU local bus, |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 9071a397136d..fa8e7689c436 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -51,6 +51,21 @@ void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev | |||
51 | void kirkwood_audio_init(void); | 51 | void kirkwood_audio_init(void); |
52 | void kirkwood_restart(char, const char *); | 52 | void kirkwood_restart(char, const char *); |
53 | 53 | ||
54 | /* board init functions for boards not fully converted to fdt */ | ||
55 | #ifdef CONFIG_MACH_DREAMPLUG_DT | ||
56 | void dreamplug_init(void); | ||
57 | #else | ||
58 | static inline void dreamplug_init(void) {}; | ||
59 | #endif | ||
60 | |||
61 | /* early init functions not converted to fdt yet */ | ||
62 | char *kirkwood_id(void); | ||
63 | void kirkwood_l2_init(void); | ||
64 | void kirkwood_wdt_init(void); | ||
65 | void kirkwood_xor0_init(void); | ||
66 | void kirkwood_xor1_init(void); | ||
67 | void kirkwood_crypto_init(void); | ||
68 | |||
54 | extern int kirkwood_tclk; | 69 | extern int kirkwood_tclk; |
55 | extern struct sys_timer kirkwood_timer; | 70 | extern struct sys_timer kirkwood_timer; |
56 | 71 | ||
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 089899a7db72..74daf5ed1432 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <plat/orion_wdt.h> | 21 | #include <plat/orion_wdt.h> |
22 | #include <plat/mv_xor.h> | 22 | #include <plat/mv_xor.h> |
23 | #include <plat/ehci-orion.h> | 23 | #include <plat/ehci-orion.h> |
24 | #include <mach/bridge-regs.h> | ||
24 | 25 | ||
25 | /* Fill in the resources structure and link it into the platform | 26 | /* Fill in the resources structure and link it into the platform |
26 | device structure. There is always a memory region, and nearly | 27 | device structure. There is always a memory region, and nearly |
@@ -568,13 +569,17 @@ void __init orion_spi_1_init(unsigned long mapbase, | |||
568 | ****************************************************************************/ | 569 | ****************************************************************************/ |
569 | static struct orion_wdt_platform_data orion_wdt_data; | 570 | static struct orion_wdt_platform_data orion_wdt_data; |
570 | 571 | ||
572 | static struct resource orion_wdt_resource = | ||
573 | DEFINE_RES_MEM(TIMER_VIRT_BASE, 0x28); | ||
574 | |||
571 | static struct platform_device orion_wdt_device = { | 575 | static struct platform_device orion_wdt_device = { |
572 | .name = "orion_wdt", | 576 | .name = "orion_wdt", |
573 | .id = -1, | 577 | .id = -1, |
574 | .dev = { | 578 | .dev = { |
575 | .platform_data = &orion_wdt_data, | 579 | .platform_data = &orion_wdt_data, |
576 | }, | 580 | }, |
577 | .num_resources = 0, | 581 | .resource = &orion_wdt_resource, |
582 | .num_resources = 1, | ||
578 | }; | 583 | }; |
579 | 584 | ||
580 | void __init orion_wdt_init(unsigned long tclk) | 585 | void __init orion_wdt_init(unsigned long tclk) |
diff --git a/arch/arm/plat-orion/include/plat/audio.h b/arch/arm/plat-orion/include/plat/audio.h index 885f8abd927b..d6a55bd2e578 100644 --- a/arch/arm/plat-orion/include/plat/audio.h +++ b/arch/arm/plat-orion/include/plat/audio.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define __PLAT_AUDIO_H | 2 | #define __PLAT_AUDIO_H |
3 | 3 | ||
4 | struct kirkwood_asoc_platform_data { | 4 | struct kirkwood_asoc_platform_data { |
5 | u32 tclk; | ||
6 | int burst; | 5 | int burst; |
7 | }; | 6 | }; |
8 | #endif | 7 | #endif |
diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index 768e2edb9678..0dd8421d41c3 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/of.h> | ||
15 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
16 | #include <linux/gfp.h> | 17 | #include <linux/gfp.h> |
17 | #include <linux/module.h> | 18 | #include <linux/module.h> |
@@ -294,11 +295,19 @@ static int __exit mv_rtc_remove(struct platform_device *pdev) | |||
294 | return 0; | 295 | return 0; |
295 | } | 296 | } |
296 | 297 | ||
298 | #ifdef CONFIG_OF | ||
299 | static struct of_device_id rtc_mv_of_match_table[] = { | ||
300 | { .compatible = "mrvl,orion-rtc", }, | ||
301 | {} | ||
302 | }; | ||
303 | #endif | ||
304 | |||
297 | static struct platform_driver mv_rtc_driver = { | 305 | static struct platform_driver mv_rtc_driver = { |
298 | .remove = __exit_p(mv_rtc_remove), | 306 | .remove = __exit_p(mv_rtc_remove), |
299 | .driver = { | 307 | .driver = { |
300 | .name = "rtc-mv", | 308 | .name = "rtc-mv", |
301 | .owner = THIS_MODULE, | 309 | .owner = THIS_MODULE, |
310 | .of_match_table = of_match_ptr(rtc_mv_of_match_table), | ||
302 | }, | 311 | }, |
303 | }; | 312 | }; |
304 | 313 | ||
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index 13448c832c44..e496f799b7a9 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c | |||
@@ -359,11 +359,6 @@ static int orion_spi_setup(struct spi_device *spi) | |||
359 | 359 | ||
360 | orion_spi = spi_master_get_devdata(spi->master); | 360 | orion_spi = spi_master_get_devdata(spi->master); |
361 | 361 | ||
362 | /* Fix ac timing if required. */ | ||
363 | if (orion_spi->spi_info->enable_clock_fix) | ||
364 | orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG, | ||
365 | (1 << 14)); | ||
366 | |||
367 | if ((spi->max_speed_hz == 0) | 362 | if ((spi->max_speed_hz == 0) |
368 | || (spi->max_speed_hz > orion_spi->max_speed)) | 363 | || (spi->max_speed_hz > orion_spi->max_speed)) |
369 | spi->max_speed_hz = orion_spi->max_speed; | 364 | spi->max_speed_hz = orion_spi->max_speed; |
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 4ad78f868515..1368e4ca3100 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c | |||
@@ -28,9 +28,9 @@ | |||
28 | /* | 28 | /* |
29 | * Watchdog timer block registers. | 29 | * Watchdog timer block registers. |
30 | */ | 30 | */ |
31 | #define TIMER_CTRL (TIMER_VIRT_BASE + 0x0000) | 31 | #define TIMER_CTRL 0x0000 |
32 | #define WDT_EN 0x0010 | 32 | #define WDT_EN 0x0010 |
33 | #define WDT_VAL (TIMER_VIRT_BASE + 0x0024) | 33 | #define WDT_VAL 0x0024 |
34 | 34 | ||
35 | #define WDT_MAX_CYCLE_COUNT 0xffffffff | 35 | #define WDT_MAX_CYCLE_COUNT 0xffffffff |
36 | #define WDT_IN_USE 0 | 36 | #define WDT_IN_USE 0 |
@@ -40,6 +40,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; | |||
40 | static int heartbeat = -1; /* module parameter (seconds) */ | 40 | static int heartbeat = -1; /* module parameter (seconds) */ |
41 | static unsigned int wdt_max_duration; /* (seconds) */ | 41 | static unsigned int wdt_max_duration; /* (seconds) */ |
42 | static unsigned int wdt_tclk; | 42 | static unsigned int wdt_tclk; |
43 | static void __iomem *wdt_reg; | ||
43 | static unsigned long wdt_status; | 44 | static unsigned long wdt_status; |
44 | static DEFINE_SPINLOCK(wdt_lock); | 45 | static DEFINE_SPINLOCK(wdt_lock); |
45 | 46 | ||
@@ -48,7 +49,7 @@ static void orion_wdt_ping(void) | |||
48 | spin_lock(&wdt_lock); | 49 | spin_lock(&wdt_lock); |
49 | 50 | ||
50 | /* Reload watchdog duration */ | 51 | /* Reload watchdog duration */ |
51 | writel(wdt_tclk * heartbeat, WDT_VAL); | 52 | writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL); |
52 | 53 | ||
53 | spin_unlock(&wdt_lock); | 54 | spin_unlock(&wdt_lock); |
54 | } | 55 | } |
@@ -60,7 +61,7 @@ static void orion_wdt_enable(void) | |||
60 | spin_lock(&wdt_lock); | 61 | spin_lock(&wdt_lock); |
61 | 62 | ||
62 | /* Set watchdog duration */ | 63 | /* Set watchdog duration */ |
63 | writel(wdt_tclk * heartbeat, WDT_VAL); | 64 | writel(wdt_tclk * heartbeat, wdt_reg + WDT_VAL); |
64 | 65 | ||
65 | /* Clear watchdog timer interrupt */ | 66 | /* Clear watchdog timer interrupt */ |
66 | reg = readl(BRIDGE_CAUSE); | 67 | reg = readl(BRIDGE_CAUSE); |
@@ -68,9 +69,9 @@ static void orion_wdt_enable(void) | |||
68 | writel(reg, BRIDGE_CAUSE); | 69 | writel(reg, BRIDGE_CAUSE); |
69 | 70 | ||
70 | /* Enable watchdog timer */ | 71 | /* Enable watchdog timer */ |
71 | reg = readl(TIMER_CTRL); | 72 | reg = readl(wdt_reg + TIMER_CTRL); |
72 | reg |= WDT_EN; | 73 | reg |= WDT_EN; |
73 | writel(reg, TIMER_CTRL); | 74 | writel(reg, wdt_reg + TIMER_CTRL); |
74 | 75 | ||
75 | /* Enable reset on watchdog */ | 76 | /* Enable reset on watchdog */ |
76 | reg = readl(RSTOUTn_MASK); | 77 | reg = readl(RSTOUTn_MASK); |
@@ -92,9 +93,9 @@ static void orion_wdt_disable(void) | |||
92 | writel(reg, RSTOUTn_MASK); | 93 | writel(reg, RSTOUTn_MASK); |
93 | 94 | ||
94 | /* Disable watchdog timer */ | 95 | /* Disable watchdog timer */ |
95 | reg = readl(TIMER_CTRL); | 96 | reg = readl(wdt_reg + TIMER_CTRL); |
96 | reg &= ~WDT_EN; | 97 | reg &= ~WDT_EN; |
97 | writel(reg, TIMER_CTRL); | 98 | writel(reg, wdt_reg + TIMER_CTRL); |
98 | 99 | ||
99 | spin_unlock(&wdt_lock); | 100 | spin_unlock(&wdt_lock); |
100 | } | 101 | } |
@@ -102,7 +103,7 @@ static void orion_wdt_disable(void) | |||
102 | static int orion_wdt_get_timeleft(int *time_left) | 103 | static int orion_wdt_get_timeleft(int *time_left) |
103 | { | 104 | { |
104 | spin_lock(&wdt_lock); | 105 | spin_lock(&wdt_lock); |
105 | *time_left = readl(WDT_VAL) / wdt_tclk; | 106 | *time_left = readl(wdt_reg + WDT_VAL) / wdt_tclk; |
106 | spin_unlock(&wdt_lock); | 107 | spin_unlock(&wdt_lock); |
107 | return 0; | 108 | return 0; |
108 | } | 109 | } |
@@ -236,6 +237,7 @@ static struct miscdevice orion_wdt_miscdev = { | |||
236 | static int __devinit orion_wdt_probe(struct platform_device *pdev) | 237 | static int __devinit orion_wdt_probe(struct platform_device *pdev) |
237 | { | 238 | { |
238 | struct orion_wdt_platform_data *pdata = pdev->dev.platform_data; | 239 | struct orion_wdt_platform_data *pdata = pdev->dev.platform_data; |
240 | struct resource *res; | ||
239 | int ret; | 241 | int ret; |
240 | 242 | ||
241 | if (pdata) { | 243 | if (pdata) { |
@@ -245,6 +247,10 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev) | |||
245 | return -ENODEV; | 247 | return -ENODEV; |
246 | } | 248 | } |
247 | 249 | ||
250 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
251 | |||
252 | wdt_reg = ioremap(res->start, resource_size(res)); | ||
253 | |||
248 | if (orion_wdt_miscdev.parent) | 254 | if (orion_wdt_miscdev.parent) |
249 | return -EBUSY; | 255 | return -EBUSY; |
250 | orion_wdt_miscdev.parent = &pdev->dev; | 256 | orion_wdt_miscdev.parent = &pdev->dev; |
diff --git a/include/linux/spi/orion_spi.h b/include/linux/spi/orion_spi.h index decf6d8c77b7..b4d9fa6f797c 100644 --- a/include/linux/spi/orion_spi.h +++ b/include/linux/spi/orion_spi.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | struct orion_spi_info { | 12 | struct orion_spi_info { |
13 | u32 tclk; /* no <linux/clk.h> support yet */ | 13 | u32 tclk; /* no <linux/clk.h> support yet */ |
14 | u32 enable_clock_fix; | ||
15 | }; | 14 | }; |
16 | 15 | ||
17 | 16 | ||