Commit Graph

46922 Commits

Author SHA1 Message Date
Simon Glass
934cdcfb1b binman: Add tests for importlib availability
Add a test that the 'entry' module works with or without importlib.
The tests are numbered so that they are executed in the correct order.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
4d5994f91c binman: Set up 'entry' to permit full test coverage
There is a little check at the top of entry.py which decides if importlib
is available. At present this has no test coverage. To add this we will
need to import the module twice, once with importlib and once without.
In preparation for allowing a test to control the importing of this
module, remove all global imports of the 'entry' module.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
5a3f222604 binman: Append to PYTHONPATH when running test coverage
Rather that overwrite this, append to it, in case the caller has already
set up the path correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
aab660fe18 dtoc: Fix up tests
The tool has changed slightly since it was originally written. Update the
tests to suit.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
251f5867c9 buildman: Fix up tests
The tests were broken by two separate commits which adjusted the output
when boards are listed. Fix this by adding back a PowerPC board and
putting the name of each board in the test.

Fixes: b9f7d881 (powerpc, 5xx: remove some "5xx" remains)
Fixes: 8d7523c5 (buildman: Allow showing the list of boards with -n)

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
cb39a10979 buildman: Allow skipping of tests which use the network
Accessing the network slows down the test and limits the environment in
which it can be run. Add an option to disable network tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
6c328f2975 patman: Fix up tests to pass with newest checkpatch
The checkpatch tool was updated but the patman tests were not. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
2f52018c3c test/run: Report and return failure
This script runs the tests but does not report failure. Also it always
returns an exit code of 0 even on failure.

Fix these problems by checking the result of each test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
d09682ef8c binman: Disable the no-unit_address_vs_reg warnings
These warnings are not useful for binman tests. Disable them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
680e3312c2 binman: Rename tests to ftest
At present these tests use the same filename as patman. This adds
confusion when running all tests, since error messages look very similar.
In fact binman tries to run the wrong tests at present.

Rename the tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
00ebd1f74d binman: Add a Makefile for test-program compilation
These test programs are includedd as binary files in U-Boot to avoid
having to build them (and associated toolchain differences). Instructions
on building are in the files themselves, but it seems better to provide
a Makefile which can be manually run when desired.

Add a Makefile, separate from the normal build system, to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
9c0a8b1f44 binman: Add docs explaining how to enable binman for a board
The process is not obvious. Add a little section to explain how to move a
board to use binman.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Simon Glass
511fd0b2bb binman: Add better Makefile debugging
There is a debugging option in the Makefile to allow people to figure out
which u-boot.dtsi files are used in the build. But is it not easy to use
since it only shows files it finds, not those it is looking for. Update it
and update the mention of it to the docs.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00
Faiz Abbas
16fa2eb951 ARM: dra7: Kconfig: Add thermal configs for dra7xx and am57xx
Configure thermal configs to remain set by default for dra7xx and am57xx
devices.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-21 08:03:39 -05:00
Faiz Abbas
12dd1e5c6a ARM: dts: OMAP5+: Add support for bandgap sensor in SPL
Mark bandgap node as uboot,dm-spl so that it can be accessed in spl

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2017-11-21 08:03:38 -05:00
Faiz Abbas
8502f9f6d7 thermal: ti-bandgap: Add support for temperature sensor
The dra7xx series of SOCs contain a temperature sensor and an
associated analog-to-digital converter (ADC) which produces
an output which is proportional to the SOC temperature.
Add support for this temperature sensor.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-21 08:03:38 -05:00
Tom Rini
5ad1fec6ed TI: am57xx; Remove am57xx_evm_nodt_defconfig
We don't want this build anymore.

Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2017-11-21 08:03:32 -05:00
S. Lockwood-Childs
1dade18e40 README: update mailing list url
Old url currently returns 403; modify to url that actually works
with current state of the list server

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
2017-11-21 07:43:32 -05:00
Stefan Agner
ded84f90a1 envtools: make sure version/timestamp header file are available
With commit 84d46e7e89 ("tools: env: allow to print U-Boot version")
the fw_env utilities need the version.h header file. Building only
the envtools in a pristine build directory will fail due to missing
header files.

