Commit fbe502e9aba098b5ad500d1cdb6b376f56f9ddbb
Committed by
Stefan Roese
1 parent
58d6f68e75
Exists in
smarc_8mq_lf_v2020.04
and in
14 other branches
ARM: kirkwood: Add device-tree for d2net_v2 & net2big_v2
Import the dts files from Linux 4.17 and enable CONFIG_OF_CONTROL. Signed-off-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Stefan Roese <sr@denx.de>
Showing 6 changed files with 362 additions and 2 deletions Side-by-side Diff
arch/arm/dts/kirkwood-d2net.dts
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Device Tree file for d2 Network v2 | |
| 4 | + * | |
| 5 | + * Copyright (C) 2014 Simon Guinot <simon.guinot@sequanux.org> | |
| 6 | + * | |
| 7 | +*/ | |
| 8 | + | |
| 9 | +/dts-v1/; | |
| 10 | + | |
| 11 | +#include <dt-bindings/leds/leds-ns2.h> | |
| 12 | +#include "kirkwood-netxbig.dtsi" | |
| 13 | + | |
| 14 | +/ { | |
| 15 | + model = "LaCie d2 Network v2"; | |
| 16 | + compatible = "lacie,d2net_v2", "lacie,netxbig", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | |
| 17 | + | |
| 18 | + memory { | |
| 19 | + device_type = "memory"; | |
| 20 | + reg = <0x00000000 0x10000000>; | |
| 21 | + }; | |
| 22 | + | |
| 23 | + ns2-leds { | |
| 24 | + compatible = "lacie,ns2-leds"; | |
| 25 | + | |
| 26 | + blue-sata { | |
| 27 | + label = "d2net_v2:blue:sata"; | |
| 28 | + slow-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; | |
| 29 | + cmd-gpio = <&gpio0 30 GPIO_ACTIVE_HIGH>; | |
| 30 | + modes-map = <NS_V2_LED_OFF 1 0 | |
| 31 | + NS_V2_LED_ON 0 1 | |
| 32 | + NS_V2_LED_ON 1 1 | |
| 33 | + NS_V2_LED_SATA 0 0>; | |
| 34 | + }; | |
| 35 | + }; | |
| 36 | + | |
| 37 | + gpio-leds { | |
| 38 | + compatible = "gpio-leds"; | |
| 39 | + | |
| 40 | + red-fail { | |
| 41 | + label = "d2net_v2:red:fail"; | |
| 42 | + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; | |
| 43 | + }; | |
| 44 | + }; | |
| 45 | +}; |
arch/arm/dts/kirkwood-net2big.dts
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Device Tree file for LaCie 2Big Network v2 | |
| 4 | + * | |
| 5 | + * Copyright (C) 2014 | |
| 6 | + * | |
| 7 | + * Andrew Lunn <andrew@lunn.ch> | |
| 8 | + * | |
| 9 | + * Based on netxbig_v2-setup.c, | |
| 10 | + * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | |
| 11 | + * | |
| 12 | +*/ | |
| 13 | + | |
| 14 | +/dts-v1/; | |
| 15 | + | |
| 16 | +#include "kirkwood.dtsi" | |
| 17 | +#include "kirkwood-6281.dtsi" | |
| 18 | +#include "kirkwood-netxbig.dtsi" | |
| 19 | + | |
| 20 | +/ { | |
| 21 | + model = "LaCie 2Big Network v2"; | |
| 22 | + compatible = "lacie,net2big_v2", "lacie,netxbig", "marvell,kirkwood-88f6281", "marvell,kirkwood"; | |
| 23 | + | |
| 24 | + memory { | |
| 25 | + device_type = "memory"; | |
| 26 | + reg = <0x00000000 0x10000000>; | |
| 27 | + }; | |
| 28 | + | |
| 29 | + fan { | |
| 30 | + compatible = "gpio-fan"; | |
| 31 | + alarm-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; | |
| 32 | + }; | |
| 33 | +}; | |
| 34 | + | |
| 35 | +®ulators { | |
| 36 | + regulator@2 { | |
| 37 | + compatible = "regulator-fixed"; | |
| 38 | + reg = <2>; | |
| 39 | + regulator-name = "hdd1power"; | |
| 40 | + regulator-min-microvolt = <5000000>; | |
| 41 | + regulator-max-microvolt = <5000000>; | |
| 42 | + enable-active-high; | |
| 43 | + regulator-always-on; | |
| 44 | + regulator-boot-on; | |
| 45 | + gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>; | |
| 46 | + }; | |
| 47 | + | |
| 48 | + clocks { | |
| 49 | + g762_clk: g762-oscillator { | |
| 50 | + compatible = "fixed-clock"; | |
| 51 | + #clock-cells = <0>; | |
| 52 | + clock-frequency = <32768>; | |
| 53 | + }; | |
| 54 | + }; | |
| 55 | +}; | |
| 56 | + | |
| 57 | +&i2c0 { | |
| 58 | + g762@3e { | |
| 59 | + compatible = "gmt,g762"; | |
| 60 | + reg = <0x3e>; | |
| 61 | + clocks = <&g762_clk>; | |
| 62 | + }; | |
| 63 | +}; |
arch/arm/dts/kirkwood-netxbig.dtsi
| 1 | +// SPDX-License-Identifier: GPL-2.0 | |
| 2 | +/* | |
| 3 | + * Device Tree common file for LaCie 2Big and 5Big Network v2 | |
| 4 | + * | |
| 5 | + * Copyright (C) 2014 | |
| 6 | + * | |
| 7 | + * Andrew Lunn <andrew@lunn.ch> | |
| 8 | + * | |
| 9 | + * Based on netxbig_v2-setup.c, | |
| 10 | + * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com> | |
| 11 | + * | |
| 12 | +*/ | |
| 13 | + | |
| 14 | +#include <dt-bindings/leds/leds-netxbig.h> | |
| 15 | +#include "kirkwood.dtsi" | |
| 16 | +#include "kirkwood-6281.dtsi" | |
| 17 | + | |
| 18 | +/ { | |
| 19 | + chosen { | |
| 20 | + bootargs = "console=ttyS0,115200n8"; | |
| 21 | + stdout-path = &uart0; | |
| 22 | + }; | |
| 23 | + | |
| 24 | + ocp@f1000000 { | |
| 25 | + serial@12000 { | |
| 26 | + status = "okay"; | |
| 27 | + }; | |
| 28 | + | |
| 29 | + spi@10600 { | |
| 30 | + status = "okay"; | |
| 31 | + | |
| 32 | + flash@0 { | |
| 33 | + #address-cells = <1>; | |
| 34 | + #size-cells = <1>; | |
| 35 | + compatible = "mxicy,mx25l4005a", "jedec,spi-nor", "spi-flash"; | |
| 36 | + reg = <0>; | |
| 37 | + spi-max-frequency = <20000000>; | |
| 38 | + mode = <0>; | |
| 39 | + | |
| 40 | + partition@0 { | |
| 41 | + reg = <0x0 0x80000>; | |
| 42 | + label = "u-boot"; | |
| 43 | + }; | |
| 44 | + }; | |
| 45 | + }; | |
| 46 | + | |
| 47 | + sata@80000 { | |
| 48 | + status = "okay"; | |
| 49 | + nr-ports = <2>; | |
| 50 | + }; | |
| 51 | + | |
| 52 | + }; | |
| 53 | + | |
| 54 | + gpio-keys { | |
| 55 | + compatible = "gpio-keys"; | |
| 56 | + #address-cells = <1>; | |
| 57 | + #size-cells = <0>; | |
| 58 | + | |
| 59 | + /* | |
| 60 | + * esc and power represent a three position rocker | |
| 61 | + * switch. Thus the conventional KEY_POWER does not fit | |
| 62 | + */ | |
| 63 | + exc { | |
| 64 | + label = "Back power switch (on|auto)"; | |
| 65 | + linux,code = <KEY_ESC>; | |
| 66 | + linux,input-type = <5>; | |
| 67 | + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; | |
| 68 | + }; | |
| 69 | + power { | |
| 70 | + label = "Back power switch (auto|off)"; | |
| 71 | + linux,code = <KEY_1>; | |
| 72 | + linux,input-type = <5>; | |
| 73 | + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; | |
| 74 | + }; | |
| 75 | + option { | |
| 76 | + label = "Function button"; | |
| 77 | + linux,code = <KEY_OPTION>; | |
| 78 | + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; | |
| 79 | + }; | |
| 80 | + | |
| 81 | + }; | |
| 82 | + | |
| 83 | + gpio-poweroff { | |
| 84 | + compatible = "gpio-poweroff"; | |
| 85 | + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; | |
| 86 | + }; | |
| 87 | + | |
| 88 | + regulators: regulators { | |
| 89 | + status = "okay"; | |
| 90 | + compatible = "simple-bus"; | |
| 91 | + #address-cells = <1>; | |
| 92 | + #size-cells = <0>; | |
| 93 | + pinctrl-names = "default"; | |
| 94 | + | |
| 95 | + regulator@1 { | |
| 96 | + compatible = "regulator-fixed"; | |
| 97 | + reg = <1>; | |
| 98 | + regulator-name = "hdd0power"; | |
| 99 | + regulator-min-microvolt = <5000000>; | |
| 100 | + regulator-max-microvolt = <5000000>; | |
| 101 | + enable-active-high; | |
| 102 | + regulator-always-on; | |
| 103 | + regulator-boot-on; | |
| 104 | + gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>; | |
| 105 | + }; | |
| 106 | + }; | |
| 107 | + | |
| 108 | + netxbig_gpio_ext: netxbig-gpio-ext { | |
| 109 | + compatible = "lacie,netxbig-gpio-ext"; | |
| 110 | + | |
| 111 | + addr-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH | |
| 112 | + &gpio1 16 GPIO_ACTIVE_HIGH | |
| 113 | + &gpio1 17 GPIO_ACTIVE_HIGH>; | |
| 114 | + data-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH | |
| 115 | + &gpio1 13 GPIO_ACTIVE_HIGH | |
| 116 | + &gpio1 14 GPIO_ACTIVE_HIGH>; | |
| 117 | + enable-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; | |
| 118 | + }; | |
| 119 | + | |
| 120 | + netxbig-leds { | |
| 121 | + compatible = "lacie,netxbig-leds"; | |
| 122 | + | |
| 123 | + gpio-ext = <&netxbig_gpio_ext>; | |
| 124 | + | |
| 125 | + timers = <NETXBIG_LED_TIMER1 500 500 | |
| 126 | + NETXBIG_LED_TIMER2 500 1000>; | |
| 127 | + | |
| 128 | + blue-power { | |
| 129 | + label = "netxbig:blue:power"; | |
| 130 | + mode-addr = <0>; | |
| 131 | + mode-val = <NETXBIG_LED_OFF 0 | |
| 132 | + NETXBIG_LED_ON 1 | |
| 133 | + NETXBIG_LED_TIMER1 3 | |
| 134 | + NETXBIG_LED_TIMER2 7>; | |
| 135 | + bright-addr = <1>; | |
| 136 | + max-brightness = <7>; | |
| 137 | + }; | |
| 138 | + red-power { | |
| 139 | + label = "netxbig:red:power"; | |
| 140 | + mode-addr = <0>; | |
| 141 | + mode-val = <NETXBIG_LED_OFF 0 | |
| 142 | + NETXBIG_LED_ON 2 | |
| 143 | + NETXBIG_LED_TIMER1 4>; | |
| 144 | + bright-addr = <1>; | |
| 145 | + max-brightness = <7>; | |
| 146 | + }; | |
| 147 | + blue-sata0 { | |
| 148 | + label = "netxbig:blue:sata0"; | |
| 149 | + mode-addr = <3>; | |
| 150 | + mode-val = <NETXBIG_LED_OFF 0 | |
| 151 | + NETXBIG_LED_ON 7 | |
| 152 | + NETXBIG_LED_SATA 1 | |
| 153 | + NETXBIG_LED_TIMER1 3>; | |
| 154 | + bright-addr = <2>; | |
| 155 | + max-brightness = <7>; | |
| 156 | + }; | |
| 157 | + red-sata0 { | |
| 158 | + label = "netxbig:red:sata0"; | |
| 159 | + mode-addr = <3>; | |
| 160 | + mode-val = <NETXBIG_LED_OFF 0 | |
| 161 | + NETXBIG_LED_ON 2 | |
| 162 | + NETXBIG_LED_TIMER1 4>; | |
| 163 | + bright-addr = <2>; | |
| 164 | + max-brightness = <7>; | |
| 165 | + }; | |
| 166 | + blue-sata1 { | |
| 167 | + label = "netxbig:blue:sata1"; | |
| 168 | + mode-addr = <4>; | |
| 169 | + mode-val = <NETXBIG_LED_OFF 0 | |
| 170 | + NETXBIG_LED_ON 7 | |
| 171 | + NETXBIG_LED_SATA 1 | |
| 172 | + NETXBIG_LED_TIMER1 3>; | |
| 173 | + bright-addr = <2>; | |
| 174 | + max-brightness = <7>; | |
| 175 | + }; | |
| 176 | + red-sata1 { | |
| 177 | + label = "netxbig:red:sata1"; | |
| 178 | + mode-addr = <4>; | |
| 179 | + mode-val = <NETXBIG_LED_OFF 0 | |
| 180 | + NETXBIG_LED_ON 2 | |
| 181 | + NETXBIG_LED_TIMER1 4>; | |
| 182 | + bright-addr = <2>; | |
| 183 | + max-brightness = <7>; | |
| 184 | + }; | |
| 185 | + }; | |
| 186 | +}; | |
| 187 | + | |
| 188 | +&mdio { | |
| 189 | + status = "okay"; | |
| 190 | + | |
| 191 | + ethphy0: ethernet-phy@0 { | |
| 192 | + reg = <8>; | |
| 193 | + }; | |
| 194 | + | |
| 195 | + ethphy1: ethernet-phy@1 { | |
| 196 | + reg = <0>; | |
| 197 | + }; | |
| 198 | +}; | |
| 199 | + | |
| 200 | +ð0 { | |
| 201 | + status = "okay"; | |
| 202 | + ethernet0-port@0 { | |
| 203 | + phy-handle = <ðphy0>; | |
| 204 | + }; | |
| 205 | +}; | |
| 206 | + | |
| 207 | +&pinctrl { | |
| 208 | + pinctrl-names = "default"; | |
| 209 | + | |
| 210 | + pmx_button_function: pmx-button-function { | |
| 211 | + marvell,pins = "mpp34"; | |
| 212 | + marvell,function = "gpio"; | |
| 213 | + }; | |
| 214 | + pmx_button_power_off: pmx-button-power-off { | |
| 215 | + marvell,pins = "mpp15"; | |
| 216 | + marvell,function = "gpio"; | |
| 217 | + }; | |
| 218 | + pmx_button_power_on: pmx-button-power-on { | |
| 219 | + marvell,pins = "mpp13"; | |
| 220 | + marvell,function = "gpio"; | |
| 221 | + }; | |
| 222 | +}; | |
| 223 | + | |
| 224 | +&i2c0 { | |
| 225 | + status = "okay"; | |
| 226 | + | |
| 227 | + eeprom@50 { | |
| 228 | + compatible = "atmel,24c04"; | |
| 229 | + pagesize = <16>; | |
| 230 | + reg = <0x50>; | |
| 231 | + }; | |
| 232 | +}; |
configs/d2net_v2_defconfig
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | CONFIG_SYS_TEXT_BASE=0x600000 |
| 4 | 4 | CONFIG_TARGET_NET2BIG_V2=y |
| 5 | 5 | CONFIG_IDENT_STRING=" D2 v2" |
| 6 | +CONFIG_DEFAULT_DEVICE_TREE="kirkwood-d2net" | |
| 6 | 7 | CONFIG_SYS_EXTRA_OPTIONS="D2NET_V2" |
| 7 | 8 | CONFIG_BOOTDELAY=3 |
| 8 | 9 | CONFIG_USE_BOOTARGS=y |
| ... | ... | @@ -26,6 +27,7 @@ |
| 26 | 27 | CONFIG_ISO_PARTITION=y |
| 27 | 28 | CONFIG_EFI_PARTITION=y |
| 28 | 29 | # CONFIG_PARTITION_UUIDS is not set |
| 30 | +CONFIG_OF_CONTROL=y | |
| 29 | 31 | CONFIG_ENV_IS_IN_SPI_FLASH=y |
| 30 | 32 | CONFIG_MVSATA_IDE=y |
| 31 | 33 | # CONFIG_MMC is not set |
| ... | ... | @@ -39,5 +41,4 @@ |
| 39 | 41 | CONFIG_USB=y |
| 40 | 42 | CONFIG_USB_EHCI_HCD=y |
| 41 | 43 | CONFIG_USB_STORAGE=y |
| 42 | -CONFIG_OF_LIBFDT=y |
configs/net2big_v2_defconfig
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | CONFIG_SYS_TEXT_BASE=0x600000 |
| 4 | 4 | CONFIG_TARGET_NET2BIG_V2=y |
| 5 | 5 | CONFIG_IDENT_STRING=" 2Big v2" |
| 6 | +CONFIG_DEFAULT_DEVICE_TREE="kirkwood-net2big" | |
| 6 | 7 | CONFIG_SYS_EXTRA_OPTIONS="NET2BIG_V2" |
| 7 | 8 | CONFIG_BOOTDELAY=3 |
| 8 | 9 | CONFIG_USE_BOOTARGS=y |
| ... | ... | @@ -26,6 +27,7 @@ |
| 26 | 27 | CONFIG_ISO_PARTITION=y |
| 27 | 28 | CONFIG_EFI_PARTITION=y |
| 28 | 29 | # CONFIG_PARTITION_UUIDS is not set |
| 30 | +CONFIG_OF_CONTROL=y | |
| 29 | 31 | CONFIG_ENV_IS_IN_SPI_FLASH=y |
| 30 | 32 | CONFIG_MVSATA_IDE=y |
| 31 | 33 | # CONFIG_MMC is not set |
| ... | ... | @@ -39,5 +41,4 @@ |
| 39 | 41 | CONFIG_USB=y |
| 40 | 42 | CONFIG_USB_EHCI_HCD=y |
| 41 | 43 | CONFIG_USB_STORAGE=y |
| 42 | -CONFIG_OF_LIBFDT=y |
include/dt-bindings/leds/leds-netxbig.h
| 1 | +/* | |
| 2 | + * This header provides constants for netxbig LED bindings. | |
| 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 | +#ifndef _DT_BINDINGS_LEDS_NETXBIG_H | |
| 10 | +#define _DT_BINDINGS_LEDS_NETXBIG_H | |
| 11 | + | |
| 12 | +#define NETXBIG_LED_OFF 0 | |
| 13 | +#define NETXBIG_LED_ON 1 | |
| 14 | +#define NETXBIG_LED_SATA 2 | |
| 15 | +#define NETXBIG_LED_TIMER1 3 | |
| 16 | +#define NETXBIG_LED_TIMER2 4 | |
| 17 | + | |
| 18 | +#endif /* _DT_BINDINGS_LEDS_NETXBIG_H */ |