From patchwork Mon Jul 16 20:56:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 944591 X-Patchwork-Delegate: openwrt@kresin.me Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rLuwiycw"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gkC0xWaj"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Twhd4fWNz9s0n for ; Tue, 17 Jul 2018 06:57:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iCz5IeJHbEDL4t+OnPtvqVzaCO4B3pTC7MNiK6Hy6mo=; b=rLuwiycwozvGG5Dd7ArBJ07OoT yeWhRGoGZaSP5Wk/2PnZHHLXI0dtH0z+RIp8rS3+798shR59meMfYf4mNUbpApWoOOs8Oii7DnVKB pc5DukOfxjqyVL3gfKZFH499ePVE88Y+q3VLVutXMH7QVbOiM20bROqPsTC2qJHu2u6wisrSkphcW APtX5LE99i2ghzWnpNvgEQ4Q+/8axpRN+BkXpC+1pMdCOAEH2SD+bSdtvPC0sAiq9K13QkBrtv/AG OPWXaRw4N0oLuP4A+zCmJsMc7vqO0PI6CUEh4WYMNn5KKknOKcvndX+zRTxEijckCV526qtWBXlBh 8yy+OAIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffAYV-0006lC-Ks; Mon, 16 Jul 2018 20:57:15 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ffAYG-0006ME-3R for openwrt-devel@lists.openwrt.org; Mon, 16 Jul 2018 20:57:05 +0000 Received: by mail-wr1-x42f.google.com with SMTP id c4-v6so20566811wrs.12 for ; Mon, 16 Jul 2018 13:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=POMGGuzBPO03LlnsNArbkruaqWx9UTsoIcd02aH+NhE=; b=gkC0xWajqR3OmN2cpbgQn5/eG3ic2aMKLMvKY13gBZfTqaoNkiC3Gz/RMSVQEd9eKA ZxoD2BRwKY8hXeSHXSayORhOYT/dHcXksyKShwPdQytpd+tlvbw4+fTcengvwMIjF0SI LAMBqKDK65xkCbh383zPk5iw95kl9l4dzjb+kbUipMY4Ft2pc8BG1Lsy2wG0wvXf0GmY dbhdZc1G1t1r1E8bjRyoHz+XjP2KpY7OXU2vFI9wXGtav5TQ1VMuqN10PoLT9snNzMQv +Ghcyhj6LWLYwrYFm/kfHJ9omJgWksvnjKT0vWIE+4kxP2GFbM8JB61Rp9SYdI+gCzl8 pDNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=POMGGuzBPO03LlnsNArbkruaqWx9UTsoIcd02aH+NhE=; b=Tka8zKP9itAjAGojKCXOPbsSCAtcE3veh/0fwLtB6EWf2SoZ5dUUfAJ2kogHInQ+z8 3pR0br7QWXsgv/DsmsLLiHw80gJNKl4Vimxm7Cj4P3G8bfquhMRqu6ybQwRSe6Znx7SG u8AR7IhkuGdo3squ5b91gPJKchEuCPh5kwiRfuuzmwGikGuip0mocVlUtmw4a2IzsBzy kLMcfv88+ZF3BbhYEYCpr5S+wSENQ490ZJbeuEQiNdzUnmZw6H8Ch/kJFxmA4LgoGluN exNRFGTuisF3dz4ltq2bQrtuLsi6PimM+EETKSCHO2L2Quw/Fd40dgmXFI4jsEJ2303z wH3g== X-Gm-Message-State: AOUpUlFmRByD0quQDK0sJyoV7m8GvCCosyR5kwND3y6shsScWeuebxFI vDxVVbHgzkJQ2PZAWV9dU54M8h4f X-Google-Smtp-Source: AAOMgpdnDKM1A9BPxk0LYAyh3tH3nOHMtwtetyoscYVh+5QOyf/OjfO/VhwVpNKy+lLh6UCwBxN6AQ== X-Received: by 2002:a5d:4701:: with SMTP id y1-v6mr13075009wrq.107.1531774608097; Mon, 16 Jul 2018 13:56:48 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC2DEFC0000000000000C3C.dip0.t-ipconnect.de. [2003:d5:fbc2:defc::c3c]) by smtp.gmail.com with ESMTPSA id r18-v6sm4203987wmh.28.2018.07.16.13.56.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Jul 2018 13:56:47 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.91) (envelope-from ) id 1ffAXy-0005fK-0a for openwrt-devel@lists.openwrt.org; Mon, 16 Jul 2018 22:56:42 +0200 From: Christian Lamparter To: openwrt-devel@lists.openwrt.org Date: Mon, 16 Jul 2018 22:56:36 +0200 Message-Id: <20180716205636.21726-3-chunkeey@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716205636.21726-1-chunkeey@gmail.com> References: <20180716205636.21726-1-chunkeey@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180716_135700_287981_F1E72565 X-CRM114-Status: GOOD ( 15.51 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42f listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH][for master] apm821xx: unify My Book Live Single + Duo images X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org By takimata: "Come to think of it, an MBL Single board boots up just fine on an MBL Duo image, and the MBL Single board identifies completely identical to the MBL Duo (Board: Apollo-3G - APM82181 Board, 2*SATA, 1*USB). I wonder if there is any downside to just using the MBL Duo firmware on a MBL Single. I wonder if the two firmwares could even be unified." Signed-off-by: Christian Lamparter --- target/linux/apm821xx/dts/apollo3g.dtsi | 189 ------------------ .../linux/apm821xx/dts/wd-mybooklive-duo.dts | 38 ---- target/linux/apm821xx/dts/wd-mybooklive.dts | 183 ++++++++++++++++- target/linux/apm821xx/image/Makefile | 23 +-- 4 files changed, 187 insertions(+), 246 deletions(-) delete mode 100644 target/linux/apm821xx/dts/apollo3g.dtsi delete mode 100644 target/linux/apm821xx/dts/wd-mybooklive-duo.dts diff --git a/target/linux/apm821xx/dts/apollo3g.dtsi b/target/linux/apm821xx/dts/apollo3g.dtsi deleted file mode 100644 index e88973f8d2..0000000000 --- a/target/linux/apm821xx/dts/apollo3g.dtsi +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2008 DENX Software Engineering, Stefan Roese - * (c) Copyright 2010 Western Digital Technologies, Inc. All Rights Reserved. - * - * 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. - */ - -#include "apm82181.dtsi" - -/ { - compatible = "amcc,apollo3g"; - - aliases { - serial0 = &UART0; - led-boot = &status; - led-failsafe = &status; - led-running = &status; - led-upgrade = &status; - }; -}; - -&POB0 { - ebc { - nor_flash@0,0 { - status = "okay"; - compatible = "amd,s29gl512n", "jedec-probe", "cfi-flash", "mtd-rom"; - bank-width = <1>; - reg = <0x00000000 0x00000000 0x00080000>; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - /* Part of bootrom - Don't use it without a jump */ - label = "free"; - reg = <0x00000000 0x0001e000>; - }; - - partition@1 { - label = "env"; - reg = <0x0001e000 0x00002000>; - }; - - partition@2 { - label = "uboot"; - reg = <0x00020000 0x00050000>; - }; - }; - }; - - GPIO1: gpio1@e0000000 { - compatible = "wd,mbl-gpio", "ti,74273"; - reg-names = "dat"; - reg = <0xe0000000 0x1>; - #gpio-cells = <2>; - gpio-controller; - - enable-phy { - /* toggle to reset EMAC PHY */ - gpio-hog; - line-name = "enable EMAC PHY"; - gpios = <0 GPIO_ACTIVE_LOW>; - output-low; - }; - - enable-button { - /* Defined in u-boot as: NOT_NOR - * "enables features other than NOR - * specifically, the buffer at CS2" - * (button). - * - * Note: This option is disabled as - * it prevents the system from being - * rebooted successfully. - */ - - gpio-hog; - line-name = "Enable Reset Button, disable NOR"; - gpios = <1 GPIO_ACTIVE_HIGH>; - output-low; - }; - - enable-usb { - gpio-hog; - line-name = "Power USB Core"; - gpios = <2 GPIO_ACTIVE_LOW>; - output-low; - status = "disabled"; - }; - - enable-port1 { - gpio-hog; - line-name = "Power Drive Port 1"; - gpios = <3 GPIO_ACTIVE_LOW>; - output-low; - }; - - enable-port0 { - gpio-hog; - line-name = "Power Drive Port 0"; - gpios = <7 GPIO_ACTIVE_LOW>; - output-low; - status = "disabled"; - }; - }; - - GPIO2: gpio2@e0100000 { - compatible = "wd,mbl-gpio", "ti,74244"; - reg-names = "dat"; - reg = <0xe0100000 0x1>; - #gpio-cells = <2>; - gpio-controller; - no-output; - }; - - gpio-leds { - compatible = "gpio-leds"; - - failsafe: power-red { - label = "mbl:red:power"; - gpios = <&GPIO1 4 GPIO_ACTIVE_HIGH>; - linux,default-trigger = "panic"; - }; - - status: power-green { - label = "mbl:green:power"; - gpios = <&GPIO1 5 GPIO_ACTIVE_HIGH>; - }; - - power-blue { - label = "mbl:blue:power"; - gpios = <&GPIO1 6 GPIO_ACTIVE_HIGH>; - }; - }; - - gpio_keys_polled { - compatible = "gpio-keys-polled"; - #address-cells = <1>; - #size-cells = <0>; - poll-interval = <60>; /* 3 * 20 = 60ms */ - autorepeat; - - button@1 { - label = "Reset button"; - linux,code = ; - gpios = <&GPIO2 2 GPIO_ACTIVE_LOW>; - }; - }; -}; - -&CRYPTO { - status = "okay"; -}; - -&PKA { - status = "okay"; -}; - -&TRNG { - status = "okay"; -}; - -&SATA1 { - status = "okay"; -}; - -&UART0 { - status = "okay"; -}; - -&EMAC0 { - status = "okay"; - - phy-map = <0x2>; - phy-address = <0x1>; - phy-handle = <&phy>; - - mdio { - phy: phy@1 { - compatible = "ethernet-phy-ieee802.3-c22"; - reg = <1>; - }; - }; -}; - -&SATA1 { - status = "okay"; -}; diff --git a/target/linux/apm821xx/dts/wd-mybooklive-duo.dts b/target/linux/apm821xx/dts/wd-mybooklive-duo.dts deleted file mode 100644 index 4f6cc506f5..0000000000 --- a/target/linux/apm821xx/dts/wd-mybooklive-duo.dts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Device Tree Source for AMCC Canyonlands (460EX) - * - * Copyright 2008 DENX Software Engineering, Stefan Roese - * (c) Copyright 2010 Western Digital Technologies, Inc. All Rights Reserved. - * - * 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. - */ - -/dts-v1/; - -#include "apollo3g.dtsi" - -/ { - compatible = "wd,mybooklive-duo", "amcc,apollo3g"; - model = "MyBook Live Duo"; -}; - -&SATA0 { - status = "okay"; -}; - -&USBOTG0 { - status = "okay"; - dr_mode = "host"; -}; - -&GPIO1 { - enable-usb { - status = "okay"; - }; - - enable-port0 { - status = "okay"; - }; -}; diff --git a/target/linux/apm821xx/dts/wd-mybooklive.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts index d841352292..aee0d3266d 100644 --- a/target/linux/apm821xx/dts/wd-mybooklive.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -9,9 +9,190 @@ /dts-v1/; -#include "apollo3g.dtsi" +#include "apm82181.dtsi" / { compatible = "wd,mybooklive", "amcc,apollo3g"; model = "MyBook Live"; + + aliases { + serial0 = &UART0; + led-boot = &status; + led-failsafe = &status; + led-running = &status; + led-upgrade = &status; + }; +}; + +&POB0 { + ebc { + nor_flash@0,0 { + status = "okay"; + compatible = "amd,s29gl512n", "jedec-probe", "cfi-flash", "mtd-rom"; + bank-width = <1>; + reg = <0x00000000 0x00000000 0x00080000>; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + /* Part of bootrom - Don't use it without a jump */ + label = "free"; + reg = <0x00000000 0x0001e000>; + }; + + partition@1 { + label = "env"; + reg = <0x0001e000 0x00002000>; + }; + + partition@2 { + label = "uboot"; + reg = <0x00020000 0x00050000>; + }; + }; + }; + + GPIO1: gpio1@e0000000 { + compatible = "wd,mbl-gpio", "ti,74273"; + reg-names = "dat"; + reg = <0xe0000000 0x1>; + #gpio-cells = <2>; + gpio-controller; + + enable-phy { + /* toggle to reset EMAC PHY */ + gpio-hog; + line-name = "enable EMAC PHY"; + gpios = <0 GPIO_ACTIVE_LOW>; + output-low; + }; + + enable-button { + /* Defined in u-boot as: NOT_NOR + * "enables features other than NOR + * specifically, the buffer at CS2" + * (button). + * + * Note: This option is disabled as + * it prevents the system from being + * rebooted successfully. + */ + + gpio-hog; + line-name = "Enable Reset Button, disable NOR"; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-low; + }; + + enable-usb { + gpio-hog; + line-name = "Power USB Core"; + gpios = <2 GPIO_ACTIVE_LOW>; + output-low; + }; + + enable-port1 { + gpio-hog; + line-name = "Power Drive Port 1"; + gpios = <3 GPIO_ACTIVE_LOW>; + output-low; + }; + + enable-port0 { + gpio-hog; + line-name = "Power Drive Port 0"; + gpios = <7 GPIO_ACTIVE_LOW>; + output-low; + }; + }; + + GPIO2: gpio2@e0100000 { + compatible = "wd,mbl-gpio", "ti,74244"; + reg-names = "dat"; + reg = <0xe0100000 0x1>; + #gpio-cells = <2>; + gpio-controller; + no-output; + }; + + gpio-leds { + compatible = "gpio-leds"; + + failsafe: power-red { + label = "mbl:red:power"; + gpios = <&GPIO1 4 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "panic"; + }; + + status: power-green { + label = "mbl:green:power"; + gpios = <&GPIO1 5 GPIO_ACTIVE_HIGH>; + }; + + power-blue { + label = "mbl:blue:power"; + gpios = <&GPIO1 6 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio_keys_polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <60>; /* 3 * 20 = 60ms */ + autorepeat; + + reset-button { + label = "Reset button"; + linux,code = ; + gpios = <&GPIO2 2 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&EMAC0 { + status = "okay"; + + phy-map = <0x2>; + phy-address = <0x1>; + phy-handle = <&phy>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy: phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; +}; + +&CRYPTO { + status = "okay"; +}; + +&PKA { + status = "okay"; +}; + +&TRNG { + status = "okay"; +}; + +&SATA0 { + status = "okay"; +}; + +&SATA1 { + status = "okay"; +}; + +&UART0 { + status = "okay"; +}; + +&USBOTG0 { + status = "okay"; + dr_mode = "host"; }; diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 1e94a40918..9d9c0e5ace 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -214,7 +214,11 @@ define Build/hdd-img ./mbl_gen_hdd_img.sh $@ $@.boot $(IMAGE_ROOTFS) endef -define Device/MyBookLiveDefault +define Device/wd_mybooklive + DEVICE_TITLE := Western Digital My Book Live Series (Single + Duo) + DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-mini + DEVICE_DTS := wd-mybooklive + SUPPORTED_DEVICES += mbl wd_mybooklive-duo IMAGE_SIZE := 48m BLOCKSIZE := 1k DTB_SIZE := 16384 @@ -228,25 +232,8 @@ define Device/MyBookLiveDefault IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip | append-metadata endef -define Device/wd_mybooklive -$(Device/MyBookLiveDefault) - DEVICE_TITLE := Western Digital My Book Live - DEVICE_DTS := wd-mybooklive - SUPPORTED_DEVICES += mbl -endef - TARGET_DEVICES += wd_mybooklive -define Device/wd_mybooklive-duo -$(Device/MyBookLiveDefault) - DEVICE_TITLE := Western Digital My Book Live Duo - DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-mini - DEVICE_DTS := wd-mybooklive-duo - SUPPORTED_DEVICES += mbl -endef - -TARGET_DEVICES += wd_mybooklive-duo - endif $(eval $(call BuildImage))