[PATCH 37/38] post: Migrate to Kconfig

Tom Rini
2022-11-19T23:53:07Z

We move the existing CONFIG_POST_* functionality over to CFG_POST and
then introduce CONFIG_POST to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
arch/powerpc/cpu/mpc85xx/cpu.c | 2 +-
configs/P2041RDB_NAND_defconfig | 1 +
configs/P2041RDB_SDCARD_defconfig | 1 +
configs/P2041RDB_SPIFLASH_defconfig | 1 +
configs/P2041RDB_defconfig | 1 +
configs/kmcent2_defconfig | 1 +
configs/kmcoge5ne_defconfig | 1 +
configs/pg_wcom_expu1_defconfig | 1 +
configs/pg_wcom_expu1_update_defconfig | 1 +
configs/pg_wcom_seli8_defconfig | 1 +
configs/pg_wcom_seli8_update_defconfig | 1 +
doc/README.POST | 6 +-
doc/README.fsl-ddr | 2 +-
drivers/serial/serial-uclass.c | 2 +-
drivers/serial/serial.c | 2 +-
include/configs/P2041RDB.h | 2 +-
include/configs/km/pg-wcom-ls102xa.h | 4 +-
include/configs/kmcent2.h | 2 +-
include/configs/kmcoge5ne.h | 4 +-
include/post.h | 4 +-
include/serial.h | 4 +-
post/cpu/mpc83xx/ecc.c | 2 +-
post/drivers/flash.c | 2 +-
post/drivers/i2c.c | 4 +-
post/drivers/memory.c | 4 +-
post/drivers/rtc.c | 4 +-
post/lib_powerpc/andi.c | 2 +-
post/lib_powerpc/asm.S | 2 +-
post/lib_powerpc/b.c | 2 +-
post/lib_powerpc/cmp.c | 2 +-
post/lib_powerpc/cmpi.c | 2 +-
post/lib_powerpc/complex.c | 2 +-
post/lib_powerpc/cpu.c | 4 +-
post/lib_powerpc/cr.c | 2 +-
post/lib_powerpc/fpu/20001122-1.c | 4 +-
post/lib_powerpc/fpu/20010114-2.c | 4 +-
post/lib_powerpc/fpu/20010226-1.c | 4 +-
post/lib_powerpc/fpu/980619-1.c | 4 +-
post/lib_powerpc/fpu/acc1.c | 4 +-
post/lib_powerpc/fpu/compare-fp-1.c | 4 +-
post/lib_powerpc/fpu/fpu.c | 4 +-
post/lib_powerpc/fpu/mul-subnormal-single-1.c | 4 +-
post/lib_powerpc/load.c | 2 +-
post/lib_powerpc/multi.c | 2 +-
post/lib_powerpc/rlwimi.c | 2 +-
post/lib_powerpc/rlwinm.c | 2 +-
post/lib_powerpc/rlwnm.c | 2 +-
post/lib_powerpc/srawi.c | 2 +-
post/lib_powerpc/store.c | 2 +-
post/lib_powerpc/string.c | 2 +-
post/lib_powerpc/three.c | 2 +-
post/lib_powerpc/threei.c | 2 +-
post/lib_powerpc/threex.c | 2 +-
post/lib_powerpc/two.c | 2 +-
post/lib_powerpc/twox.c | 2 +-
post/post.c | 4 +-
post/tests.c | 68 +++++++++----------
test/Kconfig | 5 ++
58 files changed, 114 insertions(+), 99 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 74ad7483dc10..be85c54e4801 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -486,7 +486,7 @@ int dram_init(void)
#endif /* CONFIG_SYS_RAMBOOT */
#endif

-#if CONFIG_POST & CFG_SYS_POST_MEMORY
+#if CFG_POST & CFG_SYS_POST_MEMORY

