[U-Boot] when stuff in a "common/" directory has no value?

i know i asked something similar to this a while back, but a followup question ...
i'm aware of the value of a vendor's "common/" directory where, under "board/<vendor>/", one can establish a common directory to avoid all sorts of silly duplication, but it seems like some of that content is no longer even accessed.
first, in the top-level Makefile, it seems the *proper* way to set up a common directory is with its own Makefile, as in:
... snip ... HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
libs-y += lib/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ ... snip ...
tackier alternatives appear to be, first, to have source files in a specific board directory "#include" source files from the common directory (hack! barf!). and, in some cases like under board/keymile/km83xx/, do something like this:
km83xx/Makefile:obj-y += km83xx.o ../common/common.o ../common/ivm.o km83xx_i2c.o
but i just noticed, in board/Marvell/common/, the source file memory.c, which seems totally unreferenced in any way. am i missing something? is there anything under /board/Marvell/* that, in some way, selects and compiles common/memory.c?
rday

On Sat, May 14, 2016 at 8:22 PM, Robert P. J. Day rpjday@crashcourse.ca wrote:
i know i asked something similar to this a while back, but a followup question ...
i'm aware of the value of a vendor's "common/" directory where, under "board/<vendor>/", one can establish a common directory to avoid all sorts of silly duplication, but it seems like some of that content is no longer even accessed.
first, in the top-level Makefile, it seems the *proper* way to set up a common directory is with its own Makefile, as in:
... snip ... HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
libs-y += lib/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ ... snip ...
tackier alternatives appear to be, first, to have source files in a specific board directory "#include" source files from the common directory (hack! barf!). and, in some cases like under board/keymile/km83xx/, do something like this:
km83xx/Makefile:obj-y += km83xx.o ../common/common.o ../common/ivm.o km83xx_i2c.o
but i just noticed, in board/Marvell/common/, the source file memory.c, which seems totally unreferenced in any way. am i missing something? is there anything under /board/Marvell/* that, in some way, selects and compiles common/memory.c?
board/Marvell/common/memory.c is one of two files that still "use" the ancient GTREGREAD macro, the last definition of which has been removed from the source with d92866; the only other file that uses it is drivers/rtc/ds1302.c, where I just stumbled across it.
So, to answer your question: nope, the file wouldn't even compile :-)
I'd say post a patch series that axes both files on grounds of using undefined ancient macros (if somebody wants to rescue the DS1302 driver, they're welcome, but I doubt it, since no board in the tree uses it, anyway).
Best regards, Mario

On Sun, 15 May 2016, Mario Six wrote:
On Sat, May 14, 2016 at 8:22 PM, Robert P. J. Day rpjday@crashcourse.ca wrote:
i know i asked something similar to this a while back, but a followup question ...
i'm aware of the value of a vendor's "common/" directory where, under "board/<vendor>/", one can establish a common directory to avoid all sorts of silly duplication, but it seems like some of that content is no longer even accessed.
first, in the top-level Makefile, it seems the *proper* way to set up a common directory is with its own Makefile, as in:
... snip ... HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
libs-y += lib/ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/ ... snip ...
tackier alternatives appear to be, first, to have source files in a specific board directory "#include" source files from the common directory (hack! barf!). and, in some cases like under board/keymile/km83xx/, do something like this:
km83xx/Makefile:obj-y += km83xx.o ../common/common.o ../common/ivm.o km83xx_i2c.o
but i just noticed, in board/Marvell/common/, the source file memory.c, which seems totally unreferenced in any way. am i missing something? is there anything under /board/Marvell/* that, in some way, selects and compiles common/memory.c?
board/Marvell/common/memory.c is one of two files that still "use" the ancient GTREGREAD macro, the last definition of which has been removed from the source with d92866; the only other file that uses it is drivers/rtc/ds1302.c, where I just stumbled across it.
So, to answer your question: nope, the file wouldn't even compile :-)
I'd say post a patch series that axes both files on grounds of using undefined ancient macros (if somebody wants to rescue the DS1302 driver, they're welcome, but I doubt it, since no board in the tree uses it, anyway).
from what i see, Marvell/common/ directory has a few dead files:
* memory.c * intel_flash.h * i2c.h
those last two had corresponding source files deleted in 03b004074fb641cffd7d2150505ef8afc13231bf. i'm starting to think there's not much in that Marvell/common/ directory that has much value.
rday

On Sun, 15 May 2016, Mario Six wrote:
... snip ...
board/Marvell/common/memory.c is one of two files that still "use" the ancient GTREGREAD macro, the last definition of which has been removed from the source with d92866; the only other file that uses it is drivers/rtc/ds1302.c, where I just stumbled across it.
So, to answer your question: nope, the file wouldn't even compile :-)
I'd say post a patch series that axes both files on grounds of using undefined ancient macros (if somebody wants to rescue the DS1302 driver, they're welcome, but I doubt it, since no board in the tree uses it, anyway).
unless i'm misreading, *everything* under Marvell/common/ can be removed ... as you say, memory.c is now unused. then i2c.h and intel_flash.h appear unnecessary, as their corresponding source files were removed in commit 03b00407:
arch/powerpc/cpu/74xx_7xx/Kconfig | 16 - arch/powerpc/cpu/74xx_7xx/start.S | 13 +- board/Marvell/common/flash.c | 1056 -------------------- board/Marvell/common/i2c.c | 521 ---------- board/Marvell/common/intel_flash.c | 253 ----- board/Marvell/common/misc.S | 235 ----- ...
serial.c describes itself as "serial support for the gal ev board", whose support appears to have been dropped. and without serial.c, i don't see anyone using either ns16550.h or ns16550.c, and at that point, the two files under include/, memory.h and pci.h, seem superfluous.
am i just misreading stuff?
rday
p.s. perhaps an obvious question, but should a vendor's common/ directory be referenced only from within that vendor's board directories? it would make no sense to me for other parts of the U-Boot tree to be pulling stuff out of some vendor's common/ directory.
participants (2)
-
Mario Six
-
Robert P. J. Day