* [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED
@ 2023-02-22 1:37 Troy Kisky
2023-02-22 1:37 ` [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT Troy Kisky
` (23 more replies)
0 siblings, 24 replies; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:37 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Alison Wang, Andre Przywara,
Baruch Siach, Bin Meng, Fabio Estevam, Heiko Thiery,
Heinrich Schuchardt, Jaehoon Chung, Joel Stanley, Klaus Goger,
Loic Poulain, Lukasz Majewski, Marek Behún, Marek Vasut,
Matwey V. Kornilov, Max Krummenacher, Miaoqian Lin,
NXP i.MX U-Boot Team, Olaf Mandel, Pali Rohár, Peter Hoyes,
Quentin Schulz, Rafał Miłecki, Rick Chen,
Samuel Dionne-Riel, Samuel Holland, Sean Anderson, Stefan Roese,
Stefano Babic, Tim Harvey
This patch set gets ready to checks the usage of
CONFIG_IS_ENABLED/IS_ENABLED.
After the set has been applied, you can delete
test/usage_of_is_enabled_todo.txt
and run test/usage_of_is_enabled_commit.sh
The script test/usage_of_is_enabled_check.sh
checks for new questionable uses of
CONFIG_IS_ENABLED/IS_ENABLED and is added
to .azure-pipelines.yml, and
.gitlab-ci.yml
Troy Kisky (24):
cmd: nvedit: check for ENV_SUPPORT
lib: crc32: prepare for CONFIG_IS_ENABLED changes
lib: md5: prepare for CONFIG_IS_ENABLED changes
lib: sha1: prepare for CONFIG_IS_ENABLED changes
lib: sha256: prepare for CONFIG_IS_ENABLED changes
lib: sha512: prepare for CONFIG_IS_ENABLED changes
tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h
tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding
CONFIG_TOOLS_xxx
x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED
config_distro_bootcmd: remove booting environment variables from SPL
environment
ofnode: fdt_support definitions needed if OF_CONTROL is enabled
ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config
puma-rk3399: remove check for ENV_IS_NOWHERE, it is an SPL config
fdt_support: always define fdt_fixup_mtdparts
m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT)
freescale: common: pfuze: define pfuze_mode_init only if
defined(CONFIG_DM_PMIC)
ns16550: match when to define bdf with uart code
solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of
CONFIG_CMD_SATA
arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA
x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI)
gateworks: venice: surround call of setup_fec with if
IS_ENABLED(CONFIG_NET)
power: pmic: add dm style definitions if not
CONFIG_IS_ENABLED(POWER_LEGACY)
arm: cpu: armv7: ls102xa: fdt: remove eth_device support
CI: add test/usage_of_is_enabled_check.sh
.azure-pipelines.yml | 11 +
.gitlab-ci.yml | 5 +
arch/arm/cpu/armv7/ls102xa/fdt.c | 12 -
arch/arm/mach-imx/Makefile | 2 +-
arch/x86/cpu/apollolake/uart.c | 6 +-
arch/x86/cpu/i386/cpu.c | 2 +
arch/x86/cpu/qemu/qemu.c | 2 +-
board/freescale/common/pfuze.c | 2 +-
board/gateworks/venice/venice.c | 4 +-
board/menlo/m53menlo/m53menlo.c | 2 +
board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +-
.../puma_rk3399/puma-rk3399.c | 4 -
.../ringneck_px30/ringneck-px30.c | 4 -
boot/fdt_region.c | 1 +
cmd/nvedit.c | 5 +-
include/config_distro_bootcmd.h | 23 ++
include/fdt_support.h | 26 ++-
include/ns16550.h | 2 +-
include/power/pmic.h | 2 +-
lib/crc32.c | 12 +-
lib/fdtdec_common.c | 1 +
lib/hash-checksum.c | 1 +
lib/md5.c | 9 +-
lib/sha1.c | 8 +-
lib/sha256.c | 8 +-
lib/sha512.c | 12 +-
test/usage_of_is_enabled_check.sh | 19 ++
test/usage_of_is_enabled_commit.sh | 12 +
test/usage_of_is_enabled_correct.sh | 50 +++++
test/usage_of_is_enabled_exempt.txt | 9 +
test/usage_of_is_enabled_list.sh | 86 +++++++
test/usage_of_is_enabled_splcfg.txt | 21 ++
test/usage_of_is_enabled_todo.txt | 210 ++++++++++++++++++
tools/Makefile | 2 +
tools/env/fw_env.c | 1 +
tools/fdt_host.h | 1 +
tools/mkimage.h | 1 +
37 files changed, 524 insertions(+), 56 deletions(-)
create mode 100755 test/usage_of_is_enabled_check.sh
create mode 100755 test/usage_of_is_enabled_commit.sh
create mode 100755 test/usage_of_is_enabled_correct.sh
create mode 100644 test/usage_of_is_enabled_exempt.txt
create mode 100755 test/usage_of_is_enabled_list.sh
create mode 100644 test/usage_of_is_enabled_splcfg.txt
create mode 100644 test/usage_of_is_enabled_todo.txt
--
2.34.1
^ permalink raw reply [flat|nested] 64+ messages in thread
* [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
@ 2023-02-22 1:37 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:37 ` [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes Troy Kisky
` (22 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:37 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Marek Behún, Samuel Dionne-Riel
Avoid error messages when SPL,TPL,VPL build don't
have the environment options of the main build.
This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
cmd/nvedit.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 7cbc3fd573a..ef0fe55431c 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -43,6 +43,7 @@
DECLARE_GLOBAL_DATA_PTR;
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
#if defined(CONFIG_ENV_IS_IN_EEPROM) || \
defined(CONFIG_ENV_IS_IN_FLASH) || \
defined(CONFIG_ENV_IS_IN_MMC) || \
@@ -60,10 +61,12 @@ DECLARE_GLOBAL_DATA_PTR;
#endif
#if !defined(ENV_IS_IN_DEVICE) && \
- !defined(CONFIG_ENV_IS_NOWHERE)
+ !defined(CONFIG_ENV_IS_NOWHERE) && \
+ !defined(CONFIG_VPL_BUILD)
# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
#endif
+#endif
/*
* Maximum expected input data size for import command
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
2023-02-22 1:37 ` [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT Troy Kisky
@ 2023-02-22 1:37 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 03/24] lib: md5: " Troy Kisky
` (21 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:37 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Marek Vasut, Stefan Roese
We need to include <linux/kconfig.h> in order to include
files that use CONFIG_IS_ENABLED. TO prepare for that
be more direct with using defined(USE_HOSTCC).
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
lib/crc32.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/crc32.c b/lib/crc32.c
index aa94d70ef3e..b2fa9e06e55 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -11,14 +11,18 @@
#ifdef USE_HOSTCC
#include <arpa/inet.h>
#include <u-boot/crc.h>
+#include <linux/kconfig.h>
#else
#include <common.h>
#include <efi_loader.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#define PET_WDG
+#endif
#endif
#include <compiler.h>
#include <u-boot/crc.h>
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
#include <watchdog.h>
#endif
#include "u-boot/zlib.h"
@@ -84,7 +88,7 @@ static void __efi_runtime make_crc_table(void)
}
crc_table_empty = 0;
}
-#elif !defined(CONFIG_ARM64_CRC32)
+#elif !defined(CONFIG_ARM64_CRC32) || defined(USE_HOSTCC)
/* ========================================================================
* Table of CRC-32's of all single-byte values (made by make_crc_table)
*/
@@ -184,7 +188,7 @@ const uint32_t * ZEXPORT get_crc_table()
*/
uint32_t __efi_runtime crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len)
{
-#ifdef CONFIG_ARM64_CRC32
+#if defined(CONFIG_ARM64_CRC32) && !defined(USE_HOSTCC)
crc = cpu_to_le32(crc);
while (len--)
crc = __builtin_aarch64_crc32b(crc, *buf++);
@@ -243,7 +247,7 @@ uint32_t __efi_runtime crc32(uint32_t crc, const Bytef *p, uInt len)
uint32_t crc32_wd(uint32_t crc, const unsigned char *buf, uInt len,
uInt chunk_sz)
{
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end, *curr;
int chunk;
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 03/24] lib: md5: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
2023-02-22 1:37 ` [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT Troy Kisky
2023-02-22 1:37 ` [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 04/24] lib: sha1: " Troy Kisky
` (20 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Marek Vasut, Stefan Roese
We need to include <linux/kconfig.h> in order to include
files that use CONFIG_IS_ENABLED. TO prepare for that
don't pet the watchdog when USE_HOSTCC is defined.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
lib/md5.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/md5.c b/lib/md5.c
index 1636ab93661..bd3d8fa9b2b 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -29,7 +29,12 @@
#ifndef USE_HOSTCC
#include <common.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
#include <watchdog.h>
+#define PET_WDG
+#endif
+#else
+#include <linux/kconfig.h>
#endif /* USE_HOSTCC */
#include <u-boot/md5.h>
@@ -288,14 +293,14 @@ md5_wd(const unsigned char *input, unsigned int len, unsigned char output[16],
unsigned int chunk_sz)
{
struct MD5Context context;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end, *curr;
int chunk;
#endif
MD5Init(&context);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = input;
end = input + len;
while (curr < end) {
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 04/24] lib: sha1: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (2 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 03/24] lib: md5: " Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 05/24] lib: sha256: " Troy Kisky
` (19 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Loic Poulain, Marek Vasut, Stefan Roese
We need to include <linux/kconfig.h> in order to include
files that use CONFIG_IS_ENABLED. TO prepare for that
don't pet the watchdog when USE_HOSTCC is defined.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
lib/sha1.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/sha1.c b/lib/sha1.c
index 8d074078934..af49535e5d2 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -19,7 +19,11 @@
#ifndef USE_HOSTCC
#include <common.h>
#include <linux/string.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#define PET_WDG
+#endif
#else
+#include <linux/kconfig.h>
#include <string.h>
#endif /* USE_HOSTCC */
#include <watchdog.h>
@@ -328,14 +332,14 @@ void sha1_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha1_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end, *curr;
int chunk;
#endif
sha1_starts (&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = input;
end = input + ilen;
while (curr < end) {
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 05/24] lib: sha256: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (3 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 04/24] lib: sha1: " Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 06/24] lib: sha512: " Troy Kisky
` (18 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Loic Poulain, Marek Vasut, Stefan Roese
We need to include <linux/kconfig.h> in order to include
files that use CONFIG_IS_ENABLED. TO prepare for that
don't pet the watchdog when USE_HOSTCC is defined.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
lib/sha256.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/sha256.c b/lib/sha256.c
index 4d26aea1c8c..eb31d16f996 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -8,7 +8,11 @@
#ifndef USE_HOSTCC
#include <common.h>
#include <linux/string.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#define PET_WDG
+#endif
#else
+#include <linux/kconfig.h>
#include <string.h>
#endif /* USE_HOSTCC */
#include <watchdog.h>
@@ -276,7 +280,7 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha256_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end;
unsigned char *curr;
int chunk;
@@ -284,7 +288,7 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
sha256_starts(&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 06/24] lib: sha512: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (4 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 05/24] lib: sha256: " Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 07/24] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h Troy Kisky
` (17 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Marek Vasut, Stefan Roese
We need to include <linux/kconfig.h> in order to include
files that use CONFIG_IS_ENABLED. TO prepare for that
don't pet the watchdog when USE_HOSTCC is defined.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
lib/sha512.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lib/sha512.c b/lib/sha512.c
index fbe8d5f5bfe..4db2e5c08e4 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -13,7 +13,11 @@
#ifndef USE_HOSTCC
#include <common.h>
#include <linux/string.h>
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#define PET_WDG
+#endif
#else
+#include <linux/kconfig.h>
#include <string.h>
#endif /* USE_HOSTCC */
#include <compiler.h>
@@ -292,7 +296,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha512_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end;
unsigned char *curr;
int chunk;
@@ -300,7 +304,7 @@ void sha384_csum_wd(const unsigned char *input, unsigned int ilen,
sha384_starts(&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {
@@ -355,7 +359,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
unsigned char *output, unsigned int chunk_sz)
{
sha512_context ctx;
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
const unsigned char *end;
unsigned char *curr;
int chunk;
@@ -363,7 +367,7 @@ void sha512_csum_wd(const unsigned char *input, unsigned int ilen,
sha512_starts(&ctx);
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#ifdef PET_WDG
curr = (unsigned char *)input;
end = input + ilen;
while (curr < end) {
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 07/24] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (5 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 06/24] lib: sha512: " Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 08/24] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx Troy Kisky
` (16 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Jaehoon Chung, Joel Stanley, Marek Vasut,
Miaoqian Lin, Rafał Miłecki, Sean Anderson
We need to include <linux/kconfig.h> in order to include
files that use CONFIG_IS_ENABLED.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
boot/fdt_region.c | 1 +
lib/fdtdec_common.c | 1 +
lib/hash-checksum.c | 1 +
tools/env/fw_env.c | 1 +
tools/fdt_host.h | 1 +
tools/mkimage.h | 1 +
6 files changed, 6 insertions(+)
diff --git a/boot/fdt_region.c b/boot/fdt_region.c
index 295ea08ac91..5331fbbfb50 100644
--- a/boot/fdt_region.c
+++ b/boot/fdt_region.c
@@ -5,6 +5,7 @@
* Written by Simon Glass <sjg@chromium.org>
*/
+#include <linux/kconfig.h>
#include <fdt_support.h>
#include <linux/libfdt_env.h>
#include <fdt_region.h>
diff --git a/lib/fdtdec_common.c b/lib/fdtdec_common.c
index ddaca0087e1..76719fb59b2 100644
--- a/lib/fdtdec_common.c
+++ b/lib/fdtdec_common.c
@@ -13,6 +13,7 @@
#include <linux/libfdt.h>
#include <fdtdec.h>
#else
+#include <linux/kconfig.h>
#include "libfdt.h"
#include "fdt_support.h"
diff --git a/lib/hash-checksum.c b/lib/hash-checksum.c
index 8f2a42f9a08..062c3a54db4 100644
--- a/lib/hash-checksum.c
+++ b/lib/hash-checksum.c
@@ -11,6 +11,7 @@
#include <asm/unaligned.h>
#include <hash.h>
#else
+#include <linux/kconfig.h>
#include "fdt_host.h"
#endif
#include <hash.h>
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index c9a8774acef..abe9977fad3 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -12,6 +12,7 @@
#include <compiler.h>
#include <env.h>
#include <errno.h>
+#include <linux/kconfig.h>
#include <env_flags.h>
#include <fcntl.h>
#include <libgen.h>
diff --git a/tools/fdt_host.h b/tools/fdt_host.h
index bc42306c9e5..6c7788db3c6 100644
--- a/tools/fdt_host.h
+++ b/tools/fdt_host.h
@@ -7,6 +7,7 @@
#define __FDT_HOST_H__
/* Make sure to include u-boot version of libfdt include files */
+#include "../include/linux/kconfig.h"
#include "../include/linux/libfdt.h"
#include "../include/fdt_support.h"
diff --git a/tools/mkimage.h b/tools/mkimage.h
index f5ca65e2edf..5cbb372d7b1 100644
--- a/tools/mkimage.h
+++ b/tools/mkimage.h
@@ -8,6 +8,7 @@
#ifndef _MKIIMAGE_H_
#define _MKIIMAGE_H_
+#include <linux/kconfig.h>
#include "os_support.h"
#include <errno.h>
#include <fcntl.h>
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 08/24] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (6 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 07/24] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 09/24] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED Troy Kisky
` (15 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Heiko Thiery, Heinrich Schuchardt,
Max Krummenacher, Pali Rohár, Samuel Holland, Stefan Roese
CONFIG_IS_ENABLED(FIT_SIGNATURE) will check for
CONFIG_TOOLS_FIT_SIGNATURE. So define it now in preparation.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
tools/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/Makefile b/tools/Makefile
index e13effbb66a..2670c77b2cb 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -162,8 +162,10 @@ ifdef CONFIG_TOOLS_LIBCRYPTO
# This affects include/image.h, but including the board config file
# is tricky, so manually define this options here.
HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE
+HOST_EXTRACFLAGS += -DCONFIG_TOOLS_FIT_SIGNATURE=1
HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff
HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER
+HOST_EXTRACFLAGS += -DCONFIG_TOOLS_FIT_CIPHER=1
endif
# MXSImage needs LibSSL
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 09/24] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (7 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 08/24] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 10/24] config_distro_bootcmd: remove booting environment variables from SPL environment Troy Kisky
` (14 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Bin Meng
CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT)
would check for CONFIG_SPL_SPL_X86_32BIT_INIT for SPL builds
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
arch/x86/cpu/qemu/qemu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c
index e54082df7f9..274978c023b 100644
--- a/arch/x86/cpu/qemu/qemu.c
+++ b/arch/x86/cpu/qemu/qemu.c
@@ -97,7 +97,7 @@ static void qemu_chipset_init(void)
}
}
-#if !CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT)
+#if CONFIG_IS_ENABLED(X86_32BIT_INIT)
int arch_cpu_init(void)
{
post_code(POST_CPU_INIT);
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 10/24] config_distro_bootcmd: remove booting environment variables from SPL environment
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (8 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 09/24] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 11/24] ofnode: fdt_support definitions needed if OF_CONTROL is enabled Troy Kisky
` (13 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Marek Vasut, Matwey V. Kornilov,
Pali Rohár, Peter Hoyes
SPL environments don't need command that they can never use.
Avoid errors with CONFIG_IS_ENABLED conversions by skipping them now.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
include/config_distro_bootcmd.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 9d2a225e7eb..2a136b96a6d 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -35,11 +35,15 @@
#devtypel "_boot=" \
BOOTENV_SHARED_BLKDEV_BODY(devtypel)
+#define BOOTENV_DEV_BLKDEV_NONE(devtypeu, devtypel, instance)
+
#define BOOTENV_DEV_BLKDEV(devtypeu, devtypel, instance) \
"bootcmd_" #devtypel #instance "=" \
"devnum=" #instance "; " \
"run " #devtypel "_boot\0"
+#define BOOTENV_DEV_NAME_BLKDEV_NONE(devtypeu, devtypel, instance)
+
#define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \
#devtypel #instance " "
@@ -59,6 +63,10 @@
#define BOOTENV_SHARED_MMC BOOTENV_SHARED_BLKDEV(mmc)
#define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV
+#elif defined(CONFIG_SPL_BUILD)
+#define BOOTENV_SHARED_MMC
+#define BOOTENV_DEV_MMC BOOTENV_DEV_BLKDEV_NONE
+#define BOOTENV_DEV_NAME_MMC BOOTENV_DEV_NAME_BLKDEV_NONE
#else
#define BOOTENV_SHARED_MMC
#define BOOTENV_DEV_MMC \
@@ -190,6 +198,10 @@
#define BOOTENV_SHARED_SATA BOOTENV_SHARED_BLKDEV(sata)
#define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV
+#elif defined(CONFIG_SPL_BUILD)
+#define BOOTENV_SHARED_SATA
+#define BOOTENV_DEV_SATA BOOTENV_DEV_BLKDEV_NONE
+#define BOOTENV_DEV_NAME_SATA BOOTENV_DEV_NAME_BLKDEV_NONE
#else
#define BOOTENV_SHARED_SATA
#define BOOTENV_DEV_SATA \
@@ -293,6 +305,11 @@
BOOTENV_SHARED_BLKDEV_BODY(usb)
#define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV
#define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV
+#elif defined(CONFIG_SPL_BUILD)
+#define BOOTENV_RUN_NET_USB_START
+#define BOOTENV_SHARED_USB
+#define BOOTENV_DEV_USB BOOTENV_DEV_BLKDEV_NONE
+#define BOOTENV_DEV_NAME_USB BOOTENV_DEV_NAME_BLKDEV_NONE
#else
#define BOOTENV_RUN_NET_USB_START
#define BOOTENV_SHARED_USB
@@ -395,6 +412,9 @@
"\0"
#define BOOTENV_DEV_NAME_DHCP(devtypeu, devtypel, instance) \
"dhcp "
+#elif defined(CONFIG_SPL_BUILD)
+#define BOOTENV_DEV_DHCP BOOTENV_DEV_BLKDEV_NONE
+#define BOOTENV_DEV_NAME_DHCP BOOTENV_DEV_NAME_BLKDEV_NONE
#else
#define BOOTENV_DEV_DHCP \
BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP
@@ -413,6 +433,9 @@
"fi\0"
#define BOOTENV_DEV_NAME_PXE(devtypeu, devtypel, instance) \
"pxe "
+#elif defined(CONFIG_SPL_BUILD)
+#define BOOTENV_DEV_PXE BOOTENV_DEV_BLKDEV_NONE
+#define BOOTENV_DEV_NAME_PXE BOOTENV_DEV_NAME_BLKDEV_NONE
#else
#define BOOTENV_DEV_PXE \
BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 11/24] ofnode: fdt_support definitions needed if OF_CONTROL is enabled
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (9 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 10/24] config_distro_bootcmd: remove booting environment variables from SPL environment Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config Troy Kisky
` (12 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Marek Behún
With the use of CONFIG_IS_ENABLED in code, instead of at the preprocessor
level, these defines are still needed if OF_CONTROL is enabled.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
include/fdt_support.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 5638bd4f165..eeb83e6251d 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -7,7 +7,8 @@
#ifndef __FDT_SUPPORT_H
#define __FDT_SUPPORT_H
-#if defined(CONFIG_OF_LIBFDT) && !defined(USE_HOSTCC)
+#if (defined(CONFIG_OF_LIBFDT) || defined(CONFIG_OF_CONTROL)) && \
+ !defined(USE_HOSTCC)
#include <asm/u-boot.h>
#include <linux/libfdt.h>
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (10 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 11/24] ofnode: fdt_support definitions needed if OF_CONTROL is enabled Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 14:45 ` Quentin Schulz
2023-02-22 1:38 ` [PATCH v1 13/24] puma-rk3399: " Troy Kisky
` (11 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Klaus Goger, Quentin Schulz
When IS_ENABLED(CONFIG_ENV_IS_NOWHERE) is converted to
CONFIG_IS_ENABLED(ENV_IS_NOWHERE) this will give unwanted errors
on spl builds.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
board/theobroma-systems/ringneck_px30/ringneck-px30.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/board/theobroma-systems/ringneck_px30/ringneck-px30.c b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
index 47d1a40ef7c..bb1bb4acf5c 100644
--- a/board/theobroma-systems/ringneck_px30/ringneck-px30.c
+++ b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
@@ -118,10 +118,6 @@ int mmc_get_env_dev(void)
return CONFIG_SYS_MMC_ENV_DEV;
}
-#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
-#error Please enable CONFIG_ENV_IS_NOWHERE
-#endif
-
enum env_location arch_env_get_location(enum env_operation op, int prio)
{
const char *boot_device =
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 13/24] puma-rk3399: remove check for ENV_IS_NOWHERE, it is an SPL config
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (11 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts Troy Kisky
` (10 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Klaus Goger, Quentin Schulz
When IS_ENABLED(CONFIG_ENV_IS_NOWHERE) is converted to
CONFIG_IS_ENABLED(ENV_IS_NOWHERE) this will give unwanted errors
on spl builds.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
board/theobroma-systems/puma_rk3399/puma-rk3399.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
index 97f398bd754..614a60ee8f9 100644
--- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
+++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
@@ -136,10 +136,6 @@ int mmc_get_env_dev(void)
return CONFIG_SYS_MMC_ENV_DEV;
}
-#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
-#error Please enable CONFIG_ENV_IS_NOWHERE
-#endif
-
enum env_location arch_env_get_location(enum env_operation op, int prio)
{
const char *boot_device =
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (12 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 13/24] puma-rk3399: " Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 15/24] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT) Troy Kisky
` (9 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Marek Behún
SPL code wants fdt_fixup_mtdparts defined as a NOP
when the function isn't linked in.
Prepare for ifdef CONFIG_OF_LIBFDT being converted to
if CONFIG_IS_ENABLED(OF_LIBFDT)
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
include/fdt_support.h | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/include/fdt_support.h b/include/fdt_support.h
index eeb83e6251d..94497d755a3 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -245,16 +245,6 @@ int fdt_increase_size(void *fdt, int add_len);
int fdt_delete_disabled_nodes(void *blob);
struct node_info;
-#if defined(CONFIG_FDT_FIXUP_PARTITIONS)
-void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
- int node_info_size);
-#else
-static inline void fdt_fixup_mtdparts(void *fdt,
- const struct node_info *node_info,
- int node_info_size)
-{
-}
-#endif
void fdt_del_node_and_alias(void *blob, const char *alias);
@@ -412,6 +402,19 @@ int fdt_get_cells_len(const void *blob, char *nr_cells_name);
#endif /* ifdef CONFIG_OF_LIBFDT */
+#if CONFIG_IS_ENABLED(OF_LIBFDT) && defined(CONFIG_FDT_FIXUP_PARTITIONS)
+struct node_info;
+void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
+ int node_info_size);
+#else
+struct node_info;
+static inline void fdt_fixup_mtdparts(void *fdt,
+ const struct node_info *node_info,
+ int node_info_size)
+{
+}
+#endif
+
#ifdef USE_HOSTCC
int fdtdec_get_int(const void *blob, int node, const char *prop_name,
int default_val);
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 15/24] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT)
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (13 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 16/24] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC) Troy Kisky
` (8 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Marek Vasut, Olaf Mandel
The function ft_board_setup calls do_fixup_by_path_string
which is only available on CONFIG_IS_ENABLED(OF_LIBFDT).
This prepares for the conversion.
ft_board_setup is only called from image-fdt which is linked by
obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
board/menlo/m53menlo/m53menlo.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/board/menlo/m53menlo/m53menlo.c b/board/menlo/m53menlo/m53menlo.c
index 14324c7087d..ca3b81c57ff 100644
--- a/board/menlo/m53menlo/m53menlo.c
+++ b/board/menlo/m53menlo/m53menlo.c
@@ -264,6 +264,7 @@ void board_preboot_os(void)
gpio_direction_output(IMX_GPIO_NR(6, 0), 0);
}
+#if CONFIG_IS_ENABLED(OF_LIBFDT)
int ft_board_setup(void *blob, struct bd_info *bd)
{
if (lvds_compat_string)
@@ -272,6 +273,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
return 0;
}
+#endif
struct display_info_t const displays[] = {
{
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 16/24] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC)
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (14 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 15/24] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT) Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 17/24] ns16550: match when to define bdf with uart code Troy Kisky
` (7 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Fabio Estevam
pfuze_mode_init calls pmic_reg_read which is only available from
obj-$(CONFIG_$(SPL_TPL_)DM_PMIC) += pmic-uclass.o
Prepare for conversion of defined(CONFIG_DM_PMIC) to
CONFIG_IS_ENABLED(DM_PMIC).
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
board/freescale/common/pfuze.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/freescale/common/pfuze.c b/board/freescale/common/pfuze.c
index 6dca22960bf..a9288820b2e 100644
--- a/board/freescale/common/pfuze.c
+++ b/board/freescale/common/pfuze.c
@@ -91,7 +91,7 @@ struct pmic *pfuze_common_init(unsigned char i2cbus)
return p;
}
-#else
+#elif defined(CONFIG_DM_PMIC)
int pfuze_mode_init(struct udevice *dev, u32 mode)
{
unsigned char offset, i, switch_num;
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (15 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 16/24] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC) Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 18:18 ` Tom Rini
2023-02-22 1:38 ` [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA Troy Kisky
` (6 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Andre Przywara, Bin Meng
When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
bdf is no longer accessible. So change to preprocessor to avoid access.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
arch/x86/cpu/apollolake/uart.c | 6 +++---
include/ns16550.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
index a9362436000..143217755ff 100644
--- a/arch/x86/cpu/apollolake/uart.c
+++ b/arch/x86/cpu/apollolake/uart.c
@@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
static int apl_ns16550_probe(struct udevice *dev)
{
+#if !CONFIG_IS_ENABLED(PCI)
struct apl_ns16550_plat *plat = dev_get_plat(dev);
- if (!CONFIG_IS_ENABLED(PCI))
- apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
-
+ apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
+#endif
return ns16550_serial_probe(dev);
}
diff --git a/include/ns16550.h b/include/ns16550.h
index e7e68663d03..8d7eb7d8f9c 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -74,7 +74,7 @@ struct ns16550_plat {
int clock;
u32 fcr;
int flags;
-#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
+#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
int bdf;
#endif
};
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (16 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 17/24] ns16550: match when to define bdf with uart code Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 16:59 ` Tom Rini
2023-02-22 1:38 ` [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA Troy Kisky
` (5 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Baruch Siach, Fabio Estevam
setup_sata is linked with
obj-$(CONFIG_SATA) += sata.o
So use SATA instead of CMD_SATA.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 7c44379ec4a..e31a7e9552f 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -275,7 +275,7 @@ int board_early_init_f(void)
{
setup_iomux_uart();
-#ifdef CONFIG_CMD_SATA
+#if CONFIG_IS_ENABLED(SATA)
setup_sata();
#endif
setup_fec();
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (17 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 15:05 ` Tom Rini
2023-02-22 1:38 ` [PATCH v1 20/24] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI) Troy Kisky
` (4 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Fabio Estevam, NXP i.MX U-Boot Team,
Stefano Babic
This avoid an error with enable_sata_clock when
defined(CONFIG_SATA) is changed to CONFIG_IS_ENABLED(SATA).
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
arch/arm/mach-imx/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 4dfc60eedc4..50f26975eac 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -54,7 +54,7 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
ifneq ($(CONFIG_SPL_BUILD),y)
obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
endif
-obj-$(CONFIG_SATA) += sata.o
+obj-$(CONFIG_$(SPL_)SATA) += sata.o
obj-$(CONFIG_IMX_HAB) += hab.o
obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
endif
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 20/24] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI)
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (18 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 21/24] gateworks: venice: surround call of setup_fec with if IS_ENABLED(CONFIG_NET) Troy Kisky
` (3 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Bin Meng
This avoids an error when ifdef CONFIG_PCI is changed to
if CONFIG_IS_ENABLED(PCI)
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
arch/x86/cpu/i386/cpu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
index c7f6c5a013e..07a73f79768 100644
--- a/arch/x86/cpu/i386/cpu.c
+++ b/arch/x86/cpu/i386/cpu.c
@@ -415,7 +415,9 @@ int cpu_phys_address_size(void)
/* Don't allow PCI region 3 to use memory in the 2-4GB memory hole */
static void setup_pci_ram_top(void)
{
+#if CONFIG_IS_ENABLED(PCI)
gd->pci_ram_top = 0x80000000U;
+#endif
}
static void setup_mtrr(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 21/24] gateworks: venice: surround call of setup_fec with if IS_ENABLED(CONFIG_NET)
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (19 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 20/24] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI) Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 15:07 ` Tom Rini
2023-02-22 1:38 ` [PATCH v1 22/24] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY) Troy Kisky
` (2 subsequent siblings)
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Tim Harvey
This is the same as the definition is surrounded by.
It avoids an error in converting to CONFIG_IS_ENABLED(NET).
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
board/gateworks/venice/venice.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c
index c4d86c26a9b..ad27835caaf 100644
--- a/board/gateworks/venice/venice.c
+++ b/board/gateworks/venice/venice.c
@@ -41,7 +41,7 @@ int board_fit_config_name_match(const char *name)
return -1;
}
-#if (IS_ENABLED(CONFIG_NET))
+#if IS_ENABLED(CONFIG_NET)
static int setup_fec(void)
{
struct iomuxc_gpr_base_regs *gpr =
@@ -113,10 +113,12 @@ int board_init(void)
{
venice_eeprom_init(1);
+#if IS_ENABLED(CONFIG_NET)
if (IS_ENABLED(CONFIG_FEC_MXC))
setup_fec();
if (IS_ENABLED(CONFIG_DWC_ETH_QOS))
setup_eqos();
+#endif
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 22/24] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY)
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (20 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 21/24] gateworks: venice: surround call of setup_fec with if IS_ENABLED(CONFIG_NET) Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 23/24] arm: cpu: armv7: ls102xa: fdt: remove eth_device support Troy Kisky
2023-02-22 1:38 ` [PATCH v1 24/24] CI: add test/usage_of_is_enabled_check.sh Troy Kisky
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Jaehoon Chung, Lukasz Majewski
This avoids an error in converting to CONFIG_IS_ENABLED(DM_PMIC).
Many boards SPL code needs these definitions to compile, even if
the functions are not linked.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
include/power/pmic.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/power/pmic.h b/include/power/pmic.h
index 70f2709bd0b..636221692d0 100644
--- a/include/power/pmic.h
+++ b/include/power/pmic.h
@@ -86,7 +86,7 @@ struct pmic {
#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */
/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */
-#ifdef CONFIG_DM_PMIC
+#if defined(CONFIG_DM_PMIC) || !CONFIG_IS_ENABLED(POWER_LEGACY)
/**
* U-Boot PMIC Framework
* =====================
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 23/24] arm: cpu: armv7: ls102xa: fdt: remove eth_device support
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (21 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 22/24] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY) Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 24/24] CI: add test/usage_of_is_enabled_check.sh Troy Kisky
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot; +Cc: gary.bisson, Troy Kisky, Alison Wang
commit e524f3a449f5 ("net: Remove eth_legacy.c")
removed struct eth_device
This prevents errors in the conversion to CONFIG_IS_ENABLED(DM_ETH).
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
arch/arm/cpu/armv7/ls102xa/fdt.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c b/arch/arm/cpu/armv7/ls102xa/fdt.c
index 599b7e18ef3..a5c5c780ae8 100644
--- a/arch/arm/cpu/armv7/ls102xa/fdt.c
+++ b/arch/arm/cpu/armv7/ls102xa/fdt.c
@@ -25,11 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
void ft_fixup_enet_phy_connect_type(void *fdt)
{
-#ifdef CONFIG_DM_ETH
struct udevice *dev;
-#else
- struct eth_device *dev;
-#endif
struct tsec_private *priv;
const char *enet_path, *phy_path;
char enet[16];
@@ -37,12 +33,8 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
int phy_node;
int i = 0;
uint32_t ph;
-#ifdef CONFIG_DM_ETH
char *name[3] = { "ethernet@2d10000", "ethernet@2d50000",
"ethernet@2d90000" };
-#else
- char *name[3] = { "eTSEC1", "eTSEC2", "eTSEC3" };
-#endif
for (; i < ARRAY_SIZE(name); i++) {
dev = eth_get_dev_by_name(name[i]);
@@ -53,11 +45,7 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
continue;
}
-#ifdef CONFIG_DM_ETH
priv = dev_get_priv(dev);
-#else
- priv = dev->priv;
-#endif
if (priv->flags & TSEC_SGMII)
continue;
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* [PATCH v1 24/24] CI: add test/usage_of_is_enabled_check.sh
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
` (22 preceding siblings ...)
2023-02-22 1:38 ` [PATCH v1 23/24] arm: cpu: armv7: ls102xa: fdt: remove eth_device support Troy Kisky
@ 2023-02-22 1:38 ` Troy Kisky
2023-02-22 21:20 ` Simon Glass
23 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 1:38 UTC (permalink / raw)
To: sjg, trini, u-boot
Cc: gary.bisson, Troy Kisky, Heinrich Schuchardt, Joel Stanley,
Rick Chen
Add script usage_of_is_enabled_check to print any configs that
use CONFIG_IS_ENABLED instead of IS_ENABLED and vice versa.
Add usage_of_is_enabled_commit.sh to generate commits to fix the above
issues.
You can remove entries from test/usage_of_is_enabled_todo.txt
or the entire file and then run
test/usage_of_is_enabled_commit.sh
to convert to suggested usage of CONFIG_IS_ENABLED/IS_ENABLED
or run test/usage_of_is_enabled_check.sh to
see which configs are still todo.
Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
---
.azure-pipelines.yml | 11 ++
.gitlab-ci.yml | 5 +
test/usage_of_is_enabled_check.sh | 19 +++
test/usage_of_is_enabled_commit.sh | 12 ++
test/usage_of_is_enabled_correct.sh | 50 +++++++
test/usage_of_is_enabled_exempt.txt | 9 ++
test/usage_of_is_enabled_list.sh | 86 ++++++++++++
test/usage_of_is_enabled_splcfg.txt | 21 +++
test/usage_of_is_enabled_todo.txt | 210 ++++++++++++++++++++++++++++
9 files changed, 423 insertions(+)
create mode 100755 test/usage_of_is_enabled_check.sh
create mode 100755 test/usage_of_is_enabled_commit.sh
create mode 100755 test/usage_of_is_enabled_correct.sh
create mode 100644 test/usage_of_is_enabled_exempt.txt
create mode 100755 test/usage_of_is_enabled_list.sh
create mode 100644 test/usage_of_is_enabled_splcfg.txt
create mode 100644 test/usage_of_is_enabled_todo.txt
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml
index 947c400f8d3..fcf8885fd33 100644
--- a/.azure-pipelines.yml
+++ b/.azure-pipelines.yml
@@ -67,6 +67,17 @@ stages:
:^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
:^include/linux/kconfig.h :^tools/ && exit 1 || exit 0
+ - job: check_usage_of_is_enabled
+ displayName: 'Check usage of CONFIG_IS_ENABLED vs IS_ENABLED'
+ pool:
+ vmImage: $(ubuntu_vm)
+ container:
+ image: $(ci_runner_image)
+ options: $(container_option)
+ steps:
+ # generate list of SPL configs
+ - script: test/usage_of_is_enabled_check.sh
+
- job: cppcheck
displayName: 'Static code analysis with cppcheck'
pool:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 272d69e2206..c9443702d00 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -137,6 +137,11 @@ check for new CONFIG symbols outside Kconfig:
:^doc/ :^arch/arm/dts/ :^scripts/kconfig/lkc.h
:^include/linux/kconfig.h :^tools/ && exit 1 || exit 0
+check usage of CONFIG_IS_ENABLED vs IS_ENABLED:
+ stage: testsuites
+ script:
+ - ./test/usage_of_is_enabled_check.sh
+
# QA jobs for code analytics
# static code analysis with cppcheck (we can add --enable=all later)
cppcheck:
diff --git a/test/usage_of_is_enabled_check.sh b/test/usage_of_is_enabled_check.sh
new file mode 100755
index 00000000000..6bd5d9c1ac7
--- /dev/null
+++ b/test/usage_of_is_enabled_check.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Written by Troy Kisky <troykiskyboundary@gmail.com>
+
+scriptdir=`dirname "$0"`;
+${scriptdir}/usage_of_is_enabled_list.sh | grep -vw FOO;
+if [ $? -eq 0 ] ; then
+ echo "The above may have incorrect usage of IS_ENABLED/"\
+"CONFIG_IS_ENABLED"
+ echo "Run test/usage_of_is_enabled_commit.sh and "\
+"squash with appropriate commit"
+ ret=1;
+else
+ ret=0;
+fi
+
+rm ${scriptdir}/splcfg.tmp ${scriptdir}/exclude.tmp
+exit ${ret}
diff --git a/test/usage_of_is_enabled_commit.sh b/test/usage_of_is_enabled_commit.sh
new file mode 100755
index 00000000000..593dbd1428c
--- /dev/null
+++ b/test/usage_of_is_enabled_commit.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Written by Troy Kisky <troykiskyboundary@gmail.com>
+
+scriptdir=`dirname "$0"`;
+${scriptdir}/usage_of_is_enabled_list.sh | \
+xargs -I {} sh -c "${scriptdir}/usage_of_is_enabled_correct.sh {}; \
+git commit -a -m\"CONFIG_{}: correct usage of CONFIG_IS_ENABLED/IS_ENABLED\";"
+
+
+rm ${scriptdir}/splcfg.tmp ${scriptdir}/exclude.tmp
diff --git a/test/usage_of_is_enabled_correct.sh b/test/usage_of_is_enabled_correct.sh
new file mode 100755
index 00000000000..8724747beed
--- /dev/null
+++ b/test/usage_of_is_enabled_correct.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Written by Troy Kisky <troykiskyboundary@gmail.com>
+
+scriptdir=`dirname "$0"`;
+
+if [ -z "$1" ] ; then
+ echo missing config
+ exit 1;
+fi
+if [ ! -f "${scriptdir}/splcfg.tmp" ] ; then
+ echo missing splcfg.tmp
+ exit 1;
+fi
+
+
+grep -qw $1 ${scriptdir}/splcfg.tmp
+if [ $? -ne 0 ] ; then
+ # not splcfg
+ # change CONFIG_IS_ENABLED to IS_ENABLED
+ git grep -l \
+ -e "CONFIG_IS_ENABLED($1)" \
+ | \
+ xargs -IFile sh -c \
+ " \
+ sed -i -E \"\
+s/CONFIG_IS_ENABLED\($1\)/IS_ENABLED\(CONFIG_$1\)/g; \
+\" File";
+else
+ # splcfg
+ # change IS_ENABLED to CONFIG_IS_ENABLED
+ # change ifdef to CONFIG_IS_ENABLED
+ # change ifndef to !CONFIG_IS_ENABLED
+ # change defined to CONFIG_IS_ENABLED
+ git grep -l \
+ -e "IS_ENABLED(CONFIG_$1)" \
+ -e "^#ifdef[ \t]\+CONFIG_$1\>" \
+ -e "^#ifndef[ \t]\+CONFIG_$1\>" \
+ -e "defined(CONFIG_$1)" \
+ | \
+ xargs -IFile sh -c \
+ " \
+ sed -i -E \"\
+s/([^_])IS_ENABLED\(CONFIG_$1\)/\1CONFIG_IS_ENABLED($1)/g; \
+s/^#ifdef[ \t]+CONFIG_$1\>/#if CONFIG_IS_ENABLED\($1\)/; \
+s/^#ifndef[ \t]+CONFIG_$1\>/#if !CONFIG_IS_ENABLED\($1\)/; \
+s/defined\(CONFIG_$1\)/CONFIG_IS_ENABLED\($1\)/; \
+\" File";
+fi
diff --git a/test/usage_of_is_enabled_exempt.txt b/test/usage_of_is_enabled_exempt.txt
new file mode 100644
index 00000000000..d9fefd6cb6c
--- /dev/null
+++ b/test/usage_of_is_enabled_exempt.txt
@@ -0,0 +1,9 @@
+BLOBLIST
+BLOBLIST_FIXED
+DM_PMIC_PFUZE100
+FOO
+NAND_BOOT
+OF_CONTROL
+SYS_L2_PL310
+WATCHDOG
+X86_64
diff --git a/test/usage_of_is_enabled_list.sh b/test/usage_of_is_enabled_list.sh
new file mode 100755
index 00000000000..0f51d3602ca
--- /dev/null
+++ b/test/usage_of_is_enabled_list.sh
@@ -0,0 +1,86 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Written by Troy Kisky <troykiskyboundary@gmail.com>
+
+scriptdir=`dirname "$0"`;
+# generate list of excluded configs
+{
+# 1. ignore configs that have a number or string for a value
+git grep -h -A2 -E "^config " '*Kconfig*' | \
+sed -En '/depends on/!p' | \
+sed -En '/^config/{h;$!d} ;H;x; s/config[ \t]+(.*)\n[ \t]*/config \1 #/p' | \
+sed -E "/#bool/d; /#def_bool/d; /#tristate/d; \
+/#default y/d; /#select/d; /#prompt/d; /#imply/d" |
+sed -n -r "s/^config[[:space:]]+([0-9a-zA-Z_]+)/\n\{\1\}\n/p" | \
+sed -n -r 's/^\{([0-9a-zA-Z_]+)\}/\1/p' | sort -u;
+# 2. configs that are exempt for other reasons
+cat ${scriptdir}/usage_of_is_enabled_exempt.txt;
+# 3. configs that need converted later
+[ -f ${scriptdir}/usage_of_is_enabled_todo.txt ] && \
+cat ${scriptdir}/usage_of_is_enabled_todo.txt
+} | sort -u > ${scriptdir}/exclude.tmp
+
+# generate list of CONFIGs that should use CONFIG_IS_ENABLED
+{
+# 1. all obj-$(CONFIG_$(SPL_)xxx in Makefiles
+git grep -h 'obj-$(CONFIG_$(SPL_' '*Makefile' | sed -e "s/SPL_TPL_/SPL_/"| \
+sed -n -r 's/obj\-\$\(CONFIG_\$\(SPL_\)([0-9a-zA-Z_]+)\)/\n\{\1\}\n/gp'| \
+sed -n -r 's/\{([0-9a-zA-Z_]+)\}/\1/p';
+
+# 2. all SPL_xxx in Kconfig files
+git grep -h -E 'config [ST]PL_' '*Kconfig*' | \
+sed -n -r "s/config [ST]PL_([0-9a-zA-Z_]+)/\n\{\1\}\n/p" | \
+sed -n -r 's/\{([0-9a-zA-Z_]+)\}/\1/p';
+
+# 3. all CONFIG_CMD_xxx which already use CONFIG_IS_ENABLED
+# The Makefile for most if these use ifndef CONFIG_SPL_BUILD
+# instead of obj-$(CONFIG_$(SPL_)xxx
+git grep -h -E 'CONFIG_IS_ENABLED\(CMD_' | \
+sed -n -e "s/\(CONFIG_IS_ENABLED(CMD_[0-9a-zA-Z_]*)\)/\n\1\n/gp"| \
+sed -n -r "s/CONFIG_IS_ENABLED\((CMD_[0-9a-zA-Z_]+)\)/\1/p";
+
+# 4. A list of other configs that should use CONFIG_IS_ENABLED
+# This list could be reduced if obj-$(CONFIG_$(SPL_)xxx was used instead of
+# ifndef CONFIG_SPL_BUILD in Makefiles
+# usage_of_is_enabled_splcfg.txt mostly contains configs that should always
+# be undefined in SPL/TPL
+# Note: CONFIG_CLK was included to prevent a change in test_checkpatch.py
+# which is checking for an error.
+cat ${scriptdir}/usage_of_is_enabled_splcfg.txt;
+} | sort -u | \
+comm -23 - ${scriptdir}/exclude.tmp >${scriptdir}/splcfg.tmp
+
+{
+# generate list of CONFIGs that incorrectly use CONFIG_IS_ENABLED
+git grep -h CONFIG_IS_ENABLED | \
+sed -n -e "s/\(CONFIG_IS_ENABLED([0-9a-zA-Z_]*)\)/\n\1\n/gp"| \
+sed -n -r "s/CONFIG_IS_ENABLED\(([0-9a-zA-Z_]+)\)/\1/p" |sort -u| \
+comm -23 - ${scriptdir}/exclude.tmp | \
+comm -23 - ${scriptdir}/splcfg.tmp ;
+
+# generate list of CONFIGs that incorrectly use IS_ENABLED
+git grep -h -w IS_ENABLED | \
+sed -n -e "s/\(IS_ENABLED(CONFIG_[0-9a-zA-Z_]*)\)/\n\1\n/gp"| \
+sed -n -r "s/IS_ENABLED\(CONFIG_([0-9a-zA-Z_]+)\)/\1/p" |sort -u| \
+join - ${scriptdir}/splcfg.tmp;
+
+# generate list of CONFIGs that incorrectly use ifdef
+git grep -h -E "^#ifdef[ \t]+CONFIG_" | \
+sed -n -E "s/(ifdef[ \t]+CONFIG_[0-9a-zA-Z_]+)/\n\1\n/p"| \
+sed -n -E "s/ifdef[ \t]+CONFIG_([0-9a-zA-Z_]+)/\1/p" |sort -u| \
+join - ${scriptdir}/splcfg.tmp ;
+
+# generate list of CONFIGs that incorrectly use ifndef
+git grep -h -E "^#ifndef[ \t]+CONFIG_" | \
+sed -n -E "s/(ifndef[ \t]+CONFIG_[0-9a-zA-Z_]+)/\n\1\n/p"| \
+sed -n -E "s/ifndef[ \t]+CONFIG_([0-9a-zA-Z_]+)/\1/p" |sort -u| \
+join - ${scriptdir}/splcfg.tmp ;
+
+# generate list of CONFIGs that incorrectly use defined
+git grep -h -E "defined\(CONFIG_" | \
+sed -n -E "s/(defined\(CONFIG_[0-9a-zA-Z_]+\))/\n\1\n/gp"| \
+sed -n -E "s/defined\(CONFIG_([0-9a-zA-Z_]+)\)/\1/p" |sort -u| \
+join - ${scriptdir}/splcfg.tmp ;
+
+} | sort -u;
diff --git a/test/usage_of_is_enabled_splcfg.txt b/test/usage_of_is_enabled_splcfg.txt
new file mode 100644
index 00000000000..29d6257c5c7
--- /dev/null
+++ b/test/usage_of_is_enabled_splcfg.txt
@@ -0,0 +1,21 @@
+BZIP2
+CONFIG_CLK
+CONSOLE_MUX
+DM_EVENT
+DM_HWSPINLOCK
+DM_RNG
+DM_STDIO
+EFI_DEVICE_PATH_TO_TEXT
+EFI_LOADER
+ERRNO_STR
+EVENT_DYNAMIC
+GENERATE_SMBIOS_TABLE
+IOMMU
+MMC_HW_PARTITIONING
+NAND_CS_INIT
+OFNODE_MULTI_TREE
+PINCTRL_ARMADA_38X
+PRE_CONSOLE_BUFFER
+RESET_MEDIATEK
+RESET_ROCKCHIP
+UT_DM
diff --git a/test/usage_of_is_enabled_todo.txt b/test/usage_of_is_enabled_todo.txt
new file mode 100644
index 00000000000..005531cff46
--- /dev/null
+++ b/test/usage_of_is_enabled_todo.txt
@@ -0,0 +1,210 @@
+ACPIGEN
+ARCH_MVEBU
+ARCH_VERSAL_NET
+ARM_PSCI_FW
+ARMV8_SEC_FIRMWARE_SUPPORT
+ATMEL_PIT_TIMER
+BLK
+BLOCK_CACHE
+BOOTCOUNT_LIMIT
+BOOTDEV_ETH
+BOOTDEV_SPI_FLASH
+BOOTSTAGE
+BOOTSTD
+BZIP2
+CLK
+CLK_CCF
+CLK_IMX6Q
+CMD_DHCP
+CMDLINE
+CMD_PXE
+CONSOLE_MUX
+COREBOOT_SYSINFO
+CPU
+CRC32_VERIFY
+CROS_EC_KEYB
+DFU_SF_PART
+DFU_VIRT
+DISPLAY_AER_FULL
+DM
+DMA
+DM_DMA
+DM_ETH
+DM_GPIO
+DM_I2C
+DM_KEYBOARD
+DM_MMC
+DM_PMIC
+DM_PMIC_DA9063
+DM_REGULATOR
+DM_RNG
+DM_RTC
+DM_SERIAL
+DM_SPI
+DM_SPI_FLASH
+DM_USB
+DM_USB_GADGET
+DOS_PARTITION
+DWC_AHSATA_AHCI
+EFI_DT_FIXUP
+EFI_EBBR_2_1_CONFORMANCE
+EFI_LOADER
+EFI_PARTITION
+EFI_SCROLL_ON_CLEAR_SCREEN
+EFI_TCG2_PROTOCOL_MEASURE_DTB
+EFI_UNICODE_CAPITALIZATION
+ENV_APPEND
+ENV_IS_IN_EXT4
+ENV_IS_IN_FAT
+ENV_IS_IN_FLASH
+ENV_IS_IN_MMC
+ENV_IS_IN_NAND
+ENV_IS_IN_SPI_FLASH
+ENV_IS_NOWHERE
+ENV_WRITEABLE_LIST
+ERRNO_STR
+EVENT_DEBUG
+EXPO
+EXYNOS7870
+EXYNOS7880
+FASTBOOT_UUU_SUPPORT
+FAT_WRITE
+FIT
+FIT_CIPHER
+FIT_IMAGE_POST_PROCESS
+FIT_SIGNATURE
+FIT_VERBOSE
+FPGA
+FRU_SC
+FSL_ISBC_KEY_EXT
+FSL_LS_PPA
+FS_LOADER
+FSP_VERSION2
+GENERATE_ACPI_TABLE
+GENERATE_SMBIOS_TABLE
+GMAC_ROCKCHIP
+GZIP
+I2C_EEPROM
+I8259_PIC
+IMX_RDC
+LED
+LEGACY_IMAGE_FORMAT
+LIB_UUID
+LOG
+LZ4
+LZMA
+LZO
+MALTA
+MARY
+MEMSIZE_IN_BYTES
+MIPS_BOOT_CMDLINE_LEGACY
+MIPS_BOOT_ENV_LEGACY
+MIPS_BOOT_FDT
+MMC
+MMC_IO_VOLTAGE
+MMC_VERBOSE
+MULTI_DTB_FIT
+MULTIPLEXER
+MXC_OCOTP
+NAND_DENALI
+NET
+NO_FB_CLEAR
+NXP_FSPI
+OF_LIBFDT
+OF_LIVE
+OFNODE_MULTI_TREE
+OF_REAL
+OF_TRANSLATE
+OPTEE
+OPTEE_IMAGE
+PARTITIONS
+PARTITION_UUIDS
+PCI
+PCI_PNP
+PG_WCOM_UBOOT_UPDATE_SUPPORTED
+PHY
+PHY_CADENCE_SIERRA
+PHY_CADENCE_TORRENT
+PHY_FIXED
+PINCTRL
+PKCS7_MESSAGE_PARSER
+PLATDATA
+POWER_DOMAIN
+POWER_I2C
+QFW
+QFW_PIO
+RAM
+RANDOM_UUID
+RESET_MEDIATEK
+RESTORE_EXCEPTION_VECTOR_BASE
+RISCV_SMODE
+ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON
+RSA_PUBLIC_KEY_PARSER
+RSA_VERIFY_WITH_PKEY
+SANDBOX
+SATA
+SEC_FIRMWARE_ARMV8_PSCI
+SEMIHOSTING
+SERIAL
+SERIAL_PUTS
+SERIAL_RX_BUFFER
+SHA1
+SHA384
+SHA512
+SHA512_HW_ACCEL
+SHA_HW_ACCEL
+SHOW_BOOT_PROGRESS
+SILENT_CONSOLE
+SILENT_CONSOLE_UPDATE_ON_RELOC
+SILENT_CONSOLE_UPDATE_ON_SET
+SIMPLE_BUS_CORRECT_RANGE
+SKIP_LOWLEVEL_INIT
+SMC911X_32_BIT
+SMP
+SPI
+SPI_BOOT
+SPI_DIRMAP
+SPI_FLASH_BAR
+SPI_FLASH_MACRONIX
+SPI_FLASH_MTD
+SPI_FLASH_SFDP_SUPPORT
+SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT
+STM32_ETZPC
+SYS_CONSOLE_IS_IN_ENV
+SYS_DCACHE_OFF
+SYS_DEVICE_NULLDEV
+SYS_ICACHE_OFF
+SYSINFO
+SYSRESET
+SYS_THUMB_BUILD
+SYS_WHITE_ON_BLACK
+TARGET_DENEB
+TARGET_EVB_RK3399
+TARGET_GIEDI
+TARGET_KMCOGE5NE
+TARGET_KMETER1
+TARGET_ST_STM32MP15x
+TEST_KCONFIG
+TIMER
+_UNDEFINED
+UNIT_TEST
+USB_CDNS3_GADGET
+USB_CDNS3_HOST
+USB_ETHER
+USB_GADGET
+USB_GADGET_OS_DESCRIPTORS
+USB_HOST
+USB_STORAGE
+USE_ARCH_MEMSET
+UT_DM
+UT_UNICODE
+VID
+VIRTIO
+WDT
+X509_CERTIFICATE_PARSER
+X86_16BIT_INIT
+XILINX_MICROBLAZE0_DELAY_SLOT_EXCEP
+XILINX_MICROBLAZE0_USR_EXCEP
+ZLIB
+ZSTD
+ZYNQMP_PSU_INIT_ENABLED
--
2.34.1
^ permalink raw reply related [flat|nested] 64+ messages in thread
* Re: [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config
2023-02-22 1:38 ` [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config Troy Kisky
@ 2023-02-22 14:45 ` Quentin Schulz
2023-02-22 15:03 ` Tom Rini
0 siblings, 1 reply; 64+ messages in thread
From: Quentin Schulz @ 2023-02-22 14:45 UTC (permalink / raw)
To: Troy Kisky, sjg, trini, u-boot; +Cc: gary.bisson, Klaus Goger
Hi Troy,
On 2/22/23 02:38, Troy Kisky wrote:
> When IS_ENABLED(CONFIG_ENV_IS_NOWHERE) is converted to
> CONFIG_IS_ENABLED(ENV_IS_NOWHERE) this will give unwanted errors
> on spl builds.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> board/theobroma-systems/ringneck_px30/ringneck-px30.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/board/theobroma-systems/ringneck_px30/ringneck-px30.c b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
> index 47d1a40ef7c..bb1bb4acf5c 100644
> --- a/board/theobroma-systems/ringneck_px30/ringneck-px30.c
> +++ b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
> @@ -118,10 +118,6 @@ int mmc_get_env_dev(void)
> return CONFIG_SYS_MMC_ENV_DEV;
> }
>
> -#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
> -#error Please enable CONFIG_ENV_IS_NOWHERE
> -#endif
> -
NACK. We absolutely require CONFIG_ENV_IS_NOWHERE for our SoMs in U-Boot
proper. See the discussion here:
https://lore.kernel.org/u-boot/20220722160655.3904213-8-foss+uboot@0leil.net/,
specifically
https://lore.kernel.org/u-boot/4feb827e-3932-c8d6-120e-5465ad92eac2@theobroma-systems.com/.
We don't have support for SPL environment and don't plan to AFAIK, so I
believe the current implementation is correct and I'd very much like
this check to not be removed.
How are we supposed to handle symbols definition only in U-Boot proper
without this?
Same applies to Puma BTW.
Cheers,
Quentin
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config
2023-02-22 14:45 ` Quentin Schulz
@ 2023-02-22 15:03 ` Tom Rini
0 siblings, 0 replies; 64+ messages in thread
From: Tom Rini @ 2023-02-22 15:03 UTC (permalink / raw)
To: Quentin Schulz; +Cc: Troy Kisky, sjg, u-boot, gary.bisson, Klaus Goger
[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]
On Wed, Feb 22, 2023 at 03:45:17PM +0100, Quentin Schulz wrote:
> Hi Troy,
>
> On 2/22/23 02:38, Troy Kisky wrote:
> > When IS_ENABLED(CONFIG_ENV_IS_NOWHERE) is converted to
> > CONFIG_IS_ENABLED(ENV_IS_NOWHERE) this will give unwanted errors
> > on spl builds.
> >
> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > ---
> >
> > board/theobroma-systems/ringneck_px30/ringneck-px30.c | 4 ----
> > 1 file changed, 4 deletions(-)
> >
> > diff --git a/board/theobroma-systems/ringneck_px30/ringneck-px30.c b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
> > index 47d1a40ef7c..bb1bb4acf5c 100644
> > --- a/board/theobroma-systems/ringneck_px30/ringneck-px30.c
> > +++ b/board/theobroma-systems/ringneck_px30/ringneck-px30.c
> > @@ -118,10 +118,6 @@ int mmc_get_env_dev(void)
> > return CONFIG_SYS_MMC_ENV_DEV;
> > }
> > -#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
> > -#error Please enable CONFIG_ENV_IS_NOWHERE
> > -#endif
> > -
>
> NACK. We absolutely require CONFIG_ENV_IS_NOWHERE for our SoMs in U-Boot
OK, so please select it in the config TARGET_... stanza, and make sure
doc/board/... explains what's going on.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA
2023-02-22 1:38 ` [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA Troy Kisky
@ 2023-02-22 15:05 ` Tom Rini
2023-02-23 19:23 ` Troy Kisky
0 siblings, 1 reply; 64+ messages in thread
From: Tom Rini @ 2023-02-22 15:05 UTC (permalink / raw)
To: Troy Kisky
Cc: sjg, u-boot, gary.bisson, Fabio Estevam, NXP i.MX U-Boot Team,
Stefano Babic
[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]
On Tue, Feb 21, 2023 at 05:38:16PM -0800, Troy Kisky wrote:
> This avoid an error with enable_sata_clock when
> defined(CONFIG_SATA) is changed to CONFIG_IS_ENABLED(SATA).
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> arch/arm/mach-imx/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index 4dfc60eedc4..50f26975eac 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -54,7 +54,7 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
> ifneq ($(CONFIG_SPL_BUILD),y)
> obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
> endif
> -obj-$(CONFIG_SATA) += sata.o
> +obj-$(CONFIG_$(SPL_)SATA) += sata.o
> obj-$(CONFIG_IMX_HAB) += hab.o
> obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
> endif
In that Simon thinks the $(SPL_) syntax here is ugly, lets just move
this line in to the existing guard for non-SPL builds, with
imx_bootaux.o.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 21/24] gateworks: venice: surround call of setup_fec with if IS_ENABLED(CONFIG_NET)
2023-02-22 1:38 ` [PATCH v1 21/24] gateworks: venice: surround call of setup_fec with if IS_ENABLED(CONFIG_NET) Troy Kisky
@ 2023-02-22 15:07 ` Tom Rini
0 siblings, 0 replies; 64+ messages in thread
From: Tom Rini @ 2023-02-22 15:07 UTC (permalink / raw)
To: Troy Kisky; +Cc: sjg, u-boot, gary.bisson, Tim Harvey
[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]
On Tue, Feb 21, 2023 at 05:38:18PM -0800, Troy Kisky wrote:
> This is the same as the definition is surrounded by.
> It avoids an error in converting to CONFIG_IS_ENABLED(NET).
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> board/gateworks/venice/venice.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/board/gateworks/venice/venice.c b/board/gateworks/venice/venice.c
> index c4d86c26a9b..ad27835caaf 100644
> --- a/board/gateworks/venice/venice.c
> +++ b/board/gateworks/venice/venice.c
> @@ -41,7 +41,7 @@ int board_fit_config_name_match(const char *name)
> return -1;
> }
>
> -#if (IS_ENABLED(CONFIG_NET))
> +#if IS_ENABLED(CONFIG_NET)
> static int setup_fec(void)
> {
> struct iomuxc_gpr_base_regs *gpr =
> @@ -113,10 +113,12 @@ int board_init(void)
> {
> venice_eeprom_init(1);
>
> +#if IS_ENABLED(CONFIG_NET)
> if (IS_ENABLED(CONFIG_FEC_MXC))
> setup_fec();
> if (IS_ENABLED(CONFIG_DWC_ETH_QOS))
> setup_eqos();
> +#endif
>
> return 0;
> }
We should be able to not-guard setup_fec (and setup_eqos), as if
(IS_ENABLED(...)) will lead to the compiler optimizing it all away, but
if (0) { func() } shouldn't result in unused function warnings.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA
2023-02-22 1:38 ` [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA Troy Kisky
@ 2023-02-22 16:59 ` Tom Rini
2023-02-22 18:13 ` Troy Kisky
0 siblings, 1 reply; 64+ messages in thread
From: Tom Rini @ 2023-02-22 16:59 UTC (permalink / raw)
To: Troy Kisky; +Cc: sjg, u-boot, gary.bisson, Baruch Siach, Fabio Estevam
[-- Attachment #1: Type: text/plain, Size: 816 bytes --]
On Tue, Feb 21, 2023 at 05:38:15PM -0800, Troy Kisky wrote:
> setup_sata is linked with
> obj-$(CONFIG_SATA) += sata.o
>
> So use SATA instead of CMD_SATA.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
> index 7c44379ec4a..e31a7e9552f 100644
> --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
> +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
> @@ -275,7 +275,7 @@ int board_early_init_f(void)
> {
> setup_iomux_uart();
>
> -#ifdef CONFIG_CMD_SATA
> +#if CONFIG_IS_ENABLED(SATA)
> setup_sata();
> #endif
> setup_fec();
Note that wandboard needs a similar fix.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA
2023-02-22 16:59 ` Tom Rini
@ 2023-02-22 18:13 ` Troy Kisky
2023-02-24 1:19 ` Troy Kisky
0 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 18:13 UTC (permalink / raw)
To: Tom Rini; +Cc: sjg, u-boot, gary.bisson, Baruch Siach, Fabio Estevam
On Wed, Feb 22, 2023 at 8:59 AM Tom Rini <trini@konsulko.com> wrote:
> On Tue, Feb 21, 2023 at 05:38:15PM -0800, Troy Kisky wrote:
>
> > setup_sata is linked with
> > obj-$(CONFIG_SATA) += sata.o
> >
> > So use SATA instead of CMD_SATA.
> >
> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > ---
> >
> > board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c
> b/board/solidrun/mx6cuboxi/mx6cuboxi.c
> > index 7c44379ec4a..e31a7e9552f 100644
> > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
> > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
> > @@ -275,7 +275,7 @@ int board_early_init_f(void)
> > {
> > setup_iomux_uart();
> >
> > -#ifdef CONFIG_CMD_SATA
> > +#if CONFIG_IS_ENABLED(SATA)
> > setup_sata();
> > #endif
> > setup_fec();
>
> Note that wandboard needs a similar fix.
>
> --
> Tom
>
Hi Tom
The commit script will change
#ifdef CONFIG_SATA
to
#if CONFIG_IS_ENABLED(SATA)
This series only changes things that the commit script won't.
BR
Troy
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 1:38 ` [PATCH v1 17/24] ns16550: match when to define bdf with uart code Troy Kisky
@ 2023-02-22 18:18 ` Tom Rini
2023-02-22 18:42 ` Troy Kisky
0 siblings, 1 reply; 64+ messages in thread
From: Tom Rini @ 2023-02-22 18:18 UTC (permalink / raw)
To: Troy Kisky; +Cc: sjg, u-boot, gary.bisson, Andre Przywara, Bin Meng
[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]
On Tue, Feb 21, 2023 at 05:38:14PM -0800, Troy Kisky wrote:
> When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
> bdf is no longer accessible. So change to preprocessor to avoid access.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> arch/x86/cpu/apollolake/uart.c | 6 +++---
> include/ns16550.h | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
> index a9362436000..143217755ff 100644
> --- a/arch/x86/cpu/apollolake/uart.c
> +++ b/arch/x86/cpu/apollolake/uart.c
> @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>
> static int apl_ns16550_probe(struct udevice *dev)
> {
> +#if !CONFIG_IS_ENABLED(PCI)
> struct apl_ns16550_plat *plat = dev_get_plat(dev);
>
> - if (!CONFIG_IS_ENABLED(PCI))
> - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> -
> + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> +#endif
> return ns16550_serial_probe(dev);
> }
>
> diff --git a/include/ns16550.h b/include/ns16550.h
> index e7e68663d03..8d7eb7d8f9c 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -74,7 +74,7 @@ struct ns16550_plat {
> int clock;
> u32 fcr;
> int flags;
> -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
> +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
> int bdf;
> #endif
> };
This isn't equivalent. This means platforms such as am335x_evm which do
not enable PCI nor SPL_PCI now get this field and grow their rodata.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 18:18 ` Tom Rini
@ 2023-02-22 18:42 ` Troy Kisky
2023-02-22 19:16 ` Simon Glass
2023-02-22 19:39 ` Troy Kisky
0 siblings, 2 replies; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 18:42 UTC (permalink / raw)
To: Tom Rini; +Cc: sjg, u-boot, gary.bisson, Andre Przywara, Bin Meng
On Wed, Feb 22, 2023 at 10:18 AM Tom Rini <trini@konsulko.com> wrote:
> On Tue, Feb 21, 2023 at 05:38:14PM -0800, Troy Kisky wrote:
>
> > When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
> > bdf is no longer accessible. So change to preprocessor to avoid access.
> >
> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > ---
> >
> > arch/x86/cpu/apollolake/uart.c | 6 +++---
> > include/ns16550.h | 2 +-
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/x86/cpu/apollolake/uart.c
> b/arch/x86/cpu/apollolake/uart.c
> > index a9362436000..143217755ff 100644
> > --- a/arch/x86/cpu/apollolake/uart.c
> > +++ b/arch/x86/cpu/apollolake/uart.c
> > @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
> >
> > static int apl_ns16550_probe(struct udevice *dev)
> > {
> > +#if !CONFIG_IS_ENABLED(PCI)
> > struct apl_ns16550_plat *plat = dev_get_plat(dev);
> >
> > - if (!CONFIG_IS_ENABLED(PCI))
> > - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> > -
> > + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> > +#endif
> > return ns16550_serial_probe(dev);
> > }
> >
> > diff --git a/include/ns16550.h b/include/ns16550.h
> > index e7e68663d03..8d7eb7d8f9c 100644
> > --- a/include/ns16550.h
> > +++ b/include/ns16550.h
> > @@ -74,7 +74,7 @@ struct ns16550_plat {
> > int clock;
> > u32 fcr;
> > int flags;
> > -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
> > +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
> > int bdf;
> > #endif
> > };
>
> This isn't equivalent. This means platforms such as am335x_evm which do
> not enable PCI nor SPL_PCI now get this field and grow their rodata.
>
> --
> Tom
>
tkisky@OS2:~/u-boot-tkisky$ make am335x_evm_defconfig
#
# configuration written to .config
#
tkisky@OS2:~/u-boot-tkisky$ grep -w CONFIG_INTEL_APOLLOLAKE .config
tkisky@OS2:~/u-boot-tkisky$
Would this be better ?
#if defined(CONFIG_INTEL_APOLLOLAKE) && ( !CONFIG_IS_ENABLED(PCI) ||
CONFIG_IS_ENABLED(OF_PLATDATA))
I don't understand what bdf is, but
#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
int bdf;
#endif
in the include/ns16550.h, doesn't make sense with the usage in uart.c
if (!CONFIG_IS_ENABLED(PCI))
apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
_________
I think I might be trying to paper over a bug.
Thanks
Troy
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 18:42 ` Troy Kisky
@ 2023-02-22 19:16 ` Simon Glass
2023-02-22 19:39 ` Troy Kisky
1 sibling, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 19:16 UTC (permalink / raw)
To: Troy Kisky; +Cc: Tom Rini, u-boot, gary.bisson, Andre Przywara, Bin Meng
Hi Troy,
On Wed, 22 Feb 2023 at 11:43, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> On Wed, Feb 22, 2023 at 10:18 AM Tom Rini <trini@konsulko.com> wrote:
>>
>> On Tue, Feb 21, 2023 at 05:38:14PM -0800, Troy Kisky wrote:
>>
>> > When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
>> > bdf is no longer accessible. So change to preprocessor to avoid access.
>> >
>> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
>> > ---
>> >
>> > arch/x86/cpu/apollolake/uart.c | 6 +++---
>> > include/ns16550.h | 2 +-
>> > 2 files changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
>> > index a9362436000..143217755ff 100644
>> > --- a/arch/x86/cpu/apollolake/uart.c
>> > +++ b/arch/x86/cpu/apollolake/uart.c
>> > @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>> >
>> > static int apl_ns16550_probe(struct udevice *dev)
>> > {
>> > +#if !CONFIG_IS_ENABLED(PCI)
>> > struct apl_ns16550_plat *plat = dev_get_plat(dev);
>> >
>> > - if (!CONFIG_IS_ENABLED(PCI))
>> > - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>> > -
>> > + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>> > +#endif
>> > return ns16550_serial_probe(dev);
>> > }
>> >
>> > diff --git a/include/ns16550.h b/include/ns16550.h
>> > index e7e68663d03..8d7eb7d8f9c 100644
>> > --- a/include/ns16550.h
>> > +++ b/include/ns16550.h
>> > @@ -74,7 +74,7 @@ struct ns16550_plat {
>> > int clock;
>> > u32 fcr;
>> > int flags;
>> > -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
>> > +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
>> > int bdf;
>> > #endif
>> > };
>>
>> This isn't equivalent. This means platforms such as am335x_evm which do
>> not enable PCI nor SPL_PCI now get this field and grow their rodata.
>>
>> --
>> Tom
>
>
> tkisky@OS2:~/u-boot-tkisky$ make am335x_evm_defconfig
> #
> # configuration written to .config
> #
> tkisky@OS2:~/u-boot-tkisky$ grep -w CONFIG_INTEL_APOLLOLAKE .config
> tkisky@OS2:~/u-boot-tkisky$
>
> Would this be better ?
> #if defined(CONFIG_INTEL_APOLLOLAKE) && ( !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA))
>
> I don't understand what bdf is, but
> #if defined(CONFIG_PCI) && defined(CONFIG_SPL)
> int bdf;
> #endif
bus, device, function. Basically it identifies everything on the PCI
bus that might need a driver.
>
> in the include/ns16550.h, doesn't make sense with the usage in uart.c
> if (!CONFIG_IS_ENABLED(PCI))
> apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> _________
> I think I might be trying to paper over a bug.
Yes I agree, and we have a number of these sorts of inconsistencies.
You can also add a static inline accessor, as is done with
gd_multi_dtb_fit(), for example. That would be simpler.
Specifically, for Intel Apollo Lake, the PCI Kconfig means that PCI
support is enabled in the U-Boot phase. It doesn't mean that the board
doesn't have PCI (it always does), It's just that in early stages we
don't want to bring in all that code. I believe that the bdf field is
only used in TPL, before PCI is enabled.
So an accessor seems best, or make use of Heinrich's new thing [1]
Regards,
Simon
[1] https://patchwork.ozlabs.org/project/uboot/patch/20230219113629.39142-3-heinrich.schuchardt@canonical.com/
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 18:42 ` Troy Kisky
2023-02-22 19:16 ` Simon Glass
@ 2023-02-22 19:39 ` Troy Kisky
2023-02-22 20:41 ` Troy Kisky
2023-02-22 20:56 ` Simon Glass
1 sibling, 2 replies; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 19:39 UTC (permalink / raw)
To: Tom Rini; +Cc: sjg, u-boot, gary.bisson, Andre Przywara, Bin Meng
On Wed, Feb 22, 2023 at 10:42 AM Troy Kisky <troykiskyboundary@gmail.com>
wrote:
> On Wed, Feb 22, 2023 at 10:18 AM Tom Rini <trini@konsulko.com> wrote:
>
>> On Tue, Feb 21, 2023 at 05:38:14PM -0800, Troy Kisky wrote:
>>
>> > When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
>> > bdf is no longer accessible. So change to preprocessor to avoid access.
>> >
>> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
>> > ---
>> >
>> > arch/x86/cpu/apollolake/uart.c | 6 +++---
>> > include/ns16550.h | 2 +-
>> > 2 files changed, 4 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/arch/x86/cpu/apollolake/uart.c
>> b/arch/x86/cpu/apollolake/uart.c
>> > index a9362436000..143217755ff 100644
>> > --- a/arch/x86/cpu/apollolake/uart.c
>> > +++ b/arch/x86/cpu/apollolake/uart.c
>> > @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>> >
>> > static int apl_ns16550_probe(struct udevice *dev)
>> > {
>> > +#if !CONFIG_IS_ENABLED(PCI)
>> > struct apl_ns16550_plat *plat = dev_get_plat(dev);
>> >
>> > - if (!CONFIG_IS_ENABLED(PCI))
>> > - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>> > -
>> > + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>> > +#endif
>> > return ns16550_serial_probe(dev);
>> > }
>> >
>> > diff --git a/include/ns16550.h b/include/ns16550.h
>> > index e7e68663d03..8d7eb7d8f9c 100644
>> > --- a/include/ns16550.h
>> > +++ b/include/ns16550.h
>> > @@ -74,7 +74,7 @@ struct ns16550_plat {
>> > int clock;
>> > u32 fcr;
>> > int flags;
>> > -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
>> > +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
>> > int bdf;
>> > #endif
>> > };
>>
>> This isn't equivalent. This means platforms such as am335x_evm which do
>> not enable PCI nor SPL_PCI now get this field and grow their rodata.
>>
>> --
>> Tom
>
>
How does this look ?
diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
index a9362436000..da184638cb9 100644
--- a/arch/x86/cpu/apollolake/uart.c
+++ b/arch/x86/cpu/apollolake/uart.c
@@ -79,10 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
static int apl_ns16550_probe(struct udevice *dev)
{
+#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
struct apl_ns16550_plat *plat = dev_get_plat(dev);
- if (!CONFIG_IS_ENABLED(PCI))
- apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
+ apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
+#endif
return ns16550_serial_probe(dev);
}
@@ -110,7 +111,9 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
ns.reg_offset = 0;
ns.clock = dtplat->clock_frequency;
ns.fcr = UART_FCR_DEFVAL;
+#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
ns.bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
+#endif
memcpy(plat, &ns, sizeof(ns));
#else
int ret;
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
index 2bc704e1104..d18c49686dd 100644
--- a/include/linux/kconfig.h
+++ b/include/linux/kconfig.h
@@ -27,6 +27,7 @@
* 0 otherwise.
*/
#define IS_ENABLED(option) config_enabled(option, 0)
+#define IS_ENABLED_NOCHECK(option) config_enabled(option, 0)
/*
* U-Boot add-on: Helper macros to reference to different macros (prefixed
by
diff --git a/include/ns16550.h b/include/ns16550.h
index e7e68663d03..f416e67e68f 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -74,7 +74,7 @@ struct ns16550_plat {
int clock;
u32 fcr;
int flags;
-#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
+#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL)
int bdf;
#endif
};
^ permalink raw reply related [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 19:39 ` Troy Kisky
@ 2023-02-22 20:41 ` Troy Kisky
2023-02-22 21:06 ` Troy Kisky
2023-02-22 20:56 ` Simon Glass
1 sibling, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 20:41 UTC (permalink / raw)
To: Tom Rini; +Cc: sjg, u-boot, gary.bisson, Andre Przywara, Bin Meng
On Wed, Feb 22, 2023 at 11:39 AM Troy Kisky <troykiskyboundary@gmail.com>
wrote:
>
> On Wed, Feb 22, 2023 at 10:42 AM Troy Kisky <troykiskyboundary@gmail.com>
> wrote:
>
>> On Wed, Feb 22, 2023 at 10:18 AM Tom Rini <trini@konsulko.com> wrote:
>>
>>> On Tue, Feb 21, 2023 at 05:38:14PM -0800, Troy Kisky wrote:
>>>
>>> > When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
>>> > bdf is no longer accessible. So change to preprocessor to avoid access.
>>> >
>>> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
>>> > ---
>>> >
>>> > arch/x86/cpu/apollolake/uart.c | 6 +++---
>>> > include/ns16550.h | 2 +-
>>> > 2 files changed, 4 insertions(+), 4 deletions(-)
>>> >
>>> > diff --git a/arch/x86/cpu/apollolake/uart.c
>>> b/arch/x86/cpu/apollolake/uart.c
>>> > index a9362436000..143217755ff 100644
>>> > --- a/arch/x86/cpu/apollolake/uart.c
>>> > +++ b/arch/x86/cpu/apollolake/uart.c
>>> > @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>>> >
>>> > static int apl_ns16550_probe(struct udevice *dev)
>>> > {
>>> > +#if !CONFIG_IS_ENABLED(PCI)
>>> > struct apl_ns16550_plat *plat = dev_get_plat(dev);
>>> >
>>> > - if (!CONFIG_IS_ENABLED(PCI))
>>> > - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>>> > -
>>> > + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>>> > +#endif
>>> > return ns16550_serial_probe(dev);
>>> > }
>>> >
>>> > diff --git a/include/ns16550.h b/include/ns16550.h
>>> > index e7e68663d03..8d7eb7d8f9c 100644
>>> > --- a/include/ns16550.h
>>> > +++ b/include/ns16550.h
>>> > @@ -74,7 +74,7 @@ struct ns16550_plat {
>>> > int clock;
>>> > u32 fcr;
>>> > int flags;
>>> > -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
>>> > +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
>>> > int bdf;
>>> > #endif
>>> > };
>>>
>>> This isn't equivalent. This means platforms such as am335x_evm which do
>>> not enable PCI nor SPL_PCI now get this field and grow their rodata.
>>>
>>> --
>>> Tom
>>
>>
> How does this look ?
>
> diff --git a/arch/x86/cpu/apollolake/uart.c
> b/arch/x86/cpu/apollolake/uart.c
> index a9362436000..da184638cb9 100644
> --- a/arch/x86/cpu/apollolake/uart.c
> +++ b/arch/x86/cpu/apollolake/uart.c
> @@ -79,10 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>
> static int apl_ns16550_probe(struct udevice *dev)
> {
> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
> struct apl_ns16550_plat *plat = dev_get_plat(dev);
>
> - if (!CONFIG_IS_ENABLED(PCI))
> - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> +#endif
>
> return ns16550_serial_probe(dev);
> }
> @@ -110,7 +111,9 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
> ns.reg_offset = 0;
> ns.clock = dtplat->clock_frequency;
> ns.fcr = UART_FCR_DEFVAL;
> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
> ns.bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
> +#endif
> memcpy(plat, &ns, sizeof(ns));
> #else
> int ret;
> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
> index 2bc704e1104..d18c49686dd 100644
> --- a/include/linux/kconfig.h
> +++ b/include/linux/kconfig.h
> @@ -27,6 +27,7 @@
> * 0 otherwise.
> */
> #define IS_ENABLED(option) config_enabled(option, 0)
> +#define IS_ENABLED_NOCHECK(option) config_enabled(option, 0)
>
> /*
> * U-Boot add-on: Helper macros to reference to different macros
> (prefixed by
> diff --git a/include/ns16550.h b/include/ns16550.h
> index e7e68663d03..f416e67e68f 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -74,7 +74,7 @@ struct ns16550_plat {
> int clock;
> u32 fcr;
> int flags;
> -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL)
> int bdf;
> #endif
> };
>
>
Or maybe I should s/CONFIG_SPL/CONFIG_SPL_BUILD/ in these places ?
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 19:39 ` Troy Kisky
2023-02-22 20:41 ` Troy Kisky
@ 2023-02-22 20:56 ` Simon Glass
[not found] ` <CAO46J5WM4yLmbYesfXFeRVYU-7TC=KOPxpBte6=rt9Uh0qF3vw@mail.gmail.com>
1 sibling, 1 reply; 64+ messages in thread
From: Simon Glass @ 2023-02-22 20:56 UTC (permalink / raw)
To: Troy Kisky; +Cc: Tom Rini, u-boot, gary.bisson, Andre Przywara, Bin Meng
Hi Troy,
On Wed, 22 Feb 2023 at 12:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
>
> On Wed, Feb 22, 2023 at 10:42 AM Troy Kisky <troykiskyboundary@gmail.com> wrote:
>>
>> On Wed, Feb 22, 2023 at 10:18 AM Tom Rini <trini@konsulko.com> wrote:
>>>
>>> On Tue, Feb 21, 2023 at 05:38:14PM -0800, Troy Kisky wrote:
>>>
>>> > When switching defined(CONFIG_PCI) to CONFIG_IS_ENABLED(PCI)
>>> > bdf is no longer accessible. So change to preprocessor to avoid access.
>>> >
>>> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
>>> > ---
>>> >
>>> > arch/x86/cpu/apollolake/uart.c | 6 +++---
>>> > include/ns16550.h | 2 +-
>>> > 2 files changed, 4 insertions(+), 4 deletions(-)
>>> >
>>> > diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
>>> > index a9362436000..143217755ff 100644
>>> > --- a/arch/x86/cpu/apollolake/uart.c
>>> > +++ b/arch/x86/cpu/apollolake/uart.c
>>> > @@ -79,11 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>>> >
>>> > static int apl_ns16550_probe(struct udevice *dev)
>>> > {
>>> > +#if !CONFIG_IS_ENABLED(PCI)
>>> > struct apl_ns16550_plat *plat = dev_get_plat(dev);
>>> >
>>> > - if (!CONFIG_IS_ENABLED(PCI))
>>> > - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>>> > -
>>> > + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>>> > +#endif
>>> > return ns16550_serial_probe(dev);
>>> > }
>>> >
>>> > diff --git a/include/ns16550.h b/include/ns16550.h
>>> > index e7e68663d03..8d7eb7d8f9c 100644
>>> > --- a/include/ns16550.h
>>> > +++ b/include/ns16550.h
>>> > @@ -74,7 +74,7 @@ struct ns16550_plat {
>>> > int clock;
>>> > u32 fcr;
>>> > int flags;
>>> > -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
>>> > +#if !CONFIG_IS_ENABLED(PCI) || CONFIG_IS_ENABLED(OF_PLATDATA)
>>> > int bdf;
>>> > #endif
>>> > };
>>>
>>> This isn't equivalent. This means platforms such as am335x_evm which do
>>> not enable PCI nor SPL_PCI now get this field and grow their rodata.
>>>
>>> --
>>> Tom
>
>
> How does this look ?
>
> diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
> index a9362436000..da184638cb9 100644
> --- a/arch/x86/cpu/apollolake/uart.c
> +++ b/arch/x86/cpu/apollolake/uart.c
> @@ -79,10 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>
> static int apl_ns16550_probe(struct udevice *dev)
> {
> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
> struct apl_ns16550_plat *plat = dev_get_plat(dev);
>
> - if (!CONFIG_IS_ENABLED(PCI))
> - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> +#endif
>
> return ns16550_serial_probe(dev);
> }
> @@ -110,7 +111,9 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
> ns.reg_offset = 0;
> ns.clock = dtplat->clock_frequency;
> ns.fcr = UART_FCR_DEFVAL;
> +#if defined(CONFIG_SPL) && (CONFIG_PCI)
> ns.bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
This should only be called when PCI is disabled in the particular SPL phase.
> +#endif
> memcpy(plat, &ns, sizeof(ns));
> #else
> int ret;
> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
> index 2bc704e1104..d18c49686dd 100644
> --- a/include/linux/kconfig.h
> +++ b/include/linux/kconfig.h
> @@ -27,6 +27,7 @@
> * 0 otherwise.
> */
> #define IS_ENABLED(option) config_enabled(option, 0)
> +#define IS_ENABLED_NOCHECK(option) config_enabled(option, 0)
What is this for? It looks the same as the one above.
>
> /*
> * U-Boot add-on: Helper macros to reference to different macros (prefixed by
> diff --git a/include/ns16550.h b/include/ns16550.h
> index e7e68663d03..f416e67e68f 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -74,7 +74,7 @@ struct ns16550_plat {
> int clock;
> u32 fcr;
> int flags;
> -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL)
> int bdf;
> #endif
> };
>
Regards,
Simon
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 20:41 ` Troy Kisky
@ 2023-02-22 21:06 ` Troy Kisky
2023-02-22 21:16 ` Simon Glass
0 siblings, 1 reply; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 21:06 UTC (permalink / raw)
To: Tom Rini; +Cc: sjg, u-boot, gary.bisson, Andre Przywara, Bin Meng
On Wed, Feb 22, 2023 at 12:41 PM Troy Kisky <troykiskyboundary@gmail.com>
wrote:
>
>
>
>> How does this look ?
>>
>> diff --git a/arch/x86/cpu/apollolake/uart.c
>> b/arch/x86/cpu/apollolake/uart.c
>> index a9362436000..da184638cb9 100644
>> --- a/arch/x86/cpu/apollolake/uart.c
>> +++ b/arch/x86/cpu/apollolake/uart.c
>> @@ -79,10 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>>
>> static int apl_ns16550_probe(struct udevice *dev)
>> {
>> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
>> struct apl_ns16550_plat *plat = dev_get_plat(dev);
>>
>> - if (!CONFIG_IS_ENABLED(PCI))
>> - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>> + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>> +#endif
>>
>> return ns16550_serial_probe(dev);
>> }
>> @@ -110,7 +111,9 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
>> ns.reg_offset = 0;
>> ns.clock = dtplat->clock_frequency;
>> ns.fcr = UART_FCR_DEFVAL;
>> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
>> ns.bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
>> +#endif
>> memcpy(plat, &ns, sizeof(ns));
>> #else
>> int ret;
>> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
>> index 2bc704e1104..d18c49686dd 100644
>> --- a/include/linux/kconfig.h
>> +++ b/include/linux/kconfig.h
>> @@ -27,6 +27,7 @@
>> * 0 otherwise.
>> */
>> #define IS_ENABLED(option) config_enabled(option, 0)
>> +#define IS_ENABLED_NOCHECK(option) config_enabled(option, 0)
>>
>> /*
>> * U-Boot add-on: Helper macros to reference to different macros
>> (prefixed by
>> diff --git a/include/ns16550.h b/include/ns16550.h
>> index e7e68663d03..f416e67e68f 100644
>> --- a/include/ns16550.h
>> +++ b/include/ns16550.h
>> @@ -74,7 +74,7 @@ struct ns16550_plat {
>> int clock;
>> u32 fcr;
>> int flags;
>> -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
>> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL)
>> int bdf;
>> #endif
>> };
>>
>>
>
> Or maybe I should s/CONFIG_SPL/CONFIG_SPL_BUILD/ in these places ?
>
Or better
defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD)
since Simon specified TPL use.
Thanks
Troy
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
2023-02-22 21:06 ` Troy Kisky
@ 2023-02-22 21:16 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:16 UTC (permalink / raw)
To: Troy Kisky; +Cc: Tom Rini, u-boot, gary.bisson, Andre Przywara, Bin Meng
Hi Troy,
On Wed, 22 Feb 2023 at 14:06, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> On Wed, Feb 22, 2023 at 12:41 PM Troy Kisky <troykiskyboundary@gmail.com> wrote:
>>
>>
>>
>>>
>>> How does this look ?
>>>
>>> diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
>>> index a9362436000..da184638cb9 100644
>>> --- a/arch/x86/cpu/apollolake/uart.c
>>> +++ b/arch/x86/cpu/apollolake/uart.c
>>> @@ -79,10 +79,11 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>>>
>>> static int apl_ns16550_probe(struct udevice *dev)
>>> {
>>> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
>>> struct apl_ns16550_plat *plat = dev_get_plat(dev);
>>>
>>> - if (!CONFIG_IS_ENABLED(PCI))
>>> - apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>>> + apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
>>> +#endif
>>>
>>> return ns16550_serial_probe(dev);
>>> }
>>> @@ -110,7 +111,9 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
>>> ns.reg_offset = 0;
>>> ns.clock = dtplat->clock_frequency;
>>> ns.fcr = UART_FCR_DEFVAL;
>>> +#if defined(CONFIG_SPL) && IS_ENABLED_NOCHECK(CONFIG_PCI)
>>> ns.bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
>>> +#endif
>>> memcpy(plat, &ns, sizeof(ns));
>>> #else
>>> int ret;
>>> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
>>> index 2bc704e1104..d18c49686dd 100644
>>> --- a/include/linux/kconfig.h
>>> +++ b/include/linux/kconfig.h
>>> @@ -27,6 +27,7 @@
>>> * 0 otherwise.
>>> */
>>> #define IS_ENABLED(option) config_enabled(option, 0)
>>> +#define IS_ENABLED_NOCHECK(option) config_enabled(option, 0)
>>>
>>> /*
>>> * U-Boot add-on: Helper macros to reference to different macros (prefixed by
>>> diff --git a/include/ns16550.h b/include/ns16550.h
>>> index e7e68663d03..f416e67e68f 100644
>>> --- a/include/ns16550.h
>>> +++ b/include/ns16550.h
>>> @@ -74,7 +74,7 @@ struct ns16550_plat {
>>> int clock;
>>> u32 fcr;
>>> int flags;
>>> -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
>>> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL)
>>> int bdf;
>>> #endif
>>> };
>>>
>>
>>
>> Or maybe I should s/CONFIG_SPL/CONFIG_SPL_BUILD/ in these places ?
>
>
> Or better
> defined(CONFIG_SPL_BUILD) || defined(CONFIG_TPL_BUILD)
>
> since Simon specified TPL use.
Strangely, TPL_BUILD is a subset of SPL_BUILD. SPL_BUILD means that it
is not U-Boot proper, so could be SPL, TPL or VPL. We should probably
rename that meaning of SPL_BUILD to XPL_BUILD one day, so that
SPL_BUILD really just means SPL.
So no need for the || defined(CONFIG_TPL_BUILD)
Regards,
Simon
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT
2023-02-22 1:37 ` [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Marek Behún, Samuel Dionne-Riel
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> Avoid error messages when SPL,TPL,VPL build don't
> have the environment options of the main build.
> This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
> to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> cmd/nvedit.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 03/24] lib: md5: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:38 ` [PATCH v1 03/24] lib: md5: " Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Marek Vasut, Stefan Roese
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> We need to include <linux/kconfig.h> in order to include
> files that use CONFIG_IS_ENABLED. TO prepare for that
> don't pet the watchdog when USE_HOSTCC is defined.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> lib/md5.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:37 ` [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Marek Vasut, Stefan Roese
Hi Troy,
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> We need to include <linux/kconfig.h> in order to include
> files that use CONFIG_IS_ENABLED. TO prepare for that
> be more direct with using defined(USE_HOSTCC).
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> lib/crc32.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 04/24] lib: sha1: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:38 ` [PATCH v1 04/24] lib: sha1: " Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Loic Poulain, Marek Vasut,
Stefan Roese
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> We need to include <linux/kconfig.h> in order to include
> files that use CONFIG_IS_ENABLED. TO prepare for that
> don't pet the watchdog when USE_HOSTCC is defined.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> lib/sha1.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 05/24] lib: sha256: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:38 ` [PATCH v1 05/24] lib: sha256: " Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
2023-02-22 22:42 ` Troy Kisky
0 siblings, 1 reply; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Loic Poulain, Marek Vasut,
Stefan Roese
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> We need to include <linux/kconfig.h> in order to include
> files that use CONFIG_IS_ENABLED. TO prepare for that
> don't pet the watchdog when USE_HOSTCC is defined.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> lib/sha256.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
BTW it might be possible to use '-include linux/kconfig.h' in
tools/Makefile like we do in Makefile
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 06/24] lib: sha512: prepare for CONFIG_IS_ENABLED changes
2023-02-22 1:38 ` [PATCH v1 06/24] lib: sha512: " Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Marek Vasut, Stefan Roese
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> We need to include <linux/kconfig.h> in order to include
> files that use CONFIG_IS_ENABLED. TO prepare for that
> don't pet the watchdog when USE_HOSTCC is defined.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> lib/sha512.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 07/24] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h
2023-02-22 1:38 ` [PATCH v1 07/24] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Jaehoon Chung, Joel Stanley,
Marek Vasut, Miaoqian Lin, Rafał Miłecki, Sean Anderson
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> We need to include <linux/kconfig.h> in order to include
> files that use CONFIG_IS_ENABLED.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> boot/fdt_region.c | 1 +
> lib/fdtdec_common.c | 1 +
> lib/hash-checksum.c | 1 +
> tools/env/fw_env.c | 1 +
> tools/fdt_host.h | 1 +
> tools/mkimage.h | 1 +
> 6 files changed, 6 insertions(+)
Reviewed-by: Simon Glass <sjg@chromium.org>
But see previous comment on using -include
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 09/24] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED
2023-02-22 1:38 ` [PATCH v1 09/24] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Bin Meng
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT)
> would check for CONFIG_SPL_SPL_X86_32BIT_INIT for SPL builds
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> arch/x86/cpu/qemu/qemu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
(I have the same patch but it will be dropped once this is applied)
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 11/24] ofnode: fdt_support definitions needed if OF_CONTROL is enabled
2023-02-22 1:38 ` [PATCH v1 11/24] ofnode: fdt_support definitions needed if OF_CONTROL is enabled Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Marek Behún
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> With the use of CONFIG_IS_ENABLED in code, instead of at the preprocessor
> level, these defines are still needed if OF_CONTROL is enabled.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> include/fdt_support.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 10/24] config_distro_bootcmd: remove booting environment variables from SPL environment
2023-02-22 1:38 ` [PATCH v1 10/24] config_distro_bootcmd: remove booting environment variables from SPL environment Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Marek Vasut, Matwey V. Kornilov,
Pali Rohár, Peter Hoyes
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> SPL environments don't need command that they can never use.
> Avoid errors with CONFIG_IS_ENABLED conversions by skipping them now.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> include/config_distro_bootcmd.h | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 13/24] puma-rk3399: remove check for ENV_IS_NOWHERE, it is an SPL config
2023-02-22 1:38 ` [PATCH v1 13/24] puma-rk3399: " Troy Kisky
@ 2023-02-22 21:19 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:19 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Klaus Goger, Quentin Schulz
Hi Troy,
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> When IS_ENABLED(CONFIG_ENV_IS_NOWHERE) is converted to
> CONFIG_IS_ENABLED(ENV_IS_NOWHERE) this will give unwanted errors
> on spl builds.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> board/theobroma-systems/puma_rk3399/puma-rk3399.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> index 97f398bd754..614a60ee8f9 100644
> --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c
> @@ -136,10 +136,6 @@ int mmc_get_env_dev(void)
> return CONFIG_SYS_MMC_ENV_DEV;
> }
>
> -#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
> -#error Please enable CONFIG_ENV_IS_NOWHERE
> -#endif
> -
> enum env_location arch_env_get_location(enum env_operation op, int prio)
> {
> const char *boot_device =
> --
> 2.34.1
>
For this and the previous patch, I wonder whether something like this
might be safer:
#if CONFIG_IS_ENABLED(ENV_SUPPORT)
#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
#error Please enable CONFIG_ENV_IS_NOWHERE
#endif
#endif
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts
2023-02-22 1:38 ` [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Marek Behún
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> SPL code wants fdt_fixup_mtdparts defined as a NOP
> when the function isn't linked in.
>
> Prepare for ifdef CONFIG_OF_LIBFDT being converted to
> if CONFIG_IS_ENABLED(OF_LIBFDT)
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> include/fdt_support.h | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
Reviewed-by: Simon Glass <sjg@chromium.org>
But is it possible to avoid moving this in the file?
> diff --git a/include/fdt_support.h b/include/fdt_support.h
> index eeb83e6251d..94497d755a3 100644
> --- a/include/fdt_support.h
> +++ b/include/fdt_support.h
> @@ -245,16 +245,6 @@ int fdt_increase_size(void *fdt, int add_len);
> int fdt_delete_disabled_nodes(void *blob);
>
> struct node_info;
> -#if defined(CONFIG_FDT_FIXUP_PARTITIONS)
> -void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
> - int node_info_size);
> -#else
> -static inline void fdt_fixup_mtdparts(void *fdt,
> - const struct node_info *node_info,
> - int node_info_size)
> -{
> -}
> -#endif
>
> void fdt_del_node_and_alias(void *blob, const char *alias);
>
> @@ -412,6 +402,19 @@ int fdt_get_cells_len(const void *blob, char *nr_cells_name);
>
> #endif /* ifdef CONFIG_OF_LIBFDT */
>
> +#if CONFIG_IS_ENABLED(OF_LIBFDT) && defined(CONFIG_FDT_FIXUP_PARTITIONS)
> +struct node_info;
> +void fdt_fixup_mtdparts(void *fdt, const struct node_info *node_info,
> + int node_info_size);
> +#else
> +struct node_info;
> +static inline void fdt_fixup_mtdparts(void *fdt,
> + const struct node_info *node_info,
> + int node_info_size)
> +{
> +}
> +#endif
> +
> #ifdef USE_HOSTCC
> int fdtdec_get_int(const void *blob, int node, const char *prop_name,
> int default_val);
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 15/24] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT)
2023-02-22 1:38 ` [PATCH v1 15/24] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT) Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Marek Vasut, Olaf Mandel
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> The function ft_board_setup calls do_fixup_by_path_string
> which is only available on CONFIG_IS_ENABLED(OF_LIBFDT).
> This prepares for the conversion.
>
> ft_board_setup is only called from image-fdt which is linked by
> obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> board/menlo/m53menlo/m53menlo.c | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass <sjg@chromium.org>\
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 16/24] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC)
2023-02-22 1:38 ` [PATCH v1 16/24] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC) Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Fabio Estevam
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> pfuze_mode_init calls pmic_reg_read which is only available from
>
> obj-$(CONFIG_$(SPL_TPL_)DM_PMIC) += pmic-uclass.o
>
> Prepare for conversion of defined(CONFIG_DM_PMIC) to
> CONFIG_IS_ENABLED(DM_PMIC).
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> board/freescale/common/pfuze.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 08/24] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx
2023-02-22 1:38 ` [PATCH v1 08/24] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Heiko Thiery, Heinrich Schuchardt,
Max Krummenacher, Pali Rohár, Samuel Holland, Stefan Roese
Hi Troy,
On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> CONFIG_IS_ENABLED(FIT_SIGNATURE) will check for
> CONFIG_TOOLS_FIT_SIGNATURE. So define it now in preparation.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> tools/Makefile | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Simon Glass <sjg@chromium.org>
>
> diff --git a/tools/Makefile b/tools/Makefile
> index e13effbb66a..2670c77b2cb 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -162,8 +162,10 @@ ifdef CONFIG_TOOLS_LIBCRYPTO
> # This affects include/image.h, but including the board config file
> # is tricky, so manually define this options here.
> HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE
> +HOST_EXTRACFLAGS += -DCONFIG_TOOLS_FIT_SIGNATURE=1
> HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=0xffffffff
> HOST_EXTRACFLAGS += -DCONFIG_FIT_CIPHER
> +HOST_EXTRACFLAGS += -DCONFIG_TOOLS_FIT_CIPHER=1
This makes me wonder whether we should avoid using linux/kconfig.h in
the tools builds? We normally want everything enabled in tools, except
when the host is missing a library iwc we want to avoid a build error.
> endif
>
> # MXSImage needs LibSSL
> --
> 2.34.1
>
Regards,
Simon
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 20/24] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI)
2023-02-22 1:38 ` [PATCH v1 20/24] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI) Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Bin Meng
Hi Troy,
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> This avoids an error when ifdef CONFIG_PCI is changed to
> if CONFIG_IS_ENABLED(PCI)
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> arch/x86/cpu/i386/cpu.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c
> index c7f6c5a013e..07a73f79768 100644
> --- a/arch/x86/cpu/i386/cpu.c
> +++ b/arch/x86/cpu/i386/cpu.c
> @@ -415,7 +415,9 @@ int cpu_phys_address_size(void)
> /* Don't allow PCI region 3 to use memory in the 2-4GB memory hole */
> static void setup_pci_ram_top(void)
> {
> +#if CONFIG_IS_ENABLED(PCI)
> gd->pci_ram_top = 0x80000000U;
> +#endif
Can you add an accessor in the header file, so this can be:
if (CONFIG_IS_ENABLED(PCI))
gd_set_pci_ram_top(0x80000000U);
> }
>
> static void setup_mtrr(void)
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 22/24] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY)
2023-02-22 1:38 ` [PATCH v1 22/24] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY) Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Jaehoon Chung, Lukasz Majewski
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> This avoids an error in converting to CONFIG_IS_ENABLED(DM_PMIC).
> Many boards SPL code needs these definitions to compile, even if
> the functions are not linked.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> include/power/pmic.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
How about adding a migration deadline for non-DM PMIC?
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 23/24] arm: cpu: armv7: ls102xa: fdt: remove eth_device support
2023-02-22 1:38 ` [PATCH v1 23/24] arm: cpu: armv7: ls102xa: fdt: remove eth_device support Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky; +Cc: trini, u-boot, gary.bisson, Alison Wang
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> commit e524f3a449f5 ("net: Remove eth_legacy.c")
>
> removed struct eth_device
> This prevents errors in the conversion to CONFIG_IS_ENABLED(DM_ETH).
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> arch/arm/cpu/armv7/ls102xa/fdt.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
Again, I have the same patch, but it will be dropped once this is applied.
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 24/24] CI: add test/usage_of_is_enabled_check.sh
2023-02-22 1:38 ` [PATCH v1 24/24] CI: add test/usage_of_is_enabled_check.sh Troy Kisky
@ 2023-02-22 21:20 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-22 21:20 UTC (permalink / raw)
To: Troy Kisky
Cc: trini, u-boot, gary.bisson, Heinrich Schuchardt, Joel Stanley,
Rick Chen
On Tue, 21 Feb 2023 at 18:39, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> Add script usage_of_is_enabled_check to print any configs that
> use CONFIG_IS_ENABLED instead of IS_ENABLED and vice versa.
>
> Add usage_of_is_enabled_commit.sh to generate commits to fix the above
> issues.
>
> You can remove entries from test/usage_of_is_enabled_todo.txt
> or the entire file and then run
> test/usage_of_is_enabled_commit.sh
> to convert to suggested usage of CONFIG_IS_ENABLED/IS_ENABLED
>
> or run test/usage_of_is_enabled_check.sh to
> see which configs are still todo.
>
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> ---
>
> .azure-pipelines.yml | 11 ++
> .gitlab-ci.yml | 5 +
> test/usage_of_is_enabled_check.sh | 19 +++
> test/usage_of_is_enabled_commit.sh | 12 ++
> test/usage_of_is_enabled_correct.sh | 50 +++++++
> test/usage_of_is_enabled_exempt.txt | 9 ++
> test/usage_of_is_enabled_list.sh | 86 ++++++++++++
> test/usage_of_is_enabled_splcfg.txt | 21 +++
> test/usage_of_is_enabled_todo.txt | 210 ++++++++++++++++++++++++++++
> 9 files changed, 423 insertions(+)
> create mode 100755 test/usage_of_is_enabled_check.sh
> create mode 100755 test/usage_of_is_enabled_commit.sh
> create mode 100755 test/usage_of_is_enabled_correct.sh
> create mode 100644 test/usage_of_is_enabled_exempt.txt
> create mode 100755 test/usage_of_is_enabled_list.sh
> create mode 100644 test/usage_of_is_enabled_splcfg.txt
> create mode 100644 test/usage_of_is_enabled_todo.txt
>
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 05/24] lib: sha256: prepare for CONFIG_IS_ENABLED changes
2023-02-22 21:19 ` Simon Glass
@ 2023-02-22 22:42 ` Troy Kisky
0 siblings, 0 replies; 64+ messages in thread
From: Troy Kisky @ 2023-02-22 22:42 UTC (permalink / raw)
To: Simon Glass
Cc: trini, u-boot, gary.bisson, Loic Poulain, Marek Vasut,
Stefan Roese
OK, I'll try that.
BR
Troy
On Wed, Feb 22, 2023 at 1:20 PM Simon Glass <sjg@chromium.org> wrote:
> On Tue, 21 Feb 2023 at 18:38, Troy Kisky <troykiskyboundary@gmail.com>
> wrote:
> >
> > We need to include <linux/kconfig.h> in order to include
> > files that use CONFIG_IS_ENABLED. TO prepare for that
> > don't pet the watchdog when USE_HOSTCC is defined.
> >
> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > ---
> >
> > lib/sha256.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
> BTW it might be possible to use '-include linux/kconfig.h' in
> tools/Makefile like we do in Makefile
>
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 17/24] ns16550: match when to define bdf with uart code
[not found] ` <CAO46J5XsyQpR57-WA6Q==9wkQLsgwJ+qpsJQxnVt4=GZJ+Ysyg@mail.gmail.com>
@ 2023-02-23 2:48 ` Simon Glass
0 siblings, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-23 2:48 UTC (permalink / raw)
To: Troy Kisky; +Cc: U-Boot Mailing List
Hi Troy,
On Wed, 22 Feb 2023 at 14:33, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> Hi Simon
>
> So how is this ?
> diff --git a/arch/x86/cpu/apollolake/uart.c b/arch/x86/cpu/apollolake/uart.c
> index a9362436000..878aa48ed76 100644
> --- a/arch/x86/cpu/apollolake/uart.c
> +++ b/arch/x86/cpu/apollolake/uart.c
> @@ -79,10 +79,12 @@ void apl_uart_init(pci_dev_t bdf, ulong base)
>
> static int apl_ns16550_probe(struct udevice *dev)
> {
> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL_BUILD)
> struct apl_ns16550_plat *plat = dev_get_plat(dev);
>
> if (!CONFIG_IS_ENABLED(PCI))
> apl_uart_init(plat->ns16550.bdf, plat->ns16550.base);
> +#endif
>
> return ns16550_serial_probe(dev);
> }
> @@ -110,7 +112,9 @@ static int apl_ns16550_of_to_plat(struct udevice *dev)
> ns.reg_offset = 0;
> ns.clock = dtplat->clock_frequency;
> ns.fcr = UART_FCR_DEFVAL;
> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL_BUILD)
> ns.bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
> +#endif
> memcpy(plat, &ns, sizeof(ns));
> #else
> int ret;
> diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
> index 2bc704e1104..cbf9c4e6a65 100644
> --- a/include/linux/kconfig.h
> +++ b/include/linux/kconfig.h
> @@ -27,6 +27,11 @@
> * 0 otherwise.
> */
> #define IS_ENABLED(option) config_enabled(option, 0)
> +/*
> + * Using IS_ENABLED_NOCHECK stead of IS_ENABLED prevents
> + * test/usage_of_is_enabled_check.sh from complaining
> + */
> +#define IS_ENABLED_NOCHECK(option) config_enabled(option, 0)
>
> /*
> * U-Boot add-on: Helper macros to reference to different macros (prefixed by
> diff --git a/include/ns16550.h b/include/ns16550.h
> index e7e68663d03..41b977b5b26 100644
> --- a/include/ns16550.h
> +++ b/include/ns16550.h
> @@ -74,7 +74,7 @@ struct ns16550_plat {
> int clock;
> u32 fcr;
> int flags;
> -#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
> +#if IS_ENABLED_NOCHECK(CONFIG_PCI) && defined(CONFIG_SPL_BUILD)
> int bdf;
> #endif
> };
>
> BR
> Troy
>
That looks OK to me.
Regards,
Simon
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA
2023-02-22 15:05 ` Tom Rini
@ 2023-02-23 19:23 ` Troy Kisky
2023-02-23 22:20 ` Tom Rini
2023-02-23 23:07 ` Simon Glass
0 siblings, 2 replies; 64+ messages in thread
From: Troy Kisky @ 2023-02-23 19:23 UTC (permalink / raw)
To: Tom Rini
Cc: sjg, u-boot, gary.bisson, Fabio Estevam, NXP i.MX U-Boot Team,
Stefano Babic
On Wed, Feb 22, 2023 at 7:05 AM Tom Rini <trini@konsulko.com> wrote:
> On Tue, Feb 21, 2023 at 05:38:16PM -0800, Troy Kisky wrote:
>
> > This avoid an error with enable_sata_clock when
> > defined(CONFIG_SATA) is changed to CONFIG_IS_ENABLED(SATA).
> >
> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > ---
> >
> > arch/arm/mach-imx/Makefile | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> > index 4dfc60eedc4..50f26975eac 100644
> > --- a/arch/arm/mach-imx/Makefile
> > +++ b/arch/arm/mach-imx/Makefile
> > @@ -54,7 +54,7 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
> > ifneq ($(CONFIG_SPL_BUILD),y)
> > obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
> > endif
> > -obj-$(CONFIG_SATA) += sata.o
> > +obj-$(CONFIG_$(SPL_)SATA) += sata.o
> > obj-$(CONFIG_IMX_HAB) += hab.o
> > obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
> > endif
>
> In that Simon thinks the $(SPL_) syntax here is ugly, lets just move
> this line in to the existing guard for non-SPL builds, with
> imx_bootaux.o.
>
> --
> Tom
>
Hi Tom
I don't think that does the same thing for mach-mvebu.
arch/arm/mach-mvebu/Kconfig-config MVEBU_SPL_BOOT_DEVICE_SATA
arch/arm/mach-mvebu/Kconfig- bool "SATA"
arch/arm/mach-mvebu/Kconfig: imply SPL_SATA
Shouldn't it be linked in SPL builds as well for that one?
BR
Troy
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA
2023-02-23 19:23 ` Troy Kisky
@ 2023-02-23 22:20 ` Tom Rini
2023-02-23 23:07 ` Simon Glass
1 sibling, 0 replies; 64+ messages in thread
From: Tom Rini @ 2023-02-23 22:20 UTC (permalink / raw)
To: Troy Kisky
Cc: sjg, u-boot, gary.bisson, Fabio Estevam, NXP i.MX U-Boot Team,
Stefano Babic
[-- Attachment #1: Type: text/plain, Size: 1761 bytes --]
On Thu, Feb 23, 2023 at 11:23:47AM -0800, Troy Kisky wrote:
> On Wed, Feb 22, 2023 at 7:05 AM Tom Rini <trini@konsulko.com> wrote:
>
> > On Tue, Feb 21, 2023 at 05:38:16PM -0800, Troy Kisky wrote:
> >
> > > This avoid an error with enable_sata_clock when
> > > defined(CONFIG_SATA) is changed to CONFIG_IS_ENABLED(SATA).
> > >
> > > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > > ---
> > >
> > > arch/arm/mach-imx/Makefile | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> > > index 4dfc60eedc4..50f26975eac 100644
> > > --- a/arch/arm/mach-imx/Makefile
> > > +++ b/arch/arm/mach-imx/Makefile
> > > @@ -54,7 +54,7 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
> > > ifneq ($(CONFIG_SPL_BUILD),y)
> > > obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
> > > endif
> > > -obj-$(CONFIG_SATA) += sata.o
> > > +obj-$(CONFIG_$(SPL_)SATA) += sata.o
> > > obj-$(CONFIG_IMX_HAB) += hab.o
> > > obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
> > > endif
> >
> > In that Simon thinks the $(SPL_) syntax here is ugly, lets just move
> > this line in to the existing guard for non-SPL builds, with
> > imx_bootaux.o.
> >
> > --
> > Tom
> >
>
> Hi Tom
>
> I don't think that does the same thing for mach-mvebu.
>
> arch/arm/mach-mvebu/Kconfig-config MVEBU_SPL_BOOT_DEVICE_SATA
> arch/arm/mach-mvebu/Kconfig- bool "SATA"
> arch/arm/mach-mvebu/Kconfig: imply SPL_SATA
>
> Shouldn't it be linked in SPL builds as well for that one?
Well, OK. I see there's not yet SPL_SATA functional on imx, but, when
the time comes, that file is likely to be used, so this change make
sense, thanks for explaining.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA
2023-02-23 19:23 ` Troy Kisky
2023-02-23 22:20 ` Tom Rini
@ 2023-02-23 23:07 ` Simon Glass
1 sibling, 0 replies; 64+ messages in thread
From: Simon Glass @ 2023-02-23 23:07 UTC (permalink / raw)
To: Troy Kisky
Cc: Tom Rini, u-boot, gary.bisson, Fabio Estevam,
NXP i.MX U-Boot Team, Stefano Babic
Hi Troy,
On Thu, 23 Feb 2023 at 12:24, Troy Kisky <troykiskyboundary@gmail.com> wrote:
>
> On Wed, Feb 22, 2023 at 7:05 AM Tom Rini <trini@konsulko.com> wrote:
>>
>> On Tue, Feb 21, 2023 at 05:38:16PM -0800, Troy Kisky wrote:
>>
>> > This avoid an error with enable_sata_clock when
>> > defined(CONFIG_SATA) is changed to CONFIG_IS_ENABLED(SATA).
>> >
>> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
>> > ---
>> >
>> > arch/arm/mach-imx/Makefile | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
>> > index 4dfc60eedc4..50f26975eac 100644
>> > --- a/arch/arm/mach-imx/Makefile
>> > +++ b/arch/arm/mach-imx/Makefile
>> > @@ -54,7 +54,7 @@ obj-$(CONFIG_IMX_RDC) += rdc-sema.o
>> > ifneq ($(CONFIG_SPL_BUILD),y)
>> > obj-$(CONFIG_IMX_BOOTAUX) += imx_bootaux.o
>> > endif
>> > -obj-$(CONFIG_SATA) += sata.o
>> > +obj-$(CONFIG_$(SPL_)SATA) += sata.o
>> > obj-$(CONFIG_IMX_HAB) += hab.o
>> > obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
>> > endif
>>
>> In that Simon thinks the $(SPL_) syntax here is ugly, lets just move
>> this line in to the existing guard for non-SPL builds, with
>> imx_bootaux.o.
>>
>> --
>> Tom
>
>
> Hi Tom
>
> I don't think that does the same thing for mach-mvebu.
>
> arch/arm/mach-mvebu/Kconfig-config MVEBU_SPL_BOOT_DEVICE_SATA
> arch/arm/mach-mvebu/Kconfig- bool "SATA"
> arch/arm/mach-mvebu/Kconfig: imply SPL_SATA
>
> Shouldn't it be linked in SPL builds as well for that one?
Yes I think $(SPL_) is ugly but it's fine to add one...if we move to
split config it will just be another to remove.
Regards,
Simon
^ permalink raw reply [flat|nested] 64+ messages in thread
* Re: [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA
2023-02-22 18:13 ` Troy Kisky
@ 2023-02-24 1:19 ` Troy Kisky
0 siblings, 0 replies; 64+ messages in thread
From: Troy Kisky @ 2023-02-24 1:19 UTC (permalink / raw)
To: Tom Rini; +Cc: sjg, u-boot, gary.bisson, Baruch Siach, Fabio Estevam
On Wed, Feb 22, 2023 at 10:13 AM Troy Kisky <troykiskyboundary@gmail.com>
wrote:
> On Wed, Feb 22, 2023 at 8:59 AM Tom Rini <trini@konsulko.com> wrote:
>
>> On Tue, Feb 21, 2023 at 05:38:15PM -0800, Troy Kisky wrote:
>>
>> > setup_sata is linked with
>> > obj-$(CONFIG_SATA) += sata.o
>> >
>> > So use SATA instead of CMD_SATA.
>> >
>> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
>> > ---
>> >
>> > board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c
>> b/board/solidrun/mx6cuboxi/mx6cuboxi.c
>> > index 7c44379ec4a..e31a7e9552f 100644
>> > --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
>> > +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
>> > @@ -275,7 +275,7 @@ int board_early_init_f(void)
>> > {
>> > setup_iomux_uart();
>> >
>> > -#ifdef CONFIG_CMD_SATA
>> > +#if CONFIG_IS_ENABLED(SATA)
>> > setup_sata();
>> > #endif
>> > setup_fec();
>>
>> Note that wandboard needs a similar fix.
>>
>> --
>> Tom
>>
>
> Hi Tom
>
> The commit script will change
> #ifdef CONFIG_SATA
>
> to
> #if CONFIG_IS_ENABLED(SATA)
>
> This series only changes things that the commit script won't.
>
> BR
> Troy
>
You are right Tom, wandboard is needed too as it uses SPL.
I don't know how it passed CI last time. But it didn't this time.
BR
Troy
^ permalink raw reply [flat|nested] 64+ messages in thread
end of thread, other threads:[~2023-02-24 1:24 UTC | newest]
Thread overview: 64+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-22 1:37 [PATCH v1 00/24] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
2023-02-22 1:37 ` [PATCH v1 01/24] cmd: nvedit: check for ENV_SUPPORT Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:37 ` [PATCH v1 02/24] lib: crc32: prepare for CONFIG_IS_ENABLED changes Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 03/24] lib: md5: " Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 04/24] lib: sha1: " Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 05/24] lib: sha256: " Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 22:42 ` Troy Kisky
2023-02-22 1:38 ` [PATCH v1 06/24] lib: sha512: " Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 07/24] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 08/24] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 09/24] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 10/24] config_distro_bootcmd: remove booting environment variables from SPL environment Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 11/24] ofnode: fdt_support definitions needed if OF_CONTROL is enabled Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 12/24] ringneck-px30: remove check for ENV_IS_NOWHERE, it is an SPL config Troy Kisky
2023-02-22 14:45 ` Quentin Schulz
2023-02-22 15:03 ` Tom Rini
2023-02-22 1:38 ` [PATCH v1 13/24] puma-rk3399: " Troy Kisky
2023-02-22 21:19 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 14/24] fdt_support: always define fdt_fixup_mtdparts Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 15/24] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT) Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 16/24] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC) Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 17/24] ns16550: match when to define bdf with uart code Troy Kisky
2023-02-22 18:18 ` Tom Rini
2023-02-22 18:42 ` Troy Kisky
2023-02-22 19:16 ` Simon Glass
2023-02-22 19:39 ` Troy Kisky
2023-02-22 20:41 ` Troy Kisky
2023-02-22 21:06 ` Troy Kisky
2023-02-22 21:16 ` Simon Glass
2023-02-22 20:56 ` Simon Glass
[not found] ` <CAO46J5WM4yLmbYesfXFeRVYU-7TC=KOPxpBte6=rt9Uh0qF3vw@mail.gmail.com>
[not found] ` <CAPnjgZ1jJuwwZ4FAspkhsxwK5RAQiDxtHDkygvwOOtHVFGFiJQ@mail.gmail.com>
[not found] ` <CAO46J5XsyQpR57-WA6Q==9wkQLsgwJ+qpsJQxnVt4=GZJ+Ysyg@mail.gmail.com>
2023-02-23 2:48 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 18/24] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA Troy Kisky
2023-02-22 16:59 ` Tom Rini
2023-02-22 18:13 ` Troy Kisky
2023-02-24 1:19 ` Troy Kisky
2023-02-22 1:38 ` [PATCH v1 19/24] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA Troy Kisky
2023-02-22 15:05 ` Tom Rini
2023-02-23 19:23 ` Troy Kisky
2023-02-23 22:20 ` Tom Rini
2023-02-23 23:07 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 20/24] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI) Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 21/24] gateworks: venice: surround call of setup_fec with if IS_ENABLED(CONFIG_NET) Troy Kisky
2023-02-22 15:07 ` Tom Rini
2023-02-22 1:38 ` [PATCH v1 22/24] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY) Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 23/24] arm: cpu: armv7: ls102xa: fdt: remove eth_device support Troy Kisky
2023-02-22 21:20 ` Simon Glass
2023-02-22 1:38 ` [PATCH v1 24/24] CI: add test/usage_of_is_enabled_check.sh Troy Kisky
2023-02-22 21:20 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox