platform/kernel/u-boot.git
4 years agoMerge tag 'dm-pull-3dec19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Tue, 3 Dec 2019 23:12:04 +0000 (18:12 -0500)]
Merge tag 'dm-pull-3dec19' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

Fix stdout-path handling

4 years agoMerge branch '2019-12-03-master-imports'
Tom Rini [Tue, 3 Dec 2019 23:10:17 +0000 (18:10 -0500)]
Merge branch '2019-12-03-master-imports'

- omapl138_lcdk fixes
- MediaTek MT8518 support
- VxWorks standard DTB support
- Assorted bug fixes

4 years agoarm64: zynqmp: Point zcu216 defconfig to correct dts file
Michal Simek [Mon, 25 Nov 2019 09:28:45 +0000 (10:28 +0100)]
arm64: zynqmp: Point zcu216 defconfig to correct dts file

Defconfig is pointing to incorrect DT file which needs to be fix.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
4 years agoARM: MediaTek: add basic support for MT8518 boards
mingming lee [Thu, 7 Nov 2019 11:28:44 +0000 (19:28 +0800)]
ARM: MediaTek: add basic support for MT8518 boards

This adds a general board file based on MT8518 SoCs from MediaTek.

Apart from the generic parts (cpu) we add some low level init codes
and initialize the early clocks.

This commit is adding the basic boot support for the MT8518 eMMC board.

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
[trini: Migrate env location to defconfig, set ENV_IS_IN_MMC]
Signeed-off-by: Tom Rini <trini@konsulko.com>
4 years agopinctrl: add driver for MT8518
mingming lee [Thu, 7 Nov 2019 11:28:43 +0000 (19:28 +0800)]
pinctrl: add driver for MT8518

Add Pinctrl driver for MediaTek MT8518 SoC.

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
4 years agommc: mtk-sd: Adjust the mmc tuning flow
mingming lee [Thu, 7 Nov 2019 11:28:42 +0000 (19:28 +0800)]
mmc: mtk-sd: Adjust the mmc tuning flow

1.Support cmd response and data tuning together.
2.Support hs400 cmd responese tuning.

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
4 years agoclk: mediatek: add driver for MT8518
mingming lee [Thu, 7 Nov 2019 11:28:41 +0000 (19:28 +0800)]
clk: mediatek: add driver for MT8518

Add clock driver for MediaTek MT8518 SoC.

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
4 years agoARM: MediaTek: Add support for MediaTek MT8518 SoC
mingming lee [Thu, 7 Nov 2019 11:28:40 +0000 (19:28 +0800)]
ARM: MediaTek: Add support for MediaTek MT8518 SoC

Add support for MediaTek MT8518 SoC. This include the file
that will initialize the SoC after boot and its device tree.

Signed-off-by: mingming lee <mingming.lee@mediatek.com>
4 years agoregmap: Fix potential memory leaks
Faiz Abbas [Mon, 11 Nov 2019 09:59:05 +0000 (15:29 +0530)]
regmap: Fix potential memory leaks

Free allocated memory in case of an error in regmap_init_mem() and
regmap_init_mem_index().

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
4 years agonet: cpsw: Add NULL pointer check
Faiz Abbas [Mon, 11 Nov 2019 09:52:56 +0000 (15:22 +0530)]
net: cpsw: Add NULL pointer check

Add null pointer check to take care of out of memory errors.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
4 years agospl: ymodem: Fix loading of fit image
Lokesh Vutla [Thu, 14 Nov 2019 13:03:30 +0000 (18:33 +0530)]
spl: ymodem: Fix loading of fit image

spl ymodem driver always assumes that 1 BUF_SIZE is read in one stream.
This might not be true when image is not padded to BUF_SIZE and the last
sector that gets loaded will be < BUF_SIZE. Drop this assumption and use
the actual size that is loaded.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agommc: davinci: fix mmc boot in SPL
Bartosz Golaszewski [Thu, 14 Nov 2019 15:10:31 +0000 (16:10 +0100)]
mmc: davinci: fix mmc boot in SPL

