linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S  board
@ 2022-09-29  8:01 Pawel Dembicki
  2022-09-29 12:53 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Pawel Dembicki @ 2022-09-29  8:01 UTC (permalink / raw)
  To: devicetree, linux-arm-kernel, Gregory Clement, Andrew Lunn, Tony Dinh
  Cc: Pawel Dembicki

Zyxel NSA310S is a NAS based on Marvell kirkwood SoC.

Specification:
 - Processor Marvell 88F6702 1 GHz
 - 256MB RAM
 - 128MB NAND
 - 1x GBE LAN port (PHY: Marvell 88E1318)
 - 2x USB 2.0
 - 1x SATA
 - 3x button
 - 7x leds
 - serial on J1 connector (115200 8N1) (GND-NOPIN-RX-TX-VCC)

Tested-by: Tony Dinh <mibodhi@gmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
---
 arch/arm/boot/dts/Makefile             |   1 +
 arch/arm/boot/dts/kirkwood-nsa310s.dts | 267 +++++++++++++++++++++++++
 2 files changed, 268 insertions(+)
 create mode 100644 arch/arm/boot/dts/kirkwood-nsa310s.dts

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 05d8aef6e5d2..eae7d1139fbc 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -354,6 +354,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
 	kirkwood-ns2mini.dtb \
 	kirkwood-nsa310.dtb \
 	kirkwood-nsa310a.dtb \
+	kirkwood-nsa310s.dtb \
 	kirkwood-nsa320.dtb \
 	kirkwood-nsa325.dtb \
 	kirkwood-openblocks_a6.dtb \
