From patchwork Mon Aug 14 10:36:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 9898507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 66D10602D9 for ; Mon, 14 Aug 2017 10:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 565F0285E7 for ; Mon, 14 Aug 2017 10:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AD0D285F1; Mon, 14 Aug 2017 10:37:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D7A52285E7 for ; Mon, 14 Aug 2017 10:37:47 +0000 (UTC) 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:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=s0QW0beYsaGhTgEjz8HWz2cSbQHtHWQFeqe0kFSNQBE=; b=JsA DeNYBCl/fCjskh9I1DA7EiBkpc5pCcxM1LXIx++HII3TUfFXDHgl1Nom2s2ypqBV9HFjR3HvHWLCO PFIfCoGBpkMPDucD/lXCFrhwCF2OA4/0icHQnuDeYUN+xHRrT03g76IPAa155pnN7wTGwjntZyr8I KOUNyY2guj1Uqo1hznWLKJCSlnbCOkyABCeT0yrGgDG+1SaPeucvToa9ZkawjCvAq6Hl1ZAv5PT0R ZFk2AtrPQYKMUPPM/DSyQ5wCYwbF7LxMx0gCWQLDM2DUNV0Ffij6YhZu7gjRUrOcWSgLzwq21tpm8 W4uiKUxL8jCrcqroTFi2dOwaBSOeUsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dhCkh-0006Ft-Hd; Mon, 14 Aug 2017 10:37:43 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhCkd-0006CZ-9m for linux-arm-kernel@lists.infradead.org; Mon, 14 Aug 2017 10:37:41 +0000 Received: by mail-pg0-x244.google.com with SMTP id 123so10026005pga.5 for ; Mon, 14 Aug 2017 03:37:18 -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; bh=V8eATIPCDY/Eva0JJ6S+lsz+gIOLUVJZlZCJU7+DMAo=; b=rHl8RN0qXJVjGbDkc/wZyEOFfUEnLS230UOkS4uIYuqzMaST8a+F9Qav5e8wd9Kv4L bmz9hPdl8TNg8zK/jC7cyAxgnageCAoVor9rOSm6c9Xc+tMCvjej7OkwMk5nF7OnQBjD 0XmoD/Qg2YpUS8GjXAZGfU6OPL1pgzK2CySbvamf14SBtOkJUt9ibW+LUNNrJ2haTh7G OAabDKp7w2sO4wGacokZkKyKdRAEXVNVS7juaBtqIZOsC+MczUIObgRl18jXJDF6VzL2 A1GFx9RMFyfC/xByNSM2U7BG6Zo70tNBxGkZQh4l2PzfmFFqUxMGU6jQcpOX0dP0BsD3 vDCQ== 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; bh=V8eATIPCDY/Eva0JJ6S+lsz+gIOLUVJZlZCJU7+DMAo=; b=MSwzeYn36PHoXpFcim9hrzLsF+J4ASn2kH69ySjVTt8OR2Z+haVskk3utgoABpQRNB jauIGbgp6Ool0ctZS4lP9Uo9FhrgX1tIZhsgJ8N+hhEDiwDJ3lIfVmPBTkE5B5gmaroS HiR2W1PrgOpajU8y4YkcU0Y2e9W6jsZ/DVHClHqTAECwCdldtXXOWEJEKVEvdEwq5pIY djcWDntSRf7FYj99/faTR9dfQhPxJJwdjs6/Hl66rqg1A8zR0RV1IpWSeA7oYobrCGdJ rqob0W0tbj6u86uOWpqSv8hkZZvZZ6I+sodRqrRIQr9g4gAqMgHJDsZRRwZcKFHmdT/P gyFw== X-Gm-Message-State: AHYfb5gQ44lWHL/xZrAXzgi7axpG9PgqI34VaDIGR0yhZ7C4TdetaSmT rX7kX4WzzKDySnN4ADQ= X-Received: by 10.98.204.136 with SMTP id j8mr24464576pfk.275.1502707036855; Mon, 14 Aug 2017 03:37:16 -0700 (PDT) Received: from localhost.localdomain ([27.63.93.134]) by smtp.gmail.com with ESMTPSA id g2sm12183261pgu.86.2017.08.14.03.37.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Aug 2017 03:37:15 -0700 (PDT) From: Jagan Teki X-Google-Original-From: Jagan Teki To: Maxime Ripard Subject: [PATCH v6] arm64: allwinner: a64: Add initial NanoPi A64 support Date: Mon, 14 Aug 2017 16:06:53 +0530 Message-Id: <1502707013-16422-1-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170814_033739_380181_70222403 X-CRM114-Status: GOOD ( 17.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Catalin Marinas , linux-sunxi@googlegroups.com, Will Deacon , linux-kernel@vger.kernel.org, yftan , Chen-Yu Tsai , Rob Herring , Jagan Teki , Michael Trimarchi , linux-arm-kernel@lists.infradead.org, Icenowy Zheng MIME-Version: 1.0 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 From: Jagan Teki NanoPi A64 is a new board of high performance with low cost designed by FriendlyElec., using the Allwinner A64 SOC. Nanopi A64 features - Allwinner A64, 64-bit Quad-core Cortex-A53@648MHz to 1.152GHz, DVFS - 1GB DDR3 RAM - MicroSD - Gigabit Ethernet (RTL8211E) - Wi-Fi 802.11b/g/n - IR receiver - Audio In/Out - Video In/Out - Serial Debug Port - microUSB 5V 2A DC power-supply Signed-off-by: Jagan Teki --- Changes for v6: - Moved uart0 below regulators - Add comment for i2c1 - Update vdd-cpux volt range 1.04 ~ 1.3 V - ehci0 detection https://paste.ubuntu.com/25311593/ - Remove space before usbphy - Removed unused DLD02 - Add comment for DLD01 regulator-name to vcc-dsi since it's connected along with vcc-hdmi - Add regulator node for DLD04 for vcc-pg Changes for v5: - Add AXP803 PMIC regulator support. Changes for v4: - Rebased and droped wi-fi related nodes, since it require other changes to taken care. Changes for v3: - Fix to use mmc1 for SDIO instead of mmc2 - Replace buswidth by 4 instead of 8 mmc1 - Drop cap-mmc-hw-reset for mmc1 Changes for v2: - Added ohci0, ehci0, ohic1, ehci1, usbphy. - Tested on A64 arch/arm64/boot/dts/allwinner/Makefile | 1 + .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 209 +++++++++++++++++++++ 2 files changed, 210 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile index 108f12c..c997b5c 100644 --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile @@ -1,4 +1,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts new file mode 100644 index 0000000..c2bbc75 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2017 Jagan Teki + * + * 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 library 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 library 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 "sun50i-a64.dtsi" + +#include + +/ { + model = "FriendlyARM NanoPi A64"; + compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +/* i2c1 connected with gpio headers like pine64, bananapi */ +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "okay"; +}; + +&i2c1_pins { + bias-pull-up; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_dcdc1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp803.dtsi" + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-3v"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1040000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vcc-dram"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + /* Same used for vcc-dsi */ + regulator-name = "vcc-hdmi"; +}; + +®_dldo4 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + /* Same used for vdd_wifi-io */ + regulator-name = "vcc-pg"; +}; + +®_eldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "cpvdd"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +/* + * The A64 chip cannot work without this regulator off, although + * it seems to be only driving the AR100 core. + * Maybe we don't still know well about CPUs domain. + */ +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usbphy { + status = "okay"; +};