U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
April 2020
- 229 participants
- 852 discussions
Align Kconfig and Kbuild logic to Linux 4.19 release with minimal impact
on files outside of this scope.
Our previous Kconfig sync was done by commit 5972ff077e0f ("kconfig /
kbuild: re-sync with Linux 4.18").
In this particular re-sync in order to keep clang support working a
number of related changes needed to be pulled in that had been missed
previously. Not all of these changes we easily traceable and so have
been omitted from the list below.
The imported Linux commits are:
[From prior to v4.18]
9f3f1fd29976 kbuild: Add __cc-option macro
d7f14c66c273 kbuild: Enable Large File Support for hostprogs
6d79a7b424a5 kbuild: suppress warnings from 'getconf LFS_*'
24403874316a Shared library support
86a9df597cdd kbuild: fix linker feature test macros when cross compiling with Clang
0294e6f4a000 kbuild: simplify ld-option implementation
[From v4.18 to v4.19]
96f14fe738b6 kbuild: Rename HOSTCFLAGS to KBUILD_HOSTCFLAGS
10844aebf448 kbuild: Rename HOSTCXXFLAGS to KBUILD_HOSTCXXFLAGS
b90a368000ab kbuild: Rename HOSTLDFLAGS to KBUILD_HOSTLDFLAGS
8377bd2b9ee1 kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS
f92d19e0ef9b kbuild: Use HOST*FLAGS options from the command line
4ab3b80159d4 kconfig: check for pkg-config on make {menu,n,g,x}config
693359f7ac90 kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE
f60b992e30ff kbuild: replace $(LDFLAGS) $(ldflags-y) with $(ld_flags)
2fb9279f2c3e kbuild: change ld_flags to contain LDFLAGS_$(@F)
c931d34ea085 arm64: build with baremetal linker target instead of Linux when available
5accd7f3360e kconfig: handle format string before calling conf_message_callback()
a2ff4040151a kconfig: rename file_write_dep and move it to confdata.c
0608182ad542 kconfig: split out useful helpers in confdata.c
adc18acf42a1 kconfig: remove unneeded directory generation from local*config
79123b1389cc kconfig: create directories needed for syncconfig by itself
16952b77d8b5 kconfig: make syncconfig update .config regardless of sym_change_count
d6c6ab93e17f kbuild: remove deprecated host-progs variable
56869d45e364 kconfig: fix the rule of mainmenu_stmt symbol
c151272d1687 kconfig: remove unused sym_get_env_prop() function
1880861226c1 kconfig: remove P_ENV property type
e3fd9b5384f3 scripts/dtc: consolidate include path options in Makefile
4bf6a9af0e91 kconfig: add build-only configurator targets
f1575595d156 kconfig: error out when seeing recursive dependency
5e8c5299d315 kconfig: report recursive dependency involving 'imply'
f498926c47aa kconfig: improve the recursive dependency report
98a4afbfafd2 kconfig: fix "Can't open ..." in parallel build
9a9ddcf47831 kconfig: suppress "configuration written to .config" for syncconfig
87a32e624037 kbuild: pass LDFLAGS to recordmcount.pl
d503ac531a52 kbuild: rename LDFLAGS to KBUILD_LDFLAGS
217c3e019675 disable stringop truncation warnings for now
bc8d2e20a3eb kconfig: remove a spurious self-assignment
fd65465b7016 kconfig: do not require pkg-config on make {menu,n}config
5a4630aadb9a ftrace: Build with CPPFLAGS to get -Qunused-arguments
Note that this adds new cleanup work to do in that we should adapt the
shared library support we have to what is now upstream.
Cc: Masahiro Yamada <masahiroy(a)kernel.org>
Signed-off-by: Tom Rini <trini(a)konsulko.com>
---
Changes in v2:
- Drop patches 1/3 and 2/3 as they were an artifact of having not fully
solved the LDFLAGS change for SPL. This means arch/riscv/config.mk
and arch/mips/config.mk are slightly different from v1. Thanks
Daniel!
---
Makefile | 66 ++++++--
arch/arc/config.mk | 4 +-
arch/m68k/Makefile | 2 +-
arch/m68k/config.mk | 2 +-
arch/mips/config.mk | 10 +-
arch/powerpc/config.mk | 2 +-
arch/riscv/config.mk | 4 +-
arch/x86/config.mk | 8 +-
config.mk | 4 +-
examples/standalone/Makefile | 2 +-
scripts/Kbuild.include | 22 ++-
scripts/Makefile.build | 15 +-
scripts/Makefile.clean | 5 +-
scripts/Makefile.host | 64 +++++++-
scripts/Makefile.lib | 5 +-
scripts/Makefile.spl | 2 +-
scripts/dtc/Makefile | 18 +--
scripts/kconfig/Makefile | 36 +++--
scripts/kconfig/conf.c | 15 +-
scripts/kconfig/confdata.c | 147 ++++++++++++++----
scripts/kconfig/expr.h | 3 +-
scripts/kconfig/gconf-cfg.sh | 7 +
scripts/kconfig/gconf.c | 4 +-
scripts/kconfig/lkc.h | 2 -
scripts/kconfig/lkc_proto.h | 2 +-
scripts/kconfig/mconf-cfg.sh | 25 +--
scripts/kconfig/mconf.c | 10 +-
scripts/kconfig/menu.c | 2 +-
scripts/kconfig/nconf-cfg.sh | 25 +--
scripts/kconfig/nconf.c | 7 +-
scripts/kconfig/qconf-cfg.sh | 7 +
scripts/kconfig/qconf.cc | 1 -
scripts/kconfig/symbol.c | 71 +++++----
.../Kconfig | 3 +-
.../tests/err_recursive_dep/__init__.py | 10 ++
.../tests/err_recursive_dep/expected_stderr | 38 +++++
.../tests/warn_recursive_dep/__init__.py | 9 --
.../tests/warn_recursive_dep/expected_stderr | 30 ----
scripts/kconfig/util.c | 30 ----
scripts/kconfig/zconf.y | 6 +-
tools/Makefile | 8 +-
41 files changed, 458 insertions(+), 275 deletions(-)
rename scripts/kconfig/tests/{warn_recursive_dep => err_recursive_dep}/Kconfig (93%)
create mode 100644 scripts/kconfig/tests/err_recursive_dep/__init__.py
create mode 100644 scripts/kconfig/tests/err_recursive_dep/expected_stderr
delete mode 100644 scripts/kconfig/tests/warn_recursive_dep/__init__.py
delete mode 100644 scripts/kconfig/tests/warn_recursive_dep/expected_stderr
diff --git a/Makefile b/Makefile
index 84ab6803c93f..3f371e38cd32 100644
--- a/Makefile
+++ b/Makefile
@@ -271,11 +271,17 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)
+HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
+HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
+HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
+
HOSTCC = cc
HOSTCXX = c++
-HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
- $(if $(CONFIG_TOOLS_DEBUG),-g)
-HOSTCXXFLAGS = -O2
+KBUILD_HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
+ $(if $(CONFIG_TOOLS_DEBUG),-g) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
+KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
+KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
+KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
# With the move to GCC 6, we have implicitly upgraded our language
# standard to GNU11 (see https://gcc.gnu.org/gcc-5/porting_to.html).
@@ -284,11 +290,11 @@ HOSTCXXFLAGS = -O2
# these that our host tools are GNU11 (i.e. C11 w/ GNU extensions).
CSTD_FLAG := -std=gnu11
ifeq ($(HOSTOS),linux)
-HOSTCFLAGS += $(CSTD_FLAG)
+KBUILD_HOSTCFLAGS += $(CSTD_FLAG)
endif
ifeq ($(HOSTOS),cygwin)
-HOSTCFLAGS += -ansi
+KBUILD_HOSTCFLAGS += -ansi
endif
# Mac OS X / Darwin's C preprocessor is Apple specific. It
@@ -315,17 +321,17 @@ os_x_after = $(shell if [ $(DARWIN_MAJOR_VERSION) -ge $(1) -a \
# Snow Leopards build environment has no longer restrictions as described above
HOSTCC = $(call os_x_before, 10, 5, "cc", "gcc")
-HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
-HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
+KBUILD_HOSTCFLAGS += $(call os_x_before, 10, 4, "-traditional-cpp")
+KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 5, "-multiply_defined suppress")
# since Lion (10.7) ASLR is on by default, but we use linker generated lists
# in some host tools which is a problem then ... so disable ASLR for these
# tools
-HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie")
+KBUILD_HOSTLDFLAGS += $(call os_x_before, 10, 7, "", "-Xlinker -no_pie")
# macOS Mojave (10.14.X)
# Undefined symbols for architecture x86_64: "_PyArg_ParseTuple"
-HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "")
+KBUILD_HOSTLDFLAGS += $(call os_x_after, 10, 14, "-lpython -dynamclib", "")
endif
# Decide whether to build built-in, modular, or both.
@@ -417,6 +423,23 @@ KBUILD_CFLAGS := -Wall -Wstrict-prototypes \
-fno-builtin -ffreestanding $(CSTD_FLAG)
KBUILD_CFLAGS += -fshort-wchar -fno-strict-aliasing
KBUILD_AFLAGS := -D__ASSEMBLY__
+KBUILD_LDFLAGS :=
+
+ifeq ($(cc-name),clang)
+ifneq ($(CROSS_COMPILE),)
+CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
+GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR)
+GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
+endif
+ifneq ($(GCC_TOOLCHAIN),)
+CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
+endif
+KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
+KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
+endif
# Don't generate position independent code
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
@@ -428,12 +451,12 @@ UBOOTVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SU
export VERSION PATCHLEVEL SUBLEVEL UBOOTRELEASE UBOOTVERSION
export ARCH CPU BOARD VENDOR SOC CPUDIR BOARDDIR
-export CONFIG_SHELL HOSTCC HOSTCFLAGS HOSTLDFLAGS CROSS_COMPILE AS LD CC
-export CPP AR NM LDR STRIP OBJCOPY OBJDUMP
+export CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
+export CPP AR NM LDR STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
export MAKE LEX YACC AWK PERL PYTHON PYTHON2 PYTHON3
-export HOSTCXX HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS
+export HOSTCXX KBUILD_HOSTCXXFLAGS CHECK CHECKFLAGS DTC DTC_FLAGS
-export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE OBJCOPYFLAGS LDFLAGS
+export KBUILD_CPPFLAGS NOSTDINC_FLAGS UBOOTINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
export KBUILD_CFLAGS KBUILD_AFLAGS
export CC_VERSION_TEXT := $(shell $(CC) --version | head -n 1)
@@ -656,6 +679,9 @@ endif
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
+# disable stringop warnings in gcc 8+
+KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
+
# change __FILE__ to the relative path from the srctree
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
@@ -680,7 +706,19 @@ ifeq ($(cc-name),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
+KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
+# Quiet clang warning: comparison of unsigned expression < 0 is always false
+KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
+# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
+# source of a reference will be _MergedGlobals and not on of the whitelisted names.
+# See modpost pattern 2
+KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
+else
+
+# These warnings generated too much noise in a regular build.
+# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
+KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
endif
# turn jbsr into jsr for m68k
@@ -1691,7 +1729,7 @@ ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(ARCH)/Makefile.postlink)
# Rule to link u-boot
# May be overridden by arch/$(ARCH)/config.mk
quiet_cmd_u-boot__ ?= LD $@
- cmd_u-boot__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
+ cmd_u-boot__ ?= $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_u-boot) -o $@ \
-T u-boot.lds $(u-boot-init) \
--start-group $(u-boot-main) --end-group \
$(PLATFORM_LIBS) -Map u-boot.map; \
diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index 6fa29adae81f..118472b2d0ba 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -9,12 +9,12 @@ CONFIG_SYS_BIG_ENDIAN = 1
endif
ifdef CONFIG_SYS_LITTLE_ENDIAN
-PLATFORM_LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
PLATFORM_CPPFLAGS += -mlittle-endian
endif
ifdef CONFIG_SYS_BIG_ENDIAN
-PLATFORM_LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
PLATFORM_CPPFLAGS += -mbig-endian
endif
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile
index d36d9f063199..7f23ff45887a 100644
--- a/arch/m68k/Makefile
+++ b/arch/m68k/Makefile
@@ -30,6 +30,6 @@ ldflags-$(CONFIG_MCF547x_8x) := --got=single
ifneq (,$(findstring -linux-,$(shell $(CC) --version)))
ifneq (,$(findstring GOT,$(shell $(LD) --help)))
-PLATFORM_LDFLAGS += $(ldflags-y)
+KBUILD_LDFLAGS += $(ldflags-y)
endif
endif
diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk
index a27a5245fe89..88b1a409f260 100644
--- a/arch/m68k/config.mk
+++ b/arch/m68k/config.mk
@@ -10,7 +10,7 @@ endif
CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000
PLATFORM_CPPFLAGS += -D__M68K__
-PLATFORM_LDFLAGS += -n
+KBUILD_LDFLAGS += -n
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
PLATFORM_RELFLAGS += -ffixed-d7 -msep-data
LDFLAGS_FINAL += --gc-sections
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index 9d3a84539a7d..b8544b1e51bd 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -9,7 +9,7 @@ ifdef CONFIG_SYS_BIG_ENDIAN
32bit-bfd := elf32-tradbigmips
64bit-bfd := elf64-tradbigmips
PLATFORM_CPPFLAGS += -EB
-PLATFORM_LDFLAGS += -EB
+KBUILD_LDFLAGS += -EB
endif
ifdef CONFIG_SYS_LITTLE_ENDIAN
@@ -18,19 +18,19 @@ ifdef CONFIG_SYS_LITTLE_ENDIAN
32bit-bfd := elf32-tradlittlemips
64bit-bfd := elf64-tradlittlemips
PLATFORM_CPPFLAGS += -EL
-PLATFORM_LDFLAGS += -EL
+KBUILD_LDFLAGS += -EL
endif
ifdef CONFIG_32BIT
PLATFORM_CPPFLAGS += -mabi=32
-PLATFORM_LDFLAGS += -m $(32bit-emul)
+KBUILD_LDFLAGS += -m $(32bit-emul)
OBJCOPYFLAGS += -O $(32bit-bfd)
CONFIG_STANDALONE_LOAD_ADDR ?= 0x80200000
endif
ifdef CONFIG_64BIT
PLATFORM_CPPFLAGS += -mabi=64
-PLATFORM_LDFLAGS += -m$(64bit-emul)
+KBUILD_LDFLAGS += -m$(64bit-emul)
OBJCOPYFLAGS += -O $(64bit-bfd)
CONFIG_STANDALONE_LOAD_ADDR ?= 0xffffffff80200000
endif
@@ -63,7 +63,7 @@ endif
PLATFORM_CPPFLAGS += -G 0 -mno-abicalls -fno-pic
PLATFORM_CPPFLAGS += -msoft-float
-PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib
+KBUILD_LDFLAGS += -G 0 -static -n -nostdlib
PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
LDFLAGS_FINAL += --gc-sections
OBJCOPYFLAGS += -j .text -j .rodata -j .data -j .u_boot_list
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index f5d21c837a47..88e2c58cb44a 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -15,7 +15,7 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections \
PF_CPPFLAGS_POWERPC := $(call cc-option,-fno-ira-hoist-pressure,)
PLATFORM_CPPFLAGS += -D__powerpc__ -ffixed-r2 -m32 $(PF_CPPFLAGS_POWERPC)
-PLATFORM_LDFLAGS += -m32 -melf32ppclinux
+KBUILD_LDFLAGS += -m32 -melf32ppclinux
#
# When cross-compiling on NetBSD, we have to define __PPC__ or else we
diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk
index 84654eb3ed87..1ebce5bd6748 100644
--- a/arch/riscv/config.mk
+++ b/arch/riscv/config.mk
@@ -14,12 +14,12 @@
64bit-emul := elf64lriscv
ifdef CONFIG_32BIT
-PLATFORM_LDFLAGS += -m $(32bit-emul)
+KBUILD_LDFLAGS += -m $(32bit-emul)
EFI_LDS := elf_riscv32_efi.lds
endif
ifdef CONFIG_64BIT
-PLATFORM_LDFLAGS += -m $(64bit-emul)
+KBUILD_LDFLAGS += -m $(64bit-emul)
EFI_LDS := elf_riscv64_efi.lds
endif
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index b5e8f4629791..27d8412661ff 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -29,11 +29,11 @@ endif
PLATFORM_RELFLAGS += -fdata-sections -ffunction-sections -fvisibility=hidden
-PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions
-PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64)
+KBUILD_LDFLAGS += -Bsymbolic -Bsymbolic-functions
+KBUILD_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64)
# This is used in the top-level Makefile which does not include
-# PLATFORM_LDFLAGS
+# KBUILD_LDFLAGS
LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -s
OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
@@ -71,7 +71,7 @@ LDSCRIPT := $(LDSCRIPT_EFI)
else
PLATFORM_CPPFLAGS += $(CFLAGS_NON_EFI)
-PLATFORM_LDFLAGS += --emit-relocs
+KBUILD_LDFLAGS += --emit-relocs
LDFLAGS_FINAL += --gc-sections $(if $(CONFIG_SPL_BUILD),,-pie)
endif
diff --git a/config.mk b/config.mk
index caf0dd9b8182..097d1f67d24e 100644
--- a/config.mk
+++ b/config.mk
@@ -12,8 +12,7 @@
# If we did not have Tegra SoCs, build system would be much simpler...)
PLATFORM_RELFLAGS :=
PLATFORM_CPPFLAGS :=
-PLATFORM_LDFLAGS :=
-LDFLAGS :=
+KBUILD_LDFLAGS :=
LDFLAGS_FINAL :=
LDFLAGS_STANDALONE :=
OBJCOPYFLAGS :=
@@ -70,7 +69,6 @@ RELFLAGS := $(PLATFORM_RELFLAGS)
PLATFORM_CPPFLAGS += $(RELFLAGS)
PLATFORM_CPPFLAGS += -pipe
-LDFLAGS += $(PLATFORM_LDFLAGS)
LDFLAGS_FINAL += -Bstatic
export PLATFORM_CPPFLAGS
diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile
index 0b17a91804cf..779e2528b77e 100644
--- a/examples/standalone/Makefile
+++ b/examples/standalone/Makefile
@@ -55,7 +55,7 @@ $(LIB): $(LIBOBJS) FORCE
$(call if_changed,link_lib)
quiet_cmd_link_elf = LD $@
- cmd_link_elf = $(LD) $(LDFLAGS) $(LDFLAGS_STANDALONE) -g \
+ cmd_link_elf = $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_STANDALONE) -g \
-o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) $(PLATFORM_LIBGCC)
$(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index c7ad18777787..cad3b6e76c62 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -109,11 +109,20 @@ as-option = $(call try-run,\
as-instr = $(call try-run,\
printf "%b\n" "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3))
+# __cc-option
+# Usage: MY_CFLAGS += $(call __cc-option,$(CC),$(MY_CFLAGS),-march=winchip-c6,-march=i586)
+__cc-option = $(call try-run,\
+ $(1) -Werror $(2) $(3) -c -x c /dev/null -o "$$TMP",$(3),$(4))
+
# cc-option
# Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
+cc-option = $(call __cc-option, $(CC),\
+ $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS),$(1),$(2))
-cc-option = $(call try-run,\
- $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2))
+# hostcc-option
+# Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586)
+hostcc-option = $(call __cc-option, $(HOSTCC),\
+ $(HOSTCFLAGS) $(HOST_EXTRACFLAGS),$(1),$(2))
# cc-option-yn
# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
@@ -123,7 +132,7 @@ cc-option-yn = $(call try-run,\
# cc-disable-warning
# Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
cc-disable-warning = $(call try-run,\
- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
+ $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
# cc-name
# Expands to either gcc or clang
@@ -146,12 +155,11 @@ binutils-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/binutils-version.s
# cc-ldoption
# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
cc-ldoption = $(call try-run,\
- $(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
+ $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
# ld-option
-# Usage: LDFLAGS += $(call ld-option, -X)
-ld-option = $(call try-run,\
- $(CC) -x c /dev/null -c -o "$$TMPO" ; $(LD) $(1) "$$TMPO" -o "$$TMP",$(1),$(2))
+# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
+ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
# ar-option
# Usage: KBUILD_ARFLAGS := $(call ar-option,D)
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f8362fbd89d9..5e5f1682c902 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -70,15 +70,8 @@ endif
include scripts/Makefile.lib
-ifdef host-progs
-ifneq ($(hostprogs-y),$(host-progs))
-$(warning kbuild: $(obj)/Makefile - Usage of host-progs is deprecated. Please replace with hostprogs-y!)
-hostprogs-y += $(host-progs)
-endif
-endif
-
# Do not include host rules unless needed
-ifneq ($(hostprogs-y)$(hostprogs-m),)
+ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(hostcxxlibs-m),)
include scripts/Makefile.host
endif
@@ -221,7 +214,7 @@ cmd_modversions = \
$(call cmd_gensymtypes,$(KBUILD_SYMTYPES),$(@:.o=.symtypes)) \
> $(@D)/.tmp_$(@F:.o=.ver); \
\
- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
+ $(LD) $(KBUILD_LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
-T $(@D)/.tmp_$(@F:.o=.ver); \
rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
else \
@@ -253,8 +246,8 @@ else
sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
"$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \
"$(if $(CONFIG_64BIT),64,32)" \
- "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \
- "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
+ "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)" \
+ "$(LD) $(KBUILD_LDFLAGS)" "$(NM)" "$(RM)" "$(MV)" \
"$(if $(part-of-module),1,0)" "$(@)";
recordmcount_source := $(srctree)/scripts/recordmcount.pl
endif
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index 8fe9e05a14a9..d5922e915def 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -43,8 +43,9 @@ subdir-ymn := $(foreach f, $(subdir-ymn), \
__clean-files := $(extra-y) $(extra-m) $(extra-) \
$(always) $(targets) $(clean-files) \
- $(host-progs) \
- $(hostprogs-y) $(hostprogs-m) $(hostprogs-)
+ $(hostprogs-y) $(hostprogs-m) $(hostprogs-) \
+ $(hostlibs-y) $(hostlibs-m) $(hostlibs-) \
+ $(hostcxxlibs-y) $(hostcxxlibs-m)
__clean-files := $(filter-out $(no-clean-files), $(__clean-files))
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index e3379a3c51a1..da2f4d5bfd37 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -22,6 +22,8 @@
# They are linked as C++ code to the executable qconf
__hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
+host-cshlib := $(sort $(hostlibs-y) $(hostlibs-m))
+host-cxxshlib := $(sort $(hostcxxlibs-y) $(hostcxxlibs-m))
# C code
# Executables compiled from a single .c file
@@ -47,6 +49,10 @@ host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m)))
# C++ Object (.o) files compiled from .cc files
host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs)))
+# Object (.o) files used by the shared libaries
+host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
+host-cxxshobjs := $(sort $(foreach m,$(host-cxxshlib),$($(m:.so=-objs))))
+
# output directory for programs/.o files
# hostprogs-y := tools/build may have been specified.
# Retrieve also directory of .o files from prog-objs or prog-cxxobjs notation
@@ -61,6 +67,10 @@ host-cmulti := $(addprefix $(obj)/,$(host-cmulti))
host-cobjs := $(addprefix $(obj)/,$(host-cobjs))
host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti))
host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs))
+host-cshlib := $(addprefix $(obj)/,$(host-cshlib))
+host-cxxshlib := $(addprefix $(obj)/,$(host-cxxshlib))
+host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs))
+host-cxxshobjs := $(addprefix $(obj)/,$(host-cxxshobjs))
host-shared := $(addprefix $(obj)/,$(host-shared))
host-objdirs := $(addprefix $(obj)/,$(host-objdirs))
@@ -69,9 +79,9 @@ obj-dirs += $(host-objdirs)
#####
# Handle options to gcc. Support building with separate output directory
-_hostc_flags = $(HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
+_hostc_flags = $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS) \
$(HOSTCFLAGS_$(basetarget).o)
-_hostcxx_flags = $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
+_hostcxx_flags = $(KBUILD_HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS) \
$(HOSTCXXFLAGS_$(basetarget).o)
ifeq ($(KBUILD_SRC),)
@@ -92,16 +102,16 @@ hostcxx_flags = -Wp,-MD,$(depfile) $(__hostcxx_flags)
# host-csingle -> Executable
quiet_cmd_host-csingle = HOSTCC $@
cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \
- $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
+ $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))
$(host-csingle): $(obj)/%: $(src)/%.c FORCE
$(call if_changed_dep,host-csingle)
# Link an executable based on list of .o files, all plain c
# host-cmulti -> executable
quiet_cmd_host-cmulti = HOSTLD $@
- cmd_host-cmulti = $(HOSTCC) $(HOSTLDFLAGS) -o $@ \
+ cmd_host-cmulti = $(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ \
$(addprefix $(obj)/,$($(@F)-objs)) \
- $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
+ $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))
$(host-cmulti): FORCE
$(call if_changed,host-cmulti)
$(call multi_depend, $(host-cmulti), , -objs)
@@ -116,10 +126,10 @@ $(host-cobjs): $(obj)/%.o: $(src)/%.c FORCE
# Link an executable based on list of .o files, a mixture of .c and .cc
# host-cxxmulti -> executable
quiet_cmd_host-cxxmulti = HOSTLD $@
- cmd_host-cxxmulti = $(HOSTCXX) $(HOSTLDFLAGS) -o $@ \
+ cmd_host-cxxmulti = $(HOSTCXX) $(KBUILD_HOSTLDFLAGS) -o $@ \
$(foreach o,objs cxxobjs,\
$(addprefix $(obj)/,$($(@F)-$(o)))) \
- $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
+ $(KBUILD_HOSTLDLIBS) $(HOSTLDLIBS_$(@F))
$(host-cxxmulti): FORCE
$(call if_changed,host-cxxmulti)
$(call multi_depend, $(host-cxxmulti), , -objs -cxxobjs)
@@ -130,5 +140,43 @@ quiet_cmd_host-cxxobjs = HOSTCXX $@
$(host-cxxobjs): $(obj)/%.o: $(src)/%.cc FORCE
$(call if_changed_dep,host-cxxobjs)
+# Compile .c file, create position independent .o file
+# host-cshobjs -> .o
+quiet_cmd_host-cshobjs = HOSTCC -fPIC $@
+ cmd_host-cshobjs = $(HOSTCC) $(hostc_flags) -fPIC -c -o $@ $<
+$(host-cshobjs): $(obj)/%.o: $(src)/%.c FORCE
+ $(call if_changed_dep,host-cshobjs)
+
+# Compile .c file, create position independent .o file
+# Note that plugin capable gcc versions can be either C or C++ based
+# therefore plugin source files have to be compilable in both C and C++ mode.
+# This is why a C++ compiler is invoked on a .c file.
+# host-cxxshobjs -> .o
+quiet_cmd_host-cxxshobjs = HOSTCXX -fPIC $@
+ cmd_host-cxxshobjs = $(HOSTCXX) $(hostcxx_flags) -fPIC -c -o $@ $<
+$(host-cxxshobjs): $(obj)/%.o: $(src)/%.c FORCE
+ $(call if_changed_dep,host-cxxshobjs)
+
+# Link a shared library, based on position independent .o files
+# *.o -> .so shared library (host-cshlib)
+quiet_cmd_host-cshlib = HOSTLLD -shared $@
+ cmd_host-cshlib = $(HOSTCC) $(HOSTLDFLAGS) -shared -o $@ \
+ $(addprefix $(obj)/,$($(@F:.so=-objs))) \
+ $(HOST_LOADLIBES) $(HOSTLDLIBS_$(@F))
+$(host-cshlib): FORCE
+ $(call if_changed,host-cshlib)
+$(call multi_depend, $(host-cshlib), .so, -objs)
+
+# Link a shared library, based on position independent .o files
+# *.o -> .so shared library (host-cxxshlib)
+quiet_cmd_host-cxxshlib = HOSTLLD -shared $@
+ cmd_host-cxxshlib = $(HOSTCXX) $(HOSTLDFLAGS) -shared -o $@ \
+ $(addprefix $(obj)/,$($(@F:.so=-objs))) \
+ $(HOST_LOADLIBES) $(HOSTLDLIBS_$(@F))
+$(host-cxxshlib): FORCE
+ $(call if_changed,host-cxxshlib)
+$(call multi_depend, $(host-cxxshlib), .so, -objs)
+
targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\
- $(host-cxxmulti) $(host-cxxobjs) $(host-shared)
+ $(host-cxxmulti) $(host-cxxobjs) $(host-shared) \
+ $(host-cshlib) $(host-cshobjs) $(host-cxxshlib) $(host-cxxshobjs)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8c77eaaa4eed..8decb0e451d4 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -161,7 +161,7 @@ a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
$(__cpp_flags)
-ld_flags = $(LDFLAGS) $(ldflags-y)
+ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
# Try these files in order to find the U-Boot-specific .dtsi include file
u_boot_dtsi_options = $(strip $(wildcard $(dir $<)$(basename $(notdir $<))-u-boot.dtsi) \
@@ -256,8 +256,7 @@ $(obj)/%: $(src)/%_shipped
# ---------------------------------------------------------------------------
quiet_cmd_ld = LD $@
-cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
- $(filter-out FORCE,$^) -o $@
+cmd_ld = $(LD) $(ld_flags) $(filter-out FORCE,$^) -o $@
# Objcopy
# ---------------------------------------------------------------------------
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 314b02ba07db..5384f2127830 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -407,7 +407,7 @@ $(obj)/u-boot-spl-mtk.bin: $(obj)/u-boot-spl.bin FORCE
# Rule to link u-boot-spl
# May be overridden by arch/$(ARCH)/config.mk
quiet_cmd_u-boot-spl ?= LD $@
- cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) \
+ cmd_u-boot-spl ?= (cd $(obj) && $(LD) $(KBUILD_LDFLAGS) $(LDFLAGS_$(@F)) \
$(patsubst $(obj)/%,%,$(u-boot-spl-init)) --start-group \
$(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
$(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) \
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index e999be939831..58d879dd11f5 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -9,21 +9,11 @@ dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
# Source files need to get at the userspace version of libfdt_env.h to compile
+HOST_EXTRACFLAGS := -I$(src)/libfdt
-HOSTCFLAGS_DTC := -I$(src) -I$(src)/libfdt
-
-HOSTCFLAGS_checks.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_data.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_dtc.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_flattree.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_fstree.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_livetree.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_srcpos.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_treesource.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_util.o := $(HOSTCFLAGS_DTC)
-
-HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
-HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
+# Generated files need one more search path to include headers in source tree
+HOSTCFLAGS_dtc-lexer.lex.o := -I$(src)
+HOSTCFLAGS_dtc-parser.tab.o := -I$(src)
# dependencies on generated files need to be listed explicitly
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 30b90cfde238..559bb88264c3 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -3,8 +3,8 @@
# Kernel configuration targets
# These targets are used from top-level makefile
-PHONY += xconfig gconfig menuconfig config syncconfig \
- localmodconfig localyesconfig
+PHONY += xconfig gconfig menuconfig config localmodconfig localyesconfig \
+ build_menuconfig build_nconfig build_gconfig build_xconfig
# Added for U-Boot
# Linux has defconfig files in arch/$(SRCARCH)/configs/,
@@ -40,14 +40,15 @@ config: $(obj)/conf
nconfig: $(obj)/nconf
$< $(silent) $(Kconfig)
-# This has become an internal implementation detail and is now deprecated
-# for external use.
-syncconfig: $(obj)/conf
- $(Q)mkdir -p include/config include/generated
- $< $(silent) --$@ $(Kconfig)
+build_menuconfig: $(obj)/mconf
+
+build_nconfig: $(obj)/nconf
+
+build_gconfig: $(obj)/gconf
+
+build_xconfig: $(obj)/qconf
localyesconfig localmodconfig: $(obj)/conf
- $(Q)mkdir -p include/config include/generated
$(Q)perl $(srctree)/$(src)/streamline_config.pl --$@ $(srctree) $(Kconfig) > .tmp.config
$(Q)if [ -f .config ]; then \
cmp -s .tmp.config .config || \
@@ -62,8 +63,12 @@ localyesconfig localmodconfig: $(obj)/conf
$(Q)rm -f .tmp.config
# These targets map 1:1 to the commandline options of 'conf'
+#
+# Note:
+# syncconfig has become an internal implementation detail and is now
+# deprecated for external use
simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
- alldefconfig randconfig listnewconfig olddefconfig
+ alldefconfig randconfig listnewconfig olddefconfig syncconfig
PHONY += $(simple-targets)
$(simple-targets): $(obj)/conf
@@ -179,29 +184,30 @@ HOSTCFLAGS_zconf.tab.o := -I$(src)
hostprogs-y += nconf
nconf-objs := nconf.o zconf.tab.o nconf.gui.o
-HOSTLOADLIBES_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs)
+HOSTLDLIBS_nconf = $(shell . $(obj)/.nconf-cfg && echo $$libs)
HOSTCFLAGS_nconf.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags)
HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/.nconf-cfg && echo $$cflags)
-$(obj)/nconf.o: $(obj)/.nconf-cfg
+$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/.nconf-cfg
# mconf: Used for the menuconfig target based on lxdialog
hostprogs-y += mconf
lxdialog := checklist.o inputbox.o menubox.o textbox.o util.o yesno.o
mconf-objs := mconf.o zconf.tab.o $(addprefix lxdialog/, $(lxdialog))
-HOSTLOADLIBES_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs)
+HOSTLDLIBS_mconf = $(shell . $(obj)/.mconf-cfg && echo $$libs)
$(foreach f, mconf.o $(lxdialog), \
$(eval HOSTCFLAGS_$f = $$(shell . $(obj)/.mconf-cfg && echo $$$$cflags)))
-$(addprefix $(obj)/, mconf.o $(lxdialog)): $(obj)/.mconf-cfg
+$(obj)/mconf.o: $(obj)/.mconf-cfg
+$(addprefix $(obj)/lxdialog/, $(lxdialog)): $(obj)/.mconf-cfg
# qconf: Used for the xconfig target based on Qt
hostprogs-y += qconf
qconf-cxxobjs := qconf.o
qconf-objs := zconf.tab.o
-HOSTLOADLIBES_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs)
+HOSTLDLIBS_qconf = $(shell . $(obj)/.qconf-cfg && echo $$libs)
HOSTCXXFLAGS_qconf.o = $(shell . $(obj)/.qconf-cfg && echo $$cflags)
$(obj)/qconf.o: $(obj)/.qconf-cfg $(obj)/qconf.moc
@@ -216,7 +222,7 @@ $(obj)/%.moc: $(src)/%.h $(obj)/.qconf-cfg
hostprogs-y += gconf
gconf-objs := gconf.o zconf.tab.o
-HOSTLOADLIBES_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs)
+HOSTLDLIBS_gconf = $(shell . $(obj)/.gconf-cfg && echo $$libs)
HOSTCFLAGS_gconf.o = $(shell . $(obj)/.gconf-cfg && echo $$cflags)
$(obj)/gconf.o: $(obj)/.gconf-cfg
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 671ff5364497..c54ff0453c34 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -496,6 +496,7 @@ int main(int ac, char **av)
int opt;
const char *name, *defconfig_file = NULL /* gcc uninit */;
struct stat tmpstat;
+ int no_conf_write = 0;
tty_stdio = isatty(0) && isatty(1);
@@ -507,6 +508,11 @@ int main(int ac, char **av)
input_mode = (enum input_mode)opt;
switch (opt) {
case syncconfig:
+ /*
+ * syncconfig is invoked during the build stage.
+ * Suppress distracting "configuration written to ..."
+ */
+ conf_set_message_callback(NULL);
sync_kconfig = 1;
break;
case defconfig:
@@ -633,13 +639,14 @@ int main(int ac, char **av)
}
if (sync_kconfig) {
- if (conf_get_changed()) {
- name = getenv("KCONFIG_NOSILENTUPDATE");
- if (name && *name) {
+ name = getenv("KCONFIG_NOSILENTUPDATE");
+ if (name && *name) {
+ if (conf_get_changed()) {
fprintf(stderr,
"\n*** The configuration requires explicit update.\n\n");
return 1;
}
+ no_conf_write = 1;
}
}
@@ -688,7 +695,7 @@ int main(int ac, char **av)
/* syncconfig is used during the build so we shall update autoconf.
* All other commands are only used to generate a config.
*/
- if (conf_get_changed() && conf_write(NULL)) {
+ if (!no_conf_write && conf_write(NULL)) {
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
exit(1);
}
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 1abf849bf543..d587b10d7f8e 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -16,6 +16,64 @@
#include "lkc.h"
+/* return true if 'path' exists, false otherwise */
+static bool is_present(const char *path)
+{
+ struct stat st;
+
+ return !stat(path, &st);
+}
+
+/* return true if 'path' exists and it is a directory, false otherwise */
+static bool is_dir(const char *path)
+{
+ struct stat st;
+
+ if (stat(path, &st))
+ return 0;
+
+ return S_ISDIR(st.st_mode);
+}
+
+/*
+ * Create the parent directory of the given path.
+ *
+ * For example, if 'include/config/auto.conf' is given, create 'include/config'.
+ */
+static int make_parent_dir(const char *path)
+{
+ char tmp[PATH_MAX + 1];
+ char *p;
+
+ strncpy(tmp, path, sizeof(tmp));
+ tmp[sizeof(tmp) - 1] = 0;
+
+ /* Remove the base name. Just return if nothing is left */
+ p = strrchr(tmp, '/');
+ if (!p)
+ return 0;
+ *(p + 1) = 0;
+
+ /* Just in case it is an absolute path */
+ p = tmp;
+ while (*p == '/')
+ p++;
+
+ while ((p = strchr(p, '/'))) {
+ *p = 0;
+
+ /* skip if the directory exists */
+ if (!is_dir(tmp) && mkdir(tmp, 0755))
+ return -1;
+
+ *p = '/';
+ while (*p == '/')
+ p++;
+ }
+
+ return 0;
+}
+
struct conf_printer {
void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
void (*print_comment)(FILE *, const char *, void *);
@@ -43,16 +101,16 @@ static void conf_warning(const char *fmt, ...)
conf_warnings++;
}
-static void conf_default_message_callback(const char *fmt, va_list ap)
+static void conf_default_message_callback(const char *s)
{
printf("#\n# ");
- vprintf(fmt, ap);
+ printf("%s", s);
printf("\n#\n");
}
-static void (*conf_message_callback) (const char *fmt, va_list ap) =
+static void (*conf_message_callback)(const char *s) =
conf_default_message_callback;
-void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap))
+void conf_set_message_callback(void (*fn)(const char *s))
{
conf_message_callback = fn;
}
@@ -60,10 +118,15 @@ void conf_set_message_callback(void (*fn) (const char *fmt, va_list ap))
static void conf_message(const char *fmt, ...)
{
va_list ap;
+ char buf[4096];
+
+ if (!conf_message_callback)
+ return;
va_start(ap, fmt);
- if (conf_message_callback)
- conf_message_callback(fmt, ap);
+
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ conf_message_callback(buf);
va_end(ap);
}
@@ -83,7 +146,6 @@ const char *conf_get_autoconfig_name(void)
char *conf_get_default_confname(void)
{
- struct stat buf;
static char fullname[PATH_MAX+1];
char *env, *name;
@@ -91,7 +153,7 @@ char *conf_get_default_confname(void)
env = getenv(SRCTREE);
if (env) {
sprintf(fullname, "%s/%s", env, name);
- if (!stat(fullname, &buf))
+ if (is_present(fullname))
return fullname;
}
return name;
@@ -393,7 +455,7 @@ int conf_read(const char *name)
for_all_symbols(i, sym) {
sym_calc_value(sym);
- if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO))
+ if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))
continue;
if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
/* check that calculated value agrees with saved value */
@@ -723,10 +785,9 @@ int conf_write(const char *name)
dirname[0] = 0;
if (name && name[0]) {
- struct stat st;
char *slash;
- if (!stat(name, &st) && S_ISDIR(st.st_mode)) {
+ if (is_dir(name)) {
strcpy(dirname, name);
strcat(dirname, "/");
basename = conf_get_configname();
@@ -811,26 +872,59 @@ next:
return 0;
}
+/* write a dependency file as used by kbuild to track dependencies */
+static int conf_write_dep(const char *name)
+{
+ struct file *file;
+ FILE *out;
+
+ if (!name)
+ name = ".kconfig.d";
+ out = fopen("..config.tmp", "w");
+ if (!out)
+ return 1;
+ fprintf(out, "deps_config := \\\n");
+ for (file = file_list; file; file = file->next) {
+ if (file->next)
+ fprintf(out, "\t%s \\\n", file->name);
+ else
+ fprintf(out, "\t%s\n", file->name);
+ }
+ fprintf(out, "\n%s: \\\n"
+ "\t$(deps_config)\n\n", conf_get_autoconfig_name());
+
+ env_write_dep(out, conf_get_autoconfig_name());
+
+ fprintf(out, "\n$(deps_config): ;\n");
+ fclose(out);
+
+ if (make_parent_dir(name))
+ return 1;
+ rename("..config.tmp", name);
+ return 0;
+}
+
static int conf_split_config(void)
{
const char *name;
char path[PATH_MAX+1];
char *s, *d, c;
struct symbol *sym;
- struct stat sb;
int res, i, fd;
name = conf_get_autoconfig_name();
conf_read_simple(name, S_DEF_AUTO);
sym_calc_value(modules_sym);
+ if (make_parent_dir("include/config/foo.h"))
+ return 1;
if (chdir("include/config"))
return 1;
res = 0;
for_all_symbols(i, sym) {
sym_calc_value(sym);
- if ((sym->flags & SYMBOL_AUTO) || !sym->name)
+ if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
continue;
if (sym->flags & SYMBOL_WRITE) {
if (sym->flags & SYMBOL_DEF_AUTO) {
@@ -895,19 +989,12 @@ static int conf_split_config(void)
res = 1;
break;
}
- /*
- * Create directory components,
- * unless they exist already.
- */
- d = path;
- while ((d = strchr(d, '/'))) {
- *d = 0;
- if (stat(path, &sb) && mkdir(path, 0755)) {
- res = 1;
- goto out;
- }
- *d++ = '/';
+
+ if (make_parent_dir(path)) {
+ res = 1;
+ goto out;
}
+
/* Try it again. */
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd == -1) {
@@ -933,7 +1020,7 @@ int conf_write_autoconf(void)
sym_clear_all_valid();
- file_write_dep("include/config/auto.conf.cmd");
+ conf_write_dep("include/config/auto.conf.cmd");
if (conf_split_config())
return 1;
@@ -980,14 +1067,22 @@ int conf_write_autoconf(void)
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
name = "include/generated/autoconf.h";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig.h", name))
return 1;
+
name = getenv("KCONFIG_TRISTATE");
if (!name)
name = "include/config/tristate.conf";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig_tristate", name))
return 1;
+
name = conf_get_autoconfig_name();
+ if (make_parent_dir(name))
+ return 1;
/*
* This must be the last step, kbuild has a dependency on auto.conf
* and this marks the successful completion of the previous steps.
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index f63b41b0dd49..7c329e179007 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -141,7 +141,7 @@ struct symbol {
#define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */
#define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */
#define SYMBOL_CHANGED 0x0400 /* ? */
-#define SYMBOL_AUTO 0x1000 /* value from environment variable */
+#define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */
#define SYMBOL_CHECKED 0x2000 /* used during dependency checking */
#define SYMBOL_WARNED 0x8000 /* warning has been issued */
@@ -185,7 +185,6 @@ enum prop_type {
P_SELECT, /* select BAR */
P_IMPLY, /* imply BAR */
P_RANGE, /* range 7..100 (for a symbol) */
- P_ENV, /* value from environment variable */
P_SYMBOL, /* where a symbol is defined */
};
diff --git a/scripts/kconfig/gconf-cfg.sh b/scripts/kconfig/gconf-cfg.sh
index 533b3d8f8f08..480ecd8b9f41 100755
--- a/scripts/kconfig/gconf-cfg.sh
+++ b/scripts/kconfig/gconf-cfg.sh
@@ -3,6 +3,13 @@
PKG="gtk+-2.0 gmodule-2.0 libglade-2.0"
+if [ -z "$(command -v pkg-config)" ]; then
+ echo >&2 "*"
+ echo >&2 "* 'make gconfig' requires 'pkg-config'. Please install it."
+ echo >&2 "*"
+ exit 1
+fi
+
if ! pkg-config --exists $PKG; then
echo >&2 "*"
echo >&2 "* Unable to find the GTK+ installation. Please make sure that"
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 610c4ab54d76..a9e48cc7b50a 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -101,8 +101,8 @@ const char *dbg_sym_flags(int val)
strcat(buf, "write/");
if (val & SYMBOL_CHANGED)
strcat(buf, "changed/");
- if (val & SYMBOL_AUTO)
- strcat(buf, "auto/");
+ if (val & SYMBOL_NO_WRITE)
+ strcat(buf, "no_write/");
buf[strlen(buf) - 1] = '\0';
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index ed3ff88e60ba..9eb7c837cd8f 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -97,7 +97,6 @@ void menu_set_type(int type);
/* util.c */
struct file *file_lookup(const char *name);
-int file_write_dep(const char *name);
void *xmalloc(size_t size);
void *xcalloc(size_t nmemb, size_t size);
void *xrealloc(void *p, size_t size);
@@ -126,7 +125,6 @@ const char *sym_get_string_default(struct symbol *sym);
struct symbol *sym_check_deps(struct symbol *sym);
struct property *prop_alloc(enum prop_type type, struct symbol *sym);
struct symbol *prop_get_symbol(struct property *prop);
-struct property *sym_get_env_prop(struct symbol *sym);
static inline tristate sym_get_tristate_value(struct symbol *sym)
{
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index a8b7a330587e..cf4510a2bdc7 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -10,7 +10,7 @@ int conf_write(const char *name);
int conf_write_autoconf(void);
bool conf_get_changed(void);
void conf_set_changed_callback(void (*fn)(void));
-void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap));
+void conf_set_message_callback(void (*fn)(const char *s));
/* menu.c */
extern struct menu rootmenu;
diff --git a/scripts/kconfig/mconf-cfg.sh b/scripts/kconfig/mconf-cfg.sh
index e6f9facd0077..c812872d7f9d 100755
--- a/scripts/kconfig/mconf-cfg.sh
+++ b/scripts/kconfig/mconf-cfg.sh
@@ -4,20 +4,23 @@
PKG="ncursesw"
PKG2="ncurses"
-if pkg-config --exists $PKG; then
- echo cflags=\"$(pkg-config --cflags $PKG)\"
- echo libs=\"$(pkg-config --libs $PKG)\"
- exit 0
-fi
+if [ -n "$(command -v pkg-config)" ]; then
+ if pkg-config --exists $PKG; then
+ echo cflags=\"$(pkg-config --cflags $PKG)\"
+ echo libs=\"$(pkg-config --libs $PKG)\"
+ exit 0
+ fi
-if pkg-config --exists $PKG2; then
- echo cflags=\"$(pkg-config --cflags $PKG2)\"
- echo libs=\"$(pkg-config --libs $PKG2)\"
- exit 0
+ if pkg-config --exists $PKG2; then
+ echo cflags=\"$(pkg-config --cflags $PKG2)\"
+ echo libs=\"$(pkg-config --libs $PKG2)\"
+ exit 0
+ fi
fi
-# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses
-# by pkg-config.
+# Check the default paths in case pkg-config is not installed.
+# (Even if it is installed, some distributions such as openSUSE cannot
+# find ncurses by pkg-config.)
if [ -f /usr/include/ncursesw/ncurses.h ]; then
echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\"
echo libs=\"-lncursesw\"
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 5294ed159b98..c1b38747c147 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -490,7 +490,6 @@ static void build_conf(struct menu *menu)
switch (prop->type) {
case P_MENU:
child_count++;
- prompt = prompt;
if (single_menu_mode) {
item_make("%s%*c%s",
menu->data ? "-->" : "++>",
@@ -772,16 +771,13 @@ static void show_helptext(const char *title, const char *text)
show_textbox(title, text, 0, 0);
}
-static void conf_message_callback(const char *fmt, va_list ap)
+static void conf_message_callback(const char *s)
{
- char buf[PATH_MAX+1];
-
- vsnprintf(buf, sizeof(buf), fmt, ap);
if (save_and_exit) {
if (!silent)
- printf("%s", buf);
+ printf("%s", s);
} else {
- show_textbox(NULL, buf, 6, 60);
+ show_textbox(NULL, s, 6, 60);
}
}
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 379a119dcd1e..4cf15d449c05 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -212,7 +212,7 @@ void menu_add_option(int token, char *arg)
sym_defconfig_list = current_entry->sym;
else if (sym_defconfig_list != current_entry->sym)
zconf_error("trying to redefine defconfig symbol");
- sym_defconfig_list->flags |= SYMBOL_AUTO;
+ sym_defconfig_list->flags |= SYMBOL_NO_WRITE;
break;
case T_OPT_ALLNOCONFIG_Y:
current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
diff --git a/scripts/kconfig/nconf-cfg.sh b/scripts/kconfig/nconf-cfg.sh
index 42f5ac73548e..001559ef0a60 100644
--- a/scripts/kconfig/nconf-cfg.sh
+++ b/scripts/kconfig/nconf-cfg.sh
@@ -4,20 +4,23 @@
PKG="ncursesw menuw panelw"
PKG2="ncurses menu panel"
-if pkg-config --exists $PKG; then
- echo cflags=\"$(pkg-config --cflags $PKG)\"
- echo libs=\"$(pkg-config --libs $PKG)\"
- exit 0
-fi
+if [ -n "$(command -v pkg-config)" ]; then
+ if pkg-config --exists $PKG; then
+ echo cflags=\"$(pkg-config --cflags $PKG)\"
+ echo libs=\"$(pkg-config --libs $PKG)\"
+ exit 0
+ fi
-if pkg-config --exists $PKG2; then
- echo cflags=\"$(pkg-config --cflags $PKG2)\"
- echo libs=\"$(pkg-config --libs $PKG2)\"
- exit 0
+ if pkg-config --exists $PKG2; then
+ echo cflags=\"$(pkg-config --cflags $PKG2)\"
+ echo libs=\"$(pkg-config --libs $PKG2)\"
+ exit 0
+ fi
fi
-# Unfortunately, some distributions (e.g. openSUSE) cannot find ncurses
-# by pkg-config.
+# Check the default paths in case pkg-config is not installed.
+# (Even if it is installed, some distributions such as openSUSE cannot
+# find ncurses by pkg-config.)
if [ -f /usr/include/ncursesw/ncurses.h ]; then
echo cflags=\"-D_GNU_SOURCE -I/usr/include/ncursesw\"
echo libs=\"-lncursesw -lmenuw -lpanelw\"
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
index 97b78445584b..5cbdb92e11b3 100644
--- a/scripts/kconfig/nconf.c
+++ b/scripts/kconfig/nconf.c
@@ -1210,12 +1210,9 @@ static void conf(struct menu *menu)
}
}
-static void conf_message_callback(const char *fmt, va_list ap)
+static void conf_message_callback(const char *s)
{
- char buf[1024];
-
- vsnprintf(buf, sizeof(buf), fmt, ap);
- btn_dialog(main_window, buf, 1, "<OK>");
+ btn_dialog(main_window, s, 1, "<OK>");
}
static void show_help(struct menu *menu)
diff --git a/scripts/kconfig/qconf-cfg.sh b/scripts/kconfig/qconf-cfg.sh
index 0862e1562536..02ccc0ae1031 100755
--- a/scripts/kconfig/qconf-cfg.sh
+++ b/scripts/kconfig/qconf-cfg.sh
@@ -4,6 +4,13 @@
PKG="Qt5Core Qt5Gui Qt5Widgets"
PKG2="QtCore QtGui"
+if [ -z "$(command -v pkg-config)" ]; then
+ echo >&2 "*"
+ echo >&2 "* 'make xconfig' requires 'pkg-config'. Please install it."
+ echo >&2 "*"
+ exit 1
+fi
+
if pkg-config --exists $PKG; then
echo cflags=\"-std=c++11 -fPIC $(pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)\"
echo libs=\"$(pkg-config --libs $PKG)\"
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index ad9c22dd04f5..0c3fa9405684 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1149,7 +1149,6 @@ QString ConfigInfoView::debug_info(struct symbol *sym)
case P_DEFAULT:
case P_SELECT:
case P_RANGE:
- case P_ENV:
debug += prop_get_type_name(prop->type);
debug += ": ";
expr_print(prop->expr, expr_print_help, &debug, E_NONE);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 7c9a88e91cfa..703b9b899ee9 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -76,15 +76,6 @@ struct property *sym_get_choice_prop(struct symbol *sym)
return NULL;
}
-struct property *sym_get_env_prop(struct symbol *sym)
-{
- struct property *prop;
-
- for_all_properties(sym, prop, P_ENV)
- return prop;
- return NULL;
-}
-
static struct property *sym_get_default_prop(struct symbol *sym)
{
struct property *prop;
@@ -463,7 +454,7 @@ void sym_calc_value(struct symbol *sym)
}
}
- if (sym->flags & SYMBOL_AUTO)
+ if (sym->flags & SYMBOL_NO_WRITE)
sym->flags &= ~SYMBOL_WRITE;
if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
@@ -1020,7 +1011,7 @@ static struct dep_stack {
struct dep_stack *prev, *next;
struct symbol *sym;
struct property *prop;
- struct expr *expr;
+ struct expr **expr;
} *check_top;
static void dep_stack_insert(struct dep_stack *stack, struct symbol *sym)
@@ -1085,31 +1076,42 @@ static void sym_check_print_recursive(struct symbol *last_sym)
fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
prop->file->name, prop->lineno);
- if (stack->expr) {
- fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
- prop->file->name, prop->lineno,
+ if (sym_is_choice(sym)) {
+ fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n",
+ menu->file->name, menu->lineno,
+ sym->name ? sym->name : "<choice>",
+ next_sym->name ? next_sym->name : "<choice>");
+ } else if (sym_is_choice_value(sym)) {
+ fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n",
+ menu->file->name, menu->lineno,
sym->name ? sym->name : "<choice>",
- prop_get_type_name(prop->type),
next_sym->name ? next_sym->name : "<choice>");
- } else if (stack->prop) {
+ } else if (stack->expr == &sym->dir_dep.expr) {
fprintf(stderr, "%s:%d:\tsymbol %s depends on %s\n",
prop->file->name, prop->lineno,
sym->name ? sym->name : "<choice>",
next_sym->name ? next_sym->name : "<choice>");
- } else if (sym_is_choice(sym)) {
- fprintf(stderr, "%s:%d:\tchoice %s contains symbol %s\n",
- menu->file->name, menu->lineno,
+ } else if (stack->expr == &sym->rev_dep.expr) {
+ fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n",
+ prop->file->name, prop->lineno,
sym->name ? sym->name : "<choice>",
next_sym->name ? next_sym->name : "<choice>");
- } else if (sym_is_choice_value(sym)) {
- fprintf(stderr, "%s:%d:\tsymbol %s is part of choice %s\n",
- menu->file->name, menu->lineno,
+ } else if (stack->expr == &sym->implied.expr) {
+ fprintf(stderr, "%s:%d:\tsymbol %s is implied by %s\n",
+ prop->file->name, prop->lineno,
sym->name ? sym->name : "<choice>",
next_sym->name ? next_sym->name : "<choice>");
+ } else if (stack->expr) {
+ fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
+ prop->file->name, prop->lineno,
+ sym->name ? sym->name : "<choice>",
+ prop_get_type_name(prop->type),
+ next_sym->name ? next_sym->name : "<choice>");
} else {
- fprintf(stderr, "%s:%d:\tsymbol %s is selected by %s\n",
+ fprintf(stderr, "%s:%d:\tsymbol %s %s is visible depending on %s\n",
prop->file->name, prop->lineno,
sym->name ? sym->name : "<choice>",
+ prop_get_type_name(prop->type),
next_sym->name ? next_sym->name : "<choice>");
}
}
@@ -1166,12 +1168,26 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym)
dep_stack_insert(&stack, sym);
+ stack.expr = &sym->dir_dep.expr;
+ sym2 = sym_check_expr_deps(sym->dir_dep.expr);
+ if (sym2)
+ goto out;
+
+ stack.expr = &sym->rev_dep.expr;
sym2 = sym_check_expr_deps(sym->rev_dep.expr);
if (sym2)
goto out;
+ stack.expr = &sym->implied.expr;
+ sym2 = sym_check_expr_deps(sym->implied.expr);
+ if (sym2)
+ goto out;
+
+ stack.expr = NULL;
+
for (prop = sym->prop; prop; prop = prop->next) {
- if (prop->type == P_CHOICE || prop->type == P_SELECT)
+ if (prop->type == P_CHOICE || prop->type == P_SELECT ||
+ prop->type == P_IMPLY)
continue;
stack.prop = prop;
sym2 = sym_check_expr_deps(prop->visible.expr);
@@ -1179,7 +1195,7 @@ static struct symbol *sym_check_sym_deps(struct symbol *sym)
break;
if (prop->type != P_DEFAULT || sym_is_choice(sym))
continue;
- stack.expr = prop->expr;
+ stack.expr = &prop->expr;
sym2 = sym_check_expr_deps(prop->expr);
if (sym2)
break;
@@ -1257,9 +1273,6 @@ struct symbol *sym_check_deps(struct symbol *sym)
sym->flags &= ~SYMBOL_CHECK;
}
- if (sym2 && sym2 == sym)
- sym2 = NULL;
-
return sym2;
}
@@ -1298,8 +1311,6 @@ const char *prop_get_type_name(enum prop_type type)
switch (type) {
case P_PROMPT:
return "prompt";
- case P_ENV:
- return "env";
case P_COMMENT:
return "comment";
case P_MENU:
diff --git a/scripts/kconfig/tests/warn_recursive_dep/Kconfig b/scripts/kconfig/tests/err_recursive_dep/Kconfig
similarity index 93%
rename from scripts/kconfig/tests/warn_recursive_dep/Kconfig
rename to scripts/kconfig/tests/err_recursive_dep/Kconfig
index a65bfcb7137e..ebdb3ffd8717 100644
--- a/scripts/kconfig/tests/warn_recursive_dep/Kconfig
+++ b/scripts/kconfig/tests/err_recursive_dep/Kconfig
@@ -1,3 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
+
# depends on itself
config A
@@ -31,7 +33,6 @@ config D2
bool
# depends on and imply
-# This is not recursive dependency
config E1
bool "E1"
diff --git a/scripts/kconfig/tests/err_recursive_dep/__init__.py b/scripts/kconfig/tests/err_recursive_dep/__init__.py
new file mode 100644
index 000000000000..5f3821b43ce6
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_dep/__init__.py
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0
+"""
+Detect recursive dependency error.
+
+Recursive dependency should be treated as an error.
+"""
+
+def test(conf):
+ assert conf.oldaskconfig() == 1
+ assert conf.stderr_contains('expected_stderr')
diff --git a/scripts/kconfig/tests/err_recursive_dep/expected_stderr b/scripts/kconfig/tests/err_recursive_dep/expected_stderr
new file mode 100644
index 000000000000..84679b104655
--- /dev/null
+++ b/scripts/kconfig/tests/err_recursive_dep/expected_stderr
@@ -0,0 +1,38 @@
+Kconfig:11:error: recursive dependency detected!
+Kconfig:11: symbol B is selected by B
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:5:error: recursive dependency detected!
+Kconfig:5: symbol A depends on A
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:17:error: recursive dependency detected!
+Kconfig:17: symbol C1 depends on C2
+Kconfig:21: symbol C2 depends on C1
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:32:error: recursive dependency detected!
+Kconfig:32: symbol D2 is selected by D1
+Kconfig:27: symbol D1 depends on D2
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:37:error: recursive dependency detected!
+Kconfig:37: symbol E1 depends on E2
+Kconfig:42: symbol E2 is implied by E1
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:60:error: recursive dependency detected!
+Kconfig:60: symbol G depends on G
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
+
+Kconfig:51:error: recursive dependency detected!
+Kconfig:51: symbol F2 depends on F1
+Kconfig:49: symbol F1 default value contains F2
+For a resolution refer to Documentation/kbuild/kconfig-language.txt
+subsection "Kconfig recursive dependency limitations"
diff --git a/scripts/kconfig/tests/warn_recursive_dep/__init__.py b/scripts/kconfig/tests/warn_recursive_dep/__init__.py
deleted file mode 100644
index adb21951ba41..000000000000
--- a/scripts/kconfig/tests/warn_recursive_dep/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-"""
-Warn recursive inclusion.
-
-Recursive dependency should be warned.
-"""
-
-def test(conf):
- assert conf.oldaskconfig() == 0
- assert conf.stderr_contains('expected_stderr')
diff --git a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr b/scripts/kconfig/tests/warn_recursive_dep/expected_stderr
deleted file mode 100644
index 3de807dd9cb2..000000000000
--- a/scripts/kconfig/tests/warn_recursive_dep/expected_stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-Kconfig:9:error: recursive dependency detected!
-Kconfig:9: symbol B is selected by B
-For a resolution refer to Documentation/kbuild/kconfig-language.txt
-subsection "Kconfig recursive dependency limitations"
-
-Kconfig:3:error: recursive dependency detected!
-Kconfig:3: symbol A depends on A
-For a resolution refer to Documentation/kbuild/kconfig-language.txt
-subsection "Kconfig recursive dependency limitations"
-
-Kconfig:15:error: recursive dependency detected!
-Kconfig:15: symbol C1 depends on C2
-Kconfig:19: symbol C2 depends on C1
-For a resolution refer to Documentation/kbuild/kconfig-language.txt
-subsection "Kconfig recursive dependency limitations"
-
-Kconfig:30:error: recursive dependency detected!
-Kconfig:30: symbol D2 is selected by D1
-Kconfig:25: symbol D1 depends on D2
-For a resolution refer to Documentation/kbuild/kconfig-language.txt
-subsection "Kconfig recursive dependency limitations"
-
-Kconfig:59:error: recursive dependency detected!
-Kconfig:59: symbol G depends on G
-For a resolution refer to Documentation/kbuild/kconfig-language.txt
-subsection "Kconfig recursive dependency limitations"
-
-Kconfig:50:error: recursive dependency detected!
-Kconfig:50: symbol F2 depends on F1
-Kconfig:48: symbol F1 default value contains F2
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index a365594770d9..d999683bb2a7 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -29,36 +29,6 @@ struct file *file_lookup(const char *name)
return file;
}
-/* write a dependency file as used by kbuild to track dependencies */
-int file_write_dep(const char *name)
-{
- struct file *file;
- FILE *out;
-
- if (!name)
- name = ".kconfig.d";
- out = fopen("..config.tmp", "w");
- if (!out)
- return 1;
- fprintf(out, "deps_config := \\\n");
- for (file = file_list; file; file = file->next) {
- if (file->next)
- fprintf(out, "\t%s \\\n", file->name);
- else
- fprintf(out, "\t%s\n", file->name);
- }
- fprintf(out, "\n%s: \\\n"
- "\t$(deps_config)\n\n", conf_get_autoconfig_name());
-
- env_write_dep(out, conf_get_autoconfig_name());
-
- fprintf(out, "\n$(deps_config): ;\n");
- fclose(out);
- rename("..config.tmp", name);
- return 0;
-}
-
-
/* Allocate initial growable string */
struct gstr str_new(void)
{
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 4b68272ebdb9..22fceb264cf5 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static struct menu *current_menu, *current_entry;
%}
-%expect 31
+%expect 30
%union
{
@@ -117,7 +117,7 @@ start: mainmenu_stmt stmt_list | stmt_list;
/* mainmenu entry */
-mainmenu_stmt: T_MAINMENU prompt nl
+mainmenu_stmt: T_MAINMENU prompt T_EOL
{
menu_add_prompt(P_MENU, $2, NULL);
};
@@ -265,7 +265,7 @@ symbol_option_arg:
choice: T_CHOICE word_opt T_EOL
{
struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE);
- sym->flags |= SYMBOL_AUTO;
+ sym->flags |= SYMBOL_NO_WRITE;
menu_add_entry(sym);
menu_add_expr(P_CHOICE, NULL, NULL);
free($2);
diff --git a/tools/Makefile b/tools/Makefile
index 3b9ae90369a8..c2b26340047a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -161,7 +161,7 @@ endif
ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),)
HOSTCFLAGS_kwbimage.o += \
$(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "")
-HOSTLOADLIBES_mkimage += \
+HOSTLDLIBS_mkimage += \
$(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto")
# OS X deprecate openssl in favour of CommonCrypto, supress deprecation
@@ -175,9 +175,9 @@ endif
HOSTCFLAGS_fit_image.o += -DMKIMAGE_DTC=\"$(CONFIG_MKIMAGE_DTC_PATH)\"
-HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)
-HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
-HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage)
+HOSTLDLIBS_dumpimage := $(HOSTLDLIBS_mkimage)
+HOSTLDLIBS_fit_info := $(HOSTLDLIBS_mkimage)
+HOSTLDLIBS_fit_check_sign := $(HOSTLDLIBS_mkimage)
hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl
hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
--
2.17.1
2
2
Hi Tom,
actually I've prepared this pull reuqest some weeks ago but was quite busy
since then to finally send it. This is just small stuff whcih can't break
anything. It would be great if you could sqeeze it in the release, thanks.
Gitlab: https://gitlab.denx.de/u-boot/custodians/u-boot-mips/pipelines/2695
Travis CI: https://travis-ci.org/github/danielschwierzeck/u-boot/builds/673086037
The following changes since commit dfd5321becc54d7ce9fd564aaaba70a2132c058e:
Merge tag 'u-boot-imx-20200408' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx (2020-04-08 12:06:39 -0400)
are available in the Git repository at:
git://git.denx.de/u-boot-mips.git tags/mips-fixes-for-2020.04
for you to fetch changes up to fb9acad30562177287d8cffec19e5dfa6f072de7:
mips: cmd: go: Flush cache before jumping to app/image (2020-04-09 19:00:00 +0200)
----------------------------------------------------------------
- doc: fix code examples in qemu-mips.rst
- mips: vcoreiii: fix memtest and cache coherency issues
- cmd/go: fix cache coherency issues on MIPS
----------------------------------------------------------------
Alex Nemirovsky (2):
MIPS: allow override of flush_dcache_range()
MIPS: allow override of get_tbclk()
Heinrich Schuchardt (1):
doc: board: qemu-mips.rst: fix code examples
Lars Povlsen (2):
mips: vcoreiii: Ajust CONFIG_SYS_MEMTEST_END
mips: vcoreiii: Fix cache coherency issues
Stefan Roese (1):
mips: cmd: go: Flush cache before jumping to app/image
arch/mips/cpu/time.c | 2 +-
arch/mips/lib/Makefile | 1 +
arch/mips/lib/boot.c | 23 +++++++++++++++++++++++
arch/mips/lib/cache.c | 2 +-
arch/mips/mach-mscc/cpu.c | 9 +++++----
arch/mips/mach-mscc/dram.c | 14 +++++---------
arch/mips/mach-mscc/include/mach/ddr.h | 4 ----
arch/mips/mach-mscc/lowlevel_init.S | 17 ++++++++++++++++-
doc/board/emulation/qemu-mips.rst | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------
include/configs/vcoreiii.h | 3 ++-
10 files changed, 114 insertions(+), 69 deletions(-)
create mode 100644 arch/mips/lib/boot.c
2
1

