This step shows how to create the SD card. As mentioned in page "Board bring-up overview for TEI0022" this step is for SD card setup which should be done in the following steps:
The section "Generate SD card partitions and filesystems" describes the process to create the needed partitions and filesystems on the SD card via the Linux tool fdisk. Section "Copy files to partitions" shows the moving from files on the partitions with Windows.
The Intel Cyclone V needs a specific SD card structure which should be realized within the following steps in a linux system. Therefore, the structure shall be introduced in the next subsection. Then, in the second subsection the partitions shall be generated. After that, the filesystems shall be created. Then, in the last subsection, the modification shall be written on the SD card.
The SD card needs three partitions, one vfat, one linux and one 0xA2 partition. The following table shows the target SD card partition which shall be generated in the next section.
# | Partition | Purpose | Size |
---|---|---|---|
1 | W95 FAT32 (LBA) | (U-Boot, )Linux Kernel, Device Tree Blob | > 20 MB |
2 | Linux ext(2/3 or 4) | Linux Root Filesystem | > 150 MB to 2 GB |
3 | 0xA2 | Preloader(, U-Boot) | >= 2 MB |
To generate the several partitions, the next steps are necessary:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 120G 0 disk ├─sda1 8:1 0 112G 0 part / ├─sda2 8:2 0 1K 0 part └─sda5 8:5 0 8G 0 part [SWAP] sdc 8:32 1 7,2G 0 disk └─sdc1 8:33 1 1M 0 part sr0 11:0 1 1024M 0 rom RM = Removable → sdc is the SD card with one partition sdc1 |
Creating the partition #1:
Creating the partition #2:
Creating the partition #3:
Writing SD card modifications:
The previos settings are not written to the SD card at this point. To write the changes to the card the next steps are necessary. Therefore, if the wrong identifier is selected, the following commands can destroy the host system! Be aware to use the correct identifier! Furthermore, deleting the existing partitions on the card destroys the saved information! If the information are needed save them before continuing!
The filesystems are created with the linux tool mkfs.
After preparing the SD card for booting, this section describes the copy process for the relevant files with a Linux and a Windows operating system (OS):
vFAT Partition 1:
ext3 Partition 2:
0xA2 Partition 3:
After doing these steps, the SD card can be inserted into the board and the boot process can be started. If booting runs into linux, the procedure is done.
////////////////////////
Informationsfragmente
mount/umount muss noch beachtet werden!!!!!
Was soll das folgende heißen?
Unknown - partition for u-boot config script and how to setup (uboot.scr)
The main u-boot environment can be saved with saveenv
vfat-partition: optional - Linux-Config-Script / main u-boot instead a2-partition
Before writing data to the partitions, unmount the device
sudo umount /dev/sdX*
and plage the SD card in and out of the card reader.
The W95 Fat32 partition needs to be formated.
sudo umount /dev/sdX*
sudo mkfs -t vfat /dev/sdXp (p=partition number, needs to be 1)
After the operation finishes, use a data browser to copy the
Linux kernel / zImage(.bin) and the device tree blob / socfpga.dtb.
u-boot.img muss auf diese Partition!!!!
The ext(2/3/4) partition is formated via:
sudo mkfs.ext3 /dev/sdXp (p=partition number, should be 2)
After the operation finishes, use a data browser to copy the Linux root file system / rootfs to it.
An other approach is needed for a compressed root file system. Befor decompressing a ... .tar.gz file to the SD card, it needs to be mounted to a mounting point. This requires an existing folder to write to. Usually these folder is placed inside the mnt folder, for example: sudo mkdir /mnt/card (create mounting point folder)
Mount it:
sudo mount /dev/sdXp /mnt/card (p=partition number, should be 2)
Extract the ... .tar.gz file to the partition:
sudo tar -xvf pathToCompressed.tar.gz -C /mnt/card/ (x=decompress v=show progress -C=extract to)
sudo sync (imported, empty all buffers)
//////////////////////// SOC EDA Installation für Linux !!!!!!!!!!!!!!
This partition needs no formatting, the data needs to be copied with the tool
alt-boot-disk-util .
The tool should be in the folder:
\intelFPGA\18.1\embedded\host_tools\altera\diskutils
Copy the SPL u-boot.bin and the Main u-boot.img to it, change to the directory:
cd pathToAlt-boot-disk-util (cd=change directory)
and run:
sudo pathToAlt-boot-disk-util -p preloaderImage.bin -b mainU-boot.img -a write /dev/sdX (the tool finds the a2 partition)
Lastly, unmount the Sd card ( sudo umount /dev/sdX* ) and test it.
(The tool dd can also be used to write the preloader - sudo dd if=pathToSplUboot of=/dev/sdXp seek=0 bs=64k conv=fsync)