xref: /openbmc/u-boot/doc/README.hwconfig (revision 989ce049)
1To enable this feature just define CONFIG_HWCONFIG in your board
2config file.
3
4This implements a simple hwconfig infrastructure: an
5interface for software knobs to control hardware.
6
7This a is very simple implementation, i.e. it is implemented
8via the `hwconfig' environment variable. Later we could write
9some "hwconfig <enable|disable|list>" commands, ncurses
10interface for Award BIOS-like interface, and frame-buffer
11interface for AMI GUI[1] BIOS-like interface with mouse
12support[2].
13
14Current implementation details/limitations:
15
161. Doesn't support options dependencies and mutual exclusion.
17   We can implement this by integrating apt-get[3] into Das
18   U-Boot. But I haven't bothered yet.
19
202. Since we don't implement a hwconfig command, i.e. we're working
21   with the environment directly, there is no way to tell that
22   toggling a particular option will need a reboot to take
23   effect. So, for now it's advised to always reboot the
24   target after modifying the hwconfig variable.
25
263. We support hwconfig options with arguments. For example,
27
28   set hwconfig "dr_usb:mode=peripheral,phy_type=ulpi"
29
30   This selects three hwconfig options:
31   1. dr_usb - enable Dual-Role USB controller;
32   2. dr_usb_mode:peripheral - USB in Function mode;
33   3. dr_usb_phy_type:ulpi - USB should work with ULPI PHYs.
34
35The purpose of this simple implementation is to refine the
36internal API and then we can continue improving the user
37experience by adding more mature interfaces, like a hwconfig
38command with bells and whistles. Or not adding, if we feel
39that the current interface fits people's needs.
40
41[1] http://en.wikipedia.org/wiki/American_Megatrends
42[2] Regarding ncurses and GUI with mouse support -- I'm just
43    kidding.
44[3] The comment regarding apt-get is also a joke, meaning that
45    dependency tracking could be non-trivial. For example, for
46    enabling HW feature X we may need to disable Y, and turn Z
47    into reduced mode (like RMII-only interface for ethernet,
48    no MII).
49
50    It's quite trivial to implement simple cases though.
51