[OpenWrt-Devel,5/9] sunxi: add support for pine64 lts
diff mbox series

Message ID 20190114175429.7320-6-oskari@lemmela.net
State New
Delegated to: Hauke Mehrtens
Headers show
Series
  • sunxi: add support for pine64-lts
Related show

Commit Message

Oskari Lemmelä Jan. 14, 2019, 5:54 p.m. UTC
CPU: R18 High Performance Quad-core 64-bit Cortex-A53
GPU: Mali400MP2 OpenGL ES 2.0/1.1/1.0, OpenVG 1.1, EGL
Memory: 2GB LPDDR3 (shared with GPU)
Onboard Storage: TF card / NOR flash(16MB)
Onboard Network: 1000M/100M Ethernet RJ45

Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
---
 package/boot/uboot-sunxi/Makefile             |  9 +++
 .../010-sunxi-A64-Add-Pine64-LTS-board.patch  | 69 +++++++++++++++++++
 ...ner-sun50i-a64-Add-spi-flash-node-fo.patch | 64 +++++++++++++++++
 target/linux/sunxi/image/Makefile             |  4 ++
 target/linux/sunxi/image/cortex-a53.mk        | 13 ++++
 ...ner-a64-Add-Pine64-LTS-device-tree-f.patch | 59 ++++++++++++++++
 ...ner-a64-Add-Pine64-LTS-device-tree-f.patch | 59 ++++++++++++++++
 7 files changed, 277 insertions(+)
 create mode 100644 package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
 create mode 100644 package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
 create mode 100644 target/linux/sunxi/patches-4.14/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
 create mode 100644 target/linux/sunxi/patches-4.19/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch

Comments

Petr Štetiar Jan. 14, 2019, 7:03 p.m. UTC | #1
Oskari Lemmela <oskari@lemmela.net> [2019-01-14 19:54:25]:

Hi,

> CPU: R18 High Performance Quad-core 64-bit Cortex-A53
> GPU: Mali400MP2 OpenGL ES 2.0/1.1/1.0, OpenVG 1.1, EGL
> Memory: 2GB LPDDR3 (shared with GPU)
> Onboard Storage: TF card / NOR flash(16MB)
> Onboard Network: 1000M/100M Ethernet RJ45

can you please add flashing instructions here?

From https://openwrt.org/submitting-patches

"If you add support for new hardware: Include in your commit message a short
description of the hardware and how to install OpenWrt on it. Have a look at
the recent additions for some examples."

> +  IMAGES += sysupgrade.bin u-boot-with-spl.bin
> +  IMAGE/u-boot-with-spl.bin := sunxi-uboot | check-size 896k

Please use ARTIFACTS[1] for u-boot-with-spl.bin image.

1. https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=493c9a35516c27a8ec412d97e63c8cf6f41a57ea

-- ynezz
Oskari Lemmelä Jan. 15, 2019, 4:46 p.m. UTC | #2
Hi,

On 14.1.2019 21.03, Petr Štetiar wrote:
> Oskari Lemmela <oskari@lemmela.net> [2019-01-14 19:54:25]:
>
> Hi,
>
>> CPU: R18 High Performance Quad-core 64-bit Cortex-A53
>> GPU: Mali400MP2 OpenGL ES 2.0/1.1/1.0, OpenVG 1.1, EGL
>> Memory: 2GB LPDDR3 (shared with GPU)
>> Onboard Storage: TF card / NOR flash(16MB)
>> Onboard Network: 1000M/100M Ethernet RJ45
> can you please add flashing instructions here?
>
> From https://openwrt.org/submitting-patches
>
> "If you add support for new hardware: Include in your commit message a short
> description of the hardware and how to install OpenWrt on it. Have a look at
> the recent additions for some examples."
Here is flashing instructions which I added to commit message:


    Flash instruction:
    1. Uncompress sdcard.img.gz image and write it to SD-card
       $ zcat <openwrt-sdcard-image> | dd of=/dev/sdX bs=1M
    2. Connect ethernet cable and boot Pine64 LTS with SD-card
    3. Copy u-boot-with-spl.bin to 192.168.1.1:/tmp
    4. Write u-boot image to the SPI flash
       $ mtd write <u-boot-with-spl-image> /dev/mtd0
    5. Copy squashfs-sysupgrade.bin image to 192.168.1.1:/tmp
    6. Run sysupgrade to copy the image and current configuration
       to the SPI flash
       $ sysupgrade <sysupgrade-image>

