Heiko Schocher | 2af8422 | 2010-02-10 08:03:21 +0100 | [diff] [blame] | 1 | To enable this feature just define CONFIG_HWCONFIG in your board |
| 2 | config file. |
| 3 | |
| 4 | This implements a simple hwconfig infrastructure: an |
| 5 | interface for software knobs to control hardware. |
| 6 | |
| 7 | This a is very simple implementation, i.e. it is implemented |
| 8 | via the `hwconfig' environment variable. Later we could write |
| 9 | some "hwconfig <enable|disable|list>" commands, ncurses |
| 10 | interface for Award BIOS-like interface, and frame-buffer |
| 11 | interface for AMI GUI[1] BIOS-like interface with mouse |
| 12 | support[2]. |
| 13 | |
| 14 | Current implementation details/limitations: |
| 15 | |
| 16 | 1. 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 | |
| 20 | 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^] | 21 | with the environment directly, there is no way to tell that |
Heiko Schocher | 2af8422 | 2010-02-10 08:03:21 +0100 | [diff] [blame] | 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 | |
| 26 | 3. 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 | |
| 35 | The purpose of this simple implementation is to refine the |
| 36 | internal API and then we can continue improving the user |
| 37 | experience by adding more mature interfaces, like a hwconfig |
| 38 | command with bells and whistles. Or not adding, if we feel |
| 39 | that 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. |