10 Apr '20
Rather than keeping the asynchronous schedule running always, keep it
running only across USB mass storage transfers for now, as it seems
that keeping it running all the time interferes with certain control
transfers during device enumeration.
Note that running the async schedule all the time should not be an
issue, especially on EHCI HCD, as that one implements most of the
transfers using async schedule.
Note that we have usb_disable_asynch(), which however is utterly broken.
The usb_disable_asynch() blocks the USB core from doing async transfers
by setting a global flag. The async schedule should however be disabled
per USB controller. Moreover, setting a global flag does not prevent the
controller from using the async schedule, which e.g. the EHCI HCD does.
This patch implements additional callback to the controller, which
permits it to lock the async schedule and keep it running across
multiple transfers. Once the schedule is unlocked, it must also be
disabled. This thus prevents the async schedule from running outside
of the USB mass storage transfers.
Signed-off-by: Marek Vasut <marek.vasut+renesas(a)gmail.com>
Cc: Lukasz Majewski <lukma(a)denx.de>
Cc: Tom Rini <trini(a)konsulko.com>
---
common/usb.c | 5 ++
common/usb_storage.c | 4 ++
drivers/usb/host/ehci-hcd.c | 91 +++++++++++++++++++++++++++++------
drivers/usb/host/ehci.h | 1 +
drivers/usb/host/usb-uclass.c | 11 +++++
include/usb.h | 11 +++++
6 files changed, 109 insertions(+), 14 deletions(-)
diff --git a/common/usb.c b/common/usb.c
index 349e838f1d..534cb1c0ef 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -172,6 +172,11 @@ int usb_detect_change(void)
return change;
}
+/* Lock or unlock async schedule on the controller */
+__weak int usb_lock_async(struct usb_device *dev, int lock)
+{
+}
+
/*
* disables the asynch behaviour of the control message. This is used for data
* transfers that uses the exclusiv access to the control and bulk messages.
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 097b6729c1..b291ac55d1 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1157,6 +1157,7 @@ static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
ss = (struct us_data *)udev->privptr;
usb_disable_asynch(1); /* asynch transfer not allowed */
+ usb_lock_async(udev, 1);
srb->lun = block_dev->lun;
buf_addr = (uintptr_t)buffer;
start = blknr;
@@ -1195,6 +1196,7 @@ retry_it:
debug("usb_read: end startblk " LBAF ", blccnt %x buffer %lx\n",
start, smallblks, buf_addr);
+ usb_lock_async(udev, 0);
usb_disable_asynch(0); /* asynch transfer allowed */
if (blkcnt >= ss->max_xfer_blk)
debug("\n");
@@ -1239,6 +1241,7 @@ static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
ss = (struct us_data *)udev->privptr;
usb_disable_asynch(1); /* asynch transfer not allowed */
+ usb_lock_async(udev, 1);
srb->lun = block_dev->lun;
buf_addr = (uintptr_t)buffer;
@@ -1280,6 +1283,7 @@ retry_it:
debug("usb_write: end startblk " LBAF ", blccnt %x buffer %lx\n",
start, smallblks, buf_addr);
+ usb_lock_async(udev, 0);
usb_disable_asynch(0); /* asynch transfer allowed */
if (blkcnt >= ss->max_xfer_blk)
debug("\n");
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 1cc02052f5..1edb344d0f 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -298,6 +298,51 @@ static void ehci_update_endpt2_dev_n_port(struct usb_device *udev,
QH_ENDPT2_HUBADDR(hubaddr));
}
+static int ehci_enable_async(struct ehci_ctrl *ctrl)
+{
+ u32 cmd;
+ int ret;
+
+ /* Enable async. schedule. */
+ cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
+ if (cmd & CMD_ASE)
+ return 0;
+
+ cmd |= CMD_ASE;
+ ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
+
+ ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_ASS, STS_ASS,
+ 100 * 1000);
+ if (ret < 0)
+ printf("EHCI fail timeout STS_ASS set\n");
+
+ return ret;
+}
+
+static int ehci_disable_async(struct ehci_ctrl *ctrl)
+{
+ u32 cmd;
+ int ret;
+
+ if (ctrl->async_locked)
+ return 0;
+
+ /* Disable async schedule. */
+ cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
+ if (!(cmd & CMD_ASE))
+ return 0;
+
+ cmd &= ~CMD_ASE;
+ ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
+
+ ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_ASS, 0,
+ 100 * 1000);
+ if (ret < 0)
+ printf("EHCI fail timeout STS_ASS reset\n");
+
+ return ret;
+}
+
static int
ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
int length, struct devrequest *req)
@@ -311,7 +356,6 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
uint32_t *tdp;
uint32_t endpt, maxpacket, token, usbsts, qhtoken;
uint32_t c, toggle;
- uint32_t cmd;
int timeout;
int ret = 0;
struct ehci_ctrl *ctrl = ehci_get_ctrl(dev);
@@ -556,19 +600,9 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
usbsts = ehci_readl(&ctrl->hcor->or_usbsts);
ehci_writel(&ctrl->hcor->or_usbsts, (usbsts & 0x3f));
- /* Enable async. schedule. */
- cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
- if (!(cmd & CMD_ASE)) {
- cmd |= CMD_ASE;
- ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
-
- ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_ASS, STS_ASS,
- 100 * 1000);
- if (ret < 0) {
- printf("EHCI fail timeout STS_ASS set\n");
- goto fail;
- }
- }
+ ret = ehci_enable_async(ctrl);
+ if (ret)
+ goto fail;
/* Wait for TDs to be processed. */
ts = get_timer(0);
@@ -611,6 +645,10 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
if (QT_TOKEN_GET_STATUS(token) & QT_TOKEN_STATUS_ACTIVE)
printf("EHCI timed out on TD - token=%#x\n", token);
+ ret = ehci_disable_async(ctrl);
+ if (ret)
+ goto fail;
+
if (!(QT_TOKEN_GET_STATUS(qhtoken) & QT_TOKEN_STATUS_ACTIVE)) {
debug("TOKEN=%#x\n", qhtoken);
switch (QT_TOKEN_GET_STATUS(qhtoken) &
@@ -1512,6 +1550,16 @@ static int _ehci_submit_int_msg(struct usb_device *dev, unsigned long pipe,
return result;
}
+static int _ehci_lock_async(struct ehci_ctrl *ctrl, int lock)
+{
+ ctrl->async_locked = lock;
+
+ if (lock)
+ return 0;
+
+ return ehci_disable_async(ctrl);
+}
+
#if !CONFIG_IS_ENABLED(DM_USB)
int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
void *buffer, int length)
@@ -1549,6 +1597,13 @@ int destroy_int_queue(struct usb_device *dev, struct int_queue *queue)
{
return _ehci_destroy_int_queue(dev, queue);
}
+
+int usb_lock_async(struct usb_device *dev, int lock)
+{
+ struct ehci_ctrl *ctrl = ehci_get_ctrl(dev);
+
+ return _ehci_lock_async(ctrl, lock);
+}
#endif
#if CONFIG_IS_ENABLED(DM_USB)
@@ -1612,6 +1667,13 @@ static int ehci_get_max_xfer_size(struct udevice *dev, size_t *size)
return 0;
}
+static int ehci_lock_async(struct udevice *dev, int lock)
+{
+ struct ehci_ctrl *ctrl = dev_get_priv(dev);
+
+ return _ehci_lock_async(ctrl, lock);
+}
+
int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
struct ehci_hcor *hcor, const struct ehci_ops *ops,
uint tweaks, enum usb_init_type init)
@@ -1678,6 +1740,7 @@ struct dm_usb_ops ehci_usb_ops = {
.poll_int_queue = ehci_poll_int_queue,
.destroy_int_queue = ehci_destroy_int_queue,
.get_max_xfer_size = ehci_get_max_xfer_size,
+ .lock_async = ehci_lock_async,
};
#endif
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 6c359af90c..66c1d61dbf 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -255,6 +255,7 @@ struct ehci_ctrl {
int periodic_schedules;
int ntds;
bool has_fsl_erratum_a005275; /* Freescale HS silicon quirk */
+ bool async_locked;
struct ehci_ops ops;
void *priv; /* client's private data */
};
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 8521651588..5e423012df 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -22,6 +22,17 @@ struct usb_uclass_priv {
int companion_device_count;
};
+int usb_lock_async(struct usb_device *udev, int lock)
+{
+ struct udevice *bus = udev->controller_dev;
+ struct dm_usb_ops *ops = usb_get_ops(bus);
+
+ if (!ops->lock_async)
+ return -ENOSYS;
+
+ return ops->lock_async(bus, lock);
+}
+
int usb_disable_asynch(int disable)
{
int old_value = asynch_allowed;
diff --git a/include/usb.h b/include/usb.h
index efb67ea33f..22f6088fe6 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -269,6 +269,7 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int pipe,
void *data, int len, int *actual_length, int timeout);
int usb_int_msg(struct usb_device *dev, unsigned long pipe,
void *buffer, int transfer_len, int interval, bool nonblock);
+int usb_lock_async(struct usb_device *dev, int lock);
int usb_disable_asynch(int disable);
int usb_maxpacket(struct usb_device *dev, unsigned long pipe);
int usb_get_configuration_no(struct usb_device *dev, int cfgno,
@@ -791,6 +792,16 @@ struct dm_usb_ops {
* in a USB transfer. USB class driver needs to be aware of this.
*/
int (*get_max_xfer_size)(struct udevice *bus, size_t *size);
+
+ /**
+ * lock_async() - Keep async schedule after a transfer
+ *
+ * It may be desired to keep the asynchronous schedule running even
+ * after a transfer finishes, usually when doing multiple transfers
+ * back-to-back. This callback allows signalling the USB controller
+ * driver to do just that.
+ */
+ int (*lock_async)(struct udevice *udev, int lock);
};
#define usb_get_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops)
--
2.25.1
3
4

10 Apr '20
This patch series moves the configuration of FPS-S for Apollo Lake
based SoCs from the code to the device-tree.
This is similar to the previous patch series for FSP-M.
Bernhard Messerklinger (2):
arch: x86: apl: Only load VBT if CONFIG_HAVE_VBT is enabled
arch: x86: apl: Read FSP-S configuration from device-tree
arch/x86/cpu/apollolake/fsp_s.c | 1084 +++++++++++------
arch/x86/dts/chromebook_coral.dts | 35 +-
.../asm/arch-apollolake/fsp/fsp_s_upd.h | 268 ++++
.../fsp/fsp2/apollolake/fsp-m.txt | 310 +++++
.../fsp/fsp2/apollolake/fsp-s.txt | 485 ++++++++
5 files changed, 1807 insertions(+), 375 deletions(-)
create mode 100644 doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt
create mode 100644 doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt
--
2.26.0
1
2

10 Apr '20
Hi Sean
> From: Sean Anderson [mailto:seanga2@gmail.com]
> Sent: Wednesday, April 08, 2020 10:21 PM
> To: Bin Meng; Rick Jian-Zhi Chen(陳建志); Lukas Auer; Anup Patel; Atish Patra; Pragnesh Patel; U-Boot Mailing List
> Subject: Re: [PATCH 4/7] riscv: Add SMP Kconfig option dependency for U-Boot proper
>
> On 4/8/20 9:41 AM, Bin Meng wrote:
> > U-Boot proper running in S-mode only need SMP support when using SBI
> > v0.1. With SBI v0.2 HSM extension, it does not need implement
> > multicore boot in U-Boot proper.
> >
> > Signed-off-by: Bin Meng <bmeng.cn(a)gmail.com>
> > ---
> >
> > arch/riscv/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index
> > 10478ae..502143f 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -193,6 +193,7 @@ config SYS_MALLOC_F_LEN
> >
> > config SMP
> > bool "Symmetric Multi-Processing"
> > + depends on SBI_V01
>
> So should this be
>
> "depends on SBI_V01 or RISCV_PRIV_1_9"
>
> when the priv spec 1.9 patch gets merged?
>
Your series: [v7,22/22] riscv: Add Sipeed Maix support
There are some patchs still need to be fixed:
[v7,22/22] riscv: Add Sipeed Maix support
https://patchwork.ozlabs.org/patch/1258463/
[v7,15/22] riscv: Clean up IPI initialization code
https://patchwork.ozlabs.org/patch/1258461/
And there are two patchs about clk still get no positive response from
clk maintainer
[v7,05/22] clk: Add functions to register CCF clock structs
https://patchwork.ozlabs.org/patch/1258446/
[v7,04/22] clk: Fix clk_get_by_* handling of index
https://patchwork.ozlabs.org/patch/1258442/
Thanks
Rick
> > help
> > This enables support for systems with more than one CPU. If
> > you say N here, U-Boot will run on single and multiprocessor
> >
>
> --Sean
>
2
1

[PATCH v2 0/2] arm: stm32mp1: activate data cache in SPL and before relocation
by Patrick Delaunay 10 Apr '20
by Patrick Delaunay 10 Apr '20
10 Apr '20
V2 after first feedbacks of the previous patch
"arm: stm32mp1: activate data cache in SPL and before relocation"
http://patchwork.ozlabs.org/patch/1263815/
This new serie depends on the ARM cache serie:
http://patchwork.ozlabs.org/project/uboot/list/?series=168378
I move tlb in .data section and simplify the implementation by reusing
the default weak function dram_bank_mmu_setup() for MMU configuration
and mmu_set_region_dcache_behaviour() to setup the specific behavior.
I also activate data cache on DDR for SPL.
For information the gain of the second patch is limited (few ms) for boot
from SDCARD: the SDMMC IP use internal DMA and data cache on DDR is
not really used.
Gain should be better for other boot use-case.
Example of bootstage report on STM32MP157C-DK2, boot from SD card.
1/ For trusted boot chain with TF-A
a) Before
STM32MP> bootstage report
Timer summary in microseconds (9 records):
Mark Elapsed Stage
0 0 reset
583,290 583,290 board_init_f
2,348,898 1,765,608 board_init_r
2,664,580 315,682 id=64
2,704,027 39,447 id=65
2,704,729 702 main_loop
5,563,519 2,858,790 id=175
Accumulated time:
41,696 dm_r
615,561 dm_f
b) After the serie
STM32MP> bootstage report
Timer summary in microseconds (9 records):
Mark Elapsed Stage
0 0 reset
583,401 583,401 board_init_f
727,725 144,324 board_init_r
1,043,362 315,637 id=64
1,082,806 39,444 id=65
1,083,507 701 main_loop
3,680,827 2,597,320 id=175
Accumulated time:
36,047 dm_f
41,718 dm_r
2/ And for the basic boot chain with SPL
a) Before:
STM32MP> bootstage report
Timer summary in microseconds (12 records):
Mark Elapsed Stage
0 0 reset
195,613 195,613 SPL
837,867 642,254 end SPL
840,117 2,250 board_init_f
2,739,639 1,899,522 board_init_r
3,066,815 327,176 id=64
3,103,377 36,562 id=65
3,104,078 701 main_loop
3,142,171 38,093 id=175
Accumulated time:
38,124 dm_spl
41,956 dm_r
648,861 dm_f
b) After the serie
STM32MP> bootstage report
Timer summary in microseconds (12 records):
Mark Elapsed Stage
0 0 reset
195,859 195,859 SPL
330,190 134,331 end SPL
332,408 2,218 board_init_f
482,688 150,280 board_init_r
808,694 326,006 id=64
845,029 36,335 id=65
845,730 701 main_loop
3,281,876 2,436,146 id=175
Accumulated time:
3,169 dm_spl
36,041 dm_f
41,701 dm_r
STM32MP> bootstage report
Timer summary in microseconds (12 records):
Mark Elapsed Stage
0 0 reset
211,036 211,036 SPL
343,393 132,357 end SPL
345,645 2,252 board_init_f
496,596 150,951 board_init_r
822,256 325,660 id=64
858,451 36,195 id=65
859,153 702 main_loop
3,414,706 2,555,553 id=175
Accumulated time:
3,132 dm_spl
36,005 dm_f
41,695 dm_r
Changes in v2:
- create a new function early_enable_caches
- use TLB in .init section
- use the default weak dram_bank_mmu_setup() and
use mmu_set_region_dcache_behaviour() to setup
the early MMU configuration
- enable data cache on DDR in SPL, after DDR controller initialization
- new
Patrick Delaunay (2):
arm: stm32mp: activate data cache in SPL and before relocation
arm: stm32mp: activate data cache on DDR in SPL
arch/arm/mach-stm32mp/cpu.c | 43 ++++++++++++++++++++++++++++++++++++-
arch/arm/mach-stm32mp/spl.c | 21 ++++++++++++++++++
2 files changed, 63 insertions(+), 1 deletion(-)
--
2.17.1
3
8
This patch series are divided into two parts:
The main part is to rewrite the whole architecture code of mt7628:
* Lock parts of the d-cache for initial stack so the rest of the code can
be reimplemented in C.
* Memory controller & DDR initialization have been fully written to support
detecting DDR size automatically.
* DDR calibration has also been reimplemented with a clear logic.
* Implemented a new sysreset driver to take advantage of the reset
controller so we can drop the use of syscon-based sysreset to reduce size.
The second part is to add SPL support for mt7628:
* With SPL enabled we can build the ROM-bootable and RAM-bootable binary
simultaneously, and we can drop RAM boot related configs and defconfig
files.
* Generate compressed u-boot.bin image for SPL to reduce size of final
combined binary.
* Enable DM support for SPL for a more flexible device probing.
* Add a demo board (mt7628_rfb) aims at router application.
Changes since v2:
* Dropped a patch which removes unused parts of mt7628a.dtsi
* Move lzma decompression support to common spl_nor.c
* Move u-boot,dm-pre-reloc to u-boot-mt7628.dtsi
Changes since v3:
* Rebased on newest master branch
* Add a test for binman etype u-boot-lzma-img to make sure binman passes 100%
code coverage
* Use u-boot-with-spl.bin for SPL-enabled output file
* Remove unused code from spl_nor loader.
Changes since v5:
* Rebased on newest master branch
* Made lzma decompressing support for legacy U-Boot images more generic, so
that it can be easily integrated into other devices loaders as well
Stefan Roese (4):
spl: Extract legacy image handling into separate file
spl: spl_legacy: Use IS_ENABLED() to remove #ifdef
spl: spl_nor: Move legacy image loading into spl_legacy.c
mips: mtmips: Increase CONFIG_SPL_SYS_MALLOC_F_LEN
Weijie Gao (22):
mips: add support to restore exception vector base before booting
linux
mips: mtmips: add predefined i-cache/d-cache size and linesize
mips: add an option to support initialize SRAM for initial stack
mips: start.S: avoid overwriting outside gd when clearing global data
in stack
sysreset: add reset controller based reboot driver
mips: mtmips: make use of sysreset-resetctrl for mt7628 soc
configs: enable CONFIG_RESTORE_EXCEPTION_VECTOR_BASE for all mtmips
boards
mips: add a mtmips-specific field to architecture-specific global data
mips: add a option to support not reserving malloc space on initial
stack
mips: mtmips: rewrite lowlevel codes of mt7628
dts: mtmips: add alternative pinmux node for uart2
mips: enable support for appending dtb to spl binary
mips: add an option to enable u_boot_list section for SPL loaders in
u-boot-spl.lds
lib: enable lzma decompression support for SPL build
Makefile: add support to generate LZMA compressed u-boot image
tools: binman: add etype file for u-boot-lzma-img
spl: spl_nor: Copy image header to local struct
spl: spl_legacy: Add lzma decompression support for legacy image
spl: spl_legacy: Add cache flush after reading U-Boot image
mips: mtmips: add SPL support
mips: mtmips: enable SPL for all boards
mips: mtmips: add support for mt7628-rfb
Makefile | 19 +
arch/mips/Kconfig | 66 ++++
arch/mips/cpu/start.S | 16 +-
arch/mips/cpu/u-boot-spl.lds | 4 +-
arch/mips/dts/Makefile | 1 +
arch/mips/dts/mediatek,mt7628-rfb.dts | 67 ++++
arch/mips/dts/mt7628-u-boot.dtsi | 56 +++
arch/mips/dts/mt7628a.dtsi | 17 +-
arch/mips/include/asm/global_data.h | 3 +
arch/mips/include/asm/u-boot-mips.h | 2 +
arch/mips/lib/bootm.c | 3 +
arch/mips/lib/traps.c | 19 +
arch/mips/mach-mtmips/Kconfig | 135 +++----
arch/mips/mach-mtmips/Makefile | 8 +-
arch/mips/mach-mtmips/cpu.c | 58 +---
arch/mips/mach-mtmips/ddr_cal.c | 211 +++++++++++
arch/mips/mach-mtmips/ddr_calibrate.c | 309 -----------------
arch/mips/mach-mtmips/ddr_init.c | 194 +++++++++++
arch/mips/mach-mtmips/include/mach/ddr.h | 52 +++
arch/mips/mach-mtmips/include/mach/mc.h | 180 ++++++++++
arch/mips/mach-mtmips/include/mach/serial.h | 13 +
arch/mips/mach-mtmips/lowlevel_init.S | 328 ------------------
arch/mips/mach-mtmips/mt7628/Makefile | 6 +
arch/mips/mach-mtmips/mt7628/ddr.c | 173 +++++++++
arch/mips/mach-mtmips/mt7628/init.c | 109 ++++++
arch/mips/mach-mtmips/mt7628/lowlevel_init.S | 161 +++++++++
arch/mips/mach-mtmips/mt7628/mt7628.h | 104 ++++++
arch/mips/mach-mtmips/mt7628/serial.c | 34 ++
arch/mips/mach-mtmips/mt76xx.h | 32 --
arch/mips/mach-mtmips/spl.c | 44 +++
board/gardena/smart-gateway-mt7688/board.c | 2 +
board/mediatek/mt7628/Kconfig | 12 +
board/mediatek/mt7628/MAINTAINERS | 7 +
board/mediatek/mt7628/Makefile | 3 +
board/mediatek/mt7628/board.c | 8 +
common/spl/Makefile | 1 +
common/spl/spl.c | 56 +--
common/spl/spl_legacy.c | 116 +++++++
common/spl/spl_nor.c | 31 +-
...gardena-smart-gateway-mt7688-ram_defconfig | 74 ----
.../gardena-smart-gateway-mt7688_defconfig | 14 +-
configs/linkit-smart-7688-ram_defconfig | 65 ----
configs/linkit-smart-7688_defconfig | 14 +-
configs/mt7628_rfb_defconfig | 46 +++
drivers/sysreset/Kconfig | 6 +
drivers/sysreset/Makefile | 1 +
drivers/sysreset/sysreset_resetctl.c | 48 +++
.../configs/gardena-smart-gateway-mt7688.h | 21 +-
include/configs/linkit-smart-7688.h | 22 +-
include/configs/mt7628.h | 56 +++
include/spl.h | 14 +
lib/Kconfig | 5 +
lib/Makefile | 1 +
tools/binman/README.entries | 15 +
tools/binman/etype/u_boot_lzma_img.py | 28 ++
tools/binman/ftest.py | 7 +
tools/binman/test/156_u_boot_lzma_img.dts | 11 +
57 files changed, 2077 insertions(+), 1031 deletions(-)
create mode 100644 arch/mips/dts/mediatek,mt7628-rfb.dts
create mode 100644 arch/mips/dts/mt7628-u-boot.dtsi
create mode 100644 arch/mips/mach-mtmips/ddr_cal.c
delete mode 100644 arch/mips/mach-mtmips/ddr_calibrate.c
create mode 100644 arch/mips/mach-mtmips/ddr_init.c
create mode 100644 arch/mips/mach-mtmips/include/mach/ddr.h
create mode 100644 arch/mips/mach-mtmips/include/mach/mc.h
create mode 100644 arch/mips/mach-mtmips/include/mach/serial.h
delete mode 100644 arch/mips/mach-mtmips/lowlevel_init.S
create mode 100644 arch/mips/mach-mtmips/mt7628/Makefile
create mode 100644 arch/mips/mach-mtmips/mt7628/ddr.c
create mode 100644 arch/mips/mach-mtmips/mt7628/init.c
create mode 100644 arch/mips/mach-mtmips/mt7628/lowlevel_init.S
create mode 100644 arch/mips/mach-mtmips/mt7628/mt7628.h
create mode 100644 arch/mips/mach-mtmips/mt7628/serial.c
delete mode 100644 arch/mips/mach-mtmips/mt76xx.h
create mode 100644 arch/mips/mach-mtmips/spl.c
create mode 100644 board/mediatek/mt7628/Kconfig
create mode 100644 board/mediatek/mt7628/MAINTAINERS
create mode 100644 board/mediatek/mt7628/Makefile
create mode 100644 board/mediatek/mt7628/board.c
create mode 100644 common/spl/spl_legacy.c
delete mode 100644 configs/gardena-smart-gateway-mt7688-ram_defconfig
delete mode 100644 configs/linkit-smart-7688-ram_defconfig
create mode 100644 configs/mt7628_rfb_defconfig
create mode 100644 drivers/sysreset/sysreset_resetctl.c
create mode 100644 include/configs/mt7628.h
create mode 100644 tools/binman/etype/u_boot_lzma_img.py
create mode 100644 tools/binman/test/156_u_boot_lzma_img.dts
--
2.26.0
3
34
This patch adds support for SAMSUNG's/NEXELL's ARM Cortex-A9 based
S5P4418 SoC, especially FriendlyARM's NanoPi2 and NanoPC-T2 boards.
It is based on the following FriendlyARM's U-Boot version:
https://github.com/friendlyarm/u-boot/tree/nanopi2-v2016.01.
Main changes in relation to nanopi2-v2016.01:
- Cosmetic changes due to patman warnings/errors.
- MMC and Video drivers changed to DM.
- Configs reworked (e.g. "CONFIG_..." moved from s5p4418_nanopi2.h
to s5p4418_nanopi2_defconfig)
- SPL related files are not included.
- MACH_TYPE_S5P4418 is not defined/used anymore.
- arch/arm/mach-nexell/include/mach/boot0.h added to generate the NSIH
(Nexell System Information Header), substitudes tools/nexell.
- board/s5p4418/ renamed to board/friendlyarm/
- Only the NanoPi2 and NanoPC-T2 boards are supported yet because I
do only have the NanoPC-T2 board to test the code (this board uses
the NanoPi2 code).
- USB is not supported yet.
The patch-series has been checked by buildman (all arm boards and two
m68k boards = M5235EVB):
buildman --step 0 -b master arm
buildman --step 0 -b master M5235EVB
There have been no new warnings or errors.
Changes in v2:
- arch/arm/mach-nexell/serial.c removed because this is for the UARTs
of the S5P6818 SoC which is not supported yet. S5P4418 UARTs are
different, here the (existing) PL011-code is used.
- line '... += spl/' in in arch/arm/mach-nexell/Makefile deleted, this
change has already been stated in the commit message but was missing
nethertheless.
- commit "i2c: mmc: add nexell driver (gpio, i2c, mmc, pwm)" splitted
into separate commits for gpio, i2c, mmc, pwm.
- cosmetic: line "obj-$(CONFIG_NX_GPIO) += nx_gpio.o" in
drivers/gpio/Makefile moved up.
- several Bugfixes in nx_i2c.c.
- the i2c-driver has been for s5p6818 only. Code extended approriately
in order s5p4418 is also working.
- "probe_chip" added to the i2c-driver.
- doc/device-tree-bindings/i2c/nx_i2c.txt added.
- Since drivers/pwm/pwm-nexell.c is an adapted version of
s5p-common/pwm.c an appropriately changed version of s5p-common/pwm.c
is used now. Therefore arch/arm/mach-s5pc1xx/include/mach/pwm.h
copied to arch/arm/mach-nexell/include/mach and s5p-common/Makefile
changed appropriately.
- i2c: "nexell,s5pxx18-i2c"-driver is used now instead of "i2c-gpio".
i2c0 and i2c1 added. I.e. dts files changed appropriately.
- dts: gmac-, ehci- and dwc2otg-entries removed because the appropriate
functionality is not supported yet.
- s5p4418-pinctrl.dtsi removed because there is no pinctrl-driver
available.
- "obj-$(CONFIG_ARCH_NEXELL) += s5p-common/" added to
arch/arm/cpu/armv7/Makefile since s5p-common/pwm.c is used now instead
of drivers/pwm/pwm-nexell.c.
- cosmetic: additional GPL license text removed, SPDX-License-Identifier
is enough. Furthermore file path removed (two files).
- USB related configs removed because USB is not supported yet.
- CONFIG_CMD_MEMTEST moved from s5p4418_nanopi2.h to
s5p4418_nanopi2_defconfig.
- MAINTAINERS: "F: drivers/pwm/pwm-nexell*" deleted because
arch/arm/cpu/armv7/s5p-common/pwm.c is used now. Furthermore double
line "F: drivers/video/nexell/" deleted.
Stefan Bosch (13):
arm: add mach-nexell (header files)
arm: add mach-nexell (all files except header files)
gpio: add nexell driver
i2c: add nexell driver
mmc: add nexell driver
pwm: add driver for nexell
video: add nexell video driver (soc: displaytop)
video: add nexell video driver (soc: mlc, mipi)
video: add nexell video driver (soc: lvds, hdmi)
video: add nexell video driver (soc: dpc, makefile)
video: add nexell video driver (display/video driver)
arm: add support for SoC s5p4418 (cpu) / nanopi2 board
arm: add (default) config for nanopi2 board
MAINTAINERS | 16 +
arch/arm/Kconfig | 7 +
arch/arm/Makefile | 1 +
arch/arm/cpu/armv7/Makefile | 2 +
arch/arm/cpu/armv7/s5p-common/Makefile | 4 +
arch/arm/cpu/armv7/s5p-common/pwm.c | 56 +
arch/arm/cpu/armv7/s5p4418/Makefile | 6 +
arch/arm/cpu/armv7/s5p4418/cpu.c | 120 ++
arch/arm/dts/Makefile | 3 +
arch/arm/dts/s5p4418-nanopi2.dts | 108 ++
arch/arm/dts/s5p4418.dtsi | 148 ++
arch/arm/mach-nexell/Kconfig | 67 +
arch/arm/mach-nexell/Makefile | 13 +
arch/arm/mach-nexell/clock.c | 869 +++++++++
arch/arm/mach-nexell/cmd_boot_linux.c | 145 ++
arch/arm/mach-nexell/config.mk | 11 +
arch/arm/mach-nexell/include/mach/boot0.h | 40 +
arch/arm/mach-nexell/include/mach/clk.h | 24 +
arch/arm/mach-nexell/include/mach/display.h | 273 +++
arch/arm/mach-nexell/include/mach/display_dev.h | 37 +
arch/arm/mach-nexell/include/mach/ehci.h | 106 ++
arch/arm/mach-nexell/include/mach/gpio.h | 17 +
arch/arm/mach-nexell/include/mach/mipi_display.h | 215 +++
arch/arm/mach-nexell/include/mach/nexell.h | 352 ++++
arch/arm/mach-nexell/include/mach/nx_gpio.h | 103 ++
arch/arm/mach-nexell/include/mach/pwm.h | 54 +
arch/arm/mach-nexell/include/mach/reset.h | 19 +
arch/arm/mach-nexell/include/mach/sec_reg.h | 15 +
arch/arm/mach-nexell/include/mach/tieoff.h | 423 +++++
arch/arm/mach-nexell/nx_gpio.c | 352 ++++
arch/arm/mach-nexell/nx_sec_reg.c | 82 +
arch/arm/mach-nexell/reg-call.S | 23 +
arch/arm/mach-nexell/reset.c | 33 +
arch/arm/mach-nexell/tieoff.c | 109 ++
arch/arm/mach-nexell/timer.c | 297 ++++
board/friendlyarm/Kconfig | 39 +
board/friendlyarm/nanopi2/Kconfig | 12 +
board/friendlyarm/nanopi2/MAINTAINERS | 7 +
board/friendlyarm/nanopi2/Makefile | 6 +
board/friendlyarm/nanopi2/board.c | 567 ++++++
board/friendlyarm/nanopi2/hwrev.c | 108 ++
board/friendlyarm/nanopi2/hwrev.h | 15 +
board/friendlyarm/nanopi2/lcds.c | 697 ++++++++
board/friendlyarm/nanopi2/nxp-fb.h | 94 +
board/friendlyarm/nanopi2/onewire.c | 309 ++++
board/friendlyarm/nanopi2/onewire.h | 15 +
configs/s5p4418_nanopi2_defconfig | 148 ++
doc/README.s5p4418 | 63 +
doc/device-tree-bindings/i2c/nx_i2c.txt | 28 +
drivers/gpio/Kconfig | 9 +
drivers/gpio/Makefile | 1 +
drivers/gpio/nx_gpio.c | 252 +++
drivers/i2c/Kconfig | 9 +
drivers/i2c/Makefile | 1 +
drivers/i2c/nx_i2c.c | 649 +++++++
drivers/mmc/Kconfig | 6 +
drivers/mmc/Makefile | 1 +
drivers/mmc/nexell_dw_mmc_dm.c | 350 ++++
drivers/video/Kconfig | 10 +
drivers/video/Makefile | 1 +
drivers/video/nexell/Kconfig | 27 +
drivers/video/nexell/Makefile | 12 +
drivers/video/nexell/s5pxx18_dp.c | 338 ++++
drivers/video/nexell/s5pxx18_dp_hdmi.c | 543 ++++++
drivers/video/nexell/s5pxx18_dp_lvds.c | 274 +++
drivers/video/nexell/s5pxx18_dp_mipi.c | 677 +++++++
drivers/video/nexell/s5pxx18_dp_rgb.c | 69 +
drivers/video/nexell/soc/Makefile | 11 +
drivers/video/nexell/soc/s5pxx18_soc_disptop.c | 185 ++
drivers/video/nexell/soc/s5pxx18_soc_disptop.h | 385 ++++
drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.c | 309 ++++
drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.h | 59 +
drivers/video/nexell/soc/s5pxx18_soc_disptype.h | 23 +
drivers/video/nexell/soc/s5pxx18_soc_dpc.c | 1569 +++++++++++++++++
drivers/video/nexell/soc/s5pxx18_soc_dpc.h | 444 +++++
drivers/video/nexell/soc/s5pxx18_soc_hdmi.c | 50 +
drivers/video/nexell/soc/s5pxx18_soc_hdmi.h | 488 +++++
drivers/video/nexell/soc/s5pxx18_soc_lvds.c | 278 +++
drivers/video/nexell/soc/s5pxx18_soc_lvds.h | 83 +
drivers/video/nexell/soc/s5pxx18_soc_mipi.c | 580 ++++++
drivers/video/nexell/soc/s5pxx18_soc_mipi.h | 291 +++
drivers/video/nexell/soc/s5pxx18_soc_mlc.c | 1861 ++++++++++++++++++++
drivers/video/nexell/soc/s5pxx18_soc_mlc.h | 429 +++++
drivers/video/nexell_display.c | 665 +++++++
include/configs/s5p4418_nanopi2.h | 265 +++
85 files changed, 17462 insertions(+)
create mode 100644 arch/arm/cpu/armv7/s5p4418/Makefile
create mode 100644 arch/arm/cpu/armv7/s5p4418/cpu.c
create mode 100644 arch/arm/dts/s5p4418-nanopi2.dts
create mode 100644 arch/arm/dts/s5p4418.dtsi
create mode 100644 arch/arm/mach-nexell/Kconfig
create mode 100644 arch/arm/mach-nexell/Makefile
create mode 100644 arch/arm/mach-nexell/clock.c
create mode 100644 arch/arm/mach-nexell/cmd_boot_linux.c
create mode 100644 arch/arm/mach-nexell/config.mk
create mode 100644 arch/arm/mach-nexell/include/mach/boot0.h
create mode 100644 arch/arm/mach-nexell/include/mach/clk.h
create mode 100644 arch/arm/mach-nexell/include/mach/display.h
create mode 100644 arch/arm/mach-nexell/include/mach/display_dev.h
create mode 100644 arch/arm/mach-nexell/include/mach/ehci.h
create mode 100644 arch/arm/mach-nexell/include/mach/gpio.h
create mode 100644 arch/arm/mach-nexell/include/mach/mipi_display.h
create mode 100644 arch/arm/mach-nexell/include/mach/nexell.h
create mode 100644 arch/arm/mach-nexell/include/mach/nx_gpio.h
create mode 100644 arch/arm/mach-nexell/include/mach/pwm.h
create mode 100644 arch/arm/mach-nexell/include/mach/reset.h
create mode 100644 arch/arm/mach-nexell/include/mach/sec_reg.h
create mode 100644 arch/arm/mach-nexell/include/mach/tieoff.h
create mode 100644 arch/arm/mach-nexell/nx_gpio.c
create mode 100644 arch/arm/mach-nexell/nx_sec_reg.c
create mode 100644 arch/arm/mach-nexell/reg-call.S
create mode 100644 arch/arm/mach-nexell/reset.c
create mode 100644 arch/arm/mach-nexell/tieoff.c
create mode 100644 arch/arm/mach-nexell/timer.c
create mode 100644 board/friendlyarm/Kconfig
create mode 100644 board/friendlyarm/nanopi2/Kconfig
create mode 100644 board/friendlyarm/nanopi2/MAINTAINERS
create mode 100644 board/friendlyarm/nanopi2/Makefile
create mode 100644 board/friendlyarm/nanopi2/board.c
create mode 100644 board/friendlyarm/nanopi2/hwrev.c
create mode 100644 board/friendlyarm/nanopi2/hwrev.h
create mode 100644 board/friendlyarm/nanopi2/lcds.c
create mode 100644 board/friendlyarm/nanopi2/nxp-fb.h
create mode 100644 board/friendlyarm/nanopi2/onewire.c
create mode 100644 board/friendlyarm/nanopi2/onewire.h
create mode 100644 configs/s5p4418_nanopi2_defconfig
create mode 100644 doc/README.s5p4418
create mode 100644 doc/device-tree-bindings/i2c/nx_i2c.txt
create mode 100644 drivers/gpio/nx_gpio.c
create mode 100644 drivers/i2c/nx_i2c.c
create mode 100644 drivers/mmc/nexell_dw_mmc_dm.c
create mode 100644 drivers/video/nexell/Kconfig
create mode 100644 drivers/video/nexell/Makefile
create mode 100644 drivers/video/nexell/s5pxx18_dp.c
create mode 100644 drivers/video/nexell/s5pxx18_dp_hdmi.c
create mode 100644 drivers/video/nexell/s5pxx18_dp_lvds.c
create mode 100644 drivers/video/nexell/s5pxx18_dp_mipi.c
create mode 100644 drivers/video/nexell/s5pxx18_dp_rgb.c
create mode 100644 drivers/video/nexell/soc/Makefile
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptop_clk.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_disptype.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_dpc.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_dpc.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_hdmi.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_hdmi.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_lvds.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_lvds.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mipi.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mipi.h
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mlc.c
create mode 100644 drivers/video/nexell/soc/s5pxx18_soc_mlc.h
create mode 100644 drivers/video/nexell_display.c
create mode 100644 include/configs/s5p4418_nanopi2.h
--
1.9.1
4
20

