Makefile: Expand legacy (non-DM) driver warnings
RFC PATCH 1/1 Makefile: Expand legacy (non-DM) driver warnings
Expand warnings printed by Makefile after compile when legacy drivers are in use. These include:
- CONFIG_HAVE_BLOCK_DEVICE without CONFIG_BLK
- CONFIG_BOOTCOUNT_LIMIT without CONFIG_DM_BOOTCOUNT
- CONFIG_MTD without CONFIG_DM_MTD
- CONFIG_PHYLIB without CONFIG_DM_MDIO
- CONFIG_POWER, also without CONFIG_DM_PMIC
- Absence of CONFIG_RAM and CONFIG_SPL_RAM
Also replaced existing CONFIG_DM_SPI warning for consistency. Removed CONFIG_BLK requirement for CONFIG_DM_USB, as all USB devices not block devices.
--- Makefile | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-)
Makefile +67 -6
@@ -963,11 +963,6 @@ cmd_cfgcheck = $(srctree)/scripts/check-config.sh $2 \ all: $(ALL-y) ifeq ($(CONFIG_DEPRECATED),y) $(warning "You have deprecated configuration options enabled in your .config! Please check your configuration.") -ifeq ($(CONFIG_SPI),y) -ifneq ($(CONFIG_DM_SPI)$(CONFIG_OF_CONTROL),yy) - $(warning "The relevant config item with associated code will remove in v2019.07 release.") -endif -endif endif ifneq ($(CONFIG_DM),y) @echo >&2 "===================== WARNING ======================"
@@ -988,7 +983,7 @@ ifneq ($(CONFIG_DM_MMC)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy) endif endif ifeq ($(CONFIG_USB),y) -ifneq ($(CONFIG_DM_USB)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy) +ifneq ($(CONFIG_DM_USB)$(CONFIG_OF_CONTROL),yy) @echo >&2 "===================== WARNING ======================" @echo >&2 "This board does not use CONFIG_DM_USB. Please update" @echo >&2 "the board to use CONFIG_DM_USB before the v2019.07 release."
@@ -1046,6 +1041,16 @@ ifeq ($(CONFIG_OF_EMBED),y) @echo >&2 "See doc/README.fdt-control for more info." @echo >&2 "====================================================" endif +ifeq ($(CONFIG_SPI),y) +ifneq ($(CONFIG_DM_SPI)$(CONFIG_OF_CONTROL),yy) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_SPI without having CONFIG_DM_SPI" + @echo >&2 "enabled. Please update the board before the v2019.07 release." + @echo >&2 "Failure to update by the deadline may result in board removal." + @echo >&2 "See doc/driver-model/migration.rst for more info." + @echo >&2 "====================================================" +endif +endif ifeq ($(CONFIG_SPI_FLASH),y) ifneq ($(CONFIG_DM_SPI_FLASH)$(CONFIG_OF_CONTROL),yy) @echo >&2 "===================== WARNING ======================"
@@ -1078,6 +1083,62 @@ ifneq ($(CONFIG_DM_ETH),y) @echo >&2 "====================================================" endif endif +ifeq ($(CONFIG_HAVE_BLOCK_DEVICE),y) +ifneq ($(CONFIG_BLK),y) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_HAVE_BLOCK_DEVICE but does not" + @echo >&2 "have CONFIG_BLK enabled. This implies legacy block" + @echo >&2 "device support is enabled without driver model (DM)." + @echo >&2 "====================================================" +endif +endif +ifeq ($(CONFIG_BOOTCOUNT_LIMIT),y) +ifneq ($(CONFIG_DM_BOOTCOUNT),y) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_BOOTCOUNT_LIMIT without" + @echo >&2 "having CONFIG_DM_BOOTCOUNT enabled. This implies a" + @echo >&2 "legacy bootcounter without driver model (DM) support." + @echo >&2 "====================================================" +endif +endif +ifeq ($(CONFIG_MTD),y) +ifneq ($(CONFIG_DM_MTD),y) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_MTD without having CONFIG_DM_MTD" + @echo >&2 "enabled. This implies legacy MTD support, without" + @echo >&2 "driver model (DM)." + @echo >&2 "====================================================" +endif +endif +ifeq ($(CONFIG_PHYLIB),y) +ifneq ($(CONFIG_DM_MDIO),y) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_PHYLIB, without having" + @echo >&2 "CONFIG_DM_MDIO enabled. This implies legacy ethernet" + @echo >&2 "phy support, without driver model (DM)." + @echo >&2 "====================================================" +endif +endif +ifeq ($(CONFIG_POWER),y) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board uses CONFIG_POWER which enables the legacy" + @echo >&2 "pre-DM PMIC support." +ifneq ($(CONFIG_DM_PMIC),y) + @echo >&2 "CONFIG_DM_PMIC is disabled, therefore no driver model" + @echo >&2 "(DM) PMIC support is enabled." +endif + @echo >&2 "====================================================" +endif +ifneq ($(CONFIG_RAM),y) +ifneq ($(CONFIG_SPL_RAM),y) + @echo >&2 "===================== WARNING ======================" + @echo >&2 "This board does not use CONFIG_RAM or CONFIG_SPL_RAM" + @echo >&2 "This implies legacy memory configuration code is in" + @echo >&2 "use, without driver model (DM) support." + @echo >&2 "====================================================" +endif +endif + @# Check that this build does not use CONFIG options that we do not @# know about unless they are in Kconfig. All the existing CONFIG @# options are whitelisted, so new ones should not be added.
Signature · 1 line
2.25.1
RFC PATCH 1/1 Makefile: Expand legacy (non-DM) driver warnings
Hi Niel,
Quoted 15 lines · Niel Fourie
Expand warnings printed by
Makefileafter compile when legacy drivers are in use. These include:-
CONFIG_HAVE_BLOCK_DEVICEwithoutCONFIG_BLK
-CONFIG_BOOTCOUNT_LIMITwithoutCONFIG_DM_BOOTCOUNT
-CONFIG_MTDwithoutCONFIG_DM_MTD
-CONFIG_PHYLIBwithoutCONFIG_DM_MDIO
-CONFIG_POWER, also withoutCONFIG_DM_PMIC
- Absence ofCONFIG_RAMandCONFIG_SPL_RAMAlso replaced existing
CONFIG_DM_SPIwarning for consistency. RemovedCONFIG_BLKrequirement forCONFIG_DM_USB, as all USB devices not block devices.
Quoted 5 lines
Signed-off-by Niel Fourie <[email protected]>Cc Simon Glass <[email protected]>--- Makefile | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-)
Could we add instructions on what should be done? It seems a little unclear to me.
Regards,
Simon
RFC PATCH 1/1 Makefile: Expand legacy (non-DM) driver warnings
Hi Simon
Quoted 18 lines · Simon Glass
Hi Niel,
Quoted 15 lines · Niel Fourie
Expand warnings printed by
Makefileafter compile when legacy drivers are in use. These include:-
CONFIG_HAVE_BLOCK_DEVICEwithoutCONFIG_BLK
-CONFIG_BOOTCOUNT_LIMITwithoutCONFIG_DM_BOOTCOUNT
-CONFIG_MTDwithoutCONFIG_DM_MTD
-CONFIG_PHYLIBwithoutCONFIG_DM_MDIO
-CONFIG_POWER, also withoutCONFIG_DM_PMIC
- Absence ofCONFIG_RAMandCONFIG_SPL_RAMAlso replaced existing
CONFIG_DM_SPIwarning for consistency. RemovedCONFIG_BLKrequirement forCONFIG_DM_USB, as all USB devices not block devices.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Niel Fourie <[email protected]>Cc Simon Glass <[email protected]>--- Makefile | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-)Could we add instructions on what should be done? It seems a little unclear to me.
Yes, sure. I am still a little uncertain on how to correctly create a sensible RFC patch.
My question is basically: How useful would you consider having more of these warnings in the Makefile, if at all? I am the least certain of the last one with CONFIG_RAM and CONFIG_SPL_RAM.
For background, I explored the driver model and then I had a look at how much legacy there was still around. I found some further defines and conditions which could be turned into legacy warnings in the Makefile for some more visibility. Any even further such warnings would mostly involve checking the defines for the individual legacy drivers, which I do not really consider viable.
Testing of these warnings, especially automated, would be a challenge. I have a heavily butchered Sandbox build which triggers most of the legacy warnings in the Makefile, but I would not want to inflict it on anybody else.
Best regard,
Niel Fourie
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-21 Fax: +49-8142-66989-80 Email: lusus at denx.de
RFC PATCH 1/1 Makefile: Expand legacy (non-DM) driver warnings
Hi Niel,
Quoted 45 lines · Niel Fourie
Hi Simon
Quoted 18 lines · Simon Glass
Hi Niel,
Quoted 15 lines · Niel Fourie
Expand warnings printed by
Makefileafter compile when legacy drivers are in use. These include:-
CONFIG_HAVE_BLOCK_DEVICEwithoutCONFIG_BLK
-CONFIG_BOOTCOUNT_LIMITwithoutCONFIG_DM_BOOTCOUNT
-CONFIG_MTDwithoutCONFIG_DM_MTD
-CONFIG_PHYLIBwithoutCONFIG_DM_MDIO
-CONFIG_POWER, also withoutCONFIG_DM_PMIC
- Absence ofCONFIG_RAMandCONFIG_SPL_RAMAlso replaced existing
CONFIG_DM_SPIwarning for consistency. RemovedCONFIG_BLKrequirement forCONFIG_DM_USB, as all USB devices not block devices.Quoted 8 lines
Quoted 5 lines
Signed-off-by Niel Fourie <[email protected]>Cc Simon Glass <[email protected]>--- Makefile | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-)Could we add instructions on what should be done? It seems a little unclear to me.
Yes, sure. I am still a little uncertain on how to correctly create a sensible RFC patch.
My question is basically: How useful would you consider having more of these warnings in the
Makefile, if at all? I am the least certain of the last one withCONFIG_RAMandCONFIG_SPL_RAM.For background, I explored the driver model and then I had a look at how much legacy there was still around. I found some further defines and conditions which could be turned into legacy warnings in the
Makefilefor some more visibility. Any even further such warnings would mostly involve checking the defines for the individual legacy drivers, which I do not really consider viable.
Quoted 4 lines
Testing of these warnings, especially automated, would be a challenge. I have a heavily butchered Sandbox build which triggers most of the legacy warnings in the
Makefile, but I would not want to inflict it on anybody else.
I suggest creating a series that adds each warning, and cc trini.
Overall I think it is a good idea.
would love to see a test (maybe a shell/Python script called from
test/run?) that builds sandbox with various CONFIG options added/removed. There are a few combinations that it would be nice to add to that. For example building sandbox with NO_SDL=1 in addition to what you have above.
I'm thinking of something like:
make sandbox_defconfig
sed '/CONFIG_XXX/d' .config
echo CONFIG_YYY >>.config
etc.
make
So if you feel up to trying that, please do. Otherwise manual testing is good enough.
Regards,
Simon