Based on the same Linux commit from Stephen Warren:
commit b40b25fff8205dd18124d8fc87b2c9c57f269b5f
Author: Stephen Warren <swarren@nvidia.com>
Date: Wed Mar 6 10:58:37 2013 -0700
kbuild: always run gcc -E on *.dts, remove cmd_dtc_cpp
Replace cmd_dtc with cmd_dtc_cpp, and delete the latter.
Previously, a special file extension (.dtsp) was required to trigger
the C pre-processor to run on device tree files. This was ugly. Now that
previous changes have enhanced cmd_dtc_cpp to collect dependency
information from both gcc -E and dtc, we can transparently run the pre-
processor on all device tree files, irrespective of whether they
use /include/ or #include syntax to include *.dtsi.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This brings us the following which we need for dtb file generation.
commit 2ab8a99661f4ce052bbad064237c441371df8751
Author: Stephen Warren <swarren@nvidia.com>
Date: Wed Mar 6 10:27:45 2013 -0700
kbuild: fixdep: support concatenated dep files
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The checkpatch.pl script is also used to validate user-space code in
the scripts/ directory, so it should allow printf() lines to be longer
than 80 columns.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The bootrom only reads an image if the correct checksum is present in the
header. The calculation is pretty simple:
sum over all words from 0x20 to 0x44
Two of this words are the image length. That is why the checksum can not be
calculated until barebox_image_size is known.
The easiest solution is a program that has to be run after make.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add rules to generate dtb files from dts/dtsi files,
optionally run the source files through the preprocessor.
Also add a rule to generate object files to include in
the barbox binary.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This syncs the localversion generation with the kernel.
At least one effect is that a barebox built from a tar archive no
longer marks itself as dirty. Also it moves some stuff from a scary
Makefile to a not-so-scary shell script.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
In case environment loading/saving failed, the calling program
should be informed about that by returning a non zero exit code.
Signed-off-by: Christian Kapeller <christian.kapeller@cmotion.eu>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
From previous patch that replaced printf with puts:
puts adds it's own line ending, so do not append it manually
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The lowlevel code is expected to be present only ONCE
in PBL is enabled otherwise in barebox
This fix the module support with PBL and allow to reduce the size of barebox
by drop the lowlevell init in barebox as the compiler does not discard it
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Use puts() because printf() isn't necessary,
to fix the following compiler warnings:
/barebox/common/menu.c: In function ‘menu_show’:
/barebox/common/menu.c:277:4: warning: format not a string literal and no format arguments [-Wformat-security]
/barebox/scripts/omap4_usbboot.c: In function ‘read_asic_id’:
/barebox/scripts/omap4_usbboot.c:101:3: warning: format not a string literal and no format arguments [-Wformat-security]
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Vicente <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
include/environment.h is no longer necessary to build scripts/bareboxenv,
so remove its inclusion.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
so we can use to check pbl
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
When obj-y has foo/bar.o, kbuild can't generate
foo/bar.o according foo/bar.c. Fix this
this patch based on linux kernel
commit 521cb40b0c44418a4fd36dc633f575813d59a43d
Signed-off-by: 张忠山 <zzs213@126.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This implements two new options for the loadenv command:
-s: removes (scrubs) old directory contents to be able to
create a fresh environment from for example /dev/defaultenv
-n: no overwrite. Do not overwrite existing files. This allows
to keep parts of the old environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Since the utility outputs the image on stdout we have to print the
error messages to stderr in order to see them.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The omap spi utility requires the image size to be a multiple of four
bytes. This seems unnecessary, we can just pad with a few bytes to
get the required alignment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Booting from SPI on an AM35xx (and possibly other TI SOCs) requires
a special format:
- 32 bit image size in big-endian
- 32 bit load address in big-endian
- binary image converted from little- to big-endian
The mk-am35xx-spi-image tool converts barebox.bin to
this format.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The dependencies for generating the environment do not work properly:
- If files are removed from the defaultenv, a subsequent make will not
update the default environment.
- If CONFIG_DEFAULT_ENVIRONMENT_PATH changes, the default environment
also will not be regenerated.
This patch fixes this by introducing a cmd_env which has the content of
$(ENV_FILES) in the command so that the if_changed mechanism recognizes
a change when $(ENV_FILE) changes. This also results in a nice " ENV "
string in the build process.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
The call if_changed mechanism does not work when the command
contains backslashes. This basically is an issue with lzo
and bzip2 compressed kernels. The compressed binaries do not
contain the uncompressed image size, so these use size_append
to append the size. This results in backslashes in the executed
command. With this if_changed always detects a change in the
command and rebuilds the compressed image even if nothing
has changed.
Fix this by escaping backslashes in make-cmd
This was worked out together with Jan Lübbe. The same patch
has recently been accepted to the kernel.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
we may specify file in the defconfig
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
disasm: For generating an disasssembly of an ELF file
ln: For creating a softlink
Use the disasm command for generating barebox.S
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This will allow to link compiled object to the built-in-pbl.o across the source
tree that will be finally link to the pbl.
Now we compile the source %.c in pbl-%.o and provide -D__PBL__
so we can known in the source when it's compile for barebox or the pbl.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This makes it possible to add architecure specific clean
targets again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>