From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Wed, 19 Jan 2011 09:53:29 +0100 Subject: [U-Boot] [PATCH v3] powerpc/8xxx: Add new hwconfig APIs to address early parsing used by DDR init In-Reply-To: <1295391047-10952-1-git-send-email-galak@kernel.crashing.org> References: <20110118222653.CBF5D36C@gemini.denx.de> <1295391047-10952-1-git-send-email-galak@kernel.crashing.org> Message-ID: <20110119085329.9BA1D2FC@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 Kumar Gala, In message <1295391047-10952-1-git-send-email-galak@kernel.crashing.org> you wrote: > There are several users of the hwconfig APIs (8xxx DDR) before we have > the environment properly setup. This causes issues because of the > numerous ways the environment might be accessed because of the > non-volatile memory it might be stored in. Additionally the access > might be so early that memory isn't even properly setup for us. > > Towards resolving these issues we provide versions of all the hwconfig > APIs that can be passed in a buffer to parse and leave it to the caller > to determine how to allocate and populate the buffer. > > We use the _f naming convention for these new APIs even though they are > perfectly useable after relocation and the environment being ready. > > We also now warn if the non-f APIs are called before the environment is > ready to allow users to address the issues. > > Finally, we convert the 8xxx DDR code to utilize the new APIs to > hopefully address the issue once and for all. We have the 8xxx DDR code > create a buffer on the stack and populate it via getenv_f(). > > Signed-off-by: Kumar Gala > --- > * Reworked __hwconfig to not require an additional local var per WD's comments > > arch/powerpc/cpu/mpc8xxx/ddr/options.c | 78 ++++++++++++++++++++++------- > common/hwconfig.c | 86 ++++++++++++++++--------------- > include/hwconfig.h | 68 +++++++++++++++++++------ > 3 files changed, 154 insertions(+), 78 deletions(-) Acked-by: Wolfgang Denk Please pull through 8xxx repo. 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 [Braddock:] Mr. Churchill, you are drunk. [Churchill:] And you madam, are ugly. But I shall be sober tomorrow.