Difference between revisions of "Save DTB to serial FLASH on AMC1 via U-Boot"
From DSignT Support Database
Line 47: | Line 47: | ||
<syntaxhighlight lang=c style="border:1px blue"> | <syntaxhighlight lang=c style="border:1px blue"> | ||
AMC1> sf probe | AMC1> sf probe | ||
− | SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB, | + | SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB, mapped at 30000000 |
− | |||
AMC1> | AMC1> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
==== '''''sf read ${fdtaddr} 0x150000 0x10000''''' ==== | ==== '''''sf read ${fdtaddr} 0x150000 0x10000''''' ==== | ||
Line 93: | Line 93: | ||
<br><br> | <br><br> | ||
== Save to serial FLASH == | == Save to serial FLASH == | ||
+ | === '''''sf probe''''' === | ||
+ | First step to access the QSPI FLASH is to probe for the SF. If not yet probed, execute probe command | ||
+ | <syntaxhighlight lang=c style="border:1px blue"> | ||
+ | AMC1> sf probe | ||
+ | SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB, mapped at 30000000 | ||
+ | AMC1> | ||
+ | </syntaxhighlight> | ||
+ | |||
=== Erase FLASH area === | === Erase FLASH area === | ||
'''''sf erase 0x120000 0x10000''''' | '''''sf erase 0x120000 0x10000''''' |
Revision as of 11:46, 16 November 2017
1 Load DTB
1.1 from TFTP server
Load a DTB image from TFTP server (correct network settings provided: AMC1_NetConfig.ser):
tftpboot ${fdtaddr} amc1.dtb
AMC1> tftpboot ${fdtaddr} amc1.dtb
link up on port 1, speed 1000, full duplex
Using cpsw device
TFTP from server 192.168.168.158; our IP address is 192.168.168.203
Filename 'amc1.dtb'.
Load address: 0x88000000
Loading: #########
641.6 KiB/s
done
Bytes transferred = 41451 (a1eb hex)
AMC1>
1.2 from USB memory stick
1.2.1 usb start
MC1> usb start
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
AMC1>
1.2.2 fatload usb 0:1 ${fdtaddr} amc1.dtb
AMC1> fatload usb 0:1 ${fdtaddr} amc1.dtb
reading amc1.dtb
41451 bytes read in 44 ms (919.9 KiB/s)
AMC1>
1.3 from serial FLASH
If a DTB was previously saved somewhere in serial FLASH (e.g as backup), this image can be loaded
1.3.1 sf probe
AMC1> sf probe
SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB, mapped at 30000000
AMC1>
1.3.2 sf read ${fdtaddr} 0x150000 0x10000
AMC1> sf read ${fdtaddr} 0x150000 0x10000
device 0 offset 0x150000, size 0x10000
SF: 65536 bytes @ 0x150000 Read: OK
AMC1>
2 Verify DTB
configure the fdt tool to point to the fdtaddr:
fdt addr ${fdtaddr}
If the DTB image is bad, you should get the error message:
AMC1> fdt addr ${fdtaddr}
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
AMC1>
In case a valid DTB is found on the address, nothing is printed and you can proceed to list more details. Enter fdt header command:
AMC1> fdt header
magic: 0xd00dfeed
totalsize: 0xa1eb (41451)
off_dt_struct: 0x38
off_dt_strings: 0x9a60
off_mem_rsvmap: 0x28
version: 17
last_comp_version: 16
boot_cpuid_phys: 0x0
size_dt_strings: 0x78b
size_dt_struct: 0x9a28
number mem_rsv: 0x0
AMC1>
3 Save to serial FLASH
3.1 sf probe
First step to access the QSPI FLASH is to probe for the SF. If not yet probed, execute probe command
AMC1> sf probe
SF: Detected w25q64cv with page size 256 Bytes, erase size 4 KiB, total 8 MiB, mapped at 30000000
AMC1>
3.2 Erase FLASH area
sf erase 0x120000 0x10000
AMC1> sf erase 0x120000 0x10000
SF: 65536 bytes @ 0x120000 Erased: OK
AMC1>
3.3 Write DTB to serial FLASH
sf write ${fdtaddr} 0x120000 0x10000
AMC1> sf write ${fdtaddr} 0x120000 0x10000
device 0 offset 0x120000, size 0x10000
SF: 65536 bytes @ 0x120000 Written: OK
AMC1>
4 Additional Tags
Serial FLASH mapping on AMC1 Serial FLASH programming via U-Boot on AMC1 Network settings for U-Boot on AMC1