Make sure the header files are a dependency of the envtools target.

Fixes: 84d46e7e89 ("tools: env: allow to print U-Boot version")
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-21 07:43:32 -05:00
Tom Rini
c6831c74a9 env: Remove CONFIG_ENV_AES support
This support has been deprecated since v2017.09 due to security issues.
We now remove this support.

Signed-off-by: Tom Rini <trini@konsulko.com>
2017-11-21 07:43:31 -05:00
Heinrich Schuchardt
042de609ed omap3: spi: the symbol for Hertz is Hz
fix typo

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 20:18:40 -05:00
M. Vefa Bicakci
dd2081a8e4 Makefile: Correct SPL/TPL/DTB build race condition
When building on a multi-core machine for an SPL-enabled board that
also uses CONFIG_OF_EMBED, the following error can be encountered
due to a race condition:

  make[3]: *** No rule to make target 'spl/dts/dt.dtb.o', needed by
    'spl/dts/built-in.o'.  Stop.
  ../scripts/Makefile.spl:364: recipe for target 'spl/dts' failed
  make[2]: *** [spl/dts] Error 2
  make[2]: *** Waiting for unfinished jobs....

A reliable way to trigger this race condition is to add "sleep 60" to
the end of the "arch-dtbs" rule's recipe in "dts/Makefile" and to build
U-Boot against a board which uses the CONFIG_OF_EMBED and CONFIG_SPL
options using "make -j8" or a similar command.

This commit corrects this race condition via the use of CONFIG_OF_EMBED
in the same way that commit 3c00a2c8b5 ("Makefile: Correct dependency
race condition with TPL") and commit 054b3a1e80 ("dm: Makefile: Build
of-platdata before SPL") use CONFIG_OF_SEPARATE.

Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-20 20:18:39 -05:00
Heinrich Schuchardt
a874cac3b4 malloc: don't compare pointers to 0
0 is not a pointer. So do not compare pointers to 0.

Do not return 0 from functions with a pointer return
type.

Problem identified with Coccinelle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-11-20 20:18:39 -05:00
Heinrich Schuchardt
06feb5d0bf scripts/coccinelle: add some more coccinelle tests
Add some useful static code analysis scripts for coccinelle
copied from the Linux kernel v4.14-rc8:

Warn on check against NULL before calling free.
scripts/coccinelle/free/ifnullfree.cocci

Detect superfluous NULL check for list iterator.
scripts/coccinelle/iterators/itnull.cocci

Check if list iterator is reassigned.
scripts/coccinelle/iterators/list_entry_update.cocci

Check if list iterator is used after loop.
scripts/coccinelle/iterators/use_after_iter.cocci

Find wrong argument of sizeof in allocation function:
scripts/coccinelle/misc/badty.cocci

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 20:18:39 -05:00
Heinrich Schuchardt
8a28caf02b Makefile: add coccicheck target
Coccinelle is a program for static code analysis.
For details on Coccinelle see

	http://coccinelle.lip6.fr/

Add scripts/coccicheck copied from Linux kernel v4.14.

The coccicheck script executes the tests *.cocci in
directory scripts/coccinelle by calling spatch.

In Makefile add a coccicheck target. You can use it with

	make coccicheck MODE=<mode>

	where mode in patch, report, context, org.

Add a copy of Linux v4.14 file Documentation/dev-tools/coccinelle.rst
as doc/README.coccinelle.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 20:18:38 -05:00
Heinrich Schuchardt
76df275ce5 yaffs2: rework yaffs_new_obj_id
The iterator variable of list_for_each is never NULL.
if (1 || A) is always true.
Use break if entry found.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 20:18:38 -05:00
Praneeth Bajjuri
65d87d6cfc dra7x: fastboot: Increase recovery partition size
As per current android recommendation
https://source.android.com/devices/architecture/kernel/modular-kernels

1. Android recovery mode should contain both SOC and ODM
kernel modules in the recovery partition.

2. If a kernel module is required both in recovery and normal boot
mode,  the module has to be located in recovery and vendor
partition seperately.

3. Kernel modules used in recovery mode should be independent
of vendor and odm partition

4. Recovery image should contain atleast
storage, display, keypad, battery and pmic modules.

Due to these requirements, recovery image size has increased
to >10MB.

This patch is to increase recovery partition size for TI devices
so that we dont see such flashing error

log:
sending 'recovery' (12560 KB)...
OKAY [  0.436s]
writing 'recovery'...
FAILED (remote: too large for partition)
finished. total time: 0.458s

Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2017-11-20 20:18:37 -05:00
Heinrich Schuchardt
b5142f280a scripts/ld-version.sh: regular expression compile fails
ld --version | scripts/ld-version.sh
fails with
awk: scripts/ld-version.sh:
line 4: regular expression compile failed (missing '(')
.*)