The MMC boot is currently broken on omapl138-lcdk after enabling the
driver model in SPL. The main problem is the driver's bind callback not
being called after probe in SPL (even with the DM_FLAG_PRE_RELOC flag
specified).

While a proper fix is still being worked on, this hacky changeset at
least fixes the MMC boot on this platform by calling mmc_bind()
manually from probe().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agoboard: omapl138_lcdk: add the mmc device to SPL
Bartosz Golaszewski [Thu, 14 Nov 2019 15:10:30 +0000 (16:10 +0100)]
board: omapl138_lcdk: add the mmc device to SPL

We don't have full device-tree support in SPL yet - add an appropriate
U_BOOT_DEVICE() to the board file.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agommc: davinci: drop struct davinci_mmc_plat
Bartosz Golaszewski [Thu, 14 Nov 2019 15:10:29 +0000 (16:10 +0100)]
mmc: davinci: drop struct davinci_mmc_plat

struct mmc_config & struct mmc don't need to be exported over platform
data, but can instead be private in the driver.

Remove struct davinci_mmc_plat.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agommc: davinci: drop support for ti,dm6441-mmc
Bartosz Golaszewski [Thu, 14 Nov 2019 15:10:28 +0000 (16:10 +0100)]
mmc: davinci: drop support for ti,dm6441-mmc

The DM family of DaVinci SoCs is no longer supported. Drop the
irrelevant code from the driver.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agoARM: omapl138_lcdk: Allow early init to start instruction cache
Adam Ford [Sun, 10 Nov 2019 16:17:58 +0000 (10:17 -0600)]
ARM: omapl138_lcdk: Allow early init to start instruction cache

Currently the omapl138_lcdk has SKIP_LOWLEVEL_INIT set.
The README states there is a variation of this for the ARM926EJ-S
which allows the board to just skip the call to lowlevel_init()
and do the normal CP15 init which enables the instruction cache.

On the da850evm, this was shown to improve startup time.

This patch switches SKIP_LOWLEVEL_INIT to SKIP_LOWLEVEL_INIT_ONLY
thus, enabling the cache.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agoARM: omapl138_lcdk: Enable SPL_DM_SEQ_ALIAS and SPL_OF_TRANSLATE
Adam Ford [Sun, 10 Nov 2019 14:01:33 +0000 (08:01 -0600)]
ARM: omapl138_lcdk: Enable SPL_DM_SEQ_ALIAS and SPL_OF_TRANSLATE

In order to further prepare for full device tree support in SPL,
this patch enables both SPL_DM_SEQ_ALIAS and SPL_OF_TRANSLATE.
Both of these are already enabled in U-Boot, so SPL will have
the same functionality

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agoARM: omapl138_lcdk: Increase malloc pool before relocation
Adam Ford [Sun, 10 Nov 2019 14:01:32 +0000 (08:01 -0600)]
ARM: omapl138_lcdk: Increase malloc pool before relocation

Driver model requires a malloc pool to allocate memory before
relocations to operate serial and some other devices.  This patch
increases the pool size to 2K.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agoARM: omapl138_lcdk: Separate BSS in SPL
Adam Ford [Sun, 10 Nov 2019 14:01:31 +0000 (08:01 -0600)]
ARM: omapl138_lcdk: Separate BSS in SPL

In preparation to use full device tree support, SPL can separate
BSS from text region.

This patch enables SPL_SEPARATE_BSS.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
4 years agocmd: pxe: Fix bootm argument count
Abhishek Shah [Tue, 19 Nov 2019 00:41:49 +0000 (16:41 -0800)]
cmd: pxe: Fix bootm argument count

pxe command parses the init ramfs address(through initrd lable in
pxe config file), but is not passing it to bootm command as argument
as bootm_argc count is not increased.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoarmv7m: cache: add invalidate_icache_all() stub
Giulio Benetti [Tue, 26 Nov 2019 11:19:27 +0000 (12:19 +0100)]
armv7m: cache: add invalidate_icache_all() stub

