| d6c2ac5b | 11-Aug-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
spl: move SPL driver entries to driver/Makefile
Just preparing for upcoming cleaning.
The board-specific linker script board/vpac270/u-boot-spl.lds has been touched to avoid build error. It does
spl: move SPL driver entries to driver/Makefile
Just preparing for upcoming cleaning.
The board-specific linker script board/vpac270/u-boot-spl.lds has been touched to avoid build error. It does not change the size of spl/u-boot-spl.bin for this board, so it should be OK.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stefano Babic <sbabic@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 8be60f06 | 11-Aug-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
linux/kconfig.h: add CPP macros useful for per-image config options
The previous commit introduced a useful macro used in makefiles, in order to reference to different variables (CONFIG_... or CONFI
linux/kconfig.h: add CPP macros useful for per-image config options
The previous commit introduced a useful macro used in makefiles, in order to reference to different variables (CONFIG_... or CONFIG_SPL_...) depending on the build context.
Per-image config option control is a PITA in C sources, too. Here are some macros useful in C/CPP expressions.
CONFIG_IS_ENABLED(FOO) can be used as a shorthand for
(!defined(CONFIG_SPL_BUILD) && defined(CONFIG_FOO)) || \ (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_FOO))
For example, it is useful to describe C code as follows,
#if CONFIG_IS_ENABLED(OF_CONTROL) (device tree code) #else (board file code) #endif
The ifdef conditional above is switched by CONFIG_OF_CONTROL during the U-Boot proper building (CONFIG_SPL_BUILD is not defined), and by CONFIG_SPL_OF_CONTROL during SPL building (CONFIG_SPL_BUILD is defined).
The macro can be used in C context as well, so you can also write the equivalent code as follows:
if (CONFIG_IS_ENABLED(OF_CONTROL)) { (device tree code) } else { (board file code) }
Another useful macro is CONFIG_VALUE(). CONFIG_VALUE(FOO) is expanded into CONFIG_FOO if CONFIG_SPL_BUILD is undefined, and into CONFIG_SPL_FOO if CONFIG_SPL_BUILD is defined.
You can write as follows:
text_base = CONFIG_VALUE(TEXT_BASE);
instead of:
#ifdef CONFIG_SPL_BUILD text_base = CONFIG_SPL_TEXT_BASE; #else text_base = CONFIG_TEXT_BASE; #endif
This commit also adds slight hacking on fixdep so that it can output a correct list of fixed dependencies.
If the fixdep finds CONFIG_IS_ENABLED(FOO) in a source file, we want $(wildcard include/config/foo.h) in the U-boot proper building context, while we want $(wildcard include/config/spl/foo.h) in the SPL build context.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 04a5c406 | 11-Aug-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kbuild: add a makefile macro useful with per-image config options
Commit e02ee2548afe ("kconfig: switch to single .config configuration") made the configuration itself pretty simple, instead, we los
kbuild: add a makefile macro useful with per-image config options
Commit e02ee2548afe ("kconfig: switch to single .config configuration") made the configuration itself pretty simple, instead, we lost the way to systematically enable/disable config options for each image independently.
Our current strategy is, put entries into Makefile.spl for options we need separate enabling, or once enable the options globally in Kconfig and then undef them in Makefile.uncmd_spl if we do not want to compile the features for SPL at all. Things are getting really messy. Besides, "ifdef CONFIG_SPL_BUILD" are sprinkled everywhere in makefiles.
This commit adds a variable to help describe makefile simpler.
$(SPL_) evaluates to "SPL_" during the SPL build, while to an empty string during building U-boot proper.
So, you can write
obj-$(CONFIG_$(SPL_)FOO) += foo.o
instead of
ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_FOO) += foo.o else obj-$(CONFIG_FOO) += foo.o endif
If CONFIG_SPL_FOO does not exist in Kconfig, it is equivalent to
ifndef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_FOO) += foo.o endif
This is the pattern we often see in our current makefiles.
To take advantage of this macro, we should prefix SPL_ for the SPL version of the option when we need independent control between U-boot and SPL. With this naming scheme, I hope our makefiles will be much simplified.
It means we want to rename existing config options as follows in the long run:
CONFIG_SPL_SERIAL_SUPPORT -> CONFIG_SPL_SERIAL CONFIG_SPL_I2C_SUPPORT -> CONFIG_SPL_I2C CONFIG_SPL_GPIO_SUPPORT -> CONFIG_SPL_GPIO CONFIG_SPL_SPI_SUPPORT -> CONFIG_SPL_SPI CONFIG_SPL_DISABLE_OF_CONTROL -> CONFIG_SPL_OF_CONTROL (inverting the logic)
Then drivers/Makefile would be re-worked as follows:
obj-$(CONFIG_$(SPL_)SERIAL) += serial/ obj-$(CONFIG_$(SPL_)I2C) += i2c/ obj-$(CONFIG_$(SPL_)GPIO) += gpio/ obj-$(CONFIG_$(SPL_)SPI) += spi/ ...
Eventually, SPL-specialized entries in Makefile.spl would go away.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| a350c6a6 | 15-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kbuild: create symbolic link only for ARM, AVR32, SPARC, PowerPC, x86
The symbolic link to SoC/CPU specific header directory is created during the build, while it is only necessary for ARM, AVR32, S
kbuild: create symbolic link only for ARM, AVR32, SPARC, PowerPC, x86
The symbolic link to SoC/CPU specific header directory is created during the build, while it is only necessary for ARM, AVR32, SPARC, x86, and some CPUs of PowerPC. For the other architectures, it just results in a broken symbolic link.
Introduce CONFIG_CREATE_ARCH_SYMLINK to not create unneeded symbolic links.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 98bd0e0d | 04-Jul-2015 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kbuild: sync with Linux 4.1
Update some build scripts to match Linux 4.1. Commit-based syncing was done so as not to break U-Boot specific changes. The previous big sync was from Linux 3.18-rc1 by
kbuild: sync with Linux 4.1
Update some build scripts to match Linux 4.1. Commit-based syncing was done so as not to break U-Boot specific changes. The previous big sync was from Linux 3.18-rc1 by commit 176d09827725 (kbuild: sync misc scripts with Linux 3.18-rc1).
The commits imported from Linux (some with adjustments) are:
[1] commit 9fb5e5372208973984a23ee6f5f025c05d364633 Author: Robert Richter <rrichter@cavium.com> dts, kbuild: Factor out dtbs install rules to Makefile.dtbinst
[2] commit 371fdc77af44f4cb32475fd499e1d912ccc30890 Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: collect shorthands into scripts/Kbuild.include
[3] commit a29b82326ed4eb5567b03c85b52c6891578d5a03 Author: Michal Marek <mmarek@suse.cz> kbuild: Remove duplicate $(cmd) definition in Makefile.clean
[4] commit 1846dfbde3e8a53f3673dcb1c1b79fd9b3f8d40d Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: remove redundant -rR flag of hdr-inst
[5] commit 34948e0bbf98640fc1821751b01d2f0cd17d84d5 Author: Michal Marek <mmarek@suse.cz> kbuild: Drop support for clean-rule
[6] commit a16c5f99a28c9945165c46da27fff8e6f26f8736 Author: Michal Marek <mmarek@suse.cz> kbuild: Fix removal of the debian/ directory
[7] commit d0d38cd9e853db11e0242b3df4c9c3c4a663fbb4 Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: use mixed-targets when two or more config targets are given
[8] commit dd33c03b18b3f2db791eb6a17c37d2de66e4de18 Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: fix cc-ifversion macro
[9] commit 665d92e38f65d70796aad2b8e49e42e80815d4a4 Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: do not add $(call ...) to invoke cc-version or cc-fullversion
[10] commit 6dcb4e5edf39e3b65a75ca76f087b2fdbee8a808 Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: allow cc-ifversion to have the argument for false condition
[11] commit c0a80c0c27e5e65b180a25e6c4c2f7ef9e386cd3 Author: Heiko Carstens <heiko.carstens@de.ibm.com> ftrace: allow architectures to specify ftrace compile options
[12] commit 0b24becc810dc3be6e3f94103a866f214c282394 Author: Andrey Ryabinin <a.ryabinin@samsung.com> kasan: add kernel address sanitizer infrastructure
[13] commit 4218affdf57f938c04e3a916a9685ee27079f377 Author: Masahiro Yamada <yamada.m@jp.panasonic.com> kbuild: remove warning about "make depend"
[14] commit 77479b38e2f58890eb221a0418357502a5b41cd6 Author: Nathan Rossi <nathan.rossi@xilinx.com> kbuild: Create directory for target DTB
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Robert Richter <rrichter@cavium.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com> Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Michal Marek <mmarek@suse.cz> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|