Skip to content

Commit

Permalink
Merge git://git.denx.de/u-boot-dm
Browse files Browse the repository at this point in the history
  • Loading branch information
trini committed Dec 20, 2016
2 parents 2346511 + 68af100 commit 36737f2
Show file tree
Hide file tree
Showing 91 changed files with 3,709 additions and 300 deletions.
57 changes: 11 additions & 46 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,12 @@ u-boot.ldr: u-boot
$(LDR) -T $(CONFIG_CPU) -c $@ $< $(LDR_FLAGS)
$(BOARD_SIZE_CHECK)

# binman
# ---------------------------------------------------------------------------
quiet_cmd_binman = BINMAN $@
cmd_binman = $(srctree)/tools/binman/binman -d u-boot.dtb -O . \
-I . -I $(srctree)/board/$(BOARDDIR) $<

OBJCOPYFLAGS_u-boot.ldr.hex := -I binary -O ihex

OBJCOPYFLAGS_u-boot.ldr.srec := -I binary -O srec
Expand Down Expand Up @@ -1047,50 +1053,11 @@ endif

# x86 uses a large ROM. We fill it with 0xff, put the 16-bit stuff (including
# reset vector) at the top, Intel ME descriptor at the bottom, and U-Boot in
# the middle.
# the middle. This is handled by binman based on an image description in the
# board's device tree.
ifneq ($(CONFIG_X86_RESET_VECTOR),)
rom: u-boot.rom FORCE

IFDTOOL=$(objtree)/tools/ifdtool
IFDTOOL_FLAGS = -f 0:$(objtree)/u-boot.dtb
IFDTOOL_FLAGS += -m 0x$(shell $(NM) u-boot |grep _dt_ucode_base_size |cut -d' ' -f1)
IFDTOOL_FLAGS += -U $(CONFIG_SYS_TEXT_BASE):$(objtree)/u-boot-nodtb.bin
IFDTOOL_FLAGS += -w $(CONFIG_SYS_X86_START16):$(objtree)/u-boot-x86-16bit.bin
IFDTOOL_FLAGS += -C

ifneq ($(CONFIG_HAVE_INTEL_ME),)
IFDTOOL_ME_FLAGS = -D $(srctree)/board/$(BOARDDIR)/descriptor.bin
IFDTOOL_ME_FLAGS += -i ME:$(srctree)/board/$(BOARDDIR)/me.bin
endif

ifneq ($(CONFIG_HAVE_MRC),)
IFDTOOL_FLAGS += -w $(CONFIG_X86_MRC_ADDR):$(srctree)/board/$(BOARDDIR)/mrc.bin
endif

ifneq ($(CONFIG_HAVE_FSP),)
IFDTOOL_FLAGS += -w $(CONFIG_FSP_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_FSP_FILE)
endif

ifneq ($(CONFIG_HAVE_CMC),)
IFDTOOL_FLAGS += -w $(CONFIG_CMC_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_CMC_FILE)
endif

ifneq ($(CONFIG_HAVE_VGA_BIOS),)
IFDTOOL_FLAGS += -w $(CONFIG_VGA_BIOS_ADDR):$(srctree)/board/$(BOARDDIR)/$(CONFIG_VGA_BIOS_FILE)
endif

ifneq ($(CONFIG_HAVE_REFCODE),)
IFDTOOL_FLAGS += -w $(CONFIG_X86_REFCODE_ADDR):refcode.bin
endif

quiet_cmd_ifdtool = IFDTOOL $@
cmd_ifdtool = $(IFDTOOL) -c -r $(CONFIG_ROM_SIZE) u-boot.tmp;
ifneq ($(CONFIG_HAVE_INTEL_ME),)
cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_ME_FLAGS) u-boot.tmp;
endif
cmd_ifdtool += $(IFDTOOL) $(IFDTOOL_FLAGS) u-boot.tmp;
cmd_ifdtool += mv u-boot.tmp $@

refcode.bin: $(srctree)/board/$(BOARDDIR)/refcode.bin FORCE
$(call if_changed,copy)

Expand All @@ -1100,18 +1067,16 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \

u-boot.rom: u-boot-x86-16bit.bin u-boot.bin FORCE \
$(if $(CONFIG_HAVE_REFCODE),refcode.bin)
$(call if_changed,ifdtool)
$(call if_changed,binman)

OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec
u-boot-x86-16bit.bin: u-boot FORCE
$(call if_changed,objcopy)
endif

ifneq ($(CONFIG_ARCH_SUNXI),)
OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \
--pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff
u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE
$(call if_changed,pad_cat)
u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
$(call if_changed,binman)
endif

ifneq ($(CONFIG_TEGRA),)
Expand Down
14 changes: 14 additions & 0 deletions arch/arm/dts/sunxi-u-boot.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <config.h>

/ {
binman {
filename = "u-boot-sunxi-with-spl.bin";
pad-byte = <0xff>;
blob {
filename = "spl/sunxi-spl.bin";
};
u-boot-img {
pos = <CONFIG_SPL_PAD_TO>;
};
};
};
15 changes: 15 additions & 0 deletions arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (C) 2016 Google, Inc
* Written by Simon Glass <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0+
*/

