Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165954
b: refs/heads/master
c: f05131c
h: refs/heads/master
v: v3
  • Loading branch information
Michal Simek committed Sep 24, 2009
1 parent e33e302 commit 6341a80
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cfa9a775b9ddcef7f53c35e489a71cfed8c02710
refs/heads/master: f05131cd7a9521031ccb1afd6234ce57ff03ae45
27 changes: 23 additions & 4 deletions trunk/arch/microblaze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,41 @@ core-y += arch/microblaze/platform/

boot := arch/microblaze/boot

# Are we making a simpleImage.<boardname> target? If so, crack out the boardname
DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS)))

ifneq ($(DTB),)
core-y += $(boot)/
endif

# defines filename extension depending memory management type
ifeq ($(CONFIG_MMU),)
MMU := -nommu
endif

export MMU
export MMU DTB

all: linux.bin

BOOT_TARGETS = linux.bin linux.bin.gz simpleImage.%

archclean:
$(Q)$(MAKE) $(clean)=$(boot)

linux.bin linux.bin.gz: vmlinux
$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

define archhelp
echo '* linux.bin - Create raw binary'
echo ' linux.bin.gz - Create compressed raw binary'
echo '* linux.bin - Create raw binary'
echo ' linux.bin.gz - Create compressed raw binary'
echo ' simpleImage.<dt> - ELF image with $(arch)/boot/dts/<dt>.dts linked in'
echo ' - stripped elf with fdt blob
echo ' simpleImage.<dt>.unstrip - full ELF image with fdt blob'
echo ' *_defconfig - Select default config from arch/microblaze/configs'
echo ''
echo ' Targets with <dt> embed a device tree blob inside the image'
echo ' These targets support board with firmware that does not'
echo ' support passing a device tree directly. Replace <dt> with the'
echo ' name of a dts file from the arch/microblaze/boot/dts/ directory'
echo ' (minus the .dts extension).'
endef
41 changes: 39 additions & 2 deletions trunk/arch/microblaze/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
1 change: 1 addition & 0 deletions trunk/arch/microblaze/boot/dts/system.dts
3 changes: 3 additions & 0 deletions trunk/arch/microblaze/boot/linked_dtb.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.section __fdt_blob,"a"
.incbin "arch/microblaze/boot/system.dtb"

0 comments on commit 6341a80

Please sign in to comment.