From patchwork Sat Oct 29 20:57:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Dembicki X-Patchwork-Id: 13024781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E443C433FE for ; Sat, 29 Oct 2022 20:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8EGS9fAwzpYPuDRC+h3KgQzkXVrgU9PEZazg5YvSHEM=; b=1dqgfmj43nnuhY nRv2b0dAAFzcqwHPl8FDFlFkk4zwLJPi449sZmP2Nsyxjop9e+4d/JaPVnCxsG285mqPeGf4Oa+iW u+PR+r1hh3FUivFll62286wvhHAp5x3wcsAp77CNoaC/BhrXj9h8uxdarDtUqoGlGYHyUeTVfT70j zF+pHztneOlbezEIZo90n4mgGyioINmA8MpN8kEVvQdQfW4TysEiQOxYSND419wQAyPNCuOw/lfl0 27SfWbTiTslO6IDntJlCZZoZcZli5cDKIplKKLh5yT+T+cauhOMdC9VYyXDJeEn3PPwd3uNRdqiNM xAL2XE3q/vrwV/Awp0Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oosu8-009IC4-57; Sat, 29 Oct 2022 20:58:08 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oosu4-009IB4-M2 for linux-arm-kernel@lists.infradead.org; Sat, 29 Oct 2022 20:58:06 +0000 Received: by mail-lj1-x22b.google.com with SMTP id u2so12416807ljl.3 for ; Sat, 29 Oct 2022 13:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TmXYhaOluZLzQOH9f/pZ5fj7/XV19UdsyHLu3LCS9nA=; b=HMvqhdrlYGxg3uqAk3OjX21kLKd2iDB5s5/UzrIJA51z/4J7nJ7WpZcrkW+6iYv5xm aXl6u7YPe5z2YF4YcoJuaZiaKrfA3zjsizFHTDoNiSGsOh/9ZV1L7jhSSxrGfPBKYXTz ziXMIDZnuljPYZUIul0eYy7TGBgRvRFcH7qSrKoj2fw0dTrlYivcE3uWbkF/L9uearwg KMmiWB/lY6aAey8fGFke+y1PJGhRxTey0PeQxGzKtkwK4iSm3L7QOznrnHx04NKzfWUL WfpKqMhk5SmBBRKJ8VZrFw9rPRcDdB3+y+G1sLDe7baC5+mSQGhn5+bS2tRCLtJPw3Pm /aWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TmXYhaOluZLzQOH9f/pZ5fj7/XV19UdsyHLu3LCS9nA=; b=OIAEx94T1trGa6B/uwt7XPO1VcATiZKbaIpOmnQ0Bs6skENTiHDDimhqI/MXChGiE6 PrGAFw27i5NMXLYHHPqOQ0EphlfYYYYwGEEIDNx14+AhGlJytdufNLHRbHuP8W4ieF/M /6yBhMD9loTXkDgfoPQTVo5gy8gjxp2tm/1MxAQC/tlrLsxNM5LsjE9uxhp7g9ir2L6S k69a4yYrV2WD8CyCIAECzowiP5fnEX9+loedALJEPOJ5wG/ueuOHoAEJ7dD008fk+rRv 52etVYM1CKu9LBuNxsern1bVXHjBinDreJYbAeSo1tWhkZhqaUrSNhEiQEYE79GHeyIl anAA== X-Gm-Message-State: ACrzQf0zrlZA9UibHRM1h6l374loBGEI5+71CsBfOydvCyzdbp5ns2I/ Nzm6bx30ekXNfpoL1c8btA0= X-Google-Smtp-Source: AMsMyM65k0kqAmsV/VNWtQLmZP3BGeV2rNI/SdTWqQGjKPP5iHV3e2uPi5i36pJo5s2LFJ0Ek0NkPA== X-Received: by 2002:a2e:a591:0:b0:26f:c3c7:be64 with SMTP id m17-20020a2ea591000000b0026fc3c7be64mr2153259ljp.97.1667077081878; Sat, 29 Oct 2022 13:58:01 -0700 (PDT) Received: from WBEC325.dom.lan ([2001:470:64f7:0:8ecc:c731:ca18:6cf7]) by smtp.gmail.com with ESMTPSA id c3-20020ac24143000000b00494a603953dsm436867lfi.89.2022.10.29.13.58.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Oct 2022 13:58:01 -0700 (PDT) From: Pawel Dembicki To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Gregory Clement , Andrew Lunn , Adam Baker , Tony Dinh Cc: Pawel Dembicki Subject: [PATCH v2] ARM: dts: kirkwood: Add Zyxel NSA310S board Date: Sat, 29 Oct 2022 22:57:38 +0200 Message-Id: <20221029205738.4187010-1-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221029_135804_752186_BC88E45D X-CRM114-Status: GOOD ( 14.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Pawel Dembicki Acked-by: Adam Baker Reviewed-by: Andrew Lunn --- Changes in v2: - added MIT licence option (With Adam and Tony approval) - regulators are written in 'new' way arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/kirkwood-nsa310s.dts | 259 +++++++++++++++++++++++++ 2 files changed, 260 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..888c82ebd5d8 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts @@ -0,0 +1,259 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * ZyXEL NSA310S Board Description + * Copyright 2020-2022 Pawel Dembicki + * Copyright (c) 2015-2021, Tony Dinh + * Copyright (c) 2014, Adam Baker + * Based upon the board setup file created by Peter Schildmann + */ +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" +#include + +/ { + 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 = ; + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + }; + + copy { + label = "Copy Button"; + linux,code = ; + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "Reset Button"; + linux,code = ; + 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 = ; + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + + led-2 { + function = LED_FUNCTION_USB; + color = ; + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "usb-host"; + }; + + led-3 { + function = LED_FUNCTION_DISK; + color = ; + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "ata1"; + }; + + led-4 { + function = LED_FUNCTION_INDICATOR; + color = ; + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; + }; + + led-5 { + function = LED_FUNCTION_INDICATOR; + color = ; + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; + }; + + led-6 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-on"; + }; + + led-7 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + }; + + usb0_power: regulator@1 { + compatible = "regulator-fixed"; + 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"; + 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"; + }; + }; + }; + }; +}; + + +ð0 { + status = "okay"; + + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; + +&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"; +};