Skip to content

Commit

Permalink
Merge remote-tracking branch 'robherring/for-next' into devicetree/next
Browse files Browse the repository at this point in the history
  • Loading branch information
glikely committed Dec 4, 2012
2 parents 465aac6 + 300db34 commit f2dcd0f
Show file tree
Hide file tree
Showing 24 changed files with 88 additions and 92 deletions.
15 changes: 8 additions & 7 deletions Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1175,15 +1175,16 @@ When kbuild executes, the following steps are followed (roughly):
in an init section in the image. Platform code *must* copy the
blob to non-init memory prior to calling unflatten_device_tree().

Example:
#arch/x86/platform/ce4100/Makefile
clean-files := *dtb.S
To use this command, simply add *.dtb into obj-y or targets, or make
some other target depend on %.dtb

DTC_FLAGS := -p 1024
obj-y += foo.dtb.o
A central rule exists to create $(obj)/%.dtb from $(src)/%.dts;
architecture Makefiles do no need to explicitly write out that rule.

$(obj)/%.dtb: $(src)/%.dts
$(call cmd,dtc)
Example:
targets += $(dtb-y)
clean-files += *.dtb
DTC_FLAGS ?= -p 1024

--- 6.8 Custom kbuild commands

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ zinstall uinstall install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@

%.dtb: scripts
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@

dtbs: scripts
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
$(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) dtbs

# We use MRPROPER_FILES and CLEAN_FILES now
archclean:
Expand Down
12 changes: 0 additions & 12 deletions arch/arm/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ ifneq ($(MACHINE),)
include $(srctree)/$(MACHINE)/Makefile.boot
endif

include $(srctree)/arch/arm/boot/dts/Makefile

# Note: the following conditions must always be true:
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
# PARAMS_PHYS must be within 4MB of ZRELADDR
Expand Down Expand Up @@ -59,16 +57,6 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE

endif

targets += $(dtb-y)

# Rule to build device tree blobs
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)

$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))

clean-files := *.dtb

ifneq ($(LOADADDR),)
UIMAGE_LOADADDR=$(LOADADDR)
else
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,12 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
wm8505-ref.dtb \
wm8650-mid.dtb

targets += dtbs
endif

