From patchwork Wed Mar 18 22:27:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1257832 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=WUVAa3Ah; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48jPpt2JD9z9sPF for ; Thu, 19 Mar 2020 09:29:26 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eYFx+zOpW87qPtVwZRrWnlbEvjHpNr58xD8cMEabgK4=; b=WUVAa3Ah6VEPs5 UUAg1E7r4sPunGPkAG7fT1TGLmCOAroySe4PcwzTydYRU6bAcvIRvxAyalWtvbO5ZFx7tgwfQHdVt zTcyJoBIHbBgLExY92glK3kVYsqFnap6s1DV5NntZRTyDqyecrfIhj+kwOxjcdekLbDjVNGMH/BSQ jQcwHAzfhsC2XtcLNtqxaBrf2fvuBkphK+txNf47yb0tT39k6ICslxKRKvQeXxj4SURiv8BwOXsR2 MYHQIXM4wR1Cos73mj4sfHMe/MkLJH7faOxwiDYd+NLCceYSL+VOQ6bvclPMmxgBhTbwy3+MvY1lM Gi51jJQBWraScTSInrKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEhBc-0000YF-G1; Wed, 18 Mar 2020 22:29:16 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEhA7-0006w4-Ox for openwrt-devel@lists.openwrt.org; Wed, 18 Mar 2020 22:27:46 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 4AD6D4C21; Wed, 18 Mar 2020 23:27:39 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 51f4872e; Wed, 18 Mar 2020 23:27:26 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Wed, 18 Mar 2020 23:27:11 +0100 Message-Id: <20200318222713.1495-8-ynezz@true.cz> In-Reply-To: <20200318222713.1495-1-ynezz@true.cz> References: <20200318222713.1495-1-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200318_152743_974534_1FF87757 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH 7/9] sunxi: a53: add support for Olimex A64-Olinuxino eMMC X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Specifications: SoC: Allwinner A64 (1.2 GHz Quad-Core ARM Cortex-A53 64-bit) RAM: 1GB or 2GB RAM DDR3L @ 672Mhz Flash: 0/4/16GB eMMC flash memory for storage and boot MicroSD card connector for cards up to 32GB Debug: serial UART debug header with 0.1" pins Wired connectivity: 10/100/1000Mbps GbE Ethernet Wireless connectivity: on-board RTL8723BS 1T1R 802.11bgn WiFi and Bluetooth 4.0 module with built-in antenna (only available in the A64-OLinuXino-1G4GW) Flashing instructions: Standard sunxi SD card installation procedure - copy eMMC image to SD card, insert in into SD card slot on the device and boot. You should see something like following if the eMMC is detected correctly: mmcblk2: mmc2:0001 P1XXXX 3.60 GiB mmcblk2boot0: mmc2:0001 P1XXXX partition 1 16.0 MiB mmcblk2boot1: mmc2:0001 P1XXXX partition 2 16.0 MiB Then flash SD card eMMC image straight into the mmcblk2 device: dd if=/mnt/openwrt...a64-olinuxino-emmc-squashfs-sdcard.img of=/dev/mmcblk2 It also possible to boot from boot0 partition[1]: 1. Compile U-Boot with CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x40 otherwise the U-Boot will get stuck in bootloop 2. Configure eMMC to boot from boot0 partition inside U-Boot: mmc bootbus 1 1 0 0; mmc partconf 1 1 1 0 3. echo 0 > /sys/block/mmcblk2boot0/force_ro 4. Write U-Boot from offset 0 (not offset 8k as with SD card) into boot0 partition dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk2boot0 Known issues: Wireless doesn't work properly via netifd. 1. https://linux-sunxi.org/index.php?title=Bootable_eMMC Signed-off-by: Petr Štetiar --- .../allwinner/sun50i-a64-olinuxino-emmc.dts | 25 +++++++++++++++++++ target/linux/sunxi/image/cortex-a53.mk | 10 ++++++++ ...ner-enable-sun50i-a64-olinuxino-emmc.patch | 25 +++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 target/linux/sunxi/files-4.19/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts create mode 100644 target/linux/sunxi/patches-4.19/410-arm64-dts-allwinner-enable-sun50i-a64-olinuxino-emmc.patch diff --git a/target/linux/sunxi/files-4.19/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts b/target/linux/sunxi/files-4.19/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts new file mode 100644 index 000000000000..efb20846de49 --- /dev/null +++ b/target/linux/sunxi/files-4.19/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2018 Martin Ayotte +// Copyright (C) 2019 Sunil Mohan Adapa + +#include "sun50i-a64-olinuxino.dts" + +/ { + model = "Olimex A64-Olinuxino-eMMC"; + compatible = "olimex,a64-olinuxino-emmc", "allwinner,sun50i-a64"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins>; + vmmc-supply = <®_dcdc1>; + vqmmc-supply = <®_eldo1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&pio { + vcc-pc-supply = <®_eldo1>; +}; diff --git a/target/linux/sunxi/image/cortex-a53.mk b/target/linux/sunxi/image/cortex-a53.mk index 96885cf92612..7a70de4dfff3 100644 --- a/target/linux/sunxi/image/cortex-a53.mk +++ b/target/linux/sunxi/image/cortex-a53.mk @@ -47,6 +47,16 @@ define Device/olimex_a64-olinuxino endef TARGET_DEVICES += olimex_a64-olinuxino +define Device/olimex_a64-olinuxino-emmc + DEVICE_VENDOR := Olimex + DEVICE_MODEL := A64-Olinuxino + DEVICE_VARIANT := eMMC + DEVICE_PACKAGES := kmod-rtl8723bs rtl8723bs-firmware + $(Device/sun50i-a64) + SUNXI_DTS := $$(SUNXI_DTS_DIR)$$(SOC)-olinuxino-emmc +endef +TARGET_DEVICES += olimex_a64-olinuxino-emmc + define Device/pine64_pine64-plus DEVICE_VENDOR := Pine64 DEVICE_MODEL := Pine64+ diff --git a/target/linux/sunxi/patches-4.19/410-arm64-dts-allwinner-enable-sun50i-a64-olinuxino-emmc.patch b/target/linux/sunxi/patches-4.19/410-arm64-dts-allwinner-enable-sun50i-a64-olinuxino-emmc.patch new file mode 100644 index 000000000000..e2c9abe707bd --- /dev/null +++ b/target/linux/sunxi/patches-4.19/410-arm64-dts-allwinner-enable-sun50i-a64-olinuxino-emmc.patch @@ -0,0 +1,25 @@ +From 95610cc341e7fd577d7cd04a5afa091b548582a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Wed, 18 Mar 2020 23:09:06 +0100 +Subject: [PATCH] arm64: dts: allwinner: enable sun50i-a64-olinuxino-emmc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Štetiar +--- + arch/arm64/boot/dts/allwinner/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile +index 9ffa7a038791..c2f9c316e0e5 100644 +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -3,6 +3,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-amarula-relic.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino-emmc.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-pinebook.dtb