diff --git a/conf/machine/imx8mguf.conf b/conf/machine/imx8mguf.conf index 08cf22f5a77e1706c5ce4d1b752135c068eeeb37..9328b62643536c1e59d112b0de207180761493b0 100644 --- a/conf/machine/imx8mguf.conf +++ b/conf/machine/imx8mguf.conf @@ -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 diff --git a/recipes-bsp/bootscript/bootscript-alt.bb b/recipes-bsp/bootscript/bootscript-alt.bb index 2d4f14bb0c1d6efd5af4b822401e0dc54e388c75..7104c5d272a95c5634f69edc6a71e7064e8e4210 100644 --- a/recipes-bsp/bootscript/bootscript-alt.bb +++ b/recipes-bsp/bootscript/bootscript-alt.bb @@ -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" diff --git a/recipes-bsp/bootscript/bootscript-alt/mx8/boot-alt.cfg b/recipes-bsp/bootscript/bootscript-alt/mx8/boot-alt.cfg new file mode 100644 index 0000000000000000000000000000000000000000..724caa21299a8bc7f3c12a3097fc41b597dd0dc9 --- /dev/null +++ b/recipes-bsp/bootscript/bootscript-alt/mx8/boot-alt.cfg @@ -0,0 +1,5 @@ +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" + diff --git a/recipes-bsp/bootscript/bootscript-uboot-alt.bb b/recipes-bsp/bootscript/bootscript-uboot-alt.bb new file mode 100644 index 0000000000000000000000000000000000000000..820c5926a18f5ee815431e912ee202a084af1af5 --- /dev/null +++ b/recipes-bsp/bootscript/bootscript-uboot-alt.bb @@ -0,0 +1,30 @@ +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/* " diff --git a/recipes-bsp/bootscript/bootscript-uboot-alt/boot-alt.scr.cfg b/recipes-bsp/bootscript/bootscript-uboot-alt/boot-alt.scr.cfg new file mode 100644 index 0000000000000000000000000000000000000000..e8254072776e637d8f0007c8e30dbdb64f799f0b --- /dev/null +++ b/recipes-bsp/bootscript/bootscript-uboot-alt/boot-alt.scr.cfg @@ -0,0 +1,48 @@ + +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; diff --git a/recipes-bsp/bootscript/bootscript-uboot.bb b/recipes-bsp/bootscript/bootscript-uboot.bb new file mode 100644 index 0000000000000000000000000000000000000000..e00446cd978f96695c71da481335e701d3e89558 --- /dev/null +++ b/recipes-bsp/bootscript/bootscript-uboot.bb @@ -0,0 +1,24 @@ +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/* " diff --git a/recipes-bsp/bootscript/bootscript-uboot/boot.scr.cfg b/recipes-bsp/bootscript/bootscript-uboot/boot.scr.cfg new file mode 100644 index 0000000000000000000000000000000000000000..88e18ef08e9f94c371dbc6905d4d828943e940ec --- /dev/null +++ b/recipes-bsp/bootscript/bootscript-uboot/boot.scr.cfg @@ -0,0 +1,42 @@ + +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; diff --git a/recipes-bsp/bootscript/bootscript.bb b/recipes-bsp/bootscript/bootscript.bb index cba1b010624ce797fe0bec77fb2f283c1bb868b6..c3fff5656fae4716ebf22aab6eb387f1585ab9bd 100644 --- a/recipes-bsp/bootscript/bootscript.bb +++ b/recipes-bsp/bootscript/bootscript.bb @@ -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 " diff --git a/recipes-bsp/bootscript/bootscript/mx8/boot.cfg b/recipes-bsp/bootscript/bootscript/mx8/boot.cfg new file mode 100644 index 0000000000000000000000000000000000000000..f43af81e8018a54d11c72d61c3aed07d4111978a --- /dev/null +++ b/recipes-bsp/bootscript/bootscript/mx8/boot.cfg @@ -0,0 +1,3 @@ +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"