This article describes the format of extlinux.conf used to boot Linux on Intel® SoC FPGA HPS (Hard Processor System).
Introduction
The latest (SoC EDS v20.1 or later) GSRD (Golden System Reference Design) SD card boot images contain a configuration file extlinux/extlinux.conf on the FAT partition with Linux boot options specified. extlinux/extlinux.conf, a configuration file containing Linux boot option specifications. This article describes the contents of this file.
The latest SD card configuration including extlinux.conf is also described in the following article.
Reference:
How to create SD card image for SoC FPGA boot – Macnica Altera FPGA Insights
Format of extlinux.conf
The extlinux.conf is a text file stored in the extlinux directory directly under the first partition (FAT) of the boot SD card. If extlinux/extlinux.conf is prepared on the FAT partition in advance, the contents of this text file will be applied at Linux Kernel boot time.
Below are the contents of extlinux.conf actually included in the SD card image for GSRD.
Example 1) extlinux.conf included in GSRD for Cyclone® V SoC
LABEL Linux Default
KERNEL ../zImage
FDT ../socfpga_cyclone5_socdk.dtb
APPEND root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8
Example 2) extlinux.conf included in GSRD for Arria® 10 SoC
LABEL Arria10 SOCDK SDMMC
KERNEL ../zImage
FDT ../socfpga_arria10_socdk_sdmmc.dtb
APPEND root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8
From the above example, we can see that extlinux.conf contains the LABEL, KERNEL, FDT, and APPEND specifications.
LABEL can be any name you like to distinguish the Linux system to be booted, and the contents of LABEL will be displayed when U-Boot processes extlinux.conf.
KERNEL is the location of the Linux Kernel image, relative to extlinux.conf.
FDT specifies the location of the Device Tree Blob (.dtb) file relative to extlinux.conf.
Finally, APPEND allows you to specify argument options to be passed to the Linux Kernel.
Tip: The format of extlinux.conf shown above is an example.
For example, if FDTDIR is used instead of FDT as shown below, it is possible to specify only the directory where the Device Tree Blob (.dtb) is stored without specifying the file name (in this case, the file name is specified in the U-Boot configuration option (In this case, the file name will be the one specified in the U-Boot configuration options).
LABEL Linux Default
KERNEL ../zImage
FDTDIR ..
APPEND root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8
Editing extlinux.conf
Since extlinux.conf is a text file, changes to the configuration can be made by simply opening the file with a text editor and rewriting the contents.
If you want to temporarily replace the device tree at Linux startup with a different file or change the arguments passed to the Linux Kernel, you can do so by rewriting extlinux.conf.
The conventional method of rewriting U-Boot environment variables using the setenv and editenv commands can also be used, but if you are not familiar with the U-Boot command operation, this method may be easier.
Boot log when using extlinux.conf
Below is a partial log of booting Linux using the SD card image for GSRD on the Cyclone® V SoC. The part shown in purple bold text is the content specified by extlinux.conf.
The "Kernel command line" after "Starting kernel ... In the log of "Kernel command line:" after the APPEND command line (see the log of "Kernel command line:"), it can be confirmed that the same value as specified by APPEND is passed as a command line argument of Linux Kernel.
Hit any key to stop autoboot: 2 1 0
:
:
mmc0 is current device
Scanning mmc 0:1... .
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
121 bytes read in 8 ms (14.6 KiB/s)
1: Linux Default
Retrieving file: /extlinux/.. /zImage
5048976 bytes read in 266 ms (18.1 MiB/s)
append: root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8
Retrieving file: /extlinux/... /socfpga_cyclone5_socdk.dtb
29016 bytes read in 11 ms (2.5 MiB/s)
## Flattened Device Tree blob at 02000000
Booting using the fdt blob at 0x2000000
Loading Device Tree to 09ff5000, end 09fff157 ... OK
Starting kernel ...
Deasserting all peripheral resets
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.23-altera (oe-user@oe-host) (gcc version 9.2.0 (GCC)) #1 SMP Thu Jun 25 18:23:21 UTC 2020
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: Altera SOCFPGA Cyclone V SoC Development Kit
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] percpu: Embedded 18 pages/cpu s44812 r8192 d20724 u73728
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260608
[ 0.000000] Kernel command line: root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8
Summary
I have the impression that there is not much information about extlinux.conf even if you check the general information on the Web. If you want to know more about it, it is recommended to check the documentation and source code under the U-Boot source tree.
References: EXTLINUX - Syslinux Wiki