[U-Boot] [PATCH 1/5] kconfiglib.py: Kludge in 'imply' support

Currently upstream does not yet understand the imply keyword. For what we use kconfiglib.py for today, this is OK. We only need to be able to evaluate in order to make boards.cfg and none of those choices will depend on how imply evaluates out.
Signed-off-by: Tom Rini trini@konsulko.com --- tools/buildman/kconfiglib.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/buildman/kconfiglib.py b/tools/buildman/kconfiglib.py index 7a47be9153f4..d28bbf0b49a2 100644 --- a/tools/buildman/kconfiglib.py +++ b/tools/buildman/kconfiglib.py @@ -892,7 +892,7 @@ class Config(object):
line_feeder.unget()
- elif t0 == T_SELECT: + elif t0 == T_SELECT or t0 == T_IMPLY: target = tokens.get_next()
stmt.referenced_syms.add(target) @@ -3406,8 +3406,8 @@ def _internal_error(msg): T_OPTIONAL, T_PROMPT, T_DEFAULT, T_BOOL, T_TRISTATE, T_HEX, T_INT, T_STRING, T_DEF_BOOL, T_DEF_TRISTATE, - T_SELECT, T_RANGE, T_OPTION, T_ALLNOCONFIG_Y, T_ENV, - T_DEFCONFIG_LIST, T_MODULES, T_VISIBLE) = range(39) + T_SELECT, T_IMPLY, T_RANGE, T_OPTION, T_ALLNOCONFIG_Y, T_ENV, + T_DEFCONFIG_LIST, T_MODULES, T_VISIBLE) = range(40)
# The leading underscore before the function assignments below prevent pydoc # from listing them. The constants could be hidden too, but they're fairly @@ -3424,8 +3424,9 @@ _get_keyword = \ "prompt": T_PROMPT, "default": T_DEFAULT, "bool": T_BOOL, "boolean": T_BOOL, "tristate": T_TRISTATE, "int": T_INT, "hex": T_HEX, "def_bool": T_DEF_BOOL, "def_tristate": T_DEF_TRISTATE, "string": T_STRING, "select": T_SELECT, - "range": T_RANGE, "option": T_OPTION, "allnoconfig_y": T_ALLNOCONFIG_Y, - "env": T_ENV, "defconfig_list": T_DEFCONFIG_LIST, "modules": T_MODULES, + "imply": T_IMPLY, "range": T_RANGE, "option": T_OPTION, + "allnoconfig_y": T_ALLNOCONFIG_Y, "env": T_ENV, + "defconfig_list": T_DEFCONFIG_LIST, "modules": T_MODULES, "visible": T_VISIBLE}.get
# Strings to use for True and False

These particular SPL options are part of what the ROM provides, but for compatibility with how we have previously used them, move them to being implied by the board being selected.
Signed-off-by: Tom Rini trini@konsulko.com --- arch/arm/mach-omap2/am33xx/Kconfig | 3 +++ board/ti/am335x/Kconfig | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig index 5b5d3f8cec29..5adcead185de 100644 --- a/arch/arm/mach-omap2/am33xx/Kconfig +++ b/arch/arm/mach-omap2/am33xx/Kconfig @@ -15,6 +15,9 @@ config TARGET_AM335X_EVM select DM_SERIAL select DM_GPIO select TI_I2C_BOARD_DETECT + imply SPL_YMODEM_SUPPORT + imply SPL_ENV_SUPPORT + imply SPL_WATCHDOG_SUPPORT help This option specifies support for the AM335x GP and HS EVM development platforms. The AM335x diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig index a84e91b3dc56..97374bdc12ae 100644 --- a/board/ti/am335x/Kconfig +++ b/board/ti/am335x/Kconfig @@ -1,14 +1,5 @@ if TARGET_AM335X_EVM
-config SPL_ENV_SUPPORT - default y - -config SPL_WATCHDOG_SUPPORT - default y - -config SPL_YMODEM_SUPPORT - default y - config SYS_BOARD default "am335x"

