Kconfig: More cleanup of CONFIG options
Subsystems (24)
v2 cover Kconfig: More cleanup of CONFIG options
Quite a few CONFIG options without an SPL equivalent are used as if they have one. For example, we see CONFIG_IS_ENABLED(IOMMU) when there is no SPL_IOMMU Kconfig option.
This series adds new features to moveconfig to detect and remove these problems. It includes additions to the Kconfig for options which are needed as well as dropping unwanted us of CONFIG_IS_ENABLED, etc.
This follows on from v3 the previous series[1]
It is available at u-boot-dm/splb-working
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=339724
Changes in v2:
- Rebase to previous series
- Correct the tag
- Rebase to previous series
- Drop patch to add a Kconfig for SPL_EFI_LOADER et al
- Drop patch to add a Kconfig for SPL_GENERATE_ACPI_TABLE
Simon Glass (169):
moveconfig: Update to detect / correct missing SPL Kconfigs
x86: Correct Chrromebook typo
boot: Add a Kconfig for SPL_FIT_CIPHER
boot: Add a Kconfig for SPL_BOOTSTD_FULL
boot: Add Kconfigs for BOOTMETH_VBE_REQUEST
boot: Add a Kconfig for SPL_BOOTDEV_SPI_FLASH
boot: Add a Kconfig for SPL_BOOTDEV_ETH
dm: Add a Kconfig for SPL_DEVRES
dm: Add a Kconfig for SPL_DM_HWSPINLOCK
boot: Add a Kconfig for SPL_OF_LIVE
cmd: Add a Kconfig for SPL_CRC32_VERIFY
console: Add a Kconfig for SPL_CONSOLE_MUX et al
button: Add a Kconfig for SPL_BUTTON
lib: Add a Kconfig for SPL_ERRNO_STR
iommu: Add a Kconfig for SPL_IOMMU
pinctrl: Add a Kconfig for SPL_PINCTRL_ARMADA_38X
virtio: Add a Kconfig for SPL_VIRTIO
lib: Add a Kconfig for SPL_BZIP2
acpi: Add a Kconfig for SPL_ACPIGEN
rockchip: Add a Kconfig for SPL_RESET_ROCKCHIP
mediatek: Add a Kconfig for SPL_RESET_MEDIATEK Correct SPL use of A003399_NOR_WORKAROUND
Correct SPL use of AHCI
Correct SPL uses of ALLEYCAT_5
Correct SPL uses of ARCH_MVEBU
Correct SPL use of ARCH_VERSAL
Correct SPL use of ARCH_ZYNQ
Correct SPL use of ARM64
Correct SPL uses of ARMADA_3700
Correct SPL uses of ARMADA_8K
Correct SPL use of ATMEL_PIO4
Correct SPL use of BNXT_ETH
Correct SPL use of BOOTSTAGE_FDT
Correct SPL uses of BOOTSTAGE_REPORT
Correct SPL use of CMD_BCB
Correct SPL uses of CMD_BOOTEFI_BOOTMGR
Correct SPL use of CMD_BOOTI
Correct SPL uses of CMD_BOOTM_PRE_LOAD
Correct SPL use of CMD_BOOTZ
Correct SPL uses of CMD_CLK
Correct SPL uses of CMD_DHCP
Correct SPL uses of CMD_EFICONFIG
Correct SPL use of CMD_ERASEENV
Correct SPL uses of CMD_FDT
Correct SPL use of CMD_FRU
Correct SPL use of CMD_HASH
Correct SPL use of CMD_MBR
Correct SPL uses of CMD_MMC
Correct SPL use of CMD_NET
Correct SPL use of CMD_NVEDIT_EFI
Correct SPL uses of CMD_NVME
Correct SPL use of CMD_PSTORE
Correct SPL uses of CMD_PXE
Correct SPL uses of CMD_SCSI
Correct SPL uses of CMD_SF
Correct SPL use of CMD_SHA1SUM
Correct SPL use of CMD_STBOARD
Correct SPL use of CMD_STM32PROG
Correct SPL uses of CMD_TFTPPUT
Correct SPL uses of CMD_USB
Correct SPL use of CMD_VIRTIO
Correct SPL uses of CPU_MICROBLAZE
Correct SPL use of DEBUG_UART_ZYNQ
Correct SPL uses of DFU_VIRT
Correct SPL uses of DISPLAY_AER_BRIEF
Correct SPL uses of DISPLAY_AER_FULL
Correct SPL use of DISPLAY_CPUINFO
Correct SPL use of DM_RNG
Correct SPL uses of DTB_RESELECT
Correct SPL uses of DWC_ETH_QOS
Correct SPL use of EFI_APP
Correct SPL use of EFI_DEVICE_PATH_UTIL
Correct SPL uses of EFI_HAVE_CAPSULE_SUPPORT Correct SPL use of EFI_LOADER_HII
Correct SPL use of EFI_MM_COMM_TEE
Correct SPL use of EFI_SECURE_BOOT
Correct SPL use of EFI_TCG2_PROTOCOL
Correct SPL use of EFI_UNICODE_COLLATION_PROTOCOL2 Correct SPL uses of ENV_IS_IN_UBI
Correct SPL uses of ENV_VARS_UBOOT_RUNTIME_CONFIG Correct SPL use of ENV_WRITEABLE_LIST
Correct SPL use of EXYNOS7420
Correct SPL uses of FASTBOOT
Correct SPL uses of FASTBOOT_FLASH
Correct SPL uses of FASTBOOT_FLASH_MMC
Correct SPL uses of FASTBOOT_FLASH_NAND
Correct SPL use of FASTBOOT_MMC_USER_SUPPORT Correct SPL use of FDT_SIMPLEFB
Correct SPL uses of FEC_MXC
Correct SPL use of FSL_CAAM
Correct SPL uses of FSL_ISBC_KEY_EXT
Correct SPL use of FSL_MC_ENET
Correct SPL use of FSP_VERSION2
Correct SPL use of FS_EROFS
Correct SPL use of GENERATE_SMBIOS_TABLE
Correct SPL uses of GMAC_ROCKCHIP
Correct SPL use of HUSH_PARSER
Correct SPL uses of HW_WATCHDOG
Correct SPL uses of I8259_PIC
Correct SPL uses of IMX8M
Correct SPL use of IMX8MN_BEACON_2GB_LPDDR Correct SPL uses of IMX_MODULE_FUSE
Correct SPL uses of IMX_RDC
Correct SPL uses of LMB
Correct SPL uses of MICROBLAZE
Correct SPL use of MIPS_CM
Correct SPL use of MMC_QUIRKS
Correct SPL uses of MTD
Correct SPL uses of MULTIPLEXER
Correct SPL uses of NEEDS_MANUAL_RELOC
Correct SPL use of NETDEVICES
Correct SPL uses of NXP_FSPI
Correct SPL use of OCTEON_SERIAL_BOOTCMD
Correct SPL use of OCTEON_SERIAL_PCIE_CONSOLE Correct SPL uses of OF_BOARD
Correct SPL use of OF_EMBED
Correct SPL use of PANEL
Correct SPL use of PARTITION_TYPE_GUID
Correct SPL use of PCI_PNP
Correct SPL uses of PG_WCOM_UBOOT_BOOTPACKAGE Correct SPL uses of PG_WCOM_UBOOT_UPDATE
Correct SPL use of PG_WCOM_UBOOT_UPDATE_SUPPORTED Correct SPL use of PHY_CADENCE_SIERRA
Correct SPL use of PHY_CADENCE_TORRENT
Correct SPL uses of PHY_FIXED
Correct SPL uses of PMIC_STPMIC1
Correct SPL use of QFW_PIO
Correct SPL use of REGEX
Correct SPL use of RENESAS_SDHI
Correct SPL use of RESV_RAM
Correct SPL uses of ROCKCHIP_EFUSE
Correct SPL uses of ROCKCHIP_OTP
Correct SPL use of SANDBOX
Correct SPL uses of SANDBOX_CLK_CCF
Correct SPL uses of SAVE_PREV_BL_FDT_ADDR
Correct SPL uses of SAVE_PREV_BL_INITRAMFS_START_ADDR Correct SPL uses of SEC_FIRMWARE_ARMV8_PSCI Correct SPL uses of SIFIVE_OTP
Correct SPL use of SL28CPLD
Correct SPL use of SL28_SPL_LOADS_OPTEE_BL32 Correct SPL use of SPI_FLASH_BAR
Correct SPL uses of SPI_FLASH_MACRONIX
Correct SPL use of SPLASH_SOURCE
Correct SPL use of STM32MP15X_STM32IMAGE
Correct SPL use of SUPPORT_EMMC_RPMB
Correct SPL use of SYS_FSL_ERRATUM_A010539 Correct SPL uses of SYS_LONGHELP
Correct SPL use of SYS_MEM_RSVD_FOR_MMU
Correct SPL uses of TARGET_LX2160ARDB
Correct SPL use of TARGET_MX6UL_9X9_EVK
Correct SPL use of TARGET_PG_WCOM_EXPU1
Correct SPL use of TARGET_PG_WCOM_SELI8
Correct SPL use of TEE
Correct SPL uses of TEN64_CONTROLLER
Correct SPL use of TPM_RNG
Correct SPL use of UDP_FUNCTION_FASTBOOT
Correct SPL use of USB_DWC3_MESON_G12A
Correct SPL uses of USB_DWC3_MESON_GXL
Correct SPL use of USB_FUNCTION_FASTBOOT
Correct SPL uses of USB_GADGET_DWC2_OTG
Correct SPL uses of USB_KEYBOARD
Correct SPL uses of USB_MUSB_HOST
Correct SPL uses of VIDEO
Correct SPL use of VIDEO_ANSI
Correct SPL use of VIDEO_BPP16
Correct SPL use of VIDEO_BPP32
Correct SPL use of WATCHDOG_AUTOSTART
Correct SPL uses of XEN_SERIAL
Correct SPL uses of ZYNQMP_FIRMWARE
arch/arc/lib/bootm.c | 2 +- arch/arm/cpu/armv8/cpu-dt.c | 2 +- arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +- arch/arm/include/asm/mach-imx/module_fuse.h | 2 +- arch/arm/lib/bootm-fdt.c | 2 +- arch/arm/lib/bootm.c | 2 +- arch/arm/lib/save_prev_bl_data.c | 4 +- arch/arm/mach-exynos/mmu-arm64.c | 2 +- arch/arm/mach-imx/imx_bootaux.c | 8 +- arch/arm/mach-imx/mx7/soc.c | 4 +- arch/arm/mach-meson/board-axg.c | 4 +- arch/arm/mach-meson/board-g12a.c | 4 +- arch/arm/mach-meson/board-gx.c | 4 +- arch/arm/mach-mvebu/arm64-common.c | 12 +- arch/arm/mach-rockchip/board.c | 2 +- arch/arm/mach-rockchip/cpu-info.c | 2 +- arch/arm/mach-rockchip/misc.c | 8 +- .../cmd_stm32prog/cmd_stm32prog.c | 2 +- .../mach-stm32mp/cmd_stm32prog/stm32prog.c | 6 +- arch/arm/mach-stm32mp/fdt.c | 2 +- arch/m68k/lib/bootm.c | 2 +- arch/microblaze/cpu/cpuinfo.c | 2 +- arch/microblaze/include/asm/cpuinfo.h | 2 +- arch/microblaze/lib/bootm.c | 2 +- arch/mips/include/asm/cm.h | 2 +- arch/mips/lib/bootm.c | 4 +- arch/mips/mach-octeon/cpu.c | 4 +- arch/powerpc/lib/bootm.c | 2 +- arch/riscv/lib/bootm.c | 2 +- arch/sandbox/lib/bootm.c | 2 +- arch/x86/cpu/coreboot/coreboot.c | 2 +- arch/x86/cpu/efi/payload.c | 2 +- arch/x86/cpu/qemu/qemu.c | 2 +- arch/x86/lib/bootm.c | 4 +- arch/x86/lib/fsp/fsp_dram.c | 4 +- arch/x86/lib/interrupts.c | 8 +- .../imx8mp_rsb3720a1/imx8mp_rsb3720a1.c | 2 +- board/broadcom/bcmns3/ns3.c | 2 +- board/compulab/cm_fx6/cm_fx6.c | 2 +- .../imx8mm-cl-iot-gate/imx8mm-cl-iot-gate.c | 2 +- board/emulation/common/qemu_dfu.c | 2 +- board/emulation/qemu-arm/qemu-arm.c | 2 +- board/engicam/imx8mp/icore_mx8mp.c | 4 +- board/engicam/stm32mp1/stm32mp1.c | 2 +- board/freescale/common/fsl_validate.c | 18 +- board/freescale/imx8mp_evk/imx8mp_evk.c | 4 +- board/freescale/imx93_evk/imx93_evk.c | 4 +- board/freescale/lx2160a/lx2160a.c | 6 +- board/keymile/common/common.c | 10 +- .../keymile/pg-wcom-ls102xa/pg-wcom-ls102xa.c | 4 +- board/kontron/pitx_imx8m/pitx_imx8m.c | 2 +- board/kontron/sl-mx8mm/sl-mx8mm.c | 2 +- board/kontron/sl28/sl28.c | 8 +- board/rockchip/evb_rk3399/evb-rk3399.c | 2 +- board/sandbox/sandbox.c | 2 +- board/sifive/unleashed/unleashed.c | 4 +- board/socionext/developerbox/developerbox.c | 2 +- board/st/common/stm32mp_dfu.c | 4 +- board/st/common/stm32mp_mtdparts.c | 2 +- board/st/stm32mp1/stm32mp1.c | 10 +- board/ti/am57xx/board.c | 2 +- board/ti/dra7xx/evm.c | 2 +- board/traverse/ten64/ten64.c | 10 +- .../variscite/imx8mn_var_som/imx8mn_var_som.c | 2 +- board/xilinx/common/board.c | 14 +- board/xilinx/versal-net/board.c | 4 +- board/xilinx/versal/board.c | 2 +- board/xilinx/zynq/board.c | 2 +- board/xilinx/zynqmp/zynqmp.c | 2 +- boot/Kconfig | 21 + boot/Makefile | 5 +- boot/bootm.c | 8 +- boot/image-board.c | 2 +- boot/image-fdt.c | 4 +- boot/vbe_request.c | 2 +- cmd/Kconfig | 4 + cmd/bootcount.c | 4 +- cmd/bootmenu.c | 4 +- cmd/cls.c | 2 +- cmd/cpu.c | 2 +- cmd/dm.c | 2 +- cmd/eficonfig.c | 2 +- cmd/fastboot.c | 4 +- cmd/net.c | 6 +- cmd/nvedit.c | 2 +- cmd/ti/pd.c | 2 +- common/Kconfig | 8 + common/board_r.c | 8 +- common/cli.c | 2 +- common/event.c | 2 +- common/fdt_simplefb.c | 2 +- common/hash.c | 4 +- common/splash.c | 2 +- disk/part_dos.c | 2 +- disk/part_efi.c | 2 +- drivers/Makefile | 2 +- drivers/button/Kconfig | 4 + drivers/clk/clk-divider.c | 4 +- drivers/clk/clk-gate.c | 6 +- drivers/clk/clk-mux.c | 8 +- drivers/clk/clk_k210.c | 6 +- drivers/clk/imx/clk-imx8.c | 2 +- drivers/clk/imx/clk-imx8.h | 2 +- drivers/clk/imx/clk-imx8mm.c | 4 +- drivers/clk/imx/clk-imx8qm.c | 2 +- drivers/clk/imx/clk-imx8qxp.c | 2 +- drivers/clk/rockchip/clk_rk3368.c | 4 +- drivers/core/Kconfig | 7 + drivers/crypto/aspeed/aspeed_hace.c | 2 +- drivers/crypto/hash/hash_sw.c | 2 +- drivers/dfu/Makefile | 2 +- drivers/fastboot/fb_command.c | 8 +- drivers/fastboot/fb_common.c | 2 +- drivers/fastboot/fb_getvar.c | 10 +- drivers/fastboot/fb_mmc.c | 2 +- drivers/hwspinlock/Kconfig | 4 + drivers/i2c/mxc_i2c.c | 4 +- drivers/iommu/Kconfig | 4 + drivers/misc/fsl_ifc.c | 2 +- drivers/mmc/Makefile | 2 +- drivers/mmc/mmc.c | 2 +- drivers/mmc/mv_sdhci.c | 4 +- drivers/mmc/tmio-common.h | 2 +- drivers/mtd/spi/Kconfig | 4 + drivers/mtd/spi/spi-nor-core.c | 6 +- drivers/mux/Makefile | 2 +- drivers/net/fec_mxc.c | 2 +- drivers/net/mvneta.c | 4 +- drivers/pci/pci-uclass.c | 2 +- drivers/phy/cadence/Makefile | 4 +- drivers/phy/phy-ab8500-usb.c | 2 +- drivers/pinctrl/broadcom/pinctrl-bcm283x.c | 2 +- drivers/pinctrl/mvebu/Kconfig | 4 + drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- drivers/pinctrl/pinctrl-single.c | 2 +- drivers/reset/Kconfig | 8 + drivers/serial/serial_bcm283x_mu.c | 2 +- drivers/serial/serial_bcm283x_pl011.c | 2 +- drivers/serial/serial_zynq.c | 2 +- drivers/spi/cadence_ospi_versal.c | 2 +- drivers/spi/cadence_qspi.c | 4 +- drivers/sysreset/sysreset_mpc83xx.c | 8 +- drivers/tpm/tpm-uclass.c | 2 +- drivers/usb/host/ehci-mx6.c | 4 +- drivers/usb/musb-new/omap2430.c | 2 +- drivers/video/imx/mxc_ipuv3_fb.c | 2 +- drivers/video/video-uclass.c | 4 +- drivers/virtio/Kconfig | 4 + drivers/xen/events.c | 8 +- dts/Kconfig | 4 + fs/erofs/Makefile | 2 +- include/asm-generic/global_data.h | 2 +- include/bcb.h | 2 +- include/configs/am335x_evm.h | 6 +- include/configs/am62ax_evm.h | 4 +- include/configs/apple.h | 4 +- include/configs/imx8mm-cl-iot-gate.h | 8 +- include/configs/imx8mn_beacon.h | 2 +- include/configs/imx8mp_rsb3720.h | 6 +- include/configs/iot2050.h | 2 +- include/configs/j721e_evm.h | 4 +- include/configs/mx6ul_14x14_evk.h | 2 +- include/configs/qemu-arm.h | 10 +- include/configs/rockchip-common.h | 14 +- include/configs/rpi.h | 8 +- include/configs/tegra-common-post.h | 2 +- include/dfu.h | 2 +- include/env_internal.h | 2 +- include/environment/distro/sf.h | 2 +- include/linux/clk-provider.h | 6 +- include/mux.h | 2 +- include/tee.h | 2 +- lib/Kconfig | 10 + lib/efi_loader/efi_image_loader.c | 2 +- lib/efi_loader/efi_root_node.c | 6 +- lib/hashtable.c | 2 +- lib/vsprintf.c | 2 +- net/Kconfig | 4 + net/bootp.c | 2 +- net/fastboot.c | 2 +- net/mdio-uclass.c | 2 +- tools/moveconfig.py | 599 +++++++++++++----- 182 files changed, 850 insertions(+), 446 deletions(-)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 1/169 moveconfig: Update to detect / correct missing SPL Kconfigs
This adds quite a few more features, all designed to detect problems with Kconfig options and their use. It can find options mentioned in the source code which are not in the Kconfig and vice versa. It can convert SPL usages of non-SPL Kconfig options (i.e. changing CONFIG_IS_ENABLED() to IS_ENABLED() and CONFIG_$(SPL)_FOO to CONFIG_FOO, creating commits automatically if requested.
These features are only useful for code clean-up, not for normal development.
---
Changes in v2:
- Rebase to previous series
tools/moveconfig.py | 599 +++++++++++++++++++++++++++++++++----------- 1 file changed, 456 insertions(+), 143 deletions(-)
tools/moveconfig.py +456 -143
@@ -20,6 +20,7 @@ import doctest import filecmp import fnmatch import glob +import io import multiprocessing import os import queue
@@ -118,6 +119,16 @@ def check_clean_directory(): if os.path.exists(fname): sys.exit("source tree is not clean, please run 'make mrproper'") +def write_commit(msg): + """Create a new commit with all modified files + + Args: + msg (str): Commit message + """ + subprocess.call(['git', 'add', '-u']) + rc = subprocess.call(['git', 'commit', '-s', '-m', msg]) + return rc == 0 + def get_make_cmd(): """Get the command name of GNU Make.
@@ -1606,30 +1617,59 @@ def prefix_config(cfg): return op + cfg -RE_MK_CONFIGS = re.compile('CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)') -RE_IFDEF = re.compile('(ifdef|ifndef)') -RE_C_CONFIGS = re.compile('CONFIG_([A-Za-z0-9_]*)') -RE_CONFIG_IS = re.compile('CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)') +RE_MK_CONFIGS = re.compile(r'CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)') + +# Makefile ifdefs: this only handles 'else' on its own line, so not +# 'else ifeq ...', for example +RE_IF = re.compile(r'^(ifdef|ifndef|endif|ifeq|ifneq|else)([^,]*,([^,]*)\))?.*$') + +# Normal CONFIG options in C +RE_C_CONFIGS = re.compile(r'CONFIG_([A-Za-z0-9_]*)') + +# CONFIG_IS_ENABLED() construct +RE_CONFIG_IS = re.compile(r'CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)') + +# Preprocessor #if/#ifdef directives, etc. +RE_IFDEF = re.compile(r'^\s*#\s*(ifdef|ifndef|endif|if|elif|else)\s*(?:#.*)?(.*)$') class ConfigUse: - def __init__(self, cfg, is_spl, fname, rest): + """Holds information about a use of a CONFIG option""" + def __init__(self, cfg, is_spl, conds, fname, rest, is_mk): + """Set up a new use of a CONFIG option + + Args: + cfg (str): Config option, without the CONFIG_ + is_spl (bool): True if it indicates an SPL option, i.e. has a + $(SPL_) or similar, False if not + conds (list of str): List of conditions for this use, e.g. + ['SPL_BUILD'] + fname (str): Filename contining the use + rest (str): Entire line from the file + is_mk (bool): True if this is in a Makefile, False if not + """ self.cfg = cfg self.is_spl = is_spl + self.conds = list(c for c in conds if '(NONE)' not in c) self.fname = fname self.rest = rest + self.is_mk = is_mk def __hash__(self): return hash((self.cfg, self.is_spl)) -def scan_makefiles(fnames): + def __str__(self): + return (f'ConfigUse({self.cfg}, is_spl={self.is_spl}, ' + f'is_mk={self.is_mk}, fname={self.fname}, rest={self.rest}') + +def scan_makefiles(fname_dict): """Scan Makefiles looking for Kconfig options Looks for uses of CONFIG options in Makefiles Args: - fnames (list of tuple): - str: Makefile filename where the option was found - str: Line of the Makefile + fname_dict (dict lines): + key: Makefile filename where the option was found + value: List of str lines of the Makefile Returns: tuple:
@@ -1646,46 +1686,81 @@ def scan_makefiles(fnames): ('$(SPL_)', 'MARY') >>> RE_MK_CONFIGS.search('CONFIG_$(SPL_TPL_)MARY').groups() ('$(SPL_TPL_)', 'MARY') + >>> RE_IF.match('ifdef CONFIG_SPL_BUILD').groups() + ('ifdef', None, None) + >>> RE_IF.match('endif # CONFIG_SPL_BUILD').groups() + ('endif', None, None) + >>> RE_IF.match('endif').groups() + ('endif', None, None) + >>> RE_IF.match('else').groups() + ('else', None, None) """ all_uses = collections.defaultdict(list) fname_uses = {} - for fname, rest in fnames: - m_iter = RE_MK_CONFIGS.finditer(rest) - found = False - for m in m_iter: - found = True - real_opt = m.group(2) - if real_opt == '': - continue - is_spl = False - if m.group(1): - is_spl = True - use = ConfigUse(real_opt, is_spl, fname, rest) - if fname not in fname_uses: - fname_uses[fname] = set() - fname_uses[fname].add(use) - all_uses[use].append(rest) + for fname, rest_list in fname_dict.items(): + conds = [] + for rest in rest_list: + m_iter = RE_MK_CONFIGS.finditer(rest) + m_cond = RE_IF.match(rest) + #print('line', conds, m_cond and m_cond.group(1) or '.', rest) + last_use = None + use = None + for m in m_iter: + real_opt = m.group(2) + if real_opt == '': + continue + is_spl = False + if m.group(1): + is_spl = True + use = ConfigUse(real_opt, is_spl, conds, fname, rest, True) + if fname not in fname_uses: + fname_uses[fname] = set() + fname_uses[fname].add(use) + all_uses[use].append(rest) + last_use = use + if m_cond: + cfg = last_use.cfg if last_use else '(NONE)' + cond = m_cond.group(1) + if cond == 'ifdef': + conds.append(cfg) + elif cond == 'ifndef': + conds.append(f'~{cfg}') + elif cond == 'ifeq': + #print('todo', fname, m_cond.group(3), fname, rest) + conds.append(f'{m_cond.group(3)}={cfg}') + elif cond == 'ifneq': + conds.append(f'{m_cond.group(3)}={cfg}') + #print('todo', m_cond.group(3)) + elif cond == 'endif': + conds.pop() + elif cond == 'else': + cond = conds.pop() + if cond.startswith('~'): + cond = cond[1:] + else: + cond = f'~{cond}' + conds.append(cond) + else: + print(f'unknown condition: {rest}') + if conds: + print(f'leftover {conds}') return all_uses, fname_uses - -def scan_src_files(fnames): +def scan_src_files(fname_dict, all_uses, fname_uses): """Scan source files (other than Makefiles) looking for Kconfig options Looks for uses of CONFIG options Args: - fnames (list of tuple): - str: Makefile filename where the option was found - str: Line of the Makefile - - Returns: - tuple: - dict: all_uses - key (ConfigUse): object - value (list of str): matching lines - dict: Uses by filename - key (str): filename - value (set of ConfigUse): uses in that filename + fname_dict (dict): + key (str): Filename + value (list of ConfigUse): List of uses in that filename + all_uses (dict): to add more uses to: + key (ConfigUse): object + value (list of str): matching lines + fname (dict): to add more uses-by-filename to + key (str): filename + value (set of ConfigUse): uses in that filename >>> RE_C_CONFIGS.search('CONFIG_FRED').groups() ('FRED',)
@@ -1693,39 +1768,78 @@ def scan_src_files(fnames): ('MARY',) >>> RE_CONFIG_IS.search('#if CONFIG_IS_ENABLED(OF_PLATDATA)').groups() ('OF_PLATDATA',) + >>> RE_IFDEF.match('#ifdef CONFIG_SPL_BUILD').groups() + ('ifdef', 'CONFIG_SPL_BUILD') + >>> RE_IFDEF.match('#endif # CONFIG_SPL_BUILD').groups() + ('endif', '') + >>> RE_IFDEF.match('#endif').groups() + ('endif', '') + >>> RE_IFDEF.match('#else').groups() + ('else', '') + >>> RE_IFDEF.match(' # if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)').groups() + ('if', 'defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)') """ def add_uses(m_iter, is_spl): + last_use = None for m in m_iter: found = True real_opt = m.group(1) if real_opt == '': continue - use = ConfigUse(real_opt, is_spl, fname, rest) + use = ConfigUse(real_opt, is_spl, conds, fname, rest, False) if fname not in fname_uses: fname_uses[fname] = set() fname_uses[fname].add(use) all_uses[use].append(rest) - - all_uses = collections.defaultdict(list) - fname_uses = {} - for fname, rest in fnames: - m_iter = RE_C_CONFIGS.finditer(rest) - add_uses(m_iter, False) - - m_iter2 = RE_CONFIG_IS.finditer(rest) - add_uses(m_iter2, True) - - return all_uses, fname_uses + last_use = use + return last_use + + for fname, rest_list in fname_dict.items(): + conds = [] + for rest in rest_list: + m_iter = RE_C_CONFIGS.finditer(rest) + m_cond = RE_IFDEF.match(rest) + last_use1 = add_uses(m_iter, False) + + m_iter2 = RE_CONFIG_IS.finditer(rest) + last_use2 = add_uses(m_iter2, True) + last_use = last_use1 or last_use2 + if m_cond: + cfg = last_use.cfg if last_use else '(NONE)' + cond = m_cond.group(1) + #print(fname, rest, cond, conds) + if cond == 'ifdef': + conds.append(cfg) + elif cond == 'ifndef': + conds.append(f'~{cfg}') + elif cond == 'if': + #print('todo', fname, m_cond.group(3), fname, rest) + conds.append(f'{m_cond.group(2)}={cfg}') + elif cond == 'endif': + conds.pop() + elif cond == 'else': + cond = conds.pop() + if cond.startswith('~'): + cond = cond[1:] + else: + cond = f'~{cond}' + conds.append(cond) + elif cond == 'elif': + cond = conds.pop() + conds.append(cfg) + else: + print(f'{fname}: unknown condition: {rest}') MODE_NORMAL, MODE_SPL, MODE_PROPER = range(3) -def do_scan_source(path, do_update): +def do_scan_source(path, do_update, show_conflicts, do_commit): """Scan the source tree for Kconfig inconsistencies Args: path (str): Path to source tree - do_update (bool) : True to write to scripts/kconf_... files + do_update (bool): True to write to scripts/kconf_... files + show_conflicts (bool): True to show conflicts """ def is_not_proper(name): for prefix in SPL_PREFIXES:
@@ -1754,7 +1868,7 @@ def do_scan_source(path, do_update): """ # Make sure we know about all the options not_found = collections.defaultdict(list) - for use, rest in all_uses.items(): + for use, _ in all_uses.items(): name = use.cfg if name in IGNORE_SYMS: continue
@@ -1766,7 +1880,6 @@ def do_scan_source(path, do_update): # If it is an SPL symbol, try prepending all SPL_ prefixes to # find at least one SPL symbol if use.is_spl: - add_to_dict = False for prefix in SPL_PREFIXES: try_name = prefix + name sym = kconf.syms.get(try_name)
@@ -1784,7 +1897,6 @@ def do_scan_source(path, do_update): elif not use.is_spl: check = False else: # MODE_NORMAL - debug = False sym = kconf.syms.get(name) if not sym: proper_name = is_not_proper(name)
@@ -1819,105 +1931,304 @@ def do_scan_source(path, do_update): for i, use in enumerate(uses[name]): print(f'{" " if i else ""}{use.fname}: {use.rest.strip()}') + def do_scan(): + """Scan the source tree - print('Scanning Kconfig') - kconf = KconfigScanner().conf - print(f'Scanning source in {path}') - args = ['git', 'grep', '-E', r'IS_ENABLED|\bCONFIG'] - with subprocess.Popen(args, stdout=subprocess.PIPE) as proc: - out, err = proc.communicate() - lines = out.splitlines() - re_fname = re.compile('^([^:]*):(.*)') - src_list = [] - mk_list = [] - for line in lines: - linestr = line.decode('utf-8') - m_fname = re_fname.search(linestr) - if not m_fname: - continue - fname, rest = m_fname.groups() - dirname, leaf = os.path.split(fname) - root, ext = os.path.splitext(leaf) - if ext == '.autoconf': - pass - elif ext in ['.c', '.h', '.S', '.lds', '.dts', '.dtsi', '.asl', '.cfg', - '.env', '.tmpl']: - src_list.append([fname, rest]) - elif 'Makefile' in root or ext == '.mk': - mk_list.append([fname, rest]) - elif ext in ['.yml', '.sh', '.py', '.awk', '.pl', '.rst', '', '.sed']: - pass - elif 'Kconfig' in root or 'Kbuild' in root: - pass - elif 'README' in root: - pass - elif dirname in ['configs']: - pass - elif dirname.startswith('doc') or dirname.startswith('scripts/kconfig'): - pass + This runs a 'git grep' and then picks out uses of CONFIG options from + the resulting output + + Returns: tuple + dict of uses of CONFIG in Makefiles: + key (str): Filename + value (list of ConfigUse): List of uses in that filename + dict of uses of CONFIG in source files: + key (str): Filename + value (list of ConfigUse): List of uses in that filename + """ + def finish_file(last_fname, rest_list): + if is_mkfile: + mk_dict[last_fname] = rest_list + else: + src_dict[last_fname] = rest_list + rest_list = [] + + print(f'Scanning source in {path}') + args = ['git', 'grep', '-E', + r'IS_ENABLED|\bCONFIG|CONFIG_SPL_BUILD|if|else|endif'] + with subprocess.Popen(args, stdout=subprocess.PIPE) as proc: + out, _ = proc.communicate() + lines = out.splitlines() + re_fname = re.compile('^([^:]*):(.*)') + src_dict = collections.OrderedDict() + mk_dict = collections.OrderedDict() + last_fname = None + rest_list = [] + is_mkfile = None + for line in lines: + linestr = line.decode('utf-8') + m_fname = re_fname.search(linestr) + if not m_fname: + continue + fname, rest = m_fname.groups() + if fname != last_fname: + finish_file(last_fname, rest_list) + rest_list = [] + last_fname = fname + + dirname, leaf = os.path.split(fname) + root, ext = os.path.splitext(leaf) + #if dirname != '' or root != 'Makefile': + #continue + if (dirname.startswith('test') or + dirname.startswith('lib/efi_selftest')): + # Ignore test code since it is mostly only for sandbox + pass + elif ext == '.autoconf': + pass + elif ext in ['.c', '.h', '.S', '.lds', '.dts', '.dtsi', '.asl', + '.cfg', '.env', '.tmpl']: + rest_list.append(rest) + is_mkfile = False + elif 'Makefile' in root or ext == '.mk': + rest_list.append(rest) + is_mkfile = True + elif ext in ['.yml', '.sh', '.py', '.awk', '.pl', '.rst', '', '.sed', + '.src', '.inc', '.l', '.i_shipped', '.txt', '.cmd', + '.cfg', '.y', '.cocci', '.ini', '.asn1', '.base', + '.cnf', '.patch', '.mak', '.its', '.svg', '.tcl', + '.css', '.config', '.conf']: + pass + elif 'Kconfig' in root or 'Kbuild' in root: + pass + elif 'README' in root: + pass + elif dirname in ['configs']: + pass + elif dirname.startswith('doc') or dirname.startswith('scripts/kconfig'): + pass + else: + print(f'Not sure how to handle file {fname}') + finish_file(last_fname, rest_list) + return mk_dict, src_dict + + def check_mk_missing(all_uses, spl_not_found, proper_not_found): + # Make sure we know about all the options in Makefiles + print('\nCONFIG options present in Makefiles but not Kconfig:') + not_found = check_not_found(all_uses, MODE_NORMAL) + show_uses(not_found) + + print('\nCONFIG options present in Makefiles but not Kconfig (SPL):') + not_found = check_not_found(all_uses, MODE_SPL) + show_uses(not_found) + spl_not_found |= set(is_not_proper(key) or key for key in not_found.keys()) + + print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:') + not_found = check_not_found(all_uses, MODE_PROPER) + show_uses(not_found) + proper_not_found |= set(key for key in not_found.keys()) + + def check_src_missing(all_uses, spl_not_found, proper_not_found): + # Make sure we know about all the options in source files + print('\nCONFIG options present in source but not Kconfig:') + not_found = check_not_found(all_uses, MODE_NORMAL) + show_uses(not_found) + + print('\nCONFIG options present in source but not Kconfig (SPL):') + not_found = check_not_found(all_uses, MODE_SPL) + show_uses(not_found) + spl_not_found |= set(is_not_proper(key) or key + for key in not_found.keys()) + + print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:') + not_found = check_not_found(all_uses, MODE_PROPER) + show_uses(not_found) + proper_not_found |= set(key for key in not_found.keys()) + + def show_summary(spl_not_found, proper_not_found): + print('\nCONFIG options used as SPL but without an SPL_ variant:') + for item in sorted(spl_not_found): + print(f' {item}') + + print('\nCONFIG options used as Proper but without a non-SPL_ variant:') + for item in sorted(proper_not_found): + print(f' {item}') + + def write_update(spl_not_found, proper_not_found): + with open(os.path.join(path, 'scripts', 'conf_nospl'), + encoding='utf-8') as out: + print('# These options should not be enabled in SPL builds\n', + file=out) + for item in sorted(spl_not_found): + print(item, file=out) + with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w', + encoding='utf-8') as out: + print('# These options should not be enabled in Proper builds\n', + file=out) + for item in sorted(proper_not_found): + print(item, file=out) + + def check_conflict(kconf, all_uses, show): + """Check conflicts between uses of CONFIG options in source + + Sometimes an option is used in an SPL context in once place and not in + another. For example if we see CONFIG_SPL_FOO and CONFIG_FOO then we + don't know whether FOO should be enabled in SPL if CONFIG_FOO is + enabled, or only if CONFIG_SPL_FOO is enabled., + + This function detects such situations + + Args: + kconf (Kconfiglib.Kconfig): Kconfig tree read from source + all_uses (dict): dict to add more uses to: + key (ConfigUse): object + value (list of str): matching lines + show (bool): True to show the problems + + Returns: + dict of conflicts: + key: filename + value: list of ConfigUse objects + """ + conflict_dict = collections.defaultdict(list) + cfg_dict = collections.defaultdict(list) + + uses = collections.defaultdict(list) + for use in all_uses: + uses[use.cfg].append(use) + + bad = 0 + for cfg in sorted(uses): + use_list = uses[cfg] + + # Check if + # - there is no SPL_ version of the symbol, and + # - some uses are SPL and some are not + is_spl = list(set(u.is_spl for u in use_list)) + if len(is_spl) > 1 and f'SPL_{cfg}' not in kconf.syms: + if show: + print(f'{cfg}: {is_spl}') + for use in use_list: + if show: + print(f' spl={use.is_spl}: {use.conds} {use.fname} {use.rest}') + if use.is_spl: + conflict_dict[use.fname].append(use) + cfg_dict[use.cfg].append(use) + bad += 1 + print(f'total bad: {bad}') + return conflict_dict, cfg_dict + + def replace_in_file(fname, use_or_uses): + """Replace a CONFIG pattern in a file + + Args: + fname (str): Filename to replace in + use_or_uses (ConfigUse or list of ConfigUse): Uses to replace + """ + with open(fname, encoding='utf-8') as inf: + data = inf.read() + out = io.StringIO() + + if isinstance(use_or_uses, list): + uses = use_or_uses else: - print(f'Not sure how to handle file {fname}') + uses = [use_or_uses] - # Scan the Makefiles - all_uses, fname_uses = scan_makefiles(mk_list) + re_cfgs = [] + for use in uses: + if use.is_mk: + expr = r'CONFIG_(?:\$\(SPL_(?:TPL_)?\))%s\b' % use.cfg + else: + expr = r'CONFIG_IS_ENABLED\(%s\)' % use.cfg + re_cfgs.append(re.compile(expr)) + + for line in data.splitlines(): + new_line = line + if 'CONFIG_' in line: + todo = [] + for i, re_cfg in enumerate(re_cfgs): + if not re_cfg.search(line): + todo.append(re_cfg) + use = uses[i] + if use.is_mk: + new_line = re_cfg.sub(f'CONFIG_{use.cfg}', new_line) + else: + new = f'IS_ENABLED(CONFIG_{use.cfg})' + new_line = re_cfg.sub(new, new_line) + re_cfgs = todo + out.write(new_line) + out.write('\n') + out_data = out.getvalue() + if out_data == data: + print(f'\n\nfailed with {fname}\n\n') + with open(fname, 'w', encoding='utf-8') as outf: + outf.write(out_data) + + def update_source(conflicts): + """Replace any SPL constructs with plain non-SPL ones + + CONFIG_IS_ENABLED(FOO) becomes IS_ENABLED(CONFIG_FOO) + CONFIG$_(SPL_TPL_)FOO becomes CONFIG_FOO - spl_not_found = set() - proper_not_found = set() + Args: + conflicts (dict): dict of conflicts: + key (str): filename + value (list of ConfigUse): uses within that file + """ + print(f'Updating {len(conflicts)} files') + for fname, uses in conflicts.items(): + replace_in_file(fname, uses) - # Make sure we know about all the options - print('\nCONFIG options present in Makefiles but not Kconfig:') - not_found = check_not_found(all_uses, MODE_NORMAL) - show_uses(not_found) + def create_commits(cfg_dict): + """Create a set of commits to fix SPL conflicts - print('\nCONFIG options present in Makefiles but not Kconfig (SPL):') - not_found = check_not_found(all_uses, MODE_SPL) - show_uses(not_found) - spl_not_found |= set([is_not_proper(key) or key for key in not_found.keys()]) + """ + print(f'Creating {len(cfg_dict)} commits') + for cfg, uses in cfg_dict.items(): + print(f'Processing {cfg}') + for use in uses: + #print(f' {use.fname}: {use}') + replace_in_file(use.fname, use) + plural = 's' if len(uses) > 1 else '' + msg = f'Correct SPL use{plural} of {cfg}' + msg += f'\n\nThis converts {len(uses)} usage{plural} ' + msg += 'of this option to the non-SPL form, since there is\n' + msg += f'no SPL_{cfg} defined in Kconfig' + if not write_commit(msg): + print('failed\n', uses) + break - print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:') - not_found = check_not_found(all_uses, MODE_PROPER) - show_uses(not_found) - proper_not_found |= set([key for key in not_found.keys()]) + print('Scanning Kconfig') + kconf = KconfigScanner().conf - # Scan the source code - all_uses, fname_uses = scan_src_files(src_list) + all_uses = collections.defaultdict(list) + fname_uses = {} + mk_dict, src_dict = do_scan() + + # Scan the Makefiles + all_uses, fname_uses = scan_makefiles(mk_dict) + scan_src_files(src_dict, all_uses, fname_uses) - # Make sure we know about all the options - print('\nCONFIG options present in source but not Kconfig:') - not_found = check_not_found(all_uses, MODE_NORMAL) - show_uses(not_found) + conflicts, cfg_dict = check_conflict(kconf, all_uses, show_conflicts) - print('\nCONFIG options present in source but not Kconfig (SPL):') - not_found = check_not_found(all_uses, MODE_SPL) - show_uses(not_found) - spl_not_found |= set([is_not_proper(key) or key for key in not_found.keys()]) + if do_update: + update_source(conflicts) + if do_commit: + create_commits(cfg_dict) - print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:') - not_found = check_not_found(all_uses, MODE_PROPER) - show_uses(not_found) - proper_not_found |= set([key for key in not_found.keys()]) + # Look for CONFIG options that are not found + spl_not_found = set() + proper_not_found = set() + check_mk_missing(all_uses, spl_not_found, proper_not_found) - print('\nCONFIG options used as SPL but without an SPL_ variant:') - for item in sorted(spl_not_found): - print(f' {item}') + # Scan the source code + scan_src_files(src_dict, all_uses, fname_uses) + check_src_missing(all_uses, spl_not_found, proper_not_found) - print('\nCONFIG options used as Proper but without a non-SPL_ variant:') - for item in sorted(proper_not_found): - print(f' {item}') + show_summary(spl_not_found, proper_not_found) # Write out the updated information if do_update: - with open(os.path.join(path, 'scripts', 'conf_nospl'), 'w') as out: - print('# These options should not be enabled in SPL builds\n', - file=out) - for item in sorted(spl_not_found): - print(item, file=out) - with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w') as out: - print('# These options should not be enabled in Proper builds\n', - file=out) - for item in sorted(proper_not_found): - print(item, file=out) - + write_update(spl_not_found, proper_not_found) def main(): try:
@@ -1957,9 +2268,11 @@ doc/develop/moveconfig.rst for documentation.''' parser.add_argument('-i', '--imply', action='store_true', default=False, help='find options which imply others') parser.add_argument('-I', '--imply-flags', type=str, default='', - help="control the -i option ('help' for help") + help="control the -i option ('help' for help)") parser.add_argument('-j', '--jobs', type=int, default=cpu_count, help='the number of jobs to run simultaneously') + parser.add_argument('-l', '--list-problems', action='store_true', + help='list problems found with --scan-source') parser.add_argument('-n', '--dry-run', action='store_true', default=False, help='perform a trial run (show log with no changes)') parser.add_argument('-r', '--git-ref', type=str,
@@ -1991,7 +2304,8 @@ doc/develop/moveconfig.rst for documentation.''' unittest.main() if args.scan_source: - do_scan_source(os.getcwd(), args.update) + do_scan_source(os.getcwd(), args.update, args.list_problems, + args.commit) return if not any((len(configs), args.force_sync, args.build_db, args.imply,
@@ -2049,7 +2363,6 @@ doc/develop/moveconfig.rst for documentation.''' cleanup_readme(configs, args) if args.commit: - subprocess.call(['git', 'add', '-u']) if configs: msg = 'Convert %s %sto Kconfig' % (configs[0], 'et al ' if len(configs) > 1 else '')
@@ -2058,7 +2371,7 @@ doc/develop/moveconfig.rst for documentation.''' else: msg = 'configs: Resync with savedefconfig' msg += '\n\nRsync all defconfig files using moveconfig.py' - subprocess.call(['git', 'commit', '-s', '-m', msg]) + write_commit(msg) if args.build_db: with open(CONFIG_DATABASE, 'w', encoding='utf-8') as fd:
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 2/169 x86: Correct Chrromebook typo
In reply to Simon GlassFix a typo in a comment.
---
(no changes since v1)
arch/x86/lib/fsp/fsp_dram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/lib/fsp/fsp_dram.c +1 -1
@@ -60,7 +60,7 @@ int dram_init_banksize(void)* * However it seems FSP2's behavior is different. We need to add the * DRAM range in MTRR otherwise the boot process goes very slowly, -* which was observed on Chrromebook Coral with FSP2. +* which was observed on Chromebook Coral with FSP2. */ update_mtrr =CONFIG_IS_ENABLED (FSP_VERSION2 );
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 3/169 boot: Add a Kconfig for SPL_FIT_CIPHER
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
boot/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
boot/Kconfig +4 -0
@@ -103,6 +103,10 @@ config FIT_CIPHER Enable the feature of data ciphering/unciphering in the tool mkimage and in the u-boot support of the FIT image. +config SPL_FIT_CIPHER + def_bool n # Enable ciphering data in a FIT uImages (SPL + depends on SPL_DM && SPL_FIT + config FIT_VERBOSE bool "Show verbose messages when FIT images fail" depends on FIT
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 4/169 boot: Add a Kconfig for SPL_BOOTSTD_FULL
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
boot/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
boot/Kconfig +4 -0
@@ -408,6 +408,10 @@ config VPL_BOOTSTD boot. It is enabled by default since the main purpose of VPL is to handle the firmware part of VBE. +config SPL_BOOTSTD_FULL + def_bool n # "Enhanced features for standard boot" + depends on BOOTSTD && SPL + if BOOTSTD config BOOTSTD_BOOTCOMMAND
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
Re: [PATCH v2 004/169] boot: Add a Kconfig for SPL_BOOTSTD_FULL
Quoted 3 lines · Simon Glass
This is implicitly used in the source and seems useful, so add it.
Signed-off-by Simon Glass <[email protected]>
All of these types of changes need to be moved to the RFC split config series, where we can no longer rely on the feature of undefined symbols working as expected with CONFIG_IS_ENABLED().
Signature · 1 line
Tom
Re: [PATCH v2 004/169] boot: Add a Kconfig for SPL_BOOTSTD_FULL
Hi Tom,
Quoted 10 lines · Tom Rini
Quoted 3 lines · Simon Glass
This is implicitly used in the source and seems useful, so add it.
Signed-off-by Simon Glass <[email protected]>All of these types of changes need to be moved to the RFC split config series, where we can no longer rely on the feature of undefined symbols working as expected with
CONFIG_IS_ENABLED().
OK I'll give that a crack.
Should I resend this whole series or just mark the affected patches as superseded?
Regards,
Simon
Re: [PATCH v2 004/169] boot: Add a Kconfig for SPL_BOOTSTD_FULL
Quoted 10 lines · Simon Glass
Hi Tom,
Quoted 7 lines · Tom Rini
Quoted 3 lines · Simon Glass
This is implicitly used in the source and seems useful, so add it.
Signed-off-by Simon Glass <[email protected]>
Quoted 8 lines
Quoted 3 lines
All of these types of changes need to be moved to the RFC split config series, where we can no longer rely on the feature of undefined symbols working as expected with
CONFIG_IS_ENABLED().OK I'll give that a crack.
Should I resend this whole series or just mark the affected patches as superseded?
I _think_ the series itself is ordered so that I can just skip the first 20'ish patches, I'll confirm that in the next day or two.
Signature · 1 line
Tom
Re: [PATCH v2 004/169] boot: Add a Kconfig for SPL_BOOTSTD_FULL
Hi Tom,
Quoted 16 lines · Tom Rini
Quoted 14 lines · Simon Glass
Hi Tom,
Quoted 10 lines · Tom Rini
Quoted 3 lines · Simon Glass
This is implicitly used in the source and seems useful, so add it.
Signed-off-by Simon Glass <[email protected]>All of these types of changes need to be moved to the RFC split config series, where we can no longer rely on the feature of undefined symbols working as expected with
CONFIG_IS_ENABLED().
Quoted 7 lines
Quoted 4 lines
OK I'll give that a crack.
Should I resend this whole series or just mark the affected patches as superseded?
I _think_ the series itself is ordered so that I can just skip the first 20'ish patches, I'll confirm that in the next day or two.
Yes it seems OK, except you would also need to drop the RNG patch. I'll resend splc with all the patches and will wait to hear on splb.
Regards,
Simon
PATCH v2 5/169 boot: Add Kconfigs for BOOTMETH_VBE_REQUEST
In reply to Simon GlassAllow this to be enabled separately in U-Boot proper and in SPL, since it is not needed in SPL.
---
(no changes since v1)
boot/Kconfig | 13 +++++++++++++ boot/Makefile | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-)
boot/Kconfig +13 -0
@@ -509,6 +509,19 @@ config VPL_BOOTMETH_VBE if BOOTMETH_VBE +config BOOTMETH_VBE_REQUEST + bool "Support for serving VBE OS requests" + default y + help + Enables support for looking that the requests made by the + Operating System being booted. These requests result in additions to + the device tree /chosen node, added during the device tree fixup + phase. + +config SPL_BOOTMETH_VBE_REQUEST + def_bool n # Support for serving VBE OS requests (SPL) + depends on SPL + config BOOTMETH_VBE_SIMPLE bool "Bootdev support for VBE 'simple' method" default y
boot/Makefile +2 -1
@@ -50,7 +50,8 @@ endif obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE) += expo.o scene.o scene_menu.o -obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE) += vbe.o vbe_request.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE) += vbe.o +obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_REQUEST) += vbe_request.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE) += vbe_simple.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_FW) += vbe_simple_fw.o obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_OS) += vbe_simple_os.o
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 6/169 boot: Add a Kconfig for SPL_BOOTDEV_SPI_FLASH
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/mtd/spi/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/mtd/spi/Kconfig +4 -0
@@ -88,6 +88,10 @@ config BOOTDEV_SPI_FLASH If unsure, say N +config SPL_BOOTDEV_SPI_FLASH + def_bool n # "SPI Flash bootdev support" + depends on SPL_SPI_FLASH_SUPPORT + config SPI_FLASH_SFDP_SUPPORT bool "SFDP table parsing support for SPI NOR flashes" depends on !SPI_FLASH_BAR
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 7/169 boot: Add a Kconfig for SPL_BOOTDEV_ETH
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
net/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
net/Kconfig +4 -0
@@ -34,6 +34,10 @@ config BOOTDEV_ETH an operationg system over the network, using the PXE (Preboot Execution Environment) protocol. +config SPL_BOOTDEV_ETH + def_bool n # "Enable bootdev for ethernet (SPL)" + depends on SPL_BOOTSTD + config BOOTP_SEND_HOSTNAME bool "Send hostname to DNS server" help
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 8/169 dm: Add a Kconfig for SPL_DEVRES
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/core/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/core/Kconfig +4 -0
@@ -275,6 +275,10 @@ config DEVRES non-managed variants. For example, devres_alloc() to kzalloc(), devm_kmalloc() to kmalloc(), etc. +config SPL_DEVRES + def_bool n # Managed device resources (SPL) + depends on SPL_DM + config DEBUG_DEVRES bool "Managed device resources debugging functions" depends on DEVRES
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 9/169 dm: Add a Kconfig for SPL_DM_HWSPINLOCK
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/hwspinlock/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/hwspinlock/Kconfig +4 -0
@@ -5,6 +5,10 @@ config DM_HWSPINLOCK help This option enables U-Boot hardware spinlock support +config SPL_DM_HWSPINLOCK + def_bool n # Enable U-Boot hardware spinlock support (SPL) + depends on SPL + config HWSPINLOCK_SANDBOX bool "Enable Hardware Spinlock support for Sandbox" depends on SANDBOX && DM_HWSPINLOCK
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 10/169 boot: Add a Kconfig for SPL_OF_LIVE
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
dts/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
dts/Kconfig +4 -0
@@ -85,6 +85,10 @@ config OF_LIVE enables a live tree which is available after relocation, and can be adjusted as needed. +config SPL_OF_LIVE + def_bool n # Enable use of a live tree (SPL) + depends on SPL_DM && SPL_OF_CONTROL + choice prompt "Provider of DTB for DT control" depends on OF_CONTROL
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 11/169 cmd: Add a Kconfig for SPL_CRC32_VERIFY
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
cmd/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
cmd/Kconfig +4 -0
@@ -680,6 +680,10 @@ config CRC32_VERIFY help Add -v option to verify data against a crc32 checksum. +config SPL_CRC32_VERIFY + def_bool n # crc32 -v (SPL) + depends on SPL + config CMD_EEPROM bool "eeprom - EEPROM subsystem" help
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 12/169 console: Add a Kconfig for SPL_CONSOLE_MUX et al
In reply to Simon GlassThis and SYS_CONSOLE_IS_IN_ENV are implicitly used in the source and seem useful, so add them.
---
(no changes since v1)
common/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+)
common/Kconfig +8 -0
@@ -235,6 +235,10 @@ config CONSOLE_MUX adds a small amount of size to U-Boot. Changes to the environment variables stdout, stdin and stderr will take effect immediately. +config SPL_CONSOLE_MUX + def_bool n # Enable console multiplexing (SPL) + depends on SPL + config SYS_CONSOLE_IS_IN_ENV bool "Select console devices from the environment" default y if CONSOLE_MUX
@@ -245,6 +249,10 @@ config SYS_CONSOLE_IS_IN_ENV environment variables can be updated after boot to change the input/output devices. +config SPL_SYS_CONSOLE_IS_IN_ENV + def_bool n # Select console devices from the environment (SPL) + depends on SPL + config SYS_CONSOLE_OVERWRITE_ROUTINE bool "Allow board control over console overwriting" help
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 13/169 button: Add a Kconfig for SPL_BUTTON
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/button/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/button/Kconfig +4 -0
@@ -9,6 +9,10 @@ config BUTTON can provide access to board-specific buttons. Use of the device tree for configuration is encouraged. +config SPL_BUTTON + def_bool n # Enable button support (SPL) + depends on SPL + config BUTTON_ADC bool "Button adc" depends on BUTTON
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 14/169 lib: Add a Kconfig for SPL_ERRNO_STR
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
lib/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
lib/Kconfig +4 -0
@@ -782,6 +782,10 @@ config ERRNO_STR - if errno is null or positive number - a pointer to "Success" message - if errno is negative - a pointer to errno related message +config SPL_ERRNO_STR + def_bool n # Enable function for getting errno-related string message (SPL) + depends on SPL + config HEXDUMP bool "Enable hexdump" help
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 15/169 iommu: Add a Kconfig for SPL_IOMMU
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/iommu/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/iommu/Kconfig +4 -0
@@ -14,6 +14,10 @@ config IOMMU memory if the IOMMU has been programmed to allow access to that memory. +config SPL_IOMMU + def_bool n # Enable Driver Model for IOMMU drivers (SPL) + depends on SPL_DM + config APPLE_DART bool "Apple DART support" depends on IOMMU && ARCH_APPLE
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 16/169 pinctrl: Add a Kconfig for SPL_PINCTRL_ARMADA_38X
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
Changes in v2:
- Correct the tag
drivers/pinctrl/mvebu/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/pinctrl/mvebu/Kconfig +4 -0
@@ -7,6 +7,10 @@ config PINCTRL_ARMADA_38X Support pin multiplexing and pin configuration control on Marvell's Armada-38x SoC. +config SPL_PINCTRL_ARMADA_38X + def_bool n # Armada 38x pin control driver (SPL) + depends on SPL && ARMADA_38X && SPL_PINCTRL_FULL + config PINCTRL_ARMADA_37XX depends on ARMADA_3700 && PINCTRL_FULL bool "Armada 37xx pin control driver"
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 17/169 virtio: Add a Kconfig for SPL_VIRTIO
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/virtio/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/virtio/Kconfig +4 -0
@@ -22,6 +22,10 @@ config VIRTIO This option is selected by any driver which implements the virtio transport, such as CONFIG_VIRTIO_MMIO or CONFIG_VIRTIO_PCI. +config SPL_VIRTIO + def_bool n + depends on SPL + config VIRTIO_MMIO bool "Platform bus driver for memory mapped virtio devices" select VIRTIO
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 18/169 lib: Add a Kconfig for SPL_BZIP2
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
lib/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+)
lib/Kconfig +6 -0
@@ -727,6 +727,12 @@ config ZSTD_LIB_MINIFY endif +config SPL_BZIP2 + bool "Enable bzip2 decompression support for SPL build" + depends on SPL + help + This enables support for bzip2 compression algorithm for SPL boot. + config SPL_LZ4 bool "Enable LZ4 decompression support in SPL" depends on SPL
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 19/169 acpi: Add a Kconfig for SPL_ACPIGEN
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/core/Kconfig | 3 +++ 1 file changed, 3 insertions(+)
drivers/core/Kconfig +3 -0
@@ -453,6 +453,9 @@ config ACPIGEN things like generating device-specific tables and returning the ACPI name of a device. +config SPL_ACPIGEN + def_bool n + config BOUNCE_BUFFER bool "Include bounce buffer API" help
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 20/169 rockchip: Add a Kconfig for SPL_RESET_ROCKCHIP
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/reset/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/reset/Kconfig +4 -0
@@ -99,6 +99,10 @@ config RESET_ROCKCHIP though is that some reset signals, like I2C or MISC reset multiple devices. +config SPL_RESET_ROCKCHIP + def_bool n # Reset controller driver for Rockchip SoCs (SPL) + depends on SPL_DM_RESET && ARCH_ROCKCHIP && SPL_CLK + config RESET_HSDK bool "Synopsys HSDK Reset Driver" depends on DM_RESET && TARGET_HSDK
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 21/169 mediatek: Add a Kconfig for SPL_RESET_MEDIATEK
In reply to Simon GlassThis is implicitly used in the source and seems useful, so add it.
---
(no changes since v1)
drivers/reset/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
drivers/reset/Kconfig +4 -0
@@ -132,6 +132,10 @@ config RESET_MEDIATEK help Support for reset controller on MediaTek SoCs. +config SPL_RESET_MEDIATEK + def_bool n # Reset controller driver for MediaTek SoCs (SPL) + depends on SPL_DM_RESET && ARCH_MEDIATEK && SPL_CLK + config RESET_MTMIPS bool "Reset controller driver for MediaTek MIPS platform" depends on DM_RESET && ARCH_MTMIPS
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 22/169 Correct SPL use of A003399_NOR_WORKAROUND
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_A003399_NOR_WORKAROUND defined in Kconfig
---
(no changes since v1)
drivers/misc/fsl_ifc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fsl_ifc.c +1 -1
@@ -371,7 +371,7 @@ void init_early_memctl_regs(void)for (i =0 ; i < regs_info.cs_size; i++) {if (regs[i].pr && (regs[i].pr &CSPR_V )) {/* skip setting cspr/csor_ext in below condition */ -if (!(CONFIG_IS_ENABLED (A003399_NOR_WORKAROUND ) && +if (!(IS_ENABLED (CONFIG_A003399_NOR_WORKAROUND ) && i ==0 && ((regs[0 ].pr &CSPR_MSEL ) ==CSPR_MSEL_NOR ))) {if (regs[i].pr_ext)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 23/169 Correct SPL use of AHCI
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_AHCI defined in Kconfig
---
(no changes since v1)
board/compulab/cm_fx6/cm_fx6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/compulab/cm_fx6/cm_fx6.c +1 -1
@@ -736,7 +736,7 @@ U_BOOT_DRVINFO(cm_fx6_serial) = { .plat = &cm_fx6_mxc_serial_plat, }; -#if CONFIG_IS_ENABLED (AHCI ) +#if IS_ENABLED (CONFIG_AHCI )static int sata_imx_probe (struct udevice *dev) {int i, err;
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 24/169 Correct SPL uses of ALLEYCAT_5
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_ALLEYCAT_5 defined in Kconfig
---
(no changes since v1)
arch/arm/mach-mvebu/arm64-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/arm64-common.c +2 -2
@@ -53,7 +53,7 @@ __weak int dram_init_banksize(void)return a8k_dram_init_banksize (); else if (CONFIG_IS_ENABLED(ARMADA_3700)) return a3700_dram_init_banksize(); - else if (CONFIG_IS_ENABLED(ALLEYCAT_5)) + else if (IS_ENABLED(CONFIG_ALLEYCAT_5)) return alleycat5_dram_init_banksize(); else return fdtdec_setup_memory_banksize();
@@ -70,7 +70,7 @@ __weak int dram_init(void)if (CONFIG_IS_ENABLED (ARMADA_3700 ))return a3700_dram_init (); -if (CONFIG_IS_ENABLED (ALLEYCAT_5 )) +if (IS_ENABLED (CONFIG_ALLEYCAT_5 ))return alleycat5_dram_init ();if (fdtdec_setup_mem_size_base () !=0 )
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 25/169 Correct SPL uses of ARCH_MVEBU
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_ARCH_MVEBU defined in Kconfig
---
(no changes since v1)
drivers/mmc/mv_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mv_sdhci.c +2 -2
@@ -64,7 +64,7 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) host->ops = &mv_ops;#endif -if (CONFIG_IS_ENABLED (ARCH_MVEBU )) { +if (IS_ENABLED (CONFIG_ARCH_MVEBU )) {/* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config ((void __iomem *)regbase); }
@@ -103,7 +103,7 @@ static int mv_sdhci_probe(struct udevice *dev)if (ret)return ret; -if (CONFIG_IS_ENABLED (ARCH_MVEBU )) { +if (IS_ENABLED (CONFIG_ARCH_MVEBU )) {/* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config (host->ioaddr); }
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
Re: [PATCH v2 025/169] Correct SPL uses of ARCH_MVEBU
Quoted 25 lines · Simon Glass
This converts 2 usages of this option to the non-SPL form, since there is no
SPL_ARCH_MVEBUdefined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/mmc/mv_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/mv_sdhci.c +1
-1@@ -64,7 +64,7 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) host->ops = &mv_ops;#endif -if (CONFIG_IS_ENABLED (ARCH_MVEBU )) { +if (IS_ENABLED (CONFIG_ARCH_MVEBU )) {/* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config ((void __iomem *)regbase); }
drivers/mmc/mv_sdhci.c static int mv_sdhci_probe(struct udevice *dev) · line 109
Quoted 8 lines
drivers/mmc/mv_sdhci.c +1
-1@@ -103,7 +103,7 @@ static int mv_sdhci_probe(struct udevice *dev)if (ret)return ret; -if (CONFIG_IS_ENABLED (ARCH_MVEBU )) { +if (IS_ENABLED (CONFIG_ARCH_MVEBU )) {/* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config (host->ioaddr); }
So, a number of mvebu platforms now grow their SPL here, which is (a) a functional change and (b) implies it's intentional. I'm adding Stefan here to start to get a better handle on if this really should be like this, or not.
Signature · 1 line
Tom
Re: [PATCH v2 025/169] Correct SPL uses of ARCH_MVEBU
Quoted 30 lines · Tom Rini
Quoted 28 lines · Simon Glass
This converts 2 usages of this option to the non-SPL form, since there is no
SPL_ARCH_MVEBUdefined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/mmc/mv_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/mv_sdhci.c +1
-1@@ -64,7 +64,7 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) host->ops = &mv_ops;#endif -if (CONFIG_IS_ENABLED (ARCH_MVEBU )) { +if (IS_ENABLED (CONFIG_ARCH_MVEBU )) {/* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config ((void __iomem *)regbase); }@@ -103,7 +103,7 @@ static int mv_sdhci_probe(struct udevice *dev)if (ret)return ret;
Quoted 10 lines
drivers/mmc/mv_sdhci.c static int mv_sdhci_probe(struct udevice *dev) · line 109
Quoted 5 lines
drivers/mmc/mv_sdhci.c +1
-1-if (CONFIG_IS_ENABLED (ARCH_MVEBU )) { +if (IS_ENABLED (CONFIG_ARCH_MVEBU )) {/* Configure SDHCI MBUS mbus bridge windows */ sdhci_mvebu_mbus_config (host->ioaddr); }So, a number of mvebu platforms now grow their SPL here, which is (a) a functional change and (b) implies it's intentional. I'm adding Stefan here to start to get a better handle on if this really should be like this, or not.
I just checked this driver and it already depends on ARCH_MVEBU via Kconfig. Even when used in SPL, the mbus windows should be configured, even though I doubt that any target is using this driver in SPL.
I'll send a patchset to clean up this driver shortly. This patch can be dropped then.
Thanks,
Stefan
PATCH v2 27/169 Correct SPL use of ARCH_ZYNQ
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_ARCH_ZYNQ defined in Kconfig
---
(no changes since v1)
board/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/common/board.c +1 -1
@@ -419,7 +419,7 @@ int board_late_init_xilinx(void) ret |=env_set_hex ("scriptaddr" , gd->ram_base + scriptaddr); } -if (CONFIG_IS_ENABLED (ARCH_ZYNQ ) ||CONFIG_IS_ENABLED (MICROBLAZE )) +if (IS_ENABLED (CONFIG_ARCH_ZYNQ ) ||CONFIG_IS_ENABLED (MICROBLAZE )) bootm_size =min (bootm_size, (phys_size_t)(SZ_512M +SZ_256M )); ret |=env_set_hex ("script_offset_f" ,CONFIG_BOOT_SCRIPT_OFFSET );
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 28/169 Correct SPL use of ARM64
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_ARM64 defined in Kconfig
---
(no changes since v1)
arch/arm/mach-imx/imx_bootaux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/imx_bootaux.c +1 -1
@@ -106,7 +106,7 @@ int arch_auxiliary_core_up(u32 core_id, ulong addr)if (!pc)return CMD_RET_FAILURE ; -if (!CONFIG_IS_ENABLED (ARM64 )) +if (!IS_ENABLED (CONFIG_ARM64 )) stack =0x0 ; }else {/*
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 29/169 Correct SPL uses of ARMADA_3700
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_ARMADA_3700 defined in Kconfig
---
(no changes since v1)
arch/arm/mach-mvebu/arm64-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/arm64-common.c +2 -2
@@ -51,7 +51,7 @@ __weak int dram_init_banksize(void) {if (CONFIG_IS_ENABLED (ARMADA_8K ))return a8k_dram_init_banksize (); -else if (CONFIG_IS_ENABLED (ARMADA_3700 )) +else if (IS_ENABLED (CONFIG_ARMADA_3700 ))return a3700_dram_init_banksize ();else if (IS_ENABLED (CONFIG_ALLEYCAT_5 ))return alleycat5_dram_init_banksize ();
@@ -67,7 +67,7 @@ __weak int dram_init(void)return 0 ; } -if (CONFIG_IS_ENABLED (ARMADA_3700 )) +if (IS_ENABLED (CONFIG_ARMADA_3700 ))return a3700_dram_init ();if (IS_ENABLED (CONFIG_ALLEYCAT_5 ))
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 30/169 Correct SPL uses of ARMADA_8K
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_ARMADA_8K defined in Kconfig
---
(no changes since v1)
arch/arm/mach-mvebu/arm64-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/arm64-common.c +2 -2
@@ -49,7 +49,7 @@ const struct mbus_dram_target_info *mvebu_mbus_dram_info(void)__weak int dram_init_banksize (void ) { -if (CONFIG_IS_ENABLED (ARMADA_8K )) +if (IS_ENABLED (CONFIG_ARMADA_8K ))return a8k_dram_init_banksize ();else if (IS_ENABLED (CONFIG_ARMADA_3700 ))return a3700_dram_init_banksize ();
@@ -61,7 +61,7 @@ __weak int dram_init_banksize(void)__weak int dram_init (void ) { -if (CONFIG_IS_ENABLED (ARMADA_8K )) { +if (IS_ENABLED (CONFIG_ARMADA_8K )) { gd->ram_size =a8k_dram_scan_ap_sz ();if (gd->ram_size !=0 )return 0 ;
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 31/169 Correct SPL use of ATMEL_PIO4
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_ATMEL_PIO4 defined in Kconfig
---
(no changes since v1)
drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-at91-pio4.c +1 -1
@@ -271,7 +271,7 @@ static int atmel_pinctrl_bind(struct udevice *dev)ofnode node =dev_ofnode (dev);struct atmel_pinctrl_data *priv = (struct atmel_pinctrl_data *)dev_get_driver_data (dev); -if (!CONFIG_IS_ENABLED (ATMEL_PIO4 )) +if (!IS_ENABLED (CONFIG_ATMEL_PIO4 ))return 0 ;/* Obtain a handle to the GPIO driver */
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
Re: [PATCH v2 031/169] Correct SPL use of ATMEL_PIO4
Quoted 16 lines · Simon Glass
This converts 1 usage of this option to the non-SPL form, since there is no
SPL_ATMEL_PIO4defined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/pinctrl-at91-pio4.c +0
-0
drivers/pinctrl/pinctrl-at91-pio4.c static int atmel_pinctrl_bind(struct udevice *dev) · line 277
Quoted 8 lines
drivers/pinctrl/pinctrl-at91-pio4.c +1
-1@@ -271,7 +271,7 @@ static int atmel_pinctrl_bind(struct udevice *dev)ofnode node =dev_ofnode (dev);struct atmel_pinctrl_data *priv = (struct atmel_pinctrl_data *)dev_get_driver_data (dev); -if (!CONFIG_IS_ENABLED (ATMEL_PIO4 )) +if (!IS_ENABLED (CONFIG_ATMEL_PIO4 ))return 0 ;/* Obtain a handle to the GPIO driver */
This grows SPL in a number of platforms, so adding in Eugen to see if we really do want to omit this here in SPL on platforms that otherwise set the symbol.
Signature · 1 line
Tom
Re: [PATCH v2 031/169] Correct SPL use of ATMEL_PIO4
Quoted 25 lines · Tom Rini
Quoted 23 lines · Simon Glass
This converts 1 usage of this option to the non-SPL form, since there is no
SPL_ATMEL_PIO4defined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/pinctrl-at91-pio4.c +1
-1@@ -271,7 +271,7 @@ static int atmel_pinctrl_bind(struct udevice *dev)ofnode node =dev_ofnode (dev);struct atmel_pinctrl_data *priv = (struct atmel_pinctrl_data *)dev_get_driver_data (dev); -if (!CONFIG_IS_ENABLED (ATMEL_PIO4 )) +if (!IS_ENABLED (CONFIG_ATMEL_PIO4 ))return 0 ;
Quoted 6 lines
drivers/pinctrl/pinctrl-at91-pio4.c static int atmel_pinctrl_bind(struct udevice *dev) · line 277
Quoted 1 line
drivers/pinctrl/pinctrl-at91-pio4.c +0
-0/* Obtain a handle to the GPIO driver */ This grows SPL in a number of platforms, so adding in Eugen to see if we really do want to omit this here in SPL on platforms that otherwise set the symbol.
Hi Simon, Tom,
The growth is because the compiler will now include in SPL all the code below the check ? The respective code is not conditionally compiled, so I am trying to see why the growth. The solution would be to guard all the below code in the function (or the whole bind itself) by #ifndef CONFIG_SPL_BUILD ?
Eugen
Re: [PATCH v2 031/169] Correct SPL use of ATMEL_PIO4
Quoted 31 lines · Eugen Hristev
Quoted 13 lines · Tom Rini
Quoted 11 lines · Simon Glass
This converts 1 usage of this option to the non-SPL form, since there is no
SPL_ATMEL_PIO4defined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
drivers/pinctrl/pinctrl-at91-pio4.c static int atmel_pinctrl_bind(struct udevice *dev) · line 275
Quoted 11 lines
drivers/pinctrl/pinctrl-at91-pio4.c +1
-1@@ -271,7 +271,7 @@ static int atmel_pinctrl_bind(struct udevice *dev)ofnode node =dev_ofnode (dev);struct atmel_pinctrl_data *priv = (struct atmel_pinctrl_data *)dev_get_driver_data (dev); -if (!CONFIG_IS_ENABLED (ATMEL_PIO4 )) +if (!IS_ENABLED (CONFIG_ATMEL_PIO4 ))return 0 ;/* Obtain a handle to the GPIO driver */ This grows SPL in a number of platforms, so adding in Eugen to see if we really do want to omit this here in SPL on platforms that otherwise set the symbol.
Quoted 7 lines
Hi Simon, Tom,
The growth is because the compiler will now include in SPL all the code below the check ? The respective code is not conditionally compiled, so I am trying to see why the growth. The solution would be to guard all the below code in the function (or the whole bind itself) by #ifndef
CONFIG_SPL_BUILD?
Correct, Simon's change causes it to be included in SPL and not optimized out. My question is, are we intentionally omitting the code here, in that case? Or should we be including it in SPL and Simon's change of macro is correct.
Signature · 1 line
Tom
Eugen Hristev
Reviewed-byRe: [PATCH v2 031/169] Correct SPL use of ATMEL_PIO4
Quoted 40 lines · Tom Rini
Quoted 31 lines · Eugen Hristev
Quoted 13 lines · Tom Rini
Quoted 11 lines · Simon Glass
This converts 1 usage of this option to the non-SPL form, since there is no
SPL_ATMEL_PIO4defined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
drivers/pinctrl/pinctrl-at91-pio4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 16 lines
drivers/pinctrl/pinctrl-at91-pio4.c static int atmel_pinctrl_bind(struct udevice *dev) · line 275
Quoted 11 lines
drivers/pinctrl/pinctrl-at91-pio4.c +1
-1@@ -271,7 +271,7 @@ static int atmel_pinctrl_bind(struct udevice *dev)ofnode node =dev_ofnode (dev);struct atmel_pinctrl_data *priv = (struct atmel_pinctrl_data *)dev_get_driver_data (dev); -if (!CONFIG_IS_ENABLED (ATMEL_PIO4 )) +if (!IS_ENABLED (CONFIG_ATMEL_PIO4 ))return 0 ;/* Obtain a handle to the GPIO driver */ This grows SPL in a number of platforms, so adding in Eugen to see if we really do want to omit this here in SPL on platforms that otherwise set the symbol.
Quoted 7 lines
Hi Simon, Tom,
The growth is because the compiler will now include in SPL all the code below the check ? The respective code is not conditionally compiled, so I am trying to see why the growth. The solution would be to guard all the below code in the function (or the whole bind itself) by #ifndef
CONFIG_SPL_BUILD?
Quoted 5 lines
Correct, Simon's change causes it to be included in SPL and not optimized out. My question is, are we intentionally omitting the code here, in that case? Or should we be including it in SPL and Simon's change of macro is correct.
To give a bit of a background: in Linux, the GPIO and Pinctrl driver are one and the same. In U-boot, as we have two different Uclasses, there are two distinct drivers. However to keep the bindings match, only one of the drivers is instantiated through the devicetree. This driver will instantiate the second.
However there is a possible case where the other driver is not selected in defconfig, hence this check that Simon is changing.
If we use DT in SPL, and we need the other driver , and not use the non-DM variant, then I say that the code is required in SPL.
The problem with most at91 processors is that the SPL is already too large to fit in the internal SRAM. So unless there is a lot of investment to make it smaller, SPL will no longer work anyway for at91. But I guess that if we want to have DM and both pinctrl+gpio drivers in SPL, Simon's change is correct. Without it, the bind for the gpio driver will no longer happen in SPL.
PATCH v2 32/169 Correct SPL use of BNXT_ETH
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_BNXT_ETH defined in Kconfig
---
(no changes since v1)
board/broadcom/bcmns3/ns3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/broadcom/bcmns3/ns3.c +1 -1
@@ -150,7 +150,7 @@ int board_init(void)if (bl33_info->version !=BL33_INFO_VERSION )printf ("*** warning: ATF BL31 and U-Boot not in sync! ***\n" ); -#if CONFIG_IS_ENABLED (BNXT_ETH ) +#if IS_ENABLED (CONFIG_BNXT_ETH )if (chimp_fastboot_optee () !=0 )printf ("*** warning: secure chimp fastboot failed! ***\n" );#endif
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 33/169 Correct SPL use of BOOTSTAGE_FDT
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_BOOTSTAGE_FDT defined in Kconfig
---
(no changes since v1)
arch/mips/lib/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/lib/bootm.c +1 -1
@@ -284,7 +284,7 @@ static void boot_jump_linux(struct bootm_headers *images)if (CONFIG_IS_ENABLED (MALTA )) linux_extra = gd->ram_size; -#if CONFIG_IS_ENABLED (BOOTSTAGE_FDT ) +#if IS_ENABLED (CONFIG_BOOTSTAGE_FDT )bootstage_fdt_add_report ();#endif #if CONFIG_IS_ENABLED (BOOTSTAGE_REPORT )
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 34/169 Correct SPL uses of BOOTSTAGE_REPORT
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_BOOTSTAGE_REPORT defined in Kconfig
---
(no changes since v1)
arch/mips/lib/bootm.c | 2 +- arch/x86/lib/bootm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/lib/bootm.c +1 -1
@@ -287,7 +287,7 @@ static void boot_jump_linux(struct bootm_headers *images)#if IS_ENABLED (CONFIG_BOOTSTAGE_FDT )bootstage_fdt_add_report ();#endif -#if CONFIG_IS_ENABLED (BOOTSTAGE_REPORT ) +#if IS_ENABLED (CONFIG_BOOTSTAGE_REPORT )bootstage_report ();#endif
arch/x86/lib/bootm.c +1 -1
@@ -39,7 +39,7 @@ void bootm_announce_and_cleanup(void)timestamp_add_now (TS_START_KERNEL );#endif bootstage_mark_name (BOOTSTAGE_ID_BOOTM_HANDOFF ,"start_kernel" ); -#if CONFIG_IS_ENABLED (BOOTSTAGE_REPORT ) +#if IS_ENABLED (CONFIG_BOOTSTAGE_REPORT )bootstage_report ();#endif
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 35/169 Correct SPL use of CMD_BCB
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_BCB defined in Kconfig
---
(no changes since v1)
include/bcb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/bcb.h +1 -1
@@ -8,7 +8,7 @@#ifndef __BCB_H__#define __BCB_H__ -#if CONFIG_IS_ENABLED (CMD_BCB ) +#if IS_ENABLED (CONFIG_CMD_BCB )int bcb_write_reboot_reason (int devnum,char *partp,const char *reasonp);#else #include <linux/errno.h>
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 37/169 Correct SPL use of CMD_BOOTI
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_BOOTI defined in Kconfig
---
(no changes since v1)
boot/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/bootm.c +1 -1
@@ -226,7 +226,7 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc, }if (images.os.type ==IH_TYPE_KERNEL_NOLOAD ) { -if (CONFIG_IS_ENABLED (CMD_BOOTI ) && +if (IS_ENABLED (CONFIG_CMD_BOOTI ) && images.os.arch ==IH_ARCH_ARM64 ) {ulong image_addr;ulong image_size;
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 38/169 Correct SPL uses of CMD_BOOTM_PRE_LOAD
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_BOOTM_PRE_LOAD defined in Kconfig
---
(no changes since v1)
boot/bootm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
boot/bootm.c +2 -2
@@ -100,7 +100,7 @@ static int bootm_pre_load(struct cmd_tbl *cmdtp, int flag, int argc,ulong data_addr =bootm_data_addr (argc, argv);int ret =0 ; -if (CONFIG_IS_ENABLED (CMD_BOOTM_PRE_LOAD )) +if (IS_ENABLED (CONFIG_CMD_BOOTM_PRE_LOAD )) ret =image_pre_load (data_addr);if (ret)
@@ -893,7 +893,7 @@ static const void *boot_get_kernel(struct cmd_tbl *cmdtp, int flag, int argc, &fit_uname_config, &fit_uname_kernel); -if (CONFIG_IS_ENABLED (CMD_BOOTM_PRE_LOAD )) +if (IS_ENABLED (CONFIG_CMD_BOOTM_PRE_LOAD )) img_addr += image_load_offset;bootstage_mark (BOOTSTAGE_ID_CHECK_MAGIC );
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 39/169 Correct SPL use of CMD_BOOTZ
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_BOOTZ defined in Kconfig
---
(no changes since v1)
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c +1 -1
@@ -150,7 +150,7 @@ static int do_stm32prog(struct cmd_tbl *cmdtp, int flag, int argc,/* Try bootm for legacy and FIT format image */ if (genimg_get_format (uimage) !=IMAGE_FORMAT_INVALID )do_bootm (cmdtp,0 ,4 , bootm_argv); -else if (CONFIG_IS_ENABLED (CMD_BOOTZ )) +else if (IS_ENABLED (CONFIG_CMD_BOOTZ ))do_bootz (cmdtp,0 ,4 , bootm_argv); }if (data->script)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 40/169 Correct SPL uses of CMD_CLK
In reply to Simon GlassThis converts 7 usages of this option to the non-SPL form, since there is no SPL_CMD_CLK defined in Kconfig
---
(no changes since v1)
drivers/clk/clk_k210.c | 6 +++--- drivers/clk/imx/clk-imx8.c | 2 +- drivers/clk/imx/clk-imx8.h | 2 +- drivers/clk/imx/clk-imx8qm.c | 2 +- drivers/clk/imx/clk-imx8qxp.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)
drivers/clk/clk_k210.c +3 -3
@@ -308,7 +308,7 @@ enum k210_clk_flags {* @gate: An &enum k210_gate_id of this clock's gate */ struct k210_clk_params { -#if CONFIG_IS_ENABLED (CMD_CLK ) +#if IS_ENABLED (CONFIG_CMD_CLK )const char *name;#endif u8 flags;
@@ -326,7 +326,7 @@ struct k210_clk_params { };static const struct k210_clk_params k210_clks[] = { -#if CONFIG_IS_ENABLED(CMD_CLK) +#if IS_ENABLED(CONFIG_CMD_CLK) #define NAME(_name) .name = (_name), #else #define NAME(name)
@@ -1284,7 +1284,7 @@ U_BOOT_DRIVER(k210_clk) = { .priv_auto = sizeof(struct k210_clk_priv), }; -#if CONFIG_IS_ENABLED (CMD_CLK ) +#if IS_ENABLED (CONFIG_CMD_CLK )static char show_enabled (struct k210_clk_priv *priv,int id) {bool enabled;
drivers/clk/imx/clk-imx8.c +1 -1
@@ -42,7 +42,7 @@ static int imx8_clk_enable(struct clk *clk)return __imx8_clk_enable (clk,1 ); } -#if CONFIG_IS_ENABLED (CMD_CLK ) +#if IS_ENABLED (CONFIG_CMD_CLK )int soc_clk_dump (void ) {struct udevice *dev;
drivers/clk/imx/clk-imx8.h +1 -1
@@ -9,7 +9,7 @@ struct imx8_clks {const char *name; }; -#if CONFIG_IS_ENABLED (CMD_CLK ) +#if IS_ENABLED (CONFIG_CMD_CLK )extern struct imx8_clks imx8_clk_names[];extern int num_clks;#endif
drivers/clk/imx/clk-imx8qm.c +1 -1
@@ -16,7 +16,7 @@#include "clk-imx8.h" -#if CONFIG_IS_ENABLED (CMD_CLK ) +#if IS_ENABLED (CONFIG_CMD_CLK )struct imx8_clks imx8_clk_names[] = { {IMX8QM_A53_DIV ,"A53_DIV" }, { IMX8QM_UART0_CLK, "UART0" },
drivers/clk/imx/clk-imx8qxp.c +1 -1
@@ -16,7 +16,7 @@#include "clk-imx8.h" -#if CONFIG_IS_ENABLED (CMD_CLK ) +#if IS_ENABLED (CONFIG_CMD_CLK )struct imx8_clks imx8_clk_names[] = { {IMX8QXP_A35_DIV ,"A35_DIV" }, { IMX8QXP_I2C0_CLK, "I2C0" },
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 41/169 Correct SPL uses of CMD_DHCP
In reply to Simon GlassThis converts 7 usages of this option to the non-SPL form, since there is no SPL_CMD_DHCP defined in Kconfig
---
(no changes since v1)
include/configs/am335x_evm.h | 2 +- include/configs/imx8mm-cl-iot-gate.h | 2 +- include/configs/imx8mp_rsb3720.h | 2 +- include/configs/j721e_evm.h | 2 +- include/configs/qemu-arm.h | 2 +- include/configs/rockchip-common.h | 2 +- include/configs/rpi.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
include/configs/am335x_evm.h +1 -1
@@ -59,7 +59,7 @@# define BOOT_TARGET_PXE (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )# define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else # define BOOT_TARGET_DHCP (func)
include/configs/imx8mm-cl-iot-gate.h +1 -1
@@ -50,7 +50,7 @@# define BOOT_TARGET_PXE (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )# define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else # define BOOT_TARGET_DHCP (func)
include/configs/imx8mp_rsb3720.h +1 -1
@@ -53,7 +53,7 @@# define BOOT_TARGET_PXE (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )# define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else # define BOOT_TARGET_DHCP (func)
include/configs/j721e_evm.h +1 -1
@@ -155,7 +155,7 @@# define BOOT_TARGET_PXE (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )# define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else # define BOOT_TARGET_DHCP (func)
include/configs/qemu-arm.h +1 -1
@@ -60,7 +60,7 @@# define BOOT_TARGET_NVME (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )# define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else # define BOOT_TARGET_DHCP (func)
include/configs/rockchip-common.h +1 -1
@@ -44,7 +44,7 @@#define BOOT_TARGET_PXE (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )#define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else #define BOOT_TARGET_DHCP (func)
include/configs/rpi.h +1 -1
@@ -143,7 +143,7 @@#define BOOT_TARGET_PXE (func)#endif -#if CONFIG_IS_ENABLED (CMD_DHCP ) +#if IS_ENABLED (CONFIG_CMD_DHCP )#define BOOT_TARGET_DHCP (func) func(DHCP, dhcp, na)#else #define BOOT_TARGET_DHCP (func)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
Re: [PATCH v2 041/169] Correct SPL uses of CMD_DHCP
Quoted 8 lines · Simon Glass
This converts 7 usages of this option to the non-SPL form, since there is no
SPL_CMD_DHCPdefined inKconfigSigned-off-by Simon Glass <[email protected]>---
(no changes since v1)
Quoted 8 lines
include/configs/am335x_evm.h | 2 +- include/configs/imx8mm-cl-iot-gate.h | 2 +- include/configs/imx8mp_rsb3720.h | 2 +- include/configs/j721e_evm.h | 2 +- include/configs/qemu-arm.h | 2 +- include/configs/rockchip-common.h | 2 +- include/configs/rpi.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
So this, and a few other CMD cases are special. We have in SPL, ENV_NOWHERE for various good and valid use cases. So we want to limit the size of the default environment. We also use the generic distro bootcmd framework on these boards. So CONFIG_IS_ENABLED(CMD_FOO) gets used to nop out the boot targets we don't need taking up space. It's not a fatal problem to change these, but I'm not going to pick these changes up just yet.
Signature · 1 line
Tom
PATCH v2 42/169 Correct SPL uses of CMD_EFICONFIG
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_EFICONFIG defined in Kconfig
---
(no changes since v1)
cmd/bootmenu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/bootmenu.c +2 -2
@@ -223,7 +223,7 @@ static int prepare_bootmenu_entry(struct bootmenu_data *menu,return 1 ; } -#if (IS_ENABLED (CONFIG_CMD_BOOTEFI_BOOTMGR )) && (CONFIG_IS_ENABLED (CMD_EFICONFIG )) +#if (IS_ENABLED (CONFIG_CMD_BOOTEFI_BOOTMGR )) && (IS_ENABLED (CONFIG_CMD_EFICONFIG ))/** * prepare_uefi_bootorder_entry() - generate the uefi bootmenu entries *
@@ -343,7 +343,7 @@ static struct bootmenu_data *bootmenu_create(int delay)if (ret <0 ) goto cleanup; -#if (IS_ENABLED (CONFIG_CMD_BOOTEFI_BOOTMGR )) && (CONFIG_IS_ENABLED (CMD_EFICONFIG )) +#if (IS_ENABLED (CONFIG_CMD_BOOTEFI_BOOTMGR )) && (IS_ENABLED (CONFIG_CMD_EFICONFIG ))if (i <MAX_COUNT -1 ) {efi_status_t efi_ret;
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 43/169 Correct SPL use of CMD_ERASEENV
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_ERASEENV defined in Kconfig
---
(no changes since v1)
include/env_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/env_internal.h +1 -1
@@ -189,7 +189,7 @@ struct env_driver {#endif #define ENV_SAVE_PTR (x) (CONFIG_IS_ENABLED(SAVEENV) ? (x) : NULL) -#define ENV_ERASE_PTR (x) (CONFIG_IS_ENABLED(CMD_ERASEENV) ? (x) : NULL) +#define ENV_ERASE_PTR (x) (IS_ENABLED(CONFIG_CMD_ERASEENV) ? (x) : NULL)extern struct hsearch_data env_htab;
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 44/169 Correct SPL uses of CMD_FDT
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_FDT defined in Kconfig
---
(no changes since v1)
boot/bootm.c | 2 +- boot/image-fdt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
boot/bootm.c +1 -1
@@ -313,7 +313,7 @@ int bootm_find_images(int flag, int argc, char *const argv[], ulong start, return 1; } -if (CONFIG_IS_ENABLED (CMD_FDT )) +if (IS_ENABLED (CONFIG_CMD_FDT ))set_working_fdt_addr (map_to_sysmem (images.ft_addr));#endif
boot/image-fdt.c +1 -1
@@ -272,7 +272,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size) *of_flat_tree = of_start; *of_size = of_len; -if (CONFIG_IS_ENABLED (CMD_FDT )) +if (IS_ENABLED (CONFIG_CMD_FDT ))set_working_fdt_addr (map_to_sysmem (*of_flat_tree));return 0 ;
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 45/169 Correct SPL use of CMD_FRU
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_FRU defined in Kconfig
---
(no changes since v1)
board/xilinx/common/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/common/board.c +1 -1
@@ -306,7 +306,7 @@ static int xilinx_read_eeprom_single(char *name,debug ("%s: i2c memory detected: %s\n" , __func__, name); -if (CONFIG_IS_ENABLED (CMD_FRU ) &&xilinx_detect_fru (buffer)) +if (IS_ENABLED (CONFIG_CMD_FRU ) &&xilinx_detect_fru (buffer))return xilinx_read_eeprom_fru (dev, name, desc);if (xilinx_detect_legacy (buffer))
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 46/169 Correct SPL use of CMD_HASH
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_HASH defined in Kconfig
---
(no changes since v1)
common/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/hash.c +1 -1
@@ -327,7 +327,7 @@ static struct hash_algo hash_algo[] = {/* Try to minimize code size for boards that don't want much hashing */ #if CONFIG_IS_ENABLED (SHA256 ) ||CONFIG_IS_ENABLED (CMD_SHA1SUM ) || \ -CONFIG_IS_ENABLED (CRC32_VERIFY ) ||CONFIG_IS_ENABLED (CMD_HASH ) || \ +CONFIG_IS_ENABLED (CRC32_VERIFY ) ||IS_ENABLED (CONFIG_CMD_HASH ) || \CONFIG_IS_ENABLED (SHA384 ) ||CONFIG_IS_ENABLED (SHA512 )#define multi_hash () 1#else
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 47/169 Correct SPL use of CMD_MBR
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_MBR defined in Kconfig
---
(no changes since v1)
disk/part_dos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
disk/part_dos.c +1 -1
@@ -318,7 +318,7 @@ int is_valid_dos_buf(void *buf)return test_block_type (buf) ==DOS_MBR ?0 :-1 ; } -#if CONFIG_IS_ENABLED (CMD_MBR ) +#if IS_ENABLED (CONFIG_CMD_MBR )static void lba_to_chs (lbaint_t lba,unsigned char *rc,unsigned char *rh,unsigned char *rs) {
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 48/169 Correct SPL uses of CMD_MMC
In reply to Simon GlassThis converts 6 usages of this option to the non-SPL form, since there is no SPL_CMD_MMC defined in Kconfig
---
(no changes since v1)
include/configs/am62ax_evm.h | 4 ++-- include/configs/imx8mm-cl-iot-gate.h | 2 +- include/configs/imx8mp_rsb3720.h | 2 +- include/configs/rockchip-common.h | 2 +- include/configs/rpi.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
include/configs/am62ax_evm.h +2 -2
@@ -71,12 +71,12 @@#define BOOTENV_DEV_NAME_TI_MMC (devtyeu, devtypel, instance) \ "ti_mmc " -#if CONFIG_IS_ENABLED (CMD_MMC ) +#if IS_ENABLED (CONFIG_CMD_MMC )#define BOOT_TARGET_MMC (func) \ func(TI_MMC, ti_mmc, na)#else #define BOOT_TARGET_MMC (func) -#endif /* CONFIG_IS_ENABLED(CMD_MMC) */ +#endif /* IS_ENABLED(CONFIG_CMD_MMC) */ #define BOOT_TARGET_DEVICES (func) \ BOOT_TARGET_MMC(func)
include/configs/imx8mm-cl-iot-gate.h +1 -1
@@ -30,7 +30,7 @@EFI_GUID (0x0bf1165c ,0x1831 ,0x4864 ,0x94 ,0x5e , \ 0xac, 0x3d, 0x38, 0x48, 0xf4, 0x99) -#if CONFIG_IS_ENABLED (CMD_MMC ) +#if IS_ENABLED (CONFIG_CMD_MMC )# define BOOT_TARGET_MMC (func) \ func(MMC, mmc, 2) \ func(MMC, mmc, 0)
include/configs/imx8mp_rsb3720.h +1 -1
@@ -39,7 +39,7 @@#endif -#if CONFIG_IS_ENABLED (CMD_MMC ) +#if IS_ENABLED (CONFIG_CMD_MMC )# define BOOT_TARGET_MMC (func) \ func(MMC, mmc, 2) \ func(MMC, mmc, 1)
include/configs/rockchip-common.h +1 -1
@@ -12,7 +12,7 @@#ifndef CONFIG_SPL_BUILD /* First try to boot from SD (index 1), then eMMC (index 0) */ -#if CONFIG_IS_ENABLED (CMD_MMC ) +#if IS_ENABLED (CONFIG_CMD_MMC )#define BOOT_TARGET_MMC (func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 0)
include/configs/rpi.h +1 -1
@@ -122,7 +122,7 @@"fdt_addr_r=0x02600000\0" \ "ramdisk_addr_r=0x02700000\0" -#if CONFIG_IS_ENABLED (CMD_MMC ) +#if IS_ENABLED (CONFIG_CMD_MMC )#define BOOT_TARGET_MMC (func) \ func(MMC, mmc, 0) \ func(MMC, mmc, 1) \
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 49/169 Correct SPL use of CMD_NET
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_NET defined in Kconfig
---
(no changes since v1)
arch/arm/mach-rockchip/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/misc.c +1 -1
@@ -23,7 +23,7 @@int rockchip_setup_macaddr (void ) { -#if CONFIG_IS_ENABLED (CMD_NET ) +#if IS_ENABLED (CONFIG_CMD_NET )int ret;const char *cpuid =env_get ("cpuid#" );u8 hash[SHA256_SUM_LEN ];
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 50/169 Correct SPL use of CMD_NVEDIT_EFI
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_NVEDIT_EFI defined in Kconfig
---
(no changes since v1)
cmd/nvedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/nvedit.c +1 -1
@@ -231,7 +231,7 @@ static int _do_env_set(int flag, int argc, char *const argv[], int env_flag)debug ("Initial value for argc=%d\n" , argc); -#if CONFIG_IS_ENABLED (CMD_NVEDIT_EFI ) +#if !IS_ENABLED (CONFIG_SPL_BUILD ) &&IS_ENABLED (CONFIG_CMD_NVEDIT_EFI )if (argc >1 && argv[1 ][0 ] =='-' && argv[1 ][1 ] =='e' )return do_env_set_efi (NULL , flag, --argc, ++argv);#endif
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 51/169 Correct SPL uses of CMD_NVME
In reply to Simon GlassThis converts 3 usages of this option to the non-SPL form, since there is no SPL_CMD_NVME defined in Kconfig
---
(no changes since v1)
include/configs/apple.h | 2 +- include/configs/qemu-arm.h | 2 +- include/configs/rockchip-common.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/configs/apple.h +1 -1
@@ -9,7 +9,7 @@"stdout=serial,vidconsole\0" \ "stderr=serial,vidconsole\0" -#if CONFIG_IS_ENABLED (CMD_NVME ) +#if IS_ENABLED (CONFIG_CMD_NVME )#define BOOT_TARGET_NVME (func) func(NVME, nvme, 0)#else #define BOOT_TARGET_NVME (func)
include/configs/qemu-arm.h +1 -1
@@ -54,7 +54,7 @@# define BOOT_TARGET_VIRTIO (func)#endif -#if CONFIG_IS_ENABLED (CMD_NVME ) +#if IS_ENABLED (CONFIG_CMD_NVME )# define BOOT_TARGET_NVME (func) func(NVME, nvme, 0)#else # define BOOT_TARGET_NVME (func)
include/configs/rockchip-common.h +1 -1
@@ -20,7 +20,7 @@#define BOOT_TARGET_MMC (func)#endif -#if CONFIG_IS_ENABLED (CMD_NVME ) +#if IS_ENABLED (CONFIG_CMD_NVME )#define BOOT_TARGET_NVME (func) func(NVME, nvme, 0)#else #define BOOT_TARGET_NVME (func)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 52/169 Correct SPL use of CMD_PSTORE
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_PSTORE defined in Kconfig
---
(no changes since v1)
boot/image-fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/image-fdt.c +1 -1
@@ -638,7 +638,7 @@ int image_setup_libfdt(struct bootm_headers *images, void *blob,/* Update ethernet nodes */ fdt_fixup_ethernet (blob); -#if CONFIG_IS_ENABLED (CMD_PSTORE ) +#if IS_ENABLED (CONFIG_CMD_PSTORE )/* Append PStore configuration */ fdt_fixup_pstore (blob);#endif
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 53/169 Correct SPL uses of CMD_PXE
In reply to Simon GlassThis converts 6 usages of this option to the non-SPL form, since there is no SPL_CMD_PXE defined in Kconfig
---
(no changes since v1)
include/configs/am335x_evm.h | 2 +- include/configs/imx8mm-cl-iot-gate.h | 2 +- include/configs/imx8mp_rsb3720.h | 2 +- include/configs/j721e_evm.h | 2 +- include/configs/rockchip-common.h | 2 +- include/configs/rpi.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
include/configs/am335x_evm.h +1 -1
@@ -53,7 +53,7 @@# define BOOT_TARGET_USB (func)#endif -#if CONFIG_IS_ENABLED (CMD_PXE ) +#if IS_ENABLED (CONFIG_CMD_PXE )# define BOOT_TARGET_PXE (func) func(PXE, pxe, na)#else # define BOOT_TARGET_PXE (func)
include/configs/imx8mm-cl-iot-gate.h +1 -1
@@ -44,7 +44,7 @@# define BOOT_TARGET_USB (func)#endif -#if CONFIG_IS_ENABLED (CMD_PXE ) +#if IS_ENABLED (CONFIG_CMD_PXE )# define BOOT_TARGET_PXE (func) func(PXE, pxe, na)#else # define BOOT_TARGET_PXE (func)
include/configs/imx8mp_rsb3720.h +1 -1
@@ -47,7 +47,7 @@# define BOOT_TARGET_MMC (func)#endif -#if CONFIG_IS_ENABLED (CMD_PXE ) +#if IS_ENABLED (CONFIG_CMD_PXE )# define BOOT_TARGET_PXE (func) func(PXE, pxe, na)#else # define BOOT_TARGET_PXE (func)
include/configs/j721e_evm.h +1 -1
@@ -149,7 +149,7 @@DFU_ALT_INFO_RAM \ DFU_ALT_INFO_OSPI -#if CONFIG_IS_ENABLED (CMD_PXE ) +#if IS_ENABLED (CONFIG_CMD_PXE )# define BOOT_TARGET_PXE (func) func(PXE, pxe, na)#else # define BOOT_TARGET_PXE (func)
include/configs/rockchip-common.h +1 -1
@@ -38,7 +38,7 @@#define BOOT_TARGET_USB (func)#endif -#if CONFIG_IS_ENABLED (CMD_PXE ) +#if IS_ENABLED (CONFIG_CMD_PXE )#define BOOT_TARGET_PXE (func) func(PXE, pxe, na)#else #define BOOT_TARGET_PXE (func)
include/configs/rpi.h +1 -1
@@ -137,7 +137,7 @@#define BOOT_TARGET_USB (func)#endif -#if CONFIG_IS_ENABLED (CMD_PXE ) +#if IS_ENABLED (CONFIG_CMD_PXE )#define BOOT_TARGET_PXE (func) func(PXE, pxe, na)#else #define BOOT_TARGET_PXE (func)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 54/169 Correct SPL uses of CMD_SCSI
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_SCSI defined in Kconfig
---
(no changes since v1)
include/configs/qemu-arm.h | 2 +- include/configs/rockchip-common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/configs/qemu-arm.h +1 -1
@@ -42,7 +42,7 @@# define BOOT_TARGET_USB (func)#endif -#if CONFIG_IS_ENABLED (CMD_SCSI ) +#if IS_ENABLED (CONFIG_CMD_SCSI )# define BOOT_TARGET_SCSI (func) func(SCSI, scsi, 0)#else # define BOOT_TARGET_SCSI (func)
include/configs/rockchip-common.h +1 -1
@@ -26,7 +26,7 @@#define BOOT_TARGET_NVME (func)#endif -#if CONFIG_IS_ENABLED (CMD_SCSI ) +#if IS_ENABLED (CONFIG_CMD_SCSI )#define BOOT_TARGET_SCSI (func) func(SCSI, scsi, 0)#else #define BOOT_TARGET_SCSI (func)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 55/169 Correct SPL uses of CMD_SF
In reply to Simon GlassThis converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_SF defined in Kconfig
---
(no changes since v1)
include/configs/rockchip-common.h | 2 +- include/environment/distro/sf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/configs/rockchip-common.h +1 -1
@@ -50,7 +50,7 @@#define BOOT_TARGET_DHCP (func)#endif -#if CONFIG_IS_ENABLED (CMD_SF ) +#if IS_ENABLED (CONFIG_CMD_SF )#define BOOT_TARGET_SF (func) func(SF, sf, 0)#else #define BOOT_TARGET_SF (func)
include/environment/distro/sf.h +1 -1
@@ -8,7 +8,7 @@#ifndef __DISTRO_SF_CONFIG_H#define __DISTRO_SF_CONFIG_H -#if CONFIG_IS_ENABLED (CMD_SF ) +#if IS_ENABLED (CONFIG_CMD_SF )#define BOOTENV_SHARED_SF (devtypel) \ #devtypel "_boot=" \ "if " #devtypel " probe ${busnum}; then " \
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 56/169 Correct SPL use of CMD_SHA1SUM
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_SHA1SUM defined in Kconfig
---
(no changes since v1)
common/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/hash.c +1 -1
@@ -326,7 +326,7 @@ static struct hash_algo hash_algo[] = { };/* Try to minimize code size for boards that don't want much hashing */ -#if CONFIG_IS_ENABLED (SHA256 ) ||CONFIG_IS_ENABLED (CMD_SHA1SUM ) || \ +#if CONFIG_IS_ENABLED (SHA256 ) ||IS_ENABLED (CONFIG_CMD_SHA1SUM ) || \CONFIG_IS_ENABLED (CRC32_VERIFY ) ||IS_ENABLED (CONFIG_CMD_HASH ) || \CONFIG_IS_ENABLED (SHA384 ) ||CONFIG_IS_ENABLED (SHA512 )#define multi_hash () 1
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 57/169 Correct SPL use of CMD_STBOARD
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_STBOARD defined in Kconfig
---
(no changes since v1)
board/st/stm32mp1/stm32mp1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/st/stm32mp1/stm32mp1.c +1 -1
@@ -129,7 +129,7 @@ int checkboard(void) fdt_compat && fdt_compat_len ? fdt_compat : "");/* display the STMicroelectronics board identification */ -if (CONFIG_IS_ENABLED (CMD_STBOARD )) { +if (IS_ENABLED (CONFIG_CMD_STBOARD )) { ret =uclass_get_device_by_driver (UCLASS_MISC ,DM_DRIVER_GET (stm32mp_bsec), &dev);
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 58/169 Correct SPL use of CMD_STM32PROG
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_STM32PROG defined in Kconfig
---
(no changes since v1)
board/st/common/stm32mp_mtdparts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/st/common/stm32mp_mtdparts.c +1 -1
@@ -96,7 +96,7 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)case BOOT_SERIAL_UART :case BOOT_SERIAL_USB : serial = true; -if (CONFIG_IS_ENABLED (CMD_STM32PROG )) { +if (IS_ENABLED (CONFIG_CMD_STM32PROG )) {#ifdef CONFIG_STM32MP15x_STM32IMAGE tee =stm32prog_get_tee_partitions ();#endif
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 59/169 Correct SPL uses of CMD_TFTPPUT
In reply to Simon GlassThis converts 3 usages of this option to the non-SPL form, since there is no SPL_CMD_TFTPPUT defined in Kconfig
---
(no changes since v1)
cmd/net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
cmd/net.c +3 -3
@@ -280,7 +280,7 @@ static int parse_args(enum proto_t proto, int argc, char *const argv[])switch (argc) {case 1 : -if (CONFIG_IS_ENABLED (CMD_TFTPPUT ) && proto ==TFTPPUT ) +if (IS_ENABLED (CONFIG_CMD_TFTPPUT ) && proto ==TFTPPUT )return 1 ;/* refresh bootfile name from env */
@@ -289,7 +289,7 @@ static int parse_args(enum proto_t proto, int argc, char *const argv[])break ;case 2 : -if (CONFIG_IS_ENABLED (CMD_TFTPPUT ) && proto ==TFTPPUT ) +if (IS_ENABLED (CONFIG_CMD_TFTPPUT ) && proto ==TFTPPUT )return 1 ;/* * Only one arg - accept two forms:
@@ -311,7 +311,7 @@ static int parse_args(enum proto_t proto, int argc, char *const argv[])break ;case 3 : -if (CONFIG_IS_ENABLED (CMD_TFTPPUT ) && proto ==TFTPPUT ) { +if (IS_ENABLED (CONFIG_CMD_TFTPPUT ) && proto ==TFTPPUT ) {if (parse_addr_size (argv))return 1 ; }else {
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 60/169 Correct SPL uses of CMD_USB
In reply to Simon GlassThis converts 8 usages of this option to the non-SPL form, since there is no SPL_CMD_USB defined in Kconfig
---
(no changes since v1)
include/configs/am335x_evm.h | 2 +- include/configs/apple.h | 2 +- include/configs/imx8mm-cl-iot-gate.h | 2 +- include/configs/iot2050.h | 2 +- include/configs/qemu-arm.h | 2 +- include/configs/rockchip-common.h | 2 +- include/configs/rpi.h | 2 +- include/configs/tegra-common-post.h | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
include/configs/am335x_evm.h +1 -1
@@ -47,7 +47,7 @@#define BOOTENV_DEV_NAME_NAND (devtypeu, devtypel, instance) \ #devtypel #instance " " -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )# define BOOT_TARGET_USB (func) func(USB, usb, 0)#else # define BOOT_TARGET_USB (func)
include/configs/apple.h +1 -1
@@ -15,7 +15,7 @@#define BOOT_TARGET_NVME (func)#endif -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )#define BOOT_TARGET_USB (func) func(USB, usb, 0)#else #define BOOT_TARGET_USB (func)
include/configs/imx8mm-cl-iot-gate.h +1 -1
@@ -38,7 +38,7 @@# define BOOT_TARGET_MMC (func)#endif -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )# define BOOT_TARGET_USB (func) func(USB, usb, 0)#else # define BOOT_TARGET_USB (func)
include/configs/iot2050.h +1 -1
@@ -19,7 +19,7 @@#define EXTRA_ENV_IOT2050_BOARD_SETTINGS \ "usb_pgood_delay=900\0" -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )# define BOOT_TARGET_USB (func) \ func(USB, usb, 0) \ func(USB, usb, 1) \
include/configs/qemu-arm.h +1 -1
@@ -36,7 +36,7 @@/* Environment options */ -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )# define BOOT_TARGET_USB (func) func(USB, usb, 0)#else # define BOOT_TARGET_USB (func)
include/configs/rockchip-common.h +1 -1
@@ -32,7 +32,7 @@#define BOOT_TARGET_SCSI (func)#endif -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )#define BOOT_TARGET_USB (func) func(USB, usb, 0)#else #define BOOT_TARGET_USB (func)
include/configs/rpi.h +1 -1
@@ -131,7 +131,7 @@#define BOOT_TARGET_MMC (func)#endif -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )#define BOOT_TARGET_USB (func) func(USB, usb, 0)#else #define BOOT_TARGET_USB (func)
include/configs/tegra-common-post.h +1 -1
@@ -7,7 +7,7 @@#ifndef __TEGRA_COMMON_POST_H#define __TEGRA_COMMON_POST_H -#if CONFIG_IS_ENABLED (CMD_USB ) +#if IS_ENABLED (CONFIG_CMD_USB )# define BOOT_TARGET_USB (func) func(USB, usb, 0)#else # define BOOT_TARGET_USB (func)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
PATCH v2 61/169 Correct SPL use of CMD_VIRTIO
In reply to Simon GlassThis converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_VIRTIO defined in Kconfig
---
(no changes since v1)
include/configs/qemu-arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/qemu-arm.h +1 -1
@@ -48,7 +48,7 @@# define BOOT_TARGET_SCSI (func)#endif -#if CONFIG_IS_ENABLED (CMD_VIRTIO ) +#if IS_ENABLED (CONFIG_CMD_VIRTIO )# define BOOT_TARGET_VIRTIO (func) func(VIRTIO, virtio, 0)#else # define BOOT_TARGET_VIRTIO (func)
Signature · 1 line
2.39.1.519.gcb327c4b5f-goog
Quoted 183 lines · Simon Glass
Quite a few CONFIG options without an SPL equivalent are used as if they have one. For example, we see
CONFIG_IS_ENABLED(IOMMU)when there is noSPL_IOMMUKconfigoption.This series adds new features to moveconfig to detect and remove these problems. It includes additions to the
Kconfigfor options which are needed as well as dropping unwanted us ofCONFIG_IS_ENABLED, etc.This follows on from v3 the previous series[1]
It is available at u-boot-dm/splb-working
[1] https://patchwork.ozlabs.org/project/uboot/list/?series=339724
Changes in v2:
- Rebase to previous series
- Correct the tag
- Rebase to previous series
- Drop patch to add aKconfigforSPL_EFI_LOADERet al
- Drop patch to add aKconfigforSPL_GENERATE_ACPI_TABLESimon Glass (169):
moveconfig: Update to detect / correct missing SPL Kconfigs
x86: Correct Chrromebook typo
boot: Add aKconfigforSPL_FIT_CIPHER
boot: Add aKconfigforSPL_BOOTSTD_FULL
boot: Add Kconfigs forBOOTMETH_VBE_REQUEST
boot: Add aKconfigforSPL_BOOTDEV_SPI_FLASH
boot: Add aKconfigforSPL_BOOTDEV_ETH
dm: Add aKconfigforSPL_DEVRES
dm: Add aKconfigforSPL_DM_HWSPINLOCK
boot: Add aKconfigforSPL_OF_LIVE
cmd: Add aKconfigforSPL_CRC32_VERIFY
console: Add aKconfigforSPL_CONSOLE_MUXet al
button: Add aKconfigforSPL_BUTTON
lib: Add aKconfigforSPL_ERRNO_STR
iommu: Add aKconfigforSPL_IOMMU
pinctrl: Add aKconfigforSPL_PINCTRL_ARMADA_38X
virtio: Add aKconfigforSPL_VIRTIO
lib: Add aKconfigforSPL_BZIP2
acpi: Add aKconfigforSPL_ACPIGEN
rockchip: Add aKconfigforSPL_RESET_ROCKCHIP
mediatek: Add aKconfigforSPL_RESET_MEDIATEKCorrect SPL use ofA003399_NOR_WORKAROUND
Correct SPL use of AHCI
Correct SPL uses ofALLEYCAT_5
Correct SPL uses ofARCH_MVEBU
Correct SPL use ofARCH_VERSAL
Correct SPL use ofARCH_ZYNQ
Correct SPL use of ARM64
Correct SPL uses ofARMADA_3700
Correct SPL uses ofARMADA_8K
Correct SPL use ofATMEL_PIO4
Correct SPL use ofBNXT_ETH
Correct SPL use ofBOOTSTAGE_FDT
Correct SPL uses ofBOOTSTAGE_REPORT
Correct SPL use ofCMD_BCB
Correct SPL uses ofCMD_BOOTEFI_BOOTMGR
Correct SPL use ofCMD_BOOTI
Correct SPL uses ofCMD_BOOTM_PRE_LOAD
Correct SPL use ofCMD_BOOTZ
Correct SPL uses ofCMD_CLK
Correct SPL uses ofCMD_DHCP
Correct SPL uses ofCMD_EFICONFIG
Correct SPL use ofCMD_ERASEENV
Correct SPL uses ofCMD_FDT
Correct SPL use ofCMD_FRU
Correct SPL use ofCMD_HASH
Correct SPL use ofCMD_MBR
Correct SPL uses ofCMD_MMC
Correct SPL use ofCMD_NET
Correct SPL use ofCMD_NVEDIT_EFI
Correct SPL uses ofCMD_NVME
Correct SPL use ofCMD_PSTORE
Correct SPL uses ofCMD_PXE
Correct SPL uses ofCMD_SCSI
Correct SPL uses ofCMD_SF
Correct SPL use ofCMD_SHA1SUM
Correct SPL use ofCMD_STBOARD
Correct SPL use ofCMD_STM32PROG
Correct SPL uses ofCMD_TFTPPUT
Correct SPL uses ofCMD_USB
Correct SPL use ofCMD_VIRTIO
Correct SPL uses ofCPU_MICROBLAZE
Correct SPL use ofDEBUG_UART_ZYNQ
Correct SPL uses ofDFU_VIRT
Correct SPL uses ofDISPLAY_AER_BRIEF
Correct SPL uses ofDISPLAY_AER_FULL
Correct SPL use ofDISPLAY_CPUINFO
Correct SPL use ofDM_RNG
Correct SPL uses ofDTB_RESELECT
Correct SPL uses ofDWC_ETH_QOS
Correct SPL use ofEFI_APP
Correct SPL use ofEFI_DEVICE_PATH_UTIL
Correct SPL uses ofEFI_HAVE_CAPSULE_SUPPORTCorrect SPL use ofEFI_LOADER_HII
Correct SPL use ofEFI_MM_COMM_TEE
Correct SPL use ofEFI_SECURE_BOOT
Correct SPL use ofEFI_TCG2_PROTOCOL
Correct SPL use ofEFI_UNICODE_COLLATION_PROTOCOL2Correct SPL uses ofENV_IS_IN_UBI
Correct SPL uses ofENV_VARS_UBOOT_RUNTIME_CONFIGCorrect SPL use ofENV_WRITEABLE_LIST
Correct SPL use of EXYNOS7420
Correct SPL uses of FASTBOOT
Correct SPL uses ofFASTBOOT_FLASH
Correct SPL uses ofFASTBOOT_FLASH_MMC
Correct SPL uses ofFASTBOOT_FLASH_NAND
Correct SPL use ofFASTBOOT_MMC_USER_SUPPORTCorrect SPL use ofFDT_SIMPLEFB
Correct SPL uses ofFEC_MXC
Correct SPL use ofFSL_CAAM
Correct SPL uses ofFSL_ISBC_KEY_EXT
Correct SPL use ofFSL_MC_ENET
Correct SPL use ofFSP_VERSION2
Correct SPL use ofFS_EROFS
Correct SPL use ofGENERATE_SMBIOS_TABLE
Correct SPL uses ofGMAC_ROCKCHIP
Correct SPL use ofHUSH_PARSER
Correct SPL uses ofHW_WATCHDOG
Correct SPL uses ofI8259_PIC
Correct SPL uses of IMX8M
Correct SPL use ofIMX8MN_BEACON_2GB_LPDDRCorrect SPL uses ofIMX_MODULE_FUSE
Correct SPL uses ofIMX_RDC
Correct SPL uses of LMB
Correct SPL uses of MICROBLAZE
Correct SPL use ofMIPS_CM
Correct SPL use ofMMC_QUIRKS
Correct SPL uses of MTD
Correct SPL uses of MULTIPLEXER
Correct SPL uses ofNEEDS_MANUAL_RELOC
Correct SPL use of NETDEVICES
Correct SPL uses ofNXP_FSPI
Correct SPL use ofOCTEON_SERIAL_BOOTCMD
Correct SPL use ofOCTEON_SERIAL_PCIE_CONSOLECorrect SPL uses ofOF_BOARD
Correct SPL use ofOF_EMBED
Correct SPL use of PANEL
Correct SPL use ofPARTITION_TYPE_GUID
Correct SPL use ofPCI_PNP
Correct SPL uses ofPG_WCOM_UBOOT_BOOTPACKAGECorrect SPL uses ofPG_WCOM_UBOOT_UPDATE
Correct SPL use ofPG_WCOM_UBOOT_UPDATE_SUPPORTEDCorrect SPL use ofPHY_CADENCE_SIERRA
Correct SPL use ofPHY_CADENCE_TORRENT
Correct SPL uses ofPHY_FIXED
Correct SPL uses ofPMIC_STPMIC1
Correct SPL use ofQFW_PIO
Correct SPL use of REGEX
Correct SPL use ofRENESAS_SDHI
Correct SPL use ofRESV_RAM
Correct SPL uses ofROCKCHIP_EFUSE
Correct SPL uses ofROCKCHIP_OTP
Correct SPL use of SANDBOX
Correct SPL uses ofSANDBOX_CLK_CCF
Correct SPL uses ofSAVE_PREV_BL_FDT_ADDR
Correct SPL uses ofSAVE_PREV_BL_INITRAMFS_START_ADDRCorrect SPL uses ofSEC_FIRMWARE_ARMV8_PSCICorrect SPL uses ofSIFIVE_OTP
Correct SPL use of SL28CPLD
Correct SPL use ofSL28_SPL_LOADS_OPTEE_BL32Correct SPL use ofSPI_FLASH_BAR
Correct SPL uses ofSPI_FLASH_MACRONIX
Correct SPL use ofSPLASH_SOURCE
Correct SPL use ofSTM32MP15X_STM32IMAGE
Correct SPL use ofSUPPORT_EMMC_RPMB
Correct SPL use ofSYS_FSL_ERRATUM_A010539Correct SPL uses ofSYS_LONGHELP
Correct SPL use ofSYS_MEM_RSVD_FOR_MMU
Correct SPL uses ofTARGET_LX2160ARDB
Correct SPL use ofTARGET_MX6UL_9X9_EVK
Correct SPL use ofTARGET_PG_WCOM_EXPU1
Correct SPL use ofTARGET_PG_WCOM_SELI8
Correct SPL use of TEE
Correct SPL uses ofTEN64_CONTROLLER
Correct SPL use ofTPM_RNG
Correct SPL use ofUDP_FUNCTION_FASTBOOT
Correct SPL use ofUSB_DWC3_MESON_G12A
Correct SPL uses ofUSB_DWC3_MESON_GXL
Correct SPL use ofUSB_FUNCTION_FASTBOOT
Correct SPL uses ofUSB_GADGET_DWC2_OTG
Correct SPL uses ofUSB_KEYBOARD
Quoted 8 lines
Correct SPL uses of
USB_MUSB_HOST
Correct SPL uses of VIDEO
Correct SPL use ofVIDEO_ANSI
Correct SPL use ofVIDEO_BPP16
Correct SPL use ofVIDEO_BPP32
Correct SPL use ofWATCHDOG_AUTOSTART
Correct SPL uses ofXEN_SERIAL
Correct SPL uses ofZYNQMP_FIRMWARE
I have largely applied this series. In terms of next steps:
- As we've talked about, the def_bool n parts move to the split config series, to evaluate as part of the whole there.
- The CMD_* ones can liley be handled by moving the platforms to bootstd instead, so they don't need to do tricks to reduce the default / only env, in SPL.
- The rest of the size increase patches either need to be done individually and get ack'd by the relevant custodians, or for the MULTIPLEXER one, just re-worked to move the Makefile line to the block of never-xPL lines.
I'm not going to reply to each with an applied message, but I'll run the script shortly to update patchwork status.
Signature · 1 line
Tom