Forum Discussion

s-harada's avatar
s-harada
Icon for New Contributor rankNew Contributor
2 hours ago

Questions About Custom Linux Device Tree Handling in the Agilex 5 GSRD kas Build Environment

Hello,
I have two questions regarding the following kas build environment:
https://github.com/altera-fpga/agilex5e-ed-gsrd/tree/main/dk-a5e065bb32aea-enablement/baseline-a55/software/yocto_linux

  1. Custom Device Tree Application in FPGA Configuration First Mode
    My understanding is that FPGA_ENABLE_CORE_PGM, defined in kas.yml, is used to enable or disable FPGA core configuration from HPS, effectively selecting between HPS Boot First and FPGA Configuration First modes.
    However, when FPGA_ENABLE_CORE_PGM is set to 0 (FPGA Configuration First), I observed that the custom Linux Device Tree specified by CUSTOM_LINUX_DTS_FILE in machine.yml is not applied.
    After investigating the build flow, it appears that the kernel recipe (linux-socfpga-lts_%.bbappend) checks the value of FPGA_CORE_PGM_ENABLE (which corresponds to FPGA_ENABLE_CORE_PGM) to determine whether a custom Linux Device Tree should be applied.
    On the other hand, kas.yml also defines CUSTOM_LINUX_DEVICE_TREE, which seems to be the variable specifically intended to control custom Linux Device Tree usage.
    Therefore, I would have expected the kernel recipe to check CUSTOM_LINUX_DT (which corresponds to CUSTOM_LINUX_DEVICE_TREE) rather than FPGA_CORE_PGM_ENABLE.

    As an experiment, I made the following changes:
    1) Modified the conditional check in the kernel recipe
    Before: FPGA_CORE_PGM_ENABLE
    After: CUSTOM_LINUX_DT
    2) Set the following in kas.yml
    CUSTOM_LINUX_DEVICE_TREE = "1"

    With these changes, the custom Linux Device Tree was successfully applied even when using FPGA Configuration First mode.

    Could you please confirm whether the current implementation is intentional?
    If this behavior is by design, could you also explain the reason for using FPGA_CORE_PGM_ENABLE to determine whether a custom Linux Device Tree should be applied?

  2. Definition Location of CUSTOM_LINUX_DTS_FILE
    While reviewing the README located under:
    meta-custom/recipes-kernel/linux/device-tree/

    I found the following statement:
    "FIT image - kernel.itb will use the custom device tree in CUSTOM_LINUX_DTS_FILE if defined in kas/bsp.yml, else it will use Linux Kernel in-tree device tree defined using LINUX_DTS_FILE in kas/bsp.yml."

    However, I observed that defining CUSTOM_LINUX_DTS_FILE in kas/bsp.yml does not seem to have any effect.
    After further investigation, I noticed that CUSTOM_LINUX_DTS_FILE is already defined by default in kas/machine.yml, and it appears that the value from machine.yml is actually being used.
    In addition, LINUX_DTS_FILE is also defined by default in kas/machine.yml.

    Based on these observations, I am wondering whether the README might contain a typo, and that the references to kas/bsp.yml should actually be kas/machine.yml.
    Could you please confirm whether this understanding is correct?

Thank you for your time and support.

No RepliesBe the first to reply