/ {
host1x@50000000 {
u-boot,dm-pre-reloc;
dc@54200000 {
u-boot,dm-pre-reloc;
};
};
};
2 changes: 0 additions & 2 deletions arch/arm/dts/tegra124-nyan-big.dts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@
};

host1x@50000000 {
u-boot,dm-pre-reloc;
dc@54200000 {
u-boot,dm-pre-reloc;
display-timings {
timing@0 {
clock-frequency = <69500000>;
Expand Down
8 changes: 8 additions & 0 deletions arch/arm/dts/tegra20-u-boot.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/ {
host1x@50000000 {
u-boot,dm-pre-reloc;
dc@54200000 {
u-boot,dm-pre-reloc;
};
};
};
2 changes: 0 additions & 2 deletions arch/arm/dts/tegra20.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
interrupt-parent = <&lic>;

host1x@50000000 {
u-boot,dm-pre-reloc;
compatible = "nvidia,tegra20-host1x", "simple-bus";
reg = <0x50000000 0x00024000>;
interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>, /* syncpt */
Expand Down Expand Up @@ -78,7 +77,6 @@
};

dc@54200000 {
u-boot,dm-pre-reloc;
compatible = "nvidia,tegra20-dc";
reg = <0x54200000 0x00040000>;
interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
Expand Down
18 changes: 18 additions & 0 deletions arch/x86/dts/emulation-u-boot.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (C) 2016 Google, Inc
* Written by Simon Glass <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0+
*/

#include <u-boot.dtsi>

#ifdef CONFIG_ROM_SIZE
/ {
binman {
u-boot-with-ucode-ptr {
optional-ucode;
};
};
};
#endif
62 changes: 62 additions & 0 deletions arch/x86/dts/u-boot.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2016 Google, Inc
* Written by Simon Glass <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0+
*/

#include <config.h>

#ifdef CONFIG_ROM_SIZE
/ {
binman {
filename = "u-boot.rom";
end-at-4gb;
sort-by-pos;
pad-byte = <0xff>;
size = <CONFIG_ROM_SIZE>;
#ifdef CONFIG_HAVE_INTEL_ME
intel-descriptor {
};
intel-me {
};
#endif
u-boot-with-ucode-ptr {
pos = <CONFIG_SYS_TEXT_BASE>;
};
u-boot-dtb-with-ucode {
};
u-boot-ucode {
align = <16>;
};
#ifdef CONFIG_HAVE_MRC
intel-mrc {
pos = <CONFIG_X86_MRC_ADDR>;
};
#endif
#ifdef CONFIG_HAVE_FSP
intel-fsp {
pos = <CONFIG_FSP_ADDR>;
};
#endif
#ifdef CONFIG_HAVE_CMC
intel-cmc {
pos = <CONFIG_CMC_ADDR>;
};
#endif
#ifdef CONFIG_HAVE_VGA_BIOS
intel-vga {
pos = <CONFIG_VGA_BIOS_ADDR>;
};
#endif
#ifdef CONFIG_HAVE_REFCODE
intel-refcode {
pos = <CONFIG_X86_REFCODE_ADDR>;
};
#endif
x86-start16 {
pos = <CONFIG_SYS_X86_START16>;
};
};
};
#endif
25 changes: 24 additions & 1 deletion scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,30 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \

ld_flags = $(LDFLAGS) $(ldflags-y)

dts_dir = $(srctree)/arch/$(ARCH)/dts

# Try these files in order to find the U-Boot-specific .dtsi include file
u_boot_dtsi_options = $(wildcard $(dts_dir)/$(basename $(notdir $<))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_SOC))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_CPU))-u-boot.dtsi) \
$(wildcard $(dts_dir)/$(subst $\",,$(CONFIG_SYS_VENDOR))-u-boot.dtsi) \
$(wildcard $(dts_dir)/u-boot.dtsi)

# Uncomment for debugging
# $(warning u_boot_dtsi_options: $(u_boot_dtsi_options))

# We use the first match
u_boot_dtsi = $(firstword $(u_boot_dtsi_options))

# Modified for U-Boot
dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \
-I$(srctree)/arch/$(ARCH)/dts \
-I$(srctree)/arch/$(ARCH)/dts/include \
-Iinclude \
-I$(srctree)/include \
-I$(srctree)/arch/$(ARCH)/include \
-include $(srctree)/include/linux/kconfig.h \
-D__ASSEMBLY__ \
-undef -D__DTS__

# Finds the multi-part object the current object will be linked into
Expand Down Expand Up @@ -288,8 +308,11 @@ $(obj)/%.dtb.S: $(obj)/%.dtb

quiet_cmd_dtc = DTC $@
# Modified for U-Boot
# Bring in any U-Boot-specific include after the '/dts-v1/;' header
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
cat $< $(if $(u_boot_dtsi),\
| sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \
$(DTC) -O dtb -o $@ -b 0 \
-i $(dir $<) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
Expand Down
1 change: 1 addition & 0 deletions tools/binman/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
Loading

0 comments on commit 36737f2

Please sign in to comment.