diff options
author | Michal Simek <monstr@monstr.eu> | 2009-09-14 09:15:49 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-09-24 04:28:22 -0400 |
commit | f05131cd7a9521031ccb1afd6234ce57ff03ae45 (patch) | |
tree | 35723939661604ca031afead37cb5e270362e9d2 /arch | |
parent | cfa9a775b9ddcef7f53c35e489a71cfed8c02710 (diff) |
microblaze: Support simpleImage.dts make target
Instead of remembering to specify DTB= on the make commandline, this commit
allows the much friendlier make simpleImage.<dts>
where <dts>.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.<dts>
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.<dtb name>.unstrip - full elf with fdt blob
simpleImage.<dtb name> - stripped elf with fdt blob
Add symlink to generic system.dts in platform folder
Signed-off-by: John Williams <john.williams@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/Makefile | 27 | ||||
-rw-r--r-- | arch/microblaze/boot/Makefile | 41 | ||||
l--------- | arch/microblaze/boot/dts/system.dts | 1 | ||||
-rw-r--r-- | arch/microblaze/boot/linked_dtb.S | 3 |
4 files changed, 66 insertions, 6 deletions
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 737a4dc72ed9..34187354304a 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile | |||
@@ -53,22 +53,41 @@ core-y += arch/microblaze/platform/ | |||
53 | 53 | ||
54 | boot := arch/microblaze/boot | 54 | boot := arch/microblaze/boot |
55 | 55 | ||
56 | # Are we making a simpleImage.<boardname> target? If so, crack out the boardname | ||
57 | DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS))) | ||
58 | |||
59 | ifneq ($(DTB),) | ||
60 | core-y += $(boot)/ | ||
61 | endif | ||
62 | |||
56 | # defines filename extension depending memory management type | 63 | # defines filename extension depending memory management type |
57 | ifeq ($(CONFIG_MMU),) | 64 | ifeq ($(CONFIG_MMU),) |
58 | MMU := -nommu | 65 | MMU := -nommu |
59 | endif | 66 | endif |
60 | 67 | ||
61 | export MMU | 68 | export MMU DTB |
62 | 69 | ||
63 | all: linux.bin | 70 | all: linux.bin |
64 | 71 | ||
72 | BOOT_TARGETS = linux.bin linux.bin.gz simpleImage.% | ||
73 | |||
65 | archclean: | 74 | archclean: |
66 | $(Q)$(MAKE) $(clean)=$(boot) | 75 | $(Q)$(MAKE) $(clean)=$(boot) |
67 | 76 | ||
68 | linux.bin linux.bin.gz: vmlinux | 77 | $(BOOT_TARGETS): vmlinux |
69 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | 78 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
70 | 79 | ||
71 | define archhelp | 80 | define archhelp |
72 | echo '* linux.bin - Create raw binary' | 81 | echo '* linux.bin - Create raw binary' |
73 | echo ' linux.bin.gz - Create compressed raw binary' | 82 | echo ' linux.bin.gz - Create compressed raw binary' |
83 | echo ' simpleImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in' | ||
84 | echo ' - stripped elf with fdt blob | ||
85 | echo ' simpleImage.<dt>.unstrip - full ELF image with fdt blob' | ||
86 | echo ' *_defconfig - Select default config from arch/microblaze/configs' | ||
87 | echo '' | ||
88 | echo ' Targets with <dt> embed a device tree blob inside the image' | ||
89 | echo ' These targets support board with firmware that does not' | ||
90 | echo ' support passing a device tree directly. Replace <dt> with the' | ||
91 | echo ' name of a dts file from the arch/microblaze/boot/dts/ directory' | ||
92 | echo ' (minus the .dts extension).' | ||
74 | endef | 93 | endef |
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 @@ | |||
2 | # arch/microblaze/boot/Makefile | 2 | # arch/microblaze/boot/Makefile |
3 | # | 3 | # |
4 | 4 | ||
5 | targets := linux.bin linux.bin.gz | 5 | obj-y += linked_dtb.o |
6 | |||
7 | targets := linux.bin linux.bin.gz simpleImage.% | ||
6 | 8 | ||
7 | OBJCOPYFLAGS_linux.bin := -O binary | 9 | OBJCOPYFLAGS_linux.bin := -O binary |
8 | 10 | ||
11 | # Where the DTS files live | ||
12 | dtstree := $(srctree)/$(src)/dts | ||
13 | |||
14 | # Ensure system.dtb exists | ||
15 | $(obj)/linked_dtb.o: $(obj)/system.dtb | ||
16 | |||
17 | # Generate system.dtb from $(DTB).dtb | ||
18 | ifneq ($(DTB),system) | ||
19 | $(obj)/system.dtb: $(obj)/$(DTB).dtb | ||
20 | $(call if_changed,cp) | ||
21 | endif | ||
22 | |||
9 | $(obj)/linux.bin: vmlinux FORCE | 23 | $(obj)/linux.bin: vmlinux FORCE |
10 | [ -n $(CONFIG_INITRAMFS_SOURCE) ] && [ ! -e $(CONFIG_INITRAMFS_SOURCE) ] && \ | 24 | [ -n $(CONFIG_INITRAMFS_SOURCE) ] && [ ! -e $(CONFIG_INITRAMFS_SOURCE) ] && \ |
11 | touch $(CONFIG_INITRAMFS_SOURCE) || echo "No CPIO image" | 25 | touch $(CONFIG_INITRAMFS_SOURCE) || echo "No CPIO image" |
@@ -16,4 +30,27 @@ $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE | |||
16 | $(call if_changed,gzip) | 30 | $(call if_changed,gzip) |
17 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' | 31 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
18 | 32 | ||
19 | clean-kernel += linux.bin linux.bin.gz | 33 | quiet_cmd_cp = CP $< $@$2 |
34 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | ||
35 | |||
36 | quiet_cmd_strip = STRIP $@ | ||
37 | cmd_strip = $(STRIP) -K _start -K _end -K __log_buf -K _fdt_start vmlinux -o $@ | ||
38 | |||
39 | $(obj)/simpleImage.%: vmlinux FORCE | ||
40 | $(call if_changed,cp,.unstrip) | ||
41 | $(call if_changed,strip) | ||
42 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' | ||
43 | |||
44 | # Rule to build device tree blobs | ||
45 | DTC = $(objtree)/scripts/dtc/dtc | ||
46 | |||
47 | # Rule to build device tree blobs | ||
48 | quiet_cmd_dtc = DTC $@ | ||
49 | cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 -p 1024 $(dtstree)/$*.dts | ||
50 | |||
51 | $(obj)/%.dtb: $(dtstree)/%.dts FORCE | ||
52 | $(call if_changed,dtc) | ||
53 | |||
54 | clean-kernel += linux.bin linux.bin.gz simpleImage.* | ||
55 | |||
56 | 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 @@ | |||
1 | .section __fdt_blob,"a" | ||
2 | .incbin "arch/microblaze/boot/system.dtb" | ||
3 | |||