So let's refresh the script from Linux kernel v4.14-rc8.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 20:18:37 -05:00
Heinrich Schuchardt
0931ed3c0d kconfig/symbol.c: use correct pointer type argument for sizeof
sym_arr is of type struct symbol **.
So in malloc we need sizeof(struct symbol *).

The problem was indicated by coccinelle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 20:18:36 -05:00
Tom Rini
69d3226530 Merge git://git.denx.de/u-boot-ubi 2017-11-20 11:46:08 -05:00
Tom Rini
56d5a10f3a Merge git://git.denx.de/u-boot-i2c 2017-11-20 10:51:11 -05:00
Heinrich Schuchardt
cd5f33e5fc ubi: no NULL check needed before kmem_cache_destroy
kmem_cache_destroy calls free which checks for NULL.

Problem was indicated by coccinelle.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 10:13:42 +01:00
Heinrich Schuchardt
4b29975fd0 ubifs: no NULL check needed before free
kfree() calls free.
free() checks if the parameter is NULL.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2017-11-20 10:13:33 +01:00
Beniamino Galvani
456efb5127 odroid-c2: enable I2C
Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
2017-11-20 10:11:44 +01:00
Beniamino Galvani
f8d9ca1833 i2c: add Amlogic Meson driver
Add a driver for the I2C controller available on Amlogic Meson SoCs.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
2017-11-20 10:11:34 +01:00
Tom Rini
29c4992256 Merge git://git.denx.de/u-boot-dm 2017-11-19 20:35:45 -05:00
Tom Rini
b6251db8c3 Kconfig: Introduce USE_BOOTCOMMAND and migrate BOOTCOMMAND
We first introduce CONFIG_USE_BOOTCOMMAND, similar to
CONFIG_USE_BOOTARGS.  We then migrate CONFIG_BOOTCOMMAND for most
CONFIG_DISTRO_DEFAULT users.  In some cases platforms have a complex
scheme around this usage, and these have been defered for the moment so
that platform maintainers can work on a migration plan.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
2017-11-17 16:37:26 -05:00
Dongjin Kim
232ed3ca53 arm: config: fix default console only to specify the device
Since CONFIG_DEFAULT_CONSOLE is already started with "console=",
the console argument in CONFIG_EXTRA_ENV_SETTINGS is expanded to
"console=console=ttySAC1,115200n8" and this causes the wrong
console device.

  #define CONFIG_DEFAULT_CONSOLE         "console=ttySAC1,115200n8\0"
  ...
  #define CONFIG_EXTRA_ENV_SETTINGS \
		"console=" CONFIG_DEFAULT_CONSOLE

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-17 10:54:32 -05:00
Landheer-Cieslak, Ronald
48c7f77128 Add UART base addresses for additional UARTs
UARTs 1 through 5 were missing in the code - added.
Also pick the default according to the configuration setting for the
console index.

