Remove MTD sub-directories from the root Makefile
Subsystems (3)
Miquel Raynal
maintainercover Remove MTD sub-directories from the root Makefile
Hello,
Two patches to do what we discussed with jagan a few weeks back:
remove MTD sub-directories from the root Makefile. The first patch has already been sent but as I could not see it in mainline (I can't remember when I sent this one) I decided to put it back here. The second one does simple moves, proof that everything looks ok is in Travis's report [1].
[1] https://travis-ci.org/miquelraynal/u-boot/builds/456683592
Thanks,
Miquèl
Miquel Raynal (2):
mtd: nand: let the raw NAND devices be compiled upon selection
Makefile: move MTD-related lines in coherent Makefiles
Makefile | 5 ----- drivers/Makefile | 1 + drivers/mtd/Makefile | 3 +++ drivers/mtd/nand/Makefile | 3 +++ 4 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
Miquel Raynal
maintainerPATCH 1/2 mtd: nand: let the raw NAND devices be compiled upon selection
Today way is to rely on CMD_NAND to be selected and from the root Makefile compile what is in drivers/mtd/nand/raw.
While this will work most of the time with decent configurations, it is better to also compile this subsystem upon simple request in the configuration. Otherwise, a user not selecting CMD_NAND but selecting NAND and any of the controller drivers will not see their build. Fix this weird situation by adding a single line in the nand/ directory Kconfig file.
--- drivers/mtd/nand/Makefile | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/nand/Makefile +1 -0
@@ -2,4 +2,5 @@ nandcore-objs := core.o bbt.o obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o +obj-$(CONFIG_NAND) += raw/ obj-$(CONFIG_MTD_SPI_NAND) += spi/
Signature · 1 line
2.17.1
PATCH 1/2 mtd: nand: let the raw NAND devices be compiled upon selection
Quoted 20 lines · On Sun, 18 Nov 2018 21:07:31 +0100 Miquel Raynal <[email protected]>…
Today way is to rely on
CMD_NANDto be selected and from the rootMakefilecompile what is indrivers/mtd/nand/raw.While this will work most of the time with decent configurations, it is better to also compile this subsystem upon simple request in the configuration. Otherwise, a user not selecting
CMD_NANDbut selecting NAND and any of the controller drivers will not see their build. Fix this weird situation by adding a single line in the nand/ directoryKconfigfile.Signed-off-by Miquel Raynal <[email protected]>--- drivers/mtd/nand/Makefile | 1 + 1 file changed, 1 insertion(+)drivers/mtd/nand/Makefile +0
-0
drivers/mtd/nand/Makefile line 5
Quoted 4 lines
drivers/mtd/nand/Makefile +1
-0@@ -2,4 +2,5 @@ nandcore-objs := core.o bbt.o obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o +obj-$(CONFIG_NAND) += raw/
Can we rename the Kconfig option into CONFIG_MTD_RAW_NAND to make it consistent with the other ones (should be done in a separate patch).
Also, this patch breaks the build: the raw/ dir will be included twice, and the linker will complain about duplicate symbols. Note that your second patch fixes the bug introduce here, but I guess this is the reason this patch was no applied/accepted when initially submitted.
Quoted 1 line
drivers/mtd/nand/Makefile +0
-0obj-$(CONFIG_MTD_SPI_NAND) += spi/
Miquel Raynal
maintainerPATCH 2/2 Makefile: move MTD-related lines in coherent Makefiles
In reply to Miquel RaynalA move has been started to move Makefile definitions out of the main root file and instead move these lines in their respective directory. This change does not change any logic already in place, it just moves lines to make the reading easier.
--- Makefile | 5 ----- drivers/Makefile | 1 + drivers/mtd/Makefile | 3 +++ drivers/mtd/nand/Makefile | 4 +++- 4 files changed, 7 insertions(+), 6 deletions(-)
Makefile +0 -5
@@ -688,11 +688,6 @@ libs-y += drivers/ libs-y += drivers/dma/ libs-y += drivers/gpio/ libs-y += drivers/i2c/ -libs-y += drivers/mtd/ -libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/ -libs-y += drivers/mtd/onenand/ -libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/ -libs-y += drivers/mtd/spi/ libs-y += drivers/net/ libs-y += drivers/net/phy/ libs-y += drivers/pci/
drivers/Makefile +1 -0
@@ -99,6 +99,7 @@ obj-$(CONFIG_QE) += qe/ obj-$(CONFIG_U_QE) += qe/ obj-y += mailbox/ obj-y += memory/ +obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/
drivers/mtd/Makefile +3 -0
@@ -20,3 +20,6 @@ obj-$(CONFIG_STM32_FLASH) += stm32_flash.o obj-$(CONFIG_RENESAS_RPC_HF) += renesas_rpc_hf.o obj-y += nand/ +obj-y += onenand/ +obj-y += spi/ +obj-$(CONFIG_CMD_UBI) += ubi/
drivers/mtd/nand/Makefile +3 -1
@@ -2,5 +2,7 @@ nandcore-objs := core.o bbt.o obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o -obj-$(CONFIG_NAND) += raw/ +ifneq (,$(findstring y,$(CONFIG_CMD_NAND)$(CONFIG_CMD_MTD))) +obj-y += raw/ +endif obj-$(CONFIG_MTD_SPI_NAND) += spi/
Signature · 1 line
2.17.1
PATCH 2/2 Makefile: move MTD-related lines in coherent Makefiles
Quoted 11 lines · On Sun, 18 Nov 2018 21:07:32 +0100 Miquel Raynal <[email protected]>…
A move has been started to move
Makefiledefinitions out of the main root file and instead move these lines in their respective directory. This change does not change any logic already in place, it just moves lines to make the reading easier.Signed-off-by Miquel Raynal <[email protected]>--- Makefile | 5 ----- drivers/Makefile | 1 + drivers/mtd/Makefile | 3 +++ drivers/mtd/nand/Makefile | 4 +++-
As mentioned in my review of patch 1, patch 1 changes should be moved there to keep things bisectable.
Quoted 46 lines
4 files changed, 7 insertions(+), 6 deletions(-)Makefile +0
-5@@ -688,11 +688,6 @@ libs-y += drivers/ libs-y += drivers/dma/ libs-y += drivers/gpio/ libs-y += drivers/i2c/ -libs-y += drivers/mtd/ -libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/raw/ -libs-y += drivers/mtd/onenand/ -libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/ -libs-y += drivers/mtd/spi/ libs-y += drivers/net/ libs-y += drivers/net/phy/ libs-y += drivers/pci/drivers/Makefile +1
-0@@ -99,6 +99,7 @@ obj-$(CONFIG_QE) += qe/ obj-$(CONFIG_U_QE) += qe/ obj-y += mailbox/ obj-y += memory/ +obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/drivers/mtd/Makefile +3
-0@@ -20,3 +20,6 @@ obj-$(CONFIG_STM32_FLASH) += stm32_flash.o obj-$(CONFIG_RENESAS_RPC_HF) += renesas_rpc_hf.o obj-y += nand/ +obj-y += onenand/ +obj-y += spi/ +obj-$(CONFIG_CMD_UBI) += ubi/drivers/mtd/nand/Makefile +0
-0
drivers/mtd/nand/Makefile line 8
Quoted 8 lines
drivers/mtd/nand/Makefile +3
-1@@ -2,5 +2,7 @@ nandcore-objs := core.o bbt.o obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o -obj-$(CONFIG_NAND) += raw/ +ifneq (,$(findstring y,$(CONFIG_CMD_NAND)$(CONFIG_CMD_MTD))) +obj-y += raw/ +endif obj-$(CONFIG_MTD_SPI_NAND) += spi/
Let's get rid of that too by adding a 'select NAND' to the CMD_NAND entry.
Also, there's no reason to select raw NAND support when CMD_MTD is selected.