From f05131cd7a9521031ccb1afd6234ce57ff03ae45 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 14 Sep 2009 15:15:49 +0200 Subject: microblaze: Support simpleImage.dts make target Instead of remembering to specify DTB= on the make commandline, this commit allows the much friendlier make simpleImage. where .dts is expected to be found in arch/microblaze/boot/dts/ The resulting vmlinux, with the compiled DTS linked in, will be copied to boot/simpleImage. This mirrors the same functionality as on PowerPC, albeit achieving it in a slightly different way. + strip simpleImage file The size of output file is very similar to linux.bin. vmlinux - full elf without fdt blob simpleImage..unstrip - full elf with fdt blob simpleImage. - stripped elf with fdt blob Add symlink to generic system.dts in platform folder Signed-off-by: John Williams Signed-off-by: Michal Simek --- arch/microblaze/boot/Makefile | 41 +++++++++++++++++++++++++++++++++++-- arch/microblaze/boot/dts/system.dts | 1 + arch/microblaze/boot/linked_dtb.S | 3 +++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 120000 arch/microblaze/boot/dts/system.dts create mode 100644 arch/microblaze/boot/linked_dtb.S (limited to 'arch/microblaze/boot') diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile index c2bb043a029d..21f13322a4ca 100644 --- a/arch/microblaze/boot/Makefile +++ b/arch/microblaze/boot/Makefile @@ -2,10 +2,24 @@ # arch/microblaze/boot/Makefile # -targets := linux.bin linux.bin.gz +obj-y += linked_dtb.o + +targets := linux.bin linux.bin.gz simpleImage.% OBJCOPYFLAGS_linux.bin := -O binary +# Where the DTS files live +dtstree := $(srctree)/$(src)/dts + +# Ensure system.dtb exists +$(obj)/linked_dtb.o: $(obj)/system.dtb + +# Generate system.dtb from $(DTB).dtb +ifneq ($(DTB),system) +$(obj)/system.dtb: $(obj)/$(DTB).dtb + $(call if_changed,cp) +endif + $(obj)/linux.bin: vmlinux FORCE [ -n $(CONFIG_INITRAMFS_SOURCE) ] && [ ! -e $(CONFIG_INITRAMFS_SOURCE) ] && \ touch $(CONFIG_INITRAMFS_SOURCE) || echo "No CPIO image" @@ -16,4 +30,27 @@ $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE $(call if_changed,gzip) @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' -clean-kernel += linux.bin linux.bin.gz +quiet_cmd_cp = CP $< $@$2 + cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) + +quiet_cmd_strip = STRIP $@ + cmd_strip = $(STRIP) -K _start -K _end -K __log_buf -K _fdt_start vmlinux -o $@ + +$(obj)/simpleImage.%: vmlinux FORCE + $(call if_changed,cp,.unstrip) + $(call if_changed,strip) + @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' + +# Rule to build device tree blobs +DTC = $(objtree)/scripts/dtc/dtc + +# Rule to build device tree blobs +quiet_cmd_dtc = DTC $@ + cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 -p 1024 $(dtstree)/$*.dts + +$(obj)/%.dtb: $(dtstree)/%.dts FORCE + $(call if_changed,dtc) + +clean-kernel += linux.bin linux.bin.gz simpleImage.* + +clean-files += *.dtb diff --git a/arch/microblaze/boot/dts/system.dts b/arch/microblaze/boot/dts/system.dts new file mode 120000 index 000000000000..7cb657892f21 --- /dev/null +++ b/arch/microblaze/boot/dts/system.dts @@ -0,0 +1 @@ +../../platform/generic/system.dts \ No newline at end of file diff --git a/arch/microblaze/boot/linked_dtb.S b/arch/microblaze/boot/linked_dtb.S new file mode 100644 index 000000000000..cb2b537aebee --- /dev/null +++ b/arch/microblaze/boot/linked_dtb.S @@ -0,0 +1,3 @@ +.section __fdt_blob,"a" +.incbin "arch/microblaze/boot/system.dtb" + -- cgit v1.2.3-59-g8ed1b