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