This commit:
https://gitlab.denx.de/u-boot/u-boot/commit/d409c962169bd293e39386d0ddfa64d5222a3be4
causes build failure with ICACHE enabled. This is due to missing
invalidate_icache_all() stub. Let's add empty invalidate_icache_all() in
the case where ICACHE is not enabled.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
4 years agoMAINTAINERS: Add info for bcm283x
Matthias Brugger [Wed, 27 Nov 2019 16:41:06 +0000 (17:41 +0100)]
MAINTAINERS: Add info for bcm283x

The bcm283x has grown in files, which was not reflected in the
MAINTAINERS file. Fix this by adding the missing entries.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
4 years agoblk: Make use of CONFIG_HAVE_BLOCK_DEVICE more
Tom Rini [Mon, 2 Dec 2019 15:52:31 +0000 (10:52 -0500)]
blk: Make use of CONFIG_HAVE_BLOCK_DEVICE more

When we do not have CONFIG_BLK (or SPL/TPL) enabled there are very few
cases where we need the blk_legacy code linked in. To catch these, build
when we have CONFIG_HAVE_BLOCK_DEVICE set.  In addition, we only need
cmd/blk_common.o to be linked in when we have CONFIG_HAVE_BLOCK_DEVICE
set, so make use of that directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agomtd: mtdcore: Drop unused mtd_table
Tom Rini [Wed, 27 Nov 2019 01:41:00 +0000 (20:41 -0500)]
mtd: mtdcore: Drop unused mtd_table

The array 'mtd_table' is unused in the code.  Remove this as gcc doesn't
always discard unused global variables.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agopci: Only link pci_rom.o in some cases
Tom Rini [Wed, 27 Nov 2019 01:40:59 +0000 (20:40 -0500)]
pci: Only link pci_rom.o in some cases

The content of pci_rom.c is only used in a few cases.  Only build and
link in these cases to avoid a global variable as gcc doesn't always
discard those when they are unused.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_SYS_CORTINA_FW_IN_MMC et al to Kconfig
Tom Rini [Tue, 26 Nov 2019 22:32:43 +0000 (17:32 -0500)]
Convert CONFIG_SYS_CORTINA_FW_IN_MMC et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CORTINA_FW_IN_MMC
   CONFIG_SYS_CORTINA_FW_IN_NAND
   CONFIG_SYS_CORTINA_FW_IN_NOR
   CONFIG_SYS_CORTINA_FW_IN_REMOTE
   CONFIG_SYS_CORTINA_FW_IN_SPIFLASH

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoConvert CONFIG_PHY_CORTINA to Kconfig
Tom Rini [Tue, 26 Nov 2019 22:32:42 +0000 (17:32 -0500)]
Convert CONFIG_PHY_CORTINA to Kconfig

This converts the following to Kconfig:
   CONFIG_PHY_CORTINA

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agobootm: vxworks: Support Linux compatible standard DTB for ARM and PPC
Lihua Zhao [Fri, 15 Nov 2019 08:21:17 +0000 (00:21 -0800)]
bootm: vxworks: Support Linux compatible standard DTB for ARM and PPC

Enhance do_bootm_vxworks() to support Linux compatible standard DTB
for ARM and PPC, when the least significant bit of flags in VxWorks
bootargs is set. Otherwise it falls back to the existing bootm flow
which is now legacy.

Signed-off-by: Lihua Zhao <lihua.zhao@windriver.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agotbs2910: Disable VxWorks image booting support
Tom Rini [Wed, 27 Nov 2019 14:23:05 +0000 (09:23 -0500)]
tbs2910: Disable VxWorks image booting support

There are currently no known users of this functionality on this
platform, disable it to prepare for additional VxWorks functionality
that would cause this platform to fail to link.

Cc: Soeren Moch <smoch@web.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Soeren Moch <smoch@web.de>
4 years agocosmetic: Fix spelling and whitespace errors
Thomas Hebb [Thu, 14 Nov 2019 02:18:03 +0000 (18:18 -0800)]
cosmetic: Fix spelling and whitespace errors

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
4 years agoMakefile: add Rockchip idbloader.img to CLEAN_FILES
Thomas Hebb [Sun, 10 Nov 2019 16:25:10 +0000 (08:25 -0800)]
Makefile: add Rockchip idbloader.img to CLEAN_FILES

