From: Bastian Germann Date: Thu, 7 Jun 2018 11:07:44 +0200 Subject: [U-Boot] [PATCH] lsxl: Add documentation how to flash an unmodified board In-Reply-To: References: <20180606093856.1170-1-bastian.germann@fishpost.de> Message-ID: <4a4cf150-f423-9e5b-ade1-b2e34e9597fd@fishpost.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Michael, I tried to use the MTD layer but that did not work even though I set the flash in the Linux device tree read-write. I cannot remember the output exactly as it is some time ago that I tried (with Debian). Cheers, Bastian Am 07.06.2018 um 09:49 schrieb Michael Walle: > Am 6. Juni 2018 11:38:56 MESZ schrieb Bastian Germann : >> Signed-off-by: Bastian Germann >> --- >> board/buffalo/lsxl/README | 17 ++++++++++++++++- >> 1 file changed, 16 insertions(+), 1 deletion(-) >> >> diff --git a/board/buffalo/lsxl/README b/board/buffalo/lsxl/README >> index ef5ed42880..3ede081776 100644 >> --- a/board/buffalo/lsxl/README >> +++ b/board/buffalo/lsxl/README >> @@ -111,7 +111,7 @@ rescue >> See `Rescue Mode` for more information. >> >> You can change the boot source by setting the 'bootsource' variable to >> the >> -corresponding value. Please note, that the restore_env script will the >> the >> +corresponding value. Please note, that the restore_env script will set >> the >> bootsource back to 'legacy'. > > haha had to read twice to see the difference. nice catch. > >> >> @@ -137,3 +137,18 @@ you already have a bootloader CLI, you can use the >> following commands: >> bootp ${loadaddr} u-boot.kwb >> sf erase 0 +${filelen} >> sf write 0 ${fileaddr} ${filesize} >> + >> +As netconsole is unavailable in the Buffalo U-Boot version, you can >> only >> +flash via bootloader CLI if you modify the board. If you do not want >> to do >> +that, you can flash from GNU/Linux with the flashrom utility. You have >> to >> +have the flash chip available as a spidev device, which you can get by >> +enabling Linux configuration option CONFIG_SPI_SPIDEV and adding a >> spidev >> +compatible device in the device tree available in the Linux source >> tree as >> +arch/arm/boot/dts/kirkwood-lsxl.dtsi >> + >> +The flashing is then done with the following commands: >> + >> + flashrom -r dump.bin -p linux_spi:dev=/dev/spidev0.0 >> + truncate -s 384K u-boot.kwb >> + dd conv=notrunc if=u-boot.kwb of=dump.bin >> + flashrom -w dump.bin -p linux_spi:dev=/dev/spidev0.0 > > i guess there is no need for flashrom and raw spi access if you're using the MTD layer (flash_erase /dev/mtd0 0 0 and dd to /dev/mtd0). any advantages of using flash_rom? > > -michael >