09 Apr '20
Currently, dm drivers command produces a segfault:
=> dm drivers
Driver Compatible
--------------------------------
Segmentation fault (core dumped)
This is caused by a NULL pointer dereference of entry->of_match.
Add a check to prevent this.
Signed-off-by: Ovidiu Panait <ovpanait(a)gmail.com>
Cc: Sean Anderson <seanga2(a)gmail.com>
Cc: Simon Glass <sjg(a)chromium.org>
---
drivers/core/dump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index e73ebeabcc..b5046398d4 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -107,7 +107,8 @@ void dm_dump_drivers(void)
puts("Driver Compatible\n");
puts("--------------------------------\n");
for (entry = d; entry < d + n_ents; entry++) {
- for (match = entry->of_match; match->compatible; match++)
+ for (match = entry->of_match;
+ match && match->compatible; match++)
printf("%-20.20s %s\n",
match == entry->of_match ? entry->name : "",
match->compatible);
--
2.17.1
4
7
Add a test for the dm drivers command. Also fix a null pointer dereference
revealed by said test.
Signed-off-by: Sean Anderson <seanga2(a)gmail.com>
Reviewed-by: Bin Meng <bmeng.cn(a)gmail.com>
Tested-by: Bin Meng <bmeng.cn(a)gmail.com>
Reviewed-by: Simon Glass <sjg(a)chromium.org>
---
The changes in this patch were originally submitted as v3 of 7b9d60fc1ff
"cmd: Add command to dump drivers and compatible strings" [1]. I have
retained the Reviewed-by and Tested-by tags since no other changes besides
rebasing on v1 have been made.
[1] https://patchwork.ozlabs.org/patch/1234460/
cmd/dm.c | 4 ++--
drivers/core/dump.c | 3 ++-
test/py/tests/test_dm.py | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 3 deletions(-)
create mode 100644 test/py/tests/test_dm.py
diff --git a/cmd/dm.c b/cmd/dm.c
index 108707c298..7a90685f8b 100644
--- a/cmd/dm.c
+++ b/cmd/dm.c
@@ -41,7 +41,7 @@ static int do_dm_dump_devres(cmd_tbl_t *cmdtp, int flag, int argc,
}
static int do_dm_dump_drivers(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+ char * const argv[])
{
dm_dump_drivers();
@@ -94,5 +94,5 @@ U_BOOT_CMD(
"tree Dump driver model tree ('*' = activated)\n"
"dm uclass Dump list of instances for each uclass\n"
"dm devres Dump list of device resources for each device\n"
- "dm drivers Dump list of drivers and their compatible strings\n"
+ "dm drivers Dump list of drivers and their compatible strings"
);
diff --git a/drivers/core/dump.c b/drivers/core/dump.c
index e73ebeabcc..b5046398d4 100644
--- a/drivers/core/dump.c
+++ b/drivers/core/dump.c
@@ -107,7 +107,8 @@ void dm_dump_drivers(void)
puts("Driver Compatible\n");
puts("--------------------------------\n");
for (entry = d; entry < d + n_ents; entry++) {
- for (match = entry->of_match; match->compatible; match++)
+ for (match = entry->of_match;
+ match && match->compatible; match++)
printf("%-20.20s %s\n",
match == entry->of_match ? entry->name : "",
match->compatible);
diff --git a/test/py/tests/test_dm.py b/test/py/tests/test_dm.py
new file mode 100644
index 0000000000..f6fbf8ba4c
--- /dev/null
+++ b/test/py/tests/test_dm.py
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2020 Sean Anderson
+
+import pytest
+
+(a)pytest.mark.buildconfigspec('cmd_dm')
+def test_dm_drivers(u_boot_console):
+ """Test that each driver in `dm tree` is also listed in `dm drivers`."""
+ response = u_boot_console.run_command('dm tree')
+ driver_index = response.find('Driver')
+ assert driver_index != -1
+ drivers = (line[driver_index:].split()[0]
+ for line in response[:-1].split('\n')[2:])
+
+ response = u_boot_console.run_command('dm drivers')
+ for driver in drivers:
+ assert driver in response
--
2.25.1
3
3