Add Beelink GS1 board
cover Add Beelink GS1 board
Hi,
Beelink GS1 is a TV box based on Allwinner H6.
It requires one patch for a working reboot in ARM ATF and one patch in U-boot to avoid random mac.
Patches 2 and 3, are optional and I don't think it should be merge.
Regards,
Cl?ment
Cl?ment P?ron (3):
board: add Beelink GS1 support
[DO NOT MERGE] board/beelink_gs1: enable mdev, dropbear and auto-ssh [DO NOT MERGE] board/beelink_gs1: add root passwd and eth0 auto
board/beelink/gs1/extlinux.conf | 4 + board/beelink/gs1/genimage.cfg | 33 +++ ...er-common-use-r_wdog-instead-of-wdog.patch | 39 +++ ...01-arm-dts-sync-dts-for-Allwinner-H6.patch | 279 ++++++++++++++++++ board/beelink/gs1/post-build.sh | 4 + .../gs1/rootfs_overlay/etc/network/interfaces | 7 + configs/beelink_gs1_defconfig | 40 +++ 7 files changed, 406 insertions(+) create mode 100644 board/beelink/gs1/extlinux.conf create mode 100644 board/beelink/gs1/genimage.cfg create mode 100644 board/beelink/gs1/patches/arm-trusted-firmware/0001-plat-allwinner-common-use-r_wdog-instead-of-wdog.patch create mode 100644 board/beelink/gs1/patches/uboot/0001-arm-dts-sync-dts-for-Allwinner-H6.patch create mode 100755 board/beelink/gs1/post-build.sh create mode 100644 board/beelink/gs1/rootfs_overlay/etc/network/interfaces create mode 100644 configs/beelink_gs1_defconfig
Signature · 1 line
2.20.1
PATCH 1/3 board: add Beelink GS1 support
--- board/beelink/gs1/extlinux.conf | 4 + board/beelink/gs1/genimage.cfg | 33 +++ ...er-common-use-r_wdog-instead-of-wdog.patch | 39 +++ ...01-arm-dts-sync-dts-for-Allwinner-H6.patch | 279 ++++++++++++++++++ board/beelink/gs1/post-build.sh | 4 + configs/beelink_gs1_defconfig | 35 +++ 6 files changed, 394 insertions(+) create mode 100644 board/beelink/gs1/extlinux.conf create mode 100644 board/beelink/gs1/genimage.cfg create mode 100644 board/beelink/gs1/patches/arm-trusted-firmware/0001-plat-allwinner-common-use-r_wdog-instead-of-wdog.patch create mode 100644 board/beelink/gs1/patches/uboot/0001-arm-dts-sync-dts-for-Allwinner-H6.patch create mode 100755 board/beelink/gs1/post-build.sh create mode 100644 configs/beelink_gs1_defconfig
board/beelink/gs1/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@ +label linux + kernel /Image + devicetree /sun50i-h6-beelink-gs1.dtb + append console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait
board/beelink/gs1/genimage.cfg new file +33 -0
@@ -0,0 +1,33 @@ +image boot.vfat { + vfat { + files = { + "Image", + "sun50i-h6-beelink-gs1.dtb", + "extlinux" + } + } + size = 64M +} + +image sdcard.img { + hdimage { + } + + partition u-boot { + in-partition-table = "no" + image = "u-boot-sunxi-with-spl.bin" + offset = 8192 + size = 1040384 # 1MB - 8192 + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +}
board/beelink/gs1/patches/arm-trusted-firmware/0001-plat-allwinner-common-use-r_wdog-instead-of-wdog.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 523ab5be1a84e9aa15fb62c3a15a6338b01d3961 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= <[email protected]> +Date: Tue, 9 Apr 2019 00:15:06 +0200 +Subject: [PATCH] plat: allwinner: common: use r_wdog instead of wdog +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some Allwinner H6 has a broken watchdog that doesn't +make the soc reboot. + +Use the R_WATCHDOG instead. + +Signed-off-by: Cl?ment P?ron <[email protected]> +Change-Id: Ie95cc30a80ed517b60b30d6bc2e655a1b53f18ba +--- + plat/allwinner/common/sunxi_pm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/plat/allwinner/common/sunxi_pm.c b/plat/allwinner/common/sunxi_pm.c +index 1d2dc938..13e13532 100644 +--- a/plat/allwinner/common/sunxi_pm.c ++++ b/plat/allwinner/common/sunxi_pm.c +@@ -20,9 +20,9 @@ + #include <sunxi_mmap.h> + #include <sunxi_private.h> + +-#define SUNXI_WDOG0_CTRL_REG (SUNXI_WDOG_BASE + 0x0010) +-#define SUNXI_WDOG0_CFG_REG (SUNXI_WDOG_BASE + 0x0014) +-#define SUNXI_WDOG0_MODE_REG (SUNXI_WDOG_BASE + 0x0018) ++#define SUNXI_WDOG0_CTRL_REG (SUNXI_R_WDOG_BASE + 0x0010) ++#define SUNXI_WDOG0_CFG_REG (SUNXI_R_WDOG_BASE + 0x0014) ++#define SUNXI_WDOG0_MODE_REG (SUNXI_R_WDOG_BASE + 0x0018) + + #define mpidr_is_valid(mpidr) ( \ + MPIDR_AFFLVL3_VAL(mpidr) == 0 && \ +-- +2.20.1 +
board/beelink/gs1/patches/uboot/0001-arm-dts-sync-dts-for-Allwinner-H6.patch new file +279 -0
279 lines not on this page · raw message
board/beelink/gs1/post-build.sh new file +4 -0
@@ -0,0 +1,4 @@ +#!/bin/sh +BOARD_DIR="$(dirname $0)" + +install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux/extlinux.conf
configs/beelink_gs1_defconfig new file +35 -0
@@ -0,0 +1,35 @@ +# Architecture +BR2_aarch64=y +BR2_ARM_FPU_VFPV4=y +BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg" +BR2_GLOBAL_PATCH_DIR="board/beelink/gs1/patches/" + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h6-beelink-gs1" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y + +# Firmware +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.1" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="sun50i_h6" + +# Bootloader +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="beelink_gs1" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.20.1
PATCH 2/3 board/beelink_gs1: enable mdev, dropbear and auto-ssh
In reply to Clément Péron--- configs/beelink_gs1_defconfig | 3 +++ 1 file changed, 3 insertions(+)
configs/beelink_gs1_defconfig +3 -0
@@ -2,6 +2,7 @@ BR2_aarch64=y BR2_ARM_FPU_VFPV4=y BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg"
@@ -13,6 +14,8 @@ BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h6-beelink-gs1" BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_PACKAGE_AUTOSSH=y +BR2_PACKAGE_DROPBEAR=y BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y
Signature · 1 line
2.20.1
PATCH 3/3 board/beelink_gs1: add root passwd and eth0 auto
In reply to Clément Péron--- board/beelink/gs1/rootfs_overlay/etc/network/interfaces | 7 +++++++ configs/beelink_gs1_defconfig | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 board/beelink/gs1/rootfs_overlay/etc/network/interfaces
board/beelink/gs1/rootfs_overlay/etc/network/interfaces new file +7 -0
@@ -0,0 +1,7 @@ +# Configure Loopback +auto lo +iface lo inet loopback + +# Configure eth0 with DHCP +auto eth0 +iface eth0 inet dhcp
configs/beelink_gs1_defconfig +2 -0
@@ -3,6 +3,8 @@ BR2_aarch64=y BR2_ARM_FPU_VFPV4=y BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y +BR2_TARGET_GENERIC_ROOT_PASSWD="admin" +BR2_ROOTFS_OVERLAY="board/beelink/gs1/rootfs_overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg"
Signature · 1 line
2.20.1
PATCH 3/3 board/beelink_gs1: add root passwd and eth0 auto
Quoted 13 lines · Cl?ment P?ron
Signed-off-by Cl?ment P?ron <[email protected]>--- board/beelink/gs1/rootfs_overlay/etc/network/interfaces | 7 +++++++ configs/beelink_gs1_defconfig | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 board/beelink/gs1/rootfs_overlay/etc/network/interfacesboard/beelink/gs1/rootfs_overlay/etc/network/interfaces new file +0
-0
board/beelink/gs1/rootfs_overlay/etc/network/interfaces line 7
Quoted 7 lines
board/beelink/gs1/rootfs_overlay/etc/network/interfaces new file +7
-0@@ -0,0 +1,7 @@ +# Configure Loopback +auto lo +iface lo inet loopback + +# Configure eth0 with DHCP +auto eth0 +iface eth0 inet dhcp
Doesn't BR2_SYSTEM_DHCP="eth0" work? We do that in a lot of other defconfigs.
Regards,
Arnout
Quoted 14 lines
configs/beelink_gs1_defconfig +2
-0@@ -3,6 +3,8 @@ BR2_aarch64=y BR2_ARM_FPU_VFPV4=y BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y +BR2_TARGET_GENERIC_ROOT_PASSWD="admin" +BR2_ROOTFS_OVERLAY="board/beelink/gs1/rootfs_overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg"
PATCH 3/3 board/beelink_gs1: add root passwd and eth0 auto
Hi Arnout,
Quoted 11 lines · Arnout Vandecappelle
Quoted 7 lines · Cl?ment P?ron
Signed-off-by Cl?ment P?ron <[email protected]>--- board/beelink/gs1/rootfs_overlay/etc/network/interfaces | 7 +++++++ configs/beelink_gs1_defconfig | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 board/beelink/gs1/rootfs_overlay/etc/network/interfaces
Quoted 15 lines
board/beelink/gs1/rootfs_overlay/etc/network/interfaces line 7
Quoted 13 lines
board/beelink/gs1/rootfs_overlay/etc/network/interfaces new file +7
-0@@ -0,0 +1,7 @@ +# Configure Loopback +auto lo +iface lo inet loopback + +# Configure eth0 with DHCP +auto eth0 +iface eth0 inet dhcpDoesn't BR2_SYSTEM_DHCP="eth0" work? We do that in a lot of other defconfigs.
Thanks for the tips, I didn't know about this option.
Regards,
Cl?ment
Quoted 18 lines
Regards,
ArnoutQuoted 14 lines
configs/beelink_gs1_defconfig +2
-0@@ -3,6 +3,8 @@ BR2_aarch64=y BR2_ARM_FPU_VFPV4=y BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y +BR2_TARGET_GENERIC_ROOT_PASSWD="admin" +BR2_ROOTFS_OVERLAY="board/beelink/gs1/rootfs_overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg"
PATCH 1/3 board: add Beelink GS1 support
In reply to Clément PéronHello Cl?ment,
Sorry for the slow feedback.
Quoted 4 lines · On Fri, 20 Sep 2019 21:08:11 +0200 Cl?ment P?ron <[email protected]> wrote:
board/beelink/gs1/extlinux.conf | 4 + board/beelink/gs1/genimage.cfg | 33 +++ ...er-common-use-r_wdog-instead-of-wdog.patch | 39 +++ ...01-arm-dts-sync-dts-for-Allwinner-H6.patch | 279 ++++++++++++++++++
Perhaps these patches have been merged upstream now ?
Quoted 7 lines
configs/beelink_gs1_defconfig new file +1
-0@@ -0,0 +1,35 @@ +# Architecture
configs/beelink_gs1_defconfig line 11
Quoted 10 lines
configs/beelink_gs1_defconfig new file +10
-0+BR2_aarch64=y +BR2_ARM_FPU_VFPV4=y +BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg" +BR2_GLOBAL_PATCH_DIR="board/beelink/gs1/patches/" + +# Kernel +BR2_LINUX_KERNEL=y
Please define an explicit kernel version, so that it is using a known working version.
Quoted 5 lines
configs/beelink_gs1_defconfig new file +5
-0+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h6-beelink-gs1" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_EXT2=y
configs/beelink_gs1_defconfig line 26
Quoted 10 lines
configs/beelink_gs1_defconfig new file +10
-0+BR2_TARGET_ROOTFS_EXT2_4=y + +# Firmware +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.1" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="sun50i_h6" + +# Bootloader +BR2_TARGET_UBOOT=y
Please define an explicit U-Boot version, for the same reason as above.
Also, please add yourself in the DEVELOPERS file, for both the defconfig and the board folder you're adding.
Could you send a v2 fixing those details ?
Thanks a lot!
Thomas Petazzoni
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/3 board: add Beelink GS1 support
Hello Thomas,
Quoted 8 lines · Thomas Petazzoni
Hello Cl?ment,
Sorry for the slow feedback.
On Fri, 20 Sep 2019 21:08:11 +0200
Cl?ment P?ron <[email protected]> wrote:
Quoted 6 lines
Quoted 4 lines
board/beelink/gs1/extlinux.conf | 4 + board/beelink/gs1/genimage.cfg | 33 +++ ...er-common-use-r_wdog-instead-of-wdog.patch | 39 +++ ...01-arm-dts-sync-dts-for-Allwinner-H6.patch | 279 ++++++++++++++++++Perhaps these patches have been merged upstream now ?
One has been merged in A-TF v2.2 which is one week old. I didn't have time to test it right now
The second is still not merged in U-boot 2019.10
Quoted 13 lines
Quoted 13 lines
configs/beelink_gs1_defconfig new file +6
-0@@ -0,0 +1,35 @@ +# Architecture +BR2_aarch64=y +BR2_ARM_FPU_VFPV4=y +BR2_TARGET_GENERIC_ISSUE="Welcome to Beelink GS1" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/beelink/gs1/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
Quoted 8 lines
configs/beelink_gs1_defconfig line 11
Quoted 5 lines
configs/beelink_gs1_defconfig new file +5
-0+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/beelink/gs1/genimage.cfg" +BR2_GLOBAL_PATCH_DIR="board/beelink/gs1/patches/" + +# Kernel +BR2_LINUX_KERNEL=yPlease define an explicit kernel version, so that it is using a known working version.
OK
Quoted 10 lines
Quoted 10 lines
configs/beelink_gs1_defconfig new file +9
-0+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h6-beelink-gs1" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y + +# Firmware +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
Quoted 8 lines
configs/beelink_gs1_defconfig line 26
Quoted 6 lines
configs/beelink_gs1_defconfig new file +6
-0+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.1" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="sun50i_h6" + +# Bootloader +BR2_TARGET_UBOOT=yPlease define an explicit U-Boot version, for the same reason as above.
OK
Quoted 5 lines
Also, please add yourself in the DEVELOPERS file, for both the defconfig and the board folder you're adding.
Could you send a v2 fixing those details ?
Yes,
Do you think the other patches can be merged too or are they to "user-specific" ?
Quoted 2 lines
Thanks a lot!
Thanks for the review,
Quoted 6 lines
Thomas Petazzoni
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 1/3 board: add Beelink GS1 support
Quoted 2 lines · On Sat, 26 Oct 2019 10:56:02 +0200 Cl?ment P?ron <[email protected]> wrote:
Do you think the other patches can be merged too or are they to "user-specific" ?
As Arnout said, PATCH 3/3, for the part that enables DHCP on eth0, can be added using BR2_SYSTEM_DHCP="eth0". This is acceptable upstream.
Customizing the root password is not, as is adding autossh and dropbear.
Adding mdev could be acceptable, for example if it's needed to load some kernel modules.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/3 board: add Beelink GS1 support
Quoted 7 lines · Thomas Petazzoni
Quoted 2 lines · On Sat, 26 Oct 2019 10:56:02 +0200 Cl?ment P?ron <[email protected]> wrote:
Do you think the other patches can be merged too or are they to "user-specific" ?
Quoted 7 lines
As Arnout said, PATCH 3/3, for the part that enables DHCP on eth0, can be added using BR2_SYSTEM_DHCP="eth0". This is acceptable upstream.
Customizing the root password is not, as is adding autossh and dropbear.
Adding mdev could be acceptable, for example if it's needed to load some kernel modules.
Yes it is,
Thanks
Cl?ment
Quoted 8 lines
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
PATCH 1/3 board: add Beelink GS1 support
Quoted 9 lines · Cl?ment P?ron
Quoted 7 lines · Thomas Petazzoni
Quoted 2 lines · On Sat, 26 Oct 2019 10:56:02 +0200 Cl?ment P?ron <[email protected]> wrote:
Do you think the other patches can be merged too or are they to "user-specific" ?
Quoted 8 lines
Quoted 7 lines
As Arnout said, PATCH 3/3, for the part that enables DHCP on eth0, can be added using BR2_SYSTEM_DHCP="eth0". This is acceptable upstream.
Customizing the root password is not, as is adding autossh and dropbear.
Adding mdev could be acceptable, for example if it's needed to load some kernel modules.
Yes it is,
It helps if you put a comment in the defconfig that says why it is needed (e.g.
"to autoload ethernet driver module").
Regards,
Arnout