Skip to contentSkip to conversation

lsxl: Add documentation how to flash an unmodified board

PATCH New Michael Walle 2 participants 3 messages Jun 7, 2018 – Jun 12, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 lsxl: Add documentation how to flash an unmodified board

Am 6. Juni 2018 11:38:56 MESZ schrieb Bastian Germann <[email protected]>:

Quoted 12 lines

---
board/buffalo/lsxl/README | 17 ++++++++++++++++-

1 file changed, 16 insertions(+), 1 deletion(-)
board/buffalo/lsxl/README +0 -0
index ef5ed42880..3ede081776 100644
@@ -111,7 +111,7 @@ rescue
  See `Rescue Mode` for more information.
 
Quoted 7 lines

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.

Quoted 18 lines
board/buffalo/lsxl/README +0 -0
@@ -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}

board/buffalo/lsxl/README +2 -0
+
+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

board/buffalo/lsxl/README +2 -0
+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

board/buffalo/lsxl/README

Quoted 8 lines
board/buffalo/lsxl/README +8 -0
+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

#2 lore raw

PATCH 1/1 lsxl: Add documentation how to flash an unmodified board

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:

Quoted 54 lines

Am 6. Juni 2018 11:38:56 MESZ schrieb Bastian Germann <[email protected]>:

Quoted 12 lines

---
board/buffalo/lsxl/README | 17 ++++++++++++++++-

1 file changed, 16 insertions(+), 1 deletion(-)
board/buffalo/lsxl/README +0 -0
index ef5ed42880..3ede081776 100644
@@ -111,7 +111,7 @@ rescue
  See `Rescue Mode` for more information.
 
Quoted 7 lines

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.

Quoted 18 lines
board/buffalo/lsxl/README +0 -0
@@ -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}

board/buffalo/lsxl/README +2 -0
+
+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

board/buffalo/lsxl/README +2 -0
+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

board/buffalo/lsxl/README

Quoted 8 lines
board/buffalo/lsxl/README +8 -0
+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

#3 lore raw

PATCH 1/1 lsxl: Add documentation how to flash an unmodified board

Am 2018-06-07 11:07, schrieb Bastian Germann:

Quoted 14 lines

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

Quoted 4 lines
Quoted 4 lines

+ 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

Hi Bastian,

ok I see. I'm fine with this. But one remaining question. Why do you truncate to 384KiB? The upstream bootloader has its environment in the last sector, ie 448KiB.

-michael