Hi Tom,
These particular SPL options are part of what the ROM provides, but for compatibility with how we have previously used them, move them to being implied by the board being selected.
Signed-off-by: Tom Rini trini@konsulko.com
arch/arm/mach-omap2/am33xx/Kconfig | 3 +++ board/ti/am335x/Kconfig | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig index 5b5d3f8cec29..5adcead185de 100644 --- a/arch/arm/mach-omap2/am33xx/Kconfig +++ b/arch/arm/mach-omap2/am33xx/Kconfig @@ -15,6 +15,9 @@ config TARGET_AM335X_EVM select DM_SERIAL select DM_GPIO select TI_I2C_BOARD_DETECT
- imply SPL_YMODEM_SUPPORT
- imply SPL_ENV_SUPPORT
- imply SPL_WATCHDOG_SUPPORT
Are you sure that WDT is enabled by ROM by default?
IIRC we must enable it explicitly in the SPL.
help This option specifies support for the AM335x GP and HS EVM development platforms. The AM335x diff --git a/board/ti/am335x/Kconfig b/board/ti/am335x/Kconfig index a84e91b3dc56..97374bdc12ae 100644 --- a/board/ti/am335x/Kconfig +++ b/board/ti/am335x/Kconfig @@ -1,14 +1,5 @@ if TARGET_AM335X_EVM
-config SPL_ENV_SUPPORT
- default y
-config SPL_WATCHDOG_SUPPORT
- default y
-config SPL_YMODEM_SUPPORT
- default y
config SYS_BOARD default "am335x"
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

On Sun, Mar 05, 2017 at 11:53:43PM +0100, Lukasz Majewski wrote:
Hi Tom,
These particular SPL options are part of what the ROM provides, but for compatibility with how we have previously used them, move them to being implied by the board being selected.
Signed-off-by: Tom Rini trini@konsulko.com
arch/arm/mach-omap2/am33xx/Kconfig | 3 +++ board/ti/am335x/Kconfig | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig index 5b5d3f8cec29..5adcead185de 100644 --- a/arch/arm/mach-omap2/am33xx/Kconfig +++ b/arch/arm/mach-omap2/am33xx/Kconfig @@ -15,6 +15,9 @@ config TARGET_AM335X_EVM select DM_SERIAL select DM_GPIO select TI_I2C_BOARD_DETECT
- imply SPL_YMODEM_SUPPORT
- imply SPL_ENV_SUPPORT
- imply SPL_WATCHDOG_SUPPORT
Are you sure that WDT is enabled by ROM by default?
OK, good point, my wording was slightly unclear. What I meant was that these are SPL-usable features that are part of the SoC, rather than something board-centric. That said, yes, a quick re-read of the initialization section of the AM335x TRM says that ROM sets up WDT1, which matches up with my recollections from TI days and board bring up. It's likely this should become a 'select' as if we don't twiddle it in time, we will trigger it.
IIRC we must enable it explicitly in the SPL.
We can reconfigure it to be more "precise" perhaps is the answer. I have a recollection of a bring up issue where in the problem was "Oh, we got somewhat far, but hadn't touched the WDT and reset".

On Fri, Mar 03, 2017 at 03:33:30PM -0500, Tom Rini wrote:
These particular SPL options are part of what the ROM provides, but for compatibility with how we have previously used them, move them to being implied by the board being selected.
Signed-off-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

