From: Wolfgang Denk Date: Tue, 22 Sep 2009 20:59:59 +0200 Subject: [U-Boot] [PATCH v1 3/3] mpc8536: Get the address of env on the SDCard In-Reply-To: <1252640445-7890-4-git-send-email-Mingkai.hu@freescale.com> References: <1252640445-7890-1-git-send-email-Mingkai.hu@freescale.com> <1252640445-7890-2-git-send-email-Mingkai.hu@freescale.com> <1252640445-7890-3-git-send-email-Mingkai.hu@freescale.com> <1252640445-7890-4-git-send-email-Mingkai.hu@freescale.com> Message-ID: <20090922185959.C749D832E864@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 Mingkai Hu, In message <1252640445-7890-4-git-send-email-Mingkai.hu@freescale.com> you wrote: > Both the save env and load env operation will call this function > to get the address of env on the SDCard, so the user can control > where to put the env freely. > > Also enable the functionlity of saving env variable to SDCard on > mpc8536 > > Signed-off-by: Mingkai Hu ... > +#if defined(CONFIG_MMC) > +/* > + * The environment variables are written to just after the u-boot image > + * on SDCard, so we must read the MBR to get the start address and code > + * length of the u-boot image, then calculate the address of the env. This seems to be broken by design. If your U-Boot image grows, it would overwrite the environment? Or am I missing something? 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 If A equals success, then the formula is A = X + Y + Z. X is work. Y is play. Z is keep your mouth shut. - Albert Einstein