$(MAKE) -C petalinux images/linux/BOOT.BIN
.PHONY: dist
-dist: system/system.hdf system/system.bit petalinux/bootscript petalinux/images/linux/BOOT.BIN
+dist: system/system.bit petalinux/bootscript petalinux/images/linux/BOOT.BIN petalinux/images/linux/image.ub petalinux/images/linux/system.dtb
+ $(MAKE) -C petalinux images/linux/image.ub
cp -t $(TFTPROOT) $^
petalinux_config: system/system.hdf
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
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:
--- /dev/null
+/dts-v1/;
+
+/ {
+ description = "bootscript";
+ #address-cells = <1>;
+
+ images {
+ bootscript@1 {
+ description = "Bootscript";
+ data = /incbin/("./bootscript.txt");
+ type = "script";
+ compression = "none";
+ hash@1 {
+ algo = "crc32";
+ };
+ };
+ };
+};
echo "Running bootscript ..."
-setenv tftp_dir ''
-
setenv tftp_path /uzedcan
-setenv bitstream_image ${tftp_path}/system.bit
-setenv dtb_img ${tftp_path}/system.dtb
-setenv kernel_img ${tftp_path}/image.ub
-setenv nfsserverip 192.168.1.75
-#setenv nfsserverip 147.32.86.163
+#setenv nfsserverip 192.168.1.75
+setenv nfsserverip 147.32.86.163
setenv nfspath /export/canbench
# If duplicate parameters are present, the later will take effect.
setenv bootargs ${bootargs} ip=${ipaddr} root=/dev/nfs rw nfsroot=${nfsserverip}:${nfspath}
-setenv bitstream_load_address 0x04000000
-
-setenv bitstream_tftp 'echo === Loading FPGA bitstream; tftpboot ${bitstream_load_address} ${tftp_dir}${bitstream_image}'
-setenv dtb_tftp 'echo === Loading Device Tree; tftpboot ${dtbnetstart} ${tftp_dir}${dtb_img}'
-setenv kernel_tftp 'echo === Loading Linux kernel; tftpboot ${netstart} ${tftp_dir}${kernel_img}'
+setenv image_img ${tftp_path}/image.ub
+setenv image_tftp 'echo === Loading boot image; tftpboot ${netstart} ${tftp_dir}${image_img}; fdt addr ${netstart}'
+setenv bitstream_unpack 'fdt get size filesize /images/fpga@1 data; imxtract ${netstart} fpga@1 ${bitstream_load_address}'
+setenv boot_now 'bootm ${netstart}'
+setenv bitstream_load_address 0x04000000
setenv bitstream_load 'fpga loadb 0 ${bitstream_load_address} ${filesize}'
-setenv boot_now 'bootm ${netstart} - ${dtbnetstart}'
-
-run bitstream_tftp bitstream_load kernel_tftp dtb_tftp boot_now
+run image_tftp bitstream_unpack bitstream_load boot_now
serverip=192.168.1.75
bootscript_addr=0x01000000
bootscript_path=bootscript
-tboot=tftpboot ${bootscript_addr} ${serverip}:${bootscript_path} && source ${bootscript_addr}
-default_bootcmd=run tboot
+tboot=tftpboot ${bootscript_addr} ${serverip}:${bootscript_path} && source ${bootscript_addr}:bootscript@1
+default_bootcmd=dhcp; run tboot
--- /dev/null
+/*
+ * Simple U-boot uImage source file containing a single kernel and FDT blob
+ */
+
+/dts-v1/;
+
+/ {
+ description = "Kernel for MicroZed";
+ #address-cells = <1>;
+
+ images {
+ kernel@1 {
+ description = "Linux kernel";
+ data = /incbin/("./images/linux/zImage");
+ type = "kernel";
+ arch = "arm";
+ os = "linux";
+ compression = "none";
+ load = <0x00008000>;
+ entry = <0x00008000>;
+ hash@1 {
+ algo = "crc32";
+ };
+ hash@2 {
+ algo = "sha1";
+ };
+ };
+ fdt@1 {
+ description = "Flattened Device Tree blob";
+ data = /incbin/("./images/linux/system.dtb");
+ type = "flat_dt";
+ arch = "arm";
+ compression = "none";
+ hash@1 {
+ algo = "crc32";
+ };
+ hash@2 {
+ algo = "sha1";
+ };
+ };
+ fpga@1 {
+ description = "FPGA bitstream";
+ data = /incbin/("./images/linux/system.bit.gz");
+ type = "filesystem";
+ compression = "gzip";
+ hash@1 {
+ algo = "crc32";
+ };
+ hash@2 {
+ algo = "sha1";
+ };
+ };
+ };
+
+ configurations {
+ default = "conf@1";
+ conf@1 {
+ description = "Boot Linux kernel with FDT blob";
+ kernel = "kernel@1";
+ fdt = "fdt@1";
+ };
+ };
+};