diff --git a/arch/arm/boot/dts/kirkwood-nsa310s.dts b/arch/arm/boot/dts/kirkwood-nsa310s.dts
new file mode 100644
index 000000000000..210dfdb577bb
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts
@@ -0,0 +1,267 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * ZyXEL NSA310S Board Description
+ * Copyright 2020-2022 Pawel Dembicki <paweldembicki@gmail.com>
+ * Copyright (c) 2015-2021, Tony Dinh <mibodhi@gmail.com>
+ * Copyright (c) 2014, Adam Baker <linux@baker-net.org.uk>
+ * Based upon the board setup file created by Peter Schildmann
+ */
+/dts-v1/;
+
+#include "kirkwood.dtsi"
+#include "kirkwood-6281.dtsi"
+#include <dt-bindings/leds/common.h>
+
+/ {
+	model = "ZyXEL NSA310S";
+	compatible = "zyxel,nsa310s", "marvell,kirkwood-88f6702", "marvell,kirkwood";
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 earlyprintk";
+		stdout-path = &uart0;
+	};
+
+	gpio_poweroff {
+		compatible = "gpio-poweroff";
+		pinctrl-0 = <&pmx_pwr_off>;
+		pinctrl-names = "default";
+		gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_buttons>;
+		pinctrl-names = "default";
+
+		power {
+			label = "Power Button";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
+		};
+
+		copy {
+			label = "Copy Button";
+			linux,code = <KEY_COPY>;
+			gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
+		};
+
+		reset {
+			label = "Reset Button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&pmx_leds>;
+		pinctrl-names = "default";
+
+		led-1 {
+			function = LED_FUNCTION_DISK_ERR;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-2 {
+			function = LED_FUNCTION_USB;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "usb-host";
+		};
+
+		led-3 {
+			function = LED_FUNCTION_DISK;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata1";
+		};
+
+		led-4 {
+			function = LED_FUNCTION_INDICATOR;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-5 {
+			function = LED_FUNCTION_INDICATOR;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
+		};
+
+		led-6 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "default-on";
+		};
+
+		led-7 {
+			function = LED_FUNCTION_STATUS;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_power>;
+		pinctrl-names = "default";
+
+		usb0_power: regulator@1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "USB Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>;
+		};
+
+		sata1_power: regulator@2 {
+			compatible = "regulator-fixed";
+			reg = <2>;
+			regulator-name = "SATA1 Power";
+			regulator-min-microvolt = <5000000>;
+			regulator-max-microvolt = <5000000>;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	thermal-zones {
+		disk-thermal {
+			polling-delay = <20000>;
+			polling-delay-passive = <2000>;
+
+			thermal-sensors = <&hdd_temp>;
+
+			trips {
+				disk_alert: disk-alert {
+					temperature = <40000>;
+					hysteresis = <5000>;
+					type = "active";
+				};
+				disk_crit: disk-crit {
+					temperature = <60000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+};
+
+
+&eth0 {
+	status = "okay";
+
+	ethernet0-port@0 {
+		phy-handle = <&ethphy0>;
+	};
+};
+
+&i2c0 {
+	status = "okay";
+
+	rtc@68 {
+		compatible = "htk,ht1382";
+		reg = <0x68>;
+	};
+};
+
+&mdio {
+	status = "okay";
+
+	ethphy0: ethernet-phy@1 {
+		reg = <1>;
+		phy-mode = "rgmii-id";
+		marvell,reg-init = <0x1 0x16 0x0 0x3>,
+						   <0x1 0x10 0x0 0x1017>,
+						   <0x1 0x11 0x0 0x4408>,
+						   <0x1 0x16 0x0 0x0>;
+	};
+};
+
+&nand {
+	status = "okay";
+	chip-delay = <35>;
+
+	partition@0 {
+		label = "uboot";
+		reg = <0x0000000 0x00c0000>;
+		read-only;
+	};
+	partition@c0000 {
+		label = "uboot_env";
+		reg = <0x00c0000 0x0080000>;
+	};
+	partition@140000 {
+		label = "ubi";
+		reg = <0x0140000 0x7ec0000>;
+	};
+};
+
+&pciec {
+	status = "okay";
+};
+
+&pcie0 {
+	status = "okay";
+};
+
+&pinctrl {
+	pinctrl-names = "default";
+
+	pmx_buttons: pmx-buttons {
+		marvell,pins = "mpp24", "mpp25", "mpp26";
+		marvell,function = "gpio";
+	};
+
+	pmx_leds: pmx-leds {
+		marvell,pins = "mpp13", "mpp15", "mpp16", "mpp22", "mpp23",
+						"mpp28", "mpp29";
+		marvell,function = "gpio";
+	};
+
+	pmx_power: pmx-power {
+		marvell,pins = "mpp21", "mpp33";
+		marvell,function = "gpio";
+	};
+
+	pmx_pwr_off: pmx-pwr-off {
+		marvell,pins = "mpp27";
+		marvell,function = "gpio";
+	};
+};
+
+&rtc {
+	status = "disabled";
+};
+
+&sata {
+	status = "okay";
+	nr-ports = <1>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	hdd_temp: sata-port@0 {
+		reg = <0>;
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S  board
  2022-09-29  8:01 [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S board Pawel Dembicki
@ 2022-09-29 12:53 ` Andrew Lunn
  2022-10-29  0:14   ` Adam Baker
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2022-09-29 12:53 UTC (permalink / raw)
  To: Pawel Dembicki; +Cc: devicetree, linux-arm-kernel, Gregory Clement, Tony Dinh

> +// SPDX-License-Identifier: GPL-2.0-only

Same license comment. However, you can only change the license if it
is your code. If you did the conversion from a board setup file to DT,
you can change the license. If somebody else did that and you are just
submitting it, then we need to keep to GPL-2.0-only.

> +	regulators {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		pinctrl-0 = <&pmx_power>;
> +		pinctrl-names = "default";

The modern way to do regulators is to no longer user a container node.
Most of the existing kirkwood DTS files are from long before this was
introduced, so they do have a container. But new files should probably
do it the 'new' way.

   Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S board
  2022-09-29 12:53 ` Andrew Lunn
@ 2022-10-29  0:14   ` Adam Baker
  2022-10-29  0:49     ` Tony Dinh
  2022-10-29 14:31     ` Andrew Lunn
  0 siblings, 2 replies; 5+ messages in thread
From: Adam Baker @ 2022-10-29  0:14 UTC (permalink / raw)
  To: Andrew Lunn, Pawel Dembicki
  Cc: devicetree, linux-arm-kernel, Gregory Clement, Tony Dinh

On 29/09/2022 13:53, Andrew Lunn wrote:
>> +// SPDX-License-Identifier: GPL-2.0-only
> Same license comment. However, you can only change the license if it
> is your code. If you did the conversion from a board setup file to DT,
> you can change the license. If somebody else did that and you are just
> submitting it, then we need to keep to GPL-2.0-only.

As it lists my name in the copyright I'm guessing it is derived from my 
nsa320 device tree. If so I have no objection to relicensing to GPL2 + 
MIT for anything that came from my code. It is different enough I don't 
think I could reasonably lay claim to it anyway. It looks as though some 
of it such as the keys section came from the earlier nsa310 device tree 
rather than mine. That looks like Andrew Lunn's clean up of it rather 
than Tero Jaasko's original.

There is no temperature or fan monitoring listed in the device tree, do 
you know if the 310s supports it and if so what sensor it uses?

Adam Baker


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S board
  2022-10-29  0:14   ` Adam Baker
@ 2022-10-29  0:49     ` Tony Dinh
  2022-10-29 14:31     ` Andrew Lunn
  1 sibling, 0 replies; 5+ messages in thread
From: Tony Dinh @ 2022-10-29  0:49 UTC (permalink / raw)
  To: Adam Baker
  Cc: Andrew Lunn, Pawel Dembicki, devicetree, linux-arm-kernel,
	Gregory Clement

Hi Adam,

On Fri, Oct 28, 2022 at 5:15 PM Adam Baker <linux@baker-net.org.uk> wrote:
>
> On 29/09/2022 13:53, Andrew Lunn wrote:
> >> +// SPDX-License-Identifier: GPL-2.0-only
> > Same license comment. However, you can only change the license if it
> > is your code. If you did the conversion from a board setup file to DT,
> > you can change the license. If somebody else did that and you are just
> > submitting it, then we need to keep to GPL-2.0-only.
>
> As it lists my name in the copyright I'm guessing it is derived from my
> nsa320 device tree.

Yes, I created it based on your device tree DTS from way back. Thanks.

> If so I have no objection to relicensing to GPL2 +
> MIT for anything that came from my code. It is different enough I don't
> think I could reasonably lay claim to it anyway. It looks as though some
> of it such as the keys section came from the earlier nsa310 device tree
> rather than mine. That looks like Andrew Lunn's clean up of it rather
> than Tero Jaasko's original.
>
> There is no temperature or fan monitoring listed in the device tree, do
> you know if the 310s supports it and if so what sensor it uses?

The ZyXEL NAS series 310S/320S/325 don't support the sensor module
(i.e. lm-sensor cannot be used for it). The CPU temperature and fan
speed can be read from i2c, but so far nobody has discovered how to
set them with i2c commands.

All the best,
Tony

>
> Adam Baker
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S board
  2022-10-29  0:14   ` Adam Baker
  2022-10-29  0:49     ` Tony Dinh
@ 2022-10-29 14:31     ` Andrew Lunn
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2022-10-29 14:31 UTC (permalink / raw)
  To: Adam Baker
  Cc: Pawel Dembicki, devicetree, linux-arm-kernel, Gregory Clement, Tony Dinh

On Sat, Oct 29, 2022 at 01:14:52AM +0100, Adam Baker wrote:
> On 29/09/2022 13:53, Andrew Lunn wrote:
> > > +// SPDX-License-Identifier: GPL-2.0-only
> > Same license comment. However, you can only change the license if it
> > is your code. If you did the conversion from a board setup file to DT,
> > you can change the license. If somebody else did that and you are just
> > submitting it, then we need to keep to GPL-2.0-only.
> 
> As it lists my name in the copyright I'm guessing it is derived from my
> nsa320 device tree. If so I have no objection to relicensing to GPL2 + MIT
> for anything that came from my code.

Thanks Adam.

It would be nice if you sent an Acked-by: on the patch.

   Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-29 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  8:01 [PATCH] ARM: dts: kirkwood: Add Zyxel NSA310S board Pawel Dembicki
2022-09-29 12:53 ` Andrew Lunn
2022-10-29  0:14   ` Adam Baker
2022-10-29  0:49     ` Tony Dinh
2022-10-29 14:31     ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).