Re: [U-Boot] [PATCH 1/2] RFC: dm: Kconfig: Move all driver model CONFIGs to Kconfig
On Tue, Dec 9, 2014 at 7:21 AM, Simon Glass s...@chromium.org wrote: Kconfig has been available for a while but there are still driver model CONFIG options. Move all of these to Kconfig. This patch isn't final - I need to wait until the SPL series can be fully applied, which is in turn waiting on some ARM SPL problems. So for now it is just a placeholder. But it needs to be sent out otherwise we will never move over. Signed-off-by: Simon Glass s...@chromium.org --- diff --git a/common/Kconfig b/common/Kconfig index fd84fa0..174bf4f 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -153,6 +153,29 @@ endmenu menu Device access commands +config CMD_DM + bool dm - Access to driver model information + depends on DM + default y + help + Provides access to driver model data structures and information, + such as a list of devices, list of uclasses and the state of each + device (e.g. activated). This is not required for operation, but + can be useful to see the state of driver model for debugging or + interest. + +config CMD_DEMO + bool demo - Demonstration commands for driver model + depends on DM + help + Procides a 'demo' command which can be used to play around with Provides + driver model. To use this properly you will need to enable one or + both of the demo devices (DM_DEMO_SHAPE and DM_DEMO_SIMPLE). + Otherwise you will always get an empty list of devices. The demo + devices are defined in the sandbox device tree, so the easiest + option is to use sandbox and pass the -d point to sandbox's + u-boot.dtb file. + config CMD_LOADB bool loadb help ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] RFC: dm: Kconfig: Move all driver model CONFIGs to Kconfig
Hi Masahiro, On 11 December 2014 at 10:37, Masahiro YAMADA yamad...@jp.panasonic.com wrote: Hi Simon, diff --git a/Kconfig b/Kconfig index 153ee2b..d4ca152 100644 --- a/Kconfig +++ b/Kconfig @@ -158,3 +158,5 @@ source drivers/Kconfig source fs/Kconfig source lib/Kconfig + +source test/dm/Kconfig Perhaps we might want test/Kconfig in the future. --- a/arch/arm/cpu/armv7/tegra-common/Kconfig +++ b/arch/arm/cpu/armv7/tegra-common/Kconfig @@ -20,6 +20,27 @@ endchoice config USE_PRIVATE_LIBGCC default y if SPL_BUILD +config DM + default y + +config SPL_DM + default y + +config DM_SERIAL + default y + +config DM_SPI + default y + +config DM_SPI_FLASH + default y + +config DM_I2C + default y + +config DM_GPIO + default y + Are all of these user-configurable? I mean, do Tegra boards work fine without CONFIG_DM_* ? I doubt it because you have already converted Tegra drivers. - Use select if the option is mandatory for that board - Use default y if the option is still optional, but recommended. OK will change this for tegra. source arch/arm/cpu/armv7/tegra20/Kconfig source arch/arm/cpu/armv7/tegra30/Kconfig source arch/arm/cpu/armv7/tegra114/Kconfig diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 3057325..1b4cbce 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -10,4 +10,43 @@ config SYS_BOARD config SYS_CONFIG_NAME default sandbox +config DM + default y + +config DM_GPIO + default y + +config DM_SERIAL + default y + +config CMD_DEMO + default y + +config CMD_DM + default y + +config DM_DEMO + default y + +config DM_DEMO_SIMPLE + default y + +config DM_DEMO_SHAPE + default y + +config DM_TEST + default y + +config DM_CROS_EC + default y + +config DM_SPI + default y + +config DM_SPI_FLASH + default y + +config DM_I2C + default y + Why do you like this syntax? - If the option is not user-configurable, use select - If the option is user-configurable and you want change the default value, add it to configs/sandbox_defconfig OK I'll split these into two types. diff --git a/board/samsung/goni/Kconfig b/board/samsung/goni/Kconfig index cbbf5a9..006e864 100644 --- a/board/samsung/goni/Kconfig +++ b/board/samsung/goni/Kconfig @@ -12,4 +12,13 @@ config SYS_SOC config SYS_CONFIG_NAME default s5p_goni +config DM + default y + +config DM_GPIO + default y + +config DM_SERIAL + default y + select or _defconfig Will go with select here. diff --git a/common/Kconfig b/common/Kconfig index fd84fa0..174bf4f 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -153,6 +153,29 @@ endmenu menu Device access commands +config CMD_DM + bool dm - Access to driver model information + depends on DM + default y + help + Provides access to driver model data structures and information, + such as a list of devices, list of uclasses and the state of each + device (e.g. activated). This is not required for operation, but + can be useful to see the state of driver model for debugging or + interest. + +config CMD_DEMO + bool demo - Demonstration commands for driver model + depends on DM + help + Procides a 'demo' command which can be used to play around with + driver model. To use this properly you will need to enable one or + both of the demo devices (DM_DEMO_SHAPE and DM_DEMO_SIMPLE). + Otherwise you will always get an empty list of devices. The demo + devices are defined in the sandbox device tree, so the easiest + option is to use sandbox and pass the -d point to sandbox's + u-boot.dtb file. + These seems rather Misc commands. They are driver-model-related though. config CMD_LOADB bool loadb help diff --git a/configs/Linksprite_pcDuino3_fdt_defconfig b/configs/Linksprite_pcDuino3_fdt_defconfig index a33f3a7..931b5dd 100644 --- a/configs/Linksprite_pcDuino3_fdt_defconfig +++ b/configs/Linksprite_pcDuino3_fdt_defconfig @@ -2,6 +2,8 @@ CONFIG_SPL=y CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER,SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPH(2),USB_EHCI CONFIG_FDTFILE=sun7i-a20-pcduino3.dtb CONFIG_DM=y +CONFIG_DM_GPIO=y +CONFIG_DM_SERIAL=y CONFIG_DEFAULT_DEVICE_TREE=sun7i-a20-pcduino3 CONFIG_OF_CONTROL=y CONFIG_OF_SEPARATE=y Here, you use _defconfig. What is the difference? This board shares config with others so I can't change the defaults. In fact this board still uses CONFIG_SYS_EXTRA_OPTIONS which is unfortunate a) because it should use device tree for GPIOs and b) because we are trying to deprecate these. diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index d2799dc..2ae2cc4
Re: [U-Boot] [PATCH 1/2] RFC: dm: Kconfig: Move all driver model CONFIGs to Kconfig
Hi Simon, diff --git a/Kconfig b/Kconfig index 153ee2b..d4ca152 100644 --- a/Kconfig +++ b/Kconfig @@ -158,3 +158,5 @@ source drivers/Kconfig source fs/Kconfig source lib/Kconfig + +source test/dm/Kconfig Perhaps we might want test/Kconfig in the future. --- a/arch/arm/cpu/armv7/tegra-common/Kconfig +++ b/arch/arm/cpu/armv7/tegra-common/Kconfig @@ -20,6 +20,27 @@ endchoice config USE_PRIVATE_LIBGCC default y if SPL_BUILD +config DM + default y + +config SPL_DM + default y + +config DM_SERIAL + default y + +config DM_SPI + default y + +config DM_SPI_FLASH + default y + +config DM_I2C + default y + +config DM_GPIO + default y + Are all of these user-configurable? I mean, do Tegra boards work fine without CONFIG_DM_* ? I doubt it because you have already converted Tegra drivers. - Use select if the option is mandatory for that board - Use default y if the option is still optional, but recommended. source arch/arm/cpu/armv7/tegra20/Kconfig source arch/arm/cpu/armv7/tegra30/Kconfig source arch/arm/cpu/armv7/tegra114/Kconfig diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 3057325..1b4cbce 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -10,4 +10,43 @@ config SYS_BOARD config SYS_CONFIG_NAME default sandbox +config DM + default y + +config DM_GPIO + default y + +config DM_SERIAL + default y + +config CMD_DEMO + default y + +config CMD_DM + default y + +config DM_DEMO + default y + +config DM_DEMO_SIMPLE + default y + +config DM_DEMO_SHAPE + default y + +config DM_TEST + default y + +config DM_CROS_EC + default y + +config DM_SPI + default y + +config DM_SPI_FLASH + default y + +config DM_I2C + default y + Why do you like this syntax? - If the option is not user-configurable, use select - If the option is user-configurable and you want change the default value, add it to configs/sandbox_defconfig diff --git a/board/samsung/goni/Kconfig b/board/samsung/goni/Kconfig index cbbf5a9..006e864 100644 --- a/board/samsung/goni/Kconfig +++ b/board/samsung/goni/Kconfig @@ -12,4 +12,13 @@ config SYS_SOC config SYS_CONFIG_NAME default s5p_goni +config DM + default y + +config DM_GPIO + default y + +config DM_SERIAL + default y + select or _defconfig diff --git a/common/Kconfig b/common/Kconfig index fd84fa0..174bf4f 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -153,6 +153,29 @@ endmenu menu Device access commands +config CMD_DM + bool dm - Access to driver model information + depends on DM + default y + help + Provides access to driver model data structures and information, + such as a list of devices, list of uclasses and the state of each + device (e.g. activated). This is not required for operation, but + can be useful to see the state of driver model for debugging or + interest. + +config CMD_DEMO + bool demo - Demonstration commands for driver model + depends on DM + help + Procides a 'demo' command which can be used to play around with + driver model. To use this properly you will need to enable one or + both of the demo devices (DM_DEMO_SHAPE and DM_DEMO_SIMPLE). + Otherwise you will always get an empty list of devices. The demo + devices are defined in the sandbox device tree, so the easiest + option is to use sandbox and pass the -d point to sandbox's + u-boot.dtb file. + These seems rather Misc commands. config CMD_LOADB bool loadb help diff --git a/configs/Linksprite_pcDuino3_fdt_defconfig b/configs/Linksprite_pcDuino3_fdt_defconfig index a33f3a7..931b5dd 100644 --- a/configs/Linksprite_pcDuino3_fdt_defconfig +++ b/configs/Linksprite_pcDuino3_fdt_defconfig @@ -2,6 +2,8 @@ CONFIG_SPL=y CONFIG_SYS_EXTRA_OPTIONS=AXP209_POWER,SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPH(2),USB_EHCI CONFIG_FDTFILE=sun7i-a20-pcduino3.dtb CONFIG_DM=y +CONFIG_DM_GPIO=y +CONFIG_DM_SERIAL=y CONFIG_DEFAULT_DEVICE_TREE=sun7i-a20-pcduino3 CONFIG_OF_CONTROL=y CONFIG_OF_SEPARATE=y Here, you use _defconfig. What is the difference? diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig index d2799dc..2ae2cc4 100644 --- a/drivers/core/Kconfig +++ b/drivers/core/Kconfig @@ -2,5 +2,123 @@ config DM bool Enable Driver Model depends on !SPL_BUILD help - This config option enables Driver Model. - To use legacy drivers, say N. + This config option enables Driver Model. This brings in the core + support, including scanning of platform data on start-up. If + CONFIG_OF_CONTROL is enabled, the device tree will be scanned also
[U-Boot] [PATCH 1/2] RFC: dm: Kconfig: Move all driver model CONFIGs to Kconfig
Kconfig has been available for a while but there are still driver model CONFIG options. Move all of these to Kconfig. This patch isn't final - I need to wait until the SPL series can be fully applied, which is in turn waiting on some ARM SPL problems. So for now it is just a placeholder. But it needs to be sent out otherwise we will never move over. Signed-off-by: Simon Glass s...@chromium.org --- Kconfig | 2 + arch/arm/Kconfig | 2 + arch/arm/cpu/arm1176/bcm2835/Kconfig | 12 +++ arch/arm/cpu/armv7/exynos/Kconfig | 15 arch/arm/cpu/armv7/tegra-common/Kconfig | 21 + arch/sandbox/Kconfig | 39 ++ arch/x86/Kconfig | 9 +++ board/isee/igep0033/Kconfig | 9 +++ board/isee/igep00x0/Kconfig | 9 +++ board/logicpd/am3517evm/Kconfig | 9 +++ board/logicpd/omap3som/Kconfig| 9 +++ board/logicpd/zoom1/Kconfig | 9 +++ board/overo/Kconfig | 9 +++ board/samsung/goni/Kconfig| 9 +++ board/samsung/smdk5420/Kconfig| 6 ++ board/samsung/smdkc100/Kconfig| 9 +++ board/ti/am335x/Kconfig | 10 +++ common/Kconfig| 23 ++ configs/Linksprite_pcDuino3_fdt_defconfig | 2 + configs/cm_fx6_defconfig | 3 + configs/mx6qsabreauto_defconfig | 2 + configs/mx6sabresd_spl_defconfig | 3 +- configs/omap3_beagle_defconfig| 3 + configs/omap3_pandora_defconfig | 3 + configs/snapper9260_defconfig | 3 + configs/snapper9g20_defconfig | 3 + doc/driver-model/spi-howto.txt| 4 +- drivers/Kconfig | 4 + drivers/core/Kconfig | 122 +- drivers/demo/Kconfig | 26 +++ drivers/thermal/Kconfig | 7 ++ include/config_defaults.h | 6 -- include/configs/cm_fx6.h | 4 - include/configs/exynos-common.h | 6 -- include/configs/mx6sabre_common.h | 2 - include/configs/peach-pi.h| 1 - include/configs/peach-pit.h | 1 - include/configs/rpi.h | 6 -- include/configs/s5p_goni.h| 4 - include/configs/sandbox.h | 13 include/configs/smdkc100.h| 4 - include/configs/snapper9260.h | 4 - include/configs/sunxi-common.h| 3 - include/configs/tegra-common.h| 9 --- include/configs/ti_am335x_common.h| 4 - include/configs/ti_omap3_common.h | 4 - include/configs/x86-common.h | 5 -- test/dm/Kconfig | 8 ++ 48 files changed, 399 insertions(+), 81 deletions(-) create mode 100644 arch/arm/cpu/arm1176/bcm2835/Kconfig create mode 100644 drivers/demo/Kconfig create mode 100644 drivers/thermal/Kconfig create mode 100644 test/dm/Kconfig diff --git a/Kconfig b/Kconfig index 153ee2b..d4ca152 100644 --- a/Kconfig +++ b/Kconfig @@ -158,3 +158,5 @@ source drivers/Kconfig source fs/Kconfig source lib/Kconfig + +source test/dm/Kconfig diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7a64b66..d46362c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -799,6 +799,8 @@ endchoice source arch/arm/cpu/arm926ejs/davinci/Kconfig +source arch/arm/cpu/arm1176/bcm2835/Kconfig + source arch/arm/cpu/armv7/exynos/Kconfig source arch/arm/cpu/armv7/highbank/Kconfig diff --git a/arch/arm/cpu/arm1176/bcm2835/Kconfig b/arch/arm/cpu/arm1176/bcm2835/Kconfig new file mode 100644 index 000..cb88664 --- /dev/null +++ b/arch/arm/cpu/arm1176/bcm2835/Kconfig @@ -0,0 +1,12 @@ +if TARGET_RPI_B + +config DM + default y + +config DM_SERIAL + default y + +config DM_GPIO + default y + +endif diff --git a/arch/arm/cpu/armv7/exynos/Kconfig b/arch/arm/cpu/armv7/exynos/Kconfig index f3eadb4..a5748ad 100644 --- a/arch/arm/cpu/armv7/exynos/Kconfig +++ b/arch/arm/cpu/armv7/exynos/Kconfig @@ -61,6 +61,21 @@ endchoice config SYS_SOC default exynos +config DM + default y + +config DM_SERIAL + default y + +config DM_SPI + default y + +config DM_SPI_FLASH + default y + +config DM_GPIO + default y + source board/samsung/smdkv310/Kconfig source board/samsung/trats/Kconfig source board/samsung/universal_c210/Kconfig diff --git a/arch/arm/cpu/armv7/tegra-common/Kconfig b/arch/arm/cpu/armv7/tegra-common/Kconfig index 1446452..898e86d 100644 --- a/arch/arm/cpu/armv7/tegra-common/Kconfig +++ b/arch/arm/cpu/armv7/tegra-common/Kconfig @@ -20,6 +20,27 @@ endchoice config USE_PRIVATE_LIBGCC default y if SPL_BUILD +config DM + default y + +config SPL_DM + default y +