The option that we had set in board/ti/common/Kconfig as default y are best done with imply under the appropriate main Kconfig option instead.
Signed-off-by: Tom Rini trini@konsulko.com --- arch/arm/Kconfig | 13 +++++++++++++ arch/arm/mach-omap2/am33xx/Kconfig | 36 ++++++++++++++++++++++++++---------- arch/arm/mach-omap2/omap5/Kconfig | 36 ------------------------------------ board/ti/common/Kconfig | 36 ------------------------------------ 4 files changed, 39 insertions(+), 82 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e84b74efb664..5e1838474e33 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -579,6 +579,19 @@ config OMAP44XX config OMAP54XX bool "OMAP54XX SoC" select ARCH_OMAP2 + imply SPL_DISPLAY_PRINT + imply SPL_ENV_SUPPORT + imply SPL_EXT_SUPPORT + imply SPL_FAT_SUPPORT + imply SPL_GPIO_SUPPORT + imply SPL_I2C_SUPPORT + imply SPL_LIBCOMMON_SUPPORT + imply SPL_LIBDISK_SUPPORT + imply SPL_LIBGENERIC_SUPPORT + imply SPL_MMC_SUPPORT + imply SPL_NAND_SUPPORT + imply SPL_POWER_SUPPORT + imply SPL_SERIAL_SUPPORT
config AM43XX bool "AM43XX SoC" diff --git a/arch/arm/mach-omap2/am33xx/Kconfig b/arch/arm/mach-omap2/am33xx/Kconfig index 5adcead185de..865a8d2d04ac 100644 --- a/arch/arm/mach-omap2/am33xx/Kconfig +++ b/arch/arm/mach-omap2/am33xx/Kconfig @@ -15,9 +15,20 @@ config TARGET_AM335X_EVM select DM_SERIAL select DM_GPIO select TI_I2C_BOARD_DETECT - imply SPL_YMODEM_SUPPORT imply SPL_ENV_SUPPORT + imply SPL_EXT_SUPPORT + imply SPL_FAT_SUPPORT + imply SPL_GPIO_SUPPORT + imply SPL_I2C_SUPPORT + imply SPL_LIBCOMMON_SUPPORT + imply SPL_LIBDISK_SUPPORT + imply SPL_LIBGENERIC_SUPPORT + imply SPL_MMC_SUPPORT + imply SPL_NAND_SUPPORT + imply SPL_POWER_SUPPORT + imply SPL_SERIAL_SUPPORT imply SPL_WATCHDOG_SUPPORT + imply SPL_YMODEM_SUPPORT help This option specifies support for the AM335x GP and HS EVM development platforms. The AM335x @@ -104,19 +115,24 @@ endif
if AM43XX
-config SPL_EXT_SUPPORT - default y - -config SPL_GPIO_SUPPORT - default y - -config SPL_I2C_SUPPORT - default y - config TARGET_AM43XX_EVM bool "Support am43xx_evm" select BOARD_LATE_INIT select TI_I2C_BOARD_DETECT + imply SPL_ENV_SUPPORT + imply SPL_EXT_SUPPORT + imply SPL_FAT_SUPPORT + imply SPL_GPIO_SUPPORT + imply SPL_I2C_SUPPORT + imply SPL_LIBCOMMON_SUPPORT + imply SPL_LIBDISK_SUPPORT + imply SPL_LIBGENERIC_SUPPORT + imply SPL_MMC_SUPPORT + imply SPL_NAND_SUPPORT + imply SPL_POWER_SUPPORT + imply SPL_SERIAL_SUPPORT + imply SPL_WATCHDOG_SUPPORT + imply SPL_YMODEM_SUPPORT help This option specifies support for the AM43xx GP and HS EVM development platforms.The AM437x diff --git a/arch/arm/mach-omap2/omap5/Kconfig b/arch/arm/mach-omap2/omap5/Kconfig index c5edc7c98d4d..4041adc9742e 100644 --- a/arch/arm/mach-omap2/omap5/Kconfig +++ b/arch/arm/mach-omap2/omap5/Kconfig @@ -1,41 +1,5 @@ if OMAP54XX
-config SPL_EXT_SUPPORT - default y - -config SPL_FAT_SUPPORT - default y - -config SPL_GPIO_SUPPORT - default y - -config SPL_I2C_SUPPORT - default y - -config SPL_LIBCOMMON_SUPPORT - default y - -config SPL_LIBDISK_SUPPORT - default y - -config SPL_LIBGENERIC_SUPPORT - default y - -config SPL_MMC_SUPPORT - default y - -config SPL_NAND_SUPPORT - default y - -config SPL_POWER_SUPPORT - default y - -config SPL_SERIAL_SUPPORT - default y - -config SPL_DISPLAY_PRINT - default y - choice prompt "OMAP5 board select" optional diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index 4980a047143e..adf73abc9358 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -1,41 +1,5 @@ -config SPL_ENV_SUPPORT - default y - config TI_I2C_BOARD_DETECT bool "Support for Board detection for TI platforms" help Support for detection board information on Texas Instrument's Evaluation Boards which have I2C based EEPROM detection - -config SPL_EXT_SUPPORT - default y - -config SPL_FAT_SUPPORT - default y - -config SPL_GPIO_SUPPORT - default y - -config SPL_I2C_SUPPORT - default y - -config SPL_LIBCOMMON_SUPPORT - default y - -config SPL_LIBDISK_SUPPORT - default y - -config SPL_LIBGENERIC_SUPPORT - default y - -config SPL_MMC_SUPPORT - default y - -config SPL_NAND_SUPPORT - default y - -config SPL_POWER_SUPPORT - default y - -config SPL_SERIAL_SUPPORT - default y