Signed-off-by: Ronald Landheer-Cieslak <ronaldlandheercieslak@eaton.com>
2017-11-17 10:53:45 -05:00
Minghuan Lian
3977dcd559 dm: pci: change bus number register setting compliant with Linux
This patch is to change U-Boot PCI bus assignement compliant with Linux.
It means each PCIe controller's bus number is 0, not the current maximum
PCI bus number, when start to scan this controller.

Signed-off-by: Minghuan Lian <Minghuan.Lian@nxp.com>
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2017-11-17 10:53:45 -05:00
Gan, Yau Wai
9587dee937 nios2: 10m50: Add CPU pre-relocation in device tree
Tag CPU with dm-pre-reloc to enable driver before
relocation.

Signed-off-by: Gan, Yau Wai <yau.wai.gan@intel.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Reviewed-by: Marek Vasut <marex@denx.de>
2017-11-17 10:51:24 -05:00
Baruch Siach
afc1a78a0b dm: core: fix member name in ofnode_union documentation
Fixes: 4984de2baa ("dm: core: Add ofnode to represent device tree nodes")
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
2017-11-17 07:15:52 -07:00
André Draszik
9d0c5fee29 tpm: add more missing va_end()
While commit 36d35345b1 ("tpm: add missing va_end") added
some missing calls to va_end(), it missed a few places.

Signed-off-by: André Draszik <adraszik@tycoint.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-11-17 07:15:52 -07:00
André Draszik
1259f778c9 tpm: add more useful NV storage permission flags
TPM_NV_PER_PPREAD: physical presence needed for reading
TPM_NV_PER_WRITEDEFINE: persistent write lock by writing size 0
TPM_NV_PER_WRITEALL: write in one go

Signed-off-by: André Draszik <adraszik@tycoint.com>
Acked-by: Simon Glass <sjg@chromium.org>
2017-11-17 07:15:52 -07:00
André Draszik
3c6050277b tpm: add tpm_get_random()
Add a function to obtain random data from the TPM.

Signed-off-by: André Draszik <adraszik@tycoint.com>
Added commit message, add cast to min()
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
2017-11-17 07:15:40 -07:00
Adam Ford
470dd6cc22 omap3: omap3_logic: Move pinmuxing to header file
To keep the board file smaller and clean, let's move the pinmux to the header file.

Signed-off-by: Adam Ford <aford173@gmail.com>
2017-11-17 07:44:13 -05:00
Jorge Ramirez-Ortiz
9a16153834 configs: dragonboard410c: Save environment data on eMMC
Save the environment data at the end of the boot partition on emmc

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-11-17 07:44:13 -05:00
Jorge Ramirez-Ortiz
c9e87ba665 env: Save environment at the end of an MMC partition
Allow the platform to define a partition by name at the end of which
the environment data will be located.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-11-17 07:44:13 -05:00
Wilson Lee
b12907f279 serial: nulldev: Implement "pending" function to fix tstc return "true"
In U-boot, serial_tstc was use to determine is there have a character in
serial console that pending for read. If there is no "pending" function
implemented in serial driver, the serial-uclass will return "true(1)"
to indicate there have a character pending to read.

Thus, read a character from nulldev serial will result in continuous
getting -EAGAIN return which might lead system to hang.

This commit is to fix a bug in nulldev serial which implement "pending"
function in nulldev serial to always indicate there is no character in
console that pending for read.

Signed-off-by: Wilson Lee <wilson.lee@ni.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Keng Soon Cheah <keng.soon.cheah@ni.com>
Cc: Chen Yee Chew <chen.yee.chew@ni.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
2017-11-17 07:44:13 -05:00
Kever Yang
21f4486faa armv8: update gd after relocate
We need to update gd in assamble code after relocate,
this is a fix to:
adc421e arm: move gd handling outside of C code

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-11-17 07:44:13 -05:00