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: 855949 X-Patchwork-Delegate: jagannadh.teki@gmail.com 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YnSwfRDJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zCc7223gVz9s7F for ; Fri, 5 Jan 2018 18:41:34 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id D3DECC21E11; Fri, 5 Jan 2018 07:39:36 +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-Google-Smtp-Source: ACJfBou00WHfauEybOrQqNyidBGZsDHma55sMNo8KQYE8Urz82Y1xm1do+TyydZl6z1o1bVf6Ul5xQ== 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