[U-Boot] [PATCH 12/20] arm/km: add support for external switchconfiguration

Holger Brunck holger.brunck at keymile.com
Mon Jul 9 14:04:25 CEST 2012


Hi,

On 07/04/2012 11:20 AM, Prafulla Wadaskar wrote:
>>> Sure it would be great if we had the time and resources to
>> contribute a generic
>>> driver for these switches. Unfortunately it is not the case and we
>> have only
>>> developed a simple driver with limited features that suits our
>> current needs.
>>>
>>> Since we know it's very limited, we have intentionally chosen to put
>> in in our
>>> board/keymile directory so that it's obvious that it is (currently)
>> not intended
>>> to be used nor was it tested on other boards or with other switches.
>>
>> Personally I welcome such a driver submission to mainline as it can be
>> a
>> starting point for someone else later.
>>
>>> The question now is: does u-boot allow some boards (or family of
>> boards) to
>>> integrate some board codes or drivers ? It was until now our
>> understanding that
>>> u-boot allows this. This code definitely fits into this category.
>>
>> This is also my understanding and actually our source code has lots of
>> them and many people are thankful to find such code (if they are able
>> to
>> find it ;)
>>
>>> As for the generic driver, if someone contributes one (the current
>> driver can be
>>> used as a basis), we will be very happy to drop this code and use
>> the generic
>>> driver.
>>
>> Actually I would go even further and say that a generic driver can
>> only
>> be started when there are at least two or more users of the code.
>> One should probably think about not making too many short-sighted
>> assumptions when working on a driver but to think that one could
>> develop
>> a generic driver from one device only would be foolish.
>>
>> So Prafulla, can you please reconsider to add the driver?
> 
> Hi Detlev
> Clear NAK for this patch
> 
> Let's put it in drivers/net/phy/
> FYI: there are several drivers used by just one board,
> [prafulla at pe-dt061 u-boot-marvell.git (master)]$ vim drivers/net/phy/Makefile
> [prafulla at pe-dt061 u-boot-marvell.git (master)]$ grep -Irn "CONFIG_PHY_ATHEROS" include/configs/*
> include/configs/microblaze-generic.h:346:# define CONFIG_PHY_ATHEROS    1
> [prafulla at pe-dt061 u-boot-marvell.git (master)]$ vim drivers/net/phy/Makefile
> [prafulla at pe-dt061 u-boot-marvell.git (master)]$ grep -Irn "CONFIG_PHY_BROADCOM" include/configs/*
> include/configs/microblaze-generic.h:347:# define CONFIG_PHY_BROADCOM   1
> 
> Anyways peripheral driver should go in drivers/
>

yes there are maybe drivers which proof your concept, but there are many others
in the board related code which do the opposite.

But I think this topic should be discussed not in the context of this patch.
It's a general question. I 100% agree with Detlev's explanation. If a new very
limited HW driver is added to the repo I see good reasons to keep it in the
folder for the board. If a second user comes up and wants to enhance the driver
for his needs he can still move driver then. But if no other user for this
driver is there and maybe in the future the board needs to be removed because
it's broken it's much easier to remove _all_ related code when it's located in
one directory. If the code is spread over several directories it's much harder
to track.

Regards
Holger



More information about the U-Boot mailing list