Skip to content

Commit

Permalink
Merge branch 'all-dtbs' into dt/next
Browse files Browse the repository at this point in the history
  • Loading branch information
robherring committed Oct 4, 2018
2 parents 5d5a0ab + 92f687f commit 4355151
Show file tree
Hide file tree
Showing 27 changed files with 102 additions and 195 deletions.
37 changes: 36 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE
# Carefully list dependencies so we do not try to build scripts twice
# in parallel
PHONY += scripts
scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h)
scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h)
$(Q)$(MAKE) $(build)=$(@)

# Things we need to do before we recursively start building the kernel
Expand Down Expand Up @@ -1215,6 +1215,35 @@ kselftest-merge:
$(srctree)/tools/testing/selftests/*/config
+$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig

# ---------------------------------------------------------------------------
# Devicetree files

ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
dtstree := arch/$(SRCARCH)/boot/dts
endif

ifneq ($(dtstree),)

%.dtb: prepare3 scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@

PHONY += dtbs dtbs_install
dtbs: prepare3 scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree)

dtbs_install:
$(Q)$(MAKE) $(dtbinst)=$(dtstree)

ifdef CONFIG_OF_EARLY_FLATTREE
all: dtbs
endif

endif

PHONY += scripts_dtc
scripts_dtc: scripts_basic
$(Q)$(MAKE) $(build)=scripts/dtc

# ---------------------------------------------------------------------------
# Modules

Expand Down Expand Up @@ -1424,6 +1453,12 @@ help:
@echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing'
@echo ' .config.'
@echo ''
@$(if $(dtstree), \
echo 'Devicetree:'; \
echo '* dtbs - Build device tree blobs for enabled boards'; \
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \
echo '')

@echo 'Userspace tools targets:'
@echo ' use "make tools/help"'
@echo ' or "cd tools; make help"'
Expand Down
6 changes: 0 additions & 6 deletions arch/arc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,5 @@ boot_targets += uImage uImage.bin uImage.gz
$(boot_targets): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

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

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

archclean:
$(Q)$(MAKE) $(clean)=$(boot)
20 changes: 1 addition & 19 deletions arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,7 @@ else
KBUILD_IMAGE := $(boot)/zImage
endif

# Build the DT binary blobs if we have OF configured
ifeq ($(CONFIG_USE_OF),y)
KBUILD_DTBS := dtbs
endif

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


archheaders:
Expand All @@ -339,17 +334,6 @@ $(BOOT_TARGETS): vmlinux
$(INSTALL_TARGETS):
$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@

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

PHONY += dtbs dtbs_install

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

dtbs_install:
$(Q)$(MAKE) $(dtbinst)=$(boot)/dts

PHONY += vdso_install
vdso_install:
ifeq ($(CONFIG_VDSO),y)
Expand All @@ -371,8 +355,6 @@ define archhelp
echo ' uImage - U-Boot wrapped zImage'
echo ' bootpImage - Combined zImage and initial RAM disk'
echo ' (supply initrd image via make variable INITRD=<path>)'
echo '* dtbs - Build device tree blobs for enabled boards'
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
echo ' install - Install uncompressed kernel'
echo ' zinstall - Install compressed kernel'
echo ' uinstall - Install U-Boot wrapped compressed kernel'
Expand Down
17 changes: 1 addition & 16 deletions arch/arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
# Default target when executing plain make
boot := arch/arm64/boot
KBUILD_IMAGE := $(boot)/Image.gz
KBUILD_DTBS := dtbs

all: Image.gz $(KBUILD_DTBS)
all: Image.gz


Image: vmlinux
Expand All @@ -127,25 +126,13 @@ Image.%: Image
zinstall install:
$(Q)$(MAKE) $(build)=$(boot) $@

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

PHONY += dtbs dtbs_install

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

dtbs_install:
$(Q)$(MAKE) $(dtbinst)=$(boot)/dts

PHONY += vdso_install
vdso_install:
$(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@

# We use MRPROPER_FILES and CLEAN_FILES now
archclean:
$(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=$(boot)/dts

# We need to generate vdso-offsets.h before compiling certain files in kernel/.
# In order to do that, we should use the archprepare target, but we can't since
Expand All @@ -160,8 +147,6 @@ vdso_prepare: prepare0
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 ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
echo ' install - Install uncompressed kernel'
echo ' zinstall - Install compressed kernel'
echo ' Install using (your) ~/bin/installkernel or'
Expand Down
2 changes: 0 additions & 2 deletions arch/c6x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ boot := arch/$(ARCH)/boot
DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS)))
export DTB

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

# With make 3.82 we cannot mix normal and wildcard targets

Expand Down
17 changes: 7 additions & 10 deletions arch/c6x/boot/dts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@

DTC_FLAGS ?= -p 1024

dtb-$(CONFIG_SOC_TMS320C6455) += dsk6455.dtb
dtb-$(CONFIG_SOC_TMS320C6457) += evmc6457.dtb
dtb-$(CONFIG_SOC_TMS320C6472) += evmc6472.dtb
dtb-$(CONFIG_SOC_TMS320C6474) += evmc6474.dtb
dtb-$(CONFIG_SOC_TMS320C6678) += evmc6678.dtb

ifneq ($(DTB),)
obj-y += linked_dtb.o
obj-y += $(DTB).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
2 changes: 0 additions & 2 deletions arch/c6x/boot/dts/linked_dtb.S

This file was deleted.

1 change: 0 additions & 1 deletion arch/c6x/include/asm/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ extern char _vectors_start[];
extern char _vectors_end[];

extern char _data_lma[];
extern char _fdt_start[], _fdt_end[];

#endif /* _ASM_C6X_SECTIONS_H */
4 changes: 2 additions & 2 deletions arch/c6x/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ int __init c6x_add_memory(phys_addr_t start, unsigned long size)
notrace void __init machine_init(unsigned long dt_ptr)
{
void *dtb = __va(dt_ptr);
void *fdt = _fdt_start;
void *fdt = __dtb_start;

/* interrupts must be masked */
set_creg(IER, 2);
Expand Down Expand Up @@ -358,7 +358,7 @@ void __init setup_arch(char **cmdline_p)
memory_end >> PAGE_SHIFT);
memblock_reserve(memory_start, bootmap_size);

