Skip to contentSkip to conversation

cmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig

PATCH In review Masahiro Yamada 3 participants 5 messages Jul 9, 2018 – Aug 26, 2018 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig

It is not preferred to put SUNXI-specific code in the common place.

Change it to 'imply' property of ARCH_SUNXI.

---

 arch/arm/Kconfig | 1 +
 cmd/Kconfig      | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 7d394f2..a6ce155 100644
@@ -796,6 +796,7 @@ config ARCH_SUNXI
 	select USB_KEYBOARD if DISTRO_DEFAULTS
 	select USE_TINY_PRINTF
 	imply CMD_GPT
+	imply CMD_UBI if NAND
 	imply DISTRO_DEFAULTS
 	imply FAT_WRITE
 	imply OF_LIBFDT_OVERLAY
cmd/Kconfig +0 -1
index aec2090..159ebaa 100644
@@ -1792,7 +1792,6 @@ config CMD_UBI
 	select CRC32
 	select MTD_UBI
 	select CMD_MTDPARTS
-	default y if NAND_SUNXI
 	help
 	  UBI is a software layer above MTD layer which admits use of LVM-like
 	  logical volumes on top of MTD devices, hides some complexities of
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 cmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig

Quoted 1 line · Masahiro Yamada

It is not preferred to put SUNXI-specific code in the common place.

I think Tom has been saying the exact opposite a number of times, since there's some circular dependencies issues that arise when using imply.

Maxime

Quoted 36 lines

Change it to 'imply' property of ARCH_SUNXI.

---

 arch/arm/Kconfig | 1 +
 cmd/Kconfig      | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 7d394f2..a6ce155 100644
@@ -796,6 +796,7 @@ config ARCH_SUNXI
 	select USB_KEYBOARD if DISTRO_DEFAULTS
 	select USE_TINY_PRINTF
 	imply CMD_GPT
+	imply CMD_UBI if NAND
 	imply DISTRO_DEFAULTS
 	imply FAT_WRITE
 	imply OF_LIBFDT_OVERLAY
cmd/Kconfig +0 -1
index aec2090..159ebaa 100644
@@ -1792,7 +1792,6 @@ config CMD_UBI
 	select CRC32
 	select MTD_UBI
 	select CMD_MTDPARTS
-	default y if NAND_SUNXI
 	help
 	  UBI is a software layer above MTD layer which admits use of LVM-like
 	  logical volumes on top of MTD devices, hides some complexities of
Signature · 1 line
2.7.4
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180709/13796695/attachment.sig>
#2 lore raw

PATCH 1/1 cmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig

2018-07-09 16:20 GMT+09:00 Maxime Ripard <[email protected]>:

Quoted 6 lines · Masahiro Yamada
Quoted 1 line

It is not preferred to put SUNXI-specific code in the common place.

I think Tom has been saying the exact opposite a number of times, since there's some circular dependencies issues that arise when using imply.

Platforms select/imply necessary drivers or features. This is what we usually do.

ARCH_SUNXI already uses select / imply in arch/arm/Kconfig. (Also ARCH_SUNXI does so in arch/arm/mach-sunxi/Kconfig in Linux Kernel)

On the other hand, no drivers or features select / imply ARCH_SUNXI.

To sum up, select or imply should be used
in the following direction.

Platform ---(select or imply)---> features

If you follow this rule,
circular dependency will not happen.

Quoted 49 lines

Maxime

Quoted 34 lines

Change it to 'imply' property of ARCH_SUNXI.

---

 arch/arm/Kconfig | 1 +
 cmd/Kconfig      | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
index 7d394f2..a6ce155 100644
@@ -796,6 +796,7 @@ config ARCH_SUNXI
      select USB_KEYBOARD if DISTRO_DEFAULTS
      select USE_TINY_PRINTF
      imply CMD_GPT
+     imply CMD_UBI if NAND
      imply DISTRO_DEFAULTS
      imply FAT_WRITE
      imply OF_LIBFDT_OVERLAY
cmd/Kconfig +0 -2
index aec2090..159ebaa 100644
@@ -1792,7 +1792,6 @@ config CMD_UBI
      select CRC32
      select MTD_UBI
      select CMD_MTDPARTS
-     default y if NAND_SUNXI
      help
        UBI is a software layer above MTD layer which admits use of LVM-like
        logical volumes on top of MTD devices, hides some complexities of
--
Quoted 2 lines

2.7.4

--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw

PATCH 1/1 cmd: ubi: change 'default y' for SUNXI to 'imply' in Kconfig

Quoted 20 lines · Masahiro Yamada

2018-07-09 16:20 GMT+09:00 Maxime Ripard <[email protected]>:

Quoted 6 lines · Masahiro Yamada
Quoted 1 line

It is not preferred to put SUNXI-specific code in the common place.

I think Tom has been saying the exact opposite a number of times, since there's some circular dependencies issues that arise when using imply.

Platforms select/imply necessary drivers or features. This is what we usually do.

ARCH_SUNXI already uses select / imply in arch/arm/Kconfig. (Also ARCH_SUNXI does so in arch/arm/mach-sunxi/Kconfig in Linux Kernel)

On the other hand, no drivers or features select / imply ARCH_SUNXI.

Quoted 8 lines

To sum up, select or imply should be used
in the following direction.

   Platform  ---(select or imply)--->  features

If you follow this rule,
circular dependency will not happen.

I think what ends up being confusing about this is that we must do:

    default 0xDEADBEEF if ARCH_FOO

as we cannot:

    imply FOO_OPTION 0xDEADBEEF if FOO_DRIVER
Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180709/51c32a91/attachment.sig>
#4 lore raw
In reply to Masahiro Yamada
Quoted 5 lines · Masahiro Yamada

It is not preferred to put SUNXI-specific code in the common place.

Change it to 'imply' property of ARCH_SUNXI.

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: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180826/cf07916a/attachment.sig>