Generate a PIC executable blob tagged for XL-Boot that copies a image from FLASH to its linked address in RAM and executes it.
Signed-off-by: Stephan Linz <[email protected]> --- platforms/image_xlblob.in | 42 ++++++++++++++++++++++++ rules/post/image_xlblob.make | 73 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 0 deletions(-) create mode 100644 platforms/image_xlblob.in create mode 100644 rules/post/image_xlblob.make diff --git a/platforms/image_xlblob.in b/platforms/image_xlblob.in new file mode 100644 index 0000000..4da802c --- /dev/null +++ b/platforms/image_xlblob.in @@ -0,0 +1,42 @@ +## SECTION=image + +menuconfig IMAGE_XLBLOB + bool + select HOST_XL_TOOLS + depends on ARCH_MICROBLAZE + prompt "Generate XLBLOB Images " + help + Generate a PIC executable blob tagged for XL-Boot that copies + a image from FLASH to its linked address in RAM and executes it. + +if IMAGE_XLBLOB + +if U_BOOT + +config IMAGE_XLBLOB_U_BOOT + bool + depends on U_BOOT + prompt "Generate images/u-boot-xl " + default y + help + Generate a PIC executable blob tagged for XL-Boot that copies + the U-Boot image from FLASH to its linked address in RAM and + executes it. + +endif + +if KERNEL + +config IMAGE_XLBLOB_KERNEL + bool + depends on KERNEL + prompt "Generate images/linuximage-xl " + default y + help + Generate a PIC executable blob tagged for XL-Boot that copies + the Linux kernel image from FLASH to its linked address in RAM + and executes it. + +endif + +endif diff --git a/rules/post/image_xlblob.make b/rules/post/image_xlblob.make new file mode 100644 index 0000000..407931a --- /dev/null +++ b/rules/post/image_xlblob.make @@ -0,0 +1,73 @@ +# -*-makefile-*- +# +# Copyright (C) 2011 by Stephan Linz <[email protected]> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +ifeq ($(PTXCONF_IMAGE_XLBLOB_U_BOOT),y) + +U_BOOT_PAYLOAD := $(U_BOOT_DIR)/u-boot +U_BOOT_PAYLOAD_TYPE := U-Boot +U_BOOT_PAYLOAD_NAME := U-Boot-$(U_BOOT_VERSION) + +SEL_ROOTFS-$(PTXCONF_U_BOOT) += $(IMAGEDIR)/u-boot-xl.bin +SEL_ROOTFS-$(PTXCONF_U_BOOT) += $(IMAGEDIR)/u-boot-xl.srec +SEL_ROOTFS-$(PTXCONF_U_BOOT) += $(IMAGEDIR)/u-boot-xl.elf + +$(U_BOOT_DIR)/u-boot-xl.bin \ +$(U_BOOT_DIR)/u-boot-xl.srec \ +$(U_BOOT_DIR)/u-boot-xl.elf: $(STATEDIR)/u-boot.xlblob + +$(IMAGEDIR)/u-boot-xl.%: $(U_BOOT_DIR)/u-boot-xl.% $(STATEDIR)/u-boot.targetinstall + @echo -n "Creating '$(notdir $(@))' from '$(notdir $(<))'..." + @install -m 644 "$(<)" "$(@)" + @echo "done." + +endif + +ifeq ($(PTXCONF_IMAGE_XLBLOB_KERNEL),y) + +KERNEL_PAYLOAD := $(KERNEL_IMAGE_PATH_y) +KERNEL_PAYLOAD_TYPE := Linux +KERNEL_PAYLOAD_NAME := Linux-$(KERNEL_VERSION) + +SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL) += $(IMAGEDIR)/linuximage-xl.bin +SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL) += $(IMAGEDIR)/linuximage-xl.srec +SEL_ROOTFS-$(PTXCONF_IMAGE_KERNEL) += $(IMAGEDIR)/linuximage-xl.elf + +$(KERNEL_IMAGE_PATH_y)-xl.bin \ +$(KERNEL_IMAGE_PATH_y)-xl.srec \ +$(KERNEL_IMAGE_PATH_y)-xl.elf: $(STATEDIR)/kernel.xlblob + +ifeq ($(PTXCONF_IMAGE_KERNEL_INITRAMFS),y) +$(IMAGEDIR)/linuximage-xl.bin \ +$(IMAGEDIR)/linuximage-xl.srec \ +$(IMAGEDIR)/linuximage-xl.elf: $(STATEDIR)/image_kernel.compile +endif + +$(IMAGEDIR)/linuximage-xl.%: $(KERNEL_IMAGE_PATH_y)-xl.% $(STATEDIR)/kernel.targetinstall + @echo -n "Creating '$(notdir $(@))' from '$(notdir $(<))'..." + @install -m 644 "$(<)" "$(@)" + @echo "done." + +endif + +$(STATEDIR)/%.xlblob: $(STATEDIR)/%.compile + @$(call targetinfo) + @$(call xilinx/xlblob, $(PTX_MAP_TO_PACKAGE_$(*)), \ + $($(PTX_MAP_TO_PACKAGE_$(*))_DIR), \ + $($(PTX_MAP_TO_PACKAGE_$(*))_PAYLOAD), \ + $($(PTX_MAP_TO_PACKAGE_$(*))_PAYLOAD_TYPE), \ + $($(PTX_MAP_TO_PACKAGE_$(*))_PAYLOAD_NAME)) + @$(call touch) + +xilinx/xlblob = \ + $(call world/env, $(1)) \ + cd $(2) && $(CROSS_ENV) \ + $(PTXCONF_SYSROOT_HOST)/bin/mkxlblob -t $(4) -n $(5) -o $(3)-xl $(3) + +# vim: syntax=make -- 1.6.0.4 -- ptxdist mailing list [email protected]
