]> rtime.felk.cvut.cz Git - fpga/zynq/canbench-sw.git/blobdiff - petalinux/Makefile
uboot images migrated to FIT, bootscript loads only 1 image (faster)
[fpga/zynq/canbench-sw.git] / petalinux / Makefile
index 7a71d5bc057649fa2cf88446a9204b2911fd4550..71402b30ef9c199ba9620ee8e9f82a8cdff0b44f 100644 (file)
@@ -7,23 +7,35 @@ config: .configured
 .configured:
        petalinux-config --get-hw-description ../system --oldconfig
        $(MAKE) subsystems/linux/configs/u-boot/platform-auto.h
-       touch .configured
+       #touch .configured
 
-build: .configured
+build: .configured subsystems/linux/configs/u-boot/platform-auto.h
        petalinux-build
        $(MAKE) bootscript images/linux/BOOT.BIN
 
 images/linux/BOOT.BIN: FORCE
        cd images/linux && petalinux-package --boot --fsbl zynq_fsbl.elf --u-boot u-boot.elf --force
 
-bootscript: bootscript.txt
-       mkimage -A arm -O u-boot -T script -C none -a 0 -e 0 -n "t-Boot Script" -d $< $@
+bootscript: bootscript.txt bootscript.its
+       #mkimage -A arm -O u-boot -T script -C none -a 0 -e 0 -n "t-Boot Script" -d $< $@
+       mkimage -f bootscript.its $@
 
 subsystems/linux/configs/u-boot/platform-auto.h: FORCE | build/linux/u-boot/Makefile
        $(MAKE) UBOOT_AUTO_CONFIG=y -C build/linux/u-boot autogen-config
        sed -r -i '/PSSERIAL0 \\/r uboot-extra-env.h' $@
+       # HACK: force enable legacy image format; it is needed for everything (script, kernel, device tree)
+       #       but something sometimes will go crazy and disable it, sometimes it does not
+       #       With this hack it works OK.
+       sed -r -i '/CONFIG_BOOTCOMMAND/a #define CONFIG_IMAGE_FORMAT_LEGACY' $@
+       sed -r -i '/CONFIG_BOOTCOMMAND/a #undef CONFIG_BOOTP_SERVERIP' $@
 
 build/linux/u-boot/Makefile:
        petalinux-build -c u-boot
 
+images/linux/system.bit.gz: ../system/system.bit
+       gzip -9 <$< >$@
+
+images/linux/image.ub: FORCE images/linux/system.bit.gz
+       mkimage -f uboot-image.its $@
+
 FORCE: