[U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c
Wolfgang Denk
wd at denx.de
Sun Jul 19 19:13:53 CEST 2009
Dear Alessandro Rubini,
In message <cover.1247999841.git.rubini at unipv.it> you wrote:
>
> To use soft_i2c I need to define some macros in the config file.
> Instead of writing hard numbers there I called the gpio functions, but
> the config file is inluded from asm sources as well. I don't think my
> approach is beautiful at all (both #ifndef __ASSEMBLY__ and #include
> "../board/"), but I didn't find a better solution.
Agreed. It's a bit intricate to get this done, but I don't see a
better way either.
> I would like to add a gpio command, and I've found no generic gpio
> stuff. Only one board (cm-bf527) has a gpio commands, but quite a few
> have similar commands to set leds or other bits. Is time ripe for a
> generic gpio driver with board-specific limits and operations? Would
> that be interesting for u-boot-next? Should I process with a board-specific
> gpio command by now?
Well, my opinion on that is a clear "yes, but..." :-)
Yes, some generic gpio framework would be nice - for example, if it
would allow us to get rid of the 14 largely similar "led.c" files, to
name just one.
On the other hand, the design of such a framework should be lean and
not necessarily try to cover 100% of all possible use cases - I'd
rather have a small and beautiful solution that covers 90% of the
cases and use board-specific exceptions where really needed, instead
of a fat thing that solves each and every problem but costs 50 kB.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The years of peak mental activity are undoubtedly between the ages of
four and eighteen. At four we know all the questions, at eighteen all
the answers.
More information about the U-Boot
mailing list