Import the dts files from Linux 4.17 and enable CONFIG_OF_CONTROL.

Signed-off-by: Chris Packham <judge.pack...@gmail.com>
---

 arch/arm/dts/kirkwood-is2.dts         | 40 +++++++++++
 arch/arm/dts/kirkwood-ns2-common.dtsi | 97 +++++++++++++++++++++++++++
 arch/arm/dts/kirkwood-ns2.dts         | 40 +++++++++++
 arch/arm/dts/kirkwood-ns2lite.dts     | 35 ++++++++++
 arch/arm/dts/kirkwood-ns2max.dts      | 59 ++++++++++++++++
 arch/arm/dts/kirkwood-ns2mini.dts     | 60 +++++++++++++++++
 configs/inetspace_v2_defconfig        |  3 +-
 configs/netspace_lite_v2_defconfig    |  3 +-
 configs/netspace_max_v2_defconfig     |  3 +-
 configs/netspace_mini_v2_defconfig    |  3 +-
 configs/netspace_v2_defconfig         |  3 +-
 include/dt-bindings/leds/leds-ns2.h   |  9 +++
 12 files changed, 350 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/dts/kirkwood-is2.dts
 create mode 100644 arch/arm/dts/kirkwood-ns2-common.dtsi
 create mode 100644 arch/arm/dts/kirkwood-ns2.dts
 create mode 100644 arch/arm/dts/kirkwood-ns2lite.dts
 create mode 100644 arch/arm/dts/kirkwood-ns2max.dts
 create mode 100644 arch/arm/dts/kirkwood-ns2mini.dts
 create mode 100644 include/dt-bindings/leds/leds-ns2.h

