From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Sun, 03 Oct 2010 20:27:13 +0200 Subject: [U-Boot] [RFC PATCH 1/2 v2] nand: allow delayed initialization In-Reply-To: <1286048840-1901-1-git-send-email-vapier@gentoo.org> References: <1285112736-15121-1-git-send-email-vapier@gentoo.org> <1286048840-1901-1-git-send-email-vapier@gentoo.org> Message-ID: <20101003182713.6562C1539A0@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Mike Frysinger, In message <1286048840-1901-1-git-send-email-vapier@gentoo.org> you wrote: > Many people like the current nand_init() behavior where it is always > initialized during boot and the flash size shown, but there are cases > where we are willing to forgo this niceness for speed/functionality. > So rather than change the default, introduce a delayed config option > people may enable. This way the nand is only poked when someone tries > to actually use it. > > Signed-off-by: Mike Frysinger > --- ... > extern void nand_init(void); > +#ifdef CONFIG_SYS_NAND_DELAYED_INIT > +# define nand_delayed_init() nand_init() > +#else > +# define nand_delayed_init() do { } while (0) > +#endif Would it not be esier to rename your nand_delayed_init() into nand_init(), and add a "#ifndef CONFIG_SYS_NAND_DELAYED_INIT" around the current call to nand_init()? Question: is there a risk of problems with boards that have the environment in NAND? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Don't think; let the machine do it for you!" - E. C. Berkeley