This file is generated in the root during Rockchip builds and so should
be cleaned up.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
4 years agoMakefile: consolidate hardcoded lists of files to clean
Thomas Hebb [Sun, 10 Nov 2019 16:25:09 +0000 (08:25 -0800)]
Makefile: consolidate hardcoded lists of files to clean

Currently, we have two places where we list files that should always be
cleaned if they exist. One, the CLEAN_FILES variable, is from the Linux
build system and is the proper place to list files.

The other, a set of extra arguments passed in the xargs template used to
remove files with certain extensions, was introduced by 8f06f0cee3d3
("Makefile: clean image.map") and is clearly wrong: by extending the
xargs template, we attempt to remove the files once for each batch of
arguments that xargs produces and we reduce the number of files from
stdin that xargs can include in each of its rm commands.

To fix this, put all hardcoded files into CLEAN_FILES.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
4 years agoMakefile: don't try to construct CLEAN_FILES based on config
Thomas Hebb [Sun, 10 Nov 2019 16:25:08 +0000 (08:25 -0800)]
Makefile: don't try to construct CLEAN_FILES based on config

All of the clean targets (clean, dist-clean, mrproper) are run without
loading a configuration. That means that any conditional modification of
CLEAN_FILES will either always apply or never apply and so shouldn't be
in a conditional in the first place.

Since CLEAN_FILES is allowed to list nonexistent files, just add
everything to it unconditionally to fix the issue.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
4 years agoKconfig: make TPL_DM_SERIAL depend on TPL_DM
Thomas Hebb [Sun, 10 Nov 2019 16:23:55 +0000 (08:23 -0800)]
Kconfig: make TPL_DM_SERIAL depend on TPL_DM

This missing dependency seems like an oversight, since all other
TPL_DM_* options have it.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
4 years agoKconfig: disambiguate config names for tiny printf
Thomas Hebb [Sun, 10 Nov 2019 16:23:53 +0000 (08:23 -0800)]
Kconfig: disambiguate config names for tiny printf

27084c03d36a ("spl: Allow tiny printf() to be controlled in SPL and
TPL") split this option in two for TPL and SPL, but didn't change the
Kconfig names, making them hard to set quickly.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
4 years agoPrepare v2020.01-rc4
Tom Rini [Tue, 3 Dec 2019 03:09:27 +0000 (22:09 -0500)]
Prepare v2020.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge branch '2019-12-02-master-imports'
Tom Rini [Tue, 3 Dec 2019 03:05:35 +0000 (22:05 -0500)]
Merge branch '2019-12-02-master-imports'

- A large series of clean-ups to reduce common.h contents

4 years agocommon: Move old EEPROM functions into a new header
Simon Glass [Thu, 14 Nov 2019 19:57:50 +0000 (12:57 -0700)]
common: Move old EEPROM functions into a new header

These functions do not use driver model but are still used. Move them to a
new eeprom.h header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Drop get_endaddr()
Simon Glass [Thu, 14 Nov 2019 19:57:49 +0000 (12:57 -0700)]
common: Drop get_endaddr()

This is not used in U-Boot. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move trap_init() out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:48 +0000 (12:57 -0700)]
common: Move trap_init() out of common.h

Move this function into the init.h header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
4 years agocommon: Move pci_init_board() out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:47 +0000 (12:57 -0700)]
common: Move pci_init_board() out of common.h

This function can be dropped when all boards use driver model for PCI. For
now, move it into init.h with a comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move some board functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:46 +0000 (12:57 -0700)]
common: Move some board functions out of common.h

A number of board function belong in init.h with the others. Move them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move board_get_usable_ram_top() out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:45 +0000 (12:57 -0700)]
common: Move board_get_usable_ram_top() out of common.h

Move this function into init.h which seems to be designed for this sort
of thing. Also update the header to declare struct global_data so that it
can be included without global_data.h being needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Drop board_show_dram()
Simon Glass [Thu, 14 Nov 2019 19:57:44 +0000 (12:57 -0700)]
common: Drop board_show_dram()

