Commit graph

80049 commits

Author SHA1 Message Date
Heinrich Schuchardt
89ab1e2817 btrfs: simplify lookup_data_extent()
After returning if ret <= 0 we know that ret > 0. No need to check it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain>
2022-06-06 17:47:17 -04:00
Tom Rini
2e2e784de0 zlib: Port fix for CVE-2018-25032 to U-Boot
While our copy of zlib is missing upstream commit 263b1a05b04e ("Allow
deflatePrime() to insert bits in the middle of a stream.") we do have
Z_FIXED support, and so the majority of the code changes in 5c44459c3b28
("Fix a bug that can crash deflate on some input when using Z_FIXED.")
apply here directly and cleanly.  As this has been assigned a CVE, lets
go and apply these changes.

Link: 5c44459c3b
Reported-by: "Gan, Yau Wai" <yau.wai.gan@intel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 17:47:17 -04:00
Tom Rini
8a1ab5e811 misc: Correct Kconfig dependencies for a number of options
We have many cases of SPL (or TPL or VPL) drivers that don't depend on
SPL_MISC (and so on) but rather just MISC.

Cc: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2022-06-06 17:47:17 -04:00
Chris Packham
92c1df98b3 doc: regulator: Add regulator-force-boot-off binding
The actual support was added in commit fec8c900c8 ("power: regulator:
Add support for regulator-force-boot-off"), update the docs to include
this.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2022-06-06 17:47:16 -04:00
Ovidiu Panait
7f0836a110 cmd: dm: migrate dm command to use U_BOOT_CMD_WITH_SUBCMDS()
Migrate dm command to use U_BOOT_CMD_WITH_SUBCMDS() helper macro, to reduce
duplicated code. We can also drop the CONFIG_NEEDS_MANUAL_RELOC exception,
as the command list is updated post relocation in board_r.c initcall
initr_manual_reloc_cmdtable().

Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
2022-06-06 17:47:16 -04:00
Heinrich Schuchardt
c5ef202557 dm: fix DM_EVENT dependencies
CONFIG_DM_EVENT without CONFIG_EVENT is non-functional.
Let CONFIG_DM_EVENT depend on CONFIG_EVENT.

Remove superfluous stub in include/event.h.

Fixes: 5b896ed585 ("event: Add events for device probe/remove")
Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-06-06 17:47:16 -04:00
Peng Fan
3800b318c5 boot: image-pre-load: drop unused CONFIG_SYS_BOOTM_LEN
CONFIG_SYS_BOOTM_LEN is not used in this file, drop it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2022-06-06 17:47:16 -04:00
Tom Rini
41e47b420d configs: Resync with savedefconfig
Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:13:29 -04:00
Tom Rini
8bbbd63373 Merge branch '2022-06-06-finish-SPL-Kconfig-migration' into next
- Bring in a number of series of patches that migrate all remaining
  CONFIG_SPL symbols to Kconfig, remove some dead code that this
  uncovered and then start to tighten the dependencies in Kconfig now
  that everything is migrated and these relationships can be clearly
  expressed.
2022-06-06 12:09:41 -04:00
Tom Rini
4151f4f822 spl: Rework and tighten some dependencies
- In a few places, add missing "depends on" that can be implied from the
  option name (i.e. SPL_DM_xxx depends on SPL_DM).
- Make less use of "if SPL_xxx ... endif" clauses as most of the time
  this reads better as depends on.  In the case of UBI however, move it
  all to a sub-menu.
- Rework SPL_NO_CPU_SUPPORT as it's very specific to the
  non-SPL_FRAMEWORK implementation used on those platforms, and a
  tangent to how CONFIG_SPL_START_S_PATH was used.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
ab0c5f1a59 spl: Rework Kconfig to be more menu driven
Make it so that all of SPL, TPL and VPL are proper menus hidden behind a
gating question.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
ba787bb458 spl: Move all VPL, TPL and PowerPC specific CONFIG options to separate files
- Move all PowerPC (and some shared with Layerscape) options to
  common/spl/Kconfig.nxp
- Move all other TPL related options to common/spl/Kconfig.tpl
- Move all VPL related options to common/spl/Kconfig.vpl

This makes the whole of common/spl/Kconfig slightly more readable.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Chris Packham
3ff2aa6d04 arm: mvebu: Remove CONFIG_SPL_BOOT_DEVICE
CONFIG_SPL_BOOT_DEVICE was made obsolete by
CONFIG_MVEBU_SPL_BOOT_DEVICE_{SPI,MMC,SATA,UART}.
CONFIG_MVEBU_SPL_BOOT_DEVICE_SPI is the default so existing users of
CONFIG_SPL_BOOT_DEVICE can simply have the option removed.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-06-06 12:09:29 -04:00
Chris Packham
b19512f1cf Convert CONFIG_FIXED_SDHCI_ALIGNED_BUFFER to Kconfig
CONFIG_FIXED_SDHCI_ALIGNED_BUFFER is needed on some Marvell SoCs when
booting from MMC. All existing usages of this have the same value so
make this the default and have the Kconfig option depend on SPL &&
MVEBU_SPL_BOOT_DEVICE_MMC.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-06-06 12:09:29 -04:00
Chris Packham
bfbd62f691 arm: mvebu: Use MVEBU_SPL_BOOT_DEVICE instead of SPL_BOOT_DEVICE
Update the way KWB_CFG_SEC_BOOT_DEV is determined to use
CONFIG_MVEBU_SPL_BOOT_DEVICE_{SPI,MMC} instead of
CONFIG_SPL_BOOT_DEVICE.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2022-06-06 12:09:29 -04:00
Tom Rini
c31811848e riotboard, syzygy_hub: Disable SPL_FALCON_BOOT_MMCSD
Looking at the git history and values used for the raw kernel/args
location, it's clear these platforms only ever did Falcon Mode via
filesystem images and not raw MMC/SD locations.  Disable
CONFIG_SPL_FALCON_BOOT_MMCSD.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
103d1aecb0 Convert CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR et al to Kconfig
This converts the following to Kconfig:
   CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR
   CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
5fc1d58176 Convert CONFIG_SYS_NAND_SPL_KERNEL_OFFS to Kconfig
This converts the following to Kconfig:
   CONFIG_SYS_NAND_SPL_KERNEL_OFFS

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
dc22afb975 spl: Remove CONFIG_SPL_START_S_PATH and rework the logic behind it
In some cases, when we don't use CONFIG_SPL_FRAMEWORK nor are we on
PowerPC using their specific SPL/TPL framework, we need to specify the
start.S file to use for these typically very constrained systems.  Do
this within the Makefile logic, rather than introducing a string-based
CONFIG option, as this would get slightly complex to do in Kconfig for a
very limited number of users.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
c8836dbb01 Drop CONFIG_SPL_SIZE
We do not reference CONFIG_SPL_SIZE in the code, remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
14b4817513 ax25-ae350: Move CONFIG_SYS_FDT_BASE to Kconfig
The address where the device tree will be passed in to U-Boot at is now
moved to the Kconfig file.  If this is user configurable, it needs to be
exposed rather than hidden, and should probably be renamed as well.

Reviewed-by: Rick Chen <rick@andestech.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
b4b9a00ed5 Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig
This converts the following to Kconfig:
   CONFIG_SYS_SPL_ARGS_ADDR

In doing so, we also consistently use this variable for SPL_OS_BOOT and
not CONFIG_SYS_FDT_BASE in some cases.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
a62b7f0c24 Convert CONFIG_SPL_TARGET to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_TARGET

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
cad7f4bab8 Remove CONFIG_SPL_STACK_SIZE
This is not used anywhere, drop it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
0bf940c235 Drop CONFIG_SPL_SPI_FLASH_MINIMAL
There are no users of CONFIG_SPL_SPI_FLASH_MINIMAL only platforms
defining it, drop it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
7f2c91e5d8 Convert CONFIG_SPL_GD_ADDR to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_GD_ADDR

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
cfb5dd3585 etamin: Remove CONFIG_SPL_CMT defines
These are presumably private to non-upstream code, remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:29 -04:00
Tom Rini
c4b8bc48b6 Remove CONFIG_SYS_SPL_LEN largely
This is mostly unused.  In the case where it is currently used, it means
the same as CONFIG_SPL_PAD_TO, which is already set for the platform.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
10f6e4dc3a Convert CONFIG_SYS_SPL_MALLOC_SIZE et al to Kconfig
This converts the following to Kconfig:
   CONFIG_SYS_SPL_MALLOC_SIZE
   CONFIG_SYS_SPL_MALLOC_START

We introduce a default value here as well, and CONFIG_SYS_SPL_MALLOC to
control if we have a malloc pool or not.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
6600b355c7 Convert CONFIG_SPL_BSS_START_ADDR to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_BSS_START_ADDR

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
55cf860ba7 Convert CONFIG_SPL_RELOC_TEXT_BASE et al to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_RELOC_TEXT_BASE
   CONFIG_SPL_RELOC_STACK
   CONFIG_SPL_RELOC_MALLOC_ADDR
   CONFIG_SPL_RELOC_MALLOC_SIZE

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
90e1fd0910 Convert CONFIG_TPL_NAND_INIT to Kconfig
This converts the following to Kconfig:
   CONFIG_TPL_NAND_INIT

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
8b83b53a8d imx7: Update CONFIG_SPL_STACK defaults in Kconfig
Update the Kconfig entry to have the correct defaults for i.MX7
platforms, and move the existing large comment from imx7_spl.h to
doc/imx/common/imx7.txt so that it's not lost.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
23780398b5 imx6: Update CONFIG_SPL_STACK defaults in Kconfig
Update the Kconfig entry to have the correct defaults for i.MX6
platforms, and move the existing large comment from imx6_spl.h to
doc/imx/common/imx6.txt so that it's not lost.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:28 -04:00
Tom Rini
f113d7d303 Convert CONFIG_SPL_STACK to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_STACK

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:27 -04:00
Tom Rini
eaf6ea6a1d Migrate CUSTOM_SYS_INIT_SP_ADDR to Kconfig using system-constants.h
- Make all users of CUSTOM_SYS_INIT_SP_ADDR reference SYS_INIT_SP_ADDR
- Introduce HAS_CUSTOM_SYS_INIT_SP_ADDR to allow for setting the stack
  pointer directly, otherwise we use the common calculation.
- On some platforms that were using the standard calculation but did not
  set CONFIG_SYS_INIT_RAM_SIZE / CONFIG_SYS_INIT_RAM_ADDR, set them.
- On a small number of platforms that were not subtracting
  GENERATED_GBL_DATA_SIZE do so now via the standard calculation.
- CONFIG_SYS_INIT_SP_OFFSET is now widely unused, so remove it from most
  board config header files.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:19 -04:00
Tom Rini
42c6141d37 Introduce include/system-constants.h
We have a number of CONFIG symbols today that are of the form:
SYM1 = CONST1 + CONST2
or other static math operations (shifts, etc).  The issue is that by
moving these to Kconfig we no longer have the ability to calculate these
values, so they become less flexible and useful.  It's also the case
that sometimes a platform will just define SYM1 directly or perform a
slightly different set of calculations.  We introduce this header now to
have a place to start to handle these cases.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:13 -04:00
Tom Rini
be131adb8d stih410-b2260: Switch to using GENERATED_GBL_DATA_SIZE
We have GENERATED_GBL_DATA_SIZE to tell us how large the generated
global data is, so do not use a hard-coded value of 1024 for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:13 -04:00
Tom Rini
4c97c8cd42 powerpc: Switch to using CONFIG_SYS_INIT_SP_OFFSET from CONFIG_SYS_GBL_DATA_OFFSET
In the places where PowerPC references CONFIG_SYS_GBL_DATA_OFFSET it
does so as (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET).  And
it defines CONFIG_SYS_GBL_DATA_OFFSET in the same manner that other
architectures define CONFIG_SYS_INIT_SP_OFFSET. Other architectures
define CONFIG_SYS_INIT_SP_ADDR as (CONFIG_SYS_INIT_RAM_ADDR +
CONFIG_SYS_INIT_SP_OFFSET) typically.  Rename things within PowerPC for
consistency with other architectures.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
931bad1c72 mpc85xx: Switch to setting the initial stack pointer more clearly
Currently, since we know that in the combination of
CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET all of the "high"
bits are in CONFIG_SYS_INIT_RAM_ADDR and "low" bits are in
CONFIG_SYS_GBL_DATA_OFFSET we reference this separately in start.S, but
added together everywhere else.  For clarity consistency, reference the
combined value here instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
06ddcfc95a m68k: Stop using CONFIG_SYS_GBL_DATA_OFFSET
This value is only referenced by PowerPC code in a way other than
directly as CONFIG_SYS_INIT_SP_ADDR.  Switch to CONFIG_SYS_INIT_SP_ADDR
directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
68eed5bb1c arm: Stop using CONFIG_SYS_GBL_DATA_OFFSET
This value is only referenced by PowerPC code in a way other than
directly as CONFIG_SYS_INIT_SP_ADDR.  Switch to CONFIG_SYS_INIT_SP_ADDR
directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
85758d8aa1 arm: Use CONFIG_SPL_STACK or CONFIG_SYS_INIT_SP_ADDR directly.
In some cases, we define CONFIG_SYS_INIT_SP_ADDR differently for SPL or
full U-Boot.  This case should be making use of CONFIG_SPL_STACK, as
that's what that variable is for.  In a few other cases we define
CONFIG_SPL_STACK directly to CONFIG_SYS_INIT_SP_ADDR, but do not need to
as the code handles this correctly, normally.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
3b2979eefa mvebu: Use CONFIG_SPL_STACK + 4 directly for bootparam location
The definition of CONFIG_SPL_BOOTROM_SAVE is always a fixed
CONFIG_SPL_STACK + 4, while CONFIG_SPL_STACK is not constant.  This
change will make it clear where the location is still, once
CONFIG_SPL_STACK moves to Kconfig.

Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
3135ba642f arm: pxa: Remove CONFIG_CPU_PXA25X
There are no platforms that set this, remove the code.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
1cb7d77812 m68k: Remove dead code
There are no mcf5227x platforms, remove the CPU code.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
90f0819a31 Convert CONFIG_SPL_COMMON_INIT_DDR to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_COMMON_INIT_DDR

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
6074a536d5 ppc / layerscape: Clean up CONFIG_SYS_CCSR_DO_NOT_RELOCATE usage
A number of PowerPC platforms define this, for SPL.  To move this to
Kconfig, it needs to be CONFIG_SPL_SYS_CCSR_DO_NOT_RELOCATE, so use
CONFIG_IS_ENABLED() to check for usage.  A number of layerscape
platforms bring this logic from PowerPC, but only need a small part of
it, for the fman driver.  Remove their unused portion at least.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
66bda092cf Convert CONFIG_SPL_SYS_MALLOC_SIMPLE to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_SYS_MALLOC_SIMPLE

The problem here is that a few platforms have been doing:
#ifdef CONFIG_SPL_BUILD
#define CONFIG_SYS_MALLOC_SIMPLE
#endif

instead of defining CONFIG_SPL_SYS_MALLOC_SIMPLE directly.  Correct this
and update the documentation in a few places to match usage.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:12 -04:00
Tom Rini
9b5f9aeb3b Convert CONFIG_SPL_BSS_MAX_SIZE et al to Kconfig
This converts the following to Kconfig:
   CONFIG_SPL_BSS_MAX_SIZE
   CONFIG_SPL_MAX_FOOTPRINT

Note that the da850evm platforms were violating the "only use one" rule
here, and so now hard-code their BSS limit.

Signed-off-by: Tom Rini <trini@konsulko.com>
2022-06-06 12:09:10 -04:00