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