From: Wolfgang Denk Date: Sun, 03 Oct 2010 23:40:32 +0200 Subject: [U-Boot] [RFC PATCH 1/2 v2] nand: allow delayed initialization In-Reply-To: <201010031632.47732.vapier@gentoo.org> References: <1285112736-15121-1-git-send-email-vapier@gentoo.org> <1286048840-1901-1-git-send-email-vapier@gentoo.org> <20101003182713.6562C1539A0@gemini.denx.de> <201010031632.47732.vapier@gentoo.org> Message-ID: <20101003214032.E901A1539A0@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 <201010031632.47732.vapier@gentoo.org> you wrote: > > > 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()? > > nand_init() cant handle being called multiple times. and i need to add more > nand_init() points that only apply to when things are delayed. so when > delayed init is not enabled (the default), there is no change in compiled code > size. Well, you have this in your new nand_init() code: + static uint8_t initialized; + if (initialized) + return; + initialized = 1; Why cannot we call nand_init() multiple times, then? > > Question: is there a risk of problems with boards that have the > > environment in NAND? > > that's why my patch adds delayed init points to the major nand env entry > points. my understanding is that these must be called before the env > read/write funcs may be called. OK, just wanted to make sure. 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 "Everybody is talking about the weather but nobody does anything about it." - Mark Twain