unflatten_device_tree();
unflatten_and_copy_device_tree();

c6x_cache_init();

Expand Down
10 changes: 0 additions & 10 deletions arch/c6x/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,6 @@ SECTIONS
*(.switch)
}

. = ALIGN (8) ;
__fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET)
{
_fdt_start = . ; /* place for fdt blob */
*(__fdt_blob) ; /* Any link-placed DTB */
BYTE(0); /* section always has contents */
. = _fdt_start + 0x4000; /* Pad up to 16kbyte */
_fdt_end = . ;
}

_etext = .;

/*
Expand Down
11 changes: 1 addition & 10 deletions arch/h8300/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,12 @@ CROSS_COMPILE := h8300-unknown-linux-
endif

core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""'
core-y += arch/h8300/boot/dts/
endif
core-y += arch/$(ARCH)/boot/dts/

libs-y += arch/$(ARCH)/lib/

boot := arch/h8300/boot

%.dtb %.dtb.S %.dtb.o: | scripts
$(Q)$(MAKE) $(build)=arch/h8300/boot/dts arch/h8300/boot/dts/$@

PHONY += dtbs
dtbs: scripts
$(Q)$(MAKE) $(build)=arch/h8300/boot/dts

archmrproper:

archclean:
Expand Down
4 changes: 1 addition & 3 deletions arch/microblaze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ 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)/dts/
endif
core-y += $(boot)/dts/

# defines filename extension depending memory management type
ifeq ($(CONFIG_MMU),)
Expand Down
4 changes: 4 additions & 0 deletions arch/microblaze/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# SPDX-License-Identifier: GPL-2.0
#

dtb-y := system.dtb

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

# Ensure system.dtb exists
Expand All @@ -11,6 +14,7 @@ ifneq ($(DTB),system)
$(obj)/system.dtb: $(obj)/$(DTB).dtb
$(call if_changed,cp)
endif
endif

quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
Expand Down
15 changes: 1 addition & 14 deletions arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -407,18 +407,7 @@ endif
CLEAN_FILES += vmlinux.32 vmlinux.64

# device-trees
core-$(CONFIG_BUILTIN_DTB) += arch/mips/boot/dts/

%.dtb %.dtb.S %.dtb.o: | scripts
$(Q)$(MAKE) $(build)=arch/mips/boot/dts arch/mips/boot/dts/$@

PHONY += dtbs
dtbs: scripts
$(Q)$(MAKE) $(build)=arch/mips/boot/dts

PHONY += dtbs_install
dtbs_install:
$(Q)$(MAKE) $(dtbinst)=arch/mips/boot/dts
core-y += arch/mips/boot/dts/

archprepare:
ifdef CONFIG_MIPS32_N32
Expand Down Expand Up @@ -461,8 +450,6 @@ define archhelp
echo ' uImage.lzma - U-Boot image (lzma)'
echo ' uImage.lzo - U-Boot image (lzo)'
echo ' uzImage.bin - U-Boot image (self-extracting)'
echo ' dtbs - Device-tree blobs for enabled boards'
echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
echo
echo ' These will be default as appropriate for a configured platform.'
echo
Expand Down
2 changes: 1 addition & 1 deletion arch/nds32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ CHECKFLAGS += -D__NDS32_EB__
endif

boot := arch/nds32/boot
core-$(BUILTIN_DTB) += $(boot)/dts/
core-y += $(boot)/dts/

.PHONY: FORCE

Expand Down
11 changes: 1 addition & 10 deletions arch/nios2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,13 @@ BOOT_TARGETS = vmImage zImage
PHONY += $(BOOT_TARGETS) install
KBUILD_IMAGE := $(nios2-boot)/vmImage

ifneq ($(CONFIG_NIOS2_DTB_SOURCE),"")
core-y += $(nios2-boot)/
endif
core-y += $(nios2-boot)/dts/

all: vmImage

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

%.dtb: | scripts
$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@

dtbs:
$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@

$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@

Expand All @@ -76,5 +68,4 @@ define archhelp
echo ' (your) ~/bin/$(INSTALLKERNEL) or'
echo ' (distribution) /sbin/$(INSTALLKERNEL) or'
echo ' install to $$(INSTALL_PATH)'
echo ' dtbs - Build device tree blobs for enabled boards'
endef
22 changes: 0 additions & 22 deletions arch/nios2/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,5 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
$(Q)$(MAKE) $(build)=$(obj)/compressed $@

# Rule to build device tree blobs
DTB_SRC := $(patsubst "%",%,$(CONFIG_NIOS2_DTB_SOURCE))

# Make sure the generated dtb gets removed during clean
extra-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += system.dtb

$(obj)/system.dtb: $(DTB_SRC) FORCE
$(call cmd,dtc)

# Ensure system.dtb exists
$(obj)/linked_dtb.o: $(obj)/system.dtb

obj-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += linked_dtb.o

targets += $(dtb-y)

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

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

install:
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
6 changes: 6 additions & 0 deletions arch/nios2/boot/dts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-2.0

obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))

dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
Loading

0 comments on commit 4355151

Please sign in to comment.