Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: orion5x: split linkstation lswtgl into common and device parts

In order to support more linkstation devices, common part of current
.dts file goes into .dtsi file. Some .dtsi start with "mvebu-" prefix
because other kirkwood based linkstation devices are similar, and
will be migrated to use these .dtsi some time later.
- orion5x-linkstation.dtsi
- mvebu-linkstation-fan.dtsi
- mvebu-linkstation-gpio-simple.dtsi
while all rest part remains in device specific .dts file:
- orion5x-linkstation-lswtgl.dts

Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

authored by

Roger Shimizu and committed by
Gregory CLEMENT
305e0b2a 34d48290

+408 -204
+72
arch/arm/boot/dts/mvebu-linkstation-fan.dtsi
··· 1 + /* 2 + * Device Tree common file for gpio-fan on Buffalo Linkstation 3 + * 4 + * Copyright (C) 2015, 2016 5 + * Roger Shimizu <rogershimizu@gmail.com> 6 + * 7 + * This file is dual-licensed: you can use it either under the terms 8 + * of the GPL or the X11 license, at your option. Note that this dual 9 + * licensing only applies to this file, and not this project as a 10 + * whole. 11 + * 12 + * a) This file is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License as 14 + * published by the Free Software Foundation; either version 2 of the 15 + * License, or (at your option) any later version. 16 + * 17 + * This file is distributed in the hope that it will be useful 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * Or, alternatively 23 + * 24 + * b) Permission is hereby granted, free of charge, to any person 25 + * obtaining a copy of this software and associated documentation 26 + * files (the "Software"), to deal in the Software without 27 + * restriction, including without limitation the rights to use 28 + * copy, modify, merge, publish, distribute, sublicense, and/or 29 + * sell copies of the Software, and to permit persons to whom the 30 + * Software is furnished to do so, subject to the following 31 + * conditions: 32 + * 33 + * The above copyright notice and this permission notice shall be 34 + * included in all copies or substantial portions of the Software. 35 + * 36 + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND 37 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY 41 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43 + * OTHER DEALINGS IN THE SOFTWARE. 44 + */ 45 + 46 + / { 47 + gpio_fan { 48 + compatible = "gpio-fan"; 49 + pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>; 50 + pinctrl-names = "default"; 51 + 52 + gpio-fan,speed-map = 53 + <0 3 54 + 1500 2 55 + 3250 1 56 + 5000 0>; 57 + }; 58 + }; 59 + 60 + &pinctrl { 61 + pmx_fan_low: pmx-fan-low { 62 + marvell,function = "gpio"; 63 + }; 64 + 65 + pmx_fan_high: pmx-fan-high { 66 + marvell,function = "gpio"; 67 + }; 68 + 69 + pmx_fan_lock: pmx-fan-lock { 70 + marvell,function = "gpio"; 71 + }; 72 + };
+105
arch/arm/boot/dts/mvebu-linkstation-gpio-simple.dtsi
··· 1 + /* 2 + * Device Tree common file for gpio-{keys,leds} on Buffalo Linkstation 3 + * 4 + * Copyright (C) 2015, 2016 5 + * Roger Shimizu <rogershimizu@gmail.com> 6 + * 7 + * This file is dual-licensed: you can use it either under the terms 8 + * of the GPL or the X11 license, at your option. Note that this dual 9 + * licensing only applies to this file, and not this project as a 10 + * whole. 11 + * 12 + * a) This file is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License as 14 + * published by the Free Software Foundation; either version 2 of the 15 + * License, or (at your option) any later version. 16 + * 17 + * This file is distributed in the hope that it will be useful 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * Or, alternatively 23 + * 24 + * b) Permission is hereby granted, free of charge, to any person 25 + * obtaining a copy of this software and associated documentation 26 + * files (the "Software"), to deal in the Software without 27 + * restriction, including without limitation the rights to use 28 + * copy, modify, merge, publish, distribute, sublicense, and/or 29 + * sell copies of the Software, and to permit persons to whom the 30 + * Software is furnished to do so, subject to the following 31 + * conditions: 32 + * 33 + * The above copyright notice and this permission notice shall be 34 + * included in all copies or substantial portions of the Software. 35 + * 36 + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND 37 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY 41 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43 + * OTHER DEALINGS IN THE SOFTWARE. 44 + */ 45 + 46 + #include <dt-bindings/input/input.h> 47 + 48 + / { 49 + gpio_keys { 50 + compatible = "gpio-keys"; 51 + #address-cells = <1>; 52 + #size-cells = <0>; 53 + pinctrl-0 = <&pmx_power_switch>; 54 + pinctrl-names = "default"; 55 + 56 + power-on-switch { 57 + label = "Power-on Switch"; 58 + linux,code = <KEY_RESERVED>; 59 + linux,input-type = <5>; 60 + }; 61 + 62 + power-auto-switch { 63 + label = "Power-auto Switch"; 64 + linux,code = <KEY_ESC>; 65 + linux,input-type = <5>; 66 + }; 67 + }; 68 + 69 + gpio_leds { 70 + compatible = "gpio-leds"; 71 + pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info>; 72 + pinctrl-names = "default"; 73 + 74 + blue-power-led { 75 + label = "linkstation:blue:power"; 76 + default-state = "keep"; 77 + }; 78 + 79 + red-alarm-led { 80 + label = "linkstation:red:alarm"; 81 + }; 82 + 83 + amber-info-led { 84 + label = "linkstation:amber:info"; 85 + }; 86 + }; 87 + }; 88 + 89 + &pinctrl { 90 + pmx_power_switch: pmx-power-switch { 91 + marvell,function = "gpio"; 92 + }; 93 + 94 + pmx_led_power: pmx-leds { 95 + marvell,function = "gpio"; 96 + }; 97 + 98 + pmx_led_alarm: pmx-leds { 99 + marvell,function = "gpio"; 100 + }; 101 + 102 + pmx_led_info: pmx-leds { 103 + marvell,function = "gpio"; 104 + }; 105 + };
+51 -204
arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
··· 45 45 46 46 /dts-v1/; 47 47 48 + #include "orion5x-linkstation.dtsi" 49 + #include "mvebu-linkstation-gpio-simple.dtsi" 50 + #include "mvebu-linkstation-fan.dtsi" 48 51 #include <dt-bindings/gpio/gpio.h> 49 - #include <dt-bindings/input/input.h> 50 - #include "orion5x-mv88f5182.dtsi" 51 52 52 53 / { 53 54 model = "Buffalo Linkstation LS-WTGL"; ··· 59 58 reg = <0x00000000 0x4000000>; 60 59 }; 61 60 62 - chosen { 63 - bootargs = "console=ttyS0,115200n8 earlyprintk"; 64 - linux,stdout-path = &uart0; 65 - }; 66 - 67 - soc { 68 - ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>, 69 - <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>, 70 - <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x40000>; 71 - 72 - internal-regs { 73 - pinctrl: pinctrl@10000 { 74 - pinctrl-names = "default"; 75 - 76 - pmx_led_power: pmx-leds { 77 - marvell,pins = "mpp0"; 78 - marvell,function = "gpio"; 79 - }; 80 - 81 - pmx_led_alarm: pmx-leds { 82 - marvell,pins = "mpp2"; 83 - marvell,function = "gpio"; 84 - }; 85 - 86 - pmx_led_info: pmx-leds { 87 - marvell,pins = "mpp3"; 88 - marvell,function = "gpio"; 89 - }; 90 - 91 - pmx_power_hdd: pmx-power-hdd { 92 - marvell,pins = "mpp1"; 93 - marvell,function = "gpio"; 94 - }; 95 - 96 - pmx_usb_power: pmx-usb-power { 97 - marvell,pins = "mpp9"; 98 - marvell,function = "gpio"; 99 - }; 100 - 101 - pmx_sata0: pmx-sata0 { 102 - marvell,pins = "mpp12"; 103 - marvell,function = "sata0"; 104 - }; 105 - 106 - pmx_sata1: pmx-sata1 { 107 - marvell,pins = "mpp13"; 108 - marvell,function = "sata1"; 109 - }; 110 - 111 - pmx_fan_high: pmx-fan-high { 112 - marvell,pins = "mpp14"; 113 - marvell,function = "gpio"; 114 - }; 115 - 116 - pmx_fan_low: pmx-fan-low { 117 - marvell,pins = "mpp17"; 118 - marvell,function = "gpio"; 119 - }; 120 - 121 - pmx_fan_lock: pmx-fan-lock { 122 - marvell,pins = "mpp6"; 123 - marvell,function = "gpio"; 124 - }; 125 - 126 - pmx_power_switch: pmx-power-switch { 127 - marvell,pins = "mpp8", "mpp10"; 128 - marvell,function = "gpio"; 129 - }; 130 - }; 131 - }; 132 - }; 133 - 134 61 gpio_keys { 135 - compatible = "gpio-keys"; 136 - #address-cells = <1>; 137 - #size-cells = <0>; 138 - pinctrl-0 = <&pmx_power_switch>; 139 - pinctrl-names = "default"; 140 - 141 - button@1 { 142 - label = "Power-on Switch"; 143 - linux,code = <KEY_RESERVED>; 144 - linux,input-type = <5>; 62 + power-on-switch { 145 63 gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; 146 64 }; 147 65 148 - button@2 { 149 - label = "Power-auto Switch"; 150 - linux,code = <KEY_ESC>; 151 - linux,input-type = <5>; 66 + power-auto-switch { 152 67 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; 153 68 }; 154 69 }; 155 70 156 71 gpio_leds { 157 - compatible = "gpio-leds"; 158 - pinctrl-0 = <&pmx_led_power &pmx_led_alarm 159 - &pmx_led_info>; 160 - pinctrl-names = "default"; 161 - 162 - led@1 { 163 - label = "lswtgl:blue:power"; 72 + blue-power-led { 164 73 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; 165 - default-state = "keep"; 166 74 }; 167 75 168 - led@2 { 169 - label = "lswtgl:red:alarm"; 76 + red-alarm-led { 170 77 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; 171 78 }; 172 79 173 - led@3 { 174 - label = "lswtgl:amber:info"; 80 + amber-info-led { 175 81 gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; 176 82 }; 177 83 }; 178 84 179 85 gpio_fan { 180 - compatible = "gpio-fan"; 181 - pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>; 182 - pinctrl-names = "default"; 183 - 184 86 gpios = <&gpio0 14 GPIO_ACTIVE_LOW 185 87 &gpio0 17 GPIO_ACTIVE_LOW>; 186 88 187 - gpio-fan,speed-map = <0 3 188 - 1500 2 189 - 3250 1 190 - 5000 0>; 191 - 192 89 alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; 193 90 }; 194 - 195 - restart_poweroff { 196 - compatible = "restart-poweroff"; 197 - }; 198 - 199 - regulators { 200 - compatible = "simple-bus"; 201 - #address-cells = <1>; 202 - #size-cells = <0>; 203 - pinctrl-0 = <&pmx_power_hdd &pmx_usb_power>; 204 - pinctrl-names = "default"; 205 - 206 - usb_power: regulator@1 { 207 - compatible = "regulator-fixed"; 208 - reg = <1>; 209 - regulator-name = "USB Power"; 210 - regulator-min-microvolt = <5000000>; 211 - regulator-max-microvolt = <5000000>; 212 - enable-active-high; 213 - regulator-always-on; 214 - regulator-boot-on; 215 - gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; 216 - }; 217 - 218 - hdd_power: regulator@2 { 219 - compatible = "regulator-fixed"; 220 - reg = <2>; 221 - regulator-name = "HDD Power"; 222 - regulator-min-microvolt = <5000000>; 223 - regulator-max-microvolt = <5000000>; 224 - enable-active-high; 225 - regulator-always-on; 226 - regulator-boot-on; 227 - gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; 228 - }; 229 - }; 230 91 }; 231 92 232 - &devbus_bootcs { 233 - status = "okay"; 234 - devbus,keep-config; 93 + &pinctrl { 94 + pmx_led_power: pmx-leds { 95 + marvell,pins = "mpp0"; 96 + marvell,function = "gpio"; 97 + }; 235 98 236 - flash@0 { 237 - compatible = "jedec-flash"; 238 - reg = <0 0x40000>; 239 - bank-width = <1>; 99 + pmx_power_hdd: pmx-power-hdd { 100 + marvell,pins = "mpp1"; 101 + marvell,function = "gpio"; 102 + }; 240 103 241 - partitions { 242 - compatible = "fixed-partitions"; 243 - #address-cells = <1>; 244 - #size-cells = <1>; 104 + pmx_led_alarm: pmx-leds { 105 + marvell,pins = "mpp2"; 106 + marvell,function = "gpio"; 107 + }; 245 108 246 - header@0 { 247 - reg = <0 0x30000>; 248 - read-only; 249 - }; 109 + pmx_led_info: pmx-leds { 110 + marvell,pins = "mpp3"; 111 + marvell,function = "gpio"; 112 + }; 250 113 251 - uboot@30000 { 252 - reg = <0x30000 0xF000>; 253 - read-only; 254 - }; 114 + pmx_fan_lock: pmx-fan-lock { 115 + marvell,pins = "mpp6"; 116 + marvell,function = "gpio"; 117 + }; 255 118 256 - uboot_env@3F000 { 257 - reg = <0x3F000 0x1000>; 258 - }; 259 - }; 119 + pmx_power_switch: pmx-power-switch { 120 + marvell,pins = "mpp8", "mpp10"; 121 + marvell,function = "gpio"; 122 + }; 123 + 124 + pmx_power_usb: pmx-power-usb { 125 + marvell,pins = "mpp9"; 126 + marvell,function = "gpio"; 127 + }; 128 + 129 + pmx_fan_high: pmx-fan-high { 130 + marvell,pins = "mpp14"; 131 + marvell,function = "gpio"; 132 + }; 133 + 134 + pmx_fan_low: pmx-fan-low { 135 + marvell,pins = "mpp17"; 136 + marvell,function = "gpio"; 260 137 }; 261 138 }; 262 139 263 - &mdio { 264 - status = "okay"; 265 - 266 - ethphy: ethernet-phy { 267 - reg = <8>; 268 - }; 140 + &hdd_power { 141 + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; 269 142 }; 270 143 271 - &eth { 272 - status = "okay"; 273 - 274 - ethernet-port@0 { 275 - phy-handle = <&ethphy>; 276 - }; 277 - }; 278 - 279 - &ehci0 { 280 - status = "okay"; 281 - }; 282 - 283 - &i2c { 284 - status = "okay"; 285 - 286 - rtc { 287 - compatible = "ricoh,rs5c372a"; 288 - reg = <0x32>; 289 - }; 290 - }; 291 - 292 - &wdt { 293 - status = "disabled"; 144 + &usb_power { 145 + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; 294 146 }; 295 147 296 148 &sata { 297 - pinctrl-0 = <&pmx_sata0 &pmx_sata1>; 298 - pinctrl-names = "default"; 299 - status = "okay"; 300 149 nr-ports = <2>; 301 - }; 302 - 303 - &uart0 { 304 - status = "okay"; 305 150 };
+180
arch/arm/boot/dts/orion5x-linkstation.dtsi
··· 1 + /* 2 + * Device Tree common file for orion5x based Buffalo Linkstation 3 + * 4 + * Copyright (C) 2015, 2016 5 + * Roger Shimizu <rogershimizu@gmail.com> 6 + * 7 + * This file is dual-licensed: you can use it either under the terms 8 + * of the GPL or the X11 license, at your option. Note that this dual 9 + * licensing only applies to this file, and not this project as a 10 + * whole. 11 + * 12 + * a) This file is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License as 14 + * published by the Free Software Foundation; either version 2 of the 15 + * License, or (at your option) any later version. 16 + * 17 + * This file is distributed in the hope that it will be useful 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * Or, alternatively 23 + * 24 + * b) Permission is hereby granted, free of charge, to any person 25 + * obtaining a copy of this software and associated documentation 26 + * files (the "Software"), to deal in the Software without 27 + * restriction, including without limitation the rights to use 28 + * copy, modify, merge, publish, distribute, sublicense, and/or 29 + * sell copies of the Software, and to permit persons to whom the 30 + * Software is furnished to do so, subject to the following 31 + * conditions: 32 + * 33 + * The above copyright notice and this permission notice shall be 34 + * included in all copies or substantial portions of the Software. 35 + * 36 + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND 37 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY 41 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43 + * OTHER DEALINGS IN THE SOFTWARE. 44 + */ 45 + 46 + #include "orion5x-mv88f5182.dtsi" 47 + 48 + / { 49 + chosen { 50 + bootargs = "console=ttyS0,115200n8 earlyprintk"; 51 + linux,stdout-path = &uart0; 52 + }; 53 + 54 + soc { 55 + ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>, 56 + <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>, 57 + <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x40000>; 58 + }; 59 + 60 + restart_poweroff { 61 + compatible = "restart-poweroff"; 62 + }; 63 + 64 + regulators { 65 + compatible = "simple-bus"; 66 + #address-cells = <1>; 67 + #size-cells = <0>; 68 + pinctrl-0 = <&pmx_power_usb &pmx_power_hdd>; 69 + pinctrl-names = "default"; 70 + 71 + usb_power: regulator@1 { 72 + compatible = "regulator-fixed"; 73 + reg = <1>; 74 + regulator-name = "USB Power"; 75 + regulator-min-microvolt = <5000000>; 76 + regulator-max-microvolt = <5000000>; 77 + enable-active-high; 78 + regulator-always-on; 79 + regulator-boot-on; 80 + }; 81 + 82 + hdd_power: regulator@2 { 83 + compatible = "regulator-fixed"; 84 + reg = <2>; 85 + regulator-name = "HDD Power"; 86 + regulator-min-microvolt = <5000000>; 87 + regulator-max-microvolt = <5000000>; 88 + enable-active-high; 89 + regulator-always-on; 90 + regulator-boot-on; 91 + }; 92 + }; 93 + }; 94 + 95 + &pinctrl { 96 + pmx_power_hdd: pmx-power-hdd { 97 + marvell,function = "gpio"; 98 + }; 99 + 100 + pmx_power_usb: pmx-power-usb { 101 + marvell,function = "gpio"; 102 + }; 103 + }; 104 + 105 + &devbus_bootcs { 106 + status = "okay"; 107 + devbus,keep-config; 108 + 109 + flash@0 { 110 + compatible = "jedec-flash"; 111 + reg = <0 0x40000>; 112 + bank-width = <1>; 113 + 114 + partitions { 115 + compatible = "fixed-partitions"; 116 + #address-cells = <1>; 117 + #size-cells = <1>; 118 + 119 + header@0 { 120 + reg = <0 0x30000>; 121 + read-only; 122 + }; 123 + 124 + uboot@30000 { 125 + reg = <0x30000 0xF000>; 126 + read-only; 127 + }; 128 + 129 + uboot_env@3F000 { 130 + reg = <0x3F000 0x1000>; 131 + }; 132 + }; 133 + }; 134 + }; 135 + 136 + &mdio { 137 + status = "okay"; 138 + 139 + ethphy: ethernet-phy { 140 + reg = <8>; 141 + }; 142 + }; 143 + 144 + &eth { 145 + status = "okay"; 146 + 147 + ethernet-port@0 { 148 + phy-handle = <&ethphy>; 149 + }; 150 + }; 151 + 152 + &ehci0 { 153 + status = "okay"; 154 + }; 155 + 156 + &i2c { 157 + status = "okay"; 158 + 159 + rtc { 160 + compatible = "ricoh,rs5c372a"; 161 + reg = <0x32>; 162 + }; 163 + }; 164 + 165 + &wdt { 166 + status = "disabled"; 167 + }; 168 + 169 + &sata { 170 + status = "okay"; 171 + nr-ports = <1>; 172 + }; 173 + 174 + &uart0 { 175 + status = "okay"; 176 + }; 177 + 178 + &uart1 { 179 + status = "okay"; 180 + };