summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)Author
2014-03-07kbuild: improve Kbuild speedMasahiro Yamada
Kbuild brought about many advantages for us but a significant performance regression was reported by Simon Glass. After some discussions and analysis, it turned out its main cause is in $(call cc-option,...). Historically, U-Boot parses all config.mk (arch/*/config.mk and board/*/config.mk) every time descending into subdirectories. That means cc-options are evaluated over and over again. $(call cc-option,...) is useful but costly. So we want to evaluate them only in ./Makefile and spl/Makefile and export compiler flags. This commit changes the build system as follows: - Modify scripts/Makefile.build to not include config.mk Instead, add $(PLATFORM_CPPFLAGS) to asflags-y, ccflags-y, cppflags-y. - Export many variables Going forward, Kbuild will not parse config.mk files when it descends into subdirectories. If we want to set variables in config.mk and use them in subdirectories, they must be exported. This is the list of variables to get exported: PLATFORM_CPPFLAGS CPUDIR BOARDDIR OBJCOPYFLAGS LDFLAGS LDFLAGS_FINAL (used in nand_spl/board/*/*/Makefile) CONFIG_STANDALONE_LOAD_ADDR (used in examples/standalone/Makefile) SYM_PREFIX (used in examples/standalone/Makefile) RELFLAGS (used in examples/standalone/Makefile) - Delete CPPFLAGS This variable has been replaced with PLATFORM_CPPFLAGS - Copy gcclibdir from example/standalone/Makefile to arch/sparc/config.mk The reference in CONFIG_STANDALONE_LOAD_ADDR must be resolved before it is exported. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reported-by: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> [on Sandbox] Tested-by: Stephen Warren <swarren@nvidia.com> [on Tegra]
2014-03-04scripts: update checkpatch.pl to latest upstream versionTom Rini
Update to v3.14-rc4's version of checkpatch.pl. In doing so we drop the changes to top_of_kernel_tree() as we pass in --no-tree and drop our changes about MAINTAINERS as that's for reporting checkpatch.pl problems itself (and upstream has said they'll reword this section to be clearer). Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini
Conflicts: arch/arm/cpu/armv7/config.mk board/ti/am43xx/mux.c include/configs/am43xx_evm.h Signed-off-by: Tom Rini <trini@ti.com>
2014-02-26checkpatch.pl: Add warning for new __packed additionsTom Rini
While there are valid reasons to use __packed, often the answer is that you should be doing something else here instead. Signed-off-by: Tom Rini <trini@ti.com>
2014-02-25kbuild: consolidate version and timestamp headers generationMasahiro Yamada
- Generate include/generated/{timestamp.h, version.h} more simply by using filechk rule. - Add $(UBOOTRELEASE) variable and re-write u-boot.imx rule more simply. - Rename U_BOOT_VERSION in Makefile to UBOOTVERSION Before this commit, the same variable name, "U_BOOT_VERSION" was used for two different strings. One of them was defined in Makefile. It takes the form like "2014.01-rc1" and used in makefiles and script files. The other is defined in include/generated/version.h It takes the form like "U-Boot 2014.01-rc1-00010-gbe6d426-dirty" and used in C and Aseembler. It is confusing when grepping the source tree. So, this commit renames the former to UBOOTVERSION. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-25Makefile: add a new script to check -fstack-usage supportMasahiro Yamada
If -fstack-usage option is given to crosstools that do not support it, gcc displays a warning message but still exits with status 0. This means we can not rely on $(call cc-option,...) to detect if -fstack-usage option is supported or not. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19dts: move device tree sources to arch/$(ARCH)/dts/Masahiro Yamada
Unlike Linux Kernel, U-Boot historically had *.dts files under board/$(VENDOR)/dts/ and *.dtsi files under arch/$(ARCH)/dts/. I think arch/$(ARCH)/dts dicretory is a better location to store both *.dts and *.dtsi files. For example, before this commit, board/xilinx/dts directory had both Microblaze dts (microblaze-generic.dts) and ARM dts (zynq-*.dts), which are totally unrelated. This commit moves *.dts to arch/$(ARCH)/dts/ directories, allowing us to describe nicely mutiple DTBs generation in the next commit. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19dts: re-write dts/Makefile more simply with KbuildMasahiro Yamada
Useful rules in scripts/Makefile.lib allows us to easily generate a device tree blob and wrap it in assembly code. We do not need to parse a linker script to get output format and arch. This commit deletes ./u-boot.dtb since it is a copy of dts/dt.dtb. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kernel-doc: update kernel-doc related files to Linux v3.13Masahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-02-19kernel-doc: move kernel-doc tools to scripts/Masahiro Yamada
tools/kernel-doc/docproc.c and tools/kernel-doc/kernel-doc are files imported from Linux Kernel. They originally resided under scripts/ directory in Linux Kernel. This commit moves them to the original location. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org>
2014-02-19kbuild: Do not generate .*.su files at the top directoryMasahiro Yamada
Without this workaround, you will see a lot of ".*.su" files at the top directory after building with a compiler which supports "-fstack-usage" option. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: use scripts/Makefile.cleanMasahiro Yamada
This commit refactors cleaning targets such as clean, clobber, mrpropper, distclean with scripts/Makefile.clean. By using scripts/Makefile.clean, we can recursively descend into subdirectories and delete generated files there. We do not need add a big list of generated files to the "clean" target. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: move include directives of board configuration filesMasahiro Yamada
This commit changes the location of include directives of board configuration files. The purpose of this change is: - Slim down $(TOPDIR)/config.mk - Prevent $(TOPDIR)/Makefile from including the same configuration file twice - Do not include include/config.mk multiple times because ARCH, CPU, BOARD, VENDOR, SOC are exported Before this commit: - include/autoconf.mk was included from $(TOPDIR)/Makefile and $(TOPDIR)/config.mk (This means $(TOPDIR)/Makefile included include/autoconf.mk twice) - include/{spl,tpl}-autoconf.mk was included from $(TOPDIR)/config.mk - include/config.mk was included from $(TOPDIR)/Makefile and $(TOPDIR)/config.mk (This means $(TOPDIR)/Makefile included include/config.mk twice) After this commit: - include/autoconf.mk is included from $(TOPDIR)/Makefile and $(TOPDIR)/scripts/Makefile.build - include/{spl,tpl}-autoconf.mk is included from $(TOPDIR)/spl/Makefile and $(TOPDIR)/scripts/Makefile.build - include/config.mk is included from $(TOPDIR)/config.mk and $(TOPDIR)/spl/Makefile Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: delete temporary build scriptsMasahiro Yamada
We had switched to Kbuild. We do not need old build scripts any more. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: use Linux Kernel build scriptsMasahiro Yamada
Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-19kbuild: import more build scripts from Linux v3.13 tagMasahiro Yamada
This commit imports build scripts from Linux Kernel v3.13 as they are. I know they include some trailing spaces but I am intentionally keeping them untouched. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19Makefile: rename scripts/Makefile.build to scripts/Makefile.build.tmpMasahiro Yamada
Some build scripts including scripts/Makefile.build will be imported from Linux Kernel in the next commit. We need to adjust them for U-Boot in the following commits. To make it easier for reviewers to track the modification, this commit renames scripts/Makefile.build to scripts/Makefile.build.tmp beforehand. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: change out-of-tree buildMasahiro Yamada
This commit changes the working directory where the build process occurs. Before this commit, build process occurred under the source tree for both in-tree and out-of-tree build. That's why we needed to add $(obj) prefix to all generated files in makefiles like follows: $(obj)u-boot.bin: $(obj)u-boot Here, $(obj) is empty for in-tree build, whereas it points to the output directory for out-of-tree build. And our old build system changes the current working directory with "make -C <sub-dir>" syntax when descending into the sub-directories. On the other hand, Kbuild uses a different idea to handle out-of-tree build and directory descending. The build process of Kbuild always occurs under the output tree. When "O=dir/to/store/output/files" is given, the build system changes the current working directory to that directory and restarts the make. Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>" syntax for descending into sub-directories. (We can write it like "make $(obj)=<sub-dir>" with a shorthand.) This means the current working directory is always the top of the output directory. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-19kbuild: Use Kbuild.includeMasahiro Yamada
This commit adjusts some files to use Kbuild.include. - Use cc-option defined in Kbuild.include (Delete cc-option in config.mk) - Use cc-version defined in (Delete cc-version in config.mk) - Move binutils-version and dtc-version to Kbuild.include by analogy to cc-version This commit also adds srctree (same as SRCTREE) to use Kbuild scripts. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19kbuild: import Kbuild.include from linux v3.13 tagMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19Makfile: move suffix rules to Makefile.buildMasahiro Yamada
This commit moves suffix rules from config.mk to scripts/Makefile.build, which will allow us to switch smoothly to real Kbuild. Note1: post/lib_powerpc/fpu/Makefile has its own rule to compile C sources. We need to tweak it to keep the same behavior. Note2: There are two file2 with the same name: arch/arm/lib/crt0.S and eamples/api/crt0.S. To keep the same build behavior, examples/api/Makefile also has to be treaked. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19examples: Use scripts/Makefile.buildMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2014-02-19Makefile.host.tmp: add a new script to refactor toolsMasahiro Yamada
This commit adds scripts/Makefile.host.tmp which will be used in the next commit to convert makefiles under tools/ directory to Kbuild style. Notice this script, scripts/Makefile.host.tmp is temporary. When switching over to real Kbuild, it will be replaced with scripts/Makefile.host of Linux Kernel. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-12-13Makefile: Move some scripts imported from LinuxMasahiro Yamada
We have some scripts imported from Linux Kernel: setlocalversion, checkstack.pl, checkpatch.pl, cleanpatch They are located under tools/ directory in U-Boot now. But they were originally located under scripts/ directory in Linux Kernel. This commit moves them to the original location. It is true that binutils-version.sh and dtc-version.sh do not originate in Linux Kernel, but they should be moved by analogy to gcc-version.sh. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-11-17Makefile: make directories by Makefile.buildMasahiro Yamada
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-11-17Makefile: abolish COBJS, SOBJS, etc.Masahiro Yamada
The support for COBJS, COBJS-y, SOBJS, SOBJS-y, GLCOBJS, GLSOBJS from scripts/Makefile.build. Going forward we need to use Kbuild style consistently. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
2013-10-31Makefile: support descending down to subdirectoriesMasahiro Yamada
This patch tweaks scripts/Makefile.build to allow the build system to descend into subdirectories like Kbuild. To use this feature, use "obj-y += foo/" syntax. Example: obj-$(CONFIG_FOO) += foo/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org>
2013-10-31Makefile: prepare for using Kbuild-style MakefileMasahiro Yamada
Every makefile in sub directories has common lines at the top and the bottom. This commit pushes the common parts into script/Makefile.build. Going forward sub-makefiles only need to describe this part: COBJS := ... COBJS += ... SOBJS := ... But using obj-y is preferable to prepare for switching to Kbuild. The conventional (non-Kbuild) Makefile style is still supported. This is achieved by greping the Makefile before entering into it. U-Boot conventional sub makefiles always include some other makefiles. So the build system searches a line beginning with "include" keyword in the makefile in order to distinguish which style it is. If the Makefile include a "include" line, we assume it is a conventional U-Boot style. Otherwise, it is treated as a Kbuild-style makefile. With this tweak, we can switch sub-makefiles from U-Boot style to Kbuild style little by little. obj-y := foo/ syntax (descending into the sub directory) is not supportd yet. It will be implemented in the upcomming commit. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@ti.com>