diff --git a/arch/arm/dts/kirkwood-is2.dts b/arch/arm/dts/kirkwood-is2.dts
new file mode 100644
index 000000000000..1bc16a5cdbaa
--- /dev/null
+++ b/arch/arm/dts/kirkwood-is2.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include <dt-bindings/leds/leds-ns2.h>
+#include "kirkwood-ns2-common.dtsi"
+
+/ {
+       model = "LaCie Internet Space v2";
+       compatible = "lacie,inetspace_v2", "marvell,kirkwood-88f6281", 
"marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x8000000>;
+       };
+
+       ocp@f1000000 {
+               sata@80000 {
+                       pinctrl-0 = <&pmx_ns2_sata0>;
+                       pinctrl-names = "default";
+                       status = "okay";
+                       nr-ports = <1>;
+               };
+       };
+
+       ns2-leds {
+               compatible = "lacie,ns2-leds";
+
+               blue-sata {
+                       label = "ns2:blue:sata";
+                       slow-gpio = <&gpio0 29 0>;
+                       cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
+               };
+       };
+};
+
+&ethphy0 { reg = <8>; };
diff --git a/arch/arm/dts/kirkwood-ns2-common.dtsi 
b/arch/arm/dts/kirkwood-ns2-common.dtsi
new file mode 100644
index 000000000000..f997bb4df202
--- /dev/null
+++ b/arch/arm/dts/kirkwood-ns2-common.dtsi
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+
+/ {
+       chosen {
+               bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
+       };
+
+       ocp@f1000000 {
+               pinctrl: pin-controller@10000 {
+                       pmx_ns2_sata0: pmx-ns2-sata0 {
+                               marvell,pins = "mpp21";
+                               marvell,function = "sata0";
+                       };
+                       pmx_ns2_sata1: pmx-ns2-sata1 {
+                               marvell,pins = "mpp20";
+                               marvell,function = "sata1";
+                       };
+               };
+
+               serial@12000 {
+                       status = "okay";
+               };
+
+               spi@10600 {
+                       status = "okay";
+
+                       flash@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "mxicy,mx25l4005a", 
"jedec,spi-nor", "spi-flash";
+                               reg = <0>;
+                               spi-max-frequency = <20000000>;
+                               mode = <0>;
+
+                               partition@0 {
+                                       reg = <0x0 0x80000>;
+                                       label = "u-boot";
+                               };
+                       };
+               };
+
+               i2c@11000 {
+                       status = "okay";
+
+                       eeprom@50 {
+                               compatible = "atmel,24c04";
+                               pagesize = <16>;
+                               reg = <0x50>;
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               power {
+                       label = "Power push button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               red-fail {
+                       label = "ns2:red:fail";
+                       gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio_poweroff {
+               compatible = "gpio-poweroff";
+               gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
+       };
+
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@X {
+                /* overwrite reg property in board file */
+       };
+};
+
+&eth0 {
+       status = "okay";
+       ethernet0-port@0 {
+               phy-handle = <&ethphy0>;
+       };
+};
diff --git a/arch/arm/dts/kirkwood-ns2.dts b/arch/arm/dts/kirkwood-ns2.dts
new file mode 100644
index 000000000000..7b67083e1ec0
--- /dev/null
+++ b/arch/arm/dts/kirkwood-ns2.dts
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include <dt-bindings/leds/leds-ns2.h>
+#include "kirkwood-ns2-common.dtsi"
+
+/ {
+       model = "LaCie Network Space v2";
+       compatible = "lacie,netspace_v2", "marvell,kirkwood-88f6281", 
"marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x10000000>;
+       };
+
+       ocp@f1000000 {
+               sata@80000 {
+                       pinctrl-0 = <&pmx_ns2_sata0>;
+                       pinctrl-names = "default";
+                       status = "okay";
+                       nr-ports = <1>;
+               };
+       };
+
+       ns2-leds {
+               compatible = "lacie,ns2-leds";
+
+               blue-sata {
+                       label = "ns2:blue:sata";
+                       slow-gpio = <&gpio0 29 0>;
+                       cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
+               };
+       };
+};
+
+&ethphy0 { reg = <8>; };
diff --git a/arch/arm/dts/kirkwood-ns2lite.dts 
b/arch/arm/dts/kirkwood-ns2lite.dts
new file mode 100644
index 000000000000..b0cb5907ed63
--- /dev/null
+++ b/arch/arm/dts/kirkwood-ns2lite.dts
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include "kirkwood-ns2-common.dtsi"
+
+/ {
+       model = "LaCie Network Space Lite v2";
+       compatible = "lacie,netspace_lite_v2", "marvell,kirkwood-88f6192", 
"marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x8000000>;
+       };
+
+       ocp@f1000000 {
+               sata@80000 {
+                       pinctrl-0 = <&pmx_ns2_sata0>;
+                       pinctrl-names = "default";
+                       status = "okay";
+                       nr-ports = <1>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               blue-sata {
+                       label = "ns2:blue:sata";
+                       gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "disk-activity";
+               };
+       };
+};
+
+&ethphy0 { reg = <0>; };
diff --git a/arch/arm/dts/kirkwood-ns2max.dts b/arch/arm/dts/kirkwood-ns2max.dts
new file mode 100644
index 000000000000..c0a087e77408
--- /dev/null
+++ b/arch/arm/dts/kirkwood-ns2max.dts
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include <dt-bindings/leds/leds-ns2.h>
+#include "kirkwood-ns2-common.dtsi"
+
+/ {
+       model = "LaCie Network Space Max v2";
+       compatible = "lacie,netspace_max_v2", "marvell,kirkwood-88f6281", 
"marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x10000000>;
+       };
+
+       ocp@f1000000 {
+               sata@80000 {
+                       pinctrl-0 = <&pmx_ns2_sata0 &pmx_ns2_sata1>;
+                       pinctrl-names = "default";
+                       status = "okay";
+                       nr-ports = <2>;
+               };
+       };
+
+       gpio_fan {
+               compatible = "gpio-fan";
+               gpios = <&gpio0 22 GPIO_ACTIVE_LOW
+                        &gpio0  7 GPIO_ACTIVE_LOW
+                        &gpio1  1 GPIO_ACTIVE_LOW
+                        &gpio0 23 GPIO_ACTIVE_LOW>;
+               gpio-fan,speed-map =
+                       <   0  0
+                        1500 15
+                        1700 14
+                        1800 13
+                        2100 12
+                        3100 11
+                        3300 10
+                        4300  9
+                        5500  8>;
+               alarm-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
+       };
+
+       ns2-leds {
+               compatible = "lacie,ns2-leds";
+
+               blue-sata {
+                       label = "ns2:blue:sata";
+                       slow-gpio = <&gpio0 29 0>;
+                       cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
+               };
+       };
+};
+
+&ethphy0 { reg = <8>; };
diff --git a/arch/arm/dts/kirkwood-ns2mini.dts 
b/arch/arm/dts/kirkwood-ns2mini.dts
new file mode 100644
index 000000000000..5b9fa14b6428
--- /dev/null
+++ b/arch/arm/dts/kirkwood-ns2mini.dts
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+#include <dt-bindings/leds/leds-ns2.h>
+#include "kirkwood-ns2-common.dtsi"
+
+/ {
+       /* This machine is embedded in the first LaCie CloudBox product. */
+       model = "LaCie Network Space Mini v2";
+       compatible = "lacie,netspace_mini_v2", "marvell,kirkwood-88f6192", 
"marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x8000000>;
+       };
+
+       ocp@f1000000 {
+               sata@80000 {
+                       pinctrl-0 = <&pmx_ns2_sata0>;
+                       pinctrl-names = "default";
+                       status = "okay";
+                       nr-ports = <1>;
+               };
+       };
+
+       gpio_fan {
+               compatible = "gpio-fan";
+               gpios = <&gpio0 22 GPIO_ACTIVE_LOW
+                        &gpio0  7 GPIO_ACTIVE_LOW
+                        &gpio1  1 GPIO_ACTIVE_LOW
+                        &gpio0 23 GPIO_ACTIVE_LOW>;
+               gpio-fan,speed-map =
+                       <   0  0
+                        3000 15
+                        3180 14
+                        4140 13
+                        4570 12
+                        6760 11
+                        7140 10
+                        7980  9
+                        9200  8>;
+               alarm-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
+       };
+
+       ns2-leds {
+               compatible = "lacie,ns2-leds";
+
+               blue-sata {
+                       label = "ns2:blue:sata";
+                       slow-gpio = <&gpio0 29 0>;
+                       cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
+               };
+       };
+};
+
+&ethphy0 { reg = <0>; };
diff --git a/configs/inetspace_v2_defconfig b/configs/inetspace_v2_defconfig
index 9f8677b74471..2fb7209f31a6 100644
--- a/configs/inetspace_v2_defconfig
+++ b/configs/inetspace_v2_defconfig
@@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_TARGET_NETSPACE_V2=y
 CONFIG_IDENT_STRING=" IS v2"
