Skip to content
Snippets Groups Projects
Commit 107e3590 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

bootscript:u-boot: Add u-boot compatible bootscript

For tanaro a bootscript for u-boot is needed.
Use install scripts also for tanaro.

BCS 746-000378
parent e52e8887
No related branches found
No related tags found
1 merge request!101bootscript:u-boot: Add u-boot compatible bootscript
Pipeline #17078 passed with stages
in 17 minutes and 43 seconds
......@@ -30,12 +30,6 @@ require conf/machine/include/tune-cortexa53.inc
# require conf/machine/include/arm/arch-arm64.inc
# Some recipes currently still fail during build for i.MX8 and must be
# changed to work for TANARO anyways. Remove these for now.
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove = " \
bootscript \
"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append = " \
imx-boot \
"
......@@ -58,11 +52,6 @@ MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS_append_guf = " \
spreadspectrum \
"
DISTRO_EXTRA_RDEPENDS_remove = " \
fng-install \
fng-install-postinstallation \
"
# Support mx8mn here, as well, or is separate machine-config required for Nano ?
SOC_FAMILY = "mx8:mx8m:mx8mm"
......@@ -125,6 +114,10 @@ IMAGE_BOOT_FILES_append = " \
guf-tanaro-qp_070wsvgamlli1d.dtb \
"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_append = " \
bootscript-uboot \
"
SERIAL_CONSOLES = "115200;ttymxc0"
# build WIC image for IMX8M
......
......@@ -19,11 +19,16 @@ do_configure() {
RAMDISK_LOAD_ADDR="$( printf "0x%08X" "$( awk "BEGIN {print ${RAM_START_ADDRESS} + ${RAMDISK_OFFSET}}")" )"
sed -i boot-alt.cfg -e "s|load -b 0x[0-9abcdefABCDEF]\+|load -b ${RAMDISK_LOAD_ADDR}|"
}
do_install() {
install -d ${D}/boot
install -m 0644 ${S}/boot-alt.cfg ${D}/boot/boot-alt.cfg
}
do_deploy() {
install ${S}/boot-alt.cfg ${DEPLOYDIR}/boot-alt.cfg
}
FILES_${PN} = "boot/boot-alt.cfg"
addtask do_deploy after do_install
do_deploy[cleandirs] = "${DEPLOYDIR}"
# We do not install anything to the root file system
ALLOW_EMPTY_${PN} = "1"
kernel=Image
devicetree=guf-tanaro-fg0700w0dsswagl1.dtb
initramfs=fngsystem-image.cpio.gz
cmdline="console=ttymxc0,115200 root=/dev/ram0 rootfstype=ramfs rdinit=/sbin/init cma=64M os=fngsystem vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0"
SUMMARY = "Garz & Fricke platform bootscript for U-Boot"
HOMEPAGE = "https://garz-fricke.com"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit deploy
DEPENDS += "u-boot-mkimage-native"
SRC_URI = "\
file://boot-alt.scr.cfg \
"
do_compile() {
mkimage -A arm -T script -O linux -d ${WORKDIR}/boot-alt.scr.cfg ${WORKDIR}/boot-alt.scr
}
do_install() {
install -d ${D}/boot
install ${WORKDIR}/boot-alt.scr ${D}/boot/boot-alt.scr
}
do_deploy() {
install ${D}/boot/boot-alt.scr ${DEPLOYDIR}/boot-alt.scr
}
addtask do_deploy after do_install
do_deploy[cleandirs] = "${DEPLOYDIR}"
FILES_${PN} = " /boot/* "
if fatload mmc ${current_partition} ${loadaddr} boot-alt.cfg && env import -t ${loadaddr} ${filesize}; then
if test -n ${cmdline};then
echo "Kernel cmdline: ${cmdline}"
setenv bootargs ${cmdline}
fi
if test -n ${devicetree};then
echo "Loading devicetree ${devicetree}..."
if fatload mmc ${current_partition} ${fdt_addr} ${devicetree}
fi
if test -n ${overlays}; then
for ov in ${overlays}; do
echo Overlaying ${ov}...
if fatload mmc ${current_partition} ${loadaddr} ${ov};then
fdt resize ${filesize} && fdt apply ${loadaddr}
else
echo 'Failed to load overlay ${ov}
fi
done
fi
initrd=-
if test -n ${initramfs};then
echo "Loading initramfs ${initramfs}..."
if fatload mmc ${current_partition} ${initrd_addr} ${initramfs};then
initrd=${initrd_addr}:${filesize}
else
echo 'Failed to load initramfs ${initramfs}'
fi
fi
# Fallback if not set in config file
if test -z ${kernel};then
kernel=linuximage
fi
echo "Load kernel ${kernel}"
if fatload mmc ${current_partition} ${loadaddr} ${kernel} ; then
booti ${loadaddr} ${initrd} ${fdt_addr}
else
echo 'Unable to load kernel ${kernel}'
fi
else
echo 'No valid boot-alt.cfg found'
fi;
SUMMARY = "Garz & Fricke platform bootscript for U-Boot"
HOMEPAGE = "https://garz-fricke.com"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit deploy
DEPENDS += "u-boot-mkimage-native"
SRC_URI = "\
file://boot.scr.cfg \
"
do_compile() {
mkimage -A arm -T script -O linux -d ${WORKDIR}/boot.scr.cfg ${WORKDIR}/boot.scr
}
do_install() {
install -d ${D}/boot
install ${WORKDIR}/boot.scr ${D}/boot/boot.scr
}
FILES_${PN} = " /boot/* "
if fatload mmc ${current_partition} ${loadaddr} boot-alt.cfg && env import -t ${loadaddr} ${filesize}; then
if test -n ${cmdline};then
echo "Kernel cmdline: ${cmdline}"
setenv bootargs ${cmdline}
fi
if test -n ${devicetree};then
echo "Loading devicetree ${devicetree}..."
fatload mmc ${current_partition} ${fdt_addr} ${devicetree}
fi
if test -n ${overlays}; then
for ov in ${overlays}; do
echo Overlaying ${ov}...
fatload mmc ${current_partition} ${loadaddr} ${ov} && fdt resize ${filesize} && fdt apply ${loadaddr}
done
fi
initrd=-
if test -n ${initramfs};then
echo "Loading initramfs ${initramfs}..."
if fatload mmc ${current_partition} ${initrd_addr} ${initramfs};then
initrd=${initrd_addr}:${filesize}
fi
fi
# Fallback if not set in config file
if test -z ${kernel};then
kernel=linuximage
fi
echo "Load kernel ${kernel}"
if fatload mmc ${current_partition} ${loadaddr} ${kernel} ; then
booti ${loadaddr} ${initrd} ${fdt_addr}
else
echo 'Unable to load kernel ${kernel}'
fi
else
echo 'No valid boot-alt.cfg found'
fi;
......@@ -6,8 +6,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7ca
inherit deploy
DEPENDS_mx6ull += "u-boot-mkimage-native"
SRC_URI = "\
file://boot.cfg \
"
......@@ -19,9 +17,4 @@ do_install() {
install -m 0644 ${S}/boot.cfg ${D}/boot/boot.cfg
}
do_install_append_mx6ull() {
mkimage -A arm -T script -O linux -d ${D}/boot/boot.cfg ${D}/boot/boot.scr
}
FILES_${PN} = "boot/boot.cfg"
FILES_${PN}_append_mx6ull = " boot/boot.scr "
kernel=Image
devicetree=guf-tanaro-fg0700w0dsswagl1.dtb
cmdline="console=ttymxc0,115200 root=/dev/mmcblk0p6 rootflags=data=journal rootwait rootfstype=ext4 cma=128M loglevel=6 vt.global_cursor_default=0 vt.color=0xF7 fbcon=logo-pos:center,logo-count:1,rotate:0"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment