Skip to contentSkip to conversation

da850: Add instructions to copy AIS image to NAND

PATCH Superseded Axel Haslam 3 participants 4 messages Mar 17, 2017 – Mar 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 da850: Add instructions to copy AIS image to NAND

Add instructions to write an AIS image to NAND
by using the u-boot nand tools.

---
Changes in V2:
- add erase command before write
- Add write info when MTD partitions are defined

 board/davinci/da8xxevm/README.da850 | 41 +++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
board/davinci/da8xxevm/README.da850 +41 -0
index 29cb4ec..519267e 100644
@@ -47,6 +47,47 @@ U-Boot > sf erase 0 +320000
 U-Boot > tftp u-boot.ais
 U-Boot > sf write c0700000 0 $filesize
 
+Flashing the images to NAND
+===========================
+The AIS image can be written to NAND using the u-boot "nand" commands.
+
+Example:
+
+OMAPL138_LCDK requires the AIS image to be written to the second block of
+the NAND flash.
+
+From the "nand info" command we see that the second block would start at
+offset 0x20000:
+
+  U-Boot > nand info
+      sector size      128 KiB (0x20000)
+      Page size       2048 b
+
+From the tftp command we see that we need to copy 0x74908 bytes from
+memory address 0xc0700000 (0x75000 if we align a page of 2048):
+
+  U-Boot > tftp u-boot.ais
+      Load address: 0xc0700000
+      Bytes transferred = 477448 (74908 hex)
+
+The commands to write the image from memory to NAND would be:
+
+  U-Boot > nand erase 0x20000 0x75000
+  U-Boot > nand write 0xc0700000 0x20000 0x75000
+
+Alternatively, MTD partitions may be defined. Using "mtdparts" to
+conveniently have a bootloader partition starting at the second block
+(offset 0x20000):
+
+  setenv mtdids nand0=davinci_nand.0
+  setenv mtdparts mtdparts=davinci_nand.0:128k(bootenv),2m(bootloader)
+
+In this case the commands would be simplified to:
+
+  U-Boot > tftp u-boot.ais
+  U-Boot > nand erase.part bootloader
+  U-Boot > nand write 0xc0700000 bootloader
+
 Flashing the images to MMC
 ==========================
 If the boot pins are set to boot from mmc, the RBL will try to load the
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 1/1 da850: Add instructions to copy AIS image to NAND

Hi Axel,

Quoted 50 lines · Axel Haslam

Add instructions to write an AIS image to NAND
by using the u-boot nand tools.

---
Changes in V2:
- add erase command before write
- Add write info when MTD partitions are defined

 board/davinci/da8xxevm/README.da850 | 41 +++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
board/davinci/da8xxevm/README.da850 +30 -0
index 29cb4ec..519267e 100644
@@ -47,6 +47,47 @@ U-Boot > sf erase 0 +320000
 U-Boot > tftp u-boot.ais
 U-Boot > sf write c0700000 0 $filesize
 
+Flashing the images to NAND
+===========================
+The AIS image can be written to NAND using the u-boot "nand" commands.
+
+Example:
+
+OMAPL138_LCDK requires the AIS image to be written to the second block of
+the NAND flash.
+
+From the "nand info" command we see that the second block would start at
+offset 0x20000:
+
+  U-Boot > nand info
+      sector size      128 KiB (0x20000)
+      Page size       2048 b
+
+From the tftp command we see that we need to copy 0x74908 bytes from
+memory address 0xc0700000 (0x75000 if we align a page of 2048):
+
+  U-Boot > tftp u-boot.ais
+      Load address: 0xc0700000
+      Bytes transferred = 477448 (74908 hex)
+
+The commands to write the image from memory to NAND would be:
+
+  U-Boot > nand erase 0x20000 0x75000
+  U-Boot > nand write 0xc0700000 0x20000 0x75000
+
+Alternatively, MTD partitions may be defined. Using "mtdparts" to
+conveniently have a bootloader partition starting at the second block

board/davinci/da8xxevm/README.da850 U-Boot > sf erase 0 +320000 · line 89

Quoted 10 lines
board/davinci/da8xxevm/README.da850 +10 -0
+(offset 0x20000):
+
+  setenv mtdids nand0=davinci_nand.0
+  setenv mtdparts mtdparts=davinci_nand.0:128k(bootenv),2m(bootloader)
+
+In this case the commands would be simplified to:
+
+  U-Boot > tftp u-boot.ais
+  U-Boot > nand erase.part bootloader
+  U-Boot > nand write 0xc0700000 bootloader

Looks good to me now.

Perhaps the mtdparts setting above can be part of the default environment itself ? So the additional step of setting them up can be avoided. But that will be a separate patch.

Thanks,
Sekhar

#2 lore raw

PATCH v2 1/1 da850: Add instructions to copy AIS image to NAND

Quoted 66 lines · Sekhar Nori

Hi Axel,

Quoted 50 lines · Axel Haslam

Add instructions to write an AIS image to NAND
by using the u-boot nand tools.

---
Changes in V2:
- add erase command before write
- Add write info when MTD partitions are defined

 board/davinci/da8xxevm/README.da850 | 41 +++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
board/davinci/da8xxevm/README.da850 +30 -0
index 29cb4ec..519267e 100644
@@ -47,6 +47,47 @@ U-Boot > sf erase 0 +320000
 U-Boot > tftp u-boot.ais
 U-Boot > sf write c0700000 0 $filesize
 
+Flashing the images to NAND
+===========================
+The AIS image can be written to NAND using the u-boot "nand" commands.
+
+Example:
+
+OMAPL138_LCDK requires the AIS image to be written to the second block of
+the NAND flash.
+
+From the "nand info" command we see that the second block would start at
+offset 0x20000:
+
+  U-Boot > nand info
+      sector size      128 KiB (0x20000)
+      Page size       2048 b
+
+From the tftp command we see that we need to copy 0x74908 bytes from
+memory address 0xc0700000 (0x75000 if we align a page of 2048):
+
+  U-Boot > tftp u-boot.ais
+      Load address: 0xc0700000
+      Bytes transferred = 477448 (74908 hex)
+
+The commands to write the image from memory to NAND would be:
+
+  U-Boot > nand erase 0x20000 0x75000
+  U-Boot > nand write 0xc0700000 0x20000 0x75000
+
+Alternatively, MTD partitions may be defined. Using "mtdparts" to
+conveniently have a bootloader partition starting at the second block

board/davinci/da8xxevm/README.da850 U-Boot > sf erase 0 +320000 · line 89

Quoted 10 lines
board/davinci/da8xxevm/README.da850 +10 -0
+(offset 0x20000):
+
+  setenv mtdids nand0=davinci_nand.0
+  setenv mtdparts mtdparts=davinci_nand.0:128k(bootenv),2m(bootloader)
+
+In this case the commands would be simplified to:
+
+  U-Boot > tftp u-boot.ais
+  U-Boot > nand erase.part bootloader
+  U-Boot > nand write 0xc0700000 bootloader

Looks good to me now.

Quoted 3 lines

Perhaps the mtdparts setting above can be part of the default environment itself ? So the additional step of setting them up can be avoided. But that will be a separate patch.

Yes, agree. i will send a patch for that.
-Regards
Axel.

Quoted 4 lines

Thanks,
Sekhar

#3 lore raw

PATCH v2 1/1 da850: Add instructions to copy AIS image to NAND

In reply to Axel Haslam
Quoted 4 lines · ahaslam at baylibre.com

Add instructions to write an AIS image to NAND
by using the u-boot nand tools.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170321/3e2b7d3f/attachment.sig>