From b64408698796b0df34068e255981f78f5f627ab3 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Wed, 22 Feb 2017 15:23:24 +0300 Subject: [PATCH] Convert boot_mode and sun8i machid tou-boot patch Needs testing on A10, A20, ... with legacy kernel --- common.sh | 5 ----- config/bootenv/sun8i-default.txt | 2 -- config/sources/sun8i.conf | 8 -------- .../branch_default/enable-old-kernel-compat.patch | 12 ++++++++++++ patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch | 11 +++++++++++ scripts/fel-hooks.sh.example | 12 +++--------- 6 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 patch/u-boot/u-boot-sunxi/branch_default/enable-old-kernel-compat.patch create mode 100644 patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch diff --git a/common.sh b/common.sh index d1aecff4e1..3d373b0dba 100644 --- a/common.sh +++ b/common.sh @@ -90,11 +90,6 @@ compile_uboot() [[ -f tools/logos/udoo.bmp ]] && cp $SRC/lib/bin/armbian-u-boot.bmp tools/logos/udoo.bmp touch .scmversion - # patch mainline uboot configuration to boot with old sunxi kernels - if [[ $BRANCH == default && $LINUXFAMILY == sun*i ]] && ! grep -q "CONFIG_ARMV7_BOOT_SEC_DEFAULT=y" .config ; then - echo -e "CONFIG_ARMV7_BOOT_SEC_DEFAULT=y\nCONFIG_OLD_SUNXI_KERNEL_COMPAT=y" >> .config - fi - # $BOOTDELAY can be set in board family config, ensure autoboot can be stopped even if set to 0 [[ $BOOTDELAY == 0 ]] && echo -e "CONFIG_ZERO_BOOTDELAY_CHECK=y" >> .config [[ -n $BOOTDELAY ]] && sed -i "s/^CONFIG_BOOTDELAY=.*/CONFIG_BOOTDELAY=${BOOTDELAY}/" .config || [[ -f .config ]] && echo "CONFIG_BOOTDELAY=${BOOTDELAY}" >> .config diff --git a/config/bootenv/sun8i-default.txt b/config/bootenv/sun8i-default.txt index 3edcfc6c4d..af16115c05 100644 --- a/config/bootenv/sun8i-default.txt +++ b/config/bootenv/sun8i-default.txt @@ -1,4 +1,2 @@ verbosity=1 console=both -machid=1029 -bootm_boot_mode=sec diff --git a/config/sources/sun8i.conf b/config/sources/sun8i.conf index 9f1f81dbb6..3236a4b676 100644 --- a/config/sources/sun8i.conf +++ b/config/sources/sun8i.conf @@ -45,12 +45,4 @@ family_tweaks() chroot $CACHEDIR/$SDCARD /bin/bash -c "systemctl --no-reload enable serial-getty@ttyGS0.service > /dev/null" echo "ttyGS0" >> $CACHEDIR/$SDCARD/etc/securetty fi - - # u-boot default is nonsec. Legacy requires sec, mainline requires nonsec for SMP - if [[ ! -f $CACHEDIR/$SDCARD/boot/armbianEnv.txt ]]; then - local boot_mode=nonsec - [[ $BRANCH == default ]] && boot_mode=sec - sed -i -e "1s/^/gpio set PL10\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode $boot_mode\n/" \ - -e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' $CACHEDIR/$SDCARD/boot/boot.cmd - fi } diff --git a/patch/u-boot/u-boot-sunxi/branch_default/enable-old-kernel-compat.patch b/patch/u-boot/u-boot-sunxi/branch_default/enable-old-kernel-compat.patch new file mode 100644 index 0000000000..9d0c87da7f --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/branch_default/enable-old-kernel-compat.patch @@ -0,0 +1,12 @@ +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 0ed36cded..c4f93ee83 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -575,6 +575,7 @@ config TARGET_CM_T43 + + config ARCH_SUNXI + bool "Support sunxi (Allwinner) SoCs" ++ select OLD_SUNXI_KERNEL_COMPAT + select CMD_GPIO + select CMD_MMC if MMC + select CMD_USB if DISTRO_DEFAULTS diff --git a/patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch b/patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch new file mode 100644 index 0000000000..24a33afa45 --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch @@ -0,0 +1,11 @@ +diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h +index a4c3fb69e..47ce2e9e6 100644 +--- a/include/configs/sun8i.h ++++ b/include/configs/sun8i.h +@@ -30,4 +30,6 @@ + */ + #include + ++#define CONFIG_MACH_TYPE (0x1029) ++ + #endif /* __CONFIG_H */ diff --git a/scripts/fel-hooks.sh.example b/scripts/fel-hooks.sh.example index 7ecc81c841..5b93db4938 100644 --- a/scripts/fel-hooks.sh.example +++ b/scripts/fel-hooks.sh.example @@ -6,8 +6,7 @@ # The following example assumes you use a Gembird power switch connected # through USB to be able to power cycle the board you want to fel boot. You # need the sispmctl package and use 'sispmctl -s' to get the ID of your -# power switch. And the fel_post_prepare function tries to adjust the -# boot environment for H3 boards on the fly. +# power switch. fel_pre_load() { # power cycle socket 1 of Gembird power switch @@ -20,11 +19,6 @@ fel_pre_load() { } # fel_pre_load fel_post_prepare() { - # This adds/adjusts necessary boot environment for H3 boards - if [ "$LINUXFAMILY" == "sun8i" ]; then - sed -i -e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' \ - -e '1s/^/gpio set PL10\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode sec\n/' \ - $FEL_ROOTFS/boot/boot.cmd - mkimage -C none -A arm -T script -d $FEL_ROOTFS/boot/boot.cmd $FEL_ROOTFS/boot/boot.scr > /dev/null - fi + # currently empty - sun8i-default tweaks were converted into u-boot patches + echo "calling fel_post_prepare()" } # fel_post_prepare