diff options
author | Olof Johansson <olof@lixom.net> | 2012-11-26 04:09:30 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-11-26 04:09:53 -0500 |
commit | 0dfeada90989833d0144b4df25d2b9ce3746624f (patch) | |
tree | 0773c2f81a94ca99b8b07b0d984754c81fdd16cc /arch | |
parent | d408c5dcc524dfc8e687c443719a3d6be86e2ea0 (diff) | |
parent | 2a18588c0ce336933be3c99c91e74e21db56a0fe (diff) |
Merge tag 'orion_dt_for_3.8' of git://git.infradead.org/users/jcooper/linux into next/dt
From Jason Cooper:
orion dt for v3.8
- ehci-orion dt binding
- gpio-poweroff
- use dt regulators
- move mpp to DT/pinctrl
Depends on:
- orion/boards
- merge conflicts
- keep all 'select's in Kconfig
- remove all #includes in board-*.c
- pinctrl/devel up to:
- 06763c7 pinctrl: mvebu: move to its own directory
* tag 'orion_dt_for_3.8' of git://git.infradead.org/users/jcooper/linux: (211 commits)
ARM: Kirkwood: remove kirkwood_ehci_init() from new boards
ARM: Kirkwood: Add support LED of OpenBlocks A6
ARM: Kirkwood: Convert to EHCI via DT for OpenBlocks A6
ARM: kirkwood: Add NAND partiton map for OpenBlocks A6
ARM: kirkwood: Add support second I2C bus and RTC on OpenBlocks A6
ARM: kirkwood: Add support DT of second I2C bus
ARM: kirkwood: Convert mplcec4 board to pinctrl
ARM: Kirkwood: Convert km_kirkwood to pinctrl
ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl
ARM: Kirkwood: Convert IX2-200 to pinctrl.
ARM: Kirkwood: Convert lsxl boards to pinctrl.
ARM: Kirkwood: Convert ib62x0 to pinctrl.
ARM: Kirkwood: Convert GoFlex Net to pinctrl.
ARM: Kirkwood: Convert dreamplug to pinctrl.
ARM: Kirkwood: Convert dockstar to pinctrl.
ARM: Kirkwood: Convert dnskw to pinctrl
ARM: Kirkwood: Convert iConnect to pinctrl.
ARM: Kirkwood: Convert TS219 to pinctrl.
ARM: Kirkwood: Add DTSI files for pinctrl
ARM: Kirkwood: Make use of mvebu pincltl and gpio drivers
...
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch')
125 files changed, 3315 insertions, 971 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index dbbe74c10b1c..f88fce5e9772 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -523,6 +523,8 @@ config ARCH_DOVE | |||
523 | select CPU_V7 | 523 | select CPU_V7 |
524 | select GENERIC_CLOCKEVENTS | 524 | select GENERIC_CLOCKEVENTS |
525 | select MIGHT_HAVE_PCI | 525 | select MIGHT_HAVE_PCI |
526 | select PINCTRL | ||
527 | select PINCTRL_DOVE | ||
526 | select PLAT_ORION_LEGACY | 528 | select PLAT_ORION_LEGACY |
527 | select USB_ARCH_HAS_EHCI | 529 | select USB_ARCH_HAS_EHCI |
528 | help | 530 | help |
@@ -534,6 +536,8 @@ config ARCH_KIRKWOOD | |||
534 | select CPU_FEROCEON | 536 | select CPU_FEROCEON |
535 | select GENERIC_CLOCKEVENTS | 537 | select GENERIC_CLOCKEVENTS |
536 | select PCI | 538 | select PCI |
539 | select PINCTRL | ||
540 | select PINCTRL_KIRKWOOD | ||
537 | select PLAT_ORION_LEGACY | 541 | select PLAT_ORION_LEGACY |
538 | help | 542 | help |
539 | Support for the following Marvell Kirkwood series SoCs: | 543 | Support for the following Marvell Kirkwood series SoCs: |
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index f2aa09eb658e..9137df539b61 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
@@ -33,7 +33,7 @@ ifeq ($(CONFIG_XIP_KERNEL),y) | |||
33 | 33 | ||
34 | $(obj)/xipImage: vmlinux FORCE | 34 | $(obj)/xipImage: vmlinux FORCE |
35 | $(call if_changed,objcopy) | 35 | $(call if_changed,objcopy) |
36 | $(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' | 36 | @$(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' |
37 | 37 | ||
38 | $(obj)/Image $(obj)/zImage: FORCE | 38 | $(obj)/Image $(obj)/zImage: FORCE |
39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' | 39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
@@ -48,14 +48,14 @@ $(obj)/xipImage: FORCE | |||
48 | 48 | ||
49 | $(obj)/Image: vmlinux FORCE | 49 | $(obj)/Image: vmlinux FORCE |
50 | $(call if_changed,objcopy) | 50 | $(call if_changed,objcopy) |
51 | $(kecho) ' Kernel: $@ is ready' | 51 | @$(kecho) ' Kernel: $@ is ready' |
52 | 52 | ||
53 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE | 53 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
54 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 54 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
55 | 55 | ||
56 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | 56 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
57 | $(call if_changed,objcopy) | 57 | $(call if_changed,objcopy) |
58 | $(kecho) ' Kernel: $@ is ready' | 58 | @$(kecho) ' Kernel: $@ is ready' |
59 | 59 | ||
60 | endif | 60 | endif |
61 | 61 | ||
@@ -90,7 +90,7 @@ fi | |||
90 | $(obj)/uImage: $(obj)/zImage FORCE | 90 | $(obj)/uImage: $(obj)/zImage FORCE |
91 | @$(check_for_multiple_loadaddr) | 91 | @$(check_for_multiple_loadaddr) |
92 | $(call if_changed,uimage) | 92 | $(call if_changed,uimage) |
93 | $(kecho) ' Image $@ is ready' | 93 | @$(kecho) ' Image $@ is ready' |
94 | 94 | ||
95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE | 95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ | 96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
@@ -98,7 +98,7 @@ $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE | |||
98 | 98 | ||
99 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE | 99 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
100 | $(call if_changed,objcopy) | 100 | $(call if_changed,objcopy) |
101 | $(kecho) ' Kernel: $@ is ready' | 101 | @$(kecho) ' Kernel: $@ is ready' |
102 | 102 | ||
103 | PHONY += initrd FORCE | 103 | PHONY += initrd FORCE |
104 | initrd: | 104 | initrd: |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index a31211904e91..d9cf7340572f 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -40,11 +40,20 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ | |||
40 | kirkwood-ib62x0.dtb \ | 40 | kirkwood-ib62x0.dtb \ |
41 | kirkwood-iconnect.dtb \ | 41 | kirkwood-iconnect.dtb \ |
42 | kirkwood-iomega_ix2_200.dtb \ | 42 | kirkwood-iomega_ix2_200.dtb \ |
43 | kirkwood-is2.dtb \ | ||
43 | kirkwood-km_kirkwood.dtb \ | 44 | kirkwood-km_kirkwood.dtb \ |
44 | kirkwood-lschlv2.dtb \ | 45 | kirkwood-lschlv2.dtb \ |
45 | kirkwood-lsxhl.dtb \ | 46 | kirkwood-lsxhl.dtb \ |
47 | kirkwood-mplcec4.dtb \ | ||
48 | kirkwood-ns2.dtb \ | ||
49 | kirkwood-ns2lite.dtb \ | ||
50 | kirkwood-ns2max.dtb \ | ||
51 | kirkwood-ns2mini.dtb \ | ||
52 | kirkwood-nsa310.dtb \ | ||
53 | kirkwood-topkick.dtb \ | ||
46 | kirkwood-ts219-6281.dtb \ | 54 | kirkwood-ts219-6281.dtb \ |
47 | kirkwood-ts219-6282.dtb | 55 | kirkwood-ts219-6282.dtb \ |
56 | kirkwood-openblocks_a6.dtb | ||
48 | dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ | 57 | dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ |
49 | msm8960-cdp.dtb | 58 | msm8960-cdp.dtb |
50 | dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ | 59 | dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ |
@@ -83,6 +92,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ | |||
83 | am335x-evm.dtb \ | 92 | am335x-evm.dtb \ |
84 | am335x-evmsk.dtb \ | 93 | am335x-evmsk.dtb \ |
85 | am335x-bone.dtb | 94 | am335x-bone.dtb |
95 | dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb | ||
86 | dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb | 96 | dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb |
87 | dtb-$(CONFIG_ARCH_U8500) += snowball.dtb | 97 | dtb-$(CONFIG_ARCH_U8500) += snowball.dtb |
88 | dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ | 98 | dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ |
diff --git a/arch/arm/boot/dts/dove-cubox.dts b/arch/arm/boot/dts/dove-cubox.dts index 0adbd5a38095..fed7d3f9f431 100644 --- a/arch/arm/boot/dts/dove-cubox.dts +++ b/arch/arm/boot/dts/dove-cubox.dts | |||
@@ -40,3 +40,13 @@ | |||
40 | reg = <0>; | 40 | reg = <0>; |
41 | }; | 41 | }; |
42 | }; | 42 | }; |
43 | |||
44 | &pinctrl { | ||
45 | pinctrl-0 = <&pmx_gpio_18>; | ||
46 | pinctrl-names = "default"; | ||
47 | |||
48 | pmx_gpio_18: pmx-gpio-18 { | ||
49 | marvell,pins = "mpp18"; | ||
50 | marvell,function = "gpio"; | ||
51 | }; | ||
52 | }; | ||
diff --git a/arch/arm/boot/dts/dove.dtsi b/arch/arm/boot/dts/dove.dtsi index 5a00022383e7..61f391412a5a 100644 --- a/arch/arm/boot/dts/dove.dtsi +++ b/arch/arm/boot/dts/dove.dtsi | |||
@@ -4,6 +4,12 @@ | |||
4 | compatible = "marvell,dove"; | 4 | compatible = "marvell,dove"; |
5 | model = "Marvell Armada 88AP510 SoC"; | 5 | model = "Marvell Armada 88AP510 SoC"; |
6 | 6 | ||
7 | aliases { | ||
8 | gpio0 = &gpio0; | ||
9 | gpio1 = &gpio1; | ||
10 | gpio2 = &gpio2; | ||
11 | }; | ||
12 | |||
7 | soc@f1000000 { | 13 | soc@f1000000 { |
8 | compatible = "simple-bus"; | 14 | compatible = "simple-bus"; |
9 | #address-cells = <1>; | 15 | #address-cells = <1>; |
@@ -72,7 +78,8 @@ | |||
72 | #gpio-cells = <2>; | 78 | #gpio-cells = <2>; |
73 | gpio-controller; | 79 | gpio-controller; |
74 | reg = <0xd0400 0x20>; | 80 | reg = <0xd0400 0x20>; |
75 | ngpio = <32>; | 81 | ngpios = <32>; |
82 | interrupt-controller; | ||
76 | interrupts = <12>, <13>, <14>, <60>; | 83 | interrupts = <12>, <13>, <14>, <60>; |
77 | }; | 84 | }; |
78 | 85 | ||
@@ -81,7 +88,8 @@ | |||
81 | #gpio-cells = <2>; | 88 | #gpio-cells = <2>; |
82 | gpio-controller; | 89 | gpio-controller; |
83 | reg = <0xd0420 0x20>; | 90 | reg = <0xd0420 0x20>; |
84 | ngpio = <32>; | 91 | ngpios = <32>; |
92 | interrupt-controller; | ||
85 | interrupts = <61>; | 93 | interrupts = <61>; |
86 | }; | 94 | }; |
87 | 95 | ||
@@ -90,7 +98,12 @@ | |||
90 | #gpio-cells = <2>; | 98 | #gpio-cells = <2>; |
91 | gpio-controller; | 99 | gpio-controller; |
92 | reg = <0xe8400 0x0c>; | 100 | reg = <0xe8400 0x0c>; |
93 | ngpio = <8>; | 101 | ngpios = <8>; |
102 | }; | ||
103 | |||
104 | pinctrl: pinctrl@d0200 { | ||
105 | compatible = "marvell,dove-pinctrl"; | ||
106 | reg = <0xd0200 0x10>; | ||
94 | }; | 107 | }; |
95 | 108 | ||
96 | spi0: spi@10600 { | 109 | spi0: spi@10600 { |
diff --git a/arch/arm/boot/dts/kirkwood-6281.dtsi b/arch/arm/boot/dts/kirkwood-6281.dtsi new file mode 100644 index 000000000000..d6c9d65cbaeb --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-6281.dtsi | |||
@@ -0,0 +1,44 @@ | |||
1 | / { | ||
2 | ocp@f1000000 { | ||
3 | pinctrl: pinctrl@10000 { | ||
4 | compatible = "marvell,88f6281-pinctrl"; | ||
5 | reg = <0x10000 0x20>; | ||
6 | |||
7 | pmx_nand: pmx-nand { | ||
8 | marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3", | ||
9 | "mpp4", "mpp5", "mpp18", | ||
10 | "mpp19"; | ||
11 | marvell,function = "nand"; | ||
12 | }; | ||
13 | pmx_sata0: pmx-sata0 { | ||
14 | marvell,pins = "mpp5", "mpp21", "mpp23"; | ||
15 | marvell,function = "sata0"; | ||
16 | }; | ||
17 | pmx_sata1: pmx-sata1 { | ||
18 | marvell,pins = "mpp4", "mpp20", "mpp22"; | ||
19 | marvell,function = "sata1"; | ||
20 | }; | ||
21 | pmx_spi: pmx-spi { | ||
22 | marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; | ||
23 | marvell,function = "spi"; | ||
24 | }; | ||
25 | pmx_twsi0: pmx-twsi0 { | ||
26 | marvell,pins = "mpp8", "mpp9"; | ||
27 | marvell,function = "twsi0"; | ||
28 | }; | ||
29 | pmx_uart0: pmx-uart0 { | ||
30 | marvell,pins = "mpp10", "mpp11"; | ||
31 | marvell,function = "uart0"; | ||
32 | }; | ||
33 | pmx_uart1: pmx-uart1 { | ||
34 | marvell,pins = "mpp13", "mpp14"; | ||
35 | marvell,function = "uart1"; | ||
36 | }; | ||
37 | pmx_sdio: pmx-sdio { | ||
38 | marvell,pins = "mpp12", "mpp13", "mpp14", | ||
39 | "mpp15", "mpp16", "mpp17"; | ||
40 | marvell,function = "sdio"; | ||
41 | }; | ||
42 | }; | ||
43 | }; | ||
44 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-6282.dtsi b/arch/arm/boot/dts/kirkwood-6282.dtsi new file mode 100644 index 000000000000..9ae2004d5675 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-6282.dtsi | |||
@@ -0,0 +1,45 @@ | |||
1 | / { | ||
2 | ocp@f1000000 { | ||
3 | |||
4 | pinctrl: pinctrl@10000 { | ||
5 | compatible = "marvell,88f6282-pinctrl"; | ||
6 | reg = <0x10000 0x20>; | ||
7 | |||
8 | pmx_sata0: pmx-sata0 { | ||
9 | marvell,pins = "mpp5", "mpp21", "mpp23"; | ||
10 | marvell,function = "sata0"; | ||
11 | }; | ||
12 | pmx_sata1: pmx-sata1 { | ||
13 | marvell,pins = "mpp4", "mpp20", "mpp22"; | ||
14 | marvell,function = "sata1"; | ||
15 | }; | ||
16 | pmx_spi: pmx-spi { | ||
17 | marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; | ||
18 | marvell,function = "spi"; | ||
19 | }; | ||
20 | pmx_twsi0: pmx-twsi0 { | ||
21 | marvell,pins = "mpp8", "mpp9"; | ||
22 | marvell,function = "twsi0"; | ||
23 | }; | ||
24 | pmx_uart0: pmx-uart0 { | ||
25 | marvell,pins = "mpp10", "mpp11"; | ||
26 | marvell,function = "uart0"; | ||
27 | }; | ||
28 | |||
29 | pmx_uart1: pmx-uart1 { | ||
30 | marvell,pins = "mpp13", "mpp14"; | ||
31 | marvell,function = "uart1"; | ||
32 | }; | ||
33 | }; | ||
34 | |||
35 | i2c@11100 { | ||
36 | compatible = "marvell,mv64xxx-i2c"; | ||
37 | reg = <0x11100 0x20>; | ||
38 | #address-cells = <1>; | ||
39 | #size-cells = <0>; | ||
40 | interrupts = <32>; | ||
41 | clock-frequency = <100000>; | ||
42 | status = "disabled"; | ||
43 | }; | ||
44 | }; | ||
45 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-98dx4122.dtsi b/arch/arm/boot/dts/kirkwood-98dx4122.dtsi new file mode 100644 index 000000000000..3271e4c8ea07 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-98dx4122.dtsi | |||
@@ -0,0 +1,31 @@ | |||
1 | / { | ||
2 | ocp@f1000000 { | ||
3 | pinctrl: pinctrl@10000 { | ||
4 | compatible = "marvell,98dx4122-pinctrl"; | ||
5 | reg = <0x10000 0x20>; | ||
6 | |||
7 | pmx_nand: pmx-nand { | ||
8 | marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3", | ||
9 | "mpp4", "mpp5", "mpp18", | ||
10 | "mpp19"; | ||
11 | marvell,function = "nand"; | ||
12 | }; | ||
13 | pmx_spi: pmx-spi { | ||
14 | marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; | ||
15 | marvell,function = "spi"; | ||
16 | }; | ||
17 | pmx_twsi0: pmx-twsi0 { | ||
18 | marvell,pins = "mpp8", "mpp9"; | ||
19 | marvell,function = "twsi0"; | ||
20 | }; | ||
21 | pmx_uart0: pmx-uart0 { | ||
22 | marvell,pins = "mpp10", "mpp11"; | ||
23 | marvell,function = "uart0"; | ||
24 | }; | ||
25 | pmx_uart1: pmx-uart1 { | ||
26 | marvell,pins = "mpp13", "mpp14"; | ||
27 | marvell,function = "uart1"; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
31 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi index 9b32d0272825..6875ac00c174 100644 --- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi +++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi | |||
@@ -1,4 +1,5 @@ | |||
1 | /include/ "kirkwood.dtsi" | 1 | /include/ "kirkwood.dtsi" |
2 | /include/ "kirkwood-6281.dtsi" | ||
2 | 3 | ||
3 | / { | 4 | / { |
4 | model = "D-Link DNS NASes (kirkwood-based)"; | 5 | model = "D-Link DNS NASes (kirkwood-based)"; |
@@ -35,7 +36,116 @@ | |||
35 | 6000 2>; | 36 | 6000 2>; |
36 | }; | 37 | }; |
37 | 38 | ||
39 | gpio_poweroff { | ||
40 | compatible = "gpio-poweroff"; | ||
41 | gpios = <&gpio1 4 0>; | ||
42 | }; | ||
43 | |||
38 | ocp@f1000000 { | 44 | ocp@f1000000 { |
45 | pinctrl: pinctrl@10000 { | ||
46 | |||
47 | pinctrl-0 = < &pmx_nand &pmx_uart1 | ||
48 | &pmx_sata0 &pmx_sata1 | ||
49 | &pmx_led_power | ||
50 | &pmx_led_red_right_hdd | ||
51 | &pmx_led_red_left_hdd | ||
52 | &pmx_led_red_usb_325 | ||
53 | &pmx_button_power | ||
54 | &pmx_led_red_usb_320 | ||
55 | &pmx_power_off &pmx_power_back_on | ||
56 | &pmx_power_sata0 &pmx_power_sata1 | ||
57 | &pmx_present_sata0 &pmx_present_sata1 | ||
58 | &pmx_led_white_usb &pmx_fan_tacho | ||
59 | &pmx_fan_high_speed &pmx_fan_low_speed | ||
60 | &pmx_button_unmount &pmx_button_reset | ||
61 | &pmx_temp_alarm >; | ||
62 | pinctrl-names = "default"; | ||
63 | |||
64 | pmx_sata0: pmx-sata0 { | ||
65 | marvell,pins = "mpp20"; | ||
66 | marvell,function = "sata1"; | ||
67 | }; | ||
68 | pmx_sata1: pmx-sata1 { | ||
69 | marvell,pins = "mpp21"; | ||
70 | marvell,function = "sata0"; | ||
71 | }; | ||
72 | pmx_led_power: pmx-led-power { | ||
73 | marvell,pins = "mpp26"; | ||
74 | marvell,function = "gpio"; | ||
75 | }; | ||
76 | pmx_led_red_right_hdd: pmx-led-red-right-hdd { | ||
77 | marvell,pins = "mpp27"; | ||
78 | marvell,function = "gpio"; | ||
79 | }; | ||
80 | pmx_led_red_left_hdd: pmx-led-red-left-hdd { | ||
81 | marvell,pins = "mpp28"; | ||
82 | marvell,function = "gpio"; | ||
83 | }; | ||
84 | pmx_led_red_usb_325: pmx-led-red-usb-325 { | ||
85 | marvell,pins = "mpp29"; | ||
86 | marvell,function = "gpio"; | ||
87 | }; | ||
88 | pmx_button_power: pmx-button-power { | ||
89 | marvell,pins = "mpp34"; | ||
90 | marvell,function = "gpio"; | ||
91 | }; | ||
92 | pmx_led_red_usb_320: pmx-led-red-usb-320 { | ||
93 | marvell,pins = "mpp35"; | ||
94 | marvell,function = "gpio"; | ||
95 | }; | ||
96 | pmx_power_off: pmx-power-off { | ||
97 | marvell,pins = "mpp36"; | ||
98 | marvell,function = "gpio"; | ||
99 | }; | ||
100 | pmx_power_back_on: pmx-power-back-on { | ||
101 | marvell,pins = "mpp37"; | ||
102 | marvell,function = "gpio"; | ||
103 | }; | ||
104 | pmx_power_sata0: pmx-power-sata0 { | ||
105 | marvell,pins = "mpp39"; | ||
106 | marvell,function = "gpio"; | ||
107 | }; | ||
108 | pmx_power_sata1: pmx-power-sata1 { | ||
109 | marvell,pins = "mpp40"; | ||
110 | marvell,function = "gpio"; | ||
111 | }; | ||
112 | pmx_present_sata0: pmx-present-sata0 { | ||
113 | marvell,pins = "mpp41"; | ||
114 | marvell,function = "gpio"; | ||
115 | }; | ||
116 | pmx_present_sata1: pmx-present-sata1 { | ||
117 | marvell,pins = "mpp42"; | ||
118 | marvell,function = "gpio"; | ||
119 | }; | ||
120 | pmx_led_white_usb: pmx-led-white-usb { | ||
121 | marvell,pins = "mpp43"; | ||
122 | marvell,function = "gpio"; | ||
123 | }; | ||
124 | pmx_fan_tacho: pmx-fan-tacho { | ||
125 | marvell,pins = "mpp44"; | ||
126 | marvell,function = "gpio"; | ||
127 | }; | ||
128 | pmx_fan_high_speed: pmx-fan-high-speed { | ||
129 | marvell,pins = "mpp45"; | ||
130 | marvell,function = "gpio"; | ||
131 | }; | ||
132 | pmx_fan_low_speed: pmx-fan-low-speed { | ||
133 | marvell,pins = "mpp46"; | ||
134 | marvell,function = "gpio"; | ||
135 | }; | ||
136 | pmx_button_unmount: pmx-button-unmount { | ||
137 | marvell,pins = "mpp47"; | ||
138 | marvell,function = "gpio"; | ||
139 | }; | ||
140 | pmx_button_reset: pmx-button-reset { | ||
141 | marvell,pins = "mpp48"; | ||
142 | marvell,function = "gpio"; | ||
143 | }; | ||
144 | pmx_temp_alarm: pmx-temp-alarm { | ||
145 | marvell,pins = "mpp49"; | ||
146 | marvell,function = "gpio"; | ||
147 | }; | ||
148 | }; | ||
39 | sata@80000 { | 149 | sata@80000 { |
40 | status = "okay"; | 150 | status = "okay"; |
41 | nr-ports = <2>; | 151 | nr-ports = <2>; |
@@ -43,6 +153,7 @@ | |||
43 | 153 | ||
44 | nand@3000000 { | 154 | nand@3000000 { |
45 | status = "okay"; | 155 | status = "okay"; |
156 | chip-delay = <35>; | ||
46 | 157 | ||
47 | partition@0 { | 158 | partition@0 { |
48 | label = "u-boot"; | 159 | label = "u-boot"; |
@@ -76,4 +187,33 @@ | |||
76 | }; | 187 | }; |
77 | }; | 188 | }; |
78 | }; | 189 | }; |
190 | |||
191 | regulators { | ||
192 | compatible = "simple-bus"; | ||
193 | #address-cells = <1>; | ||
194 | #size-cells = <0>; | ||
195 | |||
196 | sata0_power: regulator@1 { | ||
197 | compatible = "regulator-fixed"; | ||
198 | reg = <1>; | ||
199 | regulator-name = "SATA0 Power"; | ||
200 | regulator-min-microvolt = <5000000>; | ||
201 | regulator-max-microvolt = <5000000>; | ||
202 | enable-active-high; | ||
203 | regulator-always-on; | ||
204 | regulator-boot-on; | ||
205 | gpio = <&gpio1 7 0>; | ||
206 | }; | ||
207 | sata1_power: regulator@2 { | ||
208 | compatible = "regulator-fixed"; | ||
209 | reg = <2>; | ||
210 | regulator-name = "SATA1 Power"; | ||
211 | regulator-min-microvolt = <5000000>; | ||
212 | regulator-max-microvolt = <5000000>; | ||
213 | enable-active-high; | ||
214 | regulator-always-on; | ||
215 | regulator-boot-on; | ||
216 | gpio = <&gpio1 8 0>; | ||
217 | }; | ||
218 | }; | ||
79 | }; | 219 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-dockstar.dts b/arch/arm/boot/dts/kirkwood-dockstar.dts index 08a582414b88..2e3dd34e21a5 100644 --- a/arch/arm/boot/dts/kirkwood-dockstar.dts +++ b/arch/arm/boot/dts/kirkwood-dockstar.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "Seagate FreeAgent Dockstar"; | 7 | model = "Seagate FreeAgent Dockstar"; |
@@ -16,6 +17,25 @@ | |||
16 | }; | 17 | }; |
17 | 18 | ||
18 | ocp@f1000000 { | 19 | ocp@f1000000 { |
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_usb_power_enable | ||
23 | &pmx_led_green &pmx_led_orange >; | ||
24 | pinctrl-names = "default"; | ||
25 | |||
26 | pmx_usb_power_enable: pmx-usb-power-enable { | ||
27 | marvell,pins = "mpp29"; | ||
28 | marvell,function = "gpio"; | ||
29 | }; | ||
30 | pmx_led_green: pmx-led-green { | ||
31 | marvell,pins = "mpp46"; | ||
32 | marvell,function = "gpio"; | ||
33 | }; | ||
34 | pmx_led_orange: pmx-led-orange { | ||
35 | marvell,pins = "mpp47"; | ||
36 | marvell,function = "gpio"; | ||
37 | }; | ||
38 | }; | ||
19 | serial@12000 { | 39 | serial@12000 { |
20 | clock-frequency = <200000000>; | 40 | clock-frequency = <200000000>; |
21 | status = "ok"; | 41 | status = "ok"; |
@@ -54,4 +74,21 @@ | |||
54 | gpios = <&gpio1 15 1>; | 74 | gpios = <&gpio1 15 1>; |
55 | }; | 75 | }; |
56 | }; | 76 | }; |
77 | regulators { | ||
78 | compatible = "simple-bus"; | ||
79 | #address-cells = <1>; | ||
80 | #size-cells = <0>; | ||
81 | |||
82 | usb_power: regulator@1 { | ||
83 | compatible = "regulator-fixed"; | ||
84 | reg = <1>; | ||
85 | regulator-name = "USB Power"; | ||
86 | regulator-min-microvolt = <5000000>; | ||
87 | regulator-max-microvolt = <5000000>; | ||
88 | enable-active-high; | ||
89 | regulator-always-on; | ||
90 | regulator-boot-on; | ||
91 | gpio = <&gpio0 29 0>; | ||
92 | }; | ||
93 | }; | ||
57 | }; | 94 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts index 26e281fbf6bc..f2d386c95b07 100644 --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "Globalscale Technologies Dreamplug"; | 7 | model = "Globalscale Technologies Dreamplug"; |
@@ -16,6 +17,26 @@ | |||
16 | }; | 17 | }; |
17 | 18 | ||
18 | ocp@f1000000 { | 19 | ocp@f1000000 { |
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_spi | ||
23 | &pmx_led_bluetooth &pmx_led_wifi | ||
24 | &pmx_led_wifi_ap >; | ||
25 | pinctrl-names = "default"; | ||
26 | |||
27 | pmx_led_bluetooth: pmx-led-bluetooth { | ||
28 | marvell,pins = "mpp47"; | ||
29 | marvell,function = "gpio"; | ||
30 | }; | ||
31 | pmx_led_wifi: pmx-led-wifi { | ||
32 | marvell,pins = "mpp48"; | ||
33 | marvell,function = "gpio"; | ||
34 | }; | ||
35 | pmx_led_wifi_ap: pmx-led-wifi-ap { | ||
36 | marvell,pins = "mpp49"; | ||
37 | marvell,function = "gpio"; | ||
38 | }; | ||
39 | }; | ||
19 | serial@12000 { | 40 | serial@12000 { |
20 | clock-frequency = <200000000>; | 41 | clock-frequency = <200000000>; |
21 | status = "ok"; | 42 | status = "ok"; |
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts index 7c8238fbb6f9..1b133e0c566e 100644 --- a/arch/arm/boot/dts/kirkwood-goflexnet.dts +++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "Seagate GoFlex Net"; | 7 | model = "Seagate GoFlex Net"; |
@@ -16,6 +17,61 @@ | |||
16 | }; | 17 | }; |
17 | 18 | ||
18 | ocp@f1000000 { | 19 | ocp@f1000000 { |
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_usb_power_enable &pmx_led_orange | ||
23 | &pmx_led_left_cap_0 &pmx_led_left_cap_1 | ||
24 | &pmx_led_left_cap_2 &pmx_led_left_cap_3 | ||
25 | &pmx_led_right_cap_0 &pmx_led_right_cap_1 | ||
26 | &pmx_led_right_cap_2 &pmx_led_right_cap_3 | ||
27 | >; | ||
28 | pinctrl-names = "default"; | ||
29 | |||
30 | pmx_usb_power_enable: pmx-usb-power-enable { | ||
31 | marvell,pins = "mpp29"; | ||
32 | marvell,function = "gpio"; | ||
33 | }; | ||
34 | pmx_led_right_cap_0: pmx-led_right_cap_0 { | ||
35 | marvell,pins = "mpp38"; | ||
36 | marvell,function = "gpio"; | ||
37 | }; | ||
38 | pmx_led_right_cap_1: pmx-led_right_cap_1 { | ||
39 | marvell,pins = "mpp39"; | ||
40 | marvell,function = "gpio"; | ||
41 | }; | ||
42 | pmx_led_right_cap_2: pmx-led_right_cap_2 { | ||
43 | marvell,pins = "mpp40"; | ||
44 | marvell,function = "gpio"; | ||
45 | }; | ||
46 | pmx_led_right_cap_3: pmx-led_right_cap_3 { | ||
47 | marvell,pins = "mpp41"; | ||
48 | marvell,function = "gpio"; | ||
49 | }; | ||
50 | pmx_led_left_cap_0: pmx-led_left_cap_0 { | ||
51 | marvell,pins = "mpp42"; | ||
52 | marvell,function = "gpio"; | ||
53 | }; | ||
54 | pmx_led_left_cap_1: pmx-led_left_cap_1 { | ||
55 | marvell,pins = "mpp43"; | ||
56 | marvell,function = "gpio"; | ||
57 | }; | ||
58 | pmx_led_left_cap_2: pmx-led_left_cap_2 { | ||
59 | marvell,pins = "mpp44"; | ||
60 | marvell,function = "gpio"; | ||
61 | }; | ||
62 | pmx_led_left_cap_3: pmx-led_left_cap_3 { | ||
63 | marvell,pins = "mpp45"; | ||
64 | marvell,function = "gpio"; | ||
65 | }; | ||
66 | pmx_led_green: pmx-led_green { | ||
67 | marvell,pins = "mpp46"; | ||
68 | marvell,function = "gpio"; | ||
69 | }; | ||
70 | pmx_led_orange: pmx-led_orange { | ||
71 | marvell,pins = "mpp47"; | ||
72 | marvell,function = "gpio"; | ||
73 | }; | ||
74 | }; | ||
19 | serial@12000 { | 75 | serial@12000 { |
20 | clock-frequency = <200000000>; | 76 | clock-frequency = <200000000>; |
21 | status = "ok"; | 77 | status = "ok"; |
@@ -96,4 +152,21 @@ | |||
96 | gpios = <&gpio1 9 0>; | 152 | gpios = <&gpio1 9 0>; |
97 | }; | 153 | }; |
98 | }; | 154 | }; |
155 | regulators { | ||
156 | compatible = "simple-bus"; | ||
157 | #address-cells = <1>; | ||
158 | #size-cells = <0>; | ||
159 | |||
160 | usb_power: regulator@1 { | ||
161 | compatible = "regulator-fixed"; | ||
162 | reg = <1>; | ||
163 | regulator-name = "USB Power"; | ||
164 | regulator-min-microvolt = <5000000>; | ||
165 | regulator-max-microvolt = <5000000>; | ||
166 | enable-active-high; | ||
167 | regulator-always-on; | ||
168 | regulator-boot-on; | ||
169 | gpio = <&gpio0 29 0>; | ||
170 | }; | ||
171 | }; | ||
99 | }; | 172 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts index 66794ed75ff1..71902da33d63 100644 --- a/arch/arm/boot/dts/kirkwood-ib62x0.dts +++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; | 7 | model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; |
@@ -16,6 +17,39 @@ | |||
16 | }; | 17 | }; |
17 | 18 | ||
18 | ocp@f1000000 { | 19 | ocp@f1000000 { |
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_nand | ||
23 | &pmx_led_os_red &pmx_power_off | ||
24 | &pmx_led_os_green &pmx_led_usb_transfer | ||
25 | &pmx_button_reset &pmx_button_usb_copy >; | ||
26 | pinctrl-names = "default"; | ||
27 | |||
28 | pmx_led_os_red: pmx-led-os-red { | ||
29 | marvell,pins = "mpp22"; | ||
30 | marvell,function = "gpio"; | ||
31 | }; | ||
32 | pmx_power_off: pmx-power-off { | ||
33 | marvell,pins = "mpp24"; | ||
34 | marvell,function = "gpio"; | ||
35 | }; | ||
36 | pmx_led_os_green: pmx-led-os-green { | ||
37 | marvell,pins = "mpp25"; | ||
38 | marvell,function = "gpio"; | ||
39 | }; | ||
40 | pmx_led_usb_transfer: pmx-led-usb-transfer { | ||
41 | marvell,pins = "mpp27"; | ||
42 | marvell,function = "gpio"; | ||
43 | }; | ||
44 | pmx_button_reset: pmx-button-reset { | ||
45 | marvell,pins = "mpp28"; | ||
46 | marvell,function = "gpio"; | ||
47 | }; | ||
48 | pmx_button_usb_copy: pmx-button-usb-copy { | ||
49 | marvell,pins = "mpp29"; | ||
50 | marvell,function = "gpio"; | ||
51 | }; | ||
52 | }; | ||
19 | serial@12000 { | 53 | serial@12000 { |
20 | clock-frequency = <200000000>; | 54 | clock-frequency = <200000000>; |
21 | status = "okay"; | 55 | status = "okay"; |
@@ -79,4 +113,10 @@ | |||
79 | gpios = <&gpio0 27 0>; | 113 | gpios = <&gpio0 27 0>; |
80 | }; | 114 | }; |
81 | }; | 115 | }; |
116 | gpio_poweroff { | ||
117 | compatible = "gpio-poweroff"; | ||
118 | gpios = <&gpio0 24 0>; | ||
119 | }; | ||
120 | |||
121 | |||
82 | }; | 122 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts index d97cd9d4753e..504f16be8b54 100644 --- a/arch/arm/boot/dts/kirkwood-iconnect.dts +++ b/arch/arm/boot/dts/kirkwood-iconnect.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "Iomega Iconnect"; | 7 | model = "Iomega Iconnect"; |
@@ -18,6 +19,56 @@ | |||
18 | }; | 19 | }; |
19 | 20 | ||
20 | ocp@f1000000 { | 21 | ocp@f1000000 { |
22 | pinctrl: pinctrl@10000 { | ||
23 | |||
24 | pinctrl-0 = < &pmx_gpio_12 &pmx_gpio_35 | ||
25 | &pmx_gpio_41 &pmx_gpio_42 | ||
26 | &pmx_gpio_43 &pmx_gpio_44 | ||
27 | &pmx_gpio_45 &pmx_gpio_46 | ||
28 | &pmx_gpio_47 &pmx_gpio_48 >; | ||
29 | pinctrl-names = "default"; | ||
30 | |||
31 | pmx_gpio_12: pmx-gpio-12 { | ||
32 | marvell,pins = "mpp12"; | ||
33 | marvell,function = "gpio"; | ||
34 | }; | ||
35 | pmx_gpio_35: pmx-gpio-35 { | ||
36 | marvell,pins = "mpp35"; | ||
37 | marvell,function = "gpio"; | ||
38 | }; | ||
39 | pmx_gpio_41: pmx-gpio-41 { | ||
40 | marvell,pins = "mpp41"; | ||
41 | marvell,function = "gpio"; | ||
42 | }; | ||
43 | pmx_gpio_42: pmx-gpio-42 { | ||
44 | marvell,pins = "mpp42"; | ||
45 | marvell,function = "gpio"; | ||
46 | }; | ||
47 | pmx_gpio_43: pmx-gpio-43 { | ||
48 | marvell,pins = "mpp43"; | ||
49 | marvell,function = "gpio"; | ||
50 | }; | ||
51 | pmx_gpio_44: pmx-gpio-44 { | ||
52 | marvell,pins = "mpp44"; | ||
53 | marvell,function = "gpio"; | ||
54 | }; | ||
55 | pmx_gpio_45: pmx-gpio-45 { | ||
56 | marvell,pins = "mpp45"; | ||
57 | marvell,function = "gpio"; | ||
58 | }; | ||
59 | pmx_gpio_46: pmx-gpio-46 { | ||
60 | marvell,pins = "mpp46"; | ||
61 | marvell,function = "gpio"; | ||
62 | }; | ||
63 | pmx_gpio_47: pmx-gpio-47 { | ||
64 | marvell,pins = "mpp47"; | ||
65 | marvell,function = "gpio"; | ||
66 | }; | ||
67 | pmx_gpio_48: pmx-gpio-48 { | ||
68 | marvell,pins = "mpp48"; | ||
69 | marvell,function = "gpio"; | ||
70 | }; | ||
71 | }; | ||
21 | i2c@11000 { | 72 | i2c@11000 { |
22 | status = "okay"; | 73 | status = "okay"; |
23 | 74 | ||
diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts index 865aeec40a26..6cae4599c4b3 100644 --- a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "Iomega StorCenter ix2-200"; | 7 | model = "Iomega StorCenter ix2-200"; |
@@ -16,6 +17,94 @@ | |||
16 | }; | 17 | }; |
17 | 18 | ||
18 | ocp@f1000000 { | 19 | ocp@f1000000 { |
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_button_reset &pmx_button_power | ||
23 | &pmx_led_backup &pmx_led_power | ||
24 | &pmx_button_otb &pmx_led_rebuild | ||
25 | &pmx_led_health | ||
26 | &pmx_led_sata_brt_ctrl_1 | ||
27 | &pmx_led_sata_brt_ctrl_2 | ||
28 | &pmx_led_backup_brt_ctrl_1 | ||
29 | &pmx_led_backup_brt_ctrl_2 | ||
30 | &pmx_led_power_brt_ctrl_1 | ||
31 | &pmx_led_power_brt_ctrl_2 | ||
32 | &pmx_led_health_brt_ctrl_1 | ||
33 | &pmx_led_health_brt_ctrl_2 | ||
34 | &pmx_led_rebuild_brt_ctrl_1 | ||
35 | &pmx_led_rebuild_brt_ctrl_2 >; | ||
36 | pinctrl-names = "default"; | ||
37 | |||
38 | pmx_button_reset: pmx-button-reset { | ||
39 | marvell,pins = "mpp12"; | ||
40 | marvell,function = "gpio"; | ||
41 | }; | ||
42 | pmx_button_power: pmx-button-power { | ||
43 | marvell,pins = "mpp14"; | ||
44 | marvell,function = "gpio"; | ||
45 | }; | ||
46 | pmx_led_backup: pmx-led-backup { | ||
47 | marvell,pins = "mpp15"; | ||
48 | marvell,function = "gpio"; | ||
49 | }; | ||
50 | pmx_led_power: pmx-led-power { | ||
51 | marvell,pins = "mpp16"; | ||
52 | marvell,function = "gpio"; | ||
53 | }; | ||
54 | pmx_button_otb: pmx-button-otb { | ||
55 | marvell,pins = "mpp35"; | ||
56 | marvell,function = "gpio"; | ||
57 | }; | ||
58 | pmx_led_rebuild: pmx-led-rebuild { | ||
59 | marvell,pins = "mpp36"; | ||
60 | marvell,function = "gpio"; | ||
61 | }; | ||
62 | pmx_led_health: pmx-led_health { | ||
63 | marvell,pins = "mpp37"; | ||
64 | marvell,function = "gpio"; | ||
65 | }; | ||
66 | pmx_led_sata_brt_ctrl_1: pmx-led-sata-brt-ctrl-1 { | ||
67 | marvell,pins = "mpp38"; | ||
68 | marvell,function = "gpio"; | ||
69 | }; | ||
70 | pmx_led_sata_brt_ctrl_2: pmx-led-sata-brt-ctrl-2 { | ||
71 | marvell,pins = "mpp39"; | ||
72 | marvell,function = "gpio"; | ||
73 | }; | ||
74 | pmx_led_backup_brt_ctrl_1: pmx-led-backup-brt-ctrl-1 { | ||
75 | marvell,pins = "mpp40"; | ||
76 | marvell,function = "gpio"; | ||
77 | }; | ||
78 | pmx_led_backup_brt_ctrl_2: pmx-led-backup-brt-ctrl-2 { | ||
79 | marvell,pins = "mpp41"; | ||
80 | marvell,function = "gpio"; | ||
81 | }; | ||
82 | pmx_led_power_brt_ctrl_1: pmx-led-power-brt-ctrl-1 { | ||
83 | marvell,pins = "mpp42"; | ||
84 | marvell,function = "gpio"; | ||
85 | }; | ||
86 | pmx_led_power_brt_ctrl_2: pmx-led-power-brt-ctrl-2 { | ||
87 | marvell,pins = "mpp43"; | ||
88 | marvell,function = "gpio"; | ||
89 | }; | ||
90 | pmx_led_health_brt_ctrl_1: pmx-led-health-brt-ctrl-1 { | ||
91 | marvell,pins = "mpp44"; | ||
92 | marvell,function = "gpio"; | ||
93 | }; | ||
94 | pmx_led_health_brt_ctrl_2: pmx-led-health-brt-ctrl-2 { | ||
95 | marvell,pins = "mpp45"; | ||
96 | marvell,function = "gpio"; | ||
97 | }; | ||
98 | pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 { | ||
99 | marvell,pins = "mpp44"; | ||
100 | marvell,function = "gpio"; | ||
101 | }; | ||
102 | pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 { | ||
103 | marvell,pins = "mpp45"; | ||
104 | marvell,function = "gpio"; | ||
105 | }; | ||
106 | |||
107 | }; | ||
19 | i2c@11000 { | 108 | i2c@11000 { |
20 | status = "okay"; | 109 | status = "okay"; |
21 | 110 | ||
diff --git a/arch/arm/boot/dts/kirkwood-is2.dts b/arch/arm/boot/dts/kirkwood-is2.dts new file mode 100644 index 000000000000..0bdce0ad7277 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-is2.dts | |||
@@ -0,0 +1,30 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Internet Space v2"; | ||
7 | compatible = "lacie,inetspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x8000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <1>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | ns2-leds { | ||
22 | compatible = "lacie,ns2-leds"; | ||
23 | |||
24 | blue-sata { | ||
25 | label = "ns2:blue:sata"; | ||
26 | slow-gpio = <&gpio0 29 0>; | ||
27 | cmd-gpio = <&gpio0 30 0>; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts index 75bdb93fed26..8db3123ac80f 100644 --- a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts +++ b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts | |||
@@ -1,6 +1,7 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood.dtsi" | 3 | /include/ "kirkwood.dtsi" |
4 | /include/ "kirkwood-98dx4122.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
6 | model = "Keymile Kirkwood Reference Design"; | 7 | model = "Keymile Kirkwood Reference Design"; |
@@ -16,6 +17,22 @@ | |||
16 | }; | 17 | }; |
17 | 18 | ||
18 | ocp@f1000000 { | 19 | ocp@f1000000 { |
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_nand &pmx_i2c_gpio_sda | ||
23 | &pmx_i2c_gpio_scl >; | ||
24 | pinctrl-names = "default"; | ||
25 | |||
26 | pmx_i2c_gpio_sda: pmx-gpio-sda { | ||
27 | marvell,pins = "mpp8"; | ||
28 | marvell,function = "gpio"; | ||
29 | }; | ||
30 | pmx_i2c_gpio_scl: pmx-gpio-scl { | ||
31 | marvell,pins = "mpp9"; | ||
32 | marvell,function = "gpio"; | ||
33 | }; | ||
34 | }; | ||
35 | |||
19 | serial@12000 { | 36 | serial@12000 { |
20 | clock-frequency = <200000000>; | 37 | clock-frequency = <200000000>; |
21 | status = "ok"; | 38 | status = "ok"; |
diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi index 8fea375c734d..37d45c4f88fb 100644 --- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi +++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi | |||
@@ -1,4 +1,5 @@ | |||
1 | /include/ "kirkwood.dtsi" | 1 | /include/ "kirkwood.dtsi" |
2 | /include/ "kirkwood-6281.dtsi" | ||
2 | 3 | ||
3 | / { | 4 | / { |
4 | chosen { | 5 | chosen { |
@@ -6,6 +7,71 @@ | |||
6 | }; | 7 | }; |
7 | 8 | ||
8 | ocp@f1000000 { | 9 | ocp@f1000000 { |
10 | pinctrl: pinctrl@10000 { | ||
11 | |||
12 | pinctrl-0 = < &pmx_power_hdd &pmx_usb_vbus | ||
13 | &pmx_fan_low &pmx_fan_high | ||
14 | &pmx_led_function_red &pmx_led_alarm | ||
15 | &pmx_led_info &pmx_led_power | ||
16 | &pmx_fan_lock &pmx_button_function | ||
17 | &pmx_power_switch &pmx_power_auto_switch | ||
18 | &pmx_led_function_blue >; | ||
19 | pinctrl-names = "default"; | ||
20 | |||
21 | pmx_power_hdd: pmx-power-hdd { | ||
22 | marvell,pins = "mpp10"; | ||
23 | marvell,function = "gpo"; | ||
24 | }; | ||
25 | pmx_usb_vbus: pmx-usb-vbus { | ||
26 | marvell,pins = "mpp11"; | ||
27 | marvell,function = "gpio"; | ||
28 | }; | ||
29 | pmx_fan_high: pmx-fan-high { | ||
30 | marvell,pins = "mpp18"; | ||
31 | marvell,function = "gpo"; | ||
32 | }; | ||
33 | pmx_fan_low: pmx-fan-low { | ||
34 | marvell,pins = "mpp19"; | ||
35 | marvell,function = "gpo"; | ||
36 | }; | ||
37 | pmx_led_function_blue: pmx-led-function-blue { | ||
38 | marvell,pins = "mpp36"; | ||
39 | marvell,function = "gpio"; | ||
40 | }; | ||
41 | pmx_led_alarm: pmx-led-alarm { | ||
42 | marvell,pins = "mpp37"; | ||
43 | marvell,function = "gpio"; | ||
44 | }; | ||
45 | pmx_led_info: pmx-led-info { | ||
46 | marvell,pins = "mpp38"; | ||
47 | marvell,function = "gpio"; | ||
48 | }; | ||
49 | pmx_led_power: pmx-led-power { | ||
50 | marvell,pins = "mpp39"; | ||
51 | marvell,function = "gpio"; | ||
52 | }; | ||
53 | pmx_fan_lock: pmx-fan-lock { | ||
54 | marvell,pins = "mpp40"; | ||
55 | marvell,function = "gpio"; | ||
56 | }; | ||
57 | pmx_button_function: pmx-button-function { | ||
58 | marvell,pins = "mpp41"; | ||
59 | marvell,function = "gpio"; | ||
60 | }; | ||
61 | pmx_power_switch: pmx-power-switch { | ||
62 | marvell,pins = "mpp42"; | ||
63 | marvell,function = "gpio"; | ||
64 | }; | ||
65 | pmx_power_auto_switch: pmx-power-auto-switch { | ||
66 | marvell,pins = "mpp43"; | ||
67 | marvell,function = "gpio"; | ||
68 | }; | ||
69 | pmx_led_function_red: pmx-led-function_red { | ||
70 | marvell,pins = "mpp48"; | ||
71 | marvell,function = "gpio"; | ||
72 | }; | ||
73 | |||
74 | }; | ||
9 | sata@80000 { | 75 | sata@80000 { |
10 | status = "okay"; | 76 | status = "okay"; |
11 | nr-ports = <1>; | 77 | nr-ports = <1>; |
@@ -94,4 +160,44 @@ | |||
94 | gpios = <&gpio1 16 1>; | 160 | gpios = <&gpio1 16 1>; |
95 | }; | 161 | }; |
96 | }; | 162 | }; |
163 | |||
164 | gpio_fan { | ||
165 | compatible = "gpio-fan"; | ||
166 | gpios = <&gpio0 19 1 | ||
167 | &gpio0 18 1>; | ||
168 | gpio-fan,speed-map = <0 3 | ||
169 | 1500 2 | ||
170 | 3250 1 | ||
171 | 5000 0>; | ||
172 | alarm-gpios = <&gpio1 8 0>; | ||
173 | }; | ||
174 | |||
175 | regulators { | ||
176 | compatible = "simple-bus"; | ||
177 | #address-cells = <1>; | ||
178 | #size-cells = <0>; | ||
179 | |||
180 | usb_power: regulator@1 { | ||
181 | compatible = "regulator-fixed"; | ||
182 | reg = <1>; | ||
183 | regulator-name = "USB Power"; | ||
184 | regulator-min-microvolt = <5000000>; | ||
185 | regulator-max-microvolt = <5000000>; | ||
186 | enable-active-high; | ||
187 | regulator-always-on; | ||
188 | regulator-boot-on; | ||
189 | gpio = <&gpio0 11 0>; | ||
190 | }; | ||
191 | hdd_power: regulator@2 { | ||
192 | compatible = "regulator-fixed"; | ||
193 | reg = <2>; | ||
194 | regulator-name = "HDD Power"; | ||
195 | regulator-min-microvolt = <5000000>; | ||
196 | regulator-max-microvolt = <5000000>; | ||
197 | enable-active-high; | ||
198 | regulator-always-on; | ||
199 | regulator-boot-on; | ||
200 | gpio = <&gpio0 10 0>; | ||
201 | }; | ||
202 | }; | ||
97 | }; | 203 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts new file mode 100644 index 000000000000..262c65403760 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts | |||
@@ -0,0 +1,178 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood.dtsi" | ||
4 | /include/ "kirkwood-6281.dtsi" | ||
5 | |||
6 | / { | ||
7 | model = "MPL CEC4"; | ||
8 | compatible = "mpl,cec4-10", "mpl,cec4", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
9 | |||
10 | memory { | ||
11 | device_type = "memory"; | ||
12 | reg = <0x00000000 0x20000000>; | ||
13 | }; | ||
14 | |||
15 | chosen { | ||
16 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | ||
17 | }; | ||
18 | |||
19 | ocp@f1000000 { | ||
20 | pinctrl: pinctrl@10000 { | ||
21 | |||
22 | pinctrl-0 = < &pmx_nand &pmx_uart0 | ||
23 | &pmx_led_health &pmx_sdio | ||
24 | &pmx_sata0 &pmx_sata1 | ||
25 | &pmx_led_user1o | ||
26 | &pmx_led_user1g &pmx_led_user0o | ||
27 | &pmx_led_user0g &pmx_led_misc | ||
28 | &pmx_sdio_cd | ||
29 | >; | ||
30 | pinctrl-names = "default"; | ||
31 | |||
32 | pmx_led_health: pmx-led-health { | ||
33 | marvell,pins = "mpp7"; | ||
34 | marvell,function = "gpo"; | ||
35 | }; | ||
36 | |||
37 | pmx_sata1: pmx-sata1 { | ||
38 | marvell,pins = "mpp34"; | ||
39 | marvell,function = "sata1"; | ||
40 | }; | ||
41 | |||
42 | pmx_sata0: pmx-sata0 { | ||
43 | marvell,pins = "mpp35"; | ||
44 | marvell,function = "sata0"; | ||
45 | }; | ||
46 | |||
47 | pmx_led_user1o: pmx-led-user1o { | ||
48 | marvell,pins = "mpp40"; | ||
49 | marvell,function = "gpio"; | ||
50 | }; | ||
51 | |||
52 | pmx_led_user1g: pmx-led-user1g { | ||
53 | marvell,pins = "mpp41"; | ||
54 | marvell,function = "gpio"; | ||
55 | }; | ||
56 | |||
57 | pmx_led_user0o: pmx-led-user0o { | ||
58 | marvell,pins = "mpp44"; | ||
59 | marvell,function = "gpio"; | ||
60 | }; | ||
61 | |||
62 | pmx_led_user0g: pmx-led-user0g { | ||
63 | marvell,pins = "mpp45"; | ||
64 | marvell,function = "gpio"; | ||
65 | }; | ||
66 | |||
67 | pmx_led_misc: pmx-led-misc { | ||
68 | marvell,pins = "mpp46"; | ||
69 | marvell,function = "gpio"; | ||
70 | }; | ||
71 | |||
72 | pmx_sdio_cd: pmx-sdio-cd { | ||
73 | marvell,pins = "mpp47"; | ||
74 | marvell,function = "gpio"; | ||
75 | }; | ||
76 | }; | ||
77 | |||
78 | i2c@11000 { | ||
79 | status = "okay"; | ||
80 | |||
81 | rtc@51 { | ||
82 | compatible = "nxp,pcf8563"; | ||
83 | reg = <0x51>; | ||
84 | }; | ||
85 | |||
86 | eeprom@57 { | ||
87 | compatible = "atmel,24c02"; | ||
88 | reg = <0x57>; | ||
89 | }; | ||
90 | |||
91 | }; | ||
92 | |||
93 | serial@12000 { | ||
94 | clock-frequency = <200000000>; | ||
95 | status = "ok"; | ||
96 | }; | ||
97 | |||
98 | nand@3000000 { | ||
99 | status = "okay"; | ||
100 | |||
101 | partition@0 { | ||
102 | label = "uboot"; | ||
103 | reg = <0x0000000 0x100000>; | ||
104 | }; | ||
105 | |||
106 | partition@100000 { | ||
107 | label = "env"; | ||
108 | reg = <0x100000 0x80000>; | ||
109 | }; | ||
110 | |||
111 | partition@180000 { | ||
112 | label = "fdt"; | ||
113 | reg = <0x180000 0x80000>; | ||
114 | }; | ||
115 | |||
116 | partition@200000 { | ||
117 | label = "kernel"; | ||
118 | reg = <0x200000 0x400000>; | ||
119 | }; | ||
120 | |||
121 | partition@600000 { | ||
122 | label = "rootfs"; | ||
123 | reg = <0x600000 0x1fa00000>; | ||
124 | }; | ||
125 | }; | ||
126 | |||
127 | rtc@10300 { | ||
128 | status = "disabled"; | ||
129 | }; | ||
130 | |||
131 | sata@80000 { | ||
132 | nr-ports = <2>; | ||
133 | status = "okay"; | ||
134 | |||
135 | }; | ||
136 | }; | ||
137 | |||
138 | gpio-leds { | ||
139 | compatible = "gpio-leds"; | ||
140 | |||
141 | health { | ||
142 | label = "status:green:health"; | ||
143 | gpios = <&gpio0 7 1>; | ||
144 | }; | ||
145 | |||
146 | user1o { | ||
147 | label = "user1:orange"; | ||
148 | gpios = <&gpio1 8 1>; | ||
149 | default-state = "on"; | ||
150 | }; | ||
151 | |||
152 | user1g { | ||
153 | label = "user1:green"; | ||
154 | gpios = <&gpio1 9 1>; | ||
155 | default-state = "on"; | ||
156 | }; | ||
157 | |||
158 | user0o { | ||
159 | label = "user0:orange"; | ||
160 | gpios = <&gpio1 12 1>; | ||
161 | default-state = "on"; | ||
162 | }; | ||
163 | |||
164 | user0g { | ||
165 | label = "user0:green"; | ||
166 | gpios = <&gpio1 13 1>; | ||
167 | default-state = "on"; | ||
168 | }; | ||
169 | |||
170 | misc { | ||
171 | label = "status:orange:misc"; | ||
172 | gpios = <&gpio1 14 1>; | ||
173 | default-state = "on"; | ||
174 | }; | ||
175 | |||
176 | }; | ||
177 | }; | ||
178 | |||
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi new file mode 100644 index 000000000000..9bc6785ad228 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi | |||
@@ -0,0 +1,63 @@ | |||
1 | /include/ "kirkwood.dtsi" | ||
2 | |||
3 | / { | ||
4 | chosen { | ||
5 | bootargs = "console=ttyS0,115200n8"; | ||
6 | }; | ||
7 | |||
8 | ocp@f1000000 { | ||
9 | serial@12000 { | ||
10 | clock-frequency = <166666667>; | ||
11 | status = "okay"; | ||
12 | }; | ||
13 | |||
14 | spi@10600 { | ||
15 | status = "okay"; | ||
16 | |||
17 | flash@0 { | ||
18 | #address-cells = <1>; | ||
19 | #size-cells = <1>; | ||
20 | compatible = "mx25l4005a"; | ||
21 | reg = <0>; | ||
22 | spi-max-frequency = <20000000>; | ||
23 | mode = <0>; | ||
24 | |||
25 | partition@0 { | ||
26 | reg = <0x0 0x80000>; | ||
27 | label = "u-boot"; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
31 | |||
32 | i2c@11000 { | ||
33 | status = "okay"; | ||
34 | |||
35 | eeprom@50 { | ||
36 | compatible = "at,24c04"; | ||
37 | pagesize = <16>; | ||
38 | reg = <0x50>; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | |||
43 | gpio_keys { | ||
44 | compatible = "gpio-keys"; | ||
45 | #address-cells = <1>; | ||
46 | #size-cells = <0>; | ||
47 | |||
48 | button@1 { | ||
49 | label = "Power push button"; | ||
50 | linux,code = <116>; | ||
51 | gpios = <&gpio1 0 0>; | ||
52 | }; | ||
53 | }; | ||
54 | |||
55 | gpio-leds { | ||
56 | compatible = "gpio-leds"; | ||
57 | |||
58 | red-fail { | ||
59 | label = "ns2:red:fail"; | ||
60 | gpios = <&gpio0 12 0>; | ||
61 | }; | ||
62 | }; | ||
63 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2.dts b/arch/arm/boot/dts/kirkwood-ns2.dts new file mode 100644 index 000000000000..f2d36ecf36d8 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2.dts | |||
@@ -0,0 +1,30 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Network Space v2"; | ||
7 | compatible = "lacie,netspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <1>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | ns2-leds { | ||
22 | compatible = "lacie,ns2-leds"; | ||
23 | |||
24 | blue-sata { | ||
25 | label = "ns2:blue:sata"; | ||
26 | slow-gpio = <&gpio0 29 0>; | ||
27 | cmd-gpio = <&gpio0 30 0>; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2lite.dts b/arch/arm/boot/dts/kirkwood-ns2lite.dts new file mode 100644 index 000000000000..b02eb4ea1bb4 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2lite.dts | |||
@@ -0,0 +1,30 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Network Space Lite v2"; | ||
7 | compatible = "lacie,netspace_lite_v2", "marvell,kirkwood-88f6192", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x8000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <1>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | gpio-leds { | ||
22 | compatible = "gpio-leds"; | ||
23 | |||
24 | blue-sata { | ||
25 | label = "ns2:blue:sata"; | ||
26 | gpios = <&gpio0 30 1>; | ||
27 | linux,default-trigger = "default-on"; | ||
28 | }; | ||
29 | }; | ||
30 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2max.dts b/arch/arm/boot/dts/kirkwood-ns2max.dts new file mode 100644 index 000000000000..bcec4d6cada7 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2max.dts | |||
@@ -0,0 +1,49 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Network Space Max v2"; | ||
7 | compatible = "lacie,netspace_max_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <2>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | gpio_fan { | ||
22 | compatible = "gpio-fan"; | ||
23 | gpios = <&gpio0 22 1 | ||
24 | &gpio0 7 1 | ||
25 | &gpio1 1 1 | ||
26 | &gpio0 23 1>; | ||
27 | gpio-fan,speed-map = | ||
28 | < 0 0 | ||
29 | 1500 15 | ||
30 | 1700 14 | ||
31 | 1800 13 | ||
32 | 2100 12 | ||
33 | 3100 11 | ||
34 | 3300 10 | ||
35 | 4300 9 | ||
36 | 5500 8>; | ||
37 | alarm-gpios = <&gpio0 25 1>; | ||
38 | }; | ||
39 | |||
40 | ns2-leds { | ||
41 | compatible = "lacie,ns2-leds"; | ||
42 | |||
43 | blue-sata { | ||
44 | label = "ns2:blue:sata"; | ||
45 | slow-gpio = <&gpio0 29 0>; | ||
46 | cmd-gpio = <&gpio0 30 0>; | ||
47 | }; | ||
48 | }; | ||
49 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ns2mini.dts b/arch/arm/boot/dts/kirkwood-ns2mini.dts new file mode 100644 index 000000000000..b79f5eb25589 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2mini.dts | |||
@@ -0,0 +1,49 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood-ns2-common.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "LaCie Network Space Mini v2"; | ||
7 | compatible = "lacie,netspace_mini_v2", "marvell,kirkwood-88f6192", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x8000000>; | ||
12 | }; | ||
13 | |||
14 | ocp@f1000000 { | ||
15 | sata@80000 { | ||
16 | status = "okay"; | ||
17 | nr-ports = <1>; | ||
18 | }; | ||
19 | }; | ||
20 | |||
21 | gpio_fan { | ||
22 | compatible = "gpio-fan"; | ||
23 | gpios = <&gpio0 22 1 | ||
24 | &gpio0 7 1 | ||
25 | &gpio1 1 1 | ||
26 | &gpio0 23 1>; | ||
27 | gpio-fan,speed-map = | ||
28 | < 0 0 | ||
29 | 3000 15 | ||
30 | 3180 14 | ||
31 | 4140 13 | ||
32 | 4570 12 | ||
33 | 6760 11 | ||
34 | 7140 10 | ||
35 | 7980 9 | ||
36 | 9200 8>; | ||
37 | alarm-gpios = <&gpio0 25 1>; | ||
38 | }; | ||
39 | |||
40 | ns2-leds { | ||
41 | compatible = "lacie,ns2-leds"; | ||
42 | |||
43 | blue-sata { | ||
44 | label = "ns2:blue:sata"; | ||
45 | slow-gpio = <&gpio0 29 0>; | ||
46 | cmd-gpio = <&gpio0 30 0>; | ||
47 | }; | ||
48 | }; | ||
49 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts new file mode 100644 index 000000000000..5509f9659546 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-nsa310.dts | |||
@@ -0,0 +1,144 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "ZyXEL NSA310"; | ||
7 | compatible = "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | chosen { | ||
15 | bootargs = "console=ttyS0,115200"; | ||
16 | }; | ||
17 | |||
18 | ocp@f1000000 { | ||
19 | |||
20 | serial@12000 { | ||
21 | clock-frequency = <200000000>; | ||
22 | status = "ok"; | ||
23 | }; | ||
24 | |||
25 | sata@80000 { | ||
26 | status = "okay"; | ||
27 | nr-ports = <2>; | ||
28 | }; | ||
29 | |||
30 | i2c@11000 { | ||
31 | status = "okay"; | ||
32 | }; | ||
33 | |||
34 | nand@3000000 { | ||
35 | status = "okay"; | ||
36 | chip-delay = <35>; | ||
37 | |||
38 | partition@0 { | ||
39 | label = "uboot"; | ||
40 | reg = <0x0000000 0x0100000>; | ||
41 | read-only; | ||
42 | }; | ||
43 | partition@100000 { | ||
44 | label = "uboot_env"; | ||
45 | reg = <0x0100000 0x0080000>; | ||
46 | }; | ||
47 | partition@180000 { | ||
48 | label = "key_store"; | ||
49 | reg = <0x0180000 0x0080000>; | ||
50 | }; | ||
51 | partition@200000 { | ||
52 | label = "info"; | ||
53 | reg = <0x0200000 0x0080000>; | ||
54 | }; | ||
55 | partition@280000 { | ||
56 | label = "etc"; | ||
57 | reg = <0x0280000 0x0a00000>; | ||
58 | }; | ||
59 | partition@c80000 { | ||
60 | label = "kernel_1"; | ||
61 | reg = <0x0c80000 0x0a00000>; | ||
62 | }; | ||
63 | partition@1680000 { | ||
64 | label = "rootfs1"; | ||
65 | reg = <0x1680000 0x2fc0000>; | ||
66 | }; | ||
67 | partition@4640000 { | ||
68 | label = "kernel_2"; | ||
69 | reg = <0x4640000 0x0a00000>; | ||
70 | }; | ||
71 | partition@5040000 { | ||
72 | label = "rootfs2"; | ||
73 | reg = <0x5040000 0x2fc0000>; | ||
74 | }; | ||
75 | }; | ||
76 | }; | ||
77 | |||
78 | gpio_keys { | ||
79 | compatible = "gpio-keys"; | ||
80 | #address-cells = <1>; | ||
81 | #size-cells = <0>; | ||
82 | |||
83 | button@1 { | ||
84 | label = "Power Button"; | ||
85 | linux,code = <116>; | ||
86 | gpios = <&gpio1 14 0>; | ||
87 | }; | ||
88 | button@2 { | ||
89 | label = "Copy Button"; | ||
90 | linux,code = <133>; | ||
91 | gpios = <&gpio1 5 1>; | ||
92 | }; | ||
93 | button@3 { | ||
94 | label = "Reset Button"; | ||
95 | linux,code = <0x198>; | ||
96 | gpios = <&gpio1 4 1>; | ||
97 | }; | ||
98 | }; | ||
99 | |||
100 | gpio-leds { | ||
101 | compatible = "gpio-leds"; | ||
102 | |||
103 | green-sys { | ||
104 | label = "nsa310:green:sys"; | ||
105 | gpios = <&gpio0 28 0>; | ||
106 | }; | ||
107 | red-sys { | ||
108 | label = "nsa310:red:sys"; | ||
109 | gpios = <&gpio0 29 0>; | ||
110 | }; | ||
111 | green-hdd { | ||
112 | label = "nsa310:green:hdd"; | ||
113 | gpios = <&gpio1 9 0>; | ||
114 | }; | ||
115 | red-hdd { | ||
116 | label = "nsa310:red:hdd"; | ||
117 | gpios = <&gpio1 10 0>; | ||
118 | }; | ||
119 | green-esata { | ||
120 | label = "nsa310:green:esata"; | ||
121 | gpios = <&gpio0 12 0>; | ||
122 | }; | ||
123 | red-esata { | ||
124 | label = "nsa310:red:esata"; | ||
125 | gpios = <&gpio0 13 0>; | ||
126 | }; | ||
127 | green-usb { | ||
128 | label = "nsa310:green:usb"; | ||
129 | gpios = <&gpio0 15 0>; | ||
130 | }; | ||
131 | red-usb { | ||
132 | label = "nsa310:red:usb"; | ||
133 | gpios = <&gpio0 16 0>; | ||
134 | }; | ||
135 | green-copy { | ||
136 | label = "nsa310:green:copy"; | ||
137 | gpios = <&gpio1 7 0>; | ||
138 | }; | ||
139 | red-copy { | ||
140 | label = "nsa310:red:copy"; | ||
141 | gpios = <&gpio1 8 0>; | ||
142 | }; | ||
143 | }; | ||
144 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts new file mode 100644 index 000000000000..49d3d74d4d38 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts | |||
@@ -0,0 +1,98 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood.dtsi" | ||
4 | /include/ "kirkwood-6282.dtsi" | ||
5 | |||
6 | / { | ||
7 | model = "Plat'Home OpenBlocksA6"; | ||
8 | compatible = "plathome,openblocks-a6", "marvell,kirkwood-88f6283", "marvell,kirkwood"; | ||
9 | |||
10 | memory { | ||
11 | device_type = "memory"; | ||
12 | reg = <0x00000000 0x20000000>; | ||
13 | }; | ||
14 | |||
15 | chosen { | ||
16 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | ||
17 | }; | ||
18 | |||
19 | ocp@f1000000 { | ||
20 | serial@12000 { | ||
21 | clock-frequency = <200000000>; | ||
22 | status = "ok"; | ||
23 | }; | ||
24 | |||
25 | serial@12100 { | ||
26 | clock-frequency = <200000000>; | ||
27 | status = "ok"; | ||
28 | }; | ||
29 | |||
30 | nand@3000000 { | ||
31 | chip-delay = <25>; | ||
32 | status = "okay"; | ||
33 | |||
34 | partition@0 { | ||
35 | label = "uboot"; | ||
36 | reg = <0x0 0x90000>; | ||
37 | }; | ||
38 | |||
39 | partition@90000 { | ||
40 | label = "env"; | ||
41 | reg = <0x90000 0x44000>; | ||
42 | }; | ||
43 | |||
44 | partition@d4000 { | ||
45 | label = "test"; | ||
46 | reg = <0xd4000 0x24000>; | ||
47 | }; | ||
48 | |||
49 | partition@f4000 { | ||
50 | label = "conf"; | ||
51 | reg = <0xf4000 0x400000>; | ||
52 | }; | ||
53 | |||
54 | partition@4f4000 { | ||
55 | label = "linux"; | ||
56 | reg = <0x4f4000 0x1d20000>; | ||
57 | }; | ||
58 | |||
59 | partition@2214000 { | ||
60 | label = "user"; | ||
61 | reg = <0x2214000 0x1dec000>; | ||
62 | }; | ||
63 | }; | ||
64 | |||
65 | sata@80000 { | ||
66 | nr-ports = <1>; | ||
67 | status = "okay"; | ||
68 | }; | ||
69 | |||
70 | i2c@11100 { | ||
71 | status = "okay"; | ||
72 | |||
73 | s35390a: s35390a@30 { | ||
74 | compatible = "s35390a"; | ||
75 | reg = <0x30>; | ||
76 | }; | ||
77 | }; | ||
78 | }; | ||
79 | |||
80 | gpio-leds { | ||
81 | compatible = "gpio-leds"; | ||
82 | |||
83 | led-red { | ||
84 | label = "obsa6:red:stat"; | ||
85 | gpios = <&gpio1 9 1>; | ||
86 | }; | ||
87 | |||
88 | led-green { | ||
89 | label = "obsa6:green:stat"; | ||
90 | gpios = <&gpio1 10 1>; | ||
91 | }; | ||
92 | |||
93 | led-yellow { | ||
94 | label = "obsa6:yellow:stat"; | ||
95 | gpios = <&gpio1 11 1>; | ||
96 | }; | ||
97 | }; | ||
98 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts new file mode 100644 index 000000000000..c0de5a7f660d --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-topkick.dts | |||
@@ -0,0 +1,85 @@ | |||
1 | /dts-v1/; | ||
2 | |||
3 | /include/ "kirkwood.dtsi" | ||
4 | |||
5 | / { | ||
6 | model = "Univeral Scientific Industrial Co. Topkick-1281P2"; | ||
7 | compatible = "usi,topkick-1281P2", "usi,topkick", "marvell,kirkwood-88f6282", "marvell,kirkwood"; | ||
8 | |||
9 | memory { | ||
10 | device_type = "memory"; | ||
11 | reg = <0x00000000 0x10000000>; | ||
12 | }; | ||
13 | |||
14 | chosen { | ||
15 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | ||
16 | }; | ||
17 | |||
18 | ocp@f1000000 { | ||
19 | serial@12000 { | ||
20 | clock-frequency = <200000000>; | ||
21 | status = "ok"; | ||
22 | }; | ||
23 | |||
24 | nand@3000000 { | ||
25 | status = "okay"; | ||
26 | |||
27 | partition@0 { | ||
28 | label = "u-boot"; | ||
29 | reg = <0x0000000 0x180000>; | ||
30 | }; | ||
31 | |||
32 | partition@180000 { | ||
33 | label = "u-boot env"; | ||
34 | reg = <0x0180000 0x20000>; | ||
35 | }; | ||
36 | |||
37 | partition@200000 { | ||
38 | label = "uImage"; | ||
39 | reg = <0x0200000 0x600000>; | ||
40 | }; | ||
41 | |||
42 | partition@800000 { | ||
43 | label = "uInitrd"; | ||
44 | reg = <0x0800000 0x1000000>; | ||
45 | }; | ||
46 | |||
47 | partition@1800000 { | ||
48 | label = "rootfs"; | ||
49 | reg = <0x1800000 0xe800000>; | ||
50 | }; | ||
51 | }; | ||
52 | |||
53 | sata@80000 { | ||
54 | status = "okay"; | ||
55 | nr-ports = <1>; | ||
56 | }; | ||
57 | }; | ||
58 | |||
59 | gpio-leds { | ||
60 | compatible = "gpio-leds"; | ||
61 | |||
62 | disk { | ||
63 | label = "topkick:yellow:disk"; | ||
64 | gpios = <&gpio0 21 1>; | ||
65 | linux,default-trigger = "ide-disk"; | ||
66 | }; | ||
67 | system2 { | ||
68 | label = "topkick:red:system"; | ||
69 | gpios = <&gpio1 5 1>; | ||
70 | }; | ||
71 | system { | ||
72 | label = "topkick:blue:system"; | ||
73 | gpios = <&gpio1 6 1>; | ||
74 | default-state = "on"; | ||
75 | }; | ||
76 | wifi { | ||
77 | label = "topkick:green:wifi"; | ||
78 | gpios = <&gpio1 7 1>; | ||
79 | }; | ||
80 | wifi2 { | ||
81 | label = "topkick:yellow:wifi"; | ||
82 | gpios = <&gpio1 16 1>; | ||
83 | }; | ||
84 | }; | ||
85 | }; | ||
diff --git a/arch/arm/boot/dts/kirkwood-ts219-6281.dts b/arch/arm/boot/dts/kirkwood-ts219-6281.dts index ccbf32757800..8295c833887f 100644 --- a/arch/arm/boot/dts/kirkwood-ts219-6281.dts +++ b/arch/arm/boot/dts/kirkwood-ts219-6281.dts | |||
@@ -1,8 +1,39 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood-ts219.dtsi" | 3 | /include/ "kirkwood-ts219.dtsi" |
4 | /include/ "kirkwood-6281.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
7 | ocp@f1000000 { | ||
8 | pinctrl: pinctrl@10000 { | ||
9 | |||
10 | pinctrl-0 = < &pmx_uart0 &pmx_uart1 &pmx_spi | ||
11 | &pmx_twsi0 &pmx_sata0 &pmx_sata1 | ||
12 | &pmx_ram_size &pmx_reset_button | ||
13 | &pmx_USB_copy_button &pmx_board_id>; | ||
14 | pinctrl-names = "default"; | ||
15 | |||
16 | pmx_ram_size: pmx-ram-size { | ||
17 | /* RAM: 0: 256 MB, 1: 512 MB */ | ||
18 | marvell,pins = "mpp36"; | ||
19 | marvell,function = "gpio"; | ||
20 | }; | ||
21 | pmx_USB_copy_button: pmx-USB-copy-button { | ||
22 | marvell,pins = "mpp15"; | ||
23 | marvell,function = "gpio"; | ||
24 | }; | ||
25 | pmx_reset_button: pmx-reset-button { | ||
26 | marvell,pins = "mpp16"; | ||
27 | marvell,function = "gpio"; | ||
28 | }; | ||
29 | pmx_board_id: pmx-board-id { | ||
30 | /* 0: TS-11x, 1: TS-21x */ | ||
31 | marvell,pins = "mpp44"; | ||
32 | marvell,function = "gpio"; | ||
33 | }; | ||
34 | }; | ||
35 | }; | ||
36 | |||
6 | gpio_keys { | 37 | gpio_keys { |
7 | compatible = "gpio-keys"; | 38 | compatible = "gpio-keys"; |
8 | #address-cells = <1>; | 39 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/kirkwood-ts219-6282.dts b/arch/arm/boot/dts/kirkwood-ts219-6282.dts index fbe9932161a1..df3f95dfba33 100644 --- a/arch/arm/boot/dts/kirkwood-ts219-6282.dts +++ b/arch/arm/boot/dts/kirkwood-ts219-6282.dts | |||
@@ -1,8 +1,39 @@ | |||
1 | /dts-v1/; | 1 | /dts-v1/; |
2 | 2 | ||
3 | /include/ "kirkwood-ts219.dtsi" | 3 | /include/ "kirkwood-ts219.dtsi" |
4 | /include/ "kirkwood-6282.dtsi" | ||
4 | 5 | ||
5 | / { | 6 | / { |
7 | ocp@f1000000 { | ||
8 | pinctrl: pinctrl@10000 { | ||
9 | |||
10 | pinctrl-0 = < &pmx_uart0 &pmx_uart1 &pmx_spi | ||
11 | &pmx_twsi0 &pmx_sata0 &pmx_sata1 | ||
12 | &pmx_ram_size &pmx_reset_button | ||
13 | &pmx_USB_copy_button &pmx_board_id>; | ||
14 | pinctrl-names = "default"; | ||
15 | |||
16 | pmx_ram_size: pmx-ram-size { | ||
17 | /* RAM: 0: 256 MB, 1: 512 MB */ | ||
18 | marvell,pins = "mpp36"; | ||
19 | marvell,function = "gpio"; | ||
20 | }; | ||
21 | pmx_reset_button: pmx-reset-button { | ||
22 | marvell,pins = "mpp37"; | ||
23 | marvell,function = "gpio"; | ||
24 | }; | ||
25 | pmx_USB_copy_button: pmx-USB-copy-button { | ||
26 | marvell,pins = "mpp43"; | ||
27 | marvell,function = "gpio"; | ||
28 | }; | ||
29 | pmx_board_id: pmx-board-id { | ||
30 | /* 0: TS-11x, 1: TS-21x */ | ||
31 | marvell,pins = "mpp44"; | ||
32 | marvell,function = "gpio"; | ||
33 | }; | ||
34 | }; | ||
35 | }; | ||
36 | |||
6 | gpio_keys { | 37 | gpio_keys { |
7 | compatible = "gpio-keys"; | 38 | compatible = "gpio-keys"; |
8 | #address-cells = <1>; | 39 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi index 4e5b8154a5be..a990c30f0a26 100644 --- a/arch/arm/boot/dts/kirkwood.dtsi +++ b/arch/arm/boot/dts/kirkwood.dtsi | |||
@@ -4,6 +4,10 @@ | |||
4 | compatible = "marvell,kirkwood"; | 4 | compatible = "marvell,kirkwood"; |
5 | interrupt-parent = <&intc>; | 5 | interrupt-parent = <&intc>; |
6 | 6 | ||
7 | aliases { | ||
8 | gpio0 = &gpio0; | ||
9 | gpio1 = &gpio1; | ||
10 | }; | ||
7 | intc: interrupt-controller { | 11 | intc: interrupt-controller { |
8 | compatible = "marvell,orion-intc", "marvell,intc"; | 12 | compatible = "marvell,orion-intc", "marvell,intc"; |
9 | interrupt-controller; | 13 | interrupt-controller; |
@@ -24,7 +28,8 @@ | |||
24 | #gpio-cells = <2>; | 28 | #gpio-cells = <2>; |
25 | gpio-controller; | 29 | gpio-controller; |
26 | reg = <0x10100 0x40>; | 30 | reg = <0x10100 0x40>; |
27 | ngpio = <32>; | 31 | ngpios = <32>; |
32 | interrupt-controller; | ||
28 | interrupts = <35>, <36>, <37>, <38>; | 33 | interrupts = <35>, <36>, <37>, <38>; |
29 | }; | 34 | }; |
30 | 35 | ||
@@ -33,7 +38,8 @@ | |||
33 | #gpio-cells = <2>; | 38 | #gpio-cells = <2>; |
34 | gpio-controller; | 39 | gpio-controller; |
35 | reg = <0x10140 0x40>; | 40 | reg = <0x10140 0x40>; |
36 | ngpio = <18>; | 41 | ngpios = <18>; |
42 | interrupt-controller; | ||
37 | interrupts = <39>, <40>, <41>; | 43 | interrupts = <39>, <40>, <41>; |
38 | }; | 44 | }; |
39 | 45 | ||
@@ -77,6 +83,13 @@ | |||
77 | status = "okay"; | 83 | status = "okay"; |
78 | }; | 84 | }; |
79 | 85 | ||
86 | ehci@50000 { | ||
87 | compatible = "marvell,orion-ehci"; | ||
88 | reg = <0x50000 0x1000>; | ||
89 | interrupts = <19>; | ||
90 | status = "okay"; | ||
91 | }; | ||
92 | |||
80 | sata@80000 { | 93 | sata@80000 { |
81 | compatible = "marvell,orion-sata"; | 94 | compatible = "marvell,orion-sata"; |
82 | reg = <0x80000 0x5000>; | 95 | reg = <0x80000 0x5000>; |
diff --git a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts new file mode 100644 index 000000000000..5a3a58b7e18f --- /dev/null +++ b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | /dts-v1/; | ||
10 | /include/ "orion5x.dtsi" | ||
11 | |||
12 | / { | ||
13 | model = "LaCie Ethernet Disk mini V2"; | ||
14 | compatible = "lacie,ethernet-disk-mini-v2", "marvell-orion5x-88f5182", "marvell,orion5x"; | ||
15 | |||
16 | memory { | ||
17 | reg = <0x00000000 0x4000000>; /* 64 MB */ | ||
18 | }; | ||
19 | |||
20 | chosen { | ||
21 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | ||
22 | }; | ||
23 | |||
24 | ocp@f1000000 { | ||
25 | serial@12000 { | ||
26 | clock-frequency = <166666667>; | ||
27 | status = "okay"; | ||
28 | }; | ||
29 | |||
30 | sata@80000 { | ||
31 | status = "okay"; | ||
32 | nr-ports = <2>; | ||
33 | }; | ||
34 | }; | ||
35 | |||
36 | gpio_keys { | ||
37 | compatible = "gpio-keys"; | ||
38 | #address-cells = <1>; | ||
39 | #size-cells = <0>; | ||
40 | button@1 { | ||
41 | label = "Power-on Switch"; | ||
42 | linux,code = <116>; /* KEY_POWER */ | ||
43 | gpios = <&gpio0 18 0>; | ||
44 | }; | ||
45 | }; | ||
46 | |||
47 | gpio_leds { | ||
48 | compatible = "gpio-leds"; | ||
49 | |||
50 | led@1 { | ||
51 | label = "power:blue"; | ||
52 | gpios = <&gpio0 16 1>; | ||
53 | }; | ||
54 | }; | ||
55 | }; | ||
diff --git a/arch/arm/boot/dts/orion5x.dtsi b/arch/arm/boot/dts/orion5x.dtsi new file mode 100644 index 000000000000..8aad00f81ed9 --- /dev/null +++ b/arch/arm/boot/dts/orion5x.dtsi | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
3 | * | ||
4 | * This file is licensed under the terms of the GNU General Public | ||
5 | * License version 2. This program is licensed "as is" without any | ||
6 | * warranty of any kind, whether express or implied. | ||
7 | */ | ||
8 | |||
9 | /include/ "skeleton.dtsi" | ||
10 | |||
11 | / { | ||
12 | model = "Marvell Orion5x SoC"; | ||
13 | compatible = "marvell,orion5x"; | ||
14 | interrupt-parent = <&intc>; | ||
15 | |||
16 | intc: interrupt-controller { | ||
17 | compatible = "marvell,orion-intc", "marvell,intc"; | ||
18 | interrupt-controller; | ||
19 | #interrupt-cells = <1>; | ||
20 | reg = <0xf1020204 0x04>; | ||
21 | }; | ||
22 | |||
23 | ocp@f1000000 { | ||
24 | compatible = "simple-bus"; | ||
25 | ranges = <0x00000000 0xf1000000 0x4000000 | ||
26 | 0xf2200000 0xf2200000 0x0000800>; | ||
27 | #address-cells = <1>; | ||
28 | #size-cells = <1>; | ||
29 | |||
30 | gpio0: gpio@10100 { | ||
31 | compatible = "marvell,orion-gpio"; | ||
32 | #gpio-cells = <2>; | ||
33 | gpio-controller; | ||
34 | reg = <0x10100 0x40>; | ||
35 | ngpio = <32>; | ||
36 | interrupts = <6>, <7>, <8>, <9>; | ||
37 | }; | ||
38 | |||
39 | serial@12000 { | ||
40 | compatible = "ns16550a"; | ||
41 | reg = <0x12000 0x100>; | ||
42 | reg-shift = <2>; | ||
43 | interrupts = <3>; | ||
44 | /* set clock-frequency in board dts */ | ||
45 | status = "disabled"; | ||
46 | }; | ||
47 | |||
48 | serial@12100 { | ||
49 | compatible = "ns16550a"; | ||
50 | reg = <0x12100 0x100>; | ||
51 | reg-shift = <2>; | ||
52 | interrupts = <4>; | ||
53 | /* set clock-frequency in board dts */ | ||
54 | status = "disabled"; | ||
55 | }; | ||
56 | |||
57 | spi@10600 { | ||
58 | compatible = "marvell,orion-spi"; | ||
59 | #address-cells = <1>; | ||
60 | #size-cells = <0>; | ||
61 | cell-index = <0>; | ||
62 | reg = <0x10600 0x28>; | ||
63 | status = "disabled"; | ||
64 | }; | ||
65 | |||
66 | wdt@20300 { | ||
67 | compatible = "marvell,orion-wdt"; | ||
68 | reg = <0x20300 0x28>; | ||
69 | status = "okay"; | ||
70 | }; | ||
71 | |||
72 | sata@80000 { | ||
73 | compatible = "marvell,orion-sata"; | ||
74 | reg = <0x80000 0x5000>; | ||
75 | interrupts = <29>; | ||
76 | status = "disabled"; | ||
77 | }; | ||
78 | |||
79 | i2c@11000 { | ||
80 | compatible = "marvell,mv64xxx-i2c"; | ||
81 | reg = <0x11000 0x20>; | ||
82 | #address-cells = <1>; | ||
83 | #size-cells = <0>; | ||
84 | interrupts = <5>; | ||
85 | clock-frequency = <100000>; | ||
86 | status = "disabled"; | ||
87 | }; | ||
88 | |||
89 | crypto@90000 { | ||
90 | compatible = "marvell,orion-crypto"; | ||
91 | reg = <0x90000 0x10000>, | ||
92 | <0xf2200000 0x800>; | ||
93 | reg-names = "regs", "sram"; | ||
94 | interrupts = <22>; | ||
95 | status = "okay"; | ||
96 | }; | ||
97 | }; | ||
98 | }; | ||
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi index 1f7f49aabe6b..efa603d47a6a 100644 --- a/arch/arm/boot/dts/tegra30.dtsi +++ b/arch/arm/boot/dts/tegra30.dtsi | |||
@@ -169,8 +169,8 @@ | |||
169 | 169 | ||
170 | pinmux: pinmux { | 170 | pinmux: pinmux { |
171 | compatible = "nvidia,tegra30-pinmux"; | 171 | compatible = "nvidia,tegra30-pinmux"; |
172 | reg = <0x70000868 0xd0 /* Pad control registers */ | 172 | reg = <0x70000868 0xd4 /* Pad control registers */ |
173 | 0x70003000 0x3e0>; /* Mux registers */ | 173 | 0x70003000 0x3e4>; /* Mux registers */ |
174 | }; | 174 | }; |
175 | 175 | ||
176 | serial@70006000 { | 176 | serial@70006000 { |
diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig index 40db34cf2771..0b7ee92c5713 100644 --- a/arch/arm/configs/dove_defconfig +++ b/arch/arm/configs/dove_defconfig | |||
@@ -8,11 +8,19 @@ CONFIG_MODULE_UNLOAD=y | |||
8 | # CONFIG_BLK_DEV_BSG is not set | 8 | # CONFIG_BLK_DEV_BSG is not set |
9 | CONFIG_ARCH_DOVE=y | 9 | CONFIG_ARCH_DOVE=y |
10 | CONFIG_MACH_DOVE_DB=y | 10 | CONFIG_MACH_DOVE_DB=y |
11 | CONFIG_MACH_CM_A510=y | ||
12 | CONFIG_MACH_DOVE_DT=y | ||
11 | CONFIG_NO_HZ=y | 13 | CONFIG_NO_HZ=y |
12 | CONFIG_HIGH_RES_TIMERS=y | 14 | CONFIG_HIGH_RES_TIMERS=y |
13 | CONFIG_AEABI=y | 15 | CONFIG_AEABI=y |
14 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 16 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
15 | CONFIG_ZBOOT_ROM_BSS=0x0 | 17 | CONFIG_ZBOOT_ROM_BSS=0x0 |
18 | CONFIG_HIGHMEM=y | ||
19 | CONFIG_USE_OF=y | ||
20 | CONFIG_ATAGS=y | ||
21 | CONFIG_ARM_APPENDED_DTB=y | ||
22 | CONFIG_ARM_ATAG_DTB_COMPAT=y | ||
23 | CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y | ||
16 | CONFIG_VFP=y | 24 | CONFIG_VFP=y |
17 | CONFIG_NET=y | 25 | CONFIG_NET=y |
18 | CONFIG_PACKET=y | 26 | CONFIG_PACKET=y |
@@ -62,6 +70,9 @@ CONFIG_SERIAL_8250=y | |||
62 | CONFIG_SERIAL_8250_CONSOLE=y | 70 | CONFIG_SERIAL_8250_CONSOLE=y |
63 | # CONFIG_SERIAL_8250_PCI is not set | 71 | # CONFIG_SERIAL_8250_PCI is not set |
64 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 | 72 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 |
73 | CONFIG_SERIAL_CORE=y | ||
74 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
75 | CONFIG_SERIAL_OF_PLATFORM=y | ||
65 | # CONFIG_HW_RANDOM is not set | 76 | # CONFIG_HW_RANDOM is not set |
66 | CONFIG_I2C=y | 77 | CONFIG_I2C=y |
67 | CONFIG_I2C_CHARDEV=y | 78 | CONFIG_I2C_CHARDEV=y |
@@ -74,6 +85,18 @@ CONFIG_USB_DEVICEFS=y | |||
74 | CONFIG_USB_EHCI_HCD=y | 85 | CONFIG_USB_EHCI_HCD=y |
75 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 86 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
76 | CONFIG_USB_STORAGE=y | 87 | CONFIG_USB_STORAGE=y |
88 | CONFIG_MMC=y | ||
89 | CONFIG_MMC_SDHCI=y | ||
90 | CONFIG_MMC_SDHCI_IO_ACCESSORS=y | ||
91 | CONFIG_MMC_SDHCI_PLTFM=y | ||
92 | CONFIG_MMC_SDHCI_DOVE=y | ||
93 | CONFIG_NEW_LEDS=y | ||
94 | CONFIG_LEDS_CLASS=y | ||
95 | CONFIG_LEDS_GPIO=y | ||
96 | CONFIG_LEDS_TRIGGERS=y | ||
97 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
98 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
99 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
77 | CONFIG_RTC_CLASS=y | 100 | CONFIG_RTC_CLASS=y |
78 | CONFIG_RTC_DRV_MV=y | 101 | CONFIG_RTC_DRV_MV=y |
79 | CONFIG_DMADEVICES=y | 102 | CONFIG_DMADEVICES=y |
@@ -122,6 +145,7 @@ CONFIG_CRYPTO_TWOFISH=y | |||
122 | CONFIG_CRYPTO_DEFLATE=y | 145 | CONFIG_CRYPTO_DEFLATE=y |
123 | CONFIG_CRYPTO_LZO=y | 146 | CONFIG_CRYPTO_LZO=y |
124 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 147 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
148 | CONFIG_CRYPTO_DEV_MV_CESA=y | ||
125 | CONFIG_CRC_CCITT=y | 149 | CONFIG_CRC_CCITT=y |
126 | CONFIG_CRC16=y | 150 | CONFIG_CRC16=y |
127 | CONFIG_LIBCRC32C=y | 151 | CONFIG_LIBCRC32C=y |
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 74eee0c78f28..93f3794ba5cb 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig | |||
@@ -27,6 +27,14 @@ CONFIG_MACH_GOFLEXNET_DT=y | |||
27 | CONFIG_MACH_LSXL_DT=y | 27 | CONFIG_MACH_LSXL_DT=y |
28 | CONFIG_MACH_IOMEGA_IX2_200_DT=y | 28 | CONFIG_MACH_IOMEGA_IX2_200_DT=y |
29 | CONFIG_MACH_KM_KIRKWOOD_DT=y | 29 | CONFIG_MACH_KM_KIRKWOOD_DT=y |
30 | CONFIG_MACH_INETSPACE_V2_DT=y | ||
31 | CONFIG_MACH_MPLCEC4_DT=y | ||
32 | CONFIG_MACH_NETSPACE_V2_DT=y | ||
33 | CONFIG_MACH_NETSPACE_MAX_V2_DT=y | ||
34 | CONFIG_MACH_NETSPACE_LITE_V2_DT=y | ||
35 | CONFIG_MACH_NETSPACE_MINI_V2_DT=y | ||
36 | CONFIG_MACH_OPENBLOCKS_A6_DT=y | ||
37 | CONFIG_MACH_TOPKICK_DT=y | ||
30 | CONFIG_MACH_TS219=y | 38 | CONFIG_MACH_TS219=y |
31 | CONFIG_MACH_TS41X=y | 39 | CONFIG_MACH_TS41X=y |
32 | CONFIG_MACH_DOCKSTAR=y | 40 | CONFIG_MACH_DOCKSTAR=y |
@@ -40,6 +48,7 @@ CONFIG_MACH_D2NET_V2=y | |||
40 | CONFIG_MACH_NET2BIG_V2=y | 48 | CONFIG_MACH_NET2BIG_V2=y |
41 | CONFIG_MACH_NET5BIG_V2=y | 49 | CONFIG_MACH_NET5BIG_V2=y |
42 | CONFIG_MACH_T5325=y | 50 | CONFIG_MACH_T5325=y |
51 | CONFIG_MACH_NSA310_DT=y | ||
43 | # CONFIG_CPU_FEROCEON_OLD_ID is not set | 52 | # CONFIG_CPU_FEROCEON_OLD_ID is not set |
44 | CONFIG_PREEMPT=y | 53 | CONFIG_PREEMPT=y |
45 | CONFIG_AEABI=y | 54 | CONFIG_AEABI=y |
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig index cd5e6ba9a54d..952430d9e2d9 100644 --- a/arch/arm/configs/orion5x_defconfig +++ b/arch/arm/configs/orion5x_defconfig | |||
@@ -1,7 +1,8 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | 1 | CONFIG_EXPERIMENTAL=y |
2 | CONFIG_SYSVIPC=y | 2 | CONFIG_SYSVIPC=y |
3 | CONFIG_NO_HZ=y | ||
4 | CONFIG_HIGH_RES_TIMERS=y | ||
3 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
4 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
5 | CONFIG_EXPERT=y | 6 | CONFIG_EXPERT=y |
6 | # CONFIG_SLUB_DEBUG is not set | 7 | # CONFIG_SLUB_DEBUG is not set |
7 | CONFIG_PROFILING=y | 8 | CONFIG_PROFILING=y |
@@ -10,6 +11,8 @@ CONFIG_KPROBES=y | |||
10 | CONFIG_MODULES=y | 11 | CONFIG_MODULES=y |
11 | CONFIG_MODULE_UNLOAD=y | 12 | CONFIG_MODULE_UNLOAD=y |
12 | # CONFIG_BLK_DEV_BSG is not set | 13 | # CONFIG_BLK_DEV_BSG is not set |
14 | CONFIG_PARTITION_ADVANCED=y | ||
15 | CONFIG_BSD_DISKLABEL=y | ||
13 | CONFIG_ARCH_ORION5X=y | 16 | CONFIG_ARCH_ORION5X=y |
14 | CONFIG_MACH_DB88F5281=y | 17 | CONFIG_MACH_DB88F5281=y |
15 | CONFIG_MACH_RD88F5182=y | 18 | CONFIG_MACH_RD88F5182=y |
@@ -24,7 +27,7 @@ CONFIG_MACH_TS409=y | |||
24 | CONFIG_MACH_WRT350N_V2=y | 27 | CONFIG_MACH_WRT350N_V2=y |
25 | CONFIG_MACH_TS78XX=y | 28 | CONFIG_MACH_TS78XX=y |
26 | CONFIG_MACH_MV2120=y | 29 | CONFIG_MACH_MV2120=y |
27 | CONFIG_MACH_EDMINI_V2=y | 30 | CONFIG_MACH_EDMINI_V2_DT=y |
28 | CONFIG_MACH_D2NET=y | 31 | CONFIG_MACH_D2NET=y |
29 | CONFIG_MACH_BIGDISK=y | 32 | CONFIG_MACH_BIGDISK=y |
30 | CONFIG_MACH_NET2BIG=y | 33 | CONFIG_MACH_NET2BIG=y |
@@ -33,17 +36,13 @@ CONFIG_MACH_WNR854T=y | |||
33 | CONFIG_MACH_RD88F5181L_GE=y | 36 | CONFIG_MACH_RD88F5181L_GE=y |
34 | CONFIG_MACH_RD88F5181L_FXO=y | 37 | CONFIG_MACH_RD88F5181L_FXO=y |
35 | CONFIG_MACH_RD88F6183AP_GE=y | 38 | CONFIG_MACH_RD88F6183AP_GE=y |
36 | CONFIG_NO_HZ=y | ||
37 | CONFIG_HIGH_RES_TIMERS=y | ||
38 | CONFIG_PREEMPT=y | 39 | CONFIG_PREEMPT=y |
39 | CONFIG_AEABI=y | 40 | CONFIG_AEABI=y |
40 | CONFIG_LEDS=y | ||
41 | CONFIG_LEDS_CPU=y | ||
42 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 41 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
43 | CONFIG_ZBOOT_ROM_BSS=0x0 | 42 | CONFIG_ZBOOT_ROM_BSS=0x0 |
43 | CONFIG_ARM_APPENDED_DTB=y | ||
44 | CONFIG_FPE_NWFPE=y | 44 | CONFIG_FPE_NWFPE=y |
45 | CONFIG_VFP=y | 45 | CONFIG_VFP=y |
46 | # CONFIG_SUSPEND is not set | ||
47 | CONFIG_NET=y | 46 | CONFIG_NET=y |
48 | CONFIG_PACKET=y | 47 | CONFIG_PACKET=y |
49 | CONFIG_UNIX=y | 48 | CONFIG_UNIX=y |
@@ -54,13 +53,10 @@ CONFIG_IP_PNP_DHCP=y | |||
54 | CONFIG_IP_PNP_BOOTP=y | 53 | CONFIG_IP_PNP_BOOTP=y |
55 | # CONFIG_IPV6 is not set | 54 | # CONFIG_IPV6 is not set |
56 | CONFIG_NET_DSA=y | 55 | CONFIG_NET_DSA=y |
57 | CONFIG_NET_DSA_MV88E6131=y | ||
58 | CONFIG_NET_DSA_MV88E6123_61_65=y | ||
59 | CONFIG_NET_PKTGEN=m | 56 | CONFIG_NET_PKTGEN=m |
60 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 57 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
61 | # CONFIG_FIRMWARE_IN_KERNEL is not set | 58 | # CONFIG_FIRMWARE_IN_KERNEL is not set |
62 | CONFIG_MTD=y | 59 | CONFIG_MTD=y |
63 | CONFIG_MTD_PARTITIONS=y | ||
64 | CONFIG_MTD_CMDLINE_PARTS=y | 60 | CONFIG_MTD_CMDLINE_PARTS=y |
65 | CONFIG_MTD_CHAR=y | 61 | CONFIG_MTD_CHAR=y |
66 | CONFIG_MTD_BLOCK=y | 62 | CONFIG_MTD_BLOCK=y |
@@ -82,12 +78,11 @@ CONFIG_CHR_DEV_SG=m | |||
82 | CONFIG_ATA=y | 78 | CONFIG_ATA=y |
83 | CONFIG_SATA_MV=y | 79 | CONFIG_SATA_MV=y |
84 | CONFIG_NETDEVICES=y | 80 | CONFIG_NETDEVICES=y |
85 | CONFIG_MARVELL_PHY=y | ||
86 | CONFIG_NET_ETHERNET=y | ||
87 | CONFIG_MII=y | 81 | CONFIG_MII=y |
88 | CONFIG_NET_PCI=y | 82 | CONFIG_NET_DSA_MV88E6131=y |
83 | CONFIG_NET_DSA_MV88E6123_61_65=y | ||
89 | CONFIG_MV643XX_ETH=y | 84 | CONFIG_MV643XX_ETH=y |
90 | # CONFIG_NETDEV_10000 is not set | 85 | CONFIG_MARVELL_PHY=y |
91 | # CONFIG_INPUT_MOUSEDEV is not set | 86 | # CONFIG_INPUT_MOUSEDEV is not set |
92 | CONFIG_INPUT_EVDEV=y | 87 | CONFIG_INPUT_EVDEV=y |
93 | # CONFIG_KEYBOARD_ATKBD is not set | 88 | # CONFIG_KEYBOARD_ATKBD is not set |
@@ -95,11 +90,12 @@ CONFIG_KEYBOARD_GPIO=y | |||
95 | # CONFIG_INPUT_MOUSE is not set | 90 | # CONFIG_INPUT_MOUSE is not set |
96 | # CONFIG_SERIO is not set | 91 | # CONFIG_SERIO is not set |
97 | # CONFIG_VT is not set | 92 | # CONFIG_VT is not set |
93 | CONFIG_LEGACY_PTY_COUNT=16 | ||
98 | CONFIG_SERIAL_8250=y | 94 | CONFIG_SERIAL_8250=y |
99 | CONFIG_SERIAL_8250_CONSOLE=y | 95 | CONFIG_SERIAL_8250_CONSOLE=y |
100 | # CONFIG_SERIAL_8250_PCI is not set | 96 | # CONFIG_SERIAL_8250_PCI is not set |
101 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 | 97 | CONFIG_SERIAL_8250_RUNTIME_UARTS=2 |
102 | CONFIG_LEGACY_PTY_COUNT=16 | 98 | CONFIG_SERIAL_OF_PLATFORM=y |
103 | CONFIG_HW_RANDOM_TIMERIOMEM=m | 99 | CONFIG_HW_RANDOM_TIMERIOMEM=m |
104 | CONFIG_I2C=y | 100 | CONFIG_I2C=y |
105 | # CONFIG_I2C_COMPAT is not set | 101 | # CONFIG_I2C_COMPAT is not set |
@@ -109,10 +105,8 @@ CONFIG_GPIO_SYSFS=y | |||
109 | CONFIG_SENSORS_LM75=y | 105 | CONFIG_SENSORS_LM75=y |
110 | # CONFIG_VGA_ARB is not set | 106 | # CONFIG_VGA_ARB is not set |
111 | CONFIG_USB=y | 107 | CONFIG_USB=y |
112 | CONFIG_USB_DEVICEFS=y | ||
113 | CONFIG_USB_EHCI_HCD=y | 108 | CONFIG_USB_EHCI_HCD=y |
114 | CONFIG_USB_EHCI_ROOT_HUB_TT=y | 109 | CONFIG_USB_EHCI_ROOT_HUB_TT=y |
115 | CONFIG_USB_EHCI_TT_NEWSCHED=y | ||
116 | CONFIG_USB_PRINTER=y | 110 | CONFIG_USB_PRINTER=y |
117 | CONFIG_USB_STORAGE=y | 111 | CONFIG_USB_STORAGE=y |
118 | CONFIG_USB_STORAGE_DATAFAB=y | 112 | CONFIG_USB_STORAGE_DATAFAB=y |
@@ -140,7 +134,6 @@ CONFIG_EXT2_FS=y | |||
140 | CONFIG_EXT3_FS=y | 134 | CONFIG_EXT3_FS=y |
141 | # CONFIG_EXT3_FS_XATTR is not set | 135 | # CONFIG_EXT3_FS_XATTR is not set |
142 | CONFIG_EXT4_FS=m | 136 | CONFIG_EXT4_FS=m |
143 | CONFIG_INOTIFY=y | ||
144 | CONFIG_ISO9660_FS=m | 137 | CONFIG_ISO9660_FS=m |
145 | CONFIG_JOLIET=y | 138 | CONFIG_JOLIET=y |
146 | CONFIG_UDF_FS=m | 139 | CONFIG_UDF_FS=m |
@@ -150,25 +143,18 @@ CONFIG_TMPFS=y | |||
150 | CONFIG_JFFS2_FS=y | 143 | CONFIG_JFFS2_FS=y |
151 | CONFIG_CRAMFS=y | 144 | CONFIG_CRAMFS=y |
152 | CONFIG_NFS_FS=y | 145 | CONFIG_NFS_FS=y |
153 | CONFIG_NFS_V3=y | ||
154 | CONFIG_ROOT_NFS=y | 146 | CONFIG_ROOT_NFS=y |
155 | CONFIG_PARTITION_ADVANCED=y | ||
156 | CONFIG_BSD_DISKLABEL=y | ||
157 | CONFIG_NLS_CODEPAGE_437=y | 147 | CONFIG_NLS_CODEPAGE_437=y |
158 | CONFIG_NLS_CODEPAGE_850=y | 148 | CONFIG_NLS_CODEPAGE_850=y |
159 | CONFIG_NLS_ISO8859_1=y | 149 | CONFIG_NLS_ISO8859_1=y |
160 | CONFIG_NLS_ISO8859_2=y | 150 | CONFIG_NLS_ISO8859_2=y |
161 | CONFIG_MAGIC_SYSRQ=y | 151 | CONFIG_MAGIC_SYSRQ=y |
162 | CONFIG_DEBUG_FS=y | 152 | CONFIG_DEBUG_FS=y |
163 | CONFIG_DEBUG_KERNEL=y | ||
164 | # CONFIG_DEBUG_BUGVERBOSE is not set | 153 | # CONFIG_DEBUG_BUGVERBOSE is not set |
165 | CONFIG_DEBUG_INFO=y | 154 | CONFIG_DEBUG_INFO=y |
166 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
167 | CONFIG_LATENCYTOP=y | 155 | CONFIG_LATENCYTOP=y |
168 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
169 | # CONFIG_FTRACE is not set | 156 | # CONFIG_FTRACE is not set |
170 | CONFIG_DEBUG_USER=y | 157 | CONFIG_DEBUG_USER=y |
171 | CONFIG_DEBUG_ERRORS=y | ||
172 | CONFIG_DEBUG_LL=y | 158 | CONFIG_DEBUG_LL=y |
173 | CONFIG_CRYPTO_CBC=m | 159 | CONFIG_CRYPTO_CBC=m |
174 | CONFIG_CRYPTO_ECB=m | 160 | CONFIG_CRYPTO_ECB=m |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 1e122bcd7845..3cee0e6ea7c3 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -68,7 +68,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
68 | 68 | ||
69 | /* Enable overcurrent notification */ | 69 | /* Enable overcurrent notification */ |
70 | for (i = 0; i < data->ports; i++) { | 70 | for (i = 0; i < data->ports; i++) { |
71 | if (data->overcurrent_pin[i]) | 71 | if (gpio_is_valid(data->overcurrent_pin[i])) |
72 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 72 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
73 | } | 73 | } |
74 | 74 | ||
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index aa1e58729885..414bd855fb0c 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -72,7 +72,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
72 | 72 | ||
73 | /* Enable overcurrent notification */ | 73 | /* Enable overcurrent notification */ |
74 | for (i = 0; i < data->ports; i++) { | 74 | for (i = 0; i < data->ports; i++) { |
75 | if (data->overcurrent_pin[i]) | 75 | if (gpio_is_valid(data->overcurrent_pin[i])) |
76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
77 | } | 77 | } |
78 | 78 | ||
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index b9487696b7be..cd604aad8e96 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -72,7 +72,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
72 | 72 | ||
73 | /* Enable overcurrent notification */ | 73 | /* Enable overcurrent notification */ |
74 | for (i = 0; i < data->ports; i++) { | 74 | for (i = 0; i < data->ports; i++) { |
75 | if (data->overcurrent_pin[i]) | 75 | if (gpio_is_valid(data->overcurrent_pin[i])) |
76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 76 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
77 | } | 77 | } |
78 | 78 | ||
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index cb85da2eccea..9c61e59a2104 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -78,7 +78,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
78 | 78 | ||
79 | /* Enable overcurrent notification */ | 79 | /* Enable overcurrent notification */ |
80 | for (i = 0; i < data->ports; i++) { | 80 | for (i = 0; i < data->ports; i++) { |
81 | if (data->overcurrent_pin[i]) | 81 | if (gpio_is_valid(data->overcurrent_pin[i])) |
82 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 82 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
83 | } | 83 | } |
84 | 84 | ||
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index b1596072dcc2..fcd233cb33d2 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -1841,8 +1841,8 @@ static struct resource sha_resources[] = { | |||
1841 | .flags = IORESOURCE_MEM, | 1841 | .flags = IORESOURCE_MEM, |
1842 | }, | 1842 | }, |
1843 | [1] = { | 1843 | [1] = { |
1844 | .start = AT91SAM9G45_ID_AESTDESSHA, | 1844 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1845 | .end = AT91SAM9G45_ID_AESTDESSHA, | 1845 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1846 | .flags = IORESOURCE_IRQ, | 1846 | .flags = IORESOURCE_IRQ, |
1847 | }, | 1847 | }, |
1848 | }; | 1848 | }; |
@@ -1874,8 +1874,8 @@ static struct resource tdes_resources[] = { | |||
1874 | .flags = IORESOURCE_MEM, | 1874 | .flags = IORESOURCE_MEM, |
1875 | }, | 1875 | }, |
1876 | [1] = { | 1876 | [1] = { |
1877 | .start = AT91SAM9G45_ID_AESTDESSHA, | 1877 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1878 | .end = AT91SAM9G45_ID_AESTDESSHA, | 1878 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1879 | .flags = IORESOURCE_IRQ, | 1879 | .flags = IORESOURCE_IRQ, |
1880 | }, | 1880 | }, |
1881 | }; | 1881 | }; |
@@ -1910,8 +1910,8 @@ static struct resource aes_resources[] = { | |||
1910 | .flags = IORESOURCE_MEM, | 1910 | .flags = IORESOURCE_MEM, |
1911 | }, | 1911 | }, |
1912 | [1] = { | 1912 | [1] = { |
1913 | .start = AT91SAM9G45_ID_AESTDESSHA, | 1913 | .start = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1914 | .end = AT91SAM9G45_ID_AESTDESSHA, | 1914 | .end = NR_IRQS_LEGACY + AT91SAM9G45_ID_AESTDESSHA, |
1915 | .flags = IORESOURCE_IRQ, | 1915 | .flags = IORESOURCE_IRQ, |
1916 | }, | 1916 | }, |
1917 | }; | 1917 | }; |
diff --git a/arch/arm/mach-highbank/system.c b/arch/arm/mach-highbank/system.c index 82c27230d4a9..86e37cd9376c 100644 --- a/arch/arm/mach-highbank/system.c +++ b/arch/arm/mach-highbank/system.c | |||
@@ -28,6 +28,7 @@ void highbank_restart(char mode, const char *cmd) | |||
28 | hignbank_set_pwr_soft_reset(); | 28 | hignbank_set_pwr_soft_reset(); |
29 | 29 | ||
30 | scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); | 30 | scu_power_mode(scu_base_addr, SCU_PM_POWEROFF); |
31 | cpu_do_idle(); | 31 | while (1) |
32 | cpu_do_idle(); | ||
32 | } | 33 | } |
33 | 34 | ||
diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c index 3c1b8ff9a0a6..cc49c7ae186e 100644 --- a/arch/arm/mach-imx/clk-gate2.c +++ b/arch/arm/mach-imx/clk-gate2.c | |||
@@ -112,7 +112,7 @@ struct clk *clk_register_gate2(struct device *dev, const char *name, | |||
112 | 112 | ||
113 | clk = clk_register(dev, &gate->hw); | 113 | clk = clk_register(dev, &gate->hw); |
114 | if (IS_ERR(clk)) | 114 | if (IS_ERR(clk)) |
115 | kfree(clk); | 115 | kfree(gate); |
116 | 116 | ||
117 | return clk; | 117 | return clk; |
118 | } | 118 | } |
diff --git a/arch/arm/mach-imx/ehci-imx25.c b/arch/arm/mach-imx/ehci-imx25.c index 27e40d17de99..134c190e3003 100644 --- a/arch/arm/mach-imx/ehci-imx25.c +++ b/arch/arm/mach-imx/ehci-imx25.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define MX25_H1_SIC_SHIFT 21 | 30 | #define MX25_H1_SIC_SHIFT 21 |
31 | #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT) | 31 | #define MX25_H1_SIC_MASK (0x3 << MX25_H1_SIC_SHIFT) |
32 | #define MX25_H1_PP_BIT (1 << 18) | 32 | #define MX25_H1_PP_BIT (1 << 18) |
33 | #define MX25_H1_PM_BIT (1 << 8) | 33 | #define MX25_H1_PM_BIT (1 << 16) |
34 | #define MX25_H1_IPPUE_UP_BIT (1 << 7) | 34 | #define MX25_H1_IPPUE_UP_BIT (1 << 7) |
35 | #define MX25_H1_IPPUE_DOWN_BIT (1 << 6) | 35 | #define MX25_H1_IPPUE_DOWN_BIT (1 << 6) |
36 | #define MX25_H1_TLL_BIT (1 << 5) | 36 | #define MX25_H1_TLL_BIT (1 << 5) |
diff --git a/arch/arm/mach-imx/ehci-imx35.c b/arch/arm/mach-imx/ehci-imx35.c index a596f709a937..554e7cccff53 100644 --- a/arch/arm/mach-imx/ehci-imx35.c +++ b/arch/arm/mach-imx/ehci-imx35.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define MX35_H1_SIC_SHIFT 21 | 30 | #define MX35_H1_SIC_SHIFT 21 |
31 | #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT) | 31 | #define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT) |
32 | #define MX35_H1_PP_BIT (1 << 18) | 32 | #define MX35_H1_PP_BIT (1 << 18) |
33 | #define MX35_H1_PM_BIT (1 << 8) | 33 | #define MX35_H1_PM_BIT (1 << 16) |
34 | #define MX35_H1_IPPUE_UP_BIT (1 << 7) | 34 | #define MX35_H1_IPPUE_UP_BIT (1 << 7) |
35 | #define MX35_H1_IPPUE_DOWN_BIT (1 << 6) | 35 | #define MX35_H1_IPPUE_DOWN_BIT (1 << 6) |
36 | #define MX35_H1_TLL_BIT (1 << 5) | 36 | #define MX35_H1_TLL_BIT (1 << 5) |
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 50bca5032b7e..503d7dd944ff 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig | |||
@@ -46,6 +46,11 @@ config MACH_GURUPLUG | |||
46 | 46 | ||
47 | config ARCH_KIRKWOOD_DT | 47 | config ARCH_KIRKWOOD_DT |
48 | bool "Marvell Kirkwood Flattened Device Tree" | 48 | bool "Marvell Kirkwood Flattened Device Tree" |
49 | select POWER_SUPPLY | ||
50 | select POWER_RESET | ||
51 | select POWER_RESET_GPIO | ||
52 | select REGULATOR | ||
53 | select REGULATOR_FIXED_VOLTAGE | ||
49 | select USE_OF | 54 | select USE_OF |
50 | help | 55 | help |
51 | Say 'Y' here if you want your kernel to support the | 56 | Say 'Y' here if you want your kernel to support the |
@@ -130,6 +135,63 @@ config MACH_KM_KIRKWOOD_DT | |||
130 | Say 'Y' here if you want your kernel to support the | 135 | Say 'Y' here if you want your kernel to support the |
131 | Keymile Kirkwood Reference Desgin, using Flattened Device Tree. | 136 | Keymile Kirkwood Reference Desgin, using Flattened Device Tree. |
132 | 137 | ||
138 | config MACH_INETSPACE_V2_DT | ||
139 | bool "LaCie Internet Space v2 NAS (Flattened Device Tree)" | ||
140 | select ARCH_KIRKWOOD_DT | ||
141 | help | ||
142 | Say 'Y' here if you want your kernel to support the LaCie | ||
143 | Internet Space v2 NAS, using Flattened Device Tree. | ||
144 | |||
145 | config MACH_MPLCEC4_DT | ||
146 | bool "MPL CEC4 (Flattened Device Tree)" | ||
147 | select ARCH_KIRKWOOD_DT | ||
148 | help | ||
149 | Say 'Y' here if you want your kernel to support the | ||
150 | MPL CEC4 (Flattened Device Tree). | ||
151 | |||
152 | config MACH_NETSPACE_V2_DT | ||
153 | bool "LaCie Network Space v2 NAS (Flattened Device Tree)" | ||
154 | select ARCH_KIRKWOOD_DT | ||
155 | help | ||
156 | Say 'Y' here if you want your kernel to support the LaCie | ||
157 | Network Space v2 NAS, using Flattened Device Tree. | ||
158 | |||
159 | config MACH_NETSPACE_MAX_V2_DT | ||
160 | bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)" | ||
161 | select ARCH_KIRKWOOD_DT | ||
162 | help | ||
163 | Say 'Y' here if you want your kernel to support the LaCie | ||
164 | Network Space Max v2 NAS, using Flattened Device Tree. | ||
165 | |||
166 | config MACH_NETSPACE_LITE_V2_DT | ||
167 | bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)" | ||
168 | select ARCH_KIRKWOOD_DT | ||
169 | help | ||
170 | Say 'Y' here if you want your kernel to support the LaCie | ||
171 | Network Space Lite v2 NAS, using Flattened Device Tree. | ||
172 | |||
173 | config MACH_NETSPACE_MINI_V2_DT | ||
174 | bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)" | ||
175 | select ARCH_KIRKWOOD_DT | ||
176 | help | ||
177 | Say 'Y' here if you want your kernel to support the LaCie | ||
178 | Network Space Mini v2 NAS (aka SafeBox), using Flattened | ||
179 | Device Tree. | ||
180 | |||
181 | config MACH_OPENBLOCKS_A6_DT | ||
182 | bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)" | ||
183 | select ARCH_KIRKWOOD_DT | ||
184 | help | ||
185 | Say 'Y' here if you want your kernel to support the | ||
186 | Plat'Home OpenBlocks A6 (Flattened Device Tree). | ||
187 | |||
188 | config MACH_TOPKICK_DT | ||
189 | bool "USI Topkick (Flattened Device Tree)" | ||
190 | select ARCH_KIRKWOOD_DT | ||
191 | help | ||
192 | Say 'Y' here if you want your kernel to support the | ||
193 | USI Topkick, using Flattened Device Tree | ||
194 | |||
133 | config MACH_TS219 | 195 | config MACH_TS219 |
134 | bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" | 196 | bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" |
135 | help | 197 | help |
@@ -216,6 +278,14 @@ config MACH_T5325 | |||
216 | Say 'Y' here if you want your kernel to support the | 278 | Say 'Y' here if you want your kernel to support the |
217 | HP t5325 Thin Client. | 279 | HP t5325 Thin Client. |
218 | 280 | ||
281 | config MACH_NSA310_DT | ||
282 | bool "ZyXEL NSA-310 (Flattened Device Tree)" | ||
283 | select ARCH_KIRKWOOD_DT | ||
284 | select ARM_ATAG_DTB_COMPAT | ||
285 | help | ||
286 | Say 'Y' here if you want your kernel to support the | ||
287 | ZyXEL NSA-310 board (Flattened Device Tree). | ||
288 | |||
219 | endmenu | 289 | endmenu |
220 | 290 | ||
221 | endif | 291 | endif |
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 294779f892d9..8d2e5a96247c 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile | |||
@@ -31,3 +31,12 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o | |||
31 | obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o | 31 | obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o |
32 | obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o | 32 | obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o |
33 | obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o | 33 | obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o |
34 | obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o | ||
35 | obj-$(CONFIG_MACH_MPLCEC4_DT) += board-mplcec4.o | ||
36 | obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o | ||
37 | obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o | ||
38 | obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o | ||
39 | obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o | ||
40 | obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o | ||
41 | obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT) += board-openblocks_a6.o | ||
42 | obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o | ||
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c index 43d16d6714b8..a1aa87f09180 100644 --- a/arch/arm/mach-kirkwood/board-dnskw.c +++ b/arch/arm/mach-kirkwood/board-dnskw.c | |||
@@ -17,51 +17,11 @@ | |||
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include "common.h" | 19 | #include "common.h" |
20 | #include "mpp.h" | ||
21 | 20 | ||
22 | static struct mv643xx_eth_platform_data dnskw_ge00_data = { | 21 | static struct mv643xx_eth_platform_data dnskw_ge00_data = { |
23 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | 22 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), |
24 | }; | 23 | }; |
25 | 24 | ||
26 | static unsigned int dnskw_mpp_config[] __initdata = { | ||
27 | MPP13_UART1_TXD, /* Custom ... */ | ||
28 | MPP14_UART1_RXD, /* ... Controller (DNS-320 only) */ | ||
29 | MPP20_SATA1_ACTn, /* LED: White Right HDD */ | ||
30 | MPP21_SATA0_ACTn, /* LED: White Left HDD */ | ||
31 | MPP24_GPIO, | ||
32 | MPP25_GPIO, | ||
33 | MPP26_GPIO, /* LED: Power */ | ||
34 | MPP27_GPIO, /* LED: Red Right HDD */ | ||
35 | MPP28_GPIO, /* LED: Red Left HDD */ | ||
36 | MPP29_GPIO, /* LED: Red USB (DNS-325 only) */ | ||
37 | MPP30_GPIO, | ||
38 | MPP31_GPIO, | ||
39 | MPP32_GPIO, | ||
40 | MPP33_GPO, | ||
41 | MPP34_GPIO, /* Button: Front power */ | ||
42 | MPP35_GPIO, /* LED: Red USB (DNS-320 only) */ | ||
43 | MPP36_GPIO, /* Power: Turn off board */ | ||
44 | MPP37_GPIO, /* Power: Turn back on after power failure */ | ||
45 | MPP38_GPIO, | ||
46 | MPP39_GPIO, /* Power: SATA0 */ | ||
47 | MPP40_GPIO, /* Power: SATA1 */ | ||
48 | MPP41_GPIO, /* SATA0 present */ | ||
49 | MPP42_GPIO, /* SATA1 present */ | ||
50 | MPP43_GPIO, /* LED: White USB */ | ||
51 | MPP44_GPIO, /* Fan: Tachometer Pin */ | ||
52 | MPP45_GPIO, /* Fan: high speed */ | ||
53 | MPP46_GPIO, /* Fan: low speed */ | ||
54 | MPP47_GPIO, /* Button: Back unmount */ | ||
55 | MPP48_GPIO, /* Button: Back reset */ | ||
56 | MPP49_GPIO, /* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */ | ||
57 | 0 | ||
58 | }; | ||
59 | |||
60 | static void dnskw_power_off(void) | ||
61 | { | ||
62 | gpio_set_value(36, 1); | ||
63 | } | ||
64 | |||
65 | /* Register any GPIO for output and set the value */ | 25 | /* Register any GPIO for output and set the value */ |
66 | static void __init dnskw_gpio_register(unsigned gpio, char *name, int def) | 26 | static void __init dnskw_gpio_register(unsigned gpio, char *name, int def) |
67 | { | 27 | { |
@@ -76,22 +36,8 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def) | |||
76 | 36 | ||
77 | void __init dnskw_init(void) | 37 | void __init dnskw_init(void) |
78 | { | 38 | { |
79 | kirkwood_mpp_conf(dnskw_mpp_config); | ||
80 | |||
81 | kirkwood_ehci_init(); | ||
82 | kirkwood_ge00_init(&dnskw_ge00_data); | 39 | kirkwood_ge00_init(&dnskw_ge00_data); |
83 | 40 | ||
84 | /* Register power-off GPIO. */ | ||
85 | if (gpio_request(36, "dnskw:power:off") == 0 | ||
86 | && gpio_direction_output(36, 0) == 0) | ||
87 | pm_power_off = dnskw_power_off; | ||
88 | else | ||
89 | pr_err("dnskw: failed to configure power-off GPIO\n"); | ||
90 | |||
91 | /* Ensure power is supplied to both HDDs */ | ||
92 | dnskw_gpio_register(39, "dnskw:power:sata0", 1); | ||
93 | dnskw_gpio_register(40, "dnskw:power:sata1", 1); | ||
94 | |||
95 | /* Set NAS to turn back on after a power failure */ | 41 | /* Set NAS to turn back on after a power failure */ |
96 | dnskw_gpio_register(37, "dnskw:power:recover", 1); | 42 | dnskw_gpio_register(37, "dnskw:power:recover", 1); |
97 | } | 43 | } |
diff --git a/arch/arm/mach-kirkwood/board-dockstar.c b/arch/arm/mach-kirkwood/board-dockstar.c index f2fbb023e679..726cfc4b8921 100644 --- a/arch/arm/mach-kirkwood/board-dockstar.c +++ b/arch/arm/mach-kirkwood/board-dockstar.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/of_fdt.h> | 24 | #include <linux/of_fdt.h> |
25 | #include <linux/of_irq.h> | 25 | #include <linux/of_irq.h> |
26 | #include <linux/of_platform.h> | 26 | #include <linux/of_platform.h> |
27 | #include <linux/gpio.h> | ||
28 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
29 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
30 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
@@ -32,30 +31,15 @@ | |||
32 | #include <mach/bridge-regs.h> | 31 | #include <mach/bridge-regs.h> |
33 | #include <linux/platform_data/mmc-mvsdio.h> | 32 | #include <linux/platform_data/mmc-mvsdio.h> |
34 | #include "common.h" | 33 | #include "common.h" |
35 | #include "mpp.h" | ||
36 | 34 | ||
37 | static struct mv643xx_eth_platform_data dockstar_ge00_data = { | 35 | static struct mv643xx_eth_platform_data dockstar_ge00_data = { |
38 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | 36 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), |
39 | }; | 37 | }; |
40 | 38 | ||
41 | static unsigned int dockstar_mpp_config[] __initdata = { | ||
42 | MPP29_GPIO, /* USB Power Enable */ | ||
43 | MPP46_GPIO, /* LED green */ | ||
44 | MPP47_GPIO, /* LED orange */ | ||
45 | 0 | ||
46 | }; | ||
47 | |||
48 | void __init dockstar_dt_init(void) | 39 | void __init dockstar_dt_init(void) |
49 | { | 40 | { |
50 | /* | 41 | /* |
51 | * Basic setup. Needs to be called early. | 42 | * Basic setup. Needs to be called early. |
52 | */ | 43 | */ |
53 | kirkwood_mpp_conf(dockstar_mpp_config); | ||
54 | |||
55 | if (gpio_request(29, "USB Power Enable") != 0 || | ||
56 | gpio_direction_output(29, 1) != 0) | ||
57 | pr_err("can't setup GPIO 29 (USB Power Enable)\n"); | ||
58 | kirkwood_ehci_init(); | ||
59 | |||
60 | kirkwood_ge00_init(&dockstar_ge00_data); | 44 | kirkwood_ge00_init(&dockstar_ge00_data); |
61 | } | 45 | } |
diff --git a/arch/arm/mach-kirkwood/board-dreamplug.c b/arch/arm/mach-kirkwood/board-dreamplug.c index 20af53a56c0e..3e2d95d629ee 100644 --- a/arch/arm/mach-kirkwood/board-dreamplug.c +++ b/arch/arm/mach-kirkwood/board-dreamplug.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <mach/bridge-regs.h> | 32 | #include <mach/bridge-regs.h> |
33 | #include <linux/platform_data/mmc-mvsdio.h> | 33 | #include <linux/platform_data/mmc-mvsdio.h> |
34 | #include "common.h" | 34 | #include "common.h" |
35 | #include "mpp.h" | ||
36 | 35 | ||
37 | static struct mv643xx_eth_platform_data dreamplug_ge00_data = { | 36 | static struct mv643xx_eth_platform_data dreamplug_ge00_data = { |
38 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | 37 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), |
@@ -46,25 +45,11 @@ static struct mvsdio_platform_data dreamplug_mvsdio_data = { | |||
46 | /* unfortunately the CD signal has not been connected */ | 45 | /* unfortunately the CD signal has not been connected */ |
47 | }; | 46 | }; |
48 | 47 | ||
49 | static unsigned int dreamplug_mpp_config[] __initdata = { | ||
50 | MPP0_SPI_SCn, | ||
51 | MPP1_SPI_MOSI, | ||
52 | MPP2_SPI_SCK, | ||
53 | MPP3_SPI_MISO, | ||
54 | MPP47_GPIO, /* Bluetooth LED */ | ||
55 | MPP48_GPIO, /* Wifi LED */ | ||
56 | MPP49_GPIO, /* Wifi AP LED */ | ||
57 | 0 | ||
58 | }; | ||
59 | |||
60 | void __init dreamplug_init(void) | 48 | void __init dreamplug_init(void) |
61 | { | 49 | { |
62 | /* | 50 | /* |
63 | * Basic setup. Needs to be called early. | 51 | * Basic setup. Needs to be called early. |
64 | */ | 52 | */ |
65 | kirkwood_mpp_conf(dreamplug_mpp_config); | ||
66 | |||
67 | kirkwood_ehci_init(); | ||
68 | kirkwood_ge00_init(&dreamplug_ge00_data); | 53 | kirkwood_ge00_init(&dreamplug_ge00_data); |
69 | kirkwood_ge01_init(&dreamplug_ge01_data); | 54 | kirkwood_ge01_init(&dreamplug_ge01_data); |
70 | kirkwood_sdio_init(&dreamplug_mvsdio_data); | 55 | kirkwood_sdio_init(&dreamplug_mvsdio_data); |
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index d94872fed8c0..70eb01d96085 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c | |||
@@ -30,6 +30,8 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = { | |||
30 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), | 30 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), |
31 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", | 31 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", |
32 | NULL), | 32 | NULL), |
33 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011100, "mv64xxx_i2c.1", | ||
34 | NULL), | ||
33 | OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), | 35 | OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), |
34 | OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), | 36 | OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), |
35 | OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), | 37 | OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), |
@@ -94,6 +96,25 @@ static void __init kirkwood_dt_init(void) | |||
94 | if (of_machine_is_compatible("keymile,km_kirkwood")) | 96 | if (of_machine_is_compatible("keymile,km_kirkwood")) |
95 | km_kirkwood_init(); | 97 | km_kirkwood_init(); |
96 | 98 | ||
99 | if (of_machine_is_compatible("lacie,inetspace_v2") || | ||
100 | of_machine_is_compatible("lacie,netspace_v2") || | ||
101 | of_machine_is_compatible("lacie,netspace_max_v2") || | ||
102 | of_machine_is_compatible("lacie,netspace_lite_v2") || | ||
103 | of_machine_is_compatible("lacie,netspace_mini_v2")) | ||
104 | ns2_init(); | ||
105 | |||
106 | if (of_machine_is_compatible("mpl,cec4")) | ||
107 | mplcec4_init(); | ||
108 | |||
109 | if (of_machine_is_compatible("plathome,openblocks-a6")) | ||
110 | openblocks_a6_init(); | ||
111 | |||
112 | if (of_machine_is_compatible("usi,topkick")) | ||
113 | usi_topkick_init(); | ||
114 | |||
115 | if (of_machine_is_compatible("zyxel,nsa310")) | ||
116 | nsa310_init(); | ||
117 | |||
97 | of_platform_populate(NULL, kirkwood_dt_match_table, | 118 | of_platform_populate(NULL, kirkwood_dt_match_table, |
98 | kirkwood_auxdata_lookup, NULL); | 119 | kirkwood_auxdata_lookup, NULL); |
99 | } | 120 | } |
@@ -110,6 +131,15 @@ static const char *kirkwood_dt_board_compat[] = { | |||
110 | "buffalo,lsxl", | 131 | "buffalo,lsxl", |
111 | "iom,ix2-200", | 132 | "iom,ix2-200", |
112 | "keymile,km_kirkwood", | 133 | "keymile,km_kirkwood", |
134 | "lacie,inetspace_v2", | ||
135 | "lacie,netspace_max_v2", | ||
136 | "lacie,netspace_v2", | ||
137 | "lacie,netspace_lite_v2", | ||
138 | "lacie,netspace_mini_v2", | ||
139 | "mpl,cec4", | ||
140 | "plathome,openblocks-a6", | ||
141 | "usi,topkick", | ||
142 | "zyxel,nsa310", | ||
113 | NULL | 143 | NULL |
114 | }; | 144 | }; |
115 | 145 | ||
diff --git a/arch/arm/mach-kirkwood/board-goflexnet.c b/arch/arm/mach-kirkwood/board-goflexnet.c index 001ca8c96980..3b9661802f8c 100644 --- a/arch/arm/mach-kirkwood/board-goflexnet.c +++ b/arch/arm/mach-kirkwood/board-goflexnet.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/of_fdt.h> | 26 | #include <linux/of_fdt.h> |
27 | #include <linux/of_irq.h> | 27 | #include <linux/of_irq.h> |
28 | #include <linux/of_platform.h> | 28 | #include <linux/of_platform.h> |
29 | #include <linux/gpio.h> | ||
30 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/map.h> | 31 | #include <asm/mach/map.h> |
@@ -34,38 +33,15 @@ | |||
34 | #include <mach/bridge-regs.h> | 33 | #include <mach/bridge-regs.h> |
35 | #include <linux/platform_data/mmc-mvsdio.h> | 34 | #include <linux/platform_data/mmc-mvsdio.h> |
36 | #include "common.h" | 35 | #include "common.h" |
37 | #include "mpp.h" | ||
38 | 36 | ||
39 | static struct mv643xx_eth_platform_data goflexnet_ge00_data = { | 37 | static struct mv643xx_eth_platform_data goflexnet_ge00_data = { |
40 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | 38 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), |
41 | }; | 39 | }; |
42 | 40 | ||
43 | static unsigned int goflexnet_mpp_config[] __initdata = { | ||
44 | MPP29_GPIO, /* USB Power Enable */ | ||
45 | MPP47_GPIO, /* LED Orange */ | ||
46 | MPP46_GPIO, /* LED Green */ | ||
47 | MPP45_GPIO, /* LED Left Capacity 3 */ | ||
48 | MPP44_GPIO, /* LED Left Capacity 2 */ | ||
49 | MPP43_GPIO, /* LED Left Capacity 1 */ | ||
50 | MPP42_GPIO, /* LED Left Capacity 0 */ | ||
51 | MPP41_GPIO, /* LED Right Capacity 3 */ | ||
52 | MPP40_GPIO, /* LED Right Capacity 2 */ | ||
53 | MPP39_GPIO, /* LED Right Capacity 1 */ | ||
54 | MPP38_GPIO, /* LED Right Capacity 0 */ | ||
55 | 0 | ||
56 | }; | ||
57 | |||
58 | void __init goflexnet_init(void) | 41 | void __init goflexnet_init(void) |
59 | { | 42 | { |
60 | /* | 43 | /* |
61 | * Basic setup. Needs to be called early. | 44 | * Basic setup. Needs to be called early. |
62 | */ | 45 | */ |
63 | kirkwood_mpp_conf(goflexnet_mpp_config); | ||
64 | |||
65 | if (gpio_request(29, "USB Power Enable") != 0 || | ||
66 | gpio_direction_output(29, 1) != 0) | ||
67 | pr_err("can't setup GPIO 29 (USB Power Enable)\n"); | ||
68 | kirkwood_ehci_init(); | ||
69 | |||
70 | kirkwood_ge00_init(&goflexnet_ge00_data); | 46 | kirkwood_ge00_init(&goflexnet_ge00_data); |
71 | } | 47 | } |
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c index cfc47f80e734..b6e5db9c7ed0 100644 --- a/arch/arm/mach-kirkwood/board-ib62x0.c +++ b/arch/arm/mach-kirkwood/board-ib62x0.c | |||
@@ -17,55 +17,20 @@ | |||
17 | #include <linux/mtd/partitions.h> | 17 | #include <linux/mtd/partitions.h> |
18 | #include <linux/ata_platform.h> | 18 | #include <linux/ata_platform.h> |
19 | #include <linux/mv643xx_eth.h> | 19 | #include <linux/mv643xx_eth.h> |
20 | #include <linux/gpio.h> | ||
21 | #include <linux/input.h> | 20 | #include <linux/input.h> |
22 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
24 | #include <mach/kirkwood.h> | 23 | #include <mach/kirkwood.h> |
25 | #include "common.h" | 24 | #include "common.h" |
26 | #include "mpp.h" | ||
27 | |||
28 | #define IB62X0_GPIO_POWER_OFF 24 | ||
29 | 25 | ||
30 | static struct mv643xx_eth_platform_data ib62x0_ge00_data = { | 26 | static struct mv643xx_eth_platform_data ib62x0_ge00_data = { |
31 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | 27 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), |
32 | }; | 28 | }; |
33 | 29 | ||
34 | static unsigned int ib62x0_mpp_config[] __initdata = { | ||
35 | MPP0_NF_IO2, | ||
36 | MPP1_NF_IO3, | ||
37 | MPP2_NF_IO4, | ||
38 | MPP3_NF_IO5, | ||
39 | MPP4_NF_IO6, | ||
40 | MPP5_NF_IO7, | ||
41 | MPP18_NF_IO0, | ||
42 | MPP19_NF_IO1, | ||
43 | MPP22_GPIO, /* OS LED red */ | ||
44 | MPP24_GPIO, /* Power off device */ | ||
45 | MPP25_GPIO, /* OS LED green */ | ||
46 | MPP27_GPIO, /* USB transfer LED */ | ||
47 | MPP28_GPIO, /* Reset button */ | ||
48 | MPP29_GPIO, /* USB Copy button */ | ||
49 | 0 | ||
50 | }; | ||
51 | |||
52 | static void ib62x0_power_off(void) | ||
53 | { | ||
54 | gpio_set_value(IB62X0_GPIO_POWER_OFF, 1); | ||
55 | } | ||
56 | |||
57 | void __init ib62x0_init(void) | 30 | void __init ib62x0_init(void) |
58 | { | 31 | { |
59 | /* | 32 | /* |
60 | * Basic setup. Needs to be called early. | 33 | * Basic setup. Needs to be called early. |
61 | */ | 34 | */ |
62 | kirkwood_mpp_conf(ib62x0_mpp_config); | ||
63 | |||
64 | kirkwood_ehci_init(); | ||
65 | kirkwood_ge00_init(&ib62x0_ge00_data); | 35 | kirkwood_ge00_init(&ib62x0_ge00_data); |
66 | if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 && | ||
67 | gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0) | ||
68 | pm_power_off = ib62x0_power_off; | ||
69 | else | ||
70 | pr_err("board-ib62x0: failed to configure power-off GPIO\n"); | ||
71 | } | 36 | } |
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c index d084b1e2943a..7d3c54c8490b 100644 --- a/arch/arm/mach-kirkwood/board-iconnect.c +++ b/arch/arm/mach-kirkwood/board-iconnect.c | |||
@@ -21,31 +21,13 @@ | |||
21 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
22 | #include <mach/kirkwood.h> | 22 | #include <mach/kirkwood.h> |
23 | #include "common.h" | 23 | #include "common.h" |
24 | #include "mpp.h" | ||
25 | 24 | ||
26 | static struct mv643xx_eth_platform_data iconnect_ge00_data = { | 25 | static struct mv643xx_eth_platform_data iconnect_ge00_data = { |
27 | .phy_addr = MV643XX_ETH_PHY_ADDR(11), | 26 | .phy_addr = MV643XX_ETH_PHY_ADDR(11), |
28 | }; | 27 | }; |
29 | 28 | ||
30 | static unsigned int iconnect_mpp_config[] __initdata = { | ||
31 | MPP12_GPIO, | ||
32 | MPP35_GPIO, | ||
33 | MPP41_GPIO, | ||
34 | MPP42_GPIO, | ||
35 | MPP43_GPIO, | ||
36 | MPP44_GPIO, | ||
37 | MPP45_GPIO, | ||
38 | MPP46_GPIO, | ||
39 | MPP47_GPIO, | ||
40 | MPP48_GPIO, | ||
41 | 0 | ||
42 | }; | ||
43 | |||
44 | void __init iconnect_init(void) | 29 | void __init iconnect_init(void) |
45 | { | 30 | { |
46 | kirkwood_mpp_conf(iconnect_mpp_config); | ||
47 | |||
48 | kirkwood_ehci_init(); | ||
49 | kirkwood_ge00_init(&iconnect_ge00_data); | 31 | kirkwood_ge00_init(&iconnect_ge00_data); |
50 | } | 32 | } |
51 | 33 | ||
diff --git a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c index 158fb97d0397..22b86494671f 100644 --- a/arch/arm/mach-kirkwood/board-iomega_ix2_200.c +++ b/arch/arm/mach-kirkwood/board-iomega_ix2_200.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/ethtool.h> | 15 | #include <linux/ethtool.h> |
16 | #include <mach/kirkwood.h> | 16 | #include <mach/kirkwood.h> |
17 | #include "common.h" | 17 | #include "common.h" |
18 | #include "mpp.h" | ||
19 | 18 | ||
20 | static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { | 19 | static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { |
21 | .phy_addr = MV643XX_ETH_PHY_NONE, | 20 | .phy_addr = MV643XX_ETH_PHY_NONE, |
@@ -23,35 +22,10 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { | |||
23 | .duplex = DUPLEX_FULL, | 22 | .duplex = DUPLEX_FULL, |
24 | }; | 23 | }; |
25 | 24 | ||
26 | static unsigned int iomega_ix2_200_mpp_config[] __initdata = { | ||
27 | MPP12_GPIO, /* Reset Button */ | ||
28 | MPP14_GPIO, /* Power Button */ | ||
29 | MPP15_GPIO, /* Backup LED (blue) */ | ||
30 | MPP16_GPIO, /* Power LED (white) */ | ||
31 | MPP35_GPIO, /* OTB Button */ | ||
32 | MPP36_GPIO, /* Rebuild LED (white) */ | ||
33 | MPP37_GPIO, /* Health LED (red) */ | ||
34 | MPP38_GPIO, /* SATA LED brightness control 1 */ | ||
35 | MPP39_GPIO, /* SATA LED brightness control 2 */ | ||
36 | MPP40_GPIO, /* Backup LED brightness control 1 */ | ||
37 | MPP41_GPIO, /* Backup LED brightness control 2 */ | ||
38 | MPP42_GPIO, /* Power LED brightness control 1 */ | ||
39 | MPP43_GPIO, /* Power LED brightness control 2 */ | ||
40 | MPP44_GPIO, /* Health LED brightness control 1 */ | ||
41 | MPP45_GPIO, /* Health LED brightness control 2 */ | ||
42 | MPP46_GPIO, /* Rebuild LED brightness control 1 */ | ||
43 | MPP47_GPIO, /* Rebuild LED brightness control 2 */ | ||
44 | 0 | ||
45 | }; | ||
46 | |||
47 | void __init iomega_ix2_200_init(void) | 25 | void __init iomega_ix2_200_init(void) |
48 | { | 26 | { |
49 | /* | 27 | /* |
50 | * Basic setup. Needs to be called early. | 28 | * Basic setup. Needs to be called early. |
51 | */ | 29 | */ |
52 | kirkwood_mpp_conf(iomega_ix2_200_mpp_config); | ||
53 | |||
54 | kirkwood_ehci_init(); | ||
55 | |||
56 | kirkwood_ge01_init(&iomega_ix2_200_ge00_data); | 30 | kirkwood_ge01_init(&iomega_ix2_200_ge00_data); |
57 | } | 31 | } |
diff --git a/arch/arm/mach-kirkwood/board-km_kirkwood.c b/arch/arm/mach-kirkwood/board-km_kirkwood.c index f7d32834b757..44e4605ba0bf 100644 --- a/arch/arm/mach-kirkwood/board-km_kirkwood.c +++ b/arch/arm/mach-kirkwood/board-km_kirkwood.c | |||
@@ -18,27 +18,15 @@ | |||
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/clk-private.h> | 19 | #include <linux/clk-private.h> |
20 | #include "common.h" | 20 | #include "common.h" |
21 | #include "mpp.h" | ||
22 | 21 | ||
23 | static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = { | 22 | static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = { |
24 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | 23 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), |
25 | }; | 24 | }; |
26 | 25 | ||
27 | static unsigned int km_kirkwood_mpp_config[] __initdata = { | ||
28 | MPP8_GPIO, /* I2C SDA */ | ||
29 | MPP9_GPIO, /* I2C SCL */ | ||
30 | 0 | ||
31 | }; | ||
32 | |||
33 | void __init km_kirkwood_init(void) | 26 | void __init km_kirkwood_init(void) |
34 | { | 27 | { |
35 | struct clk *sata_clk; | 28 | struct clk *sata_clk; |
36 | /* | 29 | /* |
37 | * Basic setup. Needs to be called early. | ||
38 | */ | ||
39 | kirkwood_mpp_conf(km_kirkwood_mpp_config); | ||
40 | |||
41 | /* | ||
42 | * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing | 30 | * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing |
43 | * SATA bits (14-15) of the Clock Gating Control Register. Since these | 31 | * SATA bits (14-15) of the Clock Gating Control Register. Since these |
44 | * devices are also not present in this variant, their clocks get | 32 | * devices are also not present in this variant, their clocks get |
@@ -52,6 +40,5 @@ void __init km_kirkwood_init(void) | |||
52 | if (!IS_ERR(sata_clk)) | 40 | if (!IS_ERR(sata_clk)) |
53 | sata_clk->flags |= CLK_IGNORE_UNUSED; | 41 | sata_clk->flags |= CLK_IGNORE_UNUSED; |
54 | 42 | ||
55 | kirkwood_ehci_init(); | ||
56 | kirkwood_ge00_init(&km_kirkwood_ge00_data); | 43 | kirkwood_ge00_init(&km_kirkwood_ge00_data); |
57 | } | 44 | } |
diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c index 83d8975592f8..d60cdab46f4b 100644 --- a/arch/arm/mach-kirkwood/board-lsxl.c +++ b/arch/arm/mach-kirkwood/board-lsxl.c | |||
@@ -19,14 +19,7 @@ | |||
19 | #include <linux/spi/flash.h> | 19 | #include <linux/spi/flash.h> |
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | #include <linux/mv643xx_eth.h> | 21 | #include <linux/mv643xx_eth.h> |
22 | #include <linux/gpio.h> | ||
23 | #include <linux/gpio-fan.h> | ||
24 | #include <linux/input.h> | ||
25 | #include <asm/mach-types.h> | ||
26 | #include <asm/mach/arch.h> | ||
27 | #include <mach/kirkwood.h> | ||
28 | #include "common.h" | 22 | #include "common.h" |
29 | #include "mpp.h" | ||
30 | 23 | ||
31 | static struct mv643xx_eth_platform_data lsxl_ge00_data = { | 24 | static struct mv643xx_eth_platform_data lsxl_ge00_data = { |
32 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | 25 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), |
@@ -36,68 +29,6 @@ static struct mv643xx_eth_platform_data lsxl_ge01_data = { | |||
36 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | 29 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), |
37 | }; | 30 | }; |
38 | 31 | ||
39 | static unsigned int lsxl_mpp_config[] __initdata = { | ||
40 | MPP10_GPO, /* HDD Power Enable */ | ||
41 | MPP11_GPIO, /* USB Vbus Enable */ | ||
42 | MPP18_GPO, /* FAN High Enable# */ | ||
43 | MPP19_GPO, /* FAN Low Enable# */ | ||
44 | MPP36_GPIO, /* Function Blue LED */ | ||
45 | MPP37_GPIO, /* Alarm LED */ | ||
46 | MPP38_GPIO, /* Info LED */ | ||
47 | MPP39_GPIO, /* Power LED */ | ||
48 | MPP40_GPIO, /* Fan Lock */ | ||
49 | MPP41_GPIO, /* Function Button */ | ||
50 | MPP42_GPIO, /* Power Switch */ | ||
51 | MPP43_GPIO, /* Power Auto Switch */ | ||
52 | MPP48_GPIO, /* Function Red LED */ | ||
53 | 0 | ||
54 | }; | ||
55 | |||
56 | #define LSXL_GPIO_FAN_HIGH 18 | ||
57 | #define LSXL_GPIO_FAN_LOW 19 | ||
58 | #define LSXL_GPIO_FAN_LOCK 40 | ||
59 | |||
60 | static struct gpio_fan_alarm lsxl_alarm = { | ||
61 | .gpio = LSXL_GPIO_FAN_LOCK, | ||
62 | }; | ||
63 | |||
64 | static struct gpio_fan_speed lsxl_speeds[] = { | ||
65 | { | ||
66 | .rpm = 0, | ||
67 | .ctrl_val = 3, | ||
68 | }, { | ||
69 | .rpm = 1500, | ||
70 | .ctrl_val = 1, | ||
71 | }, { | ||
72 | .rpm = 3250, | ||
73 | .ctrl_val = 2, | ||
74 | }, { | ||
75 | .rpm = 5000, | ||
76 | .ctrl_val = 0, | ||
77 | } | ||
78 | }; | ||
79 | |||
80 | static int lsxl_gpio_list[] = { | ||
81 | LSXL_GPIO_FAN_HIGH, LSXL_GPIO_FAN_LOW, | ||
82 | }; | ||
83 | |||
84 | static struct gpio_fan_platform_data lsxl_fan_data = { | ||
85 | .num_ctrl = ARRAY_SIZE(lsxl_gpio_list), | ||
86 | .ctrl = lsxl_gpio_list, | ||
87 | .alarm = &lsxl_alarm, | ||
88 | .num_speed = ARRAY_SIZE(lsxl_speeds), | ||
89 | .speed = lsxl_speeds, | ||
90 | }; | ||
91 | |||
92 | static struct platform_device lsxl_fan_device = { | ||
93 | .name = "gpio-fan", | ||
94 | .id = -1, | ||
95 | .num_resources = 0, | ||
96 | .dev = { | ||
97 | .platform_data = &lsxl_fan_data, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | /* | 32 | /* |
102 | * On the LS-XHL/LS-CHLv2, the shutdown process is following: | 33 | * On the LS-XHL/LS-CHLv2, the shutdown process is following: |
103 | * - Userland monitors key events until the power switch goes to off position | 34 | * - Userland monitors key events until the power switch goes to off position |
@@ -111,24 +42,14 @@ static void lsxl_power_off(void) | |||
111 | kirkwood_restart('h', NULL); | 42 | kirkwood_restart('h', NULL); |
112 | } | 43 | } |
113 | 44 | ||
114 | #define LSXL_GPIO_HDD_POWER 10 | ||
115 | #define LSXL_GPIO_USB_POWER 11 | ||
116 | |||
117 | void __init lsxl_init(void) | 45 | void __init lsxl_init(void) |
118 | { | 46 | { |
119 | /* | 47 | /* |
120 | * Basic setup. Needs to be called early. | 48 | * Basic setup. Needs to be called early. |
121 | */ | 49 | */ |
122 | kirkwood_mpp_conf(lsxl_mpp_config); | ||
123 | |||
124 | /* usb and sata power on */ | ||
125 | gpio_set_value(LSXL_GPIO_USB_POWER, 1); | ||
126 | gpio_set_value(LSXL_GPIO_HDD_POWER, 1); | ||
127 | 50 | ||
128 | kirkwood_ehci_init(); | ||
129 | kirkwood_ge00_init(&lsxl_ge00_data); | 51 | kirkwood_ge00_init(&lsxl_ge00_data); |
130 | kirkwood_ge01_init(&lsxl_ge01_data); | 52 | kirkwood_ge01_init(&lsxl_ge01_data); |
131 | platform_device_register(&lsxl_fan_device); | ||
132 | 53 | ||
133 | /* register power-off method */ | 54 | /* register power-off method */ |
134 | pm_power_off = lsxl_power_off; | 55 | pm_power_off = lsxl_power_off; |
diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c new file mode 100644 index 000000000000..56bfe5a1605a --- /dev/null +++ b/arch/arm/mach-kirkwood/board-mplcec4.c | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 MPL AG, Switzerland | ||
3 | * Stefan Peter <s.peter@mpl.ch> | ||
4 | * | ||
5 | * arch/arm/mach-kirkwood/board-mplcec4.c | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public | ||
8 | * License version 2. This program is licensed "as is" without any | ||
9 | * warranty of any kind, whether express or implied. | ||
10 | */ | ||
11 | |||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/mv643xx_eth.h> | ||
15 | #include <linux/platform_data/mmc-mvsdio.h> | ||
16 | #include "common.h" | ||
17 | #include "mpp.h" | ||
18 | |||
19 | static struct mv643xx_eth_platform_data mplcec4_ge00_data = { | ||
20 | .phy_addr = MV643XX_ETH_PHY_ADDR(1), | ||
21 | }; | ||
22 | |||
23 | static struct mv643xx_eth_platform_data mplcec4_ge01_data = { | ||
24 | .phy_addr = MV643XX_ETH_PHY_ADDR(2), | ||
25 | }; | ||
26 | |||
27 | static struct mvsdio_platform_data mplcec4_mvsdio_data = { | ||
28 | .gpio_card_detect = 47, /* MPP47 used as SD card detect */ | ||
29 | }; | ||
30 | |||
31 | |||
32 | void __init mplcec4_init(void) | ||
33 | { | ||
34 | /* | ||
35 | * Basic setup. Needs to be called early. | ||
36 | */ | ||
37 | kirkwood_ge00_init(&mplcec4_ge00_data); | ||
38 | kirkwood_ge01_init(&mplcec4_ge01_data); | ||
39 | kirkwood_sdio_init(&mplcec4_mvsdio_data); | ||
40 | kirkwood_pcie_init(KW_PCIE0); | ||
41 | } | ||
42 | |||
43 | |||
44 | |||
diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c new file mode 100644 index 000000000000..8821720ab5a4 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-ns2.c | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Simon Guinot <simon.guinot@sequanux.org> | ||
3 | * | ||
4 | * arch/arm/mach-kirkwood/board-ns2.c | ||
5 | * | ||
6 | * LaCie Network Space v2 board (and parents) initialization for drivers | ||
7 | * not converted to 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/mv643xx_eth.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <linux/of.h> | ||
20 | #include "common.h" | ||
21 | #include "mpp.h" | ||
22 | |||
23 | static struct mv643xx_eth_platform_data ns2_ge00_data = { | ||
24 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | ||
25 | }; | ||
26 | |||
27 | static unsigned int ns2_mpp_config[] __initdata = { | ||
28 | MPP0_SPI_SCn, | ||
29 | MPP1_SPI_MOSI, | ||
30 | MPP2_SPI_SCK, | ||
31 | MPP3_SPI_MISO, | ||
32 | MPP4_NF_IO6, | ||
33 | MPP5_NF_IO7, | ||
34 | MPP6_SYSRST_OUTn, | ||
35 | MPP7_GPO, /* Fan speed (bit 1) */ | ||
36 | MPP8_TW0_SDA, | ||
37 | MPP9_TW0_SCK, | ||
38 | MPP10_UART0_TXD, | ||
39 | MPP11_UART0_RXD, | ||
40 | MPP12_GPO, /* Red led */ | ||
41 | MPP14_GPIO, /* USB fuse */ | ||
42 | MPP16_GPIO, /* SATA 0 power */ | ||
43 | MPP17_GPIO, /* SATA 1 power */ | ||
44 | MPP18_NF_IO0, | ||
45 | MPP19_NF_IO1, | ||
46 | MPP20_SATA1_ACTn, | ||
47 | MPP21_SATA0_ACTn, | ||
48 | MPP22_GPIO, /* Fan speed (bit 0) */ | ||
49 | MPP23_GPIO, /* Fan power */ | ||
50 | MPP24_GPIO, /* USB mode select */ | ||
51 | MPP25_GPIO, /* Fan rotation fail */ | ||
52 | MPP26_GPIO, /* USB device vbus */ | ||
53 | MPP28_GPIO, /* USB enable host vbus */ | ||
54 | MPP29_GPIO, /* Blue led (slow register) */ | ||
55 | MPP30_GPIO, /* Blue led (command register) */ | ||
56 | MPP31_GPIO, /* Board power off */ | ||
57 | MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */ | ||
58 | MPP33_GPO, /* Fan speed (bit 2) */ | ||
59 | 0 | ||
60 | }; | ||
61 | |||
62 | #define NS2_GPIO_POWER_OFF 31 | ||
63 | |||
64 | static void ns2_power_off(void) | ||
65 | { | ||
66 | gpio_set_value(NS2_GPIO_POWER_OFF, 1); | ||
67 | } | ||
68 | |||
69 | void __init ns2_init(void) | ||
70 | { | ||
71 | /* | ||
72 | * Basic setup. Needs to be called early. | ||
73 | */ | ||
74 | kirkwood_mpp_conf(ns2_mpp_config); | ||
75 | |||
76 | if (of_machine_is_compatible("lacie,netspace_lite_v2") || | ||
77 | of_machine_is_compatible("lacie,netspace_mini_v2")) | ||
78 | ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); | ||
79 | kirkwood_ge00_init(&ns2_ge00_data); | ||
80 | |||
81 | if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 && | ||
82 | gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0) | ||
83 | pm_power_off = ns2_power_off; | ||
84 | else | ||
85 | pr_err("ns2: failed to configure power-off GPIO\n"); | ||
86 | } | ||
diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c new file mode 100644 index 000000000000..f58d2e1a4042 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-nsa310.c | |||
@@ -0,0 +1,101 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-kirkwood/nsa-310-setup.c | ||
3 | * | ||
4 | * ZyXEL NSA-310 Setup | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/i2c.h> | ||
14 | #include <linux/gpio.h> | ||
15 | |||
16 | #include <asm/mach-types.h> | ||
17 | #include <asm/mach/arch.h> | ||
18 | #include <mach/kirkwood.h> | ||
19 | #include "common.h" | ||
20 | #include "mpp.h" | ||
21 | |||
22 | #define NSA310_GPIO_USB_POWER_OFF 21 | ||
23 | #define NSA310_GPIO_POWER_OFF 48 | ||
24 | |||
25 | static unsigned int nsa310_mpp_config[] __initdata = { | ||
26 | MPP12_GPIO, /* led esata green */ | ||
27 | MPP13_GPIO, /* led esata red */ | ||
28 | MPP15_GPIO, /* led usb green */ | ||
29 | MPP16_GPIO, /* led usb red */ | ||
30 | MPP21_GPIO, /* control usb power off */ | ||
31 | MPP28_GPIO, /* led sys green */ | ||
32 | MPP29_GPIO, /* led sys red */ | ||
33 | MPP36_GPIO, /* key reset */ | ||
34 | MPP37_GPIO, /* key copy */ | ||
35 | MPP39_GPIO, /* led copy green */ | ||
36 | MPP40_GPIO, /* led copy red */ | ||
37 | MPP41_GPIO, /* led hdd green */ | ||
38 | MPP42_GPIO, /* led hdd red */ | ||
39 | MPP44_GPIO, /* ?? */ | ||
40 | MPP46_GPIO, /* key power */ | ||
41 | MPP48_GPIO, /* control power off */ | ||
42 | 0 | ||
43 | }; | ||
44 | |||
45 | static struct i2c_board_info __initdata nsa310_i2c_info[] = { | ||
46 | { I2C_BOARD_INFO("adt7476", 0x2e) }, | ||
47 | }; | ||
48 | |||
49 | static void nsa310_power_off(void) | ||
50 | { | ||
51 | gpio_set_value(NSA310_GPIO_POWER_OFF, 1); | ||
52 | } | ||
53 | |||
54 | static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags, | ||
55 | const char *label) | ||
56 | { | ||
57 | int err; | ||
58 | |||
59 | err = gpio_request_one(gpio, flags, label); | ||
60 | if (err) | ||
61 | pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n", | ||
62 | gpio, label, err); | ||
63 | |||
64 | return err; | ||
65 | } | ||
66 | |||
67 | static void __init nsa310_gpio_init(void) | ||
68 | { | ||
69 | int err; | ||
70 | |||
71 | err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW, | ||
72 | "Power Off"); | ||
73 | if (!err) | ||
74 | pm_power_off = nsa310_power_off; | ||
75 | |||
76 | nsa310_gpio_request(NSA310_GPIO_USB_POWER_OFF, GPIOF_OUT_INIT_LOW, | ||
77 | "USB Power Off"); | ||
78 | } | ||
79 | |||
80 | void __init nsa310_init(void) | ||
81 | { | ||
82 | u32 dev, rev; | ||
83 | |||
84 | kirkwood_mpp_conf(nsa310_mpp_config); | ||
85 | |||
86 | nsa310_gpio_init(); | ||
87 | |||
88 | kirkwood_pcie_id(&dev, &rev); | ||
89 | |||
90 | i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info)); | ||
91 | } | ||
92 | |||
93 | static int __init nsa310_pci_init(void) | ||
94 | { | ||
95 | if (of_machine_is_compatible("zyxel,nsa310")) | ||
96 | kirkwood_pcie_init(KW_PCIE0); | ||
97 | |||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | subsys_initcall(nsa310_pci_init); | ||
diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c new file mode 100644 index 000000000000..815fc6451d52 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-openblocks_a6.c | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org> | ||
3 | * | ||
4 | * arch/arm/mach-kirkwood/board-openblocks_a6.c | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/mv643xx_eth.h> | ||
14 | #include <linux/clk.h> | ||
15 | #include <linux/clk-private.h> | ||
16 | #include "common.h" | ||
17 | #include "mpp.h" | ||
18 | |||
19 | static struct mv643xx_eth_platform_data openblocks_ge00_data = { | ||
20 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
21 | }; | ||
22 | |||
23 | static unsigned int openblocks_a6_mpp_config[] __initdata = { | ||
24 | MPP0_NF_IO2, | ||
25 | MPP1_NF_IO3, | ||
26 | MPP2_NF_IO4, | ||
27 | MPP3_NF_IO5, | ||
28 | MPP4_NF_IO6, | ||
29 | MPP5_NF_IO7, | ||
30 | MPP6_SYSRST_OUTn, | ||
31 | MPP8_UART1_RTS, | ||
32 | MPP9_UART1_CTS, | ||
33 | MPP10_UART0_TXD, | ||
34 | MPP11_UART0_RXD, | ||
35 | MPP13_UART1_TXD, | ||
36 | MPP14_UART1_RXD, | ||
37 | MPP15_UART0_RTS, | ||
38 | MPP16_UART0_CTS, | ||
39 | MPP18_NF_IO0, | ||
40 | MPP19_NF_IO1, | ||
41 | MPP20_GPIO, /* DIP SW0 */ | ||
42 | MPP21_GPIO, /* DIP SW1 */ | ||
43 | MPP22_GPIO, /* DIP SW2 */ | ||
44 | MPP23_GPIO, /* DIP SW3 */ | ||
45 | MPP24_GPIO, /* GPIO 0 */ | ||
46 | MPP25_GPIO, /* GPIO 1 */ | ||
47 | MPP26_GPIO, /* GPIO 2 */ | ||
48 | MPP27_GPIO, /* GPIO 3 */ | ||
49 | MPP28_GPIO, /* GPIO 4 */ | ||
50 | MPP29_GPIO, /* GPIO 5 */ | ||
51 | MPP30_GPIO, /* GPIO 6 */ | ||
52 | MPP31_GPIO, /* GPIO 7 */ | ||
53 | MPP36_TW1_SDA, | ||
54 | MPP37_TW1_SCK, | ||
55 | MPP38_GPIO, /* INIT */ | ||
56 | MPP39_GPIO, /* USB OC */ | ||
57 | MPP41_GPIO, /* LED: Red */ | ||
58 | MPP42_GPIO, /* LED: Green */ | ||
59 | MPP43_GPIO, /* LED: Yellow */ | ||
60 | 0, | ||
61 | }; | ||
62 | |||
63 | void __init openblocks_a6_init(void) | ||
64 | { | ||
65 | /* | ||
66 | * Basic setup. Needs to be called early. | ||
67 | */ | ||
68 | kirkwood_mpp_conf(openblocks_a6_mpp_config); | ||
69 | kirkwood_ge00_init(&openblocks_ge00_data); | ||
70 | } | ||
diff --git a/arch/arm/mach-kirkwood/board-ts219.c b/arch/arm/mach-kirkwood/board-ts219.c index 1750e68506c1..329ff682e4e6 100644 --- a/arch/arm/mach-kirkwood/board-ts219.c +++ b/arch/arm/mach-kirkwood/board-ts219.c | |||
@@ -26,47 +26,21 @@ | |||
26 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
27 | #include <mach/kirkwood.h> | 27 | #include <mach/kirkwood.h> |
28 | #include "common.h" | 28 | #include "common.h" |
29 | #include "mpp.h" | ||
30 | #include "tsx1x-common.h" | 29 | #include "tsx1x-common.h" |
31 | 30 | ||
32 | static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { | 31 | static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { |
33 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), | 32 | .phy_addr = MV643XX_ETH_PHY_ADDR(8), |
34 | }; | 33 | }; |
35 | 34 | ||
36 | static unsigned int qnap_ts219_mpp_config[] __initdata = { | ||
37 | MPP0_SPI_SCn, | ||
38 | MPP1_SPI_MOSI, | ||
39 | MPP2_SPI_SCK, | ||
40 | MPP3_SPI_MISO, | ||
41 | MPP4_SATA1_ACTn, | ||
42 | MPP5_SATA0_ACTn, | ||
43 | MPP8_TW0_SDA, | ||
44 | MPP9_TW0_SCK, | ||
45 | MPP10_UART0_TXD, | ||
46 | MPP11_UART0_RXD, | ||
47 | MPP13_UART1_TXD, /* PIC controller */ | ||
48 | MPP14_UART1_RXD, /* PIC controller */ | ||
49 | MPP15_GPIO, /* USB Copy button (on devices with 88F6281) */ | ||
50 | MPP16_GPIO, /* Reset button (on devices with 88F6281) */ | ||
51 | MPP36_GPIO, /* RAM: 0: 256 MB, 1: 512 MB */ | ||
52 | MPP37_GPIO, /* Reset button (on devices with 88F6282) */ | ||
53 | MPP43_GPIO, /* USB Copy button (on devices with 88F6282) */ | ||
54 | MPP44_GPIO, /* Board ID: 0: TS-11x, 1: TS-21x */ | ||
55 | 0 | ||
56 | }; | ||
57 | |||
58 | void __init qnap_dt_ts219_init(void) | 35 | void __init qnap_dt_ts219_init(void) |
59 | { | 36 | { |
60 | u32 dev, rev; | 37 | u32 dev, rev; |
61 | 38 | ||
62 | kirkwood_mpp_conf(qnap_ts219_mpp_config); | ||
63 | |||
64 | kirkwood_pcie_id(&dev, &rev); | 39 | kirkwood_pcie_id(&dev, &rev); |
65 | if (dev == MV88F6282_DEV_ID) | 40 | if (dev == MV88F6282_DEV_ID) |
66 | qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); | 41 | qnap_ts219_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); |
67 | 42 | ||
68 | kirkwood_ge00_init(&qnap_ts219_ge00_data); | 43 | kirkwood_ge00_init(&qnap_ts219_ge00_data); |
69 | kirkwood_ehci_init(); | ||
70 | 44 | ||
71 | pm_power_off = qnap_tsx1x_power_off; | 45 | pm_power_off = qnap_tsx1x_power_off; |
72 | } | 46 | } |
diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c new file mode 100644 index 000000000000..15e69fcde9f4 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-usi_topkick.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Jason Cooper <jason@lakedaemon.net> | ||
3 | * | ||
4 | * arch/arm/mach-kirkwood/board-usi_topkick.c | ||
5 | * | ||
6 | * USI Topkick Init for drivers not converted to flattened device tree yet. | ||
7 | * | ||
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 | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/mv643xx_eth.h> | ||
16 | #include <linux/gpio.h> | ||
17 | #include <linux/platform_data/mmc-mvsdio.h> | ||
18 | #include "common.h" | ||
19 | #include "mpp.h" | ||
20 | |||
21 | static struct mv643xx_eth_platform_data topkick_ge00_data = { | ||
22 | .phy_addr = MV643XX_ETH_PHY_ADDR(0), | ||
23 | }; | ||
24 | |||
25 | static struct mvsdio_platform_data topkick_mvsdio_data = { | ||
26 | /* unfortunately the CD signal has not been connected */ | ||
27 | }; | ||
28 | |||
29 | /* | ||
30 | * GPIO LED layout | ||
31 | * | ||
32 | * /-SYS_LED(2) | ||
33 | * | | ||
34 | * | /-DISK_LED | ||
35 | * | | | ||
36 | * | | /-WLAN_LED(2) | ||
37 | * | | | | ||
38 | * [SW] [*] [*] [*] | ||
39 | */ | ||
40 | |||
41 | /* | ||
42 | * Switch positions | ||
43 | * | ||
44 | * /-SW_LEFT | ||
45 | * | | ||
46 | * | /-SW_IDLE | ||
47 | * | | | ||
48 | * | | /-SW_RIGHT | ||
49 | * | | | | ||
50 | * PS [L] [I] [R] LEDS | ||
51 | */ | ||
52 | |||
53 | static unsigned int topkick_mpp_config[] __initdata = { | ||
54 | MPP21_GPIO, /* DISK_LED (low active) - yellow */ | ||
55 | MPP36_GPIO, /* SATA0 power enable (high active) */ | ||
56 | MPP37_GPIO, /* SYS_LED2 (low active) - red */ | ||
57 | MPP38_GPIO, /* SYS_LED (low active) - blue */ | ||
58 | MPP39_GPIO, /* WLAN_LED (low active) - green */ | ||
59 | MPP43_GPIO, /* SW_LEFT (low active) */ | ||
60 | MPP44_GPIO, /* SW_RIGHT (low active) */ | ||
61 | MPP45_GPIO, /* SW_IDLE (low active) */ | ||
62 | MPP46_GPIO, /* SW_LEFT (low active) */ | ||
63 | MPP48_GPIO, /* WLAN_LED2 (low active) - yellow */ | ||
64 | 0 | ||
65 | }; | ||
66 | |||
67 | #define TOPKICK_SATA0_PWR_ENABLE 36 | ||
68 | |||
69 | void __init usi_topkick_init(void) | ||
70 | { | ||
71 | /* | ||
72 | * Basic setup. Needs to be called early. | ||
73 | */ | ||
74 | kirkwood_mpp_conf(topkick_mpp_config); | ||
75 | |||
76 | /* SATA0 power enable */ | ||
77 | gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1); | ||
78 | |||
79 | kirkwood_ge00_init(&topkick_ge00_data); | ||
80 | kirkwood_sdio_init(&topkick_mvsdio_data); | ||
81 | } | ||
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 2c6c218fb79e..906c22eca4e9 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -266,6 +266,7 @@ void __init kirkwood_clk_init(void) | |||
266 | orion_clkdev_add("1", "pcie", pex1); | 266 | orion_clkdev_add("1", "pcie", pex1); |
267 | orion_clkdev_add(NULL, "kirkwood-i2s", audio); | 267 | orion_clkdev_add(NULL, "kirkwood-i2s", audio); |
268 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); | 268 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); |
269 | orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit); | ||
269 | 270 | ||
270 | /* Marvell says runit is used by SPI, UART, NAND, TWSI, ..., | 271 | /* Marvell says runit is used by SPI, UART, NAND, TWSI, ..., |
271 | * so should never be gated. | 272 | * so should never be gated. |
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index bcffd7ca1ca2..3e079d1d99d0 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h | |||
@@ -112,6 +112,40 @@ void km_kirkwood_init(void); | |||
112 | static inline void km_kirkwood_init(void) {}; | 112 | static inline void km_kirkwood_init(void) {}; |
113 | #endif | 113 | #endif |
114 | 114 | ||
115 | #ifdef CONFIG_MACH_MPLCEC4_DT | ||
116 | void mplcec4_init(void); | ||
117 | #else | ||
118 | static inline void mplcec4_init(void) {}; | ||
119 | #endif | ||
120 | |||
121 | #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ | ||
122 | defined(CONFIG_MACH_NETSPACE_V2_DT) || \ | ||
123 | defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \ | ||
124 | defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \ | ||
125 | defined(CONFIG_MACH_NETSPACE_MINI_V2_DT) | ||
126 | void ns2_init(void); | ||
127 | #else | ||
128 | static inline void ns2_init(void) {}; | ||
129 | #endif | ||
130 | |||
131 | #ifdef CONFIG_MACH_NSA310_DT | ||
132 | void nsa310_init(void); | ||
133 | #else | ||
134 | static inline void nsa310_init(void) {}; | ||
135 | #endif | ||
136 | |||
137 | #ifdef CONFIG_MACH_OPENBLOCKS_A6_DT | ||
138 | void openblocks_a6_init(void); | ||
139 | #else | ||
140 | static inline void openblocks_a6_init(void) {}; | ||
141 | #endif | ||
142 | |||
143 | #ifdef CONFIG_MACH_TOPKICK_DT | ||
144 | void usi_topkick_init(void); | ||
145 | #else | ||
146 | static inline void usi_topkick_init(void) {}; | ||
147 | #endif | ||
148 | |||
115 | /* early init functions not converted to fdt yet */ | 149 | /* early init functions not converted to fdt yet */ |
116 | char *kirkwood_id(void); | 150 | char *kirkwood_id(void); |
117 | void kirkwood_l2_init(void); | 151 | void kirkwood_l2_init(void); |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index b56d06b48782..95192a062d5d 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -359,7 +359,7 @@ static struct clockdomain iss_44xx_clkdm = { | |||
359 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, | 359 | .clkdm_offs = OMAP4430_CM2_CAM_CAM_CDOFFS, |
360 | .wkdep_srcs = iss_wkup_sleep_deps, | 360 | .wkdep_srcs = iss_wkup_sleep_deps, |
361 | .sleepdep_srcs = iss_wkup_sleep_deps, | 361 | .sleepdep_srcs = iss_wkup_sleep_deps, |
362 | .flags = CLKDM_CAN_HWSUP_SWSUP, | 362 | .flags = CLKDM_CAN_SWSUP, |
363 | }; | 363 | }; |
364 | 364 | ||
365 | static struct clockdomain l3_dss_44xx_clkdm = { | 365 | static struct clockdomain l3_dss_44xx_clkdm = { |
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index cf365c387c06..d2215e9873a5 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/of.h> | 19 | #include <linux/of.h> |
20 | #include <linux/pinctrl/machine.h> | 20 | #include <linux/pinctrl/machine.h> |
21 | #include <linux/platform_data/omap4-keypad.h> | 21 | #include <linux/platform_data/omap4-keypad.h> |
22 | #include <linux/platform_data/omap_ocp2scp.h> | ||
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
@@ -615,6 +616,83 @@ static void omap_init_vout(void) | |||
615 | static inline void omap_init_vout(void) {} | 616 | static inline void omap_init_vout(void) {} |
616 | #endif | 617 | #endif |
617 | 618 | ||
619 | #if defined(CONFIG_OMAP_OCP2SCP) || defined(CONFIG_OMAP_OCP2SCP_MODULE) | ||
620 | static int count_ocp2scp_devices(struct omap_ocp2scp_dev *ocp2scp_dev) | ||
621 | { | ||
622 | int cnt = 0; | ||
623 | |||
624 | while (ocp2scp_dev->drv_name != NULL) { | ||
625 | cnt++; | ||
626 | ocp2scp_dev++; | ||
627 | } | ||
628 | |||
629 | return cnt; | ||
630 | } | ||
631 | |||
632 | static void omap_init_ocp2scp(void) | ||
633 | { | ||
634 | struct omap_hwmod *oh; | ||
635 | struct platform_device *pdev; | ||
636 | int bus_id = -1, dev_cnt = 0, i; | ||
637 | struct omap_ocp2scp_dev *ocp2scp_dev; | ||
638 | const char *oh_name, *name; | ||
639 | struct omap_ocp2scp_platform_data *pdata; | ||
640 | |||
641 | if (!cpu_is_omap44xx()) | ||
642 | return; | ||
643 | |||
644 | oh_name = "ocp2scp_usb_phy"; | ||
645 | name = "omap-ocp2scp"; | ||
646 | |||
647 | oh = omap_hwmod_lookup(oh_name); | ||
648 | if (!oh) { | ||
649 | pr_err("%s: could not find omap_hwmod for %s\n", __func__, | ||
650 | oh_name); | ||
651 | return; | ||
652 | } | ||
653 | |||
654 | pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); | ||
655 | if (!pdata) { | ||
656 | pr_err("%s: No memory for ocp2scp pdata\n", __func__); | ||
657 | return; | ||
658 | } | ||
659 | |||
660 | ocp2scp_dev = oh->dev_attr; | ||
661 | dev_cnt = count_ocp2scp_devices(ocp2scp_dev); | ||
662 | |||
663 | if (!dev_cnt) { | ||
664 | pr_err("%s: No devices connected to ocp2scp\n", __func__); | ||
665 | kfree(pdata); | ||
666 | return; | ||
667 | } | ||
668 | |||
669 | pdata->devices = kzalloc(sizeof(struct omap_ocp2scp_dev *) | ||
670 | * dev_cnt, GFP_KERNEL); | ||
671 | if (!pdata->devices) { | ||
672 | pr_err("%s: No memory for ocp2scp pdata devices\n", __func__); | ||
673 | kfree(pdata); | ||
674 | return; | ||
675 | } | ||
676 | |||
677 | for (i = 0; i < dev_cnt; i++, ocp2scp_dev++) | ||
678 | pdata->devices[i] = ocp2scp_dev; | ||
679 | |||
680 | pdata->dev_cnt = dev_cnt; | ||
681 | |||
682 | pdev = omap_device_build(name, bus_id, oh, pdata, sizeof(*pdata), NULL, | ||
683 | 0, false); | ||
684 | if (IS_ERR(pdev)) { | ||
685 | pr_err("Could not build omap_device for %s %s\n", | ||
686 | name, oh_name); | ||
687 | kfree(pdata->devices); | ||
688 | kfree(pdata); | ||
689 | return; | ||
690 | } | ||
691 | } | ||
692 | #else | ||
693 | static inline void omap_init_ocp2scp(void) { } | ||
694 | #endif | ||
695 | |||
618 | /*-------------------------------------------------------------------------*/ | 696 | /*-------------------------------------------------------------------------*/ |
619 | 697 | ||
620 | static int __init omap2_init_devices(void) | 698 | static int __init omap2_init_devices(void) |
@@ -642,6 +720,7 @@ static int __init omap2_init_devices(void) | |||
642 | omap_init_sham(); | 720 | omap_init_sham(); |
643 | omap_init_aes(); | 721 | omap_init_aes(); |
644 | omap_init_vout(); | 722 | omap_init_vout(); |
723 | omap_init_ocp2scp(); | ||
645 | 724 | ||
646 | return 0; | 725 | return 0; |
647 | } | 726 | } |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 139adca3bda1..b3b00f43dd7c 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -420,6 +420,38 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v) | |||
420 | } | 420 | } |
421 | 421 | ||
422 | /** | 422 | /** |
423 | * _wait_softreset_complete - wait for an OCP softreset to complete | ||
424 | * @oh: struct omap_hwmod * to wait on | ||
425 | * | ||
426 | * Wait until the IP block represented by @oh reports that its OCP | ||
427 | * softreset is complete. This can be triggered by software (see | ||
428 | * _ocp_softreset()) or by hardware upon returning from off-mode (one | ||
429 | * example is HSMMC). Waits for up to MAX_MODULE_SOFTRESET_WAIT | ||
430 | * microseconds. Returns the number of microseconds waited. | ||
431 | */ | ||
432 | static int _wait_softreset_complete(struct omap_hwmod *oh) | ||
433 | { | ||
434 | struct omap_hwmod_class_sysconfig *sysc; | ||
435 | u32 softrst_mask; | ||
436 | int c = 0; | ||
437 | |||
438 | sysc = oh->class->sysc; | ||
439 | |||
440 | if (sysc->sysc_flags & SYSS_HAS_RESET_STATUS) | ||
441 | omap_test_timeout((omap_hwmod_read(oh, sysc->syss_offs) | ||
442 | & SYSS_RESETDONE_MASK), | ||
443 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
444 | else if (sysc->sysc_flags & SYSC_HAS_RESET_STATUS) { | ||
445 | softrst_mask = (0x1 << sysc->sysc_fields->srst_shift); | ||
446 | omap_test_timeout(!(omap_hwmod_read(oh, sysc->sysc_offs) | ||
447 | & softrst_mask), | ||
448 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
449 | } | ||
450 | |||
451 | return c; | ||
452 | } | ||
453 | |||
454 | /** | ||
423 | * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v | 455 | * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v |
424 | * @oh: struct omap_hwmod * | 456 | * @oh: struct omap_hwmod * |
425 | * | 457 | * |
@@ -1280,6 +1312,18 @@ static void _enable_sysc(struct omap_hwmod *oh) | |||
1280 | if (!oh->class->sysc) | 1312 | if (!oh->class->sysc) |
1281 | return; | 1313 | return; |
1282 | 1314 | ||
1315 | /* | ||
1316 | * Wait until reset has completed, this is needed as the IP | ||
1317 | * block is reset automatically by hardware in some cases | ||
1318 | * (off-mode for example), and the drivers require the | ||
1319 | * IP to be ready when they access it | ||
1320 | */ | ||
1321 | if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) | ||
1322 | _enable_optional_clocks(oh); | ||
1323 | _wait_softreset_complete(oh); | ||
1324 | if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) | ||
1325 | _disable_optional_clocks(oh); | ||
1326 | |||
1283 | v = oh->_sysc_cache; | 1327 | v = oh->_sysc_cache; |
1284 | sf = oh->class->sysc->sysc_flags; | 1328 | sf = oh->class->sysc->sysc_flags; |
1285 | 1329 | ||
@@ -1802,7 +1846,7 @@ static int _am33xx_disable_module(struct omap_hwmod *oh) | |||
1802 | */ | 1846 | */ |
1803 | static int _ocp_softreset(struct omap_hwmod *oh) | 1847 | static int _ocp_softreset(struct omap_hwmod *oh) |
1804 | { | 1848 | { |
1805 | u32 v, softrst_mask; | 1849 | u32 v; |
1806 | int c = 0; | 1850 | int c = 0; |
1807 | int ret = 0; | 1851 | int ret = 0; |
1808 | 1852 | ||
@@ -1832,19 +1876,7 @@ static int _ocp_softreset(struct omap_hwmod *oh) | |||
1832 | if (oh->class->sysc->srst_udelay) | 1876 | if (oh->class->sysc->srst_udelay) |
1833 | udelay(oh->class->sysc->srst_udelay); | 1877 | udelay(oh->class->sysc->srst_udelay); |
1834 | 1878 | ||
1835 | if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS) | 1879 | c = _wait_softreset_complete(oh); |
1836 | omap_test_timeout((omap_hwmod_read(oh, | ||
1837 | oh->class->sysc->syss_offs) | ||
1838 | & SYSS_RESETDONE_MASK), | ||
1839 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
1840 | else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) { | ||
1841 | softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift); | ||
1842 | omap_test_timeout(!(omap_hwmod_read(oh, | ||
1843 | oh->class->sysc->sysc_offs) | ||
1844 | & softrst_mask), | ||
1845 | MAX_MODULE_SOFTRESET_WAIT, c); | ||
1846 | } | ||
1847 | |||
1848 | if (c == MAX_MODULE_SOFTRESET_WAIT) | 1880 | if (c == MAX_MODULE_SOFTRESET_WAIT) |
1849 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", | 1881 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", |
1850 | oh->name, MAX_MODULE_SOFTRESET_WAIT); | 1882 | oh->name, MAX_MODULE_SOFTRESET_WAIT); |
@@ -2351,6 +2383,9 @@ static int __init _setup_reset(struct omap_hwmod *oh) | |||
2351 | if (oh->_state != _HWMOD_STATE_INITIALIZED) | 2383 | if (oh->_state != _HWMOD_STATE_INITIALIZED) |
2352 | return -EINVAL; | 2384 | return -EINVAL; |
2353 | 2385 | ||
2386 | if (oh->flags & HWMOD_EXT_OPT_MAIN_CLK) | ||
2387 | return -EPERM; | ||
2388 | |||
2354 | if (oh->rst_lines_cnt == 0) { | 2389 | if (oh->rst_lines_cnt == 0) { |
2355 | r = _enable(oh); | 2390 | r = _enable(oh); |
2356 | if (r) { | 2391 | if (r) { |
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h index 87b59b45c678..87a3c5b7aa74 100644 --- a/arch/arm/mach-omap2/omap_hwmod.h +++ b/arch/arm/mach-omap2/omap_hwmod.h | |||
@@ -442,6 +442,11 @@ struct omap_hwmod_omap4_prcm { | |||
442 | * in order to complete the reset. Optional clocks will be disabled | 442 | * in order to complete the reset. Optional clocks will be disabled |
443 | * again after the reset. | 443 | * again after the reset. |
444 | * HWMOD_16BIT_REG: Module has 16bit registers | 444 | * HWMOD_16BIT_REG: Module has 16bit registers |
445 | * HWMOD_EXT_OPT_MAIN_CLK: The only main functional clock source for | ||
446 | * this IP block comes from an off-chip source and is not always | ||
447 | * enabled. This prevents the hwmod code from being able to | ||
448 | * enable and reset the IP block early. XXX Eventually it should | ||
449 | * be possible to query the clock framework for this information. | ||
445 | */ | 450 | */ |
446 | #define HWMOD_SWSUP_SIDLE (1 << 0) | 451 | #define HWMOD_SWSUP_SIDLE (1 << 0) |
447 | #define HWMOD_SWSUP_MSTANDBY (1 << 1) | 452 | #define HWMOD_SWSUP_MSTANDBY (1 << 1) |
@@ -452,6 +457,7 @@ struct omap_hwmod_omap4_prcm { | |||
452 | #define HWMOD_NO_IDLEST (1 << 6) | 457 | #define HWMOD_NO_IDLEST (1 << 6) |
453 | #define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7) | 458 | #define HWMOD_CONTROL_OPT_CLKS_IN_RESET (1 << 7) |
454 | #define HWMOD_16BIT_REG (1 << 8) | 459 | #define HWMOD_16BIT_REG (1 << 8) |
460 | #define HWMOD_EXT_OPT_MAIN_CLK (1 << 9) | ||
455 | 461 | ||
456 | /* | 462 | /* |
457 | * omap_hwmod._int_flags definitions | 463 | * omap_hwmod._int_flags definitions |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 7a6132848f5d..b80bbf607ef8 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <plat-omap/dma-omap.h> | 26 | #include <plat-omap/dma-omap.h> |
27 | 27 | ||
28 | #include <linux/platform_data/omap_ocp2scp.h> | ||
28 | #include <linux/platform_data/spi-omap2-mcspi.h> | 29 | #include <linux/platform_data/spi-omap2-mcspi.h> |
29 | #include <linux/platform_data/asoc-ti-mcbsp.h> | 30 | #include <linux/platform_data/asoc-ti-mcbsp.h> |
30 | #include <plat/dmtimer.h> | 31 | #include <plat/dmtimer.h> |
@@ -2126,6 +2127,14 @@ static struct omap_hwmod omap44xx_mcpdm_hwmod = { | |||
2126 | .name = "mcpdm", | 2127 | .name = "mcpdm", |
2127 | .class = &omap44xx_mcpdm_hwmod_class, | 2128 | .class = &omap44xx_mcpdm_hwmod_class, |
2128 | .clkdm_name = "abe_clkdm", | 2129 | .clkdm_name = "abe_clkdm", |
2130 | /* | ||
2131 | * It's suspected that the McPDM requires an off-chip main | ||
2132 | * functional clock, controlled via I2C. This IP block is | ||
2133 | * currently reset very early during boot, before I2C is | ||
2134 | * available, so it doesn't seem that we have any choice in | ||
2135 | * the kernel other than to avoid resetting it. | ||
2136 | */ | ||
2137 | .flags = HWMOD_EXT_OPT_MAIN_CLK, | ||
2129 | .mpu_irqs = omap44xx_mcpdm_irqs, | 2138 | .mpu_irqs = omap44xx_mcpdm_irqs, |
2130 | .sdma_reqs = omap44xx_mcpdm_sdma_reqs, | 2139 | .sdma_reqs = omap44xx_mcpdm_sdma_reqs, |
2131 | .main_clk = "mcpdm_fck", | 2140 | .main_clk = "mcpdm_fck", |
@@ -2682,6 +2691,32 @@ static struct omap_hwmod_class omap44xx_ocp2scp_hwmod_class = { | |||
2682 | .sysc = &omap44xx_ocp2scp_sysc, | 2691 | .sysc = &omap44xx_ocp2scp_sysc, |
2683 | }; | 2692 | }; |
2684 | 2693 | ||
2694 | /* ocp2scp dev_attr */ | ||
2695 | static struct resource omap44xx_usb_phy_and_pll_addrs[] = { | ||
2696 | { | ||
2697 | .name = "usb_phy", | ||
2698 | .start = 0x4a0ad080, | ||
2699 | .end = 0x4a0ae000, | ||
2700 | .flags = IORESOURCE_MEM, | ||
2701 | }, | ||
2702 | { | ||
2703 | /* XXX: Remove this once control module driver is in place */ | ||
2704 | .name = "ctrl_dev", | ||
2705 | .start = 0x4a002300, | ||
2706 | .end = 0x4a002303, | ||
2707 | .flags = IORESOURCE_MEM, | ||
2708 | }, | ||
2709 | { } | ||
2710 | }; | ||
2711 | |||
2712 | static struct omap_ocp2scp_dev ocp2scp_dev_attr[] = { | ||
2713 | { | ||
2714 | .drv_name = "omap-usb2", | ||
2715 | .res = omap44xx_usb_phy_and_pll_addrs, | ||
2716 | }, | ||
2717 | { } | ||
2718 | }; | ||
2719 | |||
2685 | /* ocp2scp_usb_phy */ | 2720 | /* ocp2scp_usb_phy */ |
2686 | static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { | 2721 | static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { |
2687 | .name = "ocp2scp_usb_phy", | 2722 | .name = "ocp2scp_usb_phy", |
@@ -2695,6 +2730,7 @@ static struct omap_hwmod omap44xx_ocp2scp_usb_phy_hwmod = { | |||
2695 | .modulemode = MODULEMODE_HWCTRL, | 2730 | .modulemode = MODULEMODE_HWCTRL, |
2696 | }, | 2731 | }, |
2697 | }, | 2732 | }, |
2733 | .dev_attr = ocp2scp_dev_attr, | ||
2698 | }; | 2734 | }; |
2699 | 2735 | ||
2700 | /* | 2736 | /* |
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index 827f54a1dd1d..3fa2bdb44106 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c | |||
@@ -363,7 +363,7 @@ static struct regulator_init_data omap4_clk32kg_idata = { | |||
363 | }; | 363 | }; |
364 | 364 | ||
365 | static struct regulator_consumer_supply omap4_vdd1_supply[] = { | 365 | static struct regulator_consumer_supply omap4_vdd1_supply[] = { |
366 | REGULATOR_SUPPLY("vcc", "mpu.0"), | 366 | REGULATOR_SUPPLY("vcc", "cpu0"), |
367 | }; | 367 | }; |
368 | 368 | ||
369 | static struct regulator_consumer_supply omap4_vdd2_supply[] = { | 369 | static struct regulator_consumer_supply omap4_vdd2_supply[] = { |
diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c index 880249b17012..75878c37959b 100644 --- a/arch/arm/mach-omap2/vc.c +++ b/arch/arm/mach-omap2/vc.c | |||
@@ -264,7 +264,7 @@ static void __init omap_vc_i2c_init(struct voltagedomain *voltdm) | |||
264 | 264 | ||
265 | if (initialized) { | 265 | if (initialized) { |
266 | if (voltdm->pmic->i2c_high_speed != i2c_high_speed) | 266 | if (voltdm->pmic->i2c_high_speed != i2c_high_speed) |
267 | pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).", | 267 | pr_warn("%s: I2C config for vdd_%s does not match other channels (%u).\n", |
268 | __func__, voltdm->name, i2c_high_speed); | 268 | __func__, voltdm->name, i2c_high_speed); |
269 | return; | 269 | return; |
270 | } | 270 | } |
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig index 0673f0c10432..2cb2f06c20f5 100644 --- a/arch/arm/mach-orion5x/Kconfig +++ b/arch/arm/mach-orion5x/Kconfig | |||
@@ -2,6 +2,13 @@ if ARCH_ORION5X | |||
2 | 2 | ||
3 | menu "Orion Implementations" | 3 | menu "Orion Implementations" |
4 | 4 | ||
5 | config ARCH_ORION5X_DT | ||
6 | bool "Marvell Orion5x Flattened Device Tree" | ||
7 | select USE_OF | ||
8 | help | ||
9 | Say 'Y' here if you want your kernel to support the | ||
10 | Marvell Orion5x using flattened device tree. | ||
11 | |||
5 | config MACH_DB88F5281 | 12 | config MACH_DB88F5281 |
6 | bool "Marvell Orion-2 Development Board" | 13 | bool "Marvell Orion-2 Development Board" |
7 | select I2C_BOARDINFO | 14 | select I2C_BOARDINFO |
@@ -96,12 +103,13 @@ config MACH_MV2120 | |||
96 | Say 'Y' here if you want your kernel to support the | 103 | Say 'Y' here if you want your kernel to support the |
97 | HP Media Vault mv2120 or mv5100. | 104 | HP Media Vault mv2120 or mv5100. |
98 | 105 | ||
99 | config MACH_EDMINI_V2 | 106 | config MACH_EDMINI_V2_DT |
100 | bool "LaCie Ethernet Disk mini V2" | 107 | bool "LaCie Ethernet Disk mini V2 (Flattened Device Tree)" |
101 | select I2C_BOARDINFO | 108 | select I2C_BOARDINFO |
109 | select ARCH_ORION5X_DT | ||
102 | help | 110 | help |
103 | Say 'Y' here if you want your kernel to support the | 111 | Say 'Y' here if you want your kernel to support the |
104 | LaCie Ethernet Disk mini V2. | 112 | LaCie Ethernet Disk mini V2 (Flattened Device Tree). |
105 | 113 | ||
106 | config MACH_D2NET | 114 | config MACH_D2NET |
107 | bool "LaCie d2 Network" | 115 | bool "LaCie d2 Network" |
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile index 7f18cdacd487..9e809a7c05c0 100644 --- a/arch/arm/mach-orion5x/Makefile +++ b/arch/arm/mach-orion5x/Makefile | |||
@@ -12,7 +12,6 @@ obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o | |||
12 | obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n-v2-setup.o | 12 | obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n-v2-setup.o |
13 | obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o | 13 | obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o |
14 | obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o | 14 | obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o |
15 | obj-$(CONFIG_MACH_EDMINI_V2) += edmini_v2-setup.o | ||
16 | obj-$(CONFIG_MACH_D2NET) += d2net-setup.o | 15 | obj-$(CONFIG_MACH_D2NET) += d2net-setup.o |
17 | obj-$(CONFIG_MACH_BIGDISK) += d2net-setup.o | 16 | obj-$(CONFIG_MACH_BIGDISK) += d2net-setup.o |
18 | obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o | 17 | obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o |
@@ -22,3 +21,6 @@ obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o | |||
22 | obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o | 21 | obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o |
23 | obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o | 22 | obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o |
24 | obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o | 23 | obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o |
24 | |||
25 | obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o | ||
26 | obj-$(CONFIG_MACH_EDMINI_V2_DT) += edmini_v2-setup.o | ||
diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c new file mode 100644 index 000000000000..32e5c211a89b --- /dev/null +++ b/arch/arm/mach-orion5x/board-dt.c | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * Copyright 2012 (C), Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | ||
3 | * | ||
4 | * arch/arm/mach-orion5x/board-dt.c | ||
5 | * | ||
6 | * Flattened Device Tree board initialization | ||
7 | * | ||
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 | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/kernel.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/of.h> | ||
16 | #include <linux/of_platform.h> | ||
17 | #include <asm/system_misc.h> | ||
18 | #include <asm/mach/arch.h> | ||
19 | #include <mach/orion5x.h> | ||
20 | #include <plat/irq.h> | ||
21 | #include "common.h" | ||
22 | |||
23 | struct of_dev_auxdata orion5x_auxdata_lookup[] __initdata = { | ||
24 | OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), | ||
25 | OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", | ||
26 | NULL), | ||
27 | OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), | ||
28 | OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), | ||
29 | OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL), | ||
30 | {}, | ||
31 | }; | ||
32 | |||
33 | static void __init orion5x_dt_init(void) | ||
34 | { | ||
35 | char *dev_name; | ||
36 | u32 dev, rev; | ||
37 | |||
38 | orion5x_id(&dev, &rev, &dev_name); | ||
39 | printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); | ||
40 | |||
41 | /* | ||
42 | * Setup Orion address map | ||
43 | */ | ||
44 | orion5x_setup_cpu_mbus_bridge(); | ||
45 | |||
46 | /* Setup root of clk tree */ | ||
47 | clk_init(); | ||
48 | |||
49 | /* | ||
50 | * Don't issue "Wait for Interrupt" instruction if we are | ||
51 | * running on D0 5281 silicon. | ||
52 | */ | ||
53 | if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) { | ||
54 | printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); | ||
55 | disable_hlt(); | ||
56 | } | ||
57 | |||
58 | if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2")) | ||
59 | edmini_v2_init(); | ||
60 | |||
61 | of_platform_populate(NULL, of_default_bus_match_table, | ||
62 | orion5x_auxdata_lookup, NULL); | ||
63 | } | ||
64 | |||
65 | static const char *orion5x_dt_compat[] = { | ||
66 | "marvell,orion5x", | ||
67 | NULL, | ||
68 | }; | ||
69 | |||
70 | DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") | ||
71 | /* Maintainer: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> */ | ||
72 | .map_io = orion5x_map_io, | ||
73 | .init_early = orion5x_init_early, | ||
74 | .init_irq = orion_dt_init_irq, | ||
75 | .timer = &orion5x_timer, | ||
76 | .init_machine = orion5x_dt_init, | ||
77 | .restart = orion5x_restart, | ||
78 | .dt_compat = orion5x_dt_compat, | ||
79 | MACHINE_END | ||
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index b3eb3da01160..550f92320afb 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c | |||
@@ -65,7 +65,7 @@ void __init orion5x_map_io(void) | |||
65 | ****************************************************************************/ | 65 | ****************************************************************************/ |
66 | static struct clk *tclk; | 66 | static struct clk *tclk; |
67 | 67 | ||
68 | static void __init clk_init(void) | 68 | void __init clk_init(void) |
69 | { | 69 | { |
70 | tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, | 70 | tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, |
71 | orion5x_tclk); | 71 | orion5x_tclk); |
@@ -236,7 +236,7 @@ struct sys_timer orion5x_timer = { | |||
236 | /* | 236 | /* |
237 | * Identify device ID and rev from PCIe configuration header space '0'. | 237 | * Identify device ID and rev from PCIe configuration header space '0'. |
238 | */ | 238 | */ |
239 | static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name) | 239 | void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name) |
240 | { | 240 | { |
241 | orion5x_pcie_id(dev, rev); | 241 | orion5x_pcie_id(dev, rev); |
242 | 242 | ||
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index 31bab92ce038..7db5cdd9c4b7 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -12,6 +12,8 @@ void orion5x_map_io(void); | |||
12 | void orion5x_init_early(void); | 12 | void orion5x_init_early(void); |
13 | void orion5x_init_irq(void); | 13 | void orion5x_init_irq(void); |
14 | void orion5x_init(void); | 14 | void orion5x_init(void); |
15 | void orion5x_id(u32 *dev, u32 *rev, char **dev_name); | ||
16 | void clk_init(void); | ||
15 | extern int orion5x_tclk; | 17 | extern int orion5x_tclk; |
16 | extern struct sys_timer orion5x_timer; | 18 | extern struct sys_timer orion5x_timer; |
17 | 19 | ||
@@ -54,6 +56,13 @@ int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys); | |||
54 | struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys); | 56 | struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys); |
55 | int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | 57 | int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); |
56 | 58 | ||
59 | /* board init functions for boards not fully converted to fdt */ | ||
60 | #ifdef CONFIG_MACH_EDMINI_V2_DT | ||
61 | void edmini_v2_init(void); | ||
62 | #else | ||
63 | static inline void edmini_v2_init(void) {}; | ||
64 | #endif | ||
65 | |||
57 | struct meminfo; | 66 | struct meminfo; |
58 | struct tag; | 67 | struct tag; |
59 | extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *); | 68 | extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *); |
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c index 355e962137c7..d675e727803d 100644 --- a/arch/arm/mach-orion5x/edmini_v2-setup.c +++ b/arch/arm/mach-orion5x/edmini_v2-setup.c | |||
@@ -115,69 +115,6 @@ static struct i2c_board_info __initdata edmini_v2_i2c_rtc = { | |||
115 | }; | 115 | }; |
116 | 116 | ||
117 | /***************************************************************************** | 117 | /***************************************************************************** |
118 | * Sata | ||
119 | ****************************************************************************/ | ||
120 | |||
121 | static struct mv_sata_platform_data edmini_v2_sata_data = { | ||
122 | .n_ports = 2, | ||
123 | }; | ||
124 | |||
125 | /***************************************************************************** | ||
126 | * GPIO LED (simple - doesn't use hardware blinking support) | ||
127 | ****************************************************************************/ | ||
128 | |||
129 | #define EDMINI_V2_GPIO_LED_POWER 16 | ||
130 | |||
131 | static struct gpio_led edmini_v2_leds[] = { | ||
132 | { | ||
133 | .name = "power:blue", | ||
134 | .gpio = EDMINI_V2_GPIO_LED_POWER, | ||
135 | .active_low = 1, | ||
136 | }, | ||
137 | }; | ||
138 | |||
139 | static struct gpio_led_platform_data edmini_v2_led_data = { | ||
140 | .num_leds = ARRAY_SIZE(edmini_v2_leds), | ||
141 | .leds = edmini_v2_leds, | ||
142 | }; | ||
143 | |||
144 | static struct platform_device edmini_v2_gpio_leds = { | ||
145 | .name = "leds-gpio", | ||
146 | .id = -1, | ||
147 | .dev = { | ||
148 | .platform_data = &edmini_v2_led_data, | ||
149 | }, | ||
150 | }; | ||
151 | |||
152 | /**************************************************************************** | ||
153 | * GPIO key | ||
154 | ****************************************************************************/ | ||
155 | |||
156 | #define EDMINI_V2_GPIO_KEY_POWER 18 | ||
157 | |||
158 | static struct gpio_keys_button edmini_v2_buttons[] = { | ||
159 | { | ||
160 | .code = KEY_POWER, | ||
161 | .gpio = EDMINI_V2_GPIO_KEY_POWER, | ||
162 | .desc = "Power Button", | ||
163 | .active_low = 0, | ||
164 | }, | ||
165 | }; | ||
166 | |||
167 | static struct gpio_keys_platform_data edmini_v2_button_data = { | ||
168 | .buttons = edmini_v2_buttons, | ||
169 | .nbuttons = ARRAY_SIZE(edmini_v2_buttons), | ||
170 | }; | ||
171 | |||
172 | static struct platform_device edmini_v2_gpio_buttons = { | ||
173 | .name = "gpio-keys", | ||
174 | .id = -1, | ||
175 | .dev = { | ||
176 | .platform_data = &edmini_v2_button_data, | ||
177 | }, | ||
178 | }; | ||
179 | |||
180 | /***************************************************************************** | ||
181 | * General Setup | 118 | * General Setup |
182 | ****************************************************************************/ | 119 | ****************************************************************************/ |
183 | static unsigned int edminiv2_mpp_modes[] __initdata = { | 120 | static unsigned int edminiv2_mpp_modes[] __initdata = { |
@@ -207,13 +144,8 @@ static unsigned int edminiv2_mpp_modes[] __initdata = { | |||
207 | 0, | 144 | 0, |
208 | }; | 145 | }; |
209 | 146 | ||
210 | static void __init edmini_v2_init(void) | 147 | void __init edmini_v2_init(void) |
211 | { | 148 | { |
212 | /* | ||
213 | * Setup basic Orion functions. Need to be called early. | ||
214 | */ | ||
215 | orion5x_init(); | ||
216 | |||
217 | orion5x_mpp_conf(edminiv2_mpp_modes); | 149 | orion5x_mpp_conf(edminiv2_mpp_modes); |
218 | 150 | ||
219 | /* | 151 | /* |
@@ -221,15 +153,10 @@ static void __init edmini_v2_init(void) | |||
221 | */ | 153 | */ |
222 | orion5x_ehci0_init(); | 154 | orion5x_ehci0_init(); |
223 | orion5x_eth_init(&edmini_v2_eth_data); | 155 | orion5x_eth_init(&edmini_v2_eth_data); |
224 | orion5x_i2c_init(); | ||
225 | orion5x_sata_init(&edmini_v2_sata_data); | ||
226 | orion5x_uart0_init(); | ||
227 | 156 | ||
228 | orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE, | 157 | orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE, |
229 | EDMINI_V2_NOR_BOOT_SIZE); | 158 | EDMINI_V2_NOR_BOOT_SIZE); |
230 | platform_device_register(&edmini_v2_nor_flash); | 159 | platform_device_register(&edmini_v2_nor_flash); |
231 | platform_device_register(&edmini_v2_gpio_leds); | ||
232 | platform_device_register(&edmini_v2_gpio_buttons); | ||
233 | 160 | ||
234 | pr_notice("edmini_v2: USB device port, flash write and power-off " | 161 | pr_notice("edmini_v2: USB device port, flash write and power-off " |
235 | "are not yet supported.\n"); | 162 | "are not yet supported.\n"); |
@@ -247,16 +174,3 @@ static void __init edmini_v2_init(void) | |||
247 | 174 | ||
248 | i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1); | 175 | i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1); |
249 | } | 176 | } |
250 | |||
251 | /* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */ | ||
252 | MACHINE_START(EDMINI_V2, "LaCie Ethernet Disk mini V2") | ||
253 | /* Maintainer: Christopher Moore <moore@free.fr> */ | ||
254 | .atag_offset = 0x100, | ||
255 | .init_machine = edmini_v2_init, | ||
256 | .map_io = orion5x_map_io, | ||
257 | .init_early = orion5x_init_early, | ||
258 | .init_irq = orion5x_init_irq, | ||
259 | .timer = &orion5x_timer, | ||
260 | .fixup = tag_fixup_mem32, | ||
261 | .restart = orion5x_restart, | ||
262 | MACHINE_END | ||
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 5ecbd17b5641..e2c6391863fe 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mfd/asic3.h> | 28 | #include <linux/mfd/asic3.h> |
29 | #include <linux/mtd/physmap.h> | 29 | #include <linux/mtd/physmap.h> |
30 | #include <linux/pda_power.h> | 30 | #include <linux/pda_power.h> |
31 | #include <linux/pwm.h> | ||
31 | #include <linux/pwm_backlight.h> | 32 | #include <linux/pwm_backlight.h> |
32 | #include <linux/regulator/driver.h> | 33 | #include <linux/regulator/driver.h> |
33 | #include <linux/regulator/gpio-regulator.h> | 34 | #include <linux/regulator/gpio-regulator.h> |
@@ -556,7 +557,7 @@ static struct platform_device hx4700_lcd = { | |||
556 | */ | 557 | */ |
557 | 558 | ||
558 | static struct platform_pwm_backlight_data backlight_data = { | 559 | static struct platform_pwm_backlight_data backlight_data = { |
559 | .pwm_id = 1, | 560 | .pwm_id = -1, /* Superseded by pwm_lookup */ |
560 | .max_brightness = 200, | 561 | .max_brightness = 200, |
561 | .dft_brightness = 100, | 562 | .dft_brightness = 100, |
562 | .pwm_period_ns = 30923, | 563 | .pwm_period_ns = 30923, |
@@ -571,6 +572,10 @@ static struct platform_device backlight = { | |||
571 | }, | 572 | }, |
572 | }; | 573 | }; |
573 | 574 | ||
575 | static struct pwm_lookup hx4700_pwm_lookup[] = { | ||
576 | PWM_LOOKUP("pxa27x-pwm.1", 0, "pwm-backlight", NULL), | ||
577 | }; | ||
578 | |||
574 | /* | 579 | /* |
575 | * USB "Transceiver" | 580 | * USB "Transceiver" |
576 | */ | 581 | */ |
@@ -872,6 +877,7 @@ static void __init hx4700_init(void) | |||
872 | pxa_set_stuart_info(NULL); | 877 | pxa_set_stuart_info(NULL); |
873 | 878 | ||
874 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 879 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
880 | pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup)); | ||
875 | 881 | ||
876 | pxa_set_ficp_info(&ficp_info); | 882 | pxa_set_ficp_info(&ficp_info); |
877 | pxa27x_set_i2c_power_info(NULL); | 883 | pxa27x_set_i2c_power_info(NULL); |
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 438f02fe122a..842596d4d31e 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c | |||
@@ -86,10 +86,7 @@ static void spitz_discharge1(int on) | |||
86 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); | 86 | gpio_set_value(SPITZ_GPIO_LED_GREEN, on); |
87 | } | 87 | } |
88 | 88 | ||
89 | static unsigned long gpio18_config[] = { | 89 | static unsigned long gpio18_config = GPIO18_GPIO; |
90 | GPIO18_RDY, | ||
91 | GPIO18_GPIO, | ||
92 | }; | ||
93 | 90 | ||
94 | static void spitz_presuspend(void) | 91 | static void spitz_presuspend(void) |
95 | { | 92 | { |
@@ -112,7 +109,7 @@ static void spitz_presuspend(void) | |||
112 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; | 109 | PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; |
113 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); | 110 | PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); |
114 | 111 | ||
115 | pxa2xx_mfp_config(&gpio18_config[0], 1); | 112 | pxa2xx_mfp_config(&gpio18_config, 1); |
116 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); | 113 | gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown"); |
117 | gpio_free(18); | 114 | gpio_free(18); |
118 | 115 | ||
@@ -131,7 +128,6 @@ static void spitz_presuspend(void) | |||
131 | 128 | ||
132 | static void spitz_postsuspend(void) | 129 | static void spitz_postsuspend(void) |
133 | { | 130 | { |
134 | pxa2xx_mfp_config(&gpio18_config[1], 1); | ||
135 | } | 131 | } |
136 | 132 | ||
137 | static int spitz_should_wakeup(unsigned int resume_on_alarm) | 133 | static int spitz_should_wakeup(unsigned int resume_on_alarm) |
diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c index 1867944415ca..8db0b981ca64 100644 --- a/arch/arm/plat-orion/irq.c +++ b/arch/arm/plat-orion/irq.c | |||
@@ -41,7 +41,7 @@ void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr) | |||
41 | static int __init orion_add_irq_domain(struct device_node *np, | 41 | static int __init orion_add_irq_domain(struct device_node *np, |
42 | struct device_node *interrupt_parent) | 42 | struct device_node *interrupt_parent) |
43 | { | 43 | { |
44 | int i = 0, irq_gpio; | 44 | int i = 0; |
45 | void __iomem *base; | 45 | void __iomem *base; |
46 | 46 | ||
47 | do { | 47 | do { |
@@ -54,10 +54,6 @@ static int __init orion_add_irq_domain(struct device_node *np, | |||
54 | 54 | ||
55 | irq_domain_add_legacy(np, i * 32, 0, 0, | 55 | irq_domain_add_legacy(np, i * 32, 0, 0, |
56 | &irq_domain_simple_ops, NULL); | 56 | &irq_domain_simple_ops, NULL); |
57 | |||
58 | irq_gpio = i * 32; | ||
59 | orion_gpio_of_init(irq_gpio); | ||
60 | |||
61 | return 0; | 57 | return 0; |
62 | } | 58 | } |
63 | 59 | ||
diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile index cd60a81163e9..32d05c8219dc 100644 --- a/arch/arm/tools/Makefile +++ b/arch/arm/tools/Makefile | |||
@@ -5,6 +5,6 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types | 7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types |
8 | $(kecho) ' Generating $@' | 8 | @$(kecho) ' Generating $@' |
9 | @mkdir -p $(dir $@) | 9 | @mkdir -p $(dir $@) |
10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 54f6116697f7..d2f05a608274 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h | |||
@@ -222,7 +222,7 @@ extern void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot | |||
222 | extern void __iounmap(volatile void __iomem *addr); | 222 | extern void __iounmap(volatile void __iomem *addr); |
223 | 223 | ||
224 | #define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) | 224 | #define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) |
225 | #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) | 225 | #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) |
226 | #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) | 226 | #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) |
227 | 227 | ||
228 | #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) | 228 | #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) |
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index 0f3b4581d925..75fd13d289b9 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h | |||
@@ -38,7 +38,8 @@ | |||
38 | #define PMD_SECT_S (_AT(pmdval_t, 3) << 8) | 38 | #define PMD_SECT_S (_AT(pmdval_t, 3) << 8) |
39 | #define PMD_SECT_AF (_AT(pmdval_t, 1) << 10) | 39 | #define PMD_SECT_AF (_AT(pmdval_t, 1) << 10) |
40 | #define PMD_SECT_NG (_AT(pmdval_t, 1) << 11) | 40 | #define PMD_SECT_NG (_AT(pmdval_t, 1) << 11) |
41 | #define PMD_SECT_XN (_AT(pmdval_t, 1) << 54) | 41 | #define PMD_SECT_PXN (_AT(pmdval_t, 1) << 53) |
42 | #define PMD_SECT_UXN (_AT(pmdval_t, 1) << 54) | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). | 45 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). |
@@ -57,7 +58,8 @@ | |||
57 | #define PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ | 58 | #define PTE_SHARED (_AT(pteval_t, 3) << 8) /* SH[1:0], inner shareable */ |
58 | #define PTE_AF (_AT(pteval_t, 1) << 10) /* Access Flag */ | 59 | #define PTE_AF (_AT(pteval_t, 1) << 10) /* Access Flag */ |
59 | #define PTE_NG (_AT(pteval_t, 1) << 11) /* nG */ | 60 | #define PTE_NG (_AT(pteval_t, 1) << 11) /* nG */ |
60 | #define PTE_XN (_AT(pteval_t, 1) << 54) /* XN */ | 61 | #define PTE_PXN (_AT(pteval_t, 1) << 53) /* Privileged XN */ |
62 | #define PTE_UXN (_AT(pteval_t, 1) << 54) /* User XN */ | ||
61 | 63 | ||
62 | /* | 64 | /* |
63 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). | 65 | * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 8960239be722..14aba2db6776 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -62,23 +62,23 @@ extern pgprot_t pgprot_default; | |||
62 | 62 | ||
63 | #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) | 63 | #define _MOD_PROT(p, b) __pgprot(pgprot_val(p) | (b)) |
64 | 64 | ||
65 | #define PAGE_NONE _MOD_PROT(pgprot_default, PTE_NG | PTE_XN | PTE_RDONLY) | 65 | #define PAGE_NONE _MOD_PROT(pgprot_default, PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
66 | #define PAGE_SHARED _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN) | 66 | #define PAGE_SHARED _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN) |
67 | #define PAGE_SHARED_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG) | 67 | #define PAGE_SHARED_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN) |
68 | #define PAGE_COPY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 68 | #define PAGE_COPY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
69 | #define PAGE_COPY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_RDONLY) | 69 | #define PAGE_COPY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
70 | #define PAGE_READONLY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 70 | #define PAGE_READONLY _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
71 | #define PAGE_READONLY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_RDONLY) | 71 | #define PAGE_READONLY_EXEC _MOD_PROT(pgprot_default, PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
72 | #define PAGE_KERNEL _MOD_PROT(pgprot_default, PTE_XN | PTE_DIRTY) | 72 | #define PAGE_KERNEL _MOD_PROT(pgprot_default, PTE_PXN | PTE_UXN | PTE_DIRTY) |
73 | #define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_default, PTE_DIRTY) | 73 | #define PAGE_KERNEL_EXEC _MOD_PROT(pgprot_default, PTE_UXN | PTE_DIRTY) |
74 | 74 | ||
75 | #define __PAGE_NONE __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_XN | PTE_RDONLY) | 75 | #define __PAGE_NONE __pgprot(_PAGE_DEFAULT | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
76 | #define __PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN) | 76 | #define __PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN) |
77 | #define __PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG) | 77 | #define __PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN) |
78 | #define __PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 78 | #define __PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
79 | #define __PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_RDONLY) | 79 | #define __PAGE_COPY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
80 | #define __PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_XN | PTE_RDONLY) | 80 | #define __PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_RDONLY) |
81 | #define __PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_RDONLY) | 81 | #define __PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_RDONLY) |
82 | 82 | ||
83 | #endif /* __ASSEMBLY__ */ | 83 | #endif /* __ASSEMBLY__ */ |
84 | 84 | ||
@@ -130,10 +130,10 @@ extern struct page *empty_zero_page; | |||
130 | #define pte_young(pte) (pte_val(pte) & PTE_AF) | 130 | #define pte_young(pte) (pte_val(pte) & PTE_AF) |
131 | #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL) | 131 | #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL) |
132 | #define pte_write(pte) (!(pte_val(pte) & PTE_RDONLY)) | 132 | #define pte_write(pte) (!(pte_val(pte) & PTE_RDONLY)) |
133 | #define pte_exec(pte) (!(pte_val(pte) & PTE_XN)) | 133 | #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) |
134 | 134 | ||
135 | #define pte_present_exec_user(pte) \ | 135 | #define pte_present_exec_user(pte) \ |
136 | ((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_XN)) == \ | 136 | ((pte_val(pte) & (PTE_VALID | PTE_USER | PTE_UXN)) == \ |
137 | (PTE_VALID | PTE_USER)) | 137 | (PTE_VALID | PTE_USER)) |
138 | 138 | ||
139 | #define PTE_BIT_FUNC(fn,op) \ | 139 | #define PTE_BIT_FUNC(fn,op) \ |
@@ -262,7 +262,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr) | |||
262 | 262 | ||
263 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 263 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
264 | { | 264 | { |
265 | const pteval_t mask = PTE_USER | PTE_XN | PTE_RDONLY; | 265 | const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY; |
266 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); | 266 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); |
267 | return pte; | 267 | return pte; |
268 | } | 268 | } |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index acd5b68e8871..082e383c1b6f 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -637,7 +637,6 @@ mem_init (void) | |||
637 | 637 | ||
638 | high_memory = __va(max_low_pfn * PAGE_SIZE); | 638 | high_memory = __va(max_low_pfn * PAGE_SIZE); |
639 | 639 | ||
640 | reset_zone_present_pages(); | ||
641 | for_each_online_pgdat(pgdat) | 640 | for_each_online_pgdat(pgdat) |
642 | if (pgdat->bdata->node_bootmem_map) | 641 | if (pgdat->bdata->node_bootmem_map) |
643 | totalram_pages += free_all_bootmem_node(pgdat); | 642 | totalram_pages += free_all_bootmem_node(pgdat); |
diff --git a/arch/mips/cavium-octeon/executive/cvmx-l2c.c b/arch/mips/cavium-octeon/executive/cvmx-l2c.c index d38246e33ddb..9f883bf76953 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-l2c.c +++ b/arch/mips/cavium-octeon/executive/cvmx-l2c.c | |||
@@ -30,6 +30,7 @@ | |||
30 | * measurement, and debugging facilities. | 30 | * measurement, and debugging facilities. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include <linux/irqflags.h> | ||
33 | #include <asm/octeon/cvmx.h> | 34 | #include <asm/octeon/cvmx.h> |
34 | #include <asm/octeon/cvmx-l2c.h> | 35 | #include <asm/octeon/cvmx-l2c.h> |
35 | #include <asm/octeon/cvmx-spinlock.h> | 36 | #include <asm/octeon/cvmx-spinlock.h> |
diff --git a/arch/mips/fw/arc/misc.c b/arch/mips/fw/arc/misc.c index 7cf80ca2c1d2..f9f5307434c2 100644 --- a/arch/mips/fw/arc/misc.c +++ b/arch/mips/fw/arc/misc.c | |||
@@ -11,6 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/irqflags.h> | ||
14 | 15 | ||
15 | #include <asm/bcache.h> | 16 | #include <asm/bcache.h> |
16 | 17 | ||
diff --git a/arch/mips/include/asm/bitops.h b/arch/mips/include/asm/bitops.h index 82ad35ce2b45..46ac73abd5ee 100644 --- a/arch/mips/include/asm/bitops.h +++ b/arch/mips/include/asm/bitops.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
17 | #include <linux/irqflags.h> | ||
18 | #include <linux/types.h> | 17 | #include <linux/types.h> |
19 | #include <asm/barrier.h> | 18 | #include <asm/barrier.h> |
20 | #include <asm/byteorder.h> /* sigh ... */ | 19 | #include <asm/byteorder.h> /* sigh ... */ |
@@ -44,6 +43,24 @@ | |||
44 | #define smp_mb__before_clear_bit() smp_mb__before_llsc() | 43 | #define smp_mb__before_clear_bit() smp_mb__before_llsc() |
45 | #define smp_mb__after_clear_bit() smp_llsc_mb() | 44 | #define smp_mb__after_clear_bit() smp_llsc_mb() |
46 | 45 | ||
46 | |||
47 | /* | ||
48 | * These are the "slower" versions of the functions and are in bitops.c. | ||
49 | * These functions call raw_local_irq_{save,restore}(). | ||
50 | */ | ||
51 | void __mips_set_bit(unsigned long nr, volatile unsigned long *addr); | ||
52 | void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr); | ||
53 | void __mips_change_bit(unsigned long nr, volatile unsigned long *addr); | ||
54 | int __mips_test_and_set_bit(unsigned long nr, | ||
55 | volatile unsigned long *addr); | ||
56 | int __mips_test_and_set_bit_lock(unsigned long nr, | ||
57 | volatile unsigned long *addr); | ||
58 | int __mips_test_and_clear_bit(unsigned long nr, | ||
59 | volatile unsigned long *addr); | ||
60 | int __mips_test_and_change_bit(unsigned long nr, | ||
61 | volatile unsigned long *addr); | ||
62 | |||
63 | |||
47 | /* | 64 | /* |
48 | * set_bit - Atomically set a bit in memory | 65 | * set_bit - Atomically set a bit in memory |
49 | * @nr: the bit to set | 66 | * @nr: the bit to set |
@@ -57,7 +74,7 @@ | |||
57 | static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | 74 | static inline void set_bit(unsigned long nr, volatile unsigned long *addr) |
58 | { | 75 | { |
59 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 76 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
60 | unsigned short bit = nr & SZLONG_MASK; | 77 | int bit = nr & SZLONG_MASK; |
61 | unsigned long temp; | 78 | unsigned long temp; |
62 | 79 | ||
63 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 80 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
@@ -92,17 +109,8 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
92 | : "=&r" (temp), "+m" (*m) | 109 | : "=&r" (temp), "+m" (*m) |
93 | : "ir" (1UL << bit)); | 110 | : "ir" (1UL << bit)); |
94 | } while (unlikely(!temp)); | 111 | } while (unlikely(!temp)); |
95 | } else { | 112 | } else |
96 | volatile unsigned long *a = addr; | 113 | __mips_set_bit(nr, addr); |
97 | unsigned long mask; | ||
98 | unsigned long flags; | ||
99 | |||
100 | a += nr >> SZLONG_LOG; | ||
101 | mask = 1UL << bit; | ||
102 | raw_local_irq_save(flags); | ||
103 | *a |= mask; | ||
104 | raw_local_irq_restore(flags); | ||
105 | } | ||
106 | } | 114 | } |
107 | 115 | ||
108 | /* | 116 | /* |
@@ -118,7 +126,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
118 | static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | 126 | static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) |
119 | { | 127 | { |
120 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 128 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
121 | unsigned short bit = nr & SZLONG_MASK; | 129 | int bit = nr & SZLONG_MASK; |
122 | unsigned long temp; | 130 | unsigned long temp; |
123 | 131 | ||
124 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 132 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
@@ -153,17 +161,8 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
153 | : "=&r" (temp), "+m" (*m) | 161 | : "=&r" (temp), "+m" (*m) |
154 | : "ir" (~(1UL << bit))); | 162 | : "ir" (~(1UL << bit))); |
155 | } while (unlikely(!temp)); | 163 | } while (unlikely(!temp)); |
156 | } else { | 164 | } else |
157 | volatile unsigned long *a = addr; | 165 | __mips_clear_bit(nr, addr); |
158 | unsigned long mask; | ||
159 | unsigned long flags; | ||
160 | |||
161 | a += nr >> SZLONG_LOG; | ||
162 | mask = 1UL << bit; | ||
163 | raw_local_irq_save(flags); | ||
164 | *a &= ~mask; | ||
165 | raw_local_irq_restore(flags); | ||
166 | } | ||
167 | } | 166 | } |
168 | 167 | ||
169 | /* | 168 | /* |
@@ -191,7 +190,7 @@ static inline void clear_bit_unlock(unsigned long nr, volatile unsigned long *ad | |||
191 | */ | 190 | */ |
192 | static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | 191 | static inline void change_bit(unsigned long nr, volatile unsigned long *addr) |
193 | { | 192 | { |
194 | unsigned short bit = nr & SZLONG_MASK; | 193 | int bit = nr & SZLONG_MASK; |
195 | 194 | ||
196 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 195 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
197 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); | 196 | unsigned long *m = ((unsigned long *) addr) + (nr >> SZLONG_LOG); |
@@ -220,17 +219,8 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
220 | : "=&r" (temp), "+m" (*m) | 219 | : "=&r" (temp), "+m" (*m) |
221 | : "ir" (1UL << bit)); | 220 | : "ir" (1UL << bit)); |
222 | } while (unlikely(!temp)); | 221 | } while (unlikely(!temp)); |
223 | } else { | 222 | } else |
224 | volatile unsigned long *a = addr; | 223 | __mips_change_bit(nr, addr); |
225 | unsigned long mask; | ||
226 | unsigned long flags; | ||
227 | |||
228 | a += nr >> SZLONG_LOG; | ||
229 | mask = 1UL << bit; | ||
230 | raw_local_irq_save(flags); | ||
231 | *a ^= mask; | ||
232 | raw_local_irq_restore(flags); | ||
233 | } | ||
234 | } | 224 | } |
235 | 225 | ||
236 | /* | 226 | /* |
@@ -244,7 +234,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
244 | static inline int test_and_set_bit(unsigned long nr, | 234 | static inline int test_and_set_bit(unsigned long nr, |
245 | volatile unsigned long *addr) | 235 | volatile unsigned long *addr) |
246 | { | 236 | { |
247 | unsigned short bit = nr & SZLONG_MASK; | 237 | int bit = nr & SZLONG_MASK; |
248 | unsigned long res; | 238 | unsigned long res; |
249 | 239 | ||
250 | smp_mb__before_llsc(); | 240 | smp_mb__before_llsc(); |
@@ -281,18 +271,8 @@ static inline int test_and_set_bit(unsigned long nr, | |||
281 | } while (unlikely(!res)); | 271 | } while (unlikely(!res)); |
282 | 272 | ||
283 | res = temp & (1UL << bit); | 273 | res = temp & (1UL << bit); |
284 | } else { | 274 | } else |
285 | volatile unsigned long *a = addr; | 275 | res = __mips_test_and_set_bit(nr, addr); |
286 | unsigned long mask; | ||
287 | unsigned long flags; | ||
288 | |||
289 | a += nr >> SZLONG_LOG; | ||
290 | mask = 1UL << bit; | ||
291 | raw_local_irq_save(flags); | ||
292 | res = (mask & *a); | ||
293 | *a |= mask; | ||
294 | raw_local_irq_restore(flags); | ||
295 | } | ||
296 | 276 | ||
297 | smp_llsc_mb(); | 277 | smp_llsc_mb(); |
298 | 278 | ||
@@ -310,7 +290,7 @@ static inline int test_and_set_bit(unsigned long nr, | |||
310 | static inline int test_and_set_bit_lock(unsigned long nr, | 290 | static inline int test_and_set_bit_lock(unsigned long nr, |
311 | volatile unsigned long *addr) | 291 | volatile unsigned long *addr) |
312 | { | 292 | { |
313 | unsigned short bit = nr & SZLONG_MASK; | 293 | int bit = nr & SZLONG_MASK; |
314 | unsigned long res; | 294 | unsigned long res; |
315 | 295 | ||
316 | if (kernel_uses_llsc && R10000_LLSC_WAR) { | 296 | if (kernel_uses_llsc && R10000_LLSC_WAR) { |
@@ -345,18 +325,8 @@ static inline int test_and_set_bit_lock(unsigned long nr, | |||
345 | } while (unlikely(!res)); | 325 | } while (unlikely(!res)); |
346 | 326 | ||
347 | res = temp & (1UL << bit); | 327 | res = temp & (1UL << bit); |
348 | } else { | 328 | } else |
349 | volatile unsigned long *a = addr; | 329 | res = __mips_test_and_set_bit_lock(nr, addr); |
350 | unsigned long mask; | ||
351 | unsigned long flags; | ||
352 | |||
353 | a += nr >> SZLONG_LOG; | ||
354 | mask = 1UL << bit; | ||
355 | raw_local_irq_save(flags); | ||
356 | res = (mask & *a); | ||
357 | *a |= mask; | ||
358 | raw_local_irq_restore(flags); | ||
359 | } | ||
360 | 330 | ||
361 | smp_llsc_mb(); | 331 | smp_llsc_mb(); |
362 | 332 | ||
@@ -373,7 +343,7 @@ static inline int test_and_set_bit_lock(unsigned long nr, | |||
373 | static inline int test_and_clear_bit(unsigned long nr, | 343 | static inline int test_and_clear_bit(unsigned long nr, |
374 | volatile unsigned long *addr) | 344 | volatile unsigned long *addr) |
375 | { | 345 | { |
376 | unsigned short bit = nr & SZLONG_MASK; | 346 | int bit = nr & SZLONG_MASK; |
377 | unsigned long res; | 347 | unsigned long res; |
378 | 348 | ||
379 | smp_mb__before_llsc(); | 349 | smp_mb__before_llsc(); |
@@ -428,18 +398,8 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
428 | } while (unlikely(!res)); | 398 | } while (unlikely(!res)); |
429 | 399 | ||
430 | res = temp & (1UL << bit); | 400 | res = temp & (1UL << bit); |
431 | } else { | 401 | } else |
432 | volatile unsigned long *a = addr; | 402 | res = __mips_test_and_clear_bit(nr, addr); |
433 | unsigned long mask; | ||
434 | unsigned long flags; | ||
435 | |||
436 | a += nr >> SZLONG_LOG; | ||
437 | mask = 1UL << bit; | ||
438 | raw_local_irq_save(flags); | ||
439 | res = (mask & *a); | ||
440 | *a &= ~mask; | ||
441 | raw_local_irq_restore(flags); | ||
442 | } | ||
443 | 403 | ||
444 | smp_llsc_mb(); | 404 | smp_llsc_mb(); |
445 | 405 | ||
@@ -457,7 +417,7 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
457 | static inline int test_and_change_bit(unsigned long nr, | 417 | static inline int test_and_change_bit(unsigned long nr, |
458 | volatile unsigned long *addr) | 418 | volatile unsigned long *addr) |
459 | { | 419 | { |
460 | unsigned short bit = nr & SZLONG_MASK; | 420 | int bit = nr & SZLONG_MASK; |
461 | unsigned long res; | 421 | unsigned long res; |
462 | 422 | ||
463 | smp_mb__before_llsc(); | 423 | smp_mb__before_llsc(); |
@@ -494,18 +454,8 @@ static inline int test_and_change_bit(unsigned long nr, | |||
494 | } while (unlikely(!res)); | 454 | } while (unlikely(!res)); |
495 | 455 | ||
496 | res = temp & (1UL << bit); | 456 | res = temp & (1UL << bit); |
497 | } else { | 457 | } else |
498 | volatile unsigned long *a = addr; | 458 | res = __mips_test_and_change_bit(nr, addr); |
499 | unsigned long mask; | ||
500 | unsigned long flags; | ||
501 | |||
502 | a += nr >> SZLONG_LOG; | ||
503 | mask = 1UL << bit; | ||
504 | raw_local_irq_save(flags); | ||
505 | res = (mask & *a); | ||
506 | *a ^= mask; | ||
507 | raw_local_irq_restore(flags); | ||
508 | } | ||
509 | 459 | ||
510 | smp_llsc_mb(); | 460 | smp_llsc_mb(); |
511 | 461 | ||
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index 58277e0e9cd4..3c5d1464b7bd 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h | |||
@@ -290,7 +290,7 @@ struct compat_shmid64_ds { | |||
290 | 290 | ||
291 | static inline int is_compat_task(void) | 291 | static inline int is_compat_task(void) |
292 | { | 292 | { |
293 | return test_thread_flag(TIF_32BIT); | 293 | return test_thread_flag(TIF_32BIT_ADDR); |
294 | } | 294 | } |
295 | 295 | ||
296 | #endif /* _ASM_COMPAT_H */ | 296 | #endif /* _ASM_COMPAT_H */ |
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 29d9c23c20c7..ff2e0345e013 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/irqflags.h> | ||
18 | 19 | ||
19 | #include <asm/addrspace.h> | 20 | #include <asm/addrspace.h> |
20 | #include <asm/bug.h> | 21 | #include <asm/bug.h> |
diff --git a/arch/mips/include/asm/irqflags.h b/arch/mips/include/asm/irqflags.h index 309cbcd6909c..9f3384c789d7 100644 --- a/arch/mips/include/asm/irqflags.h +++ b/arch/mips/include/asm/irqflags.h | |||
@@ -16,83 +16,13 @@ | |||
16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
17 | #include <asm/hazards.h> | 17 | #include <asm/hazards.h> |
18 | 18 | ||
19 | __asm__( | 19 | #if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_MIPS_MT_SMTC) |
20 | " .macro arch_local_irq_enable \n" | ||
21 | " .set push \n" | ||
22 | " .set reorder \n" | ||
23 | " .set noat \n" | ||
24 | #ifdef CONFIG_MIPS_MT_SMTC | ||
25 | " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" | ||
26 | " ori $1, 0x400 \n" | ||
27 | " xori $1, 0x400 \n" | ||
28 | " mtc0 $1, $2, 1 \n" | ||
29 | #elif defined(CONFIG_CPU_MIPSR2) | ||
30 | " ei \n" | ||
31 | #else | ||
32 | " mfc0 $1,$12 \n" | ||
33 | " ori $1,0x1f \n" | ||
34 | " xori $1,0x1e \n" | ||
35 | " mtc0 $1,$12 \n" | ||
36 | #endif | ||
37 | " irq_enable_hazard \n" | ||
38 | " .set pop \n" | ||
39 | " .endm"); | ||
40 | 20 | ||
41 | extern void smtc_ipi_replay(void); | ||
42 | |||
43 | static inline void arch_local_irq_enable(void) | ||
44 | { | ||
45 | #ifdef CONFIG_MIPS_MT_SMTC | ||
46 | /* | ||
47 | * SMTC kernel needs to do a software replay of queued | ||
48 | * IPIs, at the cost of call overhead on each local_irq_enable() | ||
49 | */ | ||
50 | smtc_ipi_replay(); | ||
51 | #endif | ||
52 | __asm__ __volatile__( | ||
53 | "arch_local_irq_enable" | ||
54 | : /* no outputs */ | ||
55 | : /* no inputs */ | ||
56 | : "memory"); | ||
57 | } | ||
58 | |||
59 | |||
60 | /* | ||
61 | * For cli() we have to insert nops to make sure that the new value | ||
62 | * has actually arrived in the status register before the end of this | ||
63 | * macro. | ||
64 | * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs | ||
65 | * no nops at all. | ||
66 | */ | ||
67 | /* | ||
68 | * For TX49, operating only IE bit is not enough. | ||
69 | * | ||
70 | * If mfc0 $12 follows store and the mfc0 is last instruction of a | ||
71 | * page and fetching the next instruction causes TLB miss, the result | ||
72 | * of the mfc0 might wrongly contain EXL bit. | ||
73 | * | ||
74 | * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 | ||
75 | * | ||
76 | * Workaround: mask EXL bit of the result or place a nop before mfc0. | ||
77 | */ | ||
78 | __asm__( | 21 | __asm__( |
79 | " .macro arch_local_irq_disable\n" | 22 | " .macro arch_local_irq_disable\n" |
80 | " .set push \n" | 23 | " .set push \n" |
81 | " .set noat \n" | 24 | " .set noat \n" |
82 | #ifdef CONFIG_MIPS_MT_SMTC | ||
83 | " mfc0 $1, $2, 1 \n" | ||
84 | " ori $1, 0x400 \n" | ||
85 | " .set noreorder \n" | ||
86 | " mtc0 $1, $2, 1 \n" | ||
87 | #elif defined(CONFIG_CPU_MIPSR2) | ||
88 | " di \n" | 25 | " di \n" |
89 | #else | ||
90 | " mfc0 $1,$12 \n" | ||
91 | " ori $1,0x1f \n" | ||
92 | " xori $1,0x1f \n" | ||
93 | " .set noreorder \n" | ||
94 | " mtc0 $1,$12 \n" | ||
95 | #endif | ||
96 | " irq_disable_hazard \n" | 26 | " irq_disable_hazard \n" |
97 | " .set pop \n" | 27 | " .set pop \n" |
98 | " .endm \n"); | 28 | " .endm \n"); |
@@ -106,46 +36,14 @@ static inline void arch_local_irq_disable(void) | |||
106 | : "memory"); | 36 | : "memory"); |
107 | } | 37 | } |
108 | 38 | ||
109 | __asm__( | ||
110 | " .macro arch_local_save_flags flags \n" | ||
111 | " .set push \n" | ||
112 | " .set reorder \n" | ||
113 | #ifdef CONFIG_MIPS_MT_SMTC | ||
114 | " mfc0 \\flags, $2, 1 \n" | ||
115 | #else | ||
116 | " mfc0 \\flags, $12 \n" | ||
117 | #endif | ||
118 | " .set pop \n" | ||
119 | " .endm \n"); | ||
120 | |||
121 | static inline unsigned long arch_local_save_flags(void) | ||
122 | { | ||
123 | unsigned long flags; | ||
124 | asm volatile("arch_local_save_flags %0" : "=r" (flags)); | ||
125 | return flags; | ||
126 | } | ||
127 | 39 | ||
128 | __asm__( | 40 | __asm__( |
129 | " .macro arch_local_irq_save result \n" | 41 | " .macro arch_local_irq_save result \n" |
130 | " .set push \n" | 42 | " .set push \n" |
131 | " .set reorder \n" | 43 | " .set reorder \n" |
132 | " .set noat \n" | 44 | " .set noat \n" |
133 | #ifdef CONFIG_MIPS_MT_SMTC | ||
134 | " mfc0 \\result, $2, 1 \n" | ||
135 | " ori $1, \\result, 0x400 \n" | ||
136 | " .set noreorder \n" | ||
137 | " mtc0 $1, $2, 1 \n" | ||
138 | " andi \\result, \\result, 0x400 \n" | ||
139 | #elif defined(CONFIG_CPU_MIPSR2) | ||
140 | " di \\result \n" | 45 | " di \\result \n" |
141 | " andi \\result, 1 \n" | 46 | " andi \\result, 1 \n" |
142 | #else | ||
143 | " mfc0 \\result, $12 \n" | ||
144 | " ori $1, \\result, 0x1f \n" | ||
145 | " xori $1, 0x1f \n" | ||
146 | " .set noreorder \n" | ||
147 | " mtc0 $1, $12 \n" | ||
148 | #endif | ||
149 | " irq_disable_hazard \n" | 47 | " irq_disable_hazard \n" |
150 | " .set pop \n" | 48 | " .set pop \n" |
151 | " .endm \n"); | 49 | " .endm \n"); |
@@ -160,61 +58,37 @@ static inline unsigned long arch_local_irq_save(void) | |||
160 | return flags; | 58 | return flags; |
161 | } | 59 | } |
162 | 60 | ||
61 | |||
163 | __asm__( | 62 | __asm__( |
164 | " .macro arch_local_irq_restore flags \n" | 63 | " .macro arch_local_irq_restore flags \n" |
165 | " .set push \n" | 64 | " .set push \n" |
166 | " .set noreorder \n" | 65 | " .set noreorder \n" |
167 | " .set noat \n" | 66 | " .set noat \n" |
168 | #ifdef CONFIG_MIPS_MT_SMTC | 67 | #if defined(CONFIG_IRQ_CPU) |
169 | "mfc0 $1, $2, 1 \n" | ||
170 | "andi \\flags, 0x400 \n" | ||
171 | "ori $1, 0x400 \n" | ||
172 | "xori $1, 0x400 \n" | ||
173 | "or \\flags, $1 \n" | ||
174 | "mtc0 \\flags, $2, 1 \n" | ||
175 | #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | ||
176 | /* | 68 | /* |
177 | * Slow, but doesn't suffer from a relatively unlikely race | 69 | * Slow, but doesn't suffer from a relatively unlikely race |
178 | * condition we're having since days 1. | 70 | * condition we're having since days 1. |
179 | */ | 71 | */ |
180 | " beqz \\flags, 1f \n" | 72 | " beqz \\flags, 1f \n" |
181 | " di \n" | 73 | " di \n" |
182 | " ei \n" | 74 | " ei \n" |
183 | "1: \n" | 75 | "1: \n" |
184 | #elif defined(CONFIG_CPU_MIPSR2) | 76 | #else |
185 | /* | 77 | /* |
186 | * Fast, dangerous. Life is fun, life is good. | 78 | * Fast, dangerous. Life is fun, life is good. |
187 | */ | 79 | */ |
188 | " mfc0 $1, $12 \n" | 80 | " mfc0 $1, $12 \n" |
189 | " ins $1, \\flags, 0, 1 \n" | 81 | " ins $1, \\flags, 0, 1 \n" |
190 | " mtc0 $1, $12 \n" | 82 | " mtc0 $1, $12 \n" |
191 | #else | ||
192 | " mfc0 $1, $12 \n" | ||
193 | " andi \\flags, 1 \n" | ||
194 | " ori $1, 0x1f \n" | ||
195 | " xori $1, 0x1f \n" | ||
196 | " or \\flags, $1 \n" | ||
197 | " mtc0 \\flags, $12 \n" | ||
198 | #endif | 83 | #endif |
199 | " irq_disable_hazard \n" | 84 | " irq_disable_hazard \n" |
200 | " .set pop \n" | 85 | " .set pop \n" |
201 | " .endm \n"); | 86 | " .endm \n"); |
202 | 87 | ||
203 | |||
204 | static inline void arch_local_irq_restore(unsigned long flags) | 88 | static inline void arch_local_irq_restore(unsigned long flags) |
205 | { | 89 | { |
206 | unsigned long __tmp1; | 90 | unsigned long __tmp1; |
207 | 91 | ||
208 | #ifdef CONFIG_MIPS_MT_SMTC | ||
209 | /* | ||
210 | * SMTC kernel needs to do a software replay of queued | ||
211 | * IPIs, at the cost of branch and call overhead on each | ||
212 | * local_irq_restore() | ||
213 | */ | ||
214 | if (unlikely(!(flags & 0x0400))) | ||
215 | smtc_ipi_replay(); | ||
216 | #endif | ||
217 | |||
218 | __asm__ __volatile__( | 92 | __asm__ __volatile__( |
219 | "arch_local_irq_restore\t%0" | 93 | "arch_local_irq_restore\t%0" |
220 | : "=r" (__tmp1) | 94 | : "=r" (__tmp1) |
@@ -232,6 +106,75 @@ static inline void __arch_local_irq_restore(unsigned long flags) | |||
232 | : "0" (flags) | 106 | : "0" (flags) |
233 | : "memory"); | 107 | : "memory"); |
234 | } | 108 | } |
109 | #else | ||
110 | /* Functions that require preempt_{dis,en}able() are in mips-atomic.c */ | ||
111 | void arch_local_irq_disable(void); | ||
112 | unsigned long arch_local_irq_save(void); | ||
113 | void arch_local_irq_restore(unsigned long flags); | ||
114 | void __arch_local_irq_restore(unsigned long flags); | ||
115 | #endif /* if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_MIPS_MT_SMTC) */ | ||
116 | |||
117 | |||
118 | __asm__( | ||
119 | " .macro arch_local_irq_enable \n" | ||
120 | " .set push \n" | ||
121 | " .set reorder \n" | ||
122 | " .set noat \n" | ||
123 | #ifdef CONFIG_MIPS_MT_SMTC | ||
124 | " mfc0 $1, $2, 1 # SMTC - clear TCStatus.IXMT \n" | ||
125 | " ori $1, 0x400 \n" | ||
126 | " xori $1, 0x400 \n" | ||
127 | " mtc0 $1, $2, 1 \n" | ||
128 | #elif defined(CONFIG_CPU_MIPSR2) | ||
129 | " ei \n" | ||
130 | #else | ||
131 | " mfc0 $1,$12 \n" | ||
132 | " ori $1,0x1f \n" | ||
133 | " xori $1,0x1e \n" | ||
134 | " mtc0 $1,$12 \n" | ||
135 | #endif | ||
136 | " irq_enable_hazard \n" | ||
137 | " .set pop \n" | ||
138 | " .endm"); | ||
139 | |||
140 | extern void smtc_ipi_replay(void); | ||
141 | |||
142 | static inline void arch_local_irq_enable(void) | ||
143 | { | ||
144 | #ifdef CONFIG_MIPS_MT_SMTC | ||
145 | /* | ||
146 | * SMTC kernel needs to do a software replay of queued | ||
147 | * IPIs, at the cost of call overhead on each local_irq_enable() | ||
148 | */ | ||
149 | smtc_ipi_replay(); | ||
150 | #endif | ||
151 | __asm__ __volatile__( | ||
152 | "arch_local_irq_enable" | ||
153 | : /* no outputs */ | ||
154 | : /* no inputs */ | ||
155 | : "memory"); | ||
156 | } | ||
157 | |||
158 | |||
159 | __asm__( | ||
160 | " .macro arch_local_save_flags flags \n" | ||
161 | " .set push \n" | ||
162 | " .set reorder \n" | ||
163 | #ifdef CONFIG_MIPS_MT_SMTC | ||
164 | " mfc0 \\flags, $2, 1 \n" | ||
165 | #else | ||
166 | " mfc0 \\flags, $12 \n" | ||
167 | #endif | ||
168 | " .set pop \n" | ||
169 | " .endm \n"); | ||
170 | |||
171 | static inline unsigned long arch_local_save_flags(void) | ||
172 | { | ||
173 | unsigned long flags; | ||
174 | asm volatile("arch_local_save_flags %0" : "=r" (flags)); | ||
175 | return flags; | ||
176 | } | ||
177 | |||
235 | 178 | ||
236 | static inline int arch_irqs_disabled_flags(unsigned long flags) | 179 | static inline int arch_irqs_disabled_flags(unsigned long flags) |
237 | { | 180 | { |
@@ -245,7 +188,7 @@ static inline int arch_irqs_disabled_flags(unsigned long flags) | |||
245 | #endif | 188 | #endif |
246 | } | 189 | } |
247 | 190 | ||
248 | #endif | 191 | #endif /* #ifndef __ASSEMBLY__ */ |
249 | 192 | ||
250 | /* | 193 | /* |
251 | * Do the CPU's IRQ-state tracing from assembly code. | 194 | * Do the CPU's IRQ-state tracing from assembly code. |
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 8debe9e91754..18806a52061c 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h | |||
@@ -112,12 +112,6 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
112 | #define TIF_LOAD_WATCH 25 /* If set, load watch registers */ | 112 | #define TIF_LOAD_WATCH 25 /* If set, load watch registers */ |
113 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ | 113 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ |
114 | 114 | ||
115 | #ifdef CONFIG_MIPS32_O32 | ||
116 | #define TIF_32BIT TIF_32BIT_REGS | ||
117 | #elif defined(CONFIG_MIPS32_N32) | ||
118 | #define TIF_32BIT _TIF_32BIT_ADDR | ||
119 | #endif /* CONFIG_MIPS32_O32 */ | ||
120 | |||
121 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 115 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
122 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 116 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
123 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 117 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index c4a82e841c73..eeddc58802e1 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile | |||
@@ -2,8 +2,9 @@ | |||
2 | # Makefile for MIPS-specific library files.. | 2 | # Makefile for MIPS-specific library files.. |
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y += csum_partial.o delay.o memcpy.o memset.o \ | 5 | lib-y += bitops.o csum_partial.o delay.o memcpy.o memset.o \ |
6 | strlen_user.o strncpy_user.o strnlen_user.o uncached.o | 6 | mips-atomic.o strlen_user.o strncpy_user.o \ |
7 | strnlen_user.o uncached.o | ||
7 | 8 | ||
8 | obj-y += iomap.o | 9 | obj-y += iomap.o |
9 | obj-$(CONFIG_PCI) += iomap-pci.o | 10 | obj-$(CONFIG_PCI) += iomap-pci.o |
diff --git a/arch/mips/lib/bitops.c b/arch/mips/lib/bitops.c new file mode 100644 index 000000000000..239a9c957b02 --- /dev/null +++ b/arch/mips/lib/bitops.c | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (c) 1994-1997, 99, 2000, 06, 07 Ralf Baechle (ralf@linux-mips.org) | ||
7 | * Copyright (c) 1999, 2000 Silicon Graphics, Inc. | ||
8 | */ | ||
9 | #include <linux/bitops.h> | ||
10 | #include <linux/irqflags.h> | ||
11 | #include <linux/export.h> | ||
12 | |||
13 | |||
14 | /** | ||
15 | * __mips_set_bit - Atomically set a bit in memory. This is called by | ||
16 | * set_bit() if it cannot find a faster solution. | ||
17 | * @nr: the bit to set | ||
18 | * @addr: the address to start counting from | ||
19 | */ | ||
20 | void __mips_set_bit(unsigned long nr, volatile unsigned long *addr) | ||
21 | { | ||
22 | volatile unsigned long *a = addr; | ||
23 | unsigned bit = nr & SZLONG_MASK; | ||
24 | unsigned long mask; | ||
25 | unsigned long flags; | ||
26 | |||
27 | a += nr >> SZLONG_LOG; | ||
28 | mask = 1UL << bit; | ||
29 | raw_local_irq_save(flags); | ||
30 | *a |= mask; | ||
31 | raw_local_irq_restore(flags); | ||
32 | } | ||
33 | EXPORT_SYMBOL(__mips_set_bit); | ||
34 | |||
35 | |||
36 | /** | ||
37 | * __mips_clear_bit - Clears a bit in memory. This is called by clear_bit() if | ||
38 | * it cannot find a faster solution. | ||
39 | * @nr: Bit to clear | ||
40 | * @addr: Address to start counting from | ||
41 | */ | ||
42 | void __mips_clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
43 | { | ||
44 | volatile unsigned long *a = addr; | ||
45 | unsigned bit = nr & SZLONG_MASK; | ||
46 | unsigned long mask; | ||
47 | unsigned long flags; | ||
48 | |||
49 | a += nr >> SZLONG_LOG; | ||
50 | mask = 1UL << bit; | ||
51 | raw_local_irq_save(flags); | ||
52 | *a &= ~mask; | ||
53 | raw_local_irq_restore(flags); | ||
54 | } | ||
55 | EXPORT_SYMBOL(__mips_clear_bit); | ||
56 | |||
57 | |||
58 | /** | ||
59 | * __mips_change_bit - Toggle a bit in memory. This is called by change_bit() | ||
60 | * if it cannot find a faster solution. | ||
61 | * @nr: Bit to change | ||
62 | * @addr: Address to start counting from | ||
63 | */ | ||
64 | void __mips_change_bit(unsigned long nr, volatile unsigned long *addr) | ||
65 | { | ||
66 | volatile unsigned long *a = addr; | ||
67 | unsigned bit = nr & SZLONG_MASK; | ||
68 | unsigned long mask; | ||
69 | unsigned long flags; | ||
70 | |||
71 | a += nr >> SZLONG_LOG; | ||
72 | mask = 1UL << bit; | ||
73 | raw_local_irq_save(flags); | ||
74 | *a ^= mask; | ||
75 | raw_local_irq_restore(flags); | ||
76 | } | ||
77 | EXPORT_SYMBOL(__mips_change_bit); | ||
78 | |||
79 | |||
80 | /** | ||
81 | * __mips_test_and_set_bit - Set a bit and return its old value. This is | ||
82 | * called by test_and_set_bit() if it cannot find a faster solution. | ||
83 | * @nr: Bit to set | ||
84 | * @addr: Address to count from | ||
85 | */ | ||
86 | int __mips_test_and_set_bit(unsigned long nr, | ||
87 | volatile unsigned long *addr) | ||
88 | { | ||
89 | volatile unsigned long *a = addr; | ||
90 | unsigned bit = nr & SZLONG_MASK; | ||
91 | unsigned long mask; | ||
92 | unsigned long flags; | ||
93 | unsigned long res; | ||
94 | |||
95 | a += nr >> SZLONG_LOG; | ||
96 | mask = 1UL << bit; | ||
97 | raw_local_irq_save(flags); | ||
98 | res = (mask & *a); | ||
99 | *a |= mask; | ||
100 | raw_local_irq_restore(flags); | ||
101 | return res; | ||
102 | } | ||
103 | EXPORT_SYMBOL(__mips_test_and_set_bit); | ||
104 | |||
105 | |||
106 | /** | ||
107 | * __mips_test_and_set_bit_lock - Set a bit and return its old value. This is | ||
108 | * called by test_and_set_bit_lock() if it cannot find a faster solution. | ||
109 | * @nr: Bit to set | ||
110 | * @addr: Address to count from | ||
111 | */ | ||
112 | int __mips_test_and_set_bit_lock(unsigned long nr, | ||
113 | volatile unsigned long *addr) | ||
114 | { | ||
115 | volatile unsigned long *a = addr; | ||
116 | unsigned bit = nr & SZLONG_MASK; | ||
117 | unsigned long mask; | ||
118 | unsigned long flags; | ||
119 | unsigned long res; | ||
120 | |||
121 | a += nr >> SZLONG_LOG; | ||
122 | mask = 1UL << bit; | ||
123 | raw_local_irq_save(flags); | ||
124 | res = (mask & *a); | ||
125 | *a |= mask; | ||
126 | raw_local_irq_restore(flags); | ||
127 | return res; | ||
128 | } | ||
129 | EXPORT_SYMBOL(__mips_test_and_set_bit_lock); | ||
130 | |||
131 | |||
132 | /** | ||
133 | * __mips_test_and_clear_bit - Clear a bit and return its old value. This is | ||
134 | * called by test_and_clear_bit() if it cannot find a faster solution. | ||
135 | * @nr: Bit to clear | ||
136 | * @addr: Address to count from | ||
137 | */ | ||
138 | int __mips_test_and_clear_bit(unsigned long nr, volatile unsigned long *addr) | ||
139 | { | ||
140 | volatile unsigned long *a = addr; | ||
141 | unsigned bit = nr & SZLONG_MASK; | ||
142 | unsigned long mask; | ||
143 | unsigned long flags; | ||
144 | unsigned long res; | ||
145 | |||
146 | a += nr >> SZLONG_LOG; | ||
147 | mask = 1UL << bit; | ||
148 | raw_local_irq_save(flags); | ||
149 | res = (mask & *a); | ||
150 | *a &= ~mask; | ||
151 | raw_local_irq_restore(flags); | ||
152 | return res; | ||
153 | } | ||
154 | EXPORT_SYMBOL(__mips_test_and_clear_bit); | ||
155 | |||
156 | |||
157 | /** | ||
158 | * __mips_test_and_change_bit - Change a bit and return its old value. This is | ||
159 | * called by test_and_change_bit() if it cannot find a faster solution. | ||
160 | * @nr: Bit to change | ||
161 | * @addr: Address to count from | ||
162 | */ | ||
163 | int __mips_test_and_change_bit(unsigned long nr, volatile unsigned long *addr) | ||
164 | { | ||
165 | volatile unsigned long *a = addr; | ||
166 | unsigned bit = nr & SZLONG_MASK; | ||
167 | unsigned long mask; | ||
168 | unsigned long flags; | ||
169 | unsigned long res; | ||
170 | |||
171 | a += nr >> SZLONG_LOG; | ||
172 | mask = 1UL << bit; | ||
173 | raw_local_irq_save(flags); | ||
174 | res = (mask & *a); | ||
175 | *a ^= mask; | ||
176 | raw_local_irq_restore(flags); | ||
177 | return res; | ||
178 | } | ||
179 | EXPORT_SYMBOL(__mips_test_and_change_bit); | ||
diff --git a/arch/mips/lib/mips-atomic.c b/arch/mips/lib/mips-atomic.c new file mode 100644 index 000000000000..e091430dbeb1 --- /dev/null +++ b/arch/mips/lib/mips-atomic.c | |||
@@ -0,0 +1,176 @@ | |||
1 | /* | ||
2 | * This file is subject to the terms and conditions of the GNU General Public | ||
3 | * License. See the file "COPYING" in the main directory of this archive | ||
4 | * for more details. | ||
5 | * | ||
6 | * Copyright (C) 1994, 95, 96, 97, 98, 99, 2003 by Ralf Baechle | ||
7 | * Copyright (C) 1996 by Paul M. Antoine | ||
8 | * Copyright (C) 1999 Silicon Graphics | ||
9 | * Copyright (C) 2000 MIPS Technologies, Inc. | ||
10 | */ | ||
11 | #include <asm/irqflags.h> | ||
12 | #include <asm/hazards.h> | ||
13 | #include <linux/compiler.h> | ||
14 | #include <linux/preempt.h> | ||
15 | #include <linux/export.h> | ||
16 | |||
17 | #if !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC) | ||
18 | |||
19 | /* | ||
20 | * For cli() we have to insert nops to make sure that the new value | ||
21 | * has actually arrived in the status register before the end of this | ||
22 | * macro. | ||
23 | * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs | ||
24 | * no nops at all. | ||
25 | */ | ||
26 | /* | ||
27 | * For TX49, operating only IE bit is not enough. | ||
28 | * | ||
29 | * If mfc0 $12 follows store and the mfc0 is last instruction of a | ||
30 | * page and fetching the next instruction causes TLB miss, the result | ||
31 | * of the mfc0 might wrongly contain EXL bit. | ||
32 | * | ||
33 | * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008 | ||
34 | * | ||
35 | * Workaround: mask EXL bit of the result or place a nop before mfc0. | ||
36 | */ | ||
37 | __asm__( | ||
38 | " .macro arch_local_irq_disable\n" | ||
39 | " .set push \n" | ||
40 | " .set noat \n" | ||
41 | #ifdef CONFIG_MIPS_MT_SMTC | ||
42 | " mfc0 $1, $2, 1 \n" | ||
43 | " ori $1, 0x400 \n" | ||
44 | " .set noreorder \n" | ||
45 | " mtc0 $1, $2, 1 \n" | ||
46 | #elif defined(CONFIG_CPU_MIPSR2) | ||
47 | /* see irqflags.h for inline function */ | ||
48 | #else | ||
49 | " mfc0 $1,$12 \n" | ||
50 | " ori $1,0x1f \n" | ||
51 | " xori $1,0x1f \n" | ||
52 | " .set noreorder \n" | ||
53 | " mtc0 $1,$12 \n" | ||
54 | #endif | ||
55 | " irq_disable_hazard \n" | ||
56 | " .set pop \n" | ||
57 | " .endm \n"); | ||
58 | |||
59 | void arch_local_irq_disable(void) | ||
60 | { | ||
61 | preempt_disable(); | ||
62 | __asm__ __volatile__( | ||
63 | "arch_local_irq_disable" | ||
64 | : /* no outputs */ | ||
65 | : /* no inputs */ | ||
66 | : "memory"); | ||
67 | preempt_enable(); | ||
68 | } | ||
69 | EXPORT_SYMBOL(arch_local_irq_disable); | ||
70 | |||
71 | |||
72 | __asm__( | ||
73 | " .macro arch_local_irq_save result \n" | ||
74 | " .set push \n" | ||
75 | " .set reorder \n" | ||
76 | " .set noat \n" | ||
77 | #ifdef CONFIG_MIPS_MT_SMTC | ||
78 | " mfc0 \\result, $2, 1 \n" | ||
79 | " ori $1, \\result, 0x400 \n" | ||
80 | " .set noreorder \n" | ||
81 | " mtc0 $1, $2, 1 \n" | ||
82 | " andi \\result, \\result, 0x400 \n" | ||
83 | #elif defined(CONFIG_CPU_MIPSR2) | ||
84 | /* see irqflags.h for inline function */ | ||
85 | #else | ||
86 | " mfc0 \\result, $12 \n" | ||
87 | " ori $1, \\result, 0x1f \n" | ||
88 | " xori $1, 0x1f \n" | ||
89 | " .set noreorder \n" | ||
90 | " mtc0 $1, $12 \n" | ||
91 | #endif | ||
92 | " irq_disable_hazard \n" | ||
93 | " .set pop \n" | ||
94 | " .endm \n"); | ||
95 | |||
96 | unsigned long arch_local_irq_save(void) | ||
97 | { | ||
98 | unsigned long flags; | ||
99 | preempt_disable(); | ||
100 | asm volatile("arch_local_irq_save\t%0" | ||
101 | : "=r" (flags) | ||
102 | : /* no inputs */ | ||
103 | : "memory"); | ||
104 | preempt_enable(); | ||
105 | return flags; | ||
106 | } | ||
107 | EXPORT_SYMBOL(arch_local_irq_save); | ||
108 | |||
109 | |||
110 | __asm__( | ||
111 | " .macro arch_local_irq_restore flags \n" | ||
112 | " .set push \n" | ||
113 | " .set noreorder \n" | ||
114 | " .set noat \n" | ||
115 | #ifdef CONFIG_MIPS_MT_SMTC | ||
116 | "mfc0 $1, $2, 1 \n" | ||
117 | "andi \\flags, 0x400 \n" | ||
118 | "ori $1, 0x400 \n" | ||
119 | "xori $1, 0x400 \n" | ||
120 | "or \\flags, $1 \n" | ||
121 | "mtc0 \\flags, $2, 1 \n" | ||
122 | #elif defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU) | ||
123 | /* see irqflags.h for inline function */ | ||
124 | #elif defined(CONFIG_CPU_MIPSR2) | ||
125 | /* see irqflags.h for inline function */ | ||
126 | #else | ||
127 | " mfc0 $1, $12 \n" | ||
128 | " andi \\flags, 1 \n" | ||
129 | " ori $1, 0x1f \n" | ||
130 | " xori $1, 0x1f \n" | ||
131 | " or \\flags, $1 \n" | ||
132 | " mtc0 \\flags, $12 \n" | ||
133 | #endif | ||
134 | " irq_disable_hazard \n" | ||
135 | " .set pop \n" | ||
136 | " .endm \n"); | ||
137 | |||
138 | void arch_local_irq_restore(unsigned long flags) | ||
139 | { | ||
140 | unsigned long __tmp1; | ||
141 | |||
142 | #ifdef CONFIG_MIPS_MT_SMTC | ||
143 | /* | ||
144 | * SMTC kernel needs to do a software replay of queued | ||
145 | * IPIs, at the cost of branch and call overhead on each | ||
146 | * local_irq_restore() | ||
147 | */ | ||
148 | if (unlikely(!(flags & 0x0400))) | ||
149 | smtc_ipi_replay(); | ||
150 | #endif | ||
151 | preempt_disable(); | ||
152 | __asm__ __volatile__( | ||
153 | "arch_local_irq_restore\t%0" | ||
154 | : "=r" (__tmp1) | ||
155 | : "0" (flags) | ||
156 | : "memory"); | ||
157 | preempt_enable(); | ||
158 | } | ||
159 | EXPORT_SYMBOL(arch_local_irq_restore); | ||
160 | |||
161 | |||
162 | void __arch_local_irq_restore(unsigned long flags) | ||
163 | { | ||
164 | unsigned long __tmp1; | ||
165 | |||
166 | preempt_disable(); | ||
167 | __asm__ __volatile__( | ||
168 | "arch_local_irq_restore\t%0" | ||
169 | : "=r" (__tmp1) | ||
170 | : "0" (flags) | ||
171 | : "memory"); | ||
172 | preempt_enable(); | ||
173 | } | ||
174 | EXPORT_SYMBOL(__arch_local_irq_restore); | ||
175 | |||
176 | #endif /* !defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_MIPS_MT_SMTC) */ | ||
diff --git a/arch/mips/mti-malta/malta-platform.c b/arch/mips/mti-malta/malta-platform.c index 80562b81f0f2..74732177851c 100644 --- a/arch/mips/mti-malta/malta-platform.c +++ b/arch/mips/mti-malta/malta-platform.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/mtd/partitions.h> | 29 | #include <linux/mtd/partitions.h> |
30 | #include <linux/mtd/physmap.h> | 30 | #include <linux/mtd/physmap.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <asm/mips-boards/maltaint.h> | ||
32 | #include <mtd/mtd-abi.h> | 33 | #include <mtd/mtd-abi.h> |
33 | 34 | ||
34 | #define SMC_PORT(base, int) \ | 35 | #define SMC_PORT(base, int) \ |
@@ -48,7 +49,7 @@ static struct plat_serial8250_port uart8250_data[] = { | |||
48 | SMC_PORT(0x2F8, 3), | 49 | SMC_PORT(0x2F8, 3), |
49 | { | 50 | { |
50 | .mapbase = 0x1f000900, /* The CBUS UART */ | 51 | .mapbase = 0x1f000900, /* The CBUS UART */ |
51 | .irq = MIPS_CPU_IRQ_BASE + 2, | 52 | .irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB2, |
52 | .uartclk = 3686400, /* Twice the usual clk! */ | 53 | .uartclk = 3686400, /* Twice the usual clk! */ |
53 | .iotype = UPIO_MEM32, | 54 | .iotype = UPIO_MEM32, |
54 | .flags = CBUS_UART_FLAGS, | 55 | .flags = CBUS_UART_FLAGS, |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 5dba755a43e6..d385f396dfee 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -96,6 +96,7 @@ config S390 | |||
96 | select HAVE_MEMBLOCK_NODE_MAP | 96 | select HAVE_MEMBLOCK_NODE_MAP |
97 | select HAVE_CMPXCHG_LOCAL | 97 | select HAVE_CMPXCHG_LOCAL |
98 | select HAVE_CMPXCHG_DOUBLE | 98 | select HAVE_CMPXCHG_DOUBLE |
99 | select HAVE_ALIGNED_STRUCT_PAGE if SLUB | ||
99 | select HAVE_VIRT_CPU_ACCOUNTING | 100 | select HAVE_VIRT_CPU_ACCOUNTING |
100 | select VIRT_CPU_ACCOUNTING | 101 | select VIRT_CPU_ACCOUNTING |
101 | select ARCH_DISCARD_MEMBLOCK | 102 | select ARCH_DISCARD_MEMBLOCK |
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index a34a9d612fc0..18cd6b592650 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define PSW32_MASK_CC 0x00003000UL | 20 | #define PSW32_MASK_CC 0x00003000UL |
21 | #define PSW32_MASK_PM 0x00000f00UL | 21 | #define PSW32_MASK_PM 0x00000f00UL |
22 | 22 | ||
23 | #define PSW32_MASK_USER 0x00003F00UL | 23 | #define PSW32_MASK_USER 0x0000FF00UL |
24 | 24 | ||
25 | #define PSW32_ADDR_AMODE 0x80000000UL | 25 | #define PSW32_ADDR_AMODE 0x80000000UL |
26 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL | 26 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL |
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h index 9ca305383760..9935cbd6a46f 100644 --- a/arch/s390/include/asm/topology.h +++ b/arch/s390/include/asm/topology.h | |||
@@ -8,6 +8,9 @@ struct cpu; | |||
8 | 8 | ||
9 | #ifdef CONFIG_SCHED_BOOK | 9 | #ifdef CONFIG_SCHED_BOOK |
10 | 10 | ||
11 | extern unsigned char cpu_socket_id[NR_CPUS]; | ||
12 | #define topology_physical_package_id(cpu) (cpu_socket_id[cpu]) | ||
13 | |||
11 | extern unsigned char cpu_core_id[NR_CPUS]; | 14 | extern unsigned char cpu_core_id[NR_CPUS]; |
12 | extern cpumask_t cpu_core_map[NR_CPUS]; | 15 | extern cpumask_t cpu_core_map[NR_CPUS]; |
13 | 16 | ||
diff --git a/arch/s390/include/uapi/asm/ptrace.h b/arch/s390/include/uapi/asm/ptrace.h index 705588a16d70..a5ca214b34fd 100644 --- a/arch/s390/include/uapi/asm/ptrace.h +++ b/arch/s390/include/uapi/asm/ptrace.h | |||
@@ -239,7 +239,7 @@ typedef struct | |||
239 | #define PSW_MASK_EA 0x00000000UL | 239 | #define PSW_MASK_EA 0x00000000UL |
240 | #define PSW_MASK_BA 0x00000000UL | 240 | #define PSW_MASK_BA 0x00000000UL |
241 | 241 | ||
242 | #define PSW_MASK_USER 0x00003F00UL | 242 | #define PSW_MASK_USER 0x0000FF00UL |
243 | 243 | ||
244 | #define PSW_ADDR_AMODE 0x80000000UL | 244 | #define PSW_ADDR_AMODE 0x80000000UL |
245 | #define PSW_ADDR_INSN 0x7FFFFFFFUL | 245 | #define PSW_ADDR_INSN 0x7FFFFFFFUL |
@@ -269,7 +269,7 @@ typedef struct | |||
269 | #define PSW_MASK_EA 0x0000000100000000UL | 269 | #define PSW_MASK_EA 0x0000000100000000UL |
270 | #define PSW_MASK_BA 0x0000000080000000UL | 270 | #define PSW_MASK_BA 0x0000000080000000UL |
271 | 271 | ||
272 | #define PSW_MASK_USER 0x00003F8180000000UL | 272 | #define PSW_MASK_USER 0x0000FF8180000000UL |
273 | 273 | ||
274 | #define PSW_ADDR_AMODE 0x0000000000000000UL | 274 | #define PSW_ADDR_AMODE 0x0000000000000000UL |
275 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL | 275 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index a1e8a8694bb7..593fcc9253fc 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -309,6 +309,10 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) | |||
309 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | 309 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
310 | (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 | | 310 | (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32 | |
311 | (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE); | 311 | (__u64)(regs32.psw.addr & PSW32_ADDR_AMODE); |
312 | /* Check for invalid user address space control. */ | ||
313 | if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC)) | ||
314 | regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) | | ||
315 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
312 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); | 316 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); |
313 | for (i = 0; i < NUM_GPRS; i++) | 317 | for (i = 0; i < NUM_GPRS; i++) |
314 | regs->gprs[i] = (__u64) regs32.gprs[i]; | 318 | regs->gprs[i] = (__u64) regs32.gprs[i]; |
@@ -481,7 +485,10 @@ static int setup_frame32(int sig, struct k_sigaction *ka, | |||
481 | 485 | ||
482 | /* Set up registers for signal handler */ | 486 | /* Set up registers for signal handler */ |
483 | regs->gprs[15] = (__force __u64) frame; | 487 | regs->gprs[15] = (__force __u64) frame; |
484 | regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ | 488 | /* Force 31 bit amode and default user address space control. */ |
489 | regs->psw.mask = PSW_MASK_BA | | ||
490 | (psw_user_bits & PSW_MASK_ASC) | | ||
491 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
485 | regs->psw.addr = (__force __u64) ka->sa.sa_handler; | 492 | regs->psw.addr = (__force __u64) ka->sa.sa_handler; |
486 | 493 | ||
487 | regs->gprs[2] = map_signal(sig); | 494 | regs->gprs[2] = map_signal(sig); |
@@ -549,7 +556,10 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
549 | 556 | ||
550 | /* Set up registers for signal handler */ | 557 | /* Set up registers for signal handler */ |
551 | regs->gprs[15] = (__force __u64) frame; | 558 | regs->gprs[15] = (__force __u64) frame; |
552 | regs->psw.mask |= PSW_MASK_BA; /* force amode 31 */ | 559 | /* Force 31 bit amode and default user address space control. */ |
560 | regs->psw.mask = PSW_MASK_BA | | ||
561 | (psw_user_bits & PSW_MASK_ASC) | | ||
562 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
553 | regs->psw.addr = (__u64) ka->sa.sa_handler; | 563 | regs->psw.addr = (__u64) ka->sa.sa_handler; |
554 | 564 | ||
555 | regs->gprs[2] = map_signal(sig); | 565 | regs->gprs[2] = map_signal(sig); |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index c13a2a37ef00..d1259d875074 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -136,6 +136,10 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
136 | /* Use regs->psw.mask instead of psw_user_bits to preserve PER bit. */ | 136 | /* Use regs->psw.mask instead of psw_user_bits to preserve PER bit. */ |
137 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | | 137 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
138 | (user_sregs.regs.psw.mask & PSW_MASK_USER); | 138 | (user_sregs.regs.psw.mask & PSW_MASK_USER); |
139 | /* Check for invalid user address space control. */ | ||
140 | if ((regs->psw.mask & PSW_MASK_ASC) >= (psw_kernel_bits & PSW_MASK_ASC)) | ||
141 | regs->psw.mask = (psw_user_bits & PSW_MASK_ASC) | | ||
142 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
139 | /* Check for invalid amode */ | 143 | /* Check for invalid amode */ |
140 | if (regs->psw.mask & PSW_MASK_EA) | 144 | if (regs->psw.mask & PSW_MASK_EA) |
141 | regs->psw.mask |= PSW_MASK_BA; | 145 | regs->psw.mask |= PSW_MASK_BA; |
@@ -273,7 +277,10 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
273 | 277 | ||
274 | /* Set up registers for signal handler */ | 278 | /* Set up registers for signal handler */ |
275 | regs->gprs[15] = (unsigned long) frame; | 279 | regs->gprs[15] = (unsigned long) frame; |
276 | regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */ | 280 | /* Force default amode and default user address space control. */ |
281 | regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA | | ||
282 | (psw_user_bits & PSW_MASK_ASC) | | ||
283 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
277 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; | 284 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; |
278 | 285 | ||
279 | regs->gprs[2] = map_signal(sig); | 286 | regs->gprs[2] = map_signal(sig); |
@@ -346,7 +353,10 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
346 | 353 | ||
347 | /* Set up registers for signal handler */ | 354 | /* Set up registers for signal handler */ |
348 | regs->gprs[15] = (unsigned long) frame; | 355 | regs->gprs[15] = (unsigned long) frame; |
349 | regs->psw.mask |= PSW_MASK_EA | PSW_MASK_BA; /* 64 bit amode */ | 356 | /* Force default amode and default user address space control. */ |
357 | regs->psw.mask = PSW_MASK_EA | PSW_MASK_BA | | ||
358 | (psw_user_bits & PSW_MASK_ASC) | | ||
359 | (regs->psw.mask & ~PSW_MASK_ASC); | ||
350 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; | 360 | regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE; |
351 | 361 | ||
352 | regs->gprs[2] = map_signal(sig); | 362 | regs->gprs[2] = map_signal(sig); |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 54d93f4b6818..dd55f7c20104 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
@@ -40,6 +40,7 @@ static DEFINE_SPINLOCK(topology_lock); | |||
40 | static struct mask_info core_info; | 40 | static struct mask_info core_info; |
41 | cpumask_t cpu_core_map[NR_CPUS]; | 41 | cpumask_t cpu_core_map[NR_CPUS]; |
42 | unsigned char cpu_core_id[NR_CPUS]; | 42 | unsigned char cpu_core_id[NR_CPUS]; |
43 | unsigned char cpu_socket_id[NR_CPUS]; | ||
43 | 44 | ||
44 | static struct mask_info book_info; | 45 | static struct mask_info book_info; |
45 | cpumask_t cpu_book_map[NR_CPUS]; | 46 | cpumask_t cpu_book_map[NR_CPUS]; |
@@ -83,11 +84,12 @@ static struct mask_info *add_cpus_to_mask(struct topology_cpu *tl_cpu, | |||
83 | cpumask_set_cpu(lcpu, &book->mask); | 84 | cpumask_set_cpu(lcpu, &book->mask); |
84 | cpu_book_id[lcpu] = book->id; | 85 | cpu_book_id[lcpu] = book->id; |
85 | cpumask_set_cpu(lcpu, &core->mask); | 86 | cpumask_set_cpu(lcpu, &core->mask); |
87 | cpu_core_id[lcpu] = rcpu; | ||
86 | if (one_core_per_cpu) { | 88 | if (one_core_per_cpu) { |
87 | cpu_core_id[lcpu] = rcpu; | 89 | cpu_socket_id[lcpu] = rcpu; |
88 | core = core->next; | 90 | core = core->next; |
89 | } else { | 91 | } else { |
90 | cpu_core_id[lcpu] = core->id; | 92 | cpu_socket_id[lcpu] = core->id; |
91 | } | 93 | } |
92 | smp_cpu_set_polarization(lcpu, tl_cpu->pp); | 94 | smp_cpu_set_polarization(lcpu, tl_cpu->pp); |
93 | } | 95 | } |
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c index 8b8285310b5a..1f5315d1215c 100644 --- a/arch/s390/mm/gup.c +++ b/arch/s390/mm/gup.c | |||
@@ -180,8 +180,7 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
180 | addr = start; | 180 | addr = start; |
181 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 181 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
182 | end = start + len; | 182 | end = start + len; |
183 | if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ, | 183 | if ((end < start) || (end > TASK_SIZE)) |
184 | (void __user *)start, len))) | ||
185 | return 0; | 184 | return 0; |
186 | 185 | ||
187 | local_irq_save(flags); | 186 | local_irq_save(flags); |
@@ -229,7 +228,7 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write, | |||
229 | addr = start; | 228 | addr = start; |
230 | len = (unsigned long) nr_pages << PAGE_SHIFT; | 229 | len = (unsigned long) nr_pages << PAGE_SHIFT; |
231 | end = start + len; | 230 | end = start + len; |
232 | if (end < start) | 231 | if ((end < start) || (end > TASK_SIZE)) |
233 | goto slow_irqon; | 232 | goto slow_irqon; |
234 | 233 | ||
235 | /* | 234 | /* |
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig index e5c5473e69ce..c4fbb21e802b 100644 --- a/arch/unicore32/Kconfig +++ b/arch/unicore32/Kconfig | |||
@@ -16,6 +16,8 @@ config UNICORE32 | |||
16 | select ARCH_WANT_FRAME_POINTERS | 16 | select ARCH_WANT_FRAME_POINTERS |
17 | select GENERIC_IOMAP | 17 | select GENERIC_IOMAP |
18 | select MODULES_USE_ELF_REL | 18 | select MODULES_USE_ELF_REL |
19 | select GENERIC_KERNEL_THREAD | ||
20 | select GENERIC_KERNEL_EXECVE | ||
19 | help | 21 | help |
20 | UniCore-32 is 32-bit Instruction Set Architecture, | 22 | UniCore-32 is 32-bit Instruction Set Architecture, |
21 | including a series of low-power-consumption RISC chip | 23 | including a series of low-power-consumption RISC chip |
@@ -64,6 +66,9 @@ config GENERIC_CALIBRATE_DELAY | |||
64 | config ARCH_MAY_HAVE_PC_FDC | 66 | config ARCH_MAY_HAVE_PC_FDC |
65 | bool | 67 | bool |
66 | 68 | ||
69 | config ZONE_DMA | ||
70 | def_bool y | ||
71 | |||
67 | config NEED_DMA_MAP_STATE | 72 | config NEED_DMA_MAP_STATE |
68 | def_bool y | 73 | def_bool y |
69 | 74 | ||
@@ -216,7 +221,7 @@ config PUV3_GPIO | |||
216 | bool | 221 | bool |
217 | depends on !ARCH_FPGA | 222 | depends on !ARCH_FPGA |
218 | select GENERIC_GPIO | 223 | select GENERIC_GPIO |
219 | select GPIO_SYSFS if EXPERIMENTAL | 224 | select GPIO_SYSFS |
220 | default y | 225 | default y |
221 | 226 | ||
222 | if PUV3_NB0916 | 227 | if PUV3_NB0916 |
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index c910c9857e11..601e92f18af6 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild | |||
@@ -1,4 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | 1 | ||
3 | generic-y += atomic.h | 2 | generic-y += atomic.h |
4 | generic-y += auxvec.h | 3 | generic-y += auxvec.h |
diff --git a/arch/unicore32/include/asm/bug.h b/arch/unicore32/include/asm/bug.h index b1ff8cadb086..93a56f3e2344 100644 --- a/arch/unicore32/include/asm/bug.h +++ b/arch/unicore32/include/asm/bug.h | |||
@@ -19,9 +19,4 @@ extern void die(const char *msg, struct pt_regs *regs, int err); | |||
19 | extern void uc32_notify_die(const char *str, struct pt_regs *regs, | 19 | extern void uc32_notify_die(const char *str, struct pt_regs *regs, |
20 | struct siginfo *info, unsigned long err, unsigned long trap); | 20 | struct siginfo *info, unsigned long err, unsigned long trap); |
21 | 21 | ||
22 | extern asmlinkage void __backtrace(void); | ||
23 | extern asmlinkage void c_backtrace(unsigned long fp, int pmode); | ||
24 | |||
25 | extern void __show_regs(struct pt_regs *); | ||
26 | |||
27 | #endif /* __UNICORE_BUG_H__ */ | 22 | #endif /* __UNICORE_BUG_H__ */ |
diff --git a/arch/unicore32/include/asm/cmpxchg.h b/arch/unicore32/include/asm/cmpxchg.h index df4d5acfd19f..8e797ad4fa24 100644 --- a/arch/unicore32/include/asm/cmpxchg.h +++ b/arch/unicore32/include/asm/cmpxchg.h | |||
@@ -35,7 +35,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | |||
35 | : "memory", "cc"); | 35 | : "memory", "cc"); |
36 | break; | 36 | break; |
37 | default: | 37 | default: |
38 | ret = __xchg_bad_pointer(); | 38 | __xchg_bad_pointer(); |
39 | } | 39 | } |
40 | 40 | ||
41 | return ret; | 41 | return ret; |
diff --git a/arch/unicore32/include/asm/kvm_para.h b/arch/unicore32/include/asm/kvm_para.h deleted file mode 100644 index 14fab8f0b957..000000000000 --- a/arch/unicore32/include/asm/kvm_para.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kvm_para.h> | ||
diff --git a/arch/unicore32/include/asm/processor.h b/arch/unicore32/include/asm/processor.h index 14382cb09657..4eaa42167667 100644 --- a/arch/unicore32/include/asm/processor.h +++ b/arch/unicore32/include/asm/processor.h | |||
@@ -72,11 +72,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
72 | 72 | ||
73 | #define cpu_relax() barrier() | 73 | #define cpu_relax() barrier() |
74 | 74 | ||
75 | /* | ||
76 | * Create a new kernel thread | ||
77 | */ | ||
78 | extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | ||
79 | |||
80 | #define task_pt_regs(p) \ | 75 | #define task_pt_regs(p) \ |
81 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) | 76 | ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1) |
82 | 77 | ||
diff --git a/arch/unicore32/include/asm/ptrace.h b/arch/unicore32/include/asm/ptrace.h index b9caf9b0997b..726749dab52f 100644 --- a/arch/unicore32/include/asm/ptrace.h +++ b/arch/unicore32/include/asm/ptrace.h | |||
@@ -12,80 +12,10 @@ | |||
12 | #ifndef __UNICORE_PTRACE_H__ | 12 | #ifndef __UNICORE_PTRACE_H__ |
13 | #define __UNICORE_PTRACE_H__ | 13 | #define __UNICORE_PTRACE_H__ |
14 | 14 | ||
15 | #define PTRACE_GET_THREAD_AREA 22 | 15 | #include <uapi/asm/ptrace.h> |
16 | |||
17 | /* | ||
18 | * PSR bits | ||
19 | */ | ||
20 | #define USER_MODE 0x00000010 | ||
21 | #define REAL_MODE 0x00000011 | ||
22 | #define INTR_MODE 0x00000012 | ||
23 | #define PRIV_MODE 0x00000013 | ||
24 | #define ABRT_MODE 0x00000017 | ||
25 | #define EXTN_MODE 0x0000001b | ||
26 | #define SUSR_MODE 0x0000001f | ||
27 | #define MODE_MASK 0x0000001f | ||
28 | #define PSR_R_BIT 0x00000040 | ||
29 | #define PSR_I_BIT 0x00000080 | ||
30 | #define PSR_V_BIT 0x10000000 | ||
31 | #define PSR_C_BIT 0x20000000 | ||
32 | #define PSR_Z_BIT 0x40000000 | ||
33 | #define PSR_S_BIT 0x80000000 | ||
34 | |||
35 | /* | ||
36 | * Groups of PSR bits | ||
37 | */ | ||
38 | #define PSR_f 0xff000000 /* Flags */ | ||
39 | #define PSR_c 0x000000ff /* Control */ | ||
40 | 16 | ||
41 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
42 | 18 | ||
43 | /* | ||
44 | * This struct defines the way the registers are stored on the | ||
45 | * stack during a system call. Note that sizeof(struct pt_regs) | ||
46 | * has to be a multiple of 8. | ||
47 | */ | ||
48 | struct pt_regs { | ||
49 | unsigned long uregs[34]; | ||
50 | }; | ||
51 | |||
52 | #define UCreg_asr uregs[32] | ||
53 | #define UCreg_pc uregs[31] | ||
54 | #define UCreg_lr uregs[30] | ||
55 | #define UCreg_sp uregs[29] | ||
56 | #define UCreg_ip uregs[28] | ||
57 | #define UCreg_fp uregs[27] | ||
58 | #define UCreg_26 uregs[26] | ||
59 | #define UCreg_25 uregs[25] | ||
60 | #define UCreg_24 uregs[24] | ||
61 | #define UCreg_23 uregs[23] | ||
62 | #define UCreg_22 uregs[22] | ||
63 | #define UCreg_21 uregs[21] | ||
64 | #define UCreg_20 uregs[20] | ||
65 | #define UCreg_19 uregs[19] | ||
66 | #define UCreg_18 uregs[18] | ||
67 | #define UCreg_17 uregs[17] | ||
68 | #define UCreg_16 uregs[16] | ||
69 | #define UCreg_15 uregs[15] | ||
70 | #define UCreg_14 uregs[14] | ||
71 | #define UCreg_13 uregs[13] | ||
72 | #define UCreg_12 uregs[12] | ||
73 | #define UCreg_11 uregs[11] | ||
74 | #define UCreg_10 uregs[10] | ||
75 | #define UCreg_09 uregs[9] | ||
76 | #define UCreg_08 uregs[8] | ||
77 | #define UCreg_07 uregs[7] | ||
78 | #define UCreg_06 uregs[6] | ||
79 | #define UCreg_05 uregs[5] | ||
80 | #define UCreg_04 uregs[4] | ||
81 | #define UCreg_03 uregs[3] | ||
82 | #define UCreg_02 uregs[2] | ||
83 | #define UCreg_01 uregs[1] | ||
84 | #define UCreg_00 uregs[0] | ||
85 | #define UCreg_ORIG_00 uregs[33] | ||
86 | |||
87 | #ifdef __KERNEL__ | ||
88 | |||
89 | #define user_mode(regs) \ | 19 | #define user_mode(regs) \ |
90 | (processor_mode(regs) == USER_MODE) | 20 | (processor_mode(regs) == USER_MODE) |
91 | 21 | ||
@@ -125,9 +55,5 @@ static inline int valid_user_regs(struct pt_regs *regs) | |||
125 | 55 | ||
126 | #define instruction_pointer(regs) ((regs)->UCreg_pc) | 56 | #define instruction_pointer(regs) ((regs)->UCreg_pc) |
127 | 57 | ||
128 | #endif /* __KERNEL__ */ | ||
129 | |||
130 | #endif /* __ASSEMBLY__ */ | 58 | #endif /* __ASSEMBLY__ */ |
131 | |||
132 | #endif | 59 | #endif |
133 | |||
diff --git a/arch/unicore32/include/uapi/asm/Kbuild b/arch/unicore32/include/uapi/asm/Kbuild index baebb3da1d44..0514d7ad6855 100644 --- a/arch/unicore32/include/uapi/asm/Kbuild +++ b/arch/unicore32/include/uapi/asm/Kbuild | |||
@@ -1,3 +1,10 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | header-y += byteorder.h | ||
5 | header-y += kvm_para.h | ||
6 | header-y += ptrace.h | ||
7 | header-y += sigcontext.h | ||
8 | header-y += unistd.h | ||
9 | |||
10 | generic-y += kvm_para.h | ||
diff --git a/arch/unicore32/include/asm/byteorder.h b/arch/unicore32/include/uapi/asm/byteorder.h index ebe1b3fef3e3..ebe1b3fef3e3 100644 --- a/arch/unicore32/include/asm/byteorder.h +++ b/arch/unicore32/include/uapi/asm/byteorder.h | |||
diff --git a/arch/unicore32/include/uapi/asm/ptrace.h b/arch/unicore32/include/uapi/asm/ptrace.h new file mode 100644 index 000000000000..187aa2e98a53 --- /dev/null +++ b/arch/unicore32/include/uapi/asm/ptrace.h | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | * linux/arch/unicore32/include/asm/ptrace.h | ||
3 | * | ||
4 | * Code specific to PKUnity SoC and UniCore ISA | ||
5 | * | ||
6 | * Copyright (C) 2001-2010 GUAN Xue-tao | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | #ifndef _UAPI__UNICORE_PTRACE_H__ | ||
13 | #define _UAPI__UNICORE_PTRACE_H__ | ||
14 | |||
15 | #define PTRACE_GET_THREAD_AREA 22 | ||
16 | |||
17 | /* | ||
18 | * PSR bits | ||
19 | */ | ||
20 | #define USER_MODE 0x00000010 | ||
21 | #define REAL_MODE 0x00000011 | ||
22 | #define INTR_MODE 0x00000012 | ||
23 | #define PRIV_MODE 0x00000013 | ||
24 | #define ABRT_MODE 0x00000017 | ||
25 | #define EXTN_MODE 0x0000001b | ||
26 | #define SUSR_MODE 0x0000001f | ||
27 | #define MODE_MASK 0x0000001f | ||
28 | #define PSR_R_BIT 0x00000040 | ||
29 | #define PSR_I_BIT 0x00000080 | ||
30 | #define PSR_V_BIT 0x10000000 | ||
31 | #define PSR_C_BIT 0x20000000 | ||
32 | #define PSR_Z_BIT 0x40000000 | ||
33 | #define PSR_S_BIT 0x80000000 | ||
34 | |||
35 | /* | ||
36 | * Groups of PSR bits | ||
37 | */ | ||
38 | #define PSR_f 0xff000000 /* Flags */ | ||
39 | #define PSR_c 0x000000ff /* Control */ | ||
40 | |||
41 | #ifndef __ASSEMBLY__ | ||
42 | |||
43 | /* | ||
44 | * This struct defines the way the registers are stored on the | ||
45 | * stack during a system call. Note that sizeof(struct pt_regs) | ||
46 | * has to be a multiple of 8. | ||
47 | */ | ||
48 | struct pt_regs { | ||
49 | unsigned long uregs[34]; | ||
50 | }; | ||
51 | |||
52 | #define UCreg_asr uregs[32] | ||
53 | #define UCreg_pc uregs[31] | ||
54 | #define UCreg_lr uregs[30] | ||
55 | #define UCreg_sp uregs[29] | ||
56 | #define UCreg_ip uregs[28] | ||
57 | #define UCreg_fp uregs[27] | ||
58 | #define UCreg_26 uregs[26] | ||
59 | #define UCreg_25 uregs[25] | ||
60 | #define UCreg_24 uregs[24] | ||
61 | #define UCreg_23 uregs[23] | ||
62 | #define UCreg_22 uregs[22] | ||
63 | #define UCreg_21 uregs[21] | ||
64 | #define UCreg_20 uregs[20] | ||
65 | #define UCreg_19 uregs[19] | ||
66 | #define UCreg_18 uregs[18] | ||
67 | #define UCreg_17 uregs[17] | ||
68 | #define UCreg_16 uregs[16] | ||
69 | #define UCreg_15 uregs[15] | ||
70 | #define UCreg_14 uregs[14] | ||
71 | #define UCreg_13 uregs[13] | ||
72 | #define UCreg_12 uregs[12] | ||
73 | #define UCreg_11 uregs[11] | ||
74 | #define UCreg_10 uregs[10] | ||
75 | #define UCreg_09 uregs[9] | ||
76 | #define UCreg_08 uregs[8] | ||
77 | #define UCreg_07 uregs[7] | ||
78 | #define UCreg_06 uregs[6] | ||
79 | #define UCreg_05 uregs[5] | ||
80 | #define UCreg_04 uregs[4] | ||
81 | #define UCreg_03 uregs[3] | ||
82 | #define UCreg_02 uregs[2] | ||
83 | #define UCreg_01 uregs[1] | ||
84 | #define UCreg_00 uregs[0] | ||
85 | #define UCreg_ORIG_00 uregs[33] | ||
86 | |||
87 | |||
88 | #endif /* __ASSEMBLY__ */ | ||
89 | |||
90 | #endif /* _UAPI__UNICORE_PTRACE_H__ */ | ||
diff --git a/arch/unicore32/include/asm/sigcontext.h b/arch/unicore32/include/uapi/asm/sigcontext.h index 6a2d7671c052..6a2d7671c052 100644 --- a/arch/unicore32/include/asm/sigcontext.h +++ b/arch/unicore32/include/uapi/asm/sigcontext.h | |||
diff --git a/arch/unicore32/include/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index 2abcf61c615d..d18a3be89b38 100644 --- a/arch/unicore32/include/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h | |||
@@ -12,3 +12,4 @@ | |||
12 | 12 | ||
13 | /* Use the standard ABI for syscalls. */ | 13 | /* Use the standard ABI for syscalls. */ |
14 | #include <asm-generic/unistd.h> | 14 | #include <asm-generic/unistd.h> |
15 | #define __ARCH_WANT_SYS_EXECVE | ||
diff --git a/arch/unicore32/kernel/entry.S b/arch/unicore32/kernel/entry.S index dcb87ab19ddd..7049350c790f 100644 --- a/arch/unicore32/kernel/entry.S +++ b/arch/unicore32/kernel/entry.S | |||
@@ -573,17 +573,16 @@ ENDPROC(ret_to_user) | |||
573 | */ | 573 | */ |
574 | ENTRY(ret_from_fork) | 574 | ENTRY(ret_from_fork) |
575 | b.l schedule_tail | 575 | b.l schedule_tail |
576 | get_thread_info tsk | ||
577 | ldw r1, [tsk+], #TI_FLAGS @ check for syscall tracing | ||
578 | mov why, #1 | ||
579 | cand.a r1, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | ||
580 | beq ret_slow_syscall | ||
581 | mov r1, sp | ||
582 | mov r0, #1 @ trace exit [IP = 1] | ||
583 | b.l syscall_trace | ||
584 | b ret_slow_syscall | 576 | b ret_slow_syscall |
585 | ENDPROC(ret_from_fork) | 577 | ENDPROC(ret_from_fork) |
586 | 578 | ||
579 | ENTRY(ret_from_kernel_thread) | ||
580 | b.l schedule_tail | ||
581 | mov r0, r5 | ||
582 | adr lr, ret_slow_syscall | ||
583 | mov pc, r4 | ||
584 | ENDPROC(ret_from_kernel_thread) | ||
585 | |||
587 | /*============================================================================= | 586 | /*============================================================================= |
588 | * SWI handler | 587 | * SWI handler |
589 | *----------------------------------------------------------------------------- | 588 | *----------------------------------------------------------------------------- |
@@ -669,11 +668,6 @@ __cr_alignment: | |||
669 | #endif | 668 | #endif |
670 | .ltorg | 669 | .ltorg |
671 | 670 | ||
672 | ENTRY(sys_execve) | ||
673 | add r3, sp, #S_OFF | ||
674 | b __sys_execve | ||
675 | ENDPROC(sys_execve) | ||
676 | |||
677 | ENTRY(sys_clone) | 671 | ENTRY(sys_clone) |
678 | add ip, sp, #S_OFF | 672 | add ip, sp, #S_OFF |
679 | stw ip, [sp+], #4 | 673 | stw ip, [sp+], #4 |
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index b008586dad75..a8fe265ce2c0 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
@@ -258,6 +258,7 @@ void release_thread(struct task_struct *dead_task) | |||
258 | } | 258 | } |
259 | 259 | ||
260 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | 260 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); |
261 | asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); | ||
261 | 262 | ||
262 | int | 263 | int |
263 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
@@ -266,17 +267,22 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
266 | struct thread_info *thread = task_thread_info(p); | 267 | struct thread_info *thread = task_thread_info(p); |
267 | struct pt_regs *childregs = task_pt_regs(p); | 268 | struct pt_regs *childregs = task_pt_regs(p); |
268 | 269 | ||
269 | *childregs = *regs; | ||
270 | childregs->UCreg_00 = 0; | ||
271 | childregs->UCreg_sp = stack_start; | ||
272 | |||
273 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); | 270 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); |
274 | thread->cpu_context.sp = (unsigned long)childregs; | 271 | thread->cpu_context.sp = (unsigned long)childregs; |
275 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | 272 | if (unlikely(!regs)) { |
276 | 273 | thread->cpu_context.pc = (unsigned long)ret_from_kernel_thread; | |
277 | if (clone_flags & CLONE_SETTLS) | 274 | thread->cpu_context.r4 = stack_start; |
278 | childregs->UCreg_16 = regs->UCreg_03; | 275 | thread->cpu_context.r5 = stk_sz; |
276 | memset(childregs, 0, sizeof(struct pt_regs)); | ||
277 | } else { | ||
278 | thread->cpu_context.pc = (unsigned long)ret_from_fork; | ||
279 | *childregs = *regs; | ||
280 | childregs->UCreg_00 = 0; | ||
281 | childregs->UCreg_sp = stack_start; | ||
279 | 282 | ||
283 | if (clone_flags & CLONE_SETTLS) | ||
284 | childregs->UCreg_16 = regs->UCreg_03; | ||
285 | } | ||
280 | return 0; | 286 | return 0; |
281 | } | 287 | } |
282 | 288 | ||
@@ -305,42 +311,6 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fp) | |||
305 | } | 311 | } |
306 | EXPORT_SYMBOL(dump_fpu); | 312 | EXPORT_SYMBOL(dump_fpu); |
307 | 313 | ||
308 | /* | ||
309 | * Shuffle the argument into the correct register before calling the | ||
310 | * thread function. r1 is the thread argument, r2 is the pointer to | ||
311 | * the thread function, and r3 points to the exit function. | ||
312 | */ | ||
313 | asm(".pushsection .text\n" | ||
314 | " .align\n" | ||
315 | " .type kernel_thread_helper, #function\n" | ||
316 | "kernel_thread_helper:\n" | ||
317 | " mov.a asr, r7\n" | ||
318 | " mov r0, r4\n" | ||
319 | " mov lr, r6\n" | ||
320 | " mov pc, r5\n" | ||
321 | " .size kernel_thread_helper, . - kernel_thread_helper\n" | ||
322 | " .popsection"); | ||
323 | |||
324 | /* | ||
325 | * Create a kernel thread. | ||
326 | */ | ||
327 | pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | ||
328 | { | ||
329 | struct pt_regs regs; | ||
330 | |||
331 | memset(®s, 0, sizeof(regs)); | ||
332 | |||
333 | regs.UCreg_04 = (unsigned long)arg; | ||
334 | regs.UCreg_05 = (unsigned long)fn; | ||
335 | regs.UCreg_06 = (unsigned long)do_exit; | ||
336 | regs.UCreg_07 = PRIV_MODE; | ||
337 | regs.UCreg_pc = (unsigned long)kernel_thread_helper; | ||
338 | regs.UCreg_asr = regs.UCreg_07 | PSR_I_BIT; | ||
339 | |||
340 | return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | ||
341 | } | ||
342 | EXPORT_SYMBOL(kernel_thread); | ||
343 | |||
344 | unsigned long get_wchan(struct task_struct *p) | 314 | unsigned long get_wchan(struct task_struct *p) |
345 | { | 315 | { |
346 | struct stackframe frame; | 316 | struct stackframe frame; |
diff --git a/arch/unicore32/kernel/setup.h b/arch/unicore32/kernel/setup.h index f23955028a18..30f749da8f73 100644 --- a/arch/unicore32/kernel/setup.h +++ b/arch/unicore32/kernel/setup.h | |||
@@ -30,4 +30,10 @@ extern char __vectors_start[], __vectors_end[]; | |||
30 | extern void kernel_thread_helper(void); | 30 | extern void kernel_thread_helper(void); |
31 | 31 | ||
32 | extern void __init early_signal_init(void); | 32 | extern void __init early_signal_init(void); |
33 | |||
34 | extern asmlinkage void __backtrace(void); | ||
35 | extern asmlinkage void c_backtrace(unsigned long fp, int pmode); | ||
36 | |||
37 | extern void __show_regs(struct pt_regs *); | ||
38 | |||
33 | #endif | 39 | #endif |
diff --git a/arch/unicore32/kernel/sys.c b/arch/unicore32/kernel/sys.c index fabdee96110b..9680134b31f0 100644 --- a/arch/unicore32/kernel/sys.c +++ b/arch/unicore32/kernel/sys.c | |||
@@ -42,69 +42,6 @@ asmlinkage long __sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
42 | parent_tid, child_tid); | 42 | parent_tid, child_tid); |
43 | } | 43 | } |
44 | 44 | ||
45 | /* sys_execve() executes a new program. | ||
46 | * This is called indirectly via a small wrapper | ||
47 | */ | ||
48 | asmlinkage long __sys_execve(const char __user *filename, | ||
49 | const char __user *const __user *argv, | ||
50 | const char __user *const __user *envp, | ||
51 | struct pt_regs *regs) | ||
52 | { | ||
53 | int error; | ||
54 | struct filename *fn; | ||
55 | |||
56 | fn = getname(filename); | ||
57 | error = PTR_ERR(fn); | ||
58 | if (IS_ERR(fn)) | ||
59 | goto out; | ||
60 | error = do_execve(fn->name, argv, envp, regs); | ||
61 | putname(fn); | ||
62 | out: | ||
63 | return error; | ||
64 | } | ||
65 | |||
66 | int kernel_execve(const char *filename, | ||
67 | const char *const argv[], | ||
68 | const char *const envp[]) | ||
69 | { | ||
70 | struct pt_regs regs; | ||
71 | int ret; | ||
72 | |||
73 | memset(®s, 0, sizeof(struct pt_regs)); | ||
74 | ret = do_execve(filename, | ||
75 | (const char __user *const __user *)argv, | ||
76 | (const char __user *const __user *)envp, ®s); | ||
77 | if (ret < 0) | ||
78 | goto out; | ||
79 | |||
80 | /* | ||
81 | * Save argc to the register structure for userspace. | ||
82 | */ | ||
83 | regs.UCreg_00 = ret; | ||
84 | |||
85 | /* | ||
86 | * We were successful. We won't be returning to our caller, but | ||
87 | * instead to user space by manipulating the kernel stack. | ||
88 | */ | ||
89 | asm("add r0, %0, %1\n\t" | ||
90 | "mov r1, %2\n\t" | ||
91 | "mov r2, %3\n\t" | ||
92 | "mov r22, #0\n\t" /* not a syscall */ | ||
93 | "mov r23, %0\n\t" /* thread structure */ | ||
94 | "b.l memmove\n\t" /* copy regs to top of stack */ | ||
95 | "mov sp, r0\n\t" /* reposition stack pointer */ | ||
96 | "b ret_to_user" | ||
97 | : | ||
98 | : "r" (current_thread_info()), | ||
99 | "Ir" (THREAD_START_SP - sizeof(regs)), | ||
100 | "r" (®s), | ||
101 | "Ir" (sizeof(regs)) | ||
102 | : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); | ||
103 | |||
104 | out: | ||
105 | return ret; | ||
106 | } | ||
107 | |||
108 | /* Note: used by the compat code even in 64-bit Linux. */ | 45 | /* Note: used by the compat code even in 64-bit Linux. */ |
109 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, | 46 | SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, |
110 | unsigned long, prot, unsigned long, flags, | 47 | unsigned long, prot, unsigned long, flags, |
diff --git a/arch/unicore32/mm/fault.c b/arch/unicore32/mm/fault.c index 2eeb9c04cab0..f9b5c10bccee 100644 --- a/arch/unicore32/mm/fault.c +++ b/arch/unicore32/mm/fault.c | |||
@@ -168,7 +168,7 @@ static inline bool access_error(unsigned int fsr, struct vm_area_struct *vma) | |||
168 | } | 168 | } |
169 | 169 | ||
170 | static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr, | 170 | static int __do_pf(struct mm_struct *mm, unsigned long addr, unsigned int fsr, |
171 | struct task_struct *tsk) | 171 | unsigned int flags, struct task_struct *tsk) |
172 | { | 172 | { |
173 | struct vm_area_struct *vma; | 173 | struct vm_area_struct *vma; |
174 | int fault; | 174 | int fault; |
@@ -194,14 +194,7 @@ good_area: | |||
194 | * If for any reason at all we couldn't handle the fault, make | 194 | * If for any reason at all we couldn't handle the fault, make |
195 | * sure we exit gracefully rather than endlessly redo the fault. | 195 | * sure we exit gracefully rather than endlessly redo the fault. |
196 | */ | 196 | */ |
197 | fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, | 197 | fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); |
198 | (!(fsr ^ 0x12)) ? FAULT_FLAG_WRITE : 0); | ||
199 | if (unlikely(fault & VM_FAULT_ERROR)) | ||
200 | return fault; | ||
201 | if (fault & VM_FAULT_MAJOR) | ||
202 | tsk->maj_flt++; | ||
203 | else | ||
204 | tsk->min_flt++; | ||
205 | return fault; | 198 | return fault; |
206 | 199 | ||
207 | check_stack: | 200 | check_stack: |
@@ -216,6 +209,8 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
216 | struct task_struct *tsk; | 209 | struct task_struct *tsk; |
217 | struct mm_struct *mm; | 210 | struct mm_struct *mm; |
218 | int fault, sig, code; | 211 | int fault, sig, code; |
212 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | ||
213 | ((!(fsr ^ 0x12)) ? FAULT_FLAG_WRITE : 0); | ||
219 | 214 | ||
220 | tsk = current; | 215 | tsk = current; |
221 | mm = tsk->mm; | 216 | mm = tsk->mm; |
@@ -236,6 +231,7 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
236 | if (!user_mode(regs) | 231 | if (!user_mode(regs) |
237 | && !search_exception_tables(regs->UCreg_pc)) | 232 | && !search_exception_tables(regs->UCreg_pc)) |
238 | goto no_context; | 233 | goto no_context; |
234 | retry: | ||
239 | down_read(&mm->mmap_sem); | 235 | down_read(&mm->mmap_sem); |
240 | } else { | 236 | } else { |
241 | /* | 237 | /* |
@@ -251,7 +247,28 @@ static int do_pf(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
251 | #endif | 247 | #endif |
252 | } | 248 | } |
253 | 249 | ||
254 | fault = __do_pf(mm, addr, fsr, tsk); | 250 | fault = __do_pf(mm, addr, fsr, flags, tsk); |
251 | |||
252 | /* If we need to retry but a fatal signal is pending, handle the | ||
253 | * signal first. We do not need to release the mmap_sem because | ||
254 | * it would already be released in __lock_page_or_retry in | ||
255 | * mm/filemap.c. */ | ||
256 | if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) | ||
257 | return 0; | ||
258 | |||
259 | if (!(fault & VM_FAULT_ERROR) && (flags & FAULT_FLAG_ALLOW_RETRY)) { | ||
260 | if (fault & VM_FAULT_MAJOR) | ||
261 | tsk->maj_flt++; | ||
262 | else | ||
263 | tsk->min_flt++; | ||
264 | if (fault & VM_FAULT_RETRY) { | ||
265 | /* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk | ||
266 | * of starvation. */ | ||
267 | flags &= ~FAULT_FLAG_ALLOW_RETRY; | ||
268 | goto retry; | ||
269 | } | ||
270 | } | ||
271 | |||
255 | up_read(&mm->mmap_sem); | 272 | up_read(&mm->mmap_sem); |
256 | 273 | ||
257 | /* | 274 | /* |
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index a10e46016851..58fc51488828 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h | |||
@@ -24,6 +24,9 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu) | |||
24 | { | 24 | { |
25 | struct kvm_cpuid_entry2 *best; | 25 | struct kvm_cpuid_entry2 *best; |
26 | 26 | ||
27 | if (!static_cpu_has(X86_FEATURE_XSAVE)) | ||
28 | return 0; | ||
29 | |||
27 | best = kvm_find_cpuid_entry(vcpu, 1, 0); | 30 | best = kvm_find_cpuid_entry(vcpu, 1, 0); |
28 | return best && (best->ecx & bit(X86_FEATURE_XSAVE)); | 31 | return best && (best->ecx & bit(X86_FEATURE_XSAVE)); |
29 | } | 32 | } |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index ad6b1dd06f8b..f85815945fc6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -6549,19 +6549,22 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) | |||
6549 | } | 6549 | } |
6550 | } | 6550 | } |
6551 | 6551 | ||
6552 | exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); | ||
6553 | /* Exposing INVPCID only when PCID is exposed */ | 6552 | /* Exposing INVPCID only when PCID is exposed */ |
6554 | best = kvm_find_cpuid_entry(vcpu, 0x7, 0); | 6553 | best = kvm_find_cpuid_entry(vcpu, 0x7, 0); |
6555 | if (vmx_invpcid_supported() && | 6554 | if (vmx_invpcid_supported() && |
6556 | best && (best->ebx & bit(X86_FEATURE_INVPCID)) && | 6555 | best && (best->ebx & bit(X86_FEATURE_INVPCID)) && |
6557 | guest_cpuid_has_pcid(vcpu)) { | 6556 | guest_cpuid_has_pcid(vcpu)) { |
6557 | exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); | ||
6558 | exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; | 6558 | exec_control |= SECONDARY_EXEC_ENABLE_INVPCID; |
6559 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | 6559 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, |
6560 | exec_control); | 6560 | exec_control); |
6561 | } else { | 6561 | } else { |
6562 | exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID; | 6562 | if (cpu_has_secondary_exec_ctrls()) { |
6563 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | 6563 | exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL); |
6564 | exec_control); | 6564 | exec_control &= ~SECONDARY_EXEC_ENABLE_INVPCID; |
6565 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, | ||
6566 | exec_control); | ||
6567 | } | ||
6565 | if (best) | 6568 | if (best) |
6566 | best->ebx &= ~bit(X86_FEATURE_INVPCID); | 6569 | best->ebx &= ~bit(X86_FEATURE_INVPCID); |
6567 | } | 6570 | } |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 224a7e78cb6c..4f7641756be2 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5781,6 +5781,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
5781 | int pending_vec, max_bits, idx; | 5781 | int pending_vec, max_bits, idx; |
5782 | struct desc_ptr dt; | 5782 | struct desc_ptr dt; |
5783 | 5783 | ||
5784 | if (!guest_cpuid_has_xsave(vcpu) && (sregs->cr4 & X86_CR4_OSXSAVE)) | ||
5785 | return -EINVAL; | ||
5786 | |||
5784 | dt.size = sregs->idt.limit; | 5787 | dt.size = sregs->idt.limit; |
5785 | dt.address = sregs->idt.base; | 5788 | dt.address = sregs->idt.base; |
5786 | kvm_x86_ops->set_idt(vcpu, &dt); | 5789 | kvm_x86_ops->set_idt(vcpu, &dt); |