U-Boot has compelled all boards to have
board/${BOARD}/ or board/${VENDOR}/${BOARD}/ directory.
Sometimes it does not seem suitable for some boards,
for example Sandbox. (Is it a board?)
And arcangel4 board has nothing to compile
under the board directory.
This commit makes the build system more flexible:
If '<none>' is given to the 6th column (=Board name) of boards.cfg,
Kbuild will not descend into the board directory.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Programs in tools/ directory are usually built for the host.
But some of them (mkimage, dumpimge, gen_eth_addr, etc.) are
useful on the target OS too.
Actually, prior to Kbuild, U-Boot could build tools for
the target like follows:
$ make <target_board>_config
$ export CROSS_COMPILE=<cross_gcc_prefix>
$ make HOSTCC=${CROSS_COMPILE}gcc HOSTSTRIP=${CROSS_COMPILE}strip tools
In Kbuild, we can no longer replace HOSTCC at the command line.
In order to get back that feature, this commit adds "cross-tools" target.
Usage:
Build tools for the host
$ make CROSS_COMPILE=<cross_gcc_prefix> tools
Build tools for the target
$ make CROSS_COMPILE=<cross_gcc_prefix> cross_tools
Besides, "make cross_tools" strip tools programs because we
generally expect smaller storages on embedded systems.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Heiko Schocher <hs@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
The top Makefile must export HOST_TOOLS_ALL to use it
in tools/Makefile.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
We had switched to Kbuild so now we can specify
PLATFORM_LIBS/PLATFORM_LIBGCC with relative path.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Tom Rini <trini@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
As an example of how to write a uclass and a driver, provide a demo version
of each, accessible through the 'demo' command.
To use these with driver model, define CONFIG_CMD_DEMO and CONFIG_DM_DEMO.
The two demo drivers are enabled with CONFIG_DM_DEMO_SIMPLE and
CONFIG_DM_DEMO_SHAPE.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
Add some tests of driver model functionality. Coverage includes:
- basic init
- binding of drivers to devices using platform_data
- automatic probing of devices when referenced
- availability of platform data to devices
- lifecycle from bind to probe to remove to unbind
- renumbering within a uclass when devices are probed/removed
- calling driver-defined operations
- deactivation of drivers when removed
- memory leak across creation and destruction of drivers/uclasses
- uclass init/destroy methods
- automatic probe/remove of children/parents when needed
This function is enabled for sandbox, using CONFIG_DM_TEST.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add driver model functionality for generic board.
This includes data structures and base code for registering devices and
uclasses (groups of devices with the same purpose, e.g. all I2C ports will
be in the same uclass).
The feature is enabled with CONFIG_DM.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com>
Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com>
Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
Add support for building a device tree for sandbox's CONFIG_OF_HOSTFILE
option to make it easier to use device tree with sandbox.
This adjusts the Makefile to build a u-boot.dtb file which can be passed
to sandbox U-Boot with:
./u-boot -d u-boot.dtb
Signed-off-by: Simon Glass <sjg@chromium.org>
Now we have two different frameworks for doing the same thing.
I'd like to propose to drop nand_spl framework.
How about deleting it before v2014.07 release?
In the interim, this commit will display a warning message
when compiling nand_spl board.
Now we have 19 nand_spl boards:
MPC8315ERDB_NAND
SIMPC8313_LP
SIMPC8313_SP
MPC8536DS_NAND
MPC8569MDS_NAND
MPC8572DS_NAND
P1023RDS_NAND
P1011RDB_NAND
P1020RDB_NAND
P2010RDB_NAND
P2020RDB_NAND
acadia_nand
bamboo_nand
canyonlands_nand
glacier_nand
haleakala_nand
kilauea_nand
rainier_nand
sequoia_nand
They must be ported to SPL before the deadline,
otherwise they will be removed.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Dave Liu <daveliu@freescale.com>
Cc: Ron Madrid <info@sheldoninst.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
Same as the previous commit.
Move sanity check to prepare1 target to avoid nasty troubles.
Before this commit, LDSCRIPT existence was not checked
when it was specified by CONFIG_SYS_LDSCRIPT.
Now LDSCRIPT existence is checked for all boards.
$(wildcard $(LDSCRIPT)) must point to the linker scripts
with absolute path.
Otherwise, make will terminate with a false error
on out-of-tree build.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Before this commit, make terminated with an error
where is shouldn't under some condition.
This bug happened when we built a board unsupporting
generic board right after building with generic board.
For example, the following sequence failed.
(harmony uses generic board but microblaze-generic does not
support it)
$ make harmony_config
Configuring for harmony board...
$ make CROSS_COMPILE=arm-linux-gnueabi-
[ Build succeed ]
$ make microblaze-generic_config
Configuring for microblaze-generic board...
$ make CROSS_COMPILE=microblaze-linux-
Makefile:488: *** Your architecture does not support generic board.
Please undefined CONFIG_SYS_GENERIC_BOARD in your board config file. Stop.
We had to do "make clean" before building the microblaze board.
This commit fixes this unconvenience.
Move generic board sanity check to "prepare1" target,
which is run after generation of include/autoconf.mk.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Commit 6ab6b2af deleted ./u-boot.dtb because it was a copy
of dts/dt.dtb.
But Simon suggested to keep u-boot.dtb at the top directory
because it is a build output.
After discussions, we agreed on revival of ./u-boot.dtb.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@ti.com>
Acked-by: Simon Glass <sjg@chromium.org>
"help" target has been copied from Linux 3.13 and adjusted
for U-Boot.
Unlike Linux, cleaning is done on 4 levels:
clean, clobber, mrproper, distclean.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit avoids generating ./SPL twice.
- Fist time descending to spl/
- Second time as a prerequisite of u-boot-with-spl.imx,
u-boot-with-nand-spl.imx.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Rename OBJCFLAGS to OBJCOPYFLAGS beforehand to use
"cmd_objcopy" in scripts/Makefile.lib in an upcoming commit.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Generate include/generated/generic-asm-offsets.h and
include/generated/asm-offsets.h in ./Kbuild.
This commit also changes the include guard.
Before this commit, __ASM_OFFSETS_H__ was used for both of them.
So we could not include generic-asm-offsets.h and asm-offsets.h
at the same time.
This commit renames the include guard of the former to
__GENERIC_ASM_OFFSETS_H__.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit moves include/generated/{generic-asm-offsets.h, asm-offsets.h}
from "depend" targets to "prepare" targets and deletes "depend" targets.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
- 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>
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>
Conflicts:
Makefile
drivers/net/npe/Makefile
These two conflicts arise from commit 0b2d3f20
("ARM: NET: Remove the IXP NPE ethernet driver") and are
resolved by deleting the drivers/net/npe/Makefile file
and removing the CONFIG_IXP4XX_NPE line from Makefile.
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>
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>
For out-of-tree build
- Check if the source tree is clean
- Create a Makefile in the output directory
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit fixes two problems:
[1] We could not do board configuration and "make all"
in one command line.
For example, the following did not work as we expect:
$ make sandbox_config all
Configuring for sandbox board...
make: Nothing to be done for `all'.
[2] mixed-target build did not work with -j option
For example, the following did not work:
$ make -j8 sandbox_config u-boot
Makefile:481: *** "System not configured - see README". Stop.
make: *** [u-boot] Error 2
make: *** Waiting for unfinished jobs....
Configuring for sandbox board...
Going forward, we can do
$ make -j8 sandbox_config all
This is the same as
$ make sandbox_config
$ make -j8
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
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>
$(MTD_VERSION) is used in tools/env/Makefile
If you specify a variable at a command line like:
$ make MTD_VERSION=old env
or specify it thru an envrionment variable like:
$ export MTD_VERSION=old
$ make env
it is inherited to the sub-make too.
We do not need to pass it from the top Makefile explicitely.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit refactors rules of directory descending
and defines u-boot-dirs and u-boot-all-dirs.
(We will need u-boot-all-dirs when using
scripts/Makefile.clean)
Additionally, rename LIBS-y to libs-y.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit changes the top Makefile to handle various targets
nicely.
Make targets are divided into four categories:
- mixed-targets
We can call a configuration target and build targets
at one command line like follows:
$ make <board_name>_config u-boot
They are handled one by one.
- config targets
<board_name>_config
- no-dot-config-targets
Targets we can run without board configuration such as
clean, mrproper, distclean, TAGS, %docs, etc.
- build targets
The other target which need board configuration.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Before this commit, "make tidy" did
"make clean" + delete "*.depend*" files.
But, we do not have "*.depend*" files any more,
which means "make tidy" is the same as "make clean".
This commit removes the redandant target "tidy".
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Before this commit, {spl,tpl}-autoconf.mk was always generated
at the top Makefile even if SPL(TPL) build was not selected.
This commit moves the build rule of {spl,tpl}-autoconf.mk
from the top Makefile to spl/Makefile.
It prevents unnecessary {spl,tpl}-autoconf.mk from being
generated.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
We can get Kbuild-ish log style like this:
GEN include/autoconf.mk
GEN include/autoconf.mk.dep
We do not need XECHO any more.
And also change checkstack target like Linux Kernel.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
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>
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>