Skip to contentSkip to conversation

kconfiglib.py: Kludge in 'imply' support

PATCH New Tom Rini 2 participants 12 messages Mar 3, 2017 – Mar 10, 2017

Subsystems (3)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

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.

---
 tools/buildman/kconfiglib.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
tools/buildman/kconfiglib.py +6 -5
index 7a47be9153f4..d28bbf0b49a2 100644
@@ -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
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/5 kconfiglib.py: Kludge in 'imply' support

Quoted 6 lines · Tom Rini

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170310/f6a8fa2d/attachment.sig>
author
#2 lore raw

PATCH 2/5 am335x_evm: Switch to using imply keyword

In reply to Tom Rini

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.

---
 arch/arm/mach-omap2/am33xx/Kconfig | 3 +++
 board/ti/am335x/Kconfig            | 9 ---------
 2 files changed, 3 insertions(+), 9 deletions(-)
arch/arm/mach-omap2/am33xx/Kconfig +3 -0
index 5b5d3f8cec29..5adcead185de 100644
@@ -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
board/ti/am335x/Kconfig +0 -9
index a84e91b3dc56..97374bdc12ae 100644
@@ -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"
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/5 am335x_evm: Switch to using imply keyword

Hi Tom,

Quoted 15 lines

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.

---
 arch/arm/mach-omap2/am33xx/Kconfig | 3 +++
 board/ti/am335x/Kconfig            | 9 ---------
 2 files changed, 3 insertions(+), 9 deletions(-)
(quoted diff) +0 -0

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

arch/arm/mach-omap2/am33xx/Kconfig config TARGET_AM335X_EVM · line 20

Quoted 6 lines
arch/arm/mach-omap2/am33xx/Kconfig +3 -0
@@ -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.

Quoted 12 lines
arch/arm/mach-omap2/am33xx/Kconfig +0 -0
 	help
 	  This option specifies support for the AM335x
 	  GP and HS EVM development platforms. The AM335x
board/ti/am335x/Kconfig +0 -2
index a84e91b3dc56..97374bdc12ae 100644
@@ -1,14 +1,5 @@
 if TARGET_AM335X_EVM
 
-config SPL_ENV_SUPPORT
-	default y

board/ti/am335x/Kconfig line 5

Quoted 10 lines
board/ti/am335x/Kconfig +0 -7
-
-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 at denx.de

author
#4 lore raw

PATCH 2/5 am335x_evm: Switch to using imply keyword

Quoted 12 lines · Lukasz Majewski

Hi Tom,

Quoted 10 lines

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.

---
 arch/arm/mach-omap2/am33xx/Kconfig | 3 +++
 board/ti/am335x/Kconfig            | 9 ---------
 2 files changed, 3 insertions(+), 9 deletions(-)
Quoted 13 lines

arch/arm/mach-omap2/am33xx/Kconfig config TARGET_AM335X_EVM · line 20

Quoted 11 lines
(quoted diff) +0 -0

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

arch/arm/mach-omap2/am33xx/Kconfig +3 -0
@@ -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.

Quoted 1 line

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".

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170305/db79cade/attachment.sig>
author
#5 lore raw

PATCH 2/5 am335x_evm: Switch to using imply keyword

In reply to Tom Rini
Quoted 5 lines · Tom Rini

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170310/b36caad7/attachment.sig>
author
#6 lore raw

PATCH 3/5 TI: Migrate board/ti/common/Kconfig to imply

In reply to Tom Rini

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.

---
 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(-)
arch/arm/Kconfig +13 -0
index e84b74efb664..5e1838474e33 100644
@@ -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"
arch/arm/mach-omap2/am33xx/Kconfig +26 -10
index 5adcead185de..865a8d2d04ac 100644
@@ -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
arch/arm/mach-omap2/omap5/Kconfig +0 -36
index c5edc7c98d4d..4041adc9742e 100644
@@ -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
board/ti/common/Kconfig +0 -36
index 4980a047143e..adf73abc9358 100644
@@ -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
Signature · 1 line
1.9.1
author
#7 lore raw

PATCH 3/5 TI: Migrate board/ti/common/Kconfig to imply

Quoted 4 lines · Tom Rini

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170310/f889907e/attachment.sig>
author
#8 lore raw

PATCH 4/5 omap3: Migrate to using imply

In reply to Tom Rini

Move the default y options under arch/arm/mach-omap2/omap3/Kconfig to be using imply instead in arch/arm/Kconfig

---
 arch/arm/Kconfig                  | 11 +++++++++++
 arch/arm/mach-omap2/omap3/Kconfig | 33 ---------------------------------
 2 files changed, 11 insertions(+), 33 deletions(-)
arch/arm/Kconfig +11 -0
index 5e1838474e33..afb49fe5e5ef 100644
@@ -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"
arch/arm/mach-omap2/omap3/Kconfig +0 -33
index 4a7957fde85d..933fcba37cf5 100644
@@ -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
Signature · 1 line
1.9.1
author
#9 lore raw

PATCH 4/5 omap3: Migrate to using imply

Quoted 4 lines · Tom Rini

Move the default y options under arch/arm/mach-omap2/omap3/Kconfig to be using imply instead in arch/arm/Kconfig

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170310/17a66a8b/attachment.sig>
author
#10 lore raw

PATCH 5/5 omap4: Migrate to using imply

In reply to Tom Rini

Move the default y options under arch/arm/mach-omap2/omap4/Kconfig to be using imply instead in arch/arm/Kconfig

---
 arch/arm/Kconfig                  | 12 ++++++++++++
 arch/arm/mach-omap2/omap4/Kconfig | 36 ------------------------------------
 2 files changed, 12 insertions(+), 36 deletions(-)
arch/arm/Kconfig +12 -0
index afb49fe5e5ef..7022e2af847e 100644
@@ -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"
arch/arm/mach-omap2/omap4/Kconfig +0 -36
index 2091dd781512..49adb8ec5be3 100644
@@ -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
Signature · 1 line
1.9.1
author
#11 lore raw

PATCH 5/5 omap4: Migrate to using imply

Quoted 4 lines · Tom Rini

Move the default y options under arch/arm/mach-omap2/omap4/Kconfig to be using imply instead in arch/arm/Kconfig

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170310/6c72b391/attachment.sig>