From patchwork Mon Oct 21 21:02:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ebalard X-Patchwork-Id: 3079571 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 232549F2B7 for ; Mon, 21 Oct 2013 21:04:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E7E0203A8 for ; Mon, 21 Oct 2013 21:04:14 +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 BE3DD20233 for ; Mon, 21 Oct 2013 21:04:12 +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 1VYMdl-0000Jl-KP; Mon, 21 Oct 2013 21:03:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VYMdj-0003nb-5E; Mon, 21 Oct 2013 21:03:51 +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 1VYMdf-0003n5-J4 for linux-arm-kernel@lists.infradead.org; Mon, 21 Oct 2013 21:03:48 +0000 Received: by smtp.natisbad.org (Postfix, from userid 5001) id 3DD472C074E; Mon, 21 Oct 2013 23:03:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1382389405; bh=dUz62pUW1HIxOkip9Xc/Mc4V9OuisIGhg0TA//YEPU4=; h=From:To:Cc:Subject:Date; b=gXalu7rYvcCTV5M3LJUXS21ijwBEhKkiUhwNx6HBTCeFdFo/JzhUoRzDZ3RHOAHu1 UPRgC63V8KwD/AlR+ZFgv0XzAo150M55Mtu6U+UakT3SkPC8RBIxubZpR11VayoBty BLDdtxzb00OLzyF84td8QPCk8vDNmWVIP18BUh+M= X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from small (localhost [127.0.0.1]) by smtp.natisbad.org (Postfix) with ESMTP id 978422C05FE; Mon, 21 Oct 2013 23:02:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=natisbad.org; s=mail; t=1382389372; bh=dUz62pUW1HIxOkip9Xc/Mc4V9OuisIGhg0TA//YEPU4=; h=From:To:Cc:Subject:Date; b=MsmzW52IpgPvxLyu1PxvG2ZJISAxClkVX+4Q4Ivg4/NfdhAGUoI1n4z83uzatqQ/e X/uQp19xpuH1r7DDfew3B/0pnggVTfu2SlnnS7//Y1wgQY2kqSyfMT43uQKu+syLyT QSyYEydWudJD13nXOQl5FPXkDn3oIVK/g7r8NX94= X-Hashcash: 1:20:131021:jason@lakedaemon.net::5Vf8b/1FwkXW4LGo:0000000000000000000000000000000000000000031NF X-Hashcash: 1:20:131021:andrew@lunn.ch::w8YrNSzn0bNHkPx0:0001fOT X-Hashcash: 1:20:131021:gregory.clement@free-electrons.com::MtjUEV0FNTXani2+:0000000000000000000000000003TuE X-Hashcash: 1:20:131021:sebastian.hesselbarth@gmail.com::IdiWnWSPW4keTnCD:0000000000000000000000000000002mxY X-Hashcash: 1:20:131021:linux-arm-kernel@lists.infradead.org::RBeo/lPXLOJ16232:000000000000000000000000012rM X-Hashcash: 1:20:131021:rob.herring@calxeda.com::fYw6U2tO11JW7baD:00000000000000000000000000000000000000BOyL X-Hashcash: 1:20:131021:pawel.moll@arm.com::WL5HYf14bQdRZU9r:00000000000000000000000000000000000000000002d24 X-Hashcash: 1:20:131021:mark.rutland@arm.com::Z7Yx+6QCoBkqKUo4:0000000000000000000000000000000000000000005uN X-Hashcash: 1:20:131021:swarren@wwwdotorg.org::AA0UNQmwwO31cJsV:00000000000000000000000000000000000000001cAs X-Hashcash: 1:20:131021:ijc+devicetree@hellion.org.uk::OKiHV5oY+pZ4OTQM:0000000000000000000000000000000021al X-Hashcash: 1:20:131021:linux@arm.linux.org.uk::ZSfLGRuMTFw4Nx0u:000000000000000000000000000000000000000GJJN X-Hashcash: 1:20:131021:devicetree@vger.kernel.org::UbT+iJylC9g6n7O1:000000000000000000000000000000000002h+d From: arno@natisbad.org (Arnaud Ebalard) To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth Subject: [PATCH] ARM: mvebu: Add Netgear ReadyNAS 104 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: Mon, 21 Oct 2013 23:02:51 +0200 Message-ID: <87txgapcas.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-20131021_170347_985060_8F072A17 X-CRM114-Status: GOOD ( 19.27 ) X-Spam-Score: -1.0 (-) Cc: Mark Rutland , devicetree@vger.kernel.org, Russell King , Pawel Moll , Ian Campbell , Stephen Warren , 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 Main hardware parts of the (Armada 370 based) NETGEAR ReadyNAS 104 are supported by mainline kernel (USB 3.0 rear ports, USB 2.0 front port, Gigabit controller and PHYs, serial port, LEDs, buttons, SATA ports, G762 fan controller) and referenced in provided .dts file. Some additonal work remains for: - Intersil ISL12057 I2C RTC and Alarm chip: working driver but needs to be splitted for submission of RTC part first; - Front LCD (Winstar 1602G): driver needs to be written - Armada NAND controller (to access onboard 128MB of NAND): support being pushed by @free-electrons people - 4 front SATA LEDs controlled via GPIO brought by NXP PCA9554: driver is available upstream. Not referenced/tested yet. but the device is usable w/o those. Signed-off-by: Arnaud Ebalard --- Jason and Andrew, I do not think there is any good way to share much between RN102 and RN104 .dts in a common .dtsi file because MPP are used in a different fashion on the two boards. But if you have ideas ... I do intend to document the hardware parts and setup of the device as I did for the Duo v2 and RN102 but I wanted to get the patch submitted for inclusion in 3.13 first. Comments welcome, Cheers, a+ arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/armada-370-netgear-rn104.dts | 197 +++++++++++++++++++++++++ 2 files changed, 198 insertions(+) create mode 100644 arch/arm/boot/dts/armada-370-netgear-rn104.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 802720e..be682cb 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -108,6 +108,7 @@ dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ armada-370-mirabox.dtb \ armada-370-netgear-rn102.dtb \ + armada-370-netgear-rn104.dtb \ armada-370-rd.dtb \ armada-xp-axpwifiap.dtb \ armada-xp-db.dtb \ diff --git a/arch/arm/boot/dts/armada-370-netgear-rn104.dts b/arch/arm/boot/dts/armada-370-netgear-rn104.dts new file mode 100644 index 0000000..e3855e8 --- /dev/null +++ b/arch/arm/boot/dts/armada-370-netgear-rn104.dts @@ -0,0 +1,197 @@ +/* + * Device Tree file for NETGEAR ReadyNAS 104 + * + * 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-370.dtsi" + +/ { + model = "NETGEAR ReadyNAS 104"; + compatible = "netgear,readynas-104", "marvell,armada370", "marvell,armada-370-xp"; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk"; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x20000000>; /* 512 MB */ + }; + + soc { + ranges = ; + + pcie-controller { + status = "okay"; + + /* Connected to FL1009 USB 3.0 controller */ + pcie@1,0 { + /* Port 0, Lane 0 */ + status = "okay"; + }; + + /* Connected to Marvell 88SE9215 SATA controller */ + pcie@2,0 { + /* Port 1, Lane 0 */ + status = "okay"; + }; + }; + + internal-regs { + serial@12000 { + clock-frequency = <200000000>; + status = "okay"; + }; + + sata@a0000 { + status = "disabled"; + }; + + pinctrl { + poweroff: poweroff { + marvell,pins = "mpp60"; + marvell,function = "gpio"; + }; + + backup_key_pin: backup-key-pin { + marvell,pins = "mpp52"; + marvell,function = "gpio"; + }; + + power_key_pin: power-key-pin { + marvell,pins = "mpp62"; + marvell,function = "gpio"; + }; + + backup_led_pin: backup-led-pin { + marvell,pins = "mpp63"; + marvell,function = "gpo"; + }; + + power_led_pin: power-led-pin { + marvell,pins = "mpp64"; + marvell,function = "gpio"; + }; + + reset_key_pin: reset-key-pin { + marvell,pins = "mpp65"; + marvell,function = "gpio"; + }; + }; + + 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"; + }; + + usb@50000 { + status = "okay"; + }; + + i2c@11000 { + compatible = "marvell,mv64xxx-i2c"; + clock-frequency = <100000>; + status = "okay"; + + g762: g762@3e { + compatible = "gmt,g762"; + reg = <0x3e>; + clocks = <&g762_clk>; /* input clock */ + fan_gear_mode = <0>; + fan_startv = <1>; + pwm_polarity = <0>; + }; + }; + }; + }; + + clocks { + #address-cells = <1>; + #size-cells = <0>; + + g762_clk: fixedclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <8192>; + }; + }; + + gpio_leds { + compatible = "gpio-leds"; + pinctrl-0 = <&backup_led_pin &power_led_pin>; + pinctrl-names = "default"; + + blue_backup_led { + label = "rn104:blue:backup"; + gpios = <&gpio1 31 1>; /* GPIO 63 Active Low */ + default-state = "on"; + }; + + blue_power_led { + label = "rn104:blue:pwr"; + gpios = <&gpio2 0 1>; /* GPIO 64 Active Low */ + linux,default-trigger = "heartbeat"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&backup_key_pin + &power_key_pin + &reset_key_pin>; + pinctrl-names = "default"; + + button@1 { + label = "Backup Button"; + linux,code = <133>; /* KEY_COPY */ + gpios = <&gpio1 20 1>; + }; + + button@2 { + label = "Power Button"; + linux,code = <116>; /* KEY_POWER */ + gpios = <&gpio1 30 0>; + }; + + button@3 { + label = "Reset Button"; + linux,code = <0x198>; /* KEY_RESTART */ + gpios = <&gpio2 1 1>; + }; + }; + + gpio_poweroff { + compatible = "gpio-poweroff"; + pinctrl-0 = <&poweroff>; + pinctrl-names = "default"; + gpios = <&gpio1 28 1>; + }; +};