>> +  IMAGES += sysupgrade.bin u-boot-with-spl.bin
>> +  IMAGE/u-boot-with-spl.bin := sunxi-uboot | check-size 896k
> Please use ARTIFACTS[1] for u-boot-with-spl.bin image.
Thanks, I did not notice this one. Already updated commit to use it.
> 1. https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=493c9a35516c27a8ec412d97e63c8cf6f41a57ea
>
> -- ynezz

Oskari

Patch
diff mbox series

diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
index 59aa4f0277..b904e166f9 100644
--- a/package/boot/uboot-sunxi/Makefile
+++ b/package/boot/uboot-sunxi/Makefile
@@ -196,6 +196,14 @@  define U-Boot/nanopi_neo2
   UENV:=a64
 endef
 
+define U-Boot/pine64-lts
+  BUILD_SUBTARGET:=cortexa53
+  NAME:=Pine64 LTS
+  BUILD_DEVICES:=sun50i-a64-pine64-lts
+  DEPENDS:=+PACKAGE_u-boot-pine64_lts:arm-trusted-firmware-sunxi
+  UENV:=a64
+endef
+
 define U-Boot/pine64_plus
   BUILD_SUBTARGET:=cortexa53
   NAME:=Pine64 Plus A64
@@ -259,6 +267,7 @@  UBOOT_TARGETS := \
 	orangepi_2 \
 	orangepi_pc2 \
 	pangolin \
+	pine64-lts \
 	pine64_plus \
 	sopine_baseboard \
 	orangepi_zero_plus