# *.dtb used to be generated in the directory above. Clean out the
# old build results so people don't accidentally use them.
dtbs: $(addprefix $(obj)/, $(dtb-y))
$(Q)rm -f $(obj)/../*.dtb

clean-files := *.dtb
17 changes: 11 additions & 6 deletions arch/arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,24 @@ libs-y := arch/arm64/lib/ $(libs-y)
libs-y += $(LIBGCC)

# Default target when executing plain make
KBUILD_IMAGE := Image.gz
KBUILD_IMAGE := Image.gz
KBUILD_DTBS := dtbs

all: $(KBUILD_IMAGE)
all: $(KBUILD_IMAGE) $(KBUILD_DTBS)

boot := arch/arm64/boot

Image Image.gz: vmlinux
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

zinstall install: vmlinux
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
$(Q)$(MAKE) $(build)=$(boot) $@

%.dtb:
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
%.dtb: scripts
$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@

dtbs: scripts
$(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@

# We use MRPROPER_FILES and CLEAN_FILES now
archclean:
Expand All @@ -63,6 +67,7 @@ archclean:
define archhelp
echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
echo '* dtbs - Build device tree blobs for enabled boards'
echo ' install - Install uncompressed kernel'
echo ' zinstall - Install compressed kernel'
echo ' Install using (your) ~/bin/installkernel or'
Expand Down
5 changes: 0 additions & 5 deletions arch/arm64/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ $(obj)/Image: vmlinux FORCE
$(obj)/Image.gz: $(obj)/Image FORCE
$(call if_changed,gzip)

$(obj)/%.dtb: $(src)/dts/%.dts
$(call cmd,dtc)

install: $(obj)/Image
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image System.map "$(INSTALL_PATH)"

zinstall: $(obj)/Image.gz
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image.gz System.map "$(INSTALL_PATH)"

clean-files += *.dtb
1 change: 1 addition & 0 deletions arch/arm64/boot/dts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.dtb
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
targets += dtbs

dtbs: $(addprefix $(obj)/, $(dtb-y))

clean-files := *.dtb
2 changes: 1 addition & 1 deletion arch/c6x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS)))
export DTB

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

# With make 3.82 we cannot mix normal and wildcard targets
Expand Down
20 changes: 0 additions & 20 deletions arch/c6x/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,5 @@ OBJCOPYFLAGS_vmlinux.bin := -O binary
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)

DTC_FLAGS ?= -p 1024

ifneq ($(DTB),)
obj-y += linked_dtb.o
endif

$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)

quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)

# Generate builtin.dtb from $(DTB).dtb
$(obj)/builtin.dtb: $(obj)/$(DTB).dtb
$(call if_changed,cp)

$(obj)/linked_dtb.o: $(obj)/builtin.dtb

$(obj)/dtbImage.%: vmlinux
$(call if_changed,objcopy)

clean-files := $(obj)/*.dtb
20 changes: 20 additions & 0 deletions arch/c6x/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Makefile for device trees
#

DTC_FLAGS ?= -p 1024

ifneq ($(DTB),)
obj-y += linked_dtb.o
endif

quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)

# Generate builtin.dtb from $(DTB).dtb
$(obj)/builtin.dtb: $(obj)/$(DTB).dtb
$(call if_changed,cp)

$(obj)/linked_dtb.o: $(obj)/builtin.dtb

clean-files := *.dtb
2 changes: 2 additions & 0 deletions arch/c6x/boot/dts/linked_dtb.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.section __fdt_blob,"a"
.incbin "arch/c6x/boot/dts/builtin.dtb"
2 changes: 0 additions & 2 deletions arch/c6x/boot/linked_dtb.S

This file was deleted.

2 changes: 1 addition & 1 deletion arch/microblaze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ boot := arch/microblaze/boot
DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS)))

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

# defines filename extension depending memory management type
Expand Down
19 changes: 1 addition & 18 deletions arch/microblaze/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,10 @@
# arch/microblaze/boot/Makefile
#

obj-y += linked_dtb.o

targets := linux.bin linux.bin.gz simpleImage.%

OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary

# 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
$(call if_changed,objcopy)
$(call if_changed,uimage)
Expand Down Expand Up @@ -45,10 +34,4 @@ $(obj)/simpleImage.%: vmlinux FORCE
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'


# Rule to build device tree blobs
DTC_FLAGS := -p 1024

$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)

clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub
clean-files += simpleImage.*.unstrip linux.bin.ub
22 changes: 22 additions & 0 deletions arch/microblaze/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# arch/microblaze/boot/Makefile
#

obj-y += linked_dtb.o

# 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

quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)

# Rule to build device tree blobs
DTC_FLAGS := -p 1024

clean-files += *.dtb
2 changes: 2 additions & 0 deletions arch/microblaze/boot/dts/linked_dtb.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.section __fdt_blob,"a"
.incbin "arch/microblaze/boot/dts/system.dtb"
3 changes: 0 additions & 3 deletions arch/microblaze/boot/linked_dtb.S

This file was deleted.

3 changes: 0 additions & 3 deletions arch/mips/cavium-octeon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ DTB_FILES = $(patsubst %.dts, %.dtb, $(DTS_FILES))

obj-y += $(patsubst %.dts, %.dtb.o, $(DTS_FILES))

$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)

# Let's keep the .dtb files around in case we want to look at them.
.SECONDARY: $(addprefix $(obj)/, $(DTB_FILES))

Expand Down
3 changes: 0 additions & 3 deletions arch/mips/lantiq/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
obj-$(CONFIG_DT_EASY50712) := easy50712.dtb.o

$(obj)/%.dtb: $(obj)/%.dts
$(call if_changed,dtc)
3 changes: 0 additions & 3 deletions arch/mips/netlogic/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o

$(obj)/%.dtb: $(obj)/%.dts
$(call if_changed,dtc)
2 changes: 1 addition & 1 deletion arch/openrisc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ BUILTIN_DTB := y
else
BUILTIN_DTB := n
endif
core-$(BUILTIN_DTB) += arch/openrisc/boot/
core-$(BUILTIN_DTB) += arch/openrisc/boot/dts/

all: vmlinux
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""'
BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_OPENRISC_BUILTIN_DTB)).dtb.o
else
Expand All @@ -10,6 +8,3 @@ obj-y += $(BUILTIN_DTB)
clean-files := *.dtb.S

#DTC_FLAGS ?= -p 1024

$(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call if_changed_dep,dtc)
3 changes: 3 additions & 0 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
quiet_cmd_dtc = DTC $@
cmd_dtc = $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) -d $(depfile) $<

$(obj)/%.dtb: $(src)/%.dts FORCE
$(call if_changed_dep,dtc)

# Bzip2
# ---------------------------------------------------------------------------

Expand Down

0 comments on commit f2dcd0f

Please sign in to comment.