This function is not defined by any boards so the feature is not used.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move command functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:43 +0000 (12:57 -0700)]
common: Move command functions out of common.h

Move these functions into the command.h header file which is a better fit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move enable/disable_interrupts out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:42 +0000 (12:57 -0700)]
common: Move enable/disable_interrupts out of common.h

Move these two functions into the irq_funcs.h header file. Also move
interrupt_handler_t as this is used by the irq_install_handler() function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move interrupt functions into a new header
Simon Glass [Thu, 14 Nov 2019 19:57:41 +0000 (12:57 -0700)]
common: Move interrupt functions into a new header

These functions do not use driver model but are fairly widely used in
U-Boot. But it is not clear that they will use driver model anytime soon,
so we don't want to label them as 'legacy'.

Move them to a new irq_func.h header file. Avoid the name 'irq.h' since it
is widely used in U-Boot already.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoarm: powerpc: Tidy up code style for interrupt functions
Simon Glass [Thu, 14 Nov 2019 19:57:40 +0000 (12:57 -0700)]
arm: powerpc: Tidy up code style for interrupt functions

Remove the unwanted space before the bracket.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move ARM cache operations out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:39 +0000 (12:57 -0700)]
common: Move ARM cache operations out of common.h

These functions are CPU-related and do not use driver model. Move them to
cpu_func.h

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Drop checkicache() and checkdcache()
Simon Glass [Thu, 14 Nov 2019 19:57:38 +0000 (12:57 -0700)]
common: Drop checkicache() and checkdcache()

These are used by only one arch and only within a single file. Drop the
declarations from the common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move some cache and MMU functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:37 +0000 (12:57 -0700)]
common: Move some cache and MMU functions out of common.h

These functions belong in cpu_func.h. Another option would be cache.h
but that code uses driver model and we have not moved these cache
functions to use driver model. Since they are CPU-related it seems
reasonable to put them here.

Move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoarm: powerpc: Tidy up code style for cache functions
Simon Glass [Thu, 14 Nov 2019 19:57:36 +0000 (12:57 -0700)]
arm: powerpc: Tidy up code style for cache functions

Remove the unwanted space before the bracket.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move some SMP functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:35 +0000 (12:57 -0700)]
common: Move some SMP functions out of common.h

These functions belong in cpu_func.h so move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move checkcpu() out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:34 +0000 (12:57 -0700)]
common: Move checkcpu() out of common.h

This function belongs in cpu_func.h so move it over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Drop cpu_init()
Simon Glass [Thu, 14 Nov 2019 19:57:33 +0000 (12:57 -0700)]
common: Drop cpu_init()

This function is not defined anywhere. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move some CPU functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:32 +0000 (12:57 -0700)]
common: Move some CPU functions out of common.h

These functions belong in cpu_func.h since they do not use driver model.
Move them over. Don't bother adding comments since these functions should
be deleted.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move mii_init() function out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:31 +0000 (12:57 -0700)]
common: Move mii_init() function out of common.h

This function belongs in mii.h so move it over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move get_ticks() function out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:30 +0000 (12:57 -0700)]
common: Move get_ticks() function out of common.h

This function belongs in time.h so move it over and add a comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move timer_get_us() function out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:29 +0000 (12:57 -0700)]
common: Move timer_get_us() function out of common.h

This function belongs in time.h so move it over and update the comment
style.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoarm: pxa: Drop pxa_wait_ticks()
Simon Glass [Thu, 14 Nov 2019 19:57:28 +0000 (12:57 -0700)]
arm: pxa: Drop pxa_wait_ticks()

This function has a similar name to the common wait_ticks(). It is only
used in one place and seems small enough to drop.

Inline it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move wait_ticks functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:27 +0000 (12:57 -0700)]
common: Move wait_ticks functions out of common.h

This function belongs in time.h so move it over and add a comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move some time functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:26 +0000 (12:57 -0700)]
common: Move some time functions out of common.h

