mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-03-16 23:07:00 +00:00
Merge branch '2023-05-11-CONFIG_IS_ENABLED-vs-IS_ENABLED-cleanups' into next
- Bring in some of the clean-ups to use IS_ENABLED rather than CONFIG_IS_ENABLED to make the code less error-prone.
This commit is contained in:
commit
eaa9efafff
11 changed files with 50 additions and 45 deletions
|
@ -54,7 +54,7 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
|
|||
ifneq ($(CONFIG_SPL_BUILD),y)
|
||||
obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
|
||||
endif
|
||||
obj-$(CONFIG_SATA) += sata.o
|
||||
obj-$(CONFIG_$(SPL_)SATA) += sata.o
|
||||
obj-$(CONFIG_IMX_HAB) += hab.o
|
||||
obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
|
||||
endif
|
||||
|
|
|
@ -97,7 +97,7 @@ static void qemu_chipset_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
#if !CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT)
|
||||
#if CONFIG_IS_ENABLED(X86_32BIT_INIT)
|
||||
int arch_cpu_init(void)
|
||||
{
|
||||
post_code(POST_CPU_INIT);
|
||||
|
|
|
@ -91,7 +91,7 @@ struct pmic *pfuze_common_init(unsigned char i2cbus)
|
|||
|
||||
return p;
|
||||
}
|
||||
#else
|
||||
#elif defined(CONFIG_DM_PMIC)
|
||||
int pfuze_mode_init(struct udevice *dev, u32 mode)
|
||||
{
|
||||
unsigned char offset, i, switch_num;
|
||||
|
|
|
@ -264,6 +264,7 @@ void board_preboot_os(void)
|
|||
gpio_direction_output(IMX_GPIO_NR(6, 0), 0);
|
||||
}
|
||||
|
||||
#if CONFIG_IS_ENABLED(OF_LIBFDT)
|
||||
int ft_board_setup(void *blob, struct bd_info *bd)
|
||||
{
|
||||
if (lvds_compat_string)
|
||||
|
@ -272,6 +273,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct display_info_t const displays[] = {
|
||||
{
|
||||
|
|
|
@ -275,9 +275,8 @@ int board_early_init_f(void)
|
|||
{
|
||||
setup_iomux_uart();
|
||||
|
||||
#ifdef CONFIG_SATA
|
||||
setup_sata();
|
||||
#endif
|
||||
if (CONFIG_IS_ENABLED(SATA))
|
||||
setup_sata();
|
||||
setup_fec();
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -352,9 +352,8 @@ static void setup_display(void)
|
|||
int board_early_init_f(void)
|
||||
{
|
||||
setup_iomux_uart();
|
||||
#ifdef CONFIG_SATA
|
||||
setup_sata();
|
||||
#endif
|
||||
if (CONFIG_IS_ENABLED(SATA))
|
||||
setup_sata();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
32
cmd/nvedit.c
32
cmd/nvedit.c
|
@ -43,28 +43,6 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#if defined(CONFIG_ENV_IS_IN_EEPROM) || \
|
||||
defined(CONFIG_ENV_IS_IN_FLASH) || \
|
||||
defined(CONFIG_ENV_IS_IN_MMC) || \
|
||||
defined(CONFIG_ENV_IS_IN_FAT) || \
|
||||
defined(CONFIG_ENV_IS_IN_EXT4) || \
|
||||
defined(CONFIG_ENV_IS_IN_NAND) || \
|
||||
defined(CONFIG_ENV_IS_IN_NVRAM) || \
|
||||
defined(CONFIG_ENV_IS_IN_ONENAND) || \
|
||||
defined(CONFIG_ENV_IS_IN_SPI_FLASH) || \
|
||||
defined(CONFIG_ENV_IS_IN_REMOTE) || \
|
||||
defined(CONFIG_ENV_IS_IN_UBI)
|
||||
|
||||
#define ENV_IS_IN_DEVICE
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(ENV_IS_IN_DEVICE) && \
|
||||
!defined(CONFIG_ENV_IS_NOWHERE)
|
||||
# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
|
||||
NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Maximum expected input data size for import command
|
||||
*/
|
||||
|
@ -596,7 +574,7 @@ static int do_env_edit(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||
}
|
||||
#endif /* CONFIG_CMD_EDITENV */
|
||||
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !IS_ENABLED(CONFIG_ENV_IS_DEFAULT)
|
||||
static int do_env_save(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||
char *const argv[])
|
||||
{
|
||||
|
@ -1105,7 +1083,7 @@ static int do_env_info(struct cmd_tbl *cmdtp, int flag,
|
|||
int eval_flags = 0;
|
||||
int eval_results = 0;
|
||||
bool quiet = false;
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !IS_ENABLED(CONFIG_ENV_IS_DEFAULT)
|
||||
enum env_location loc;
|
||||
#endif
|
||||
|
||||
|
@ -1148,7 +1126,7 @@ static int do_env_info(struct cmd_tbl *cmdtp, int flag,
|
|||
|
||||
/* evaluate whether environment can be persisted */
|
||||
if (eval_flags & ENV_INFO_IS_PERSISTED) {
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !IS_ENABLED(CONFIG_ENV_IS_DEFAULT)
|
||||
loc = env_get_location(ENVOP_SAVE, gd->env_load_prio);
|
||||
if (ENVL_NOWHERE != loc && ENVL_UNKNOWN != loc) {
|
||||
if (!quiet)
|
||||
|
@ -1229,7 +1207,7 @@ static struct cmd_tbl cmd_env_sub[] = {
|
|||
#if defined(CONFIG_CMD_RUN)
|
||||
U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !IS_ENABLED(CONFIG_ENV_IS_DEFAULT)
|
||||
U_BOOT_CMD_MKENT(save, 1, 0, do_env_save, "", ""),
|
||||
#if defined(CONFIG_CMD_ERASEENV)
|
||||
U_BOOT_CMD_MKENT(erase, 1, 0, do_env_erase, "", ""),
|
||||
|
@ -1320,7 +1298,7 @@ static char env_help_text[] =
|
|||
#if defined(CONFIG_CMD_RUN)
|
||||
"env run var [...] - run commands in an environment variable\n"
|
||||
#endif
|
||||
#if defined(CONFIG_CMD_SAVEENV) && defined(ENV_IS_IN_DEVICE)
|
||||
#if defined(CONFIG_CMD_SAVEENV) && !IS_ENABLED(CONFIG_ENV_IS_DEFAULT)
|
||||
"env save - save environment\n"
|
||||
#if defined(CONFIG_CMD_ERASEENV)
|
||||
"env erase - erase environment\n"
|
||||
|
|
17
env/Kconfig
vendored
17
env/Kconfig
vendored
|
@ -55,20 +55,23 @@ config ENV_MAX_ENTRIES
|
|||
be generous and should work in most cases. This setting can be used
|
||||
to tune behaviour; see lib/hashtable.c for details.
|
||||
|
||||
config ENV_IS_NOWHERE
|
||||
bool "Environment is not stored"
|
||||
default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
|
||||
config ENV_IS_DEFAULT
|
||||
def_bool y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
|
||||
!ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \
|
||||
!ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
|
||||
!ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
|
||||
!ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
|
||||
!ENV_IS_IN_UBI
|
||||
select ENV_IS_NOWHERE
|
||||
|
||||
config ENV_IS_NOWHERE
|
||||
bool "Environment is not stored"
|
||||
help
|
||||
Define this if you don't want to or can't have an environment stored
|
||||
Define this if you don't care whether or not an environment is stored
|
||||
on a storage medium. In this case the environment will still exist
|
||||
while U-Boot is running, but once U-Boot exits it will not be
|
||||
stored. U-Boot will therefore always start up with a default
|
||||
environment.
|
||||
while U-Boot is running, but once U-Boot exits it may not be
|
||||
stored. If no other ENV_IS_IN_ is defined, U-Boot will always start
|
||||
up with the default environment.
|
||||
|
||||
config ENV_IS_IN_EEPROM
|
||||
bool "Environment in EEPROM"
|
||||
|
|
|
@ -35,11 +35,15 @@
|
|||
#devtypel "_boot=" \
|
||||
BOOTENV_SHARED_BLKDEV_BODY(devtypel)
|
||||
|
||||
#define BOOTENV_DEV_BLKDEV_NONE(devtypeu, devtypel, instance)
|
||||
|
||||
#define BOOTENV_DEV_BLKDEV(devtypeu, devtypel, instance) \
|
||||
"bootcmd_" #devtypel #instance "=" \
|
||||
"devnum=" #instance "; " \
|
||||
"run " #devtypel "_boot\0"
|
||||
|
||||
#define BOOTENV_DEV_NAME_BLKDEV_NONE(devtypeu, devtypel, instance)
|
||||
|
||||
#define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \
|
||||
#devtypel #instance " "
|
||||
|
||||
|
@ -59,6 +63,10 @@
|
|||
#define BOOTENV_SHARED_MMC BOOTENV_SHARED_BLKDEV(mmc)
|
||||
#define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV
|
||||
#define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV
|
||||
#elif defined(CONFIG_SPL_BUILD)
|
||||
#define BOOTENV_SHARED_MMC
|
||||
#define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV_NONE
|
||||
#define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV_NONE
|
||||
#else
|
||||
#define BOOTENV_SHARED_MMC
|
||||
#define BOOTENV_DEV_MMC \
|
||||
|
@ -190,6 +198,10 @@
|
|||
#define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata)
|
||||
#define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV
|
||||
#define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV
|
||||
#elif defined(CONFIG_SPL_BUILD)
|
||||
#define BOOTENV_SHARED_SATA
|
||||
#define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV_NONE
|
||||
#define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV_NONE
|
||||
#else
|
||||
#define BOOTENV_SHARED_SATA
|
||||
#define BOOTENV_DEV_SATA \
|
||||
|
@ -293,6 +305,11 @@
|
|||
BOOTENV_SHARED_BLKDEV_BODY(usb)
|
||||
#define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV
|
||||
#define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV
|
||||
#elif defined(CONFIG_SPL_BUILD)
|
||||
#define BOOTENV_RUN_NET_USB_START
|
||||
#define BOOTENV_SHARED_USB
|
||||
#define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV_NONE
|
||||
#define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV_NONE
|
||||
#else
|
||||
#define BOOTENV_RUN_NET_USB_START
|
||||
#define BOOTENV_SHARED_USB
|
||||
|
@ -395,6 +412,9 @@
|
|||
"\0"
|
||||
#define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \
|
||||
"dhcp "
|
||||
#elif defined(CONFIG_SPL_BUILD)
|
||||
#define BOOTENV_DEV_DHCP BOOTENV_DEV_BLKDEV_NONE
|
||||
#define BOOTENV_DEV_NAME_DHCP BOOTENV_DEV_NAME_BLKDEV_NONE
|
||||
#else
|
||||
#define BOOTENV_DEV_DHCP \
|
||||
BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP
|
||||
|
@ -413,6 +433,9 @@
|
|||
"fi\0"
|
||||
#define BOOTENV_DEV_NAME_PXE(devtypeu, devtypel, instance) \
|
||||
"pxe "
|
||||
#elif defined(CONFIG_SPL_BUILD)
|
||||
#define BOOTENV_DEV_PXE BOOTENV_DEV_BLKDEV_NONE
|
||||
#define BOOTENV_DEV_NAME_PXE BOOTENV_DEV_NAME_BLKDEV_NONE
|
||||
#else
|
||||
#define BOOTENV_DEV_PXE \
|
||||
BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#ifndef __FDT_SUPPORT_H
|
||||
#define __FDT_SUPPORT_H
|
||||
|
||||
#if defined(CONFIG_OF_LIBFDT) && !defined(USE_HOSTCC)
|
||||
#if (defined(CONFIG_OF_LIBFDT) || defined(CONFIG_OF_CONTROL)) && \
|
||||
!defined(USE_HOSTCC)
|
||||
|
||||
#include <asm/u-boot.h>
|
||||
#include <linux/libfdt.h>
|
||||
|
|
|
@ -86,7 +86,7 @@ struct pmic {
|
|||
#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */
|
||||
|
||||
/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */
|
||||
#ifdef CONFIG_DM_PMIC
|
||||
#if defined(CONFIG_DM_PMIC) || !CONFIG_IS_ENABLED(POWER_LEGACY)
|
||||
/**
|
||||
* U-Boot PMIC Framework
|
||||
* =====================
|
||||
|
|
Loading…
Add table
Reference in a new issue