/* Board-specific functions defined in each board's ddr.c */
void fsl_ddr_get_spd(generic_spd_eeprom_t *ctrl_dimms_spd,
diff --git a/configs/P2041RDB_NAND_defconfig b/configs/P2041RDB_NAND_defconfig
index aa80f79fd7f7..38ab9af13b34 100644
--- a/configs/P2041RDB_NAND_defconfig
+++ b/configs/P2041RDB_NAND_defconfig
@@ -112,3 +112,4 @@ CONFIG_USB_MAX_CONTROLLER_COUNT=2
CONFIG_USB_STORAGE=y
CONFIG_ADDR_MAP=y
CONFIG_SYS_NUM_ADDR_MAP=64
+CONFIG_POST=y
diff --git a/configs/P2041RDB_SDCARD_defconfig b/configs/P2041RDB_SDCARD_defconfig
index bd223c18988d..39f5f8ce6910 100644
--- a/configs/P2041RDB_SDCARD_defconfig
+++ b/configs/P2041RDB_SDCARD_defconfig
@@ -107,3 +107,4 @@ CONFIG_USB_MAX_CONTROLLER_COUNT=2
CONFIG_USB_STORAGE=y
CONFIG_ADDR_MAP=y
CONFIG_SYS_NUM_ADDR_MAP=64
+CONFIG_POST=y
diff --git a/configs/P2041RDB_SPIFLASH_defconfig b/configs/P2041RDB_SPIFLASH_defconfig
index dbd5845789cc..b06e6142c4ee 100644
--- a/configs/P2041RDB_SPIFLASH_defconfig
+++ b/configs/P2041RDB_SPIFLASH_defconfig
@@ -109,3 +109,4 @@ CONFIG_USB_MAX_CONTROLLER_COUNT=2
CONFIG_USB_STORAGE=y
CONFIG_ADDR_MAP=y
CONFIG_SYS_NUM_ADDR_MAP=64
+CONFIG_POST=y
diff --git a/configs/P2041RDB_defconfig b/configs/P2041RDB_defconfig
index c17318c7cc15..0eb837321aeb 100644
--- a/configs/P2041RDB_defconfig
+++ b/configs/P2041RDB_defconfig
@@ -104,3 +104,4 @@ CONFIG_USB_MAX_CONTROLLER_COUNT=2
CONFIG_USB_STORAGE=y
CONFIG_ADDR_MAP=y
CONFIG_SYS_NUM_ADDR_MAP=64
+CONFIG_POST=y
diff --git a/configs/kmcent2_defconfig b/configs/kmcent2_defconfig
index 48ac85b699be..41b26287d567 100644
--- a/configs/kmcent2_defconfig
+++ b/configs/kmcent2_defconfig
@@ -110,3 +110,4 @@ CONFIG_FS_CRAMFS=y
CONFIG_BCH=y
CONFIG_PANIC_HANG=y
CONFIG_LZO=y
+CONFIG_POST=y
diff --git a/configs/kmcoge5ne_defconfig b/configs/kmcoge5ne_defconfig
index c2a17c6212f1..013277c9bf12 100644
--- a/configs/kmcoge5ne_defconfig
+++ b/configs/kmcoge5ne_defconfig
@@ -243,3 +243,4 @@ CONFIG_QE_UEC=y
CONFIG_QE=y
CONFIG_SYS_NS16550=y
CONFIG_BCH=y
+CONFIG_POST=y
diff --git a/configs/pg_wcom_expu1_defconfig b/configs/pg_wcom_expu1_defconfig
index ed55f7bfd0aa..d21e180d1fc3 100644
--- a/configs/pg_wcom_expu1_defconfig
+++ b/configs/pg_wcom_expu1_defconfig
@@ -100,3 +100,4 @@ CONFIG_SCSI_AHCI_PLAT=y
CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_DM_SERIAL=y
CONFIG_SYS_NS16550=y
+CONFIG_POST=y
diff --git a/configs/pg_wcom_expu1_update_defconfig b/configs/pg_wcom_expu1_update_defconfig
index 64ddaf8aa61c..54773b06339a 100644
--- a/configs/pg_wcom_expu1_update_defconfig
+++ b/configs/pg_wcom_expu1_update_defconfig
@@ -98,3 +98,4 @@ CONFIG_SCSI_AHCI_PLAT=y
CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_DM_SERIAL=y
CONFIG_SYS_NS16550=y
+CONFIG_POST=y
diff --git a/configs/pg_wcom_seli8_defconfig b/configs/pg_wcom_seli8_defconfig
index ad08e3582e36..8311b3a3a00f 100644
--- a/configs/pg_wcom_seli8_defconfig
+++ b/configs/pg_wcom_seli8_defconfig
@@ -100,3 +100,4 @@ CONFIG_SCSI_AHCI_PLAT=y
CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_DM_SERIAL=y
CONFIG_SYS_NS16550=y
+CONFIG_POST=y
diff --git a/configs/pg_wcom_seli8_update_defconfig b/configs/pg_wcom_seli8_update_defconfig
index 01a6198d727e..d6f4a0547907 100644
--- a/configs/pg_wcom_seli8_update_defconfig
+++ b/configs/pg_wcom_seli8_update_defconfig
@@ -98,3 +98,4 @@ CONFIG_SCSI_AHCI_PLAT=y
CONFIG_SPECIFY_CONSOLE_INDEX=y
CONFIG_DM_SERIAL=y
CONFIG_SYS_NS16550=y
+CONFIG_POST=y
diff --git a/doc/README.POST b/doc/README.POST
index 1d1c25bdf9e1..5d92f3fe6e91 100644
--- a/doc/README.POST
+++ b/doc/README.POST
@@ -242,11 +242,11 @@ storage server and etc.

All POST-related code will be #ifdef'ed with the CONFIG_POST macro.
This macro will be defined in the config_<board>.h file for those
-boards that need POST. The CONFIG_POST macro will contain the list of
+boards that need POST. The CFG_POST macro will contain the list of
POST tests for the board. The macro will have the format of array
composed of post_test structures:

-#define CONFIG_POST \
+#define CFG_POST \
{
"On-board peripherals test", "board", \
" This test performs full check-up of the " \
@@ -257,7 +257,7 @@ composed of post_test structures:

A new file, post.h, will be created in the include/ directory. This
file will contain common POST declarations and will define a set of
-macros that will be reused for defining CONFIG_POST. As an example,
+macros that will be reused for defining CFG_POST. As an example,
the following macro may be defined:

#define POST_CACHE \
diff --git a/doc/README.fsl-ddr b/doc/README.fsl-ddr
index cec5d94df4a8..10e63f3be1d3 100644
--- a/doc/README.fsl-ddr
+++ b/doc/README.fsl-ddr
@@ -137,7 +137,7 @@ Memory testing options for mpc85xx
2. Memory test can be done with Power-On-Self-Test function, activated at
compile time.

- In order to enable the POST memory test, CONFIG_POST needs to be
+ In order to enable the POST memory test, CFG_POST needs to be
defined in board configuraiton header file. By default, POST memory test
performs a fast test. A slow test can be enabled by changing the flag at
compiling time. To test memory bigger than 2GB, 36BIT support is needed.
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 8a489a2e3f95..c02106747a08 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -526,7 +526,7 @@ static int serial_post_probe(struct udevice *dev)
ops->getconfig += gd->reloc_off;
if (ops->setconfig)
ops->setconfig += gd->reloc_off;
-#if CONFIG_POST & CONFIG_SYS_POST_UART
+#if CFG_POST & CONFIG_SYS_POST_UART
if (ops->loop)
ops->loop += gd->reloc_off;
#endif
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 4d5496509481..369a8e38e3e2 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -458,7 +458,7 @@ void default_serial_puts(const char *s)
dev->putc(*s++);
}

-#if CONFIG_POST & CONFIG_SYS_POST_UART
+#if CFG_POST & CONFIG_SYS_POST_UART
static const int bauds[] = CFG_SYS_BAUDRATE_TABLE;

/**
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index acbd43419f2e..8b901ca47a0c 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -41,7 +41,7 @@
*/
#define CFG_SYS_INIT_L2CSR0 L2CSR0_L2E

-#define CONFIG_POST CFG_SYS_POST_MEMORY /* test POST memory test */
+#define CFG_POST CFG_SYS_POST_MEMORY /* test POST memory test */

/*
* Config the L3 Cache as L3 SRAM
diff --git a/include/configs/km/pg-wcom-ls102xa.h b/include/configs/km/pg-wcom-ls102xa.h
index c1174b87ab7a..dfa81c037f48 100644
--- a/include/configs/km/pg-wcom-ls102xa.h
+++ b/include/configs/km/pg-wcom-ls102xa.h
@@ -25,8 +25,8 @@
#define SPD_EEPROM_ADDRESS 0x54

/* POST memory regions test */
-#define CONFIG_POST (CFG_SYS_POST_MEM_REGIONS)
-#define CONFIG_POST_EXTERNAL_WORD_FUNCS
+#define CFG_POST (CFG_SYS_POST_MEM_REGIONS)
+#define CFG_POST_EXTERNAL_WORD_FUNCS

/*
* IFC Definitions
diff --git a/include/configs/kmcent2.h b/include/configs/kmcent2.h
index 89c5a24ee901..527f0383bc65 100644
--- a/include/configs/kmcent2.h
+++ b/include/configs/kmcent2.h
@@ -148,7 +148,7 @@
#define CFG_SYS_INIT_L2CSR0 L2CSR0_L2E

/* POST memory regions test */
-#define CONFIG_POST CFG_SYS_POST_MEM_REGIONS
+#define CFG_POST CFG_SYS_POST_MEM_REGIONS

/*
* Config the L3 Cache as L3 SRAM
diff --git a/include/configs/kmcoge5ne.h b/include/configs/kmcoge5ne.h
index c24d6ad8bc2d..6b30fb4b617e 100644
--- a/include/configs/kmcoge5ne.h
+++ b/include/configs/kmcoge5ne.h
@@ -33,8 +33,8 @@
CSCONFIG_COL_BIT_10)

/* enable POST tests */
-#define CONFIG_POST (CFG_SYS_POST_MEMORY|CFG_SYS_POST_MEM_REGIONS)
-#define CONFIG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
+#define CFG_POST (CFG_SYS_POST_MEMORY|CFG_SYS_POST_MEM_REGIONS)
+#define CFG_POST_EXTERNAL_WORD_FUNCS /* use own functions, not generic */
#define CPM_POST_WORD_ADDR CONFIG_SYS_MEMTEST_END
#define CONFIG_TESTPIN_REG gprt3 /* for kmcoge5ne */
#define CONFIG_TESTPIN_MASK 0x20 /* for kmcoge5ne */
diff --git a/include/post.h b/include/post.h
index 867a66f3007a..e68d5c89020c 100644
--- a/include/post.h
+++ b/include/post.h
@@ -16,7 +16,7 @@

#if defined(CONFIG_POST)

-#ifndef CONFIG_POST_EXTERNAL_WORD_FUNCS
+#ifndef CFG_POST_EXTERNAL_WORD_FUNCS
#ifdef CONFIG_SYS_POST_WORD_ADDR
#define _POST_WORD_ADDR CONFIG_SYS_POST_WORD_ADDR
#else
@@ -51,7 +51,7 @@ static inline void post_word_store (ulong value)
extern ulong post_word_load(void);
extern void post_word_store(ulong value);

-#endif /* CONFIG_POST_EXTERNAL_WORD_FUNCS */
+#endif /* CFG_POST_EXTERNAL_WORD_FUNCS */
#endif /* defined (CONFIG_POST) */
#endif /* __ASSEMBLY__ */

diff --git a/include/serial.h b/include/serial.h
index fe01bcfadb9b..f4d7dc58a9e1 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -14,7 +14,7 @@ struct serial_device {
int (*tstc)(void);
void (*putc)(const char c);
void (*puts)(const char *s);
-#if CONFIG_POST & CONFIG_SYS_POST_UART
+#if CFG_POST & CONFIG_SYS_POST_UART
void (*loop)(int);
#endif
struct serial_device *next;
@@ -242,7 +242,7 @@ struct dm_serial_ops {
* @return 0 if OK, -ve on error
*/
int (*clear)(struct udevice *dev);
-#if CONFIG_POST & CONFIG_SYS_POST_UART
+#if CFG_POST & CONFIG_SYS_POST_UART
/**
* loop() - Control serial device loopback mode
*
diff --git a/post/cpu/mpc83xx/ecc.c b/post/cpu/mpc83xx/ecc.c
index edd74115672b..45263e6b44ca 100644
--- a/post/cpu/mpc83xx/ecc.c
+++ b/post/cpu/mpc83xx/ecc.c
@@ -17,7 +17,7 @@
#include <asm/io.h>
#include <post.h>

-#if CONFIG_POST & CONFIG_SYS_POST_ECC
+#if CFG_POST & CONFIG_SYS_POST_ECC
/*
* We use the RAW I/O accessors where possible in order to
* achieve performance goal, since the test's execution time
diff --git a/post/drivers/flash.c b/post/drivers/flash.c
index 7d65f46d9fea..e157d3691100 100644
--- a/post/drivers/flash.c
+++ b/post/drivers/flash.c
@@ -6,7 +6,7 @@
* Licensed under the GPL-2 or later.
*/

-#if CONFIG_POST & CONFIG_SYS_POST_FLASH
+#if CFG_POST & CONFIG_SYS_POST_FLASH
#include <common.h>
#include <malloc.h>
#include <post.h>
diff --git a/post/drivers/i2c.c b/post/drivers/i2c.c
index 3b378921fafc..057454ffd8f5 100644
--- a/post/drivers/i2c.c
+++ b/post/drivers/i2c.c
@@ -26,7 +26,7 @@
#include <post.h>
#include <i2c.h>

-#if CONFIG_POST & CONFIG_SYS_POST_I2C
+#if CFG_POST & CONFIG_SYS_POST_I2C

static int i2c_ignore_device(unsigned int chip)
{
@@ -94,4 +94,4 @@ int i2c_post_test (int flags)
#endif
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_I2C */
+#endif /* CFG_POST & CONFIG_SYS_POST_I2C */
diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index 71dad7b8c026..1be2b41df45d 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -138,7 +138,7 @@
#include <post.h>
#include <watchdog.h>

-#if CONFIG_POST & (CFG_SYS_POST_MEMORY | CFG_SYS_POST_MEM_REGIONS)
+#if CFG_POST & (CFG_SYS_POST_MEMORY | CFG_SYS_POST_MEM_REGIONS)

DECLARE_GLOBAL_DATA_PTR;

@@ -535,4 +535,4 @@ int memory_post_test(int flags)
return ret;
}

-#endif /* CONFIG_POST&(CFG_SYS_POST_MEMORY|CFG_SYS_POST_MEM_REGIONS) */
+#endif /* CFG_POST&(CFG_SYS_POST_MEMORY|CFG_SYS_POST_MEM_REGIONS) */
diff --git a/post/drivers/rtc.c b/post/drivers/rtc.c
index c603f0e6728c..cfed56b680cd 100644
--- a/post/drivers/rtc.c
+++ b/post/drivers/rtc.c
@@ -26,7 +26,7 @@
#include <post.h>
#include <rtc.h>

-#if CONFIG_POST & CONFIG_SYS_POST_RTC
+#if CFG_POST & CONFIG_SYS_POST_RTC

static int rtc_post_skip (ulong * diff)
{
@@ -189,4 +189,4 @@ int rtc_post_test (int flags)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_RTC */
+#endif /* CFG_POST & CONFIG_SYS_POST_RTC */
diff --git a/post/lib_powerpc/andi.c b/post/lib_powerpc/andi.c
index d4f60aa73880..d69d61396bcb 100644
--- a/post/lib_powerpc/andi.c
+++ b/post/lib_powerpc/andi.c
@@ -19,7 +19,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_21 (ulong *code, ulong *cr, ulong *res, ulong op);
extern ulong cpu_post_makecr (long v);
diff --git a/post/lib_powerpc/asm.S b/post/lib_powerpc/asm.S
index 91b599932ffd..13302d796898 100644
--- a/post/lib_powerpc/asm.S
+++ b/post/lib_powerpc/asm.S
@@ -10,7 +10,7 @@
#include <ppc_defs.h>
#include <asm/cache.h>

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

/* void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2); */
.global cpu_post_exec_02
diff --git a/post/lib_powerpc/b.c b/post/lib_powerpc/b.c
index 0b02e9169e2b..eb9371fa6b20 100644
--- a/post/lib_powerpc/b.c
+++ b/post/lib_powerpc/b.c
@@ -24,7 +24,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_11 (ulong *code, ulong *res, ulong op1);
extern void cpu_post_exec_31 (ulong *code, ulong *ctr, ulong *lr, ulong *jump,
diff --git a/post/lib_powerpc/cmp.c b/post/lib_powerpc/cmp.c
index e70869774ceb..e4d0931fc9a4 100644
--- a/post/lib_powerpc/cmp.c
+++ b/post/lib_powerpc/cmp.c
@@ -23,7 +23,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_12 (ulong *code, ulong *res, ulong op1, ulong op2);

diff --git a/post/lib_powerpc/cmpi.c b/post/lib_powerpc/cmpi.c
index 85a9b0ad36b2..983892d00635 100644
--- a/post/lib_powerpc/cmpi.c
+++ b/post/lib_powerpc/cmpi.c
@@ -23,7 +23,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_11 (ulong *code, ulong *res, ulong op1);

diff --git a/post/lib_powerpc/complex.c b/post/lib_powerpc/complex.c
index bb29e9170127..d2ec21b0cbea 100644
--- a/post/lib_powerpc/complex.c
+++ b/post/lib_powerpc/complex.c
@@ -18,7 +18,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern int cpu_post_complex_1_asm (int a1, int a2, int a3, int a4, int n);
extern int cpu_post_complex_2_asm (int x, int n);
diff --git a/post/lib_powerpc/cpu.c b/post/lib_powerpc/cpu.c
index 1d4710734291..77c25381729b 100644
--- a/post/lib_powerpc/cpu.c
+++ b/post/lib_powerpc/cpu.c
@@ -20,7 +20,7 @@
#include <post.h>
#include <asm/mmu.h>

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern int cpu_post_test_cmp (void);
extern int cpu_post_test_cmpi (void);
@@ -118,4 +118,4 @@ int cpu_post_test (int flags)
return ret;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_CPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_CPU */
diff --git a/post/lib_powerpc/cr.c b/post/lib_powerpc/cr.c
index 56ed355dde71..077fb0f2da3a 100644
--- a/post/lib_powerpc/cr.c
+++ b/post/lib_powerpc/cr.c
@@ -33,7 +33,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_11 (ulong *code, ulong *res, ulong op1);
extern void cpu_post_exec_21x (ulong *code, ulong *op1, ulong *op2, ulong op3);
diff --git a/post/lib_powerpc/fpu/20001122-1.c b/post/lib_powerpc/fpu/20001122-1.c
index 4b452dc083d4..eddd3f915eed 100644
--- a/post/lib_powerpc/fpu/20001122-1.c
+++ b/post/lib_powerpc/fpu/20001122-1.c
@@ -13,7 +13,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

int fpu_post_test_math1 (void)
{
@@ -40,4 +40,4 @@ int fpu_post_test_math1 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/20010114-2.c b/post/lib_powerpc/fpu/20010114-2.c
index 4aadd1e0482d..9e3e54661f99 100644
--- a/post/lib_powerpc/fpu/20010114-2.c
+++ b/post/lib_powerpc/fpu/20010114-2.c
@@ -13,7 +13,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

static float rintf (float x)
{
@@ -45,4 +45,4 @@ int fpu_post_test_math2 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/20010226-1.c b/post/lib_powerpc/fpu/20010226-1.c
index b09a25c2118c..5bb386090035 100644
--- a/post/lib_powerpc/fpu/20010226-1.c
+++ b/post/lib_powerpc/fpu/20010226-1.c
@@ -13,7 +13,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

int fpu_post_test_math3 (void)
{
@@ -33,4 +33,4 @@ int fpu_post_test_math3 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/980619-1.c b/post/lib_powerpc/fpu/980619-1.c
index 2fea708306cc..415cd50c85d2 100644
--- a/post/lib_powerpc/fpu/980619-1.c
+++ b/post/lib_powerpc/fpu/980619-1.c
@@ -13,7 +13,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

int fpu_post_test_math4 (void)
{
@@ -39,4 +39,4 @@ int fpu_post_test_math4 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/acc1.c b/post/lib_powerpc/fpu/acc1.c
index 9e5783b25792..4cf3b7cef757 100644
--- a/post/lib_powerpc/fpu/acc1.c
+++ b/post/lib_powerpc/fpu/acc1.c
@@ -13,7 +13,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

static double func (const double *array)
{
@@ -36,4 +36,4 @@ int fpu_post_test_math5 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/compare-fp-1.c b/post/lib_powerpc/fpu/compare-fp-1.c
index d46a13adcdfe..029600fd2b74 100644
--- a/post/lib_powerpc/fpu/compare-fp-1.c
+++ b/post/lib_powerpc/fpu/compare-fp-1.c
@@ -15,7 +15,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

static int failed;

@@ -204,4 +204,4 @@ int fpu_post_test_math6 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/fpu.c b/post/lib_powerpc/fpu/fpu.c
index bd65f623d500..8993b36e801d 100644
--- a/post/lib_powerpc/fpu/fpu.c
+++ b/post/lib_powerpc/fpu/fpu.c
@@ -21,7 +21,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

#include <watchdog.h>

@@ -71,4 +71,4 @@ int fpu_post_test (int flags)
return ret;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/fpu/mul-subnormal-single-1.c b/post/lib_powerpc/fpu/mul-subnormal-single-1.c
index cb61c9114d7b..87b882c6b22f 100644
--- a/post/lib_powerpc/fpu/mul-subnormal-single-1.c
+++ b/post/lib_powerpc/fpu/mul-subnormal-single-1.c
@@ -15,7 +15,7 @@

GNU_FPOST_ATTR

-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU

union uf
{
@@ -82,4 +82,4 @@ int fpu_post_test_math7 (void)
return 0;
}

-#endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
+#endif /* CFG_POST & CONFIG_SYS_POST_FPU */
diff --git a/post/lib_powerpc/load.c b/post/lib_powerpc/load.c
index 5269563b1e17..ece0b2756e00 100644
--- a/post/lib_powerpc/load.c
+++ b/post/lib_powerpc/load.c
@@ -28,7 +28,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_22w (ulong *code, ulong *op1, ulong op2, ulong *op3);
extern void cpu_post_exec_21w (ulong *code, ulong *op1, ulong *op2);
diff --git a/post/lib_powerpc/multi.c b/post/lib_powerpc/multi.c
index f082e4c546cc..0e9ee88eb5d5 100644
--- a/post/lib_powerpc/multi.c
+++ b/post/lib_powerpc/multi.c
@@ -21,7 +21,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_02(ulong *code, ulong op1, ulong op2);

diff --git a/post/lib_powerpc/rlwimi.c b/post/lib_powerpc/rlwimi.c
index 7b4dc79fb17d..d24a3f665c7c 100644
--- a/post/lib_powerpc/rlwimi.c
+++ b/post/lib_powerpc/rlwimi.c
@@ -19,7 +19,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_22 (ulong *code, ulong *cr, ulong *res, ulong op1,
ulong op2);
diff --git a/post/lib_powerpc/rlwinm.c b/post/lib_powerpc/rlwinm.c
index 8a03e9b9bcb6..9f4a3edb3ea7 100644
--- a/post/lib_powerpc/rlwinm.c
+++ b/post/lib_powerpc/rlwinm.c
@@ -19,7 +19,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_21 (ulong *code, ulong *cr, ulong *res, ulong op1);
extern ulong cpu_post_makecr (long v);
diff --git a/post/lib_powerpc/rlwnm.c b/post/lib_powerpc/rlwnm.c
index e2beb4e41713..224e6bdd45e9 100644
--- a/post/lib_powerpc/rlwnm.c
+++ b/post/lib_powerpc/rlwnm.c
@@ -19,7 +19,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_22 (ulong *code, ulong *cr, ulong *res, ulong op1,
ulong op2);
diff --git a/post/lib_powerpc/srawi.c b/post/lib_powerpc/srawi.c
index d4a8fabc4257..713d4f2276b3 100644
--- a/post/lib_powerpc/srawi.c
+++ b/post/lib_powerpc/srawi.c
@@ -19,7 +19,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_21 (ulong *code, ulong *cr, ulong *res, ulong op);
extern ulong cpu_post_makecr (long v);
diff --git a/post/lib_powerpc/store.c b/post/lib_powerpc/store.c
index 8e278fee885a..2dbcccf098a5 100644
--- a/post/lib_powerpc/store.c
+++ b/post/lib_powerpc/store.c
@@ -28,7 +28,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_12w (ulong *code, ulong *op1, ulong op2, ulong op3);
extern void cpu_post_exec_11w (ulong *code, ulong *op1, ulong op2);
diff --git a/post/lib_powerpc/string.c b/post/lib_powerpc/string.c
index 0d8d280b271c..9b54847632a3 100644
--- a/post/lib_powerpc/string.c
+++ b/post/lib_powerpc/string.c
@@ -20,7 +20,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2);
extern void cpu_post_exec_04 (ulong *code, ulong op1, ulong op2, ulong op3,
diff --git a/post/lib_powerpc/three.c b/post/lib_powerpc/three.c
index fc6f1f5674ad..55f0ff8a8825 100644
--- a/post/lib_powerpc/three.c
+++ b/post/lib_powerpc/three.c
@@ -22,7 +22,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_22 (ulong *code, ulong *cr, ulong *res, ulong op1,
ulong op2);
diff --git a/post/lib_powerpc/threei.c b/post/lib_powerpc/threei.c
index f49c85e6b9da..ec52d238e699 100644
--- a/post/lib_powerpc/threei.c
+++ b/post/lib_powerpc/threei.c
@@ -21,7 +21,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_21 (ulong *code, ulong *cr, ulong *res, ulong op);
extern ulong cpu_post_makecr (long v);
diff --git a/post/lib_powerpc/threex.c b/post/lib_powerpc/threex.c
index 6bc5a54706b4..6f5f0b8eb760 100644
--- a/post/lib_powerpc/threex.c
+++ b/post/lib_powerpc/threex.c
@@ -22,7 +22,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_22 (ulong *code, ulong *cr, ulong *res, ulong op1,
ulong op2);
diff --git a/post/lib_powerpc/two.c b/post/lib_powerpc/two.c
index fa376c76b1bb..b44dd4e20845 100644
--- a/post/lib_powerpc/two.c
+++ b/post/lib_powerpc/two.c
@@ -22,7 +22,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_21 (ulong *code, ulong *cr, ulong *res, ulong op1);
extern ulong cpu_post_makecr (long v);
diff --git a/post/lib_powerpc/twox.c b/post/lib_powerpc/twox.c
index 5c36012a9b79..320cc0a64e7c 100644
--- a/post/lib_powerpc/twox.c
+++ b/post/lib_powerpc/twox.c
@@ -22,7 +22,7 @@
#include <post.h>
#include "cpu_asm.h"

-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU

extern void cpu_post_exec_21 (ulong *code, ulong *cr, ulong *res, ulong op1);
extern ulong cpu_post_makecr (long v);
diff --git a/post/post.c b/post/post.c
index b81425d8cf81..9964b4108041 100644
--- a/post/post.c
+++ b/post/post.c
@@ -168,7 +168,7 @@ static void post_bootmode_test_off(void)
post_word_store(word);
}

-#ifndef CONFIG_POST_SKIP_ENV_FLAGS
+#ifndef CFG_POST_SKIP_ENV_FLAGS
static void post_get_env_flags(int *test_flags)
{
int flag[] = { POST_POWERON, POST_NORMAL, POST_SLOWTEST,
@@ -227,7 +227,7 @@ static void post_get_flags(int *test_flags)
for (j = 0; j < post_list_size; j++)
test_flags[j] = post_list[j].flags;

-#ifndef CONFIG_POST_SKIP_ENV_FLAGS
+#ifndef CFG_POST_SKIP_ENV_FLAGS
post_get_env_flags(test_flags);
#endif

diff --git a/post/tests.c b/post/tests.c
index fc36e738f731..d61ea74d512e 100644
--- a/post/tests.c
+++ b/post/tests.c
@@ -45,7 +45,7 @@ extern void sysmon_reloc (void);

struct post_test post_list[] =
{
-#if CONFIG_POST & CONFIG_SYS_POST_OCM
+#if CFG_POST & CONFIG_SYS_POST_OCM
{
"OCM test",
"ocm",
@@ -57,7 +57,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_OCM
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_CACHE
+#if CFG_POST & CONFIG_SYS_POST_CACHE
{
"Cache test",
"cache",
@@ -69,9 +69,9 @@ struct post_test post_list[] =
CONFIG_SYS_POST_CACHE
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_WATCHDOG
-#if defined(CONFIG_POST_WATCHDOG)
- CONFIG_POST_WATCHDOG,
+#if CFG_POST & CONFIG_SYS_POST_WATCHDOG
+#if defined(CFG_POST_WATCHDOG)
+ CFG_POST_WATCHDOG,
#else
{
"Watchdog timer test",
@@ -85,7 +85,7 @@ struct post_test post_list[] =
},
#endif
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_I2C
+#if CFG_POST & CONFIG_SYS_POST_I2C
{
"I2C test",
"i2c",
@@ -97,7 +97,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_I2C
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_RTC
+#if CFG_POST & CONFIG_SYS_POST_RTC
{
"RTC test",
"rtc",
@@ -109,7 +109,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_RTC
},
#endif
-#if CONFIG_POST & CFG_SYS_POST_MEMORY
+#if CFG_POST & CFG_SYS_POST_MEMORY
{
"Memory test",
"memory",
@@ -121,7 +121,7 @@ struct post_test post_list[] =
CFG_SYS_POST_MEMORY
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_CPU
+#if CFG_POST & CONFIG_SYS_POST_CPU
{
"CPU test",
"cpu",
@@ -134,7 +134,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_CPU
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_FPU
+#if CFG_POST & CONFIG_SYS_POST_FPU
{
"FPU test",
"fpu",
@@ -147,9 +147,9 @@ struct post_test post_list[] =
CONFIG_SYS_POST_FPU
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_UART
-#if defined(CONFIG_POST_UART)
- CONFIG_POST_UART,
+#if CFG_POST & CONFIG_SYS_POST_UART
+#if defined(CFG_POST_UART)
+ CFG_POST_UART,
#else
{
"UART test",
@@ -161,9 +161,9 @@ struct post_test post_list[] =
NULL,
CONFIG_SYS_POST_UART
},
-#endif /* CONFIG_POST_UART */
+#endif /* CFG_POST_UART */
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_ETHER
+#if CFG_POST & CONFIG_SYS_POST_ETHER
{
"ETHERNET test",
"ethernet",
@@ -175,7 +175,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_ETHER
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_USB
+#if CFG_POST & CONFIG_SYS_POST_USB
{
"USB test",
"usb",
@@ -187,7 +187,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_USB
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_SPR
+#if CFG_POST & CONFIG_SYS_POST_SPR
{
"SPR test",
"spr",
@@ -199,7 +199,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_SPR
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_SYSMON
+#if CFG_POST & CONFIG_SYS_POST_SYSMON
{
"SYSMON test",
"sysmon",
@@ -211,7 +211,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_SYSMON
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_DSP
+#if CFG_POST & CONFIG_SYS_POST_DSP
{
"DSP test",
"dsp",
@@ -223,7 +223,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_DSP
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_CODEC
+#if CFG_POST & CONFIG_SYS_POST_CODEC
{
"CODEC test",
"codec",
@@ -235,7 +235,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_CODEC
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_ECC
+#if CFG_POST & CONFIG_SYS_POST_ECC
{
"ECC test",
"ecc",
@@ -247,22 +247,22 @@ struct post_test post_list[] =
CONFIG_SYS_POST_ECC
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_BSPEC1
- CONFIG_POST_BSPEC1,
+#if CFG_POST & CONFIG_SYS_POST_BSPEC1
+ CFG_POST_BSPEC1,
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_BSPEC2
- CONFIG_POST_BSPEC2,
+#if CFG_POST & CONFIG_SYS_POST_BSPEC2
+ CFG_POST_BSPEC2,
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_BSPEC3
- CONFIG_POST_BSPEC3,
+#if CFG_POST & CONFIG_SYS_POST_BSPEC3
+ CFG_POST_BSPEC3,
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_BSPEC4
- CONFIG_POST_BSPEC4,
+#if CFG_POST & CONFIG_SYS_POST_BSPEC4
+ CFG_POST_BSPEC4,
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_BSPEC5
- CONFIG_POST_BSPEC5,
+#if CFG_POST & CONFIG_SYS_POST_BSPEC5
+ CFG_POST_BSPEC5,
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_COPROC
+#if CFG_POST & CONFIG_SYS_POST_COPROC
{
"Coprocessors communication test",
"coproc_com",
@@ -274,7 +274,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_COPROC
},
#endif
-#if CONFIG_POST & CONFIG_SYS_POST_FLASH
+#if CFG_POST & CONFIG_SYS_POST_FLASH
{
"Parallel NOR flash test",
"flash",
@@ -286,7 +286,7 @@ struct post_test post_list[] =
CONFIG_SYS_POST_FLASH
},
#endif
-#if CONFIG_POST & CFG_SYS_POST_MEM_REGIONS
+#if CFG_POST & CFG_SYS_POST_MEM_REGIONS
{
"Memory regions test",
"mem_regions",
diff --git a/test/Kconfig b/test/Kconfig
index a6b463e4d06c..9f4641ae6bc5 100644
--- a/test/Kconfig
+++ b/test/Kconfig
@@ -1,3 +1,8 @@
+config POST
+ bool "Power On Self Test support"
+ help
+ See doc/README.POST for more details
+
menuconfig UNIT_TEST
bool "Unit tests"
help
--
2.25.1