[U-Boot] [PATCH 1/8] Add simple hwconfig infrastructure

Wolfgang Denk wd at denx.de
Thu Jul 16 22:26:40 CEST 2009


Dear Anton Vorontsov,

In message <20090609202527.GA20493 at oksana.dev.rtsoft.ru> you wrote:
> This patch implements simple hwconfig infrastructure: an
> interface for software knobs to control a hardware.
> 
> This is very simple implementation, i.e. it is implemented
> via `hwconfig' environment variable. Later we could write
> some "hwconfig <enable|disable|list>" commands, ncurses
> interface for Award BIOS-like interface, and frame-buffer
> interface for AMI GUI[1] BIOS-like interface with mouse
> support[2].
> 
> Current implementation details/limitations:
> 
> 1. Doesn't support options dependencies and mutual exclusion.
>    We can implement this by integrating apt-get[3] into the
>    u-boot. But I didn't bother yet.
> 
> 2. Since we don't implement hwconfig command, i.e. we're working
>    with the environement directly, there is no way to tell that
>    toggling a particular option will need a reboot to take
>    an effect. So, for now it's advised to always reboot the
>    target after modifying hwconfig variable.
> 
> 3. We support hwconfig options with arguments. For example,
> 
>    set hwconfig dr_usb:mode=peripheral,phy_type=ulpi
> 
>    That means:
>    - dr_usb - enable Dual-Role USB controller;
>    - dr_usb:mode=peripheral - USB in Function mode;
>    - dr_usb:phy_type=ulpi - USB should work with ULPI PHYs;
> 
> The purpose of this simple implementation is to define some
> internal API and then we can continue improving user experience
> by adding more mature interface, like hwconfig command with
> bells and whistles. Or not adding, if we feel that current
> interface fits its needs.
> 
> [1] http://en.wikipedia.org/wiki/American_Megatrends
> [2] Regarding ncurses and GUI with mouse support -- I'm just
>     kidding.
> [3] The comment regarding apt-get is also a joke, meaning that
>     dependency tracking could be non-trivial. For example, for
>     enabling HW feature X we may need to disable Y, and turn Z
>     into reduced mode (like RMII-only interface for ethernet,
>     no MII).
> 
>     It's quite trivial to implement simple cases though.
> 
> Signed-off-by: Anton Vorontsov <avorontsov at ru.mvista.com>
> ---
>  common/Makefile    |    1 +
>  common/hwconfig.c  |  210 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  include/hwconfig.h |   69 +++++++++++++++++
>  3 files changed, 280 insertions(+), 0 deletions(-)
>  create mode 100644 common/hwconfig.c
>  create mode 100644 include/hwconfig.h

Applied, thanks.

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 games have always  strengthened  us.  Death  becomes  a  familiar
pattern. We don't fear it as you do.
	-- Proconsul Marcus Claudius, "Bread and Circuses",
	   stardate 4041.2


More information about the U-Boot mailing list