From patchwork Thu May 17 09:45:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 915280 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="auPikyH/"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40mmkg3vhCz9s1B for ; Thu, 17 May 2018 19:50:19 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 364FEC21E76; Thu, 17 May 2018 09:50:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 395D7C21EA8; Thu, 17 May 2018 09:46:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BDE7AC21E1E; Thu, 17 May 2018 09:46:27 +0000 (UTC) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by lists.denx.de (Postfix) with ESMTPS id 54942C21E60 for ; Thu, 17 May 2018 09:46:22 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id q22-v6so1826043pff.11 for ; Thu, 17 May 2018 02:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZawSJajMdcJ6l+kTaDRI02GmsEw2ykP2VpZwcCqu0s0=; b=auPikyH/DgG5vsYJIuyrSUY88O9+owhEvF0CIO2PQIY/n0rkRvcGldI1xBXTPyLPUu AYpZ3I1SRC50TqUYFCQxwjapzg5z2saH0PJe74ihY/tce7MQ4ZRW3XTHT3VZDLmlVKGI XI1t1Gsn2vi+nko6cK3I3RvgFZikwTsGDFaNrfQ3sR2Gk+TQYZlQ1COZEQZpRRJDqR63 eDvxD5wP5IMz5DglP4b/6UQ0xmrz9S/sKPlgEr/hNWyEZ55HUghNEuGiqJwyjYpAI+qi OAjm8rQM/sfRVnwOfOEM49Uw6wk0z3qv7qxKNj7bBDpujQl+cggijO9vugzgzLlvL5ms g0Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZawSJajMdcJ6l+kTaDRI02GmsEw2ykP2VpZwcCqu0s0=; b=XrY2khqTg4cOEBlrzVAuQZmphErDNXG0tX8wsYBREVJeQeQM/X+tD7b8jqP5zDQ9mx ABTL548gTR8+dltso2OEUGDQcNthd3cBjTMwhTZIhcmaVNxIPVIC07LvzInmUE9ItxXF tjFs2PavbMZqdsi4ppiPB3vaqFsSbLICADUgxWJTPPquBlHPkq54MAUTjYJqlhlyS9nm UjFdD3oMndmMcxUG/TJeOOsd6SeZgyPCbjTPQ7o9pNpTsOxZOFs9DDdfqoqJHXdPDTWh QXkdiiQI8ShjkQCvORtHLgsTly1uzrQ5igXYMKWn7QuChOKyRF2y7Vp//+iiQ2tBEhrT xjbg== X-Gm-Message-State: ALKqPwd+pHRYM9ZkuRiY1qoVKWpsLJy+kYJaCzXGFtBI0OgfB3u4wtIz 42yV7d8aHsmg/7g8hPguQ0HCRF5J X-Google-Smtp-Source: AB8JxZo5S5DiDu+OW9Y5Lk3ytdLvHqjuZOxGaJK7JiysnIUFiaoYBkWvSuJWxJ0WVthuMROMHMghRQ== X-Received: by 2002:a63:9612:: with SMTP id c18-v6mr3534144pge.361.1526550380630; Thu, 17 May 2018 02:46:20 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id u16-v6sm9495759pfl.39.2018.05.17.02.46.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 May 2018 02:46:19 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Thu, 17 May 2018 21:45:56 +1200 Message-Id: <20180517094601.4816-2-judge.packham@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180517094601.4816-1-judge.packham@gmail.com> References: <20180517094601.4816-1-judge.packham@gmail.com> Cc: Luka Perkov , Prafulla Wadaskar , Chris Packham , Tom Rini Subject: [U-Boot] [PATCH 1/6] ARM: kirkwood: Add device-tree for d2net_v2 & net2big_v2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Import the dts files from Linux 4.17 and enable CONFIG_OF_CONTROL. Signed-off-by: Chris Packham --- arch/arm/dts/kirkwood-d2net.dts | 45 +++++ arch/arm/dts/kirkwood-net2big.dts | 63 +++++++ arch/arm/dts/kirkwood-netxbig.dtsi | 232 ++++++++++++++++++++++++ configs/d2net_v2_defconfig | 3 +- configs/net2big_v2_defconfig | 3 +- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 6 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 arch/arm/dts/kirkwood-d2net.dts create mode 100644 arch/arm/dts/kirkwood-net2big.dts create mode 100644 arch/arm/dts/kirkwood-netxbig.dtsi create mode 100644 include/dt-bindings/leds/leds-netxbig.h diff --git a/arch/arm/dts/kirkwood-d2net.dts b/arch/arm/dts/kirkwood-d2net.dts new file mode 100644 index 000000000000..bd3b266dd766 --- /dev/null +++ b/arch/arm/dts/kirkwood-d2net.dts @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree file for d2 Network v2 + * + * Copyright (C) 2014 Simon Guinot + * +*/ + +/dts-v1/; + +#include +#include "kirkwood-netxbig.dtsi" + +/ { + model = "LaCie d2 Network v2"; + compatible = "lacie,d2net_v2", "lacie,netxbig", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + ns2-leds { + compatible = "lacie,ns2-leds"; + + blue-sata { + label = "d2net_v2:blue:sata"; + slow-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; + cmd-gpio = <&gpio0 30 GPIO_ACTIVE_HIGH>; + modes-map = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + red-fail { + label = "d2net_v2:red:fail"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + }; +}; diff --git a/arch/arm/dts/kirkwood-net2big.dts b/arch/arm/dts/kirkwood-net2big.dts new file mode 100644 index 000000000000..3e3ac289e5b0 --- /dev/null +++ b/arch/arm/dts/kirkwood-net2big.dts @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree file for LaCie 2Big Network v2 + * + * Copyright (C) 2014 + * + * Andrew Lunn + * + * Based on netxbig_v2-setup.c, + * Copyright (C) 2010 Simon Guinot + * +*/ + +/dts-v1/; + +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" +#include "kirkwood-netxbig.dtsi" + +/ { + model = "LaCie 2Big Network v2"; + compatible = "lacie,net2big_v2", "lacie,netxbig", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + fan { + compatible = "gpio-fan"; + alarm-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; + }; +}; + +®ulators { + regulator@2 { + compatible = "regulator-fixed"; + reg = <2>; + regulator-name = "hdd1power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>; + }; + + clocks { + g762_clk: g762-oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + }; +}; + +&i2c0 { + g762@3e { + compatible = "gmt,g762"; + reg = <0x3e>; + clocks = <&g762_clk>; + }; +}; diff --git a/arch/arm/dts/kirkwood-netxbig.dtsi b/arch/arm/dts/kirkwood-netxbig.dtsi new file mode 100644 index 000000000000..135ac8021c8c --- /dev/null +++ b/arch/arm/dts/kirkwood-netxbig.dtsi @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree common file for LaCie 2Big and 5Big Network v2 + * + * Copyright (C) 2014 + * + * Andrew Lunn + * + * Based on netxbig_v2-setup.c, + * Copyright (C) 2010 Simon Guinot + * +*/ + +#include +#include "kirkwood.dtsi" +#include "kirkwood-6281.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + stdout-path = &uart0; + }; + + ocp@f1000000 { + serial@12000 { + status = "okay"; + }; + + spi@10600 { + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mxicy,mx25l4005a", "jedec,spi-nor", "spi-flash"; + reg = <0>; + spi-max-frequency = <20000000>; + mode = <0>; + + partition@0 { + reg = <0x0 0x80000>; + label = "u-boot"; + }; + }; + }; + + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + /* + * esc and power represent a three position rocker + * switch. Thus the conventional KEY_POWER does not fit + */ + exc { + label = "Back power switch (on|auto)"; + linux,code = ; + linux,input-type = <5>; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + power { + label = "Back power switch (auto|off)"; + linux,code = ; + linux,input-type = <5>; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + }; + option { + label = "Function button"; + linux,code = ; + gpios = <&gpio1 2 GPIO_ACTIVE_LOW>; + }; + + }; + + gpio-poweroff { + compatible = "gpio-poweroff"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + }; + + regulators: regulators { + status = "okay"; + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + + regulator@1 { + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "hdd0power"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + regulator-always-on; + regulator-boot-on; + gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>; + }; + }; + + netxbig_gpio_ext: netxbig-gpio-ext { + compatible = "lacie,netxbig-gpio-ext"; + + addr-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH + &gpio1 16 GPIO_ACTIVE_HIGH + &gpio1 17 GPIO_ACTIVE_HIGH>; + data-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH + &gpio1 13 GPIO_ACTIVE_HIGH + &gpio1 14 GPIO_ACTIVE_HIGH>; + enable-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; + }; + + netxbig-leds { + compatible = "lacie,netxbig-leds"; + + gpio-ext = <&netxbig_gpio_ext>; + + timers = ; + + blue-power { + label = "netxbig:blue:power"; + mode-addr = <0>; + mode-val = ; + bright-addr = <1>; + max-brightness = <7>; + }; + red-power { + label = "netxbig:red:power"; + mode-addr = <0>; + mode-val = ; + bright-addr = <1>; + max-brightness = <7>; + }; + blue-sata0 { + label = "netxbig:blue:sata0"; + mode-addr = <3>; + mode-val = ; + bright-addr = <2>; + max-brightness = <7>; + }; + red-sata0 { + label = "netxbig:red:sata0"; + mode-addr = <3>; + mode-val = ; + bright-addr = <2>; + max-brightness = <7>; + }; + blue-sata1 { + label = "netxbig:blue:sata1"; + mode-addr = <4>; + mode-val = ; + bright-addr = <2>; + max-brightness = <7>; + }; + red-sata1 { + label = "netxbig:red:sata1"; + mode-addr = <4>; + mode-val = ; + bright-addr = <2>; + max-brightness = <7>; + }; + }; +}; + +&mdio { + status = "okay"; + + ethphy0: ethernet-phy@0 { + reg = <8>; + }; + + ethphy1: ethernet-phy@1 { + reg = <0>; + }; +}; + +ð0 { + status = "okay"; + ethernet0-port@0 { + phy-handle = <ðphy0>; + }; +}; + +&pinctrl { + pinctrl-names = "default"; + + pmx_button_function: pmx-button-function { + marvell,pins = "mpp34"; + marvell,function = "gpio"; + }; + pmx_button_power_off: pmx-button-power-off { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + pmx_button_power_on: pmx-button-power-on { + marvell,pins = "mpp13"; + marvell,function = "gpio"; + }; +}; + +&i2c0 { + status = "okay"; + + eeprom@50 { + compatible = "atmel,24c04"; + pagesize = <16>; + reg = <0x50>; + }; +}; diff --git a/configs/d2net_v2_defconfig b/configs/d2net_v2_defconfig index 72db1e74a0aa..d054c21780c3 100644 --- a/configs/d2net_v2_defconfig +++ b/configs/d2net_v2_defconfig @@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y CONFIG_SYS_TEXT_BASE=0x600000 CONFIG_TARGET_NET2BIG_V2=y CONFIG_IDENT_STRING=" D2 v2" +CONFIG_DEFAULT_DEVICE_TREE="kirkwood-d2net" CONFIG_SYS_EXTRA_OPTIONS="D2NET_V2" CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y @@ -26,6 +27,7 @@ CONFIG_CMD_FAT=y CONFIG_ISO_PARTITION=y CONFIG_EFI_PARTITION=y # CONFIG_PARTITION_UUIDS is not set +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_MVSATA_IDE=y # CONFIG_MMC is not set @@ -39,4 +41,3 @@ CONFIG_KIRKWOOD_SPI=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y -CONFIG_OF_LIBFDT=y diff --git a/configs/net2big_v2_defconfig b/configs/net2big_v2_defconfig index d486e4cd7bd2..e7216556be92 100644 --- a/configs/net2big_v2_defconfig +++ b/configs/net2big_v2_defconfig @@ -3,6 +3,7 @@ CONFIG_KIRKWOOD=y CONFIG_SYS_TEXT_BASE=0x600000 CONFIG_TARGET_NET2BIG_V2=y CONFIG_IDENT_STRING=" 2Big v2" +CONFIG_DEFAULT_DEVICE_TREE="kirkwood-net2big" CONFIG_SYS_EXTRA_OPTIONS="NET2BIG_V2" CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y @@ -26,6 +27,7 @@ CONFIG_CMD_FAT=y CONFIG_ISO_PARTITION=y CONFIG_EFI_PARTITION=y # CONFIG_PARTITION_UUIDS is not set +CONFIG_OF_CONTROL=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_MVSATA_IDE=y # CONFIG_MMC is not set @@ -39,4 +41,3 @@ CONFIG_KIRKWOOD_SPI=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y -CONFIG_OF_LIBFDT=y diff --git a/include/dt-bindings/leds/leds-netxbig.h b/include/dt-bindings/leds/leds-netxbig.h new file mode 100644 index 000000000000..92658b0310b2 --- /dev/null +++ b/include/dt-bindings/leds/leds-netxbig.h @@ -0,0 +1,18 @@ +/* + * This header provides constants for netxbig LED bindings. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef _DT_BINDINGS_LEDS_NETXBIG_H +#define _DT_BINDINGS_LEDS_NETXBIG_H + +#define NETXBIG_LED_OFF 0 +#define NETXBIG_LED_ON 1 +#define NETXBIG_LED_SATA 2 +#define NETXBIG_LED_TIMER1 3 +#define NETXBIG_LED_TIMER2 4 + +#endif /* _DT_BINDINGS_LEDS_NETXBIG_H */