From patchwork Fri Jan 5 07:37:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 123480 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp493995qgn; Thu, 4 Jan 2018 23:41:26 -0800 (PST) X-Google-Smtp-Source: ACJfBou8mYjFlRHJOHtaVi72PcflF/GrdXJnrXoc+k41Oo4serzFGTo7He1NOed6X+Ijm3PwbBtu X-Received: by 10.80.182.55 with SMTP id b52mr2893651ede.112.1515138086634; Thu, 04 Jan 2018 23:41:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515138086; cv=none; d=google.com; s=arc-20160816; b=tIY75Aefw8Tbio58Pbcd0m86KIfrKaZYvAZCASDeOhIzxfjnVztwX6HnLMj1K1kSnS Iv1HdqT9Xpd46ZV7Qjw8c7l9C3jG7zyIHWAP8E/lTMR8GEQ09/Xa0ApTADljMYvHrEDR rbGcN08iS0bNoKu5JVKg8FHJYyhS+BrA+N0/1LR8NlE/99zaCdJ9Fhvfx2E1DGFrXezf kUpva7YkUPie5S0eQn6WS4iKJ005EZxSvxeJSrI5Uv/wsZXXjcoP11rrWeNKZcWxyV56 /Hgn3S41BT9IlTtu25yQt3ADicTTskzYKrN/phXGYWwVT2falKJSPwmK4Yo8ZFnC4etg 4DzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=eGbzWqhN3j5nqAURoyVjkrO4YGS4BxD6cVXI8CczrK8=; b=mQSJIWj8rHF3MLPoHQP/OP2Z2/zLTrndz0UOscvSFxYJMrMOg77qF0kxpZnJjbMZ+T CI/Uck3CknQ/rEgWcLXOtTCaorR6mIFiMt1Px72zNQSdOEPqO6SQKTlUR7jZOeFlfGnH +EzW5uksgRcU4TSrU3RgjF5iykUXGt3P4vcUCc8gfn/93r+GJAomDC/u7YCo3HBHNHCs dCtjguV+f23tYFz3TNJNPMa5KuY+1cIonfZ9KN6T00r02LI2SAemmGHAh7Hg7czJFR7i Z07D06zpblxIDousG6stQQ9sJOszKtL4+cOAvw1XIPXwSgXB/O52bHteqg52/zuU1n0G cmNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YnSwfRDJ; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id h38si4002890ede.369.2018.01.04.23.41.26; Thu, 04 Jan 2018 23:41:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YnSwfRDJ; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 424A9C21E06; Fri, 5 Jan 2018 07:39:34 +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=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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 C02C0C21E14; Fri, 5 Jan 2018 07:39:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4912AC21DF0; Fri, 5 Jan 2018 07:38:12 +0000 (UTC) Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by lists.denx.de (Postfix) with ESMTPS id 51274C21E24 for ; Fri, 5 Jan 2018 07:38:08 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id bd8so2639291plb.9 for ; Thu, 04 Jan 2018 23:38:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GfUJICeP89NwMktJbbPtysrYbMtGJR95aLbrL9pXg80=; b=YnSwfRDJAuzwaTQuHxhtpfC4lY3it92jiZUVcs57j6Z1ZSU5/1FcPx2pFyei0P61uC c+f3qCvOmPwRzUAhIBJYSB5nqXGlejymmZD1K/EO+fUkQy7+zn88E98jb5I6TO/vaTcs M+h3yBmMsMgE/HGJuXSzOL+uxBox/xUFt8jdY= 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=GfUJICeP89NwMktJbbPtysrYbMtGJR95aLbrL9pXg80=; b=mKWUhpDmTELx4+uzzkD4vYiHs+gzssNtCAqr8g8ncn/NySNl+uWAxkMwlRtvLarNCC B4ZJgJzta+cRqVtVsS2TIv/2D7ph/Petc4DDc5PVcqo3MySc3Y31A8LuYUhtz45bZERU BnlPQWqmPCf38NIwqo74gQigEat42GH7x9uOTeTIR0DFyQEH1YxVS4lDAV0FGmu4aTD1 1diDN+KHWQHi9vhGU8LZ9pVlqW1Jko3Wvl2IiSIKCcku92B8vnppJ8DCvUnKXuC9ri3s NcnANQRXbP6bG7YxDChTb5IQYCV4KnRdQ63rHxRBFvmwdKJH7YmfHG7clysbqbWd4kCL shiw== X-Gm-Message-State: AKGB3mL00cek9ccRST5ZN2P3Y/z6G24ARXzBf0zQF0sndvhOaqmiK5QY BZi9+w4ToYfx7nlnUcfVhA3ZMQ== X-Received: by 10.159.234.141 with SMTP id d13mr252124plr.74.1515137886974; Thu, 04 Jan 2018 23:38:06 -0800 (PST) Received: from localhost.localdomain ([45.56.153.113]) by smtp.gmail.com with ESMTPSA id b9sm9553789pgs.3.2018.01.04.23.37.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Jan 2018 23:38:05 -0800 (PST) From: Jun Nie To: wens@csie.org, maxime.ripard@free-electrons.com, hdegoede@redhat.com Date: Fri, 5 Jan 2018 15:37:01 +0800 Message-Id: <1515137821-30583-7-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> References: <1515137821-30583-1-git-send-email-jun.nie@linaro.org> Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 6/6] sunxi: Add initial Banana-Pi Zero support 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" Banana-Pi Zero is designed for IOT development using the Allwinner H2+ SOC. Key features - Allwinner H2+, Quad-core Cortex-A7 - 512MB DRAM - microSD slot - Serial Debug Port - Combo WiFi/BT - HDMI Signed-off-by: Jun Nie --- arch/arm/dts/Makefile | 1 + arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts | 113 ++++++++++++++++++++++++ configs/bananapi_zero_defconfig | 17 ++++ 3 files changed, 131 insertions(+) create mode 100644 arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts create mode 100644 configs/bananapi_zero_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index a895c70..80eec7e 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -327,6 +327,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ sun8i-a83t-cubietruck-plus.dtb \ sun8i-a83t-tbs-a711.dts dtb-$(CONFIG_MACH_SUN8I_H3) += \ + sun8i-h2-plus-bananapi-m2-zero.dtb \ sun8i-h2-plus-orangepi-zero.dtb \ sun8i-h3-bananapi-m2-plus.dtb \ sun8i-h3-orangepi-2.dtb \ diff --git a/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts new file mode 100644 index 0000000..4d96c16 --- /dev/null +++ b/arch/arm/dts/sun8i-h2-plus-bananapi-m2-zero.dts @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2017 Jun Nie + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file 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. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun8i-h3.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include +#include + +/ { + model = "Banana Pi BPI-M2-Zero"; + compatible = "sinovoip,bpi-m2-zero", "allwinner,sun8i-h2-plus"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + + pwr_led { + label = "bananapi-m2-zero:red:pwr"; + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */ + default-state = "on"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + + sw4 { + label = "power"; + linux,code = ; + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + /* + * In different revisions the board have different card detect + * configuration. + */ + broken-cd; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + /* USB OTG VBUS is directly connected to 5V without any regulators */ + status = "okay"; +}; diff --git a/configs/bananapi_zero_defconfig b/configs/bananapi_zero_defconfig new file mode 100644 index 0000000..9c78b21 --- /dev/null +++ b/configs/bananapi_zero_defconfig @@ -0,0 +1,17 @@ +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y +CONFIG_MACH_SUN8I_H3=y +CONFIG_DRAM_CLK=408 +CONFIG_DRAM_ZQ=3881979 +CONFIG_DRAM_ODT_EN=y +CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-bananapi-m2-zero" +# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set +CONFIG_SPL=y +# CONFIG_CMD_FLASH is not set +# CONFIG_CMD_FPGA is not set +CONFIG_CMD_USB_MASS_STORAGE=y +# CONFIG_SPL_DOS_PARTITION is not set +# CONFIG_SPL_ISO_PARTITION is not set +# CONFIG_SPL_EFI_PARTITION is not set +CONFIG_MMC_BROKEN_CD=y +CONFIG_USB_MUSB_GADGET=y