Build Linux For TSOM

I have Terasic SoC System on Module Evaluation KIT, and want to start with build everything from scratch for Linux side.

For that i have search a lot, but did not found exact document which can guide to build the u-boot,kernel,file system etc for TSOM board.

can anyone guide me to build the linux for TSOM?

The Tersaic SoM board uses a cyclone v device and as far as I know the hps in the SoC is the same for all the cyclone v devices.
If that’s correct you can use any guide for any cyclone v SoC development board (DE10 nano / std etc).

Here’s a guide for building a Linux image from scratch (without using any build tools like yocto or buoldroot)

And that’s kind of a build script project that uses yocto to build an image - it’s much easier to use this one and it has added tools for programming the FPGA and using the FPGA-HPS bridges from userspace, but I think that it’s harder to customize and it comes with too many tools and libs in the rootfs (it’s probably configurable but I didn’t use it that much)

There’s also the gsrd guide for cyclone v SoC of course:

And the only differences (that I can think of) between using the tsom and any other board used in those guides are:
The quartus project - that is different between the board because of different pin assignments and different hardware on the board that is used in the project (like LEDs and switches that in the gsrd guide)

Device tree - changes must match the qsys components that are connected to the HPS and their parameters (like address base, size and what kind of component it is)

Drivers - they would be the same as the ones in the guides but if you want to use IP cores in qsys that aren’t being used in the guides you would probably need to enable their matching drivers in the kernel configuration (and include them your device tree)

I have build FPGA design,bootloader,u-boot,boot-script,devicetree,Linux kernel,busy box root filesystem.
Now i tried to prepare micro SD card to run the board.
On Guest Ubuntu 18.04 i have created card image and flash to micro SD card partitions are as below

Disk /dev/sdb: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x19ae464f

Device     Boot  Start     End Sectors  Size Id Type
/dev/sdb1       524288 1048575  524288  256M  b W95 FAT32
/dev/sdb2         4096  524287  520192  254M 83 Linux
/dev/sdb3         2048    4095    2048    1M a2 unknown

[sudo mkfs.ext4 /dev/sdb2]

when i boot the TSOM from this image the filesystem mounts read only, kernel log showing error as below.

[    1.499806] Waiting for root device /dev/mmcblk0p2...
[    1.568870] mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.578638] mmc0: new high speed SDHC card at address aaaa
[    1.584588] mmcblk0: mmc0:aaaa JULIE 14.8 GiB 
[    1.593231]  mmcblk0: p1 p2 p3
[    1.608755] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.619318] EXT4-fs (mmcblk0p2): Filesystem with huge files cannot be mounted RDWR without CONFIG_LBDAF
[    1.631157] EXT2-fs (mmcblk0p2): error: couldn't mount because of unsupported optional features (2c0)
[    1.643487] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[    1.658029] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    1.666115] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    1.675671] devtmpfs: mounted
[    1.679024] Freeing unused kernel memory: 452K (c0785000 - c07f6000)
[    1.779724] EXT4-fs (mmcblk0p2): Filesystem with huge files cannot be mounted RDWR without CONFIG_LBDAF
[    1.789524] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered

Mounted root filesystem as read only. why this error and how to overcome this problem?

When i format the rootfs partition with ext2 and change in fstab ext2 for /dev/root then file system mounts as Read Write mode and works fine.

so is there any option in kernel to mount the ext4 partition for root filesystem.

current configuration is :


‘CONFIG_LBDAF’ needs to be enabled, this mounts the filesystem RW.