[U-Boot] [U-Boot, 3/9] nand: add a hw specific subcommand to the nand command.
Scott Wood
scottwood at freescale.com
Wed Aug 3 17:56:27 CEST 2011
On Wed, 3 Aug 2011 07:14:51 +0200
Heiko Schocher <hs at denx.de> wrote:
> Hello Scott,
>
> Scott Wood wrote:
> > Sorry for the delay, didn't see this the first time around -- just
> > noticed it in patchwork.
>
> No problem. Thanks for the review!
>
> > On Sat, Jul 16, 2011 at 12:06:44AM -0000, Heiko Schocher wrote:
> >> @@ -739,6 +743,10 @@ U_BOOT_CMD(
> >> "nand env.oob set off|partition - set enviromnent offset\n"
> >> "nand env.oob get - get environment offset"
> >> #endif
> >> +#ifdef CONFIG_CMD_NAND_HWFUNC
> >> + "\n"
> >> + "nand hwfunc " CONFIG_CMD_NAND_HWFUNC "\n"
> >> +#endif
> >
> > Why not just define hardware-specific commands at whatever scope they
> > makes sense (board code, controller driver, etc.), rather than add a
> > generic hook here?
>
> Hmm... because if I define a hw specific command for example at
> soc scope, it is not a nand subcommand ... and I like to have all
> nand commands (I use it for switching between different read/write
> functions) accessable under "nand ..." from the u-boot shell ...
> I don;t like to have all over the code randomised some nand commands ...
What if there are multiple such commands? You'd end up with "nand hwfunc
foo <args>", which is getting a bit unwieldy. Having only one might
actually be worse: what does a plain "nand hwfunc" do?
What if there are multiple commands, but which belong in different places
(e.g. one defined by the board, one defined by the controller driver)?
-Scott
More information about the U-Boot
mailing list