From patchwork Sat Nov 9 20:27:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 3164161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7D09F9F492 for ; Sat, 9 Nov 2013 20:29:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6780120233 for ; Sat, 9 Nov 2013 20:29:27 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0FB4D20237 for ; Sat, 9 Nov 2013 20:29:26 +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 1VfF9a-0001wH-4d; Sat, 09 Nov 2013 20:29:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfF9X-0004o7-QZ; Sat, 09 Nov 2013 20:29:07 +0000 Received: from [2a01:e35:139b:9f90:221:70ff:fe55:8f78] (helo=smtp.natisbad.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VfF9S-0004nJ-3X for linux-arm-kernel@lists.infradead.org; Sat, 09 Nov 2013 20:29:05 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 035952C0CCF; Sat, 9 Nov 2013 21:28:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1384028895; bh=KZ8sz+sQIzT7Zfd1I8NwUkCMwcdTbj/Uj838aohBMNE=; h=From:To:Cc:Subject:Date; b=3OtKr51ZLjT0jMsqluh3Oe5RlJ8+ulYOKuiYc8zSt+uNfja0VEfYpskPfgfyaJUF+ TOMlh2q/7trHrLKaxEozEkSXgiLku2vseS7cKPSeL05uEfjT1EJ2D43PZvOsmHYtCb 5NitvZHxJgOy0XyA0VuL1k71t9iC4uGKvcq5SWu8= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, KHOP_BIG_TO_CC,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 DD3B32C05C9; Sat, 9 Nov 2013 21:27:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1384028854; bh=KZ8sz+sQIzT7Zfd1I8NwUkCMwcdTbj/Uj838aohBMNE=; h=From:To:Cc:Subject:Date; b=yQUCkOSUpNzoJbOkEJzMuXXuXZKuPJbyY1oo4kfxmTMGCtQ1iFqyd9OSNVtWl1DtD FjSgyiztFwI/o2IRA4RkoFO7sI9gHCYx/WTf4XzW0jsvFLEgCe+TMZFXUNY6Uk98JC W3YEXAtpyn0wbAd6Ja8QeW7jZuRV1CWAj0er29CI= X-Hashcash: 1:20:131109:jason@lakedaemon.net::xaQ5Q9USPUNSefkk:000000000000000000000000000000000000000000I49 X-Hashcash: 1:20:131109:andrew@lunn.ch::G/lUsUiKw9/7AMhR:0007mte X-Hashcash: 1:20:131109:gregory.clement@free-electrons.com::rGPyM40UFjqIIQNp:0000000000000000000000000001w0P X-Hashcash: 1:20:131109:sebastian.hesselbarth@gmail.com::tDE72ciYhsC2THeG:0000000000000000000000000000000uXe X-Hashcash: 1:20:131109:ezequiel.garcia@free-electrons.com::ai4VILAV+Gqjx0/C:00000000000000000000000000082H6 X-Hashcash: 1:20:131109:thomas.petazzoni@free-electrons.com::MDAn5ZXTjQY3pApx:000000000000000000000000000hfY X-Hashcash: 1:20:131109:linux@arm.linux.org.uk::h8WlqPOAyUMT33X2:0000000000000000000000000000000000000009hRq X-Hashcash: 1:20:131109:linux-arm-kernel@lists.infradead.org::2+LxL21Ckyhl+K/c:000000000000000000000000008rl X-Hashcash: 1:20:131109:rob.herring@calxeda.com::yPjjNJ87weQkRsMS:000000000000000000000000000000000000000aQl X-Hashcash: 1:20:131109:pawel.moll@arm.com::dF5mrSNQ0Bd7CWEY:00000000000000000000000000000000000000000000kSn X-Hashcash: 1:20:131109:mark.rutland@arm.com::8kJrywjF7p5rw+es:000000000000000000000000000000000000000004SLE X-Hashcash: 1:20:131109:swarren@wwwdotorg.org::zEqA6y4fB00l0kiO:00000000000000000000000000000000000000001wSY X-Hashcash: 1:20:131109:ijc+devicetree@hellion.org.uk::entPWTKuPKQ8GqjA:00000000000000000000000000000000219V X-Hashcash: 1:20:131109:devicetree@vger.kernel.org::hYJ+vdQCMuNDNThk:000000000000000000000000000000000000BOt X-Hashcash: 1:20:131109:linux@roeck-us.net::F0Guae22+qU5YeDQ:000000000000000000000000000000000000000000017MN From: arno@natisbad.org (Arnaud Ebalard) To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Ezequiel Garcia , Thomas Petazzoni Subject: [PATCH] ARM: mvebu: Add Netgear ReadyNAS 2120 board X-PGP-Key-URL: http://natisbad.org/arno@natisbad.org.asc X-Fingerprint: D3A5 B68A 839B 38A5 815A 781B B77C 0748 A7AE 341B Date: Sat, 09 Nov 2013 21:27:32 +0100 Message-ID: <87bo1tmibv.fsf@natisbad.org> 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-20131109_152902_797659_8D842C63 X-CRM114-Status: GOOD ( 16.69 ) X-Spam-Score: -0.2 (/) Cc: Mark Rutland , devicetree@vger.kernel.org, Russell King , Pawel Moll , Stephen Warren , Ian Campbell , Rob Herring , Guenter Roeck , 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 All hardware parts of the (mv78230 Armada XP based) NETGEAR ReadyNAS 2120 are supported by mainline kernel (USB 3.0 and eSATA rear ports, USB 2.0 front port, Gigabit controller and PHYs for the two rear ports, serial port, LEDs, Buttons, 88SE9170 SATA controllers, three G762 fan controllers, G751 temperature sensor) except for: - the Intersil ISL12057 I2C RTC Chip, - the Armada NAND controller. Support for both of those is currently work in progress and does not prevent boot. Signed-off-by: Arnaud Ebalard --- Hi, This one is intended for v3.14. This depends on the recent fix I pushed for mv78230 PCIe and also on a small patch Guenter Roeck just accepted to have lm75 driver support GMT G751 Temperature sensor (see https://lkml.org/lkml/2013/11/9/273). Regarding the SATA presence and power pin definitions under pinctrl node if you wonder, I thought it would not harm to have them for reference even though they are currently not used. FWIW, I am currently looking if a GPIO regulator can make any use of those. Comments welcome, Cheers, a+ arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 289 +++++++++++++++++++++++++ 2 files changed, 290 insertions(+) create mode 100644 arch/arm/boot/dts/armada-xp-netgear-rn2120.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 802720e..c6dd4de 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -112,6 +112,7 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ armada-xp-axpwifiap.dtb \ armada-xp-db.dtb \ armada-xp-gp.dtb \ + armada-xp-netgear-rn2120.dtb \ armada-xp-openblocks-ax3-4.dtb dtb-$(CONFIG_ARCH_MXC) += \ imx25-karo-tx25.dtb \ diff --git a/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts new file mode 100644 index 0000000..2651ba3 --- /dev/null +++ b/arch/arm/boot/dts/armada-xp-netgear-rn2120.dts @@ -0,0 +1,289 @@ +/* + * Device Tree file for NETGEAR ReadyNAS 2120 + * + * 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 "armada-xp-mv78230.dtsi" + +/ { + model = "NETGEAR ReadyNAS 2120"; + compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp"; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk"; + }; + + memory { + device_type = "memory"; + reg = <0 0x00000000 0 0x80000000>; /* 2GB */ + }; + + soc { + ranges = ; + + pcie-controller { + status = "okay"; + + /* Connected to first Marvell 88SE9170 SATA controller */ + pcie@1,0 { + /* Port 0, Lane 0 */ + status = "okay"; + }; + + /* Connected to second Marvell 88SE9170 SATA controller */ + pcie@2,0 { + /* Port 0, Lane 1 */ + status = "okay"; + }; + + /* Connected to Fresco Logic FL1009 USB 3.0 controller */ + pcie@5,0 { + /* Port 1, Lane 0 */ + status = "okay"; + }; + }; + + internal-regs { + pinctrl { + poweroff: poweroff { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + + power_key_pin: power-key-pin { + marvell,pins = "mpp27"; + marvell,function = "gpio"; + }; + + reset_key_pin: reset-key-pin { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + + sata1_led_pin: sata1-led-pin { + marvell,pins = "mpp31"; + marvell,function = "gpio"; + }; + + sata2_led_pin: sata2-led-pin { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + + sata3_led_pin: sata3-led-pin { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + + sata4_led_pin: sata4-led-pin { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + + sata1_power_pin: sata1-power-pin { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + + sata2_power_pin: sata2-power-pin { + marvell,pins = "mpp25"; + marvell,function = "gpio"; + }; + + sata3_power_pin: sata3-power-pin { + marvell,pins = "mpp26"; + marvell,function = "gpio"; + }; + + sata4_power_pin: sata4-power-pin { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + + sata1_pres_pin: sata1-pres-pin { + marvell,pins = "mpp32"; + marvell,function = "gpio"; + }; + + sata2_pres_pin: sata2-pres-pin { + marvell,pins = "mpp33"; + marvell,function = "gpio"; + }; + + sata3_pres_pin: sata3-pres-pin { + marvell,pins = "mpp34"; + marvell,function = "gpio"; + }; + + sata4_pres_pin: sata4-pres-pin { + marvell,pins = "mpp35"; + marvell,function = "gpio"; + }; + + err_led_pin: err-led-pin { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + }; + + serial@12000 { + clock-frequency = <250000000>; + status = "okay"; + }; + + mdio { + phy0: ethernet-phy@0 { + reg = <0>; + }; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + }; + + ethernet@70000 { + status = "okay"; + phy = <&phy0>; + phy-mode = "rgmii-id"; + }; + + ethernet@74000 { + status = "okay"; + phy = <&phy1>; + phy-mode = "rgmii-id"; + }; + + /* Front USB 2.0 port */ + usb@50000 { + status = "okay"; + }; + + i2c@11000 { + compatible = "marvell,mv64xxx-i2c"; + clock-frequency = <400000>; + status = "okay"; + + /* Rear fan #1 of 3 (Protechnic MGT4012XB-O20, + * 8000RPM) near eSATA port */ + g762_fan1: g762@3e { + compatible = "gmt,g762"; + reg = <0x3e>; + clocks = <&g762_clk>; /* input clock */ + fan_gear_mode = <0>; + fan_startv = <1>; + pwm_polarity = <0>; + }; + + /* Rear fan #2 of 3 at the center */ + g762_fan2: g762@48 { + compatible = "gmt,g762"; + reg = <0x48>; + clocks = <&g762_clk>; /* input clock */ + fan_gear_mode = <0>; + fan_startv = <1>; + pwm_polarity = <0>; + }; + + /* Rear fan #3 of 3 */ + g762_fan3: g762@49 { + compatible = "gmt,g762"; + reg = <0x49>; + clocks = <&g762_clk>; /* input clock */ + fan_gear_mode = <0>; + fan_startv = <1>; + pwm_polarity = <0>; + }; + + g751: g751@4c { + compatible = "gmt,g751"; + reg = <0x4c>; + }; + }; + }; + }; + + clocks { + #address-cells = <1>; + #size-cells = <0>; + + g762_clk: fixedclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + }; + + gpio_leds { + compatible = "gpio-leds"; + pinctrl-0 = <&sata1_led_pin &sata2_led_pin &err_led_pin + &sata3_led_pin &sata4_led_pin>; + pinctrl-names = "default"; + + red_sata1_led { + label = "rn2120:red:sata1"; + gpios = <&gpio0 31 0>; /* GPIO 31 Active High */ + default-state = "off"; + }; + + red_sata2_led { + label = "rn2120:red:sata2"; + gpios = <&gpio1 8 0>; /* GPIO 40 Active High */ + default-state = "off"; + }; + + red_sata3_led { + label = "rn2120:red:sata3"; + gpios = <&gpio1 12 0>; /* GPIO 44 Active High */ + default-state = "off"; + }; + + red_sata4_led { + label = "rn2120:red:sata4"; + gpios = <&gpio1 15 0>; /* GPIO 47 Active High */ + default-state = "off"; + }; + + red_err_led { + label = "rn2120:red:err"; + gpios = <&gpio1 13 1>; /* GPIO 45 Active Low */ + default-state = "off"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&power_key_pin + &reset_key_pin>; + pinctrl-names = "default"; + + button@1 { + label = "Power Button"; + linux,code = <116>; /* KEY_POWER */ + gpios = <&gpio0 27 0>; + }; + + button@2 { + label = "Reset Button"; + linux,code = <0x198>; /* KEY_RESTART */ + gpios = <&gpio1 9 1>; + }; + }; + + gpio_poweroff { + compatible = "gpio-poweroff"; + pinctrl-0 = <&poweroff>; + pinctrl-names = "default"; + gpios = <&gpio1 10 1>; + }; +};