oweals/u-boot.git
5 years agoMerge tag 'dm-pull-15jan19' of git://git.denx.de/u-boot-dm
Tom Rini [Wed, 16 Jan 2019 03:05:34 +0000 (22:05 -0500)]
Merge tag 'dm-pull-15jan19' of git://git.denx.de/u-boot-dm

Fix recent changes to serial API for driver model
Buildman clang support and a few fixes
Small fixes to 'dm tree' and regmap test
Improve sandbox build compatibility
A few other minor fixes

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-i2c
Tom Rini [Wed, 16 Jan 2019 03:05:28 +0000 (22:05 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-i2c

5 years agoMerge git://git.denx.de/u-boot-riscv
Tom Rini [Wed, 16 Jan 2019 03:05:05 +0000 (22:05 -0500)]
Merge git://git.denx.de/u-boot-riscv

1. Improve cache implementation.
2. Fix and improve standalone applications

5 years agoMerge branch '2019-01-14-master-imports'
Tom Rini [Wed, 16 Jan 2019 01:33:07 +0000 (20:33 -0500)]
Merge branch '2019-01-14-master-imports'

- MediaTek improvements (eth support)
- DM conversion for HI6220
- ISEE, Toby Churchill, other platform updates
- Various format code printf fixes
- Build race fixes
- Command repeat functionality enhanced, command autocomplete support
  enhanced.

5 years agocommon: command: Add support for $ auto-completion
Boris Brezillon [Wed, 5 Dec 2018 08:26:50 +0000 (09:26 +0100)]
common: command: Add support for $ auto-completion

Add the dollar_complete() function to auto-complete arguments starting
with a '$' and use it in the cmd_auto_complete() path such that all
args starting with a $ can be auto-completed based on the available env
vars.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
[trini: Fix some linking problems]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agomisc: fs_loader: Switching private data allocation to DM auto allocation
Tien Fong Chee [Mon, 10 Dec 2018 13:29:44 +0000 (21:29 +0800)]
misc: fs_loader: Switching private data allocation to DM auto allocation

Switching private data manual allocation to driver model auto allocation
so users no longer need to deallocate themself because this would be
deallocated by driver model when the device is no longer required.

Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agocmd: adc: Use the sub-command infrastructure
Boris Brezillon [Mon, 3 Dec 2018 21:54:23 +0000 (22:54 +0100)]
cmd: adc: Use the sub-command infrastructure

And you get sub-command auto-completion for free.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agocmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands
Boris Brezillon [Mon, 3 Dec 2018 21:54:22 +0000 (22:54 +0100)]
cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands

It's way simpler this way, and we also gain auto-completion support for
free (MTD name auto-completion has been added with mtd_name_complete())

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agocommand: commands: Add macros to declare commands with subcmds
Boris Brezillon [Mon, 3 Dec 2018 21:54:21 +0000 (22:54 +0100)]
command: commands: Add macros to declare commands with subcmds

Most cmd/xxx.c source files expose several commands through a single
entry point. Some of them are doing the sub-command parsing manually in
their do_<cmd>() function, others are declaring a table of sub-commands
and then use find_cmd_tbl() to delegate the request to the sub command
handler.

In either case, the amount of code to do that is not negligible and
repetitive, not to mention that almost no commands are implementing
the auto-completion hook, which means most u-boot commands lack
auto-completion.

Provide several macros to easily define commands exposing sub-commands.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agocommon: command: Rework the 'cmd is repeatable' logic
Boris Brezillon [Mon, 3 Dec 2018 21:54:20 +0000 (22:54 +0100)]
common: command: Rework the 'cmd is repeatable' logic

The repeatable property is currently attached to the main command and
sub-commands have no way to change the repeatable value (the
->repeatable field in sub-command entries is ignored).

Replace the ->repeatable field by an extended ->cmd() hook (called
->cmd_rep()) which takes a new int pointer to store the repeatable cap
of the command being executed.

With this trick, we can let sub-commands decide whether they are
repeatable or not.

We also patch mmc and dtimg who are testing the ->repeatable field
directly (they now use cmd_is_repeatable() instead), and fix the help
entry manually since it doesn't use the U_BOOT_CMD() macro.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agocommon: command: Expose a generic helper to auto-complete sub commands
Boris Brezillon [Mon, 3 Dec 2018 21:54:19 +0000 (22:54 +0100)]
common: command: Expose a generic helper to auto-complete sub commands

Some commands have a table of sub-commands. With minor adjustments,
complete_cmdv() is able to provide auto-completion for sub-commands
(it's just about passing the table of commands instead of taking the
global one).
We rename this function into complete_subcmd() and implement
complete_cmdv() as a wrapper around complete_subcmdv().

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agocommon: command: Fix command auto-completion
Boris Brezillon [Mon, 3 Dec 2018 21:54:18 +0000 (22:54 +0100)]
common: command: Fix command auto-completion

When auto-completing command arguments, the last argument is not
necessarily the one we need to auto-complete. When the last character is
a space, a tab or '\0' what we want instead is list all possible values,
or if there's only one possible value, place this value on the command
line instead of trying to suffix the last valid argument with missing
chars.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoblk: Increase cache element size
Marek Vasut [Wed, 8 Aug 2018 11:20:29 +0000 (13:20 +0200)]
blk: Increase cache element size

Cache up to 4 kiB entries. 4 kiB is the default block size on ext4, yet
the underlying block layer devices usually report support for 512B . In
most cases, the 512B support is emulated (ie. SD cards, SSDs, USB sticks
etc.) and the real block size of those devices is much bigger.

To avoid performance degradation with such devices and FS setup, bump
the maximum cache entry size to 4 kiB.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoMakefile: run CONFIG_BOARD_SIZE_LIMIT against .img
Simon Goldschmidt [Fri, 11 Jan 2019 19:56:02 +0000 (20:56 +0100)]
Makefile: run CONFIG_BOARD_SIZE_LIMIT against .img

With the current Makefile, CONFIG_BOARD_SIZE_LIMIT is used to check
the U-Boot binary without devicetree only. This produces wrong results
when OF_SEPARATE is used.

To fix this, run the CONFIG_BOARD_SIZE_LIMIT check on all .img binaries
as well.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agokbuild: add .SECONDARY special target to scripts/Kbuild.include
Masahiro Yamada [Fri, 11 Jan 2019 10:42:27 +0000 (19:42 +0900)]
kbuild: add .SECONDARY special target to scripts/Kbuild.include

Based on the following Linux commits:

 - 54a702f70589 ("kbuild: mark $(targets) as .SECONDARY and remove
   .PRECIOUS markers")

 - 8e9b61b293d9 ("kbuild: move .SECONDARY special target to
   Kbuild.include")

GNU Make automatically deletes intermediate files that are updated
in a chain of pattern rules.

Example 1) %.dtb.o <- %.dtb.S <- %.dtb <- %.dts
Example 2) %.o <- %.c <- %.c_shipped

A couple of makefiles mark such targets as .PRECIOUS to prevent Make
from deleting them, but the correct way is to use .SECONDARY.

  .SECONDARY
    Prerequisites of this special target are treated as intermediate
    files but are never automatically deleted.

  .PRECIOUS
    When make is interrupted during execution, it may delete the target
    file it is updating if the file was modified since make started.
    If you mark the file as precious, make will never delete the file
    if interrupted.

Both can avoid deletion of intermediate files, but the difference is
the behavior when Make is interrupted; .SECONDARY deletes the target,
but .PRECIOUS does not.

The use of .PRECIOUS is relatively rare since we do not want to keep
partially constructed (possibly corrupted) targets.

.SECONDARY with no prerequisites causes all targets to be treated as
secondary. This agrees the policy of Kbuild.

scripts/Kbuild.include seems a suitable place to add it because it is
included from almost all sub-makes.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
5 years agokbuild: add .DELETE_ON_ERROR special target
Masahiro Yamada [Fri, 11 Jan 2019 10:42:26 +0000 (19:42 +0900)]
kbuild: add .DELETE_ON_ERROR special target

Linux commit 9c2af1c7377a8a6ef86e5cabf80978f3dbbb25c0

If Make gets a fatal signal while a shell is executing, it may delete
the target file that the recipe was supposed to update.  This is needed
to make sure that it is remade from scratch when Make is next run; if
Make is interrupted after the recipe has begun to write the target file,
it results in an incomplete file whose time stamp is newer than that
of the prerequisites files.  Make automatically deletes the incomplete
file on interrupt unless the target is marked .PRECIOUS.

The situation is just the same as when the shell fails for some reasons.
Usually when a recipe line fails, if it has changed the target file at
all, the file is corrupted, or at least it is not completely updated.
Yet the file’s time stamp says that it is now up to date, so the next
time Make runs, it will not try to update that file.

However, Make does not cater to delete the incomplete target file in
this case.  We need to add .DELETE_ON_ERROR somewhere in the Makefile
to request it.

scripts/Kbuild.include seems a suitable place to add it because it is
included from almost all sub-makes.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
5 years agocommon: Kconfig: miscellaneous spelling fixes
Chris Packham [Fri, 11 Jan 2019 02:30:50 +0000 (15:30 +1300)]
common: Kconfig: miscellaneous spelling fixes

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agokbuild: fix parallel build race caused by u-boot.cfg regeneration
Masahiro Yamada [Thu, 10 Jan 2019 14:11:39 +0000 (23:11 +0900)]
kbuild: fix parallel build race caused by u-boot.cfg regeneration

Multiple people have reported intermittent build failure in parallel
building.

Kever Yang reported this issue some time ago [1], but I could not
get enough clue at that time.

This time, Richard Purdie provided a full build log [2], which was
very helpful for me to root-cause it.

The cause of the problem is commit 0d982c585330 ("Makefile: add
dependencies to regenerate u-boot.cfg when lost").

That commit added the 'cfg' as the prerequisite of the 'all' target,
so the parallel build tries to run it simultaneously, then regenerates
a symlink while building objects.

When u-boot.cfg is accidentally lost, let's rebuild it before
descending into any subdirectories.

Also, what is annoying is u-boot.cfg is currently regenerated every
time since it depends on FORCE. We can get rid of all the prerequisites
of u-boot.cfg because u-boot.cfg is rebuilt anyway as the byproduct of
auto.conf when a user updates the .config file.

[1] https://lists.denx.de/pipermail/u-boot/2018-June/330341.html
[2] https://autobuilder.yoctoproject.org/typhoon/#/builders/65/builds/160/steps/7/logs/step1b

Fixes: 0d982c585330 ("Makefile: add dependencies to regenerate u-boot.cfg when lost")
Reported-by: Kever Yang <kever.yang@rock-chips.com>
Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoserial: ns16550: fix debug uart putc called before init
Simon Goldschmidt [Wed, 9 Jan 2019 19:35:31 +0000 (20:35 +0100)]
serial: ns16550: fix debug uart putc called before init

If _debug_uart_putc() is called before _debug_uart_init(), the
ns16550 debug uart driver hangs in a tight loop waiting for the
tx FIFO to get empty.

As this can happen via a printf sneaking in before the port calls
debug_uart_init(), introduce a config option to ignore characters
before the debug uart is initialized.

This is done by reading the baudrate divisor and aborting if is zero.

The Kconfig option is required as reading the baudrate divisor does
not seem to work for all ns16500 compatibles (which is why the last
attempt on this has been reverted in 1a67969a99).

Tested on socfpga_cyclone5_socrates.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agodrivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART
Simon Goldschmidt [Wed, 9 Jan 2019 19:27:09 +0000 (20:27 +0100)]
drivers: serial: DEBUG_UART_SKIP_INIT depends on DEBUG_UART

DEBUG_UART_SKIP_INIT is used only by debug UART and thus should depend
on DEBUG_UART.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoFix typo: missmatched -> mismatched.
Vagrant Cascadian [Tue, 8 Jan 2019 21:10:23 +0000 (13:10 -0800)]
Fix typo: missmatched -> mismatched.

Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
5 years agoxyz-modem: Fix timeout loop waiting with WATCHDOG
Lokesh Vutla [Tue, 8 Jan 2019 13:58:35 +0000 (19:28 +0530)]
xyz-modem: Fix timeout loop waiting with WATCHDOG

Commit 2c77c0d6524eb ("xyz-modem: Change getc timeout loop waiting")
fixes the loop delay when using a hw watchdog, assuming that watchdog
kicking is taken care of by getc(). But the xyzmodem driver tries to
do a getc only after confirming that a character is available like below:
while (!tstc()) {
till timeout;
}
if (tstc())
*c = getc();

and getc() does a watchdog reset only if it fails to see a character.
In this case, getc() always sees a character and never does a
watchdog reset. So to make sure that watchdog doesn't get reset
while loading the file, do a watchdog reset just before starting the
image loading.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agopylibfdt: Use Python 2 in Makefile
Josef Lusticky [Tue, 8 Jan 2019 13:19:46 +0000 (14:19 +0100)]
pylibfdt: Use Python 2 in Makefile

pylibfdt needs Python 2 to build.
Replace $(PYTHON) with $(PYTHON2) in pylibfdt Makefile
to ensure Python 2 is used to build it.

This fixes build on systems where Python 3 is the default version
of the "python" interpreter.
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agolib: uuid: Do not enable UUID command SPL
Marek Vasut [Mon, 7 Jan 2019 20:23:38 +0000 (21:23 +0100)]
lib: uuid: Do not enable UUID command SPL

The uuid command is only really useful in U-Boot, but it's useless in
SPL. Worse yet, it pulls in various environment manipulation functions
as it call env_set(). Do not compile the command in in SPL.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agospl: ymodem: Add support for loading gzip compressed uImage
Marek Vasut [Mon, 7 Jan 2019 20:23:22 +0000 (21:23 +0100)]
spl: ymodem: Add support for loading gzip compressed uImage

Add support for gunzip-ing gzip-compressed uImages in the SPL Ymodem code.
Loading data over Ymodem can be gruelingly slow, gzip-ing the data can
reduce that aggravating slowness at least slightly (depends on the data,
u-boot.bin compresses to ~1/3 of it's original size on ARM64), hence add
optional support for decompressing gzip-compressed uImages.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
5 years agodtoc: make generated platdata structs const
Simon Goldschmidt [Mon, 7 Jan 2019 19:29:26 +0000 (20:29 +0100)]
dtoc: make generated platdata structs const

The platdata initialization structs are currently generated into .rwdata.
Make sure the are put into .rodata by generating them as const.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agocmd: zip: use correct format code
Heinrich Schuchardt [Sun, 6 Jan 2019 11:38:37 +0000 (12:38 +0100)]
cmd: zip: use correct format code

dst_len is defined as unsigned long. So use %lu for printf().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agocmd: unzip: use correct format code
Heinrich Schuchardt [Sun, 6 Jan 2019 11:34:16 +0000 (12:34 +0100)]
cmd: unzip: use correct format code

src_len is defined as unsigned long. So use %lu for printf().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agocmd: ubi: remove unreachable code
Heinrich Schuchardt [Sun, 6 Jan 2019 11:26:28 +0000 (12:26 +0100)]
cmd: ubi: remove unreachable code

It does not make sense to check if argc < 2 a second time, especially after
accessing argv[1].

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agocmd: tpm-v2: use correct format code
Heinrich Schuchardt [Sun, 6 Jan 2019 11:09:10 +0000 (12:09 +0100)]
cmd: tpm-v2: use correct format code

updates is defined as unsigned int. So use %u for printf().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agocmd: sf: use correct printf code
Heinrich Schuchardt [Sun, 6 Jan 2019 11:03:37 +0000 (12:03 +0100)]
cmd: sf: use correct printf code

test->time_ms[] is defined as unsigned. So use %u for printf().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agocmd: nvedit: use correct format code
Heinrich Schuchardt [Sun, 6 Jan 2019 10:52:06 +0000 (11:52 +0100)]
cmd: nvedit: use correct format code

len is defined as unsigned. So use %u for printf().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agocmd: gpio: use correct printf code
Heinrich Schuchardt [Sun, 6 Jan 2019 10:31:54 +0000 (11:31 +0100)]
cmd: gpio: use correct printf code

gpio is defined as unsigned int. So we should use %u when calling printf().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoconfigs: stm32: Remove CONFIG_OF_EMBED
Patrice Chotard [Fri, 4 Jan 2019 10:48:55 +0000 (11:48 +0100)]
configs: stm32: Remove CONFIG_OF_EMBED

Building with CONFIG_OF_EMBED generates build warnings, as it should
only be used for debugging purposes.

Remove CONFIG_OF_EMBED from all stm32 config files which are using
this flag.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
5 years agocmd: mmc: Invalidate MMC block cache after init
Marek Vasut [Thu, 3 Jan 2019 21:09:44 +0000 (22:09 +0100)]
cmd: mmc: Invalidate MMC block cache after init

Make sure the block cache is cleared for the MMC device after it was
reinitialized to avoid having any stale data in the cache, like e.g.
partition tables or such.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
5 years agocmd: mmc: Force mmc reinit when no card present
Marek Vasut [Thu, 3 Jan 2019 21:09:43 +0000 (22:09 +0100)]
cmd: mmc: Force mmc reinit when no card present

In case the card is removed, force-init the MMC to start the internal
machinery which deregisters and invalidate the MMC device.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
5 years agommc: Add support for downgrading HS200/HS400 to HS mode
Marek Vasut [Thu, 3 Jan 2019 20:19:24 +0000 (21:19 +0100)]
mmc: Add support for downgrading HS200/HS400 to HS mode

The mmc_select_mode_and_width() function can be called while the card
is in HS200/HS400 mode and can be used to downgrade the card to lower
mode, e.g. HS. This is used for example by mmc_boot_part_access_chk()
which cannot access the card in HS200/HS400 mode and which is in turn
called by saveenv if env is in the MMC.

In such case, forcing the card clock to legacy frequency cannot work.
Instead, the card must be switched to HS mode first, from which it can
then be reprogrammed as needed.

However, this procedure needs additional code changes, since the current
implementation checks whether the card correctly switched to HS mode in
mmc_set_card_speed(). The check only expects that the card will be going
to HS mode from lower modes, not from higher modes, hence add a parameter
which indicates that the HS200/HS400 to HS downgrade is happening. This
makes the code send the switch command first, reconfigure the controller
next and finally perform the EXT_CSD readback check. The last two steps
cannot be done in reverse order as the card is already in HS mode when
the clock are being switched on the controller side.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
5 years agoam335x: igep003x: Add Device Tree Support and DM_MMC driver
Enric Balletbo i Serra [Fri, 28 Dec 2018 10:55:48 +0000 (11:55 +0100)]
am335x: igep003x: Add Device Tree Support and DM_MMC driver

This adds device tree and the DM_MMC driver for the AM335x IGEP based
boards.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
5 years agoam335x: sl50: Add Device Tree Support and DM_MMC driver
Enric Balletbo i Serra [Thu, 27 Dec 2018 16:34:11 +0000 (17:34 +0100)]
am335x: sl50: Add Device Tree Support and DM_MMC driver

This adds device tree and the DM_MMC driver for the SL50 board.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
5 years agoomap3: igep00x0: Add Device Tree Support and DM_MMC driver
Enric Balletbo i Serra [Thu, 27 Dec 2018 16:03:30 +0000 (17:03 +0100)]
omap3: igep00x0: Add Device Tree Support and DM_MMC driver

This adds device tree for OMAP3 IGEP based boards and the DM_MMC driver.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agoomap3: igep00x0: Switch to simple malloc in SPL
Enric Balletbo i Serra [Thu, 27 Dec 2018 16:03:29 +0000 (17:03 +0100)]
omap3: igep00x0: Switch to simple malloc in SPL

To save more space, switch to simple malloc here.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
5 years agoomap3: igep00x0: Switch to using TI_COMMON_CMD_OPTION
Enric Balletbo i Serra [Thu, 27 Dec 2018 16:03:28 +0000 (17:03 +0100)]
omap3: igep00x0: Switch to using TI_COMMON_CMD_OPTION

Enable TI_COMMON_CMD_OPTIONS and remove similar options
from the defconfig.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
5 years agoomap3: igep00x0: Remove USB support due DM_USB deadline
Enric Balletbo i Serra [Thu, 27 Dec 2018 16:03:27 +0000 (17:03 +0100)]
omap3: igep00x0: Remove USB support due DM_USB deadline

The USB support for this board was never really tested, in fact, the
presence of these options are more a copy & paste error from the
Beagleboard than a feature that really was used. As doesn't work, remove
for now. If someone at some point want to add this support he'll need to
migrate the board to use CONFIG_DM_USB instead.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
5 years agoomap3: igep00x0: Remove unmaintained IGEP0032 defconfig
Enric Balletbo i Serra [Thu, 27 Dec 2018 16:03:26 +0000 (17:03 +0100)]
omap3: igep00x0: Remove unmaintained IGEP0032 defconfig

The IGEP0032 board was never officially pushed upstream and actually I
don't have access to this hardware, unless someone with the hardware
wants to start working on this doesn't makes sense have this defconfig
here. So remove it.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
5 years agotest: Use single quote consistently
Simon Glass [Thu, 27 Dec 2018 15:11:13 +0000 (08:11 -0700)]
test: Use single quote consistently

Some tests have ended up using double quotes where single quotes could be
used. Adjust this for consistency with the rest of U-Boot's Python code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
5 years agoarm: dts: Add MMC nodes for HiKey board
Manivannan Sadhasivam [Thu, 27 Dec 2018 13:34:05 +0000 (19:04 +0530)]
arm: dts: Add MMC nodes for HiKey board

Add MMC nodes for HiKey board based on HI6220 SoC. There are three MMC
controllers in this SoC, first one used for eMMC, second one used
for SD card and third one is not used by u-boot.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agommc: Convert HI6220 MMC driver to driver model
Manivannan Sadhasivam [Thu, 27 Dec 2018 13:34:04 +0000 (19:04 +0530)]
mmc: Convert HI6220 MMC driver to driver model

Convert HiSilicon HI6220 MMC driver based on DWMMC IP to driver
model.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
[trini: Enable this on poplar]
Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agoi2c: Reflect correct dependency for !DM cadence driver
Michal Simek [Wed, 9 Jan 2019 11:00:32 +0000 (12:00 +0100)]
i2c: Reflect correct dependency for !DM cadence driver

Setup proper DM_I2C dependency.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoi2c: mux: Covert to livetree functions
Michal Simek [Wed, 9 Jan 2019 10:58:24 +0000 (11:58 +0100)]
i2c: mux: Covert to livetree functions

Updates i2c muxes drivers to support livetree.
Similar changes were done by:
"net: zynq_gem: convert to use livetree"
(sha1: 26026e695afa794ac018a09e79a48120d322b60d)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoi2c: i2c-cdns: Use proper input frequency
Tomasz Gorochowik [Thu, 3 Jan 2019 12:36:33 +0000 (13:36 +0100)]
i2c: i2c-cdns: Use proper input frequency

This is needed to properly calculate i2c bus speed divisors.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
Signed-off-by: Wojciech Tatarski <wtatarski@antmicro.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
5 years agoi2c: xiic: Add Xilinx AXI I2C driver
Marek Vasut [Wed, 19 Dec 2018 11:26:27 +0000 (12:26 +0100)]
i2c: xiic: Add Xilinx AXI I2C driver

Add Xilinx AXI I2C controller driver based on the Linux i2c-xiic driver.
This driver is stripped of all the IRQ handling and uses pure polling,
yet tries to retain most of the structure of the Linux driver to make
backporting of fixes easy.

Note that the IP has a known limitation on 255 bytes read and write,
according to xilinx this is still being worked on [1].

[1] https://forums.xilinx.com/t5/Embedded-Processor-System-Design/AXI-IIC-V2-0-I2C-Master-Reading-multiple-bytes-from-I2C-slave/m-p/854419/highlight/true#M39387

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Heiko Schocher <hs@denx.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
5 years agoriscv: qemu: define standalone load address
Lukas Auer [Fri, 4 Jan 2019 00:37:34 +0000 (01:37 +0100)]
riscv: qemu: define standalone load address

We need to define the standalone load address to use standalone
application on qemu-riscv. Define it and set it equal to
CONFIG_SYS_LOAD_ADDR.

To not overwrite it, change the assigned of CONFIG_STANDALONE_LOAD_ADDR
in arch/riscv/config.mk to a conditional one.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: support standalone applications on RV64I systems
Lukas Auer [Fri, 4 Jan 2019 00:37:33 +0000 (01:37 +0100)]
riscv: support standalone applications on RV64I systems

Add an implementation of EXPORT_FUNC() for RV64I systems to support them
in standalone applications.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: replace use of callee-saved register in standalone
Lukas Auer [Fri, 4 Jan 2019 00:37:32 +0000 (01:37 +0100)]
riscv: replace use of callee-saved register in standalone

Register x19 (s3) is a callee-saved register. It must not be used to
load and jump to exported functions without saving it beforehand.
Replace it with t0, a temporary and caller-saved register.

Change the code comment to reflect this and fix it to correctly list gp
as the register with the pointer to global data.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: remove RISC-V standalone linker script
Lukas Auer [Fri, 4 Jan 2019 00:37:31 +0000 (01:37 +0100)]
riscv: remove RISC-V standalone linker script

Standalone applications do not require a separate linker script and can
use the default linker script of the compiler instead. Remove the RISC-V
standalone linker script.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: use invalidate/flush_*cache_range functions in cache.c
Lukas Auer [Fri, 4 Jan 2019 00:37:30 +0000 (01:37 +0100)]
riscv: use invalidate/flush_*cache_range functions in cache.c

The flush_cache() function in lib/cache.c ignores its arguments and
flushes the complete data and instruction caches. Use the
invalidate/flush_*cache_range() functions instead to only flush the
requested memory region.

This patch does not change the current behavior of U-Boot, since the
implementation of the invalidate/flush_*cache_range() functions flush
the complete data and instruction caches. It is in preparation for CPUs
with the necessary functionality for flushing a selectable memory range.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: move the AX25-specific implementation of flush_dcache_all
Lukas Auer [Fri, 4 Jan 2019 00:37:29 +0000 (01:37 +0100)]
riscv: move the AX25-specific implementation of flush_dcache_all

The fence instruction is used to enforce device I/O and memory ordering
constraints in RISC-V. It can not be relied on to directly affect the
data cache on every CPU.
Andes' AX25 does not have a coherence agent. Its fence instruction
flushes the data cache and is used to keep data in the system coherent.
The implementation of flush_dcache_all in lib/cache.c is therefore
specific to the AX25. Move it into the AX25-specific cache.c in
cpu/ax25/.

This also adds a missing new line between flush_dcache_all and
flush_dcache_range in lib/cache.c.

Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agoriscv: clarify error message on undefined exceptions
Lukas Auer [Fri, 4 Jan 2019 00:37:28 +0000 (01:37 +0100)]
riscv: clarify error message on undefined exceptions

Undefined exceptions are treated as reserved. This is not clearly
communicated to the user. Adjust the error message to clarify that a
reserved exception has occurred and add additional details.

Fixes: e8b522b ("riscv: treat undefined exception codes as reserved")
Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
5 years agolib: fdtdec: fdtdec_get_addr_size_fixed remove checks
Keerthy [Fri, 21 Dec 2018 16:24:30 +0000 (21:54 +0530)]
lib: fdtdec: fdtdec_get_addr_size_fixed remove checks

With 8 bytes addressing even on 32 bit machines these checks
are no longer valid. Remove them.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agosandbox: i2c_emul_find() No emulators for device 'rtc@43'
Heinrich Schuchardt [Sat, 5 Jan 2019 21:30:07 +0000 (22:30 +0100)]
sandbox: i2c_emul_find() No emulators for device 'rtc@43'

when running the date command on sandbox_defconfig an error occurs:

    ./u-boot -D u-boot.dtb

    => date
    i2c_emul_find() No emulators for device 'rtc@43'
    ## Get date failed

Correct the references to the emulator devices in the sandbox device trees
using test.dts as a reference.

Fixes: 031a650e1309 ("dm: sandbox: i2c: Use new emulator parent uclass")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Dropped unnecessary #address/size-cells property in i2c_emul:
Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agodm: serial: Tidy up header file comments
Simon Glass [Fri, 28 Dec 2018 21:23:11 +0000 (14:23 -0700)]
dm: serial: Tidy up header file comments

The getconfig() comment is out of date. Fix this and add comments for
recently added functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
5 years agodm: serial: Adjust serial_getinfo() to use proper API
Simon Glass [Fri, 28 Dec 2018 21:23:10 +0000 (14:23 -0700)]
dm: serial: Adjust serial_getinfo() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
5 years agodm: serial: Adjust serial_setconfig() to use proper API
Simon Glass [Fri, 28 Dec 2018 21:23:09 +0000 (14:23 -0700)]
dm: serial: Adjust serial_setconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
5 years agodm: serial: Adjust serial_getconfig() to use proper API
Simon Glass [Fri, 28 Dec 2018 21:23:08 +0000 (14:23 -0700)]
dm: serial: Adjust serial_getconfig() to use proper API

All driver-model functions should have a device as the first parameter.
Update this function accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
5 years agoserial: Move new functions to serial.h
Simon Glass [Fri, 28 Dec 2018 21:23:07 +0000 (14:23 -0700)]
serial: Move new functions to serial.h

We should not be adding new functions to common.h. Move these recently
added functions to serial.h.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
5 years agobuildman: Fix tabs in GetWrapper()
Simon Glass [Mon, 7 Jan 2019 23:44:24 +0000 (16:44 -0700)]
buildman: Fix tabs in GetWrapper()

This function has tabs instead of spaces. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agonet: Fix error handling in sb_eth_raw_ofdata_to_platdata()
Simon Glass [Mon, 7 Jan 2019 23:44:22 +0000 (16:44 -0700)]
net: Fix error handling in sb_eth_raw_ofdata_to_platdata()

At present this stores the error number in an unsigned int so an error is
never detected. Use the existing signed variable instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
5 years agotravis: Use buildman for building with clang
Simon Glass [Mon, 7 Jan 2019 23:44:21 +0000 (16:44 -0700)]
travis: Use buildman for building with clang

Now that buildman supports clang, use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agobuildman: Add support for building with clang
Simon Glass [Mon, 7 Jan 2019 23:44:20 +0000 (16:44 -0700)]
buildman: Add support for building with clang

Add a -O option which allows building with clang.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agolog: Check printf() arguments
Simon Glass [Mon, 7 Jan 2019 23:44:19 +0000 (16:44 -0700)]
log: Check printf() arguments

At present logging does not check printf() arguments. Now that all users
have been corrected, enable this to prevent further problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agoefi_loader: Add a wchar_t cast in efi_file_open()
Simon Glass [Mon, 7 Jan 2019 23:44:18 +0000 (16:44 -0700)]
efi_loader: Add a wchar_t cast in efi_file_open()

The printf() string here is not actually correct. Add a cast to avoid
a warning when checking is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agosandbox: Correct SDL build flags
Simon Glass [Mon, 17 Dec 2018 16:12:16 +0000 (09:12 -0700)]
sandbox: Correct SDL build flags

The check for CONFIG_SANDBOX_SDL in config.mk does not work since the
build config is not available by the time that file is included. Remove it
so that we always call sdl-config except when NO_SDL is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agobuildman: Deal nicely with invalid build-status file
Simon Glass [Mon, 10 Dec 2018 16:05:23 +0000 (09:05 -0700)]
buildman: Deal nicely with invalid build-status file

The 'done' files created by buildman may end up being empty if buildman
runs out of disk space while writing them. This error is then persistent,
since even if disk space is reclaimed and the build retries, the empty
file causes an exception in the builder thread.

Deal with this silently by doing a rebuild.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agotest: dm: regmap: Fix the long test delay
Simon Glass [Mon, 10 Dec 2018 00:11:10 +0000 (17:11 -0700)]
test: dm: regmap: Fix the long test delay

At present one of the regmap tests takes 5 seconds to run since it waits
for a timeout. This should be handled using sandbox_timer_add_offset()
which advances time for test purposes.

This requires a little change to make the regmap_read_poll_timeout()
testable.

Update the macro and the test.

Fixes: ebe3497c9c ("test: regmap: add regmap_read_poll_timeout test")

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agocommon: fdt_support: print hexadecimal numbers in debug
Sekhar Nori [Thu, 6 Dec 2018 09:50:47 +0000 (15:20 +0530)]
common: fdt_support: print hexadecimal numbers in debug

We usually deal with hexadecimal addresses and sizes in
device-tree. Its much easier if debug logs print hexadecimal
values too.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 years agodm: Tidy up 'dm tree' output when there are many devices
Simon Glass [Thu, 6 Dec 2018 01:42:52 +0000 (18:42 -0700)]
dm: Tidy up 'dm tree' output when there are many devices

At present the 'Index' column assumes there is only one digit. But on some
devices (e.g. snow) there are a lot of regulators and GPIO banks. Adjust
the output to allow for two digits without messing up the display.

Also capatalise the heading to match.

Fixes: 5197dafc42 (dm: core: Widen the dump tree to show more of the
driver's name.)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Liviu Dudau <liviu.dudau@foss.arm.com>
5 years agobuildman: Drop comment about Ctrl-C problem
Simon Glass [Wed, 5 Dec 2018 12:35:26 +0000 (05:35 -0700)]
buildman: Drop comment about Ctrl-C problem

This bug is now fixed, so drop this comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 years agosandbox: add memset_io(..), memcpy_fromio(..) and memcpy_toio(..)
Christian GMEINER [Tue, 4 Dec 2018 19:35:24 +0000 (20:35 +0100)]
sandbox: add memset_io(..), memcpy_fromio(..) and memcpy_toio(..)

These functions could be used by drivers.

Signed-off-by: Christian GMEINER <christian.GMEINER@bachmann.info>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoinclude: configs: Add gunzip size for HiKey board
Manivannan Sadhasivam [Thu, 27 Dec 2018 13:34:03 +0000 (19:04 +0530)]
include: configs: Add gunzip size for HiKey board

Default 8MB gunzip size is not enough to load the release kernel, hence
fix 64MB size for uncompressing the kernel.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoconfigs: MediaTek: use OF_SEPARATE instead of OF_EMBED
Weijie Gao [Thu, 20 Dec 2018 08:12:59 +0000 (16:12 +0800)]
configs: MediaTek: use OF_SEPARATE instead of OF_EMBED

This patch replace OF_EMBED with OF_SEPARATE of defconfig files of
MediaTek boards because now OF_EMBED is only used for debugging purpose.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoMAINTAINERS: ARM MEDIATEK: update file entries
Weijie Gao [Thu, 20 Dec 2018 08:12:58 +0000 (16:12 +0800)]
MAINTAINERS: ARM MEDIATEK: update file entries

This patch adds new file entries for MediaTek SoCs

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
5 years agoarm: MediaTek: add ethernet support for MT7629 boards
Weijie Gao [Thu, 20 Dec 2018 08:12:57 +0000 (16:12 +0800)]
arm: MediaTek: add ethernet support for MT7629 boards

Enable ethernet related configs to mt7629_rfb_defconfig.
Add default IP addresses.
Enable noncached memory region required by ethernet driver.

Signed-off-by: Mark Lee <Mark-MC.Lee@mediatek.com>
5 years agoarm: MediaTek: add ethernet support for MT7623 boards
Weijie Gao [Thu, 20 Dec 2018 08:12:56 +0000 (16:12 +0800)]
arm: MediaTek: add ethernet support for MT7623 boards

Enable ethernet related configs to mt7623n_bpir2_defconfig.
Add default IP addresses.
Enable noncached memory region required by ethernet driver.

Signed-off-by: Mark Lee <Mark-MC.Lee@mediatek.com>
5 years agoarm: dts: add ethernet related node for MT7629 SoC
Weijie Gao [Thu, 20 Dec 2018 08:12:55 +0000 (16:12 +0800)]
arm: dts: add ethernet related node for MT7629 SoC

This patch adds ethernet gmac node for MT7629 with internal gigabit phy.

Signed-off-by: Mark Lee <Mark-MC.Lee@mediatek.com>
5 years agoarm: dts: add ethernet related node for MT7623 SoC
Weijie Gao [Thu, 20 Dec 2018 08:12:54 +0000 (16:12 +0800)]
arm: dts: add ethernet related node for MT7623 SoC

This patch adds ethernet gmac node for MT7623 with MT7530 gigabit switch.

Signed-off-by: Mark Lee <Mark-MC.Lee@mediatek.com>
5 years agoethernet: MediaTek: add ethernet driver for MediaTek ARM-based SoCs
Weijie Gao [Thu, 20 Dec 2018 08:12:53 +0000 (16:12 +0800)]
ethernet: MediaTek: add ethernet driver for MediaTek ARM-based SoCs

This patch adds ethernet support for Mediatek ARM-based SoCs, including
a minimum setup of the integrated switch.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Signed-off-by: Mark Lee <Mark-MC.Lee@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Tested-By: "Frank Wunderlich" <frank-w@public-files.de>
5 years agoclk: MediaTek: bind ethsys reset controller
Weijie Gao [Thu, 20 Dec 2018 08:12:52 +0000 (16:12 +0800)]
clk: MediaTek: bind ethsys reset controller

The ethsys contains not only the clock gating controller, but also the
reset controller for the whole ethernet subsystem and its components.

This patch adds binding of the reset controller so that the ethernet node
can have references on it.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
5 years agoreset: MedaiTek: add reset controller driver for MediaTek SoCs
Weijie Gao [Thu, 20 Dec 2018 08:12:51 +0000 (16:12 +0800)]
reset: MedaiTek: add reset controller driver for MediaTek SoCs

This patch adds reset controller driver for MediaTek SoCs.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
5 years agopoplar_defconfig: enable fastboot support
Shawn Guo [Tue, 18 Dec 2018 09:52:07 +0000 (17:52 +0800)]
poplar_defconfig: enable fastboot support

It enables fastboot support on Poplar board by using DWC2 OTG gadget
driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
5 years agopoplar: add DWC2 OTG gadget support
Shawn Guo [Tue, 18 Dec 2018 09:52:06 +0000 (17:52 +0800)]
poplar: add DWC2 OTG gadget support

It enables DWC2 OTG gadget driver support for Poplar board.  As
usb2_phy_init() is being always called from board_init(), we can save
the call from board_usb_init().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
5 years agoimage: fix compiling without CMD_FDT
Simon Goldschmidt [Mon, 17 Dec 2018 19:14:42 +0000 (20:14 +0100)]
image: fix compiling without CMD_FDT

Booting an image currently sets the environment variable "fdtaddr"
by calling into 'cmd/fdt.c'. As a result, linking U-Boot fails if
CMD_FDT is not enabled.

Fix this by adding 'if (CONFIG_IS_ENABLED(CMD_FDT))' to the two
places where 'set_working_fdt_addr()' is called.

Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
5 years agoam57xx_evm_defconfig: Enable YMODEM support
Yan Liu [Mon, 17 Dec 2018 14:27:59 +0000 (09:27 -0500)]
am57xx_evm_defconfig: Enable YMODEM support

Enable CONFIG_SPL_YMODEM_SUPPORT to support UART boot

Signed-off-by: Yan Liu <yan-liu@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
5 years agotest: bootcount: add bootcount-uclass test
Philipp Tomsich [Fri, 14 Dec 2018 20:14:29 +0000 (21:14 +0100)]
test: bootcount: add bootcount-uclass test

Add a test for the bootcount uclass, which uses the RTC bootcount backend
(i.e. drivers/bootcount/rtc.c is implictly also tested).

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 years agoPrepare v2019.01 v2019.01
Tom Rini [Mon, 14 Jan 2019 22:02:36 +0000 (17:02 -0500)]
Prepare v2019.01

Signed-off-by: Tom Rini <trini@konsulko.com>
5 years agommc: fsl_esdhc: Avoid infinite loop in esdhc_send_cmd_common()
Fabio Estevam [Mon, 19 Nov 2018 12:31:53 +0000 (10:31 -0200)]
mmc: fsl_esdhc: Avoid infinite loop in esdhc_send_cmd_common()

The following hang is observed on a Hummingboard 2 MicroSOM
i2eX iMX6D - rev 1.3 with no eMMC populated on board:

U-Boot SPL 2018.11+gf6206f8587 (Nov 16 2018 - 00:56:34 +0000)
Trying to boot from MMC1

U-Boot 2018.11+gf6206f8587 (Nov 16 2018 - 00:56:34 +0000)

CPU:   Freescale i.MX6D rev1.5 996 MHz (running at 792 MHz)
CPU:   Extended Commercial temperature grade (-20C to 105C) at 33C
Reset cause: POR
Board: MX6 HummingBoard2
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

No panel detected: default to HDMI
Display: HDMI (1024x768)
In:    serial
Out:   serial
Err:   serial
---> hangs

which is caused by the following infinite loop inside esdhc_send_cmd_common()

while (!(esdhc_read32(&regs->irqstat) & flags))
;

Instead of looping forever, provide an exit path so that a timeout
error can be propagated in the case irqstat does not report
any interrupts, which may happen when no eMMC is populated on
board.

Reported-by: Ricardo Salveti <rsalveti@rsalveti.net>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Ricardo Salveti <rsalveti@rsalveti.net>
5 years agoimx8mq_evk_defconfig: Move file system options to Kconfig
Fabio Estevam [Sat, 29 Dec 2018 12:02:24 +0000 (10:02 -0200)]
imx8mq_evk_defconfig: Move file system options to Kconfig

Chris Spencer reports that when enabling ext4 read support without
also enabling write support the following error is seen:

fs/fs.c:198:12: error: 'ext4_write_file' undeclared here (not in a
function); did you mean 'ext4_read_file'?
   .write = ext4_write_file,
            ^~~~~~~~~~~~~~~
Fix this problem by moving these options to Kconfig.

Reported-by: Chris Spencer <spencercw@gmail.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
5 years agopoplar: save environment at a different offset
Alex Elder [Tue, 18 Dec 2018 03:08:18 +0000 (11:08 +0800)]
poplar: save environment at a different offset

Change CONFIG_ENV_OFFSET for Poplar to be 1MB further into the eMMC
than before.  This puts it immediately prior to the space we are
reserving offset 0x200000-0x400000 for UEFI to save its persistent
data.  Define CONFIG_ENV_SIZE as a product of env_mmc_nblks and the
sector size, like CONFIG_ENV_OFFSET is.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
5 years agoMerge branch 'master' of git://git.denx.de/u-boot-socfpga
Tom Rini [Fri, 11 Jan 2019 15:47:53 +0000 (10:47 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-socfpga

5 years agoMerge branch 'master' of git://git.denx.de/u-boot-usb
Tom Rini [Fri, 11 Jan 2019 15:47:41 +0000 (10:47 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-usb

5 years agoRevert "fs: fat: assign rootdir sector when accessing root directory"
Tom Rini [Fri, 11 Jan 2019 14:54:44 +0000 (09:54 -0500)]
Revert "fs: fat: assign rootdir sector when accessing root directory"

This particular commit is causing a regression on stih410-b2260 and
other platforms when reading from FAT16.  Noting that I had rebased the
original fix from Thomas onto then-current master, there is also
question from Akashi-san if the change is still needed after other FAT
fixes that have gone in.

This reverts commit a68b0e11ea774492713a65d9fd5bb525fcaefff3.

Reported-by: Patrice Chotard <patrice.chotard@st.com>
Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: Thomas RIENOESSL <thomas.rienoessl@bachmann.info>
Signed-off-by: Tom Rini <trini@konsulko.com>