8 using the spi flash for os 6.5.9 booting an os – Kontron COMe-cP2020 User Manual
Page 97
www.kontron.com
COMe-P2020 User Guide
97
After the volume is mounted, its contents can be listed:
or a file loaded, in this case “kernel.bin” to address 0x100000:
6.5.8
Using the SPI Flash for OS
The SPI flash for OS is not used together with a file system, it is used raw. It does not contain any U-Boot components and is
completely free for user usage. It's primary function is to store VxWorks® boot ROMs and images.
Before making any changes to the flashes, ensure that the correct flash is selected. To select the SPI flash for OS, execute
the “sf probe 3” command (SPI flash for OS is routed to the processor’s SPI controller chip select 3).
The SPI flash must be erased before it is programmed. To achieve this, use the “sf erase” command.
To program an image to the SPI flash, it must first be loaded to memory from an arbitrary source. It can then be pro-
grammed with the “sf write” command.
Example: Programming a test file “test.img” from an SD card using the “ext2” file system:
This example assumes that the size of “test.img” is less than 64 kB. The environment variable “filesize” is set automatically
when a file is loaded to memory and can be used for convenience here.
6.5.9
Booting an OS
6.5.9.1
Booting Linux
To boot Linux, at least a kernel image and a FDT (Flattened Device Tree) must be loaded to memory. Optionally, an “initrd”
can be loaded.
Furthermore, a command line must be prepared in the environment variable “bootargs”.
The boot itself is initiated with the “bootm” command.
To simplify the setup of the board, three predefined scripts are already programmed in the default environment:
•
“nfsboot” to boot from a tftp server and mount the root over NFS
•
“nandboot” to boot from the NAND flash and also mount it as root
•
“sdboot” to boot from a SD Card and also mount it as root
•
“multi_img_boot” to boot from the multi-image provided. The multi-image consists of a FDT, a kernel and a rootfs
=> ubifsls
=>
=> ubifsload 100000 kernel.bin
=>
=> mmc rescan 0
=> ext2load mmc 0 100000 test.img
=> sf probe 3
=> sf erase 0 10000
=> sf write 100000 0 ${filesize}