From patchwork Sat Nov 30 15:13:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 3260591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C6248BEEAD for ; Sat, 30 Nov 2013 15:15:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D9DC20465 for ; Sat, 30 Nov 2013 15:15:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8C9220211 for ; Sat, 30 Nov 2013 15:15:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VmmFy-0004wW-MT; Sat, 30 Nov 2013 15:14:54 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VmmFw-00029z-71; Sat, 30 Nov 2013 15:14:52 +0000 Received: from mic92-1-81-57-185-249.fbx.proxad.net ([81.57.185.249] helo=smtp.natisbad.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VmmFt-00029d-Jp for linux-arm-kernel@lists.infradead.org; Sat, 30 Nov 2013 15:14:50 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 658B32C0C3F; Sat, 30 Nov 2013 16:14:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1385824466; bh=oYD8HQrJeSDgs5Mvoi/V32/tl36TZz8tb70UZvqF/OM=; h=From:To:Cc:Subject:Date; b=3vOgHyXRkHcHBTRAweEPUBhkgmvouukLImjiWZ41Ixd+x7CGkEbr5XR7JoWbrI5u5 FK9bRsQmzUdUTWGlhR4CBsFlEZraEOIPbTP9NQDSAYemJZ62+WKsoK5JeHT527gz0I azObCxJ4Csq07rjZ6r0LKOyRaGzZ4GtakgYGI3LM= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from small (localhost [127.0.0.1]) by smtp.natisbad.org (Postfix) with ESMTP id DBD782C00B1; Sat, 30 Nov 2013 16:13:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1385824426; bh=oYD8HQrJeSDgs5Mvoi/V32/tl36TZz8tb70UZvqF/OM=; h=From:To:Cc:Subject:Date; b=cQyU1dhxvyxgbbnUQIMopDCFLz7K/GZkaf0NCeNL5DWd3+pknIMk+70MxoeF3qyDf hg3GkZGc3Yj6WoKy2naEJTKRLujbR6qw6M2bHEp9fHpPPntvKfu70QNqM1kFmPhEIR APqNL6f8mZAjaMI5BBrVYr9PLxqj44jk/zqgPovU= X-Hashcash: 1:20:131130:jason@lakedaemon.net::2YIyTi3L0HnABbP1:000000000000000000000000000000000000000004DDB X-Hashcash: 1:20:131130:andrew@lunn.ch::f8EPfqVAaRC69jZa:0003Syo X-Hashcash: 1:20:131130:gregory.clement@free-electrons.com::CcRsjJRKHmOazxah:0000000000000000000000000000bB9 X-Hashcash: 1:20:131130:sebastian.hesselbarth@gmail.com::UcPqq88v1VvRCu0v:0000000000000000000000000000008FYj X-Hashcash: 1:20:131130:linux@arm.linux.org.uk::juqzNdAlGe4hHFce:00000000000000000000000000000000000000054lW X-Hashcash: 1:20:131130:linux-arm-kernel@lists.infradead.org::Jpo4ch+lznDrgyQF:000000000000000000000000094Su X-Hashcash: 1:20:131130:rob.herring@calxeda.com::5GKbSeMiDfCme4MK:000000000000000000000000000000000000006oT/ X-Hashcash: 1:20:131130:pawel.moll@arm.com::UYrHpuPKxVSHwsaF:00000000000000000000000000000000000000000000jUJ X-Hashcash: 1:20:131130:mark.rutland@arm.com::0Tz/yICOi/Z2kUR1:000000000000000000000000000000000000000004M+4 X-Hashcash: 1:20:131130:swarren@wwwdotorg.org::v6yeea7ommdWc9tG:000000000000000000000000000000000000000005oK X-Hashcash: 1:20:131130:ijc+devicetree@hellion.org.uk::hgpY3KAmuEuIbahO:000000000000000000000000000000000ie5 X-Hashcash: 1:20:131130:devicetree@vger.kernel.org::fWLBzVq1jykN7IF+:000000000000000000000000000000000003bhZ From: Arnaud Ebalard To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCHv0] ARM: kirkwood: Add support for NETGEAR ReadyNAS NV+ v2 Message-Id: <58e99356aad0daf90d28162eac6a4ecec70470f8.1385822676.git.arno@natisbad.org> Date: Sat, 30 Nov 2013 16:13:44 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131130_101449_988094_7564C895 X-CRM114-Status: GOOD ( 18.47 ) X-Spam-Score: -1.0 (-) Cc: Mark Rutland , devicetree@vger.kernel.org, Russell King , Pawel Moll , Stephen Warren , Ian Campbell , Rob Herring , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Almost all hardware parts of the NETGEAR ReadyNAS NV+ v2 ([1] for more details) are supported by mainline kernel. The only missing elements in provided .dts file are: - the front LCD module (Winstar WINSTAR WH1602): driver development is ongoing. This is the same LCD module as on ReadyNAS 104. - the Macronix MX25L512 512Kbit SPI flash: no time to play with it yet. The device is the big brother (4 vs 2 bay) of the ReadyNAS Duo v2. The main differences are some additional LEDs for the disks, a Marvell 88SM4140 SATA Port multiplier (no driver required to access the disk) and previously described LCD module. Otherwise, it shares the same SoC (kirkwood 88F6282), RAM (256MB), NAND (128MB), RTC chip (Ricoh rs5c372a), fan controller (GMT G762), XHCI controller (NEC/Renesas µPD720200). [1]: http://natisbad.org/NAS5/ Signed-off-by: Arnaud Ebalard --- Hi, This is v3.14 material. As most of the .dts file content can be shared w/ Duo v2 one, I intend to work on that aspect for next round (it was easier for me to develop and test on a flat .dts). To be more specific, the main differences between the two files are different GPIO values for gpio-leds nodes and pinctrl, and 2 additional LEDs. If you have comments or directions to avoid common mistakes while doing that work, I'll take them into account. Meanwhile, I will start and take a look at existing .dtsi files. Cheers, a+ arch/arm/boot/dts/Makefile | 1 + .../boot/dts/kirkwood-netgear_readynas_nv+_v2.dts | 270 +++++++++++++++++++++ 2 files changed, 271 insertions(+) create mode 100644 arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index d57c1a6..c9cd0e9 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -90,6 +90,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \ kirkwood-mplcec4.dtb \ kirkwood-mv88f6281gtw-ge.dtb \ kirkwood-netgear_readynas_duo_v2.dtb \ + kirkwood-netgear_readynas_nv+_v2.dtb \ kirkwood-ns2.dtb \ kirkwood-ns2lite.dtb \ kirkwood-ns2max.dtb \ diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts new file mode 100644 index 0000000..9cb5d26 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_nv+_v2.dts @@ -0,0 +1,270 @@ +/* + * Device Tree file for NETGEAR ReadyNAS NV+ v2 + * + * Copyright (C) 2013, Arnaud EBALARD + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/dts-v1/; + +#include +#include +#include "kirkwood.dtsi" +#include "kirkwood-6282.dtsi" + +/ { + model = "NETGEAR ReadyNAS NV+ v2"; + compatible = "netgear,readynas-nv+-v2", "netgear,readynas", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + + memory { /* 256 MB */ + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + }; + + mbus { + pcie-controller { + status = "okay"; + + /* Connected to NEC uPD720200 USB 3.0 controller */ + pcie@1,0 { + /* Port 0, Lane 0 */ + status = "okay"; + }; + }; + }; + + ocp@f1000000 { + pinctrl: pinctrl@10000 { + pmx_button_power: pmx-button-power { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + + pmx_button_backup: pmx-button-backup { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + + pmx_button_reset: pmx-button-reset { + marvell,pins = "mpp13"; + marvell,function = "gpio"; + }; + + pmx_led_blue_power: pmx-led-blue-power { + marvell,pins = "mpp31"; + marvell,function = "gpio"; + }; + + pmx_led_blue_backup: pmx-led-blue-backup { + marvell,pins = "mpp22"; + marvell,function = "gpio"; + }; + + pmx_led_blue_disk1: pmx-led-blue-disk1 { + marvell,pins = "mpp20"; + marvell,function = "gpio"; + }; + + pmx_led_blue_disk2: pmx-led-blue-disk2 { + marvell,pins = "mpp23"; + marvell,function = "gpio"; + }; + + pmx_led_blue_disk3: pmx-led-blue-disk3 { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + pmx_led_blue_disk4: pmx-led-blue-disk4 { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + + pmx_poweroff: pmx-poweroff { + marvell,pins = "mpp30"; + marvell,function = "gpio"; + }; + }; + + clocks { + g762_clk: g762-oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <8192>; + }; + }; + + i2c@11000 { + status = "okay"; + + rs5c372a: rs5c372a@32 { + compatible = "ricoh,rs5c372a"; + reg = <0x32>; + }; + + g762: g762@3e { + compatible = "gmt,g762"; + reg = <0x3e>; + clocks = <&g762_clk>; /* input clock */ + fan_gear_mode = <0>; + fan_startv = <1>; + pwm_polarity = <0>; + }; + }; + + serial@12000 { + pinctrl-0 = <&pmx_uart0>; + pinctrl-names = "default"; + status = "okay"; + }; + + sata@80000 { /* Connected to Marvell 88SM4140 SATA port multiplier */ + status = "okay"; + nr-ports = <1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = < &pmx_led_blue_power &pmx_led_blue_backup + &pmx_led_blue_disk1 &pmx_led_blue_disk2 + &pmx_led_blue_disk3 &pmx_led_blue_disk3 >; + pinctrl-names = "default"; + + power_led { + label = "status:blue:power_led"; + gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; + linux,default-trigger = "default-on"; + }; + + backup_led { + label = "status:blue:backup_led"; + gpios = <&gpio0 22 GPIO_ACTIVE_LOW>; + }; + + disk1_led { + label = "status:blue:disk1_led"; + gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + }; + + disk2_led { + label = "status:blue:disk2_led"; + gpios = <&gpio0 23 GPIO_ACTIVE_LOW>; + }; + + disk3_led { + label = "status:blue:disk3_led"; + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; + }; + + disk4_led { + label = "status:blue:disk4_led"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-0 = <&pmx_button_power &pmx_button_backup + &pmx_button_reset>; + pinctrl-names = "default"; + + power-button { + label = "Power Button"; + linux,code = ; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + reset-button { + label = "Reset Button"; + linux,code = ; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + backup-button { + label = "Backup Button"; + linux,code = ; + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-poweroff { + compatible = "gpio-poweroff"; + pinctrl-0 = <&pmx_poweroff>; + pinctrl-names = "default"; + gpios = <&gpio0 30 GPIO_ACTIVE_LOW>; + }; + + regulators { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + + usb3_regulator: usb3-regulator { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "USB 3.0 Power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&nand { + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x180000>; + read-only; + }; + + partition@180000 { + label = "u-boot-env"; + reg = <0x180000 0x20000>; + }; + + partition@200000 { + label = "uImage"; + reg = <0x0200000 0x600000>; + }; + + partition@800000 { + label = "minirootfs"; + reg = <0x0800000 0x1000000>; + }; + + partition@1800000 { + label = "jffs2"; + reg = <0x1800000 0x6800000>; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { /* Marvell 88E1318 */ + device_type = "ethernet-phy"; + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +};