From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bo Shen Date: Fri, 17 May 2013 11:04:14 +0800 Subject: [U-Boot] u-boot USB question In-Reply-To: References: <51958652.7030501@atmel.com> Message-ID: <51959E2E.1080408@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Lance, On 5/17/2013 10:20, Lance Beck wrote: > Thanks Bo! > > My thinking with fw_printev (setenv) was that I would use it to set the environment variables from our user space app. This way, we can control when the USB stick will be used for a kernel or rootfs upgrade. Any thoughts on show this could be scripted and run? We would like to be able to have a customer in the field do this without having to do anything but send a command from the user app, insert the USB drive and reboot. Maybe you can test reference in ---8>--- #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x82000000\0" \ "console=ttyO2,115200n8\0" \ "mmcdev=0\0" \ "mmcargs=setenv bootargs console=${console} " \ "root=/dev/mmcblk0p2 rw rootwait\0" \ "nandargs=setenv bootargs console=${console} " \ "root=/dev/mtdblock4 rw " \ "rootfstype=jffs2\0" \ "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \ "bootscript=echo Running bootscript from mmc ...; " \ "source ${loadaddr}\0" \ "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ "nandboot=echo Booting from nand ...; " \ "run nandargs; " \ "nand read ${loadaddr} 280000 400000; " \ "bootm ${loadaddr}\0" \ #define CONFIG_BOOTCOMMAND \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run loadbootscript; then " \ "run bootscript; " \ "else " \ "if run loaduimage; then " \ "run mmcboot; " \ "else run nandboot; " \ "fi; " \ "fi; " \ "else run nandboot; fi" ---<8--- Best Regards, Bo Shen