These functions belong in time.h so move them over and add comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Add a new lz4.h header file
Simon Glass [Thu, 14 Nov 2019 19:57:25 +0000 (12:57 -0700)]
common: Add a new lz4.h header file

Add a header file to house the lz4 compression function. Add a comment
while we are here, since it not even clear from the name what the function
actuall does.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move serial functions out of common.h
Simon Glass [Thu, 14 Nov 2019 19:57:24 +0000 (12:57 -0700)]
common: Move serial functions out of common.h

These functions belong in serial.h so move them over.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move serial_printf() to the serial header
Simon Glass [Thu, 14 Nov 2019 19:57:23 +0000 (12:57 -0700)]
common: Move serial_printf() to the serial header

Move this function header to serial.h since this function is clearly
related to serial. The function itself stays in console.c since we don't
have a single serial file. DM and non-DM each has a separate file so we
would have to either create a new common serial file, or repeat the
function in both serial.c and serial-uclass.c, neither of which seem
worthwhile.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoserial: usb: Correct the usbtty_...() prototypes
Simon Glass [Thu, 14 Nov 2019 19:57:22 +0000 (12:57 -0700)]
serial: usb: Correct the usbtty_...() prototypes

The function declarations in serial.h are not in sync with what is
currently used in usbtty. Fix this by updating the header and including
it, to help catch future such problems.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move env_get_ip() to net.h
Simon Glass [Thu, 14 Nov 2019 19:57:21 +0000 (12:57 -0700)]
common: Move env_get_ip() to net.h

This function relates to networking, so move it out of the common.h
header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
4 years agoMove strtomhz() to vsprintf.h
Simon Glass [Thu, 14 Nov 2019 19:57:20 +0000 (12:57 -0700)]
Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move sorting functions to their own header file
Simon Glass [Thu, 14 Nov 2019 19:57:19 +0000 (12:57 -0700)]
common: Move sorting functions to their own header file

These don't need to be in common.h so move them out into a new header.
Also add some missing comments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move bootcount functions to their header file
Simon Glass [Thu, 14 Nov 2019 19:57:18 +0000 (12:57 -0700)]
common: Move bootcount functions to their header file

These don't need to be in common.h so move them out.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agospl: bootcount: Move code out of header file
Simon Glass [Thu, 14 Nov 2019 19:57:17 +0000 (12:57 -0700)]
spl: bootcount: Move code out of header file

It is not good practice to write code in a header file. If it is included
multiple times then the code can cause duplicate functions.

Move the bootcount_store() and bootcount_load() functions into SPL.

Note: bootcount is a bit strange in that it uses driver model but does not
define proper drivers. This should be fixed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocrc32: Use the crc.h header for crc functions
Simon Glass [Thu, 14 Nov 2019 19:57:16 +0000 (12:57 -0700)]
crc32: Use the crc.h header for crc functions

Drop inclusion of crc.h in common.h and use the correct header directly
instead.

With this we can drop the conflicting definition in fw_env.h and rely on
the crc.h header, which is already included.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocrc: Fix code style with crc functions
Simon Glass [Thu, 14 Nov 2019 19:57:15 +0000 (12:57 -0700)]
crc: Fix code style with crc functions

Some of these have a space before the bracket. Drop it to fix the style.
Add some missing function comments while here.

Note that u32 and u8 cannot be used here since crc.h is included on the
host side.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Drop linux/crc8.h
Simon Glass [Thu, 14 Nov 2019 19:57:14 +0000 (12:57 -0700)]
common: Drop linux/crc8.h

We have an existing U-Boot header for the one function that this defines.
Use that instead of the linux/ one. Move over the nice comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Move random-number functions into their own header
Simon Glass [Thu, 14 Nov 2019 19:57:13 +0000 (12:57 -0700)]
common: Move random-number functions into their own header

Create a new rand.h header file and move functions into it, to reduce
the size of common.h

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agostatus_led: Tidy up the code style
Simon Glass [Thu, 14 Nov 2019 19:57:12 +0000 (12:57 -0700)]
status_led: Tidy up the code style

