From: Wolfgang Denk Date: Fri, 18 May 2012 20:23:46 +0200 Subject: [U-Boot] [PATCH 5/6] cmd_nvedit.c: allow board-specific code before/after saving the environment In-Reply-To: <4FB67191.4030000@freescale.com> References: <1336170092-22538-1-git-send-email-timur@freescale.com> <1336170092-22538-5-git-send-email-timur@freescale.com> <201205140120.45712.vapier@gentoo.org> <4FB12E88.1050906@freescale.com> <20120517221808.2AEAE206271@gemini.denx.de> <4FB57D2D.3090902@freescale.com> <20120518112855.D7467202A22@gemini.denx.de> <4FB67191.4030000@freescale.com> Message-ID: <20120518182346.601FF202A22@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 Timur, In message <4FB67191.4030000@freescale.com> you wrote: > > > For example, what happens when I just use "md" or "itest *addr" or > > similar trying to read NOR flash while the display is on? > > The reason I make a big deal about saveenv is because I use an environment > variable ("video-mode") to enable video support. Once the console is > switched to the video display, the only way to switch it back to the > serial port is to delete the environment variable, save the environment, > and reboot. Please try to look over the rim of your plate. Even if you make "saveenv" work with some magic, your end users may have a zillion other ideas why they want to access the flash - for example, to store a copy of the environment created using "env export", or to reload such a saved profile using "env import". Why should their needs be ignored? > > Feel free to provide commands to switch mode, but don't lard the code > > with hooks here and there trying to fix what cannot be fixed. > > Is there a way to switch the console Sure. Delete the env var, switch mode to flash access, run saveenv, run reset. 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 Often it is fatal to live too long. - Racine