Convert boot_mode and sun8i machid tou-boot patch
Needs testing on A10, A20, ... with legacy kernel
This commit is contained in:
parent
56a4590934
commit
b644086987
@ -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
|
||||
|
||||
@ -1,4 +1,2 @@
|
||||
verbosity=1
|
||||
console=both
|
||||
machid=1029
|
||||
bootm_boot_mode=sec
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
11
patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch
Normal file
11
patch/u-boot/u-boot-sunxi/sun8i-set-machid.patch
Normal file
@ -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 <configs/sunxi-common.h>
|
||||
|
||||
+#define CONFIG_MACH_TYPE (0x1029)
|
||||
+
|
||||
#endif /* __CONFIG_H */
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user