On Fri, Mar 03, 2017 at 03:33:31PM -0500, Tom Rini wrote:
The option that we had set in board/ti/common/Kconfig as default y are best done with imply under the appropriate main Kconfig option instead.
Signed-off-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Move the default y options under arch/arm/mach-omap2/omap3/Kconfig to be using imply instead in arch/arm/Kconfig
Signed-off-by: Tom Rini trini@konsulko.com --- arch/arm/Kconfig | 11 +++++++++++ arch/arm/mach-omap2/omap3/Kconfig | 33 --------------------------------- 2 files changed, 11 insertions(+), 33 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5e1838474e33..afb49fe5e5ef 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -570,6 +570,17 @@ config OMAP34XX bool "OMAP34XX SoC" select ARCH_OMAP2 select USE_TINY_PRINTF + imply SPL_EXT_SUPPORT + imply SPL_FAT_SUPPORT + imply SPL_GPIO_SUPPORT + imply SPL_I2C_SUPPORT + imply SPL_LIBCOMMON_SUPPORT + imply SPL_LIBDISK_SUPPORT + imply SPL_LIBGENERIC_SUPPORT + imply SPL_MMC_SUPPORT + imply SPL_NAND_SUPPORT + imply SPL_POWER_SUPPORT + imply SPL_SERIAL_SUPPORT
config OMAP44XX bool "OMAP44XX SoC" diff --git a/arch/arm/mach-omap2/omap3/Kconfig b/arch/arm/mach-omap2/omap3/Kconfig index 4a7957fde85d..933fcba37cf5 100644 --- a/arch/arm/mach-omap2/omap3/Kconfig +++ b/arch/arm/mach-omap2/omap3/Kconfig @@ -1,38 +1,5 @@ if OMAP34XX
-config SPL_EXT_SUPPORT - default y - -config SPL_FAT_SUPPORT - default y - -config SPL_GPIO_SUPPORT - default y - -config SPL_I2C_SUPPORT - default y - -config SPL_LIBCOMMON_SUPPORT - default y - -config SPL_LIBDISK_SUPPORT - default y - -config SPL_LIBGENERIC_SUPPORT - default y - -config SPL_MMC_SUPPORT - default y - -config SPL_NAND_SUPPORT - default y - -config SPL_POWER_SUPPORT - default y - -config SPL_SERIAL_SUPPORT - default y - choice prompt "OMAP3 board select" optional

On Fri, Mar 03, 2017 at 03:33:32PM -0500, Tom Rini wrote:
Move the default y options under arch/arm/mach-omap2/omap3/Kconfig to be using imply instead in arch/arm/Kconfig
Signed-off-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

Move the default y options under arch/arm/mach-omap2/omap4/Kconfig to be using imply instead in arch/arm/Kconfig
Signed-off-by: Tom Rini trini@konsulko.com --- arch/arm/Kconfig | 12 ++++++++++++ arch/arm/mach-omap2/omap4/Kconfig | 36 ------------------------------------ 2 files changed, 12 insertions(+), 36 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index afb49fe5e5ef..7022e2af847e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -586,6 +586,18 @@ config OMAP44XX bool "OMAP44XX SoC" select ARCH_OMAP2 select USE_TINY_PRINTF + imply SPL_DISPLAY_PRINT + imply SPL_EXT_SUPPORT + imply SPL_FAT_SUPPORT + imply SPL_GPIO_SUPPORT + imply SPL_I2C_SUPPORT + imply SPL_LIBCOMMON_SUPPORT + imply SPL_LIBDISK_SUPPORT + imply SPL_LIBGENERIC_SUPPORT + imply SPL_MMC_SUPPORT + imply SPL_NAND_SUPPORT + imply SPL_POWER_SUPPORT + imply SPL_SERIAL_SUPPORT
config OMAP54XX bool "OMAP54XX SoC" diff --git a/arch/arm/mach-omap2/omap4/Kconfig b/arch/arm/mach-omap2/omap4/Kconfig index 2091dd781512..49adb8ec5be3 100644 --- a/arch/arm/mach-omap2/omap4/Kconfig +++ b/arch/arm/mach-omap2/omap4/Kconfig @@ -1,41 +1,5 @@ if OMAP44XX
-config SPL_EXT_SUPPORT - default y - -config SPL_FAT_SUPPORT - default y - -config SPL_GPIO_SUPPORT - default y - -config SPL_I2C_SUPPORT - default y - -config SPL_LIBCOMMON_SUPPORT - default y - -config SPL_LIBDISK_SUPPORT - default y - -config SPL_LIBGENERIC_SUPPORT - default y - -config SPL_MMC_SUPPORT - default y - -config SPL_NAND_SUPPORT - default y - -config SPL_POWER_SUPPORT - default y - -config SPL_SERIAL_SUPPORT - default y - -config SPL_DISPLAY_PRINT - default y - choice prompt "OMAP4 board select" optional

On Fri, Mar 03, 2017 at 03:33:33PM -0500, Tom Rini wrote:
Move the default y options under arch/arm/mach-omap2/omap4/Kconfig to be using imply instead in arch/arm/Kconfig
Signed-off-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!

On Fri, Mar 03, 2017 at 03:33:29PM -0500, Tom Rini wrote:
Currently upstream does not yet understand the imply keyword. For what we use kconfiglib.py for today, this is OK. We only need to be able to evaluate in order to make boards.cfg and none of those choices will depend on how imply evaluates out.
Signed-off-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!
participants (2)
-
Lukasz Majewski
-
Tom Rini