There are a few whitespace problems with this code. Tidy them up.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agocommon: Drop global inclusion of status_led.h
Simon Glass [Thu, 14 Nov 2019 19:57:11 +0000 (12:57 -0700)]
common: Drop global inclusion of status_led.h

This is only used by a few files so it should not be in the common header.
Move it out.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoDrop CONFIG_SHOW_ACTIVITY
Simon Glass [Thu, 14 Nov 2019 19:57:10 +0000 (12:57 -0700)]
Drop CONFIG_SHOW_ACTIVITY

This feature is not enabled by any board. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agocommon: Move older CPU functions to their own header
Simon Glass [Thu, 14 Nov 2019 19:57:09 +0000 (12:57 -0700)]
common: Move older CPU functions to their own header

These should be moved to driver model, but in the meantime, move them
out of the common header to help reduce its size.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agodm: serial: Handle "stdout-path" with ":options" correctly
Bin Meng [Mon, 25 Nov 2019 13:52:36 +0000 (05:52 -0800)]
dm: serial: Handle "stdout-path" with ":options" correctly

With commit f0921f5098d8 ("fdt: Sync up to the latest libfdt"),
SiFive Unleashed board does not boot any more. This was due to
the U-Boot local changes commit 77d7fff8cec2 ("fdt: Fix handling
of paths with options in them") to libfdt/fdt_ro.c was dropped
during the libfdt upgrade.

>From the history [1] it was mentioned that the U-Boot changes
commit 77d7fff8cec2 ("fdt: Fix handling of paths with options in
them") was rejected by libfdt upstream, hence we need find another
way to fix the things.

This commit uses another method, by updating serial_check_stdout()
directly to handle the situation of "stdout-path" with ":options".
A simpler way is to change the logic in fdtdec_get_chosen_node()
to do similar thing, but I feel that not every property in chosen
node may have the option in them, hence it would make more sense
to do the special handling in serial_check_stdout() directly.

[1]: http://patchwork.ozlabs.org/patch/462756/

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Tom Rini [Mon, 2 Dec 2019 15:53:34 +0000 (10:53 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq

- fsl-qoriq : Minor bug fixes and updates on lx2160a, ls1028a, ls1012a,
  ls1043aqds platforms

4 years agoMerge branch 'master' of git://git.denx.de/u-boot-mips
Tom Rini [Mon, 2 Dec 2019 15:53:07 +0000 (10:53 -0500)]
Merge branch 'master' of git://git.denx.de/u-boot-mips

- MIPS: remove Micronas VCT boards

4 years agoMIPS: remove Micronas VCT boards
Daniel Schwierzeck [Fri, 18 Oct 2019 13:13:26 +0000 (15:13 +0200)]
MIPS: remove Micronas VCT boards

The deadline for migration to CONFIG_DM is v2020.01. The VCT
baords would need an almost complete rewrite of all drivers to
support driver model.

Unless someone has access to the hardware and volunteers to do the migration,
the board should be scheduled for removal.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Stefan Roese <sr@denx.de>
4 years agoconfigs: ls1028a: enable CMD_DM
Alex Marginean [Fri, 22 Nov 2019 09:58:05 +0000 (11:58 +0200)]
configs: ls1028a: enable CMD_DM

Since at least some of the drivers relevant to LS1028A are now following
DM, it's useful to have dm command enabled by default.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoboard: fsl: lx2160a: Fix the typo in board_fix_fdt
Pankaj Bansal [Wed, 20 Nov 2019 09:12:47 +0000 (09:12 +0000)]
board: fsl: lx2160a: Fix the typo in board_fix_fdt

Fix a typo that caused incorrect reg-name for pcie node in lx2160a rev2.

Fixes: 5d535aa40b ("board: fsl: lx2160a: implement board_fix_fdt")

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs/lx2160a: Add CONFIG_ENV_SECT_SIZE in defconfig
Priyanka Jain [Tue, 26 Nov 2019 06:45:10 +0000 (06:45 +0000)]
configs/lx2160a: Add CONFIG_ENV_SECT_SIZE in defconfig

Define CONFIG_ENV_SECT_SIZE as 0x20000 in lx2160a related defconfigs:
lx2160ardb_tfa_defconfig, lx2160ardb_tfa_SECURE_BOOT_defconfig,
lx2160aqds_tfa_defconfig, lx2160aqds_tfa_SECURE_BOOT_defconfig

Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoMerge git://git.denx.de/u-boot-socfpga
Tom Rini [Thu, 28 Nov 2019 12:34:41 +0000 (07:34 -0500)]
Merge git://git.denx.de/u-boot-socfpga

- Assorted Gen5 fixes

4 years agoMerge git://git.denx.de/u-boot-usb
Tom Rini [Thu, 28 Nov 2019 12:34:21 +0000 (07:34 -0500)]
Merge git://git.denx.de/u-boot-usb

- USB keyboard improvements

4 years agoMerge tag 'mmc-11-27-2019' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Thu, 28 Nov 2019 12:33:45 +0000 (07:33 -0500)]
Merge tag 'mmc-11-27-2019' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc

- fsl_esdhc update and some cleanup in ls1021a/mpc83xx code
- mmc tmio sdhi update for hs400

4 years agoMerge tag 'u-boot-stm32-20191126' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Thu, 28 Nov 2019 12:33:16 +0000 (07:33 -0500)]
Merge tag 'u-boot-stm32-20191126' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- Solve warning for stih410-b2260
- Device tree alignment on v5.4-rc4 for all stm32 boards
- Correct the eMMC pin configuration on stm32mp157c-ev1
- Add DFU and SPI-NAND support for stm32mp1 board

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx
Tom Rini [Thu, 28 Nov 2019 12:32:44 +0000 (07:32 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mpc85xx

- powerpc: Fix DM_MMC related build warnings by adding eSDHC device
  module support for T4240RDB, T2080RDB, T1042D4RDB, T1024RDB, P5040DS,
  P4080DS, P3041DS, P2041RDB, P2020RDB, P1020RDB platforms

4 years agommc: tmio: sdhi: Add calibration tables
Marek Vasut [Sat, 23 Nov 2019 12:36:25 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Add calibration tables

Instead of using single fixed value for the calibration offset,
add tables which dynamically adjust this per calibration code
from the SCC.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Skip bad taps
Marek Vasut [Sat, 23 Nov 2019 12:36:24 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Skip bad taps

Some of the tuning taps produce suboptimal results. Add code
which skips those "bad" taps.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Add SCC error checking
Marek Vasut [Sat, 23 Nov 2019 12:36:23 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Add SCC error checking

Check SCC for errors after check command if applicable and
optionally adjust the bus skew settings accordingly.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Disable auto-retuning in HS400
Marek Vasut [Sat, 23 Nov 2019 12:36:22 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Disable auto-retuning in HS400

Disable the auto-retuning in HS400 mode in favor of manual calibration.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Adjust HS400 calibration offsets
Marek Vasut [Sat, 23 Nov 2019 12:36:21 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Adjust HS400 calibration offsets

Adjust the TMPPORT3 offsets according to the latest information
from the chip vendor.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Adjust DT2FF settings for HS400 mode
Marek Vasut [Sat, 23 Nov 2019 12:36:20 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Adjust DT2FF settings for HS400 mode

Adjust the DT2FF offsets in HS400 according to latest information
from the chip vendor.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Use 4 tuning taps on M3W up to ES1.2
Marek Vasut [Sat, 23 Nov 2019 12:36:19 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Use 4 tuning taps on M3W up to ES1.2

The M3W up to ES1.2 uses 4 tuning taps for HS400, make it so.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Track SMPCMP valu in private data
Marek Vasut [Sat, 23 Nov 2019 12:36:18 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Track SMPCMP valu in private data

Retain the SMPCMP value from last calibration in private data.
This will be later used for skipping bad taps.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
4 years agommc: tmio: sdhi: Track current tap number in private data
Marek Vasut [Sat, 23 Nov 2019 12:36:17 +0000 (13:36 +0100)]
mmc: tmio: sdhi: Track current tap number in private data

Retain the tap number from last calibration in private data. This
will be later used for SCC error checking after each command.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>