+CONFIG_DEFAULT_DEVICE_TREE="kirkwood-is2"
 CONFIG_SYS_EXTRA_OPTIONS="INETSPACE_V2"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -26,6 +27,7 @@ CONFIG_CMD_FAT=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_PARTITION_UUIDS is not set
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
@@ -39,4 +41,3 @@ CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
diff --git a/configs/netspace_lite_v2_defconfig 
b/configs/netspace_lite_v2_defconfig
index d37146dc94bb..c0e3651e6e03 100644
--- a/configs/netspace_lite_v2_defconfig
+++ b/configs/netspace_lite_v2_defconfig
@@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_TARGET_NETSPACE_V2=y
 CONFIG_IDENT_STRING=" NS v2 Lite"
+CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2lite"
 CONFIG_SYS_EXTRA_OPTIONS="NETSPACE_LITE_V2"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -26,6 +27,7 @@ CONFIG_CMD_FAT=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_PARTITION_UUIDS is not set
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
@@ -39,4 +41,3 @@ CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
diff --git a/configs/netspace_max_v2_defconfig 
b/configs/netspace_max_v2_defconfig
index 9b639c017b30..db75e6d55060 100644
--- a/configs/netspace_max_v2_defconfig
+++ b/configs/netspace_max_v2_defconfig
@@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_TARGET_NETSPACE_V2=y
 CONFIG_IDENT_STRING=" NS Max v2"
+CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2max"
 CONFIG_SYS_EXTRA_OPTIONS="NETSPACE_MAX_V2"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -26,6 +27,7 @@ CONFIG_CMD_FAT=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_PARTITION_UUIDS is not set
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
@@ -39,4 +41,3 @@ CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
diff --git a/configs/netspace_mini_v2_defconfig 
b/configs/netspace_mini_v2_defconfig
index ee7554fd3f98..fd774c722afb 100644
--- a/configs/netspace_mini_v2_defconfig
+++ b/configs/netspace_mini_v2_defconfig
@@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_TARGET_NETSPACE_V2=y
 CONFIG_IDENT_STRING=" NS v2 Mini"
+CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2mini"
 CONFIG_SYS_EXTRA_OPTIONS="NETSPACE_MINI_V2"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -24,6 +25,7 @@ CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_PARTITION_UUIDS is not set
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
@@ -34,4 +36,3 @@ CONFIG_MVGBE=y
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_KIRKWOOD_SPI=y
-CONFIG_OF_LIBFDT=y
diff --git a/configs/netspace_v2_defconfig b/configs/netspace_v2_defconfig
index 6421706de043..ebdb16b16f58 100644
--- a/configs/netspace_v2_defconfig
+++ b/configs/netspace_v2_defconfig
@@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y
 CONFIG_SYS_TEXT_BASE=0x600000
 CONFIG_TARGET_NETSPACE_V2=y
 CONFIG_IDENT_STRING=" NS v2"
+CONFIG_DEFAULT_DEVICE_TREE="kirkwood-ns2"
 CONFIG_SYS_EXTRA_OPTIONS="NETSPACE_V2"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -26,6 +27,7 @@ CONFIG_CMD_FAT=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_PARTITION_UUIDS is not set
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_MVSATA_IDE=y
 # CONFIG_MMC is not set
@@ -39,4 +41,3 @@ CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_OF_LIBFDT=y
diff --git a/include/dt-bindings/leds/leds-ns2.h 
b/include/dt-bindings/leds/leds-ns2.h
new file mode 100644
index 000000000000..fd615749e703
--- /dev/null
+++ b/include/dt-bindings/leds/leds-ns2.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _DT_BINDINGS_LEDS_NS2_H
+#define _DT_BINDINGS_LEDS_NS2_H
+
+#define NS_V2_LED_OFF  0
+#define NS_V2_LED_ON   1
+#define NS_V2_LED_SATA 2
+
+#endif
-- 
2.17.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to