U-Boot: Difference between revisions
| (7 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
U-Boot is a bootloader. | U-Boot is a bootloader. | ||
== Where to load the Device Tree Blob? == | |||
The Device Tree Blob (DTB) should be loaded memory in a carefully chosen address. Indeed, the DTB can be overwritten by the decompressing kernel image. On ARM-based system, the address of the DTB is passed to the kernel through the register '''r2'''. To ensure the DTB will not be relocated by U-Boot and if the region where the DTB is is writeable, you can set '''fdt_high''' to 0xFFFFFFFF. '''fdt_high''' defines the highest address the DTB could be relocated by U-Boot. It could be useful if the kernel has a limited dedicated memory. | |||
== Communicate with the SST26VF032B == | fdt addr + fdt resize | ||
bi_boot_params | |||
== Communicate with the SST26VF032B<ref>http://ww1.microchip.com/downloads/en/DeviceDoc/20005218B.pdf</ref> == | |||
The SST26VF032B contains Block-Protection feature. By default, at reset, all blocks are write-protected and some blocks are read-protected. To be able to write and read into that memory, you have to disable the Block-Protection feature using the WBPR instruction (which requires WREN to be executed before). | |||
{| class="wikitable" | {| class="wikitable" | ||
!Instruction | !Instruction | ||
! | !Description | ||
!Command cycle | !Command cycle | ||
!Bitlen | !Bitlen | ||
| Line 12: | Line 19: | ||
|- | |- | ||
|JEDEC-ID | |JEDEC-ID | ||
| | |JEDEC-ID Read | ||
|9FH | |9FH | ||
|32 | |32 | ||
| Line 20: | Line 27: | ||
|- | |- | ||
|RDSR | |RDSR | ||
| | |Read the Status Register | ||
|05H | |05H | ||
|16 | |16 | ||
|p. 10 | |p. 10 | ||
|U-Boot > sspi 0x7100 16 | |U-Boot > sspi 0x7100 16 0500 | ||
0002 | |||
|- | |- | ||
|RDCR | |RDCR | ||
| | | | ||
Read the Configuration Register | |||
|35H | |35H | ||
|16 | |16 | ||
| | | | ||
| | |U-Boot > sspi 0x7100 16 3500 | ||
0008 | |||
|- | |- | ||
|WREN | |WREN | ||
| | |Write-Enable: required for ULBPR, PP, ... | ||
|06H | |06H | ||
|8 | |8 | ||
| Line 43: | Line 54: | ||
|- | |- | ||
|WBPR | |WBPR | ||
| | |Write Block-Protection Register | ||
|42H | |42H | ||
|152 | |152 | ||
| | |p. 36 | ||
| | |U-Boot > sspi 0x7100 8 06 | ||
00 | |||
U-Boot > sspi 0x7100 152 42000000000000000000000000000000000000 | |||
00000000000000000000000000000000000000 | |||
|- | |- | ||
|RBPR | |RBPR | ||
| | |Read Block-Protection Register | ||
|72H | |72H | ||
|152 | |152 | ||
| | |p. 35 | ||
| | |U-Boot > sspi 0x7100 152 72000000000000000000000000000000000000 | ||
00FFFFFFFFFFFFFFFFFFFF0000000000000000 | |||
|- | |- | ||
|ULBPR | |ULBPR | ||
| | |Global Block-Protection Unlock | ||
|98H | |98H | ||
|8 | |8 | ||
| | |p. 39 | ||
| | |U-Boot > sspi 0x7100 8 06 | ||
00 | |||
U-Boot > sspi 0x7100 8 98 | |||
00 | |||
|- | |- | ||
|Read (40MHz) | |Read (40MHz) | ||
| | | | ||
|03H | |03H | ||
| | |N/A | ||
|p. 15 | |p. 15 | ||
|Read at offset 0 32 bits | |Read at offset 0 32 bits | ||
U-Boot > sspi 0x7100 64 0300000000000000 | U-Boot > sspi 0x7100 64 0300000000000000 | ||
00000000FFFFFFFF | 00000000FFFFFFFF | ||
|- | |- | ||
| Line 76: | Line 99: | ||
|20H | |20H | ||
|32 | |32 | ||
|p. 25 | |||
| | | | ||
|- | |||
|PP | |||
|Page Program | |||
|02H | |||
|N/A | |||
|p. 28 | |||
| | | | ||
|} | |} | ||
== References == | |||
Latest revision as of 05:52, 18 July 2016
U-Boot is a bootloader.
Where to load the Device Tree Blob?
The Device Tree Blob (DTB) should be loaded memory in a carefully chosen address. Indeed, the DTB can be overwritten by the decompressing kernel image. On ARM-based system, the address of the DTB is passed to the kernel through the register r2. To ensure the DTB will not be relocated by U-Boot and if the region where the DTB is is writeable, you can set fdt_high to 0xFFFFFFFF. fdt_high defines the highest address the DTB could be relocated by U-Boot. It could be useful if the kernel has a limited dedicated memory.
fdt addr + fdt resize
bi_boot_params
Communicate with the SST26VF032B[1]
The SST26VF032B contains Block-Protection feature. By default, at reset, all blocks are write-protected and some blocks are read-protected. To be able to write and read into that memory, you have to disable the Block-Protection feature using the WBPR instruction (which requires WREN to be executed before).
| Instruction | Description | Command cycle | Bitlen | Source | Example |
|---|---|---|---|---|---|
| JEDEC-ID | JEDEC-ID Read | 9FH | 32 | U-Boot > sspi 0x7100 32 9f000000
00BF2642 | |
| RDSR | Read the Status Register | 05H | 16 | p. 10 | U-Boot > sspi 0x7100 16 0500
0002 |
| RDCR |
Read the Configuration Register |
35H | 16 | U-Boot > sspi 0x7100 16 3500
0008 | |
| WREN | Write-Enable: required for ULBPR, PP, ... | 06H | 8 | p. 33 | U-Boot > sspi 0x7100 8 06
00 |
| WBPR | Write Block-Protection Register | 42H | 152 | p. 36 | U-Boot > sspi 0x7100 8 06
00 U-Boot > sspi 0x7100 152 42000000000000000000000000000000000000 00000000000000000000000000000000000000 |
| RBPR | Read Block-Protection Register | 72H | 152 | p. 35 | U-Boot > sspi 0x7100 152 72000000000000000000000000000000000000
00FFFFFFFFFFFFFFFFFFFF0000000000000000 |
| ULBPR | Global Block-Protection Unlock | 98H | 8 | p. 39 | U-Boot > sspi 0x7100 8 06
00 U-Boot > sspi 0x7100 8 98 00 |
| Read (40MHz) | 03H | N/A | p. 15 | Read at offset 0 32 bits
U-Boot > sspi 0x7100 64 0300000000000000 00000000FFFFFFFF | |
| SE | Sector-Erase (change to 1) a 4KiB sector | 20H | 32 | p. 25 | |
| PP | Page Program | 02H | N/A | p. 28 |