diff --git a/package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch b/package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
new file mode 100644
index 0000000000..3e5655ca5e
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/010-sunxi-A64-Add-Pine64-LTS-board.patch
@@ -0,0 +1,69 @@ 
+From 00ca215fe639051b3880821438949569691a2efc Mon Sep 17 00:00:00 2001
+From: Andre Przywara <andre.przywara@arm.com>
+Date: Mon, 29 Oct 2018 00:56:50 +0000
+Subject: [PATCH] sunxi: A64: Add Pine64-LTS board
+
+The Pine64 LTS is an updated version of the Pine64, copying the
+technical updates from the SoPine platform: LPDDR3 DRAM, eMMC socket and
+soldered SPI flash chip, even the broken SD card detect pin has been copied.
+Consequently this leads to the .dts (copied from the kernel) just including
+the SoPine baseboard .dts, and the defconfig being almost identical.
+Nevertheless the boards deserves a separate config.
+
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
+Reviewed-by: Jagan Teki <jagan@openedev.com>
+---
+ arch/arm/dts/sun50i-a64-pine64-lts.dts | 13 +++++++++++++
+ configs/pine64-lts_defconfig           | 19 +++++++++++++++++++
+ 2 files changed, 32 insertions(+)
+ create mode 100644 arch/arm/dts/sun50i-a64-pine64-lts.dts
+ create mode 100644 configs/pine64-lts_defconfig
+
+diff --git a/arch/arm/dts/sun50i-a64-pine64-lts.dts b/arch/arm/dts/sun50i-a64-pine64-lts.dts
+new file mode 100644
+index 0000000000..72d6961dc3
+--- /dev/null
++++ b/arch/arm/dts/sun50i-a64-pine64-lts.dts
+@@ -0,0 +1,13 @@
++/*
++ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++ *
++ * Copyright (c) 2018 ARM Ltd.
++ */
++
++#include "sun50i-a64-sopine-baseboard.dts"
++
++/ {
++	model = "Pine64 LTS";
++	compatible = "pine64,pine64-lts", "allwinner,sun50i-r18",
++		     "allwinner,sun50i-a64";
++};
+diff --git a/configs/pine64-lts_defconfig b/configs/pine64-lts_defconfig
+new file mode 100644
+index 0000000000..fd3cdeec85
+--- /dev/null
++++ b/configs/pine64-lts_defconfig
+@@ -0,0 +1,19 @@
++CONFIG_ARM=y
++CONFIG_ARCH_SUNXI=y
++CONFIG_SPL=y
++CONFIG_MACH_SUN50I=y
++CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
++CONFIG_DRAM_CLK=552
++CONFIG_DRAM_ZQ=3881949
++CONFIG_MMC0_CD_PIN=""
++CONFIG_MMC_SUNXI_SLOT_EXTRA=2
++CONFIG_SPL_SPI_SUNXI=y
++CONFIG_NR_DRAM_BANKS=1
++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
++# CONFIG_CMD_FLASH is not set
++# CONFIG_SPL_DOS_PARTITION is not set
++# CONFIG_SPL_EFI_PARTITION is not set
++CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-lts"
++CONFIG_SUN8I_EMAC=y
++CONFIG_USB_EHCI_HCD=y
++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+-- 
+2.17.1
+
diff --git a/package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch b/package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
new file mode 100644
index 0000000000..7028aec555
--- /dev/null
+++ b/package/boot/uboot-sunxi/patches/073-arm64-dts-allwinner-sun50i-a64-Add-spi-flash-node-fo.patch
@@ -0,0 +1,64 @@ 
+From 2912beffaa0a84c27493e59d73e89845008b62d4 Mon Sep 17 00:00:00 2001
+From: Andre Przywara <andre.przywara@arm.com>
+Date: Mon, 29 Oct 2018 00:56:47 +0000
+Subject: [PATCH] sunxi: A64: Update .dts/.dtsi files
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Update the .dts/.dtsi file from the Linux sunxi/dt64-for-4.20 tree:
+commit 679294497be31596e1c9c61507746d72b6b05f26
+Author: Rodrigo Exterckötter Tjäder <rodrigo@tjader.xyz>
+Date:   Wed Sep 26 19:48:24 2018 +0000
+    arm64: dts: allwinner: a64: a64-olinuxino: set the PHY TX delay
+
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
+Reviewed-by: Jagan Teki <jagan@openedev.com>
+---
+ arch/arm/dts/sun50i-a64-sopine.dtsi | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/arch/arm/dts/sun50i-a64-sopine.dtsi b/arch/arm/dts/sun50i-a64-sopine.dtsi
+index 43418bd881..6723b8695e 100644
+--- a/arch/arm/dts/sun50i-a64-sopine.dtsi
++++ b/arch/arm/dts/sun50i-a64-sopine.dtsi
+@@ -45,6 +45,8 @@
+ 
+ #include "sun50i-a64.dtsi"
+ 
++#include <dt-bindings/gpio/gpio.h>
++
+ &mmc0 {
+ 	pinctrl-names = "default";
+ 	pinctrl-0 = <&mmc0_pins>;
+@@ -52,6 +54,7 @@
+ 	non-removable;
+ 	disable-wp;
+ 	bus-width = <4>;
++	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+ 	status = "okay";
+ };
+ 
+@@ -66,6 +69,18 @@
+ 	};
+ };
+ 
++&spi0  {
++	status = "okay";
++
++	flash@0 {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		compatible = "jedec,spi-nor";
++		reg = <0>;
++		spi-max-frequency = <40000000>;
++	};
++};
++
+ #include "axp803.dtsi"
+ 
+ &reg_aldo2 {
+-- 
+2.17.1
+
diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile
index b24cf70928..263d068c5d 100644
--- a/target/linux/sunxi/image/Makefile
+++ b/target/linux/sunxi/image/Makefile
@@ -26,6 +26,10 @@  define Build/sunxi-sdcard
 	rm -f $@.boot
 endef
 
+define Build/sunxi-uboot
+	cp $(STAGING_DIR_IMAGE)/$(DEVICE_NAME)-u-boot-with-spl.bin $@
+endef
+
 # why \x00\x00\x00\x00 for zImage-initramfs
 define Device/Default
   PROFILES := Default
diff --git a/target/linux/sunxi/image/cortex-a53.mk b/target/linux/sunxi/image/cortex-a53.mk
index c7f3fa5733..af7e11b864 100644
--- a/target/linux/sunxi/image/cortex-a53.mk
+++ b/target/linux/sunxi/image/cortex-a53.mk
@@ -23,6 +23,19 @@  endef
 
 TARGET_DEVICES += sun50i-h5-nanopi-neo2
 
+define Device/sun50i-a64-pine64-lts
+  $(call Device/FitImageLzma64)
+  DEVICE_TITLE:=Pine64 LTS
+  FILESYSTEMS := squashfs
+  IMAGE_SIZE := 15360k
+  SUPPORTED_DEVICES:=pine64,pine64-lts
+  IMAGES += sysupgrade.bin u-boot-with-spl.bin
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
+  IMAGE/u-boot-with-spl.bin := sunxi-uboot | check-size 896k
+endef
+
+TARGET_DEVICES += sun50i-a64-pine64-lts
+
 define Device/sun50i-a64-pine64-plus
   $(call Device/FitImageLzma64)
   DEVICE_TITLE:=Pine64 Plus A64
diff --git a/target/linux/sunxi/patches-4.14/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch b/target/linux/sunxi/patches-4.14/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
new file mode 100644
index 0000000000..32c4490c54
--- /dev/null
+++ b/target/linux/sunxi/patches-4.14/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
@@ -0,0 +1,59 @@ 
+From b3ee15a509ffd7473b77b21cb921b3128efdd005 Mon Sep 17 00:00:00 2001
+From: Andre Przywara <andre.przywara@arm.com>
+Date: Mon, 30 Jul 2018 13:31:20 +0100
+Subject: [PATCH] arm64: dts: allwinner: a64: Add Pine64-LTS device tree file
+
+The Pine64-LTS is a variant of the Pine64 board, from the software
+visible side resembling a SoPine module on a baseboard, though the
+board has the SoC and DRAM integrated on one PCB.
+Due to this it basically shares the DT with the SoPine baseboard, which
+we mimic in our DT by inclucing the boardboard .dts into the new file,
+just overwriting the model name.
+Having a separate .dts for this seems useful, since we don't know yet if
+there are subtle differences between the two. Also the SoC on the LTS
+board is technically an "R18" instead of the original "A64", although as
+far as we know this is just a relabelled version of the original SoC.
+
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
+Signed-off-by: Chen-Yu Tsai <wens@csie.org>
+---
+ arch/arm64/boot/dts/allwinner/Makefile              |  1 +
+ .../boot/dts/allwinner/sun50i-a64-pine64-lts.dts    | 13 +++++++++++++
+ 2 files changed, 14 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
+
+diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
+index 9ffa7a038791..b7034327b28b 100644
+--- a/arch/arm64/boot/dts/allwinner/Makefile
++++ b/arch/arm64/boot/dts/allwinner/Makefile
+@@ -4,6 +4,7 @@ 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-orangepi-win.dtb
++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-lts.dtb
+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
+new file mode 100644
+index 000000000000..72d6961dc312
+--- /dev/null
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
+@@ -0,0 +1,13 @@
++/*
++ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++ *
++ * Copyright (c) 2018 ARM Ltd.
++ */
++
++#include "sun50i-a64-sopine-baseboard.dts"
++
++/ {
++	model = "Pine64 LTS";
++	compatible = "pine64,pine64-lts", "allwinner,sun50i-r18",
++		     "allwinner,sun50i-a64";
++};
+-- 
+2.17.1
+
diff --git a/target/linux/sunxi/patches-4.19/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch b/target/linux/sunxi/patches-4.19/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
new file mode 100644
index 0000000000..32c4490c54
--- /dev/null
+++ b/target/linux/sunxi/patches-4.19/062-arm64-dts-allwinner-a64-Add-Pine64-LTS-device-tree-f.patch
@@ -0,0 +1,59 @@ 
+From b3ee15a509ffd7473b77b21cb921b3128efdd005 Mon Sep 17 00:00:00 2001
+From: Andre Przywara <andre.przywara@arm.com>
+Date: Mon, 30 Jul 2018 13:31:20 +0100
+Subject: [PATCH] arm64: dts: allwinner: a64: Add Pine64-LTS device tree file
+
+The Pine64-LTS is a variant of the Pine64 board, from the software
+visible side resembling a SoPine module on a baseboard, though the
+board has the SoC and DRAM integrated on one PCB.
+Due to this it basically shares the DT with the SoPine baseboard, which
+we mimic in our DT by inclucing the boardboard .dts into the new file,
+just overwriting the model name.
+Having a separate .dts for this seems useful, since we don't know yet if
+there are subtle differences between the two. Also the SoC on the LTS
+board is technically an "R18" instead of the original "A64", although as
+far as we know this is just a relabelled version of the original SoC.
+
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
+Signed-off-by: Chen-Yu Tsai <wens@csie.org>
+---
+ arch/arm64/boot/dts/allwinner/Makefile              |  1 +
+ .../boot/dts/allwinner/sun50i-a64-pine64-lts.dts    | 13 +++++++++++++
+ 2 files changed, 14 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
+
+diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
+index 9ffa7a038791..b7034327b28b 100644
+--- a/arch/arm64/boot/dts/allwinner/Makefile
++++ b/arch/arm64/boot/dts/allwinner/Makefile
+@@ -4,6 +4,7 @@ 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-orangepi-win.dtb
++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-lts.dtb
+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
+new file mode 100644
+index 000000000000..72d6961dc312
+--- /dev/null
++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts
+@@ -0,0 +1,13 @@
++/*
++ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++ *
++ * Copyright (c) 2018 ARM Ltd.
++ */
++
++#include "sun50i-a64-sopine-baseboard.dts"
++
++/ {
++	model = "Pine64 LTS";
++	compatible = "pine64,pine64-lts", "allwinner,sun50i-r18",
++		     "allwinner,sun50i-a64";
++};
+-- 
+2.17.1
+