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

Anton Vorontsov avorontsov at ru.mvista.com
Fri May 1 01:12:20 CEST 2009


On Fri, May 01, 2009 at 12:31:54AM +0200, Wolfgang Denk wrote:
> Dear Anton,
> 
> In message <20090429215000.GA1092 at oksana.dev.rtsoft.ru> you wrote:
> > This patch implements simple hwconfig infrastructure: an
> > interface for software knobs to control a hardware.
> 
> Thanks a lot.
> 
> > 3. We support hwconfig options with arguments. For example,
> > 
> >    set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi
> > 
> >    There are three hwconfig options selected:
> >    1. dr_usb - enable Dual-Role USB controller;
> >    2. dr_usb_mode:peripheral - USB in Function mode;
> >    3. dr_usb_phy_type:ulpi - USB should work with ULPI PHYs.
> 
> That gives a lot of typing, which in turn results in lots of typing
> errors, which in this case are probably nasty to debug.
> 
> Suggestion: instead of
> 
> 	set hwconfig dr_usb,dr_usb_mode:peripheral,dr_usb_phy_type:ulpi
> 
> use:
> 
> 	set hwconfig dr_usb:mode=peripheral,phy_type=ulpi
> 
> What do you think?

At first sight this looks great. But where should we stop?
I mean, technically that is

dr_usb {
	mode = peripheral;
	phy_type = ulpi;
};

I wonder if we want multi-level nesting capability, i.e.

dr_usb {
	mode = peripheral;
	phy {
		type = ulpi;
		clock = 48;
	};
};

We'd type it this way:

=> set hwconfig "
> dr_usb {
> mode = peripheral;
> phy {
> type = ulpi;
> speed = 48;
> }
> }
> "

:-)

Or we can stop at one nesting level capability, just as you
describe. Your suggestion is quite easy to implement, but
full fledged parser is needed for the most generic case.


Thanks,

-- 
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2


More information about the U-Boot mailing list