Intel® SoC FPGA Embedded Development Suite
Support for SoC FPGA Software Development, SoC FPGA HPS Architecture, HPS SoC Boot and Configuration, Operating Systems
519 Discussions

Bloated Linux configuration for 64 bit HPS architectures

fletcher-wadsworth
272 Views

Is there any way to get an arm64 defconfig for SoC devices with an aarch64 processor in linux-socfpga? There is an socfpga_defconfig for 32 bit architectures (Arria/Cyclone) in the linux source tree, but the sole defconfig available in arch/arm64/config is bloated with configs for other boards and it's a huge pain to pare that down as a non-expert in the HPS configuration in Agilex/Stratix devices.

Labels (1)
0 Kudos
4 Replies
JitLoonL_Altera
Employee
218 Views

Here’s a script to extract a current kernel .config, minimize it using make savedefconfig, and create a custom defconfig you can reuse for your SoCFPGA ARM64 board (e.g., Agilex or Stratix 10).

Example reference script: 

#!/bin/bash

# Variables — customize these
ARCH=arm64
DEFCONFIG_NAME=socfpga_agilex_defconfig
KERNEL_SOURCE_DIR=~/linux-socfpga # Change to your kernel source path

# Step 1: Extract running config from target board
echo "[*] Extracting config from /proc/config.gz..."
zcat /proc/config.gz > config_from_target

# Step 2: Copy to kernel source tree
echo "[*] Copying to source tree..."
cp config_from_target $KERNEL_SOURCE_DIR/.config

# Step 3: Minimize it using savedefconfig
cd $KERNEL_SOURCE_DIR
make ARCH=$ARCH savedefconfig

# Step 4: Rename and store the result
cp defconfig arch/$ARCH/configs/$DEFCONFIG_NAME

echo "[✔] Defconfig created at: arch/$ARCH/configs/$DEFCONFIG_NAME"


This script gives you a clean starting point without the bloat of unrelated SoCs and boards.

0 Kudos
fletcher-wadsworth
208 Views

Unless I'm misunderstanding something about kernel configuration, that doesn't really help. I am working on deploying a Linux kernel on an Agilex device. Here are the steps as I see them:

1. Clone linux-socfpga and, with `ARCH=arm64`, run

make defconfig


2. Add custom configurations based on the particular needs for my kernel, such as including drivers for FPGA IP or adding debug features for use during development. This is done with a custom config fragment file and 

./scripts/kconfig/merge_config.sh -O ./ ./.config ./config-fragment-linux


3. Build the kernel:

make Image dtbs modules


4. Deploy the modules in the root filesystem (using a full SD card boot).
5. Deploy kernel image, dtb, other bootloader binaries, and FPGA bitstream onto SD card.

6. Boot the Agilex board.

 

At this point, I could use your script to extract the running config from the target board, bring it to the Linux source path, and use 

make savedefconfig

to extract the non-default configurations (i.e. those configs that differ from arch/arm64/config/defconfig). But I already know what the non-default configurations were, I set them in the config fragment. This doesn't solve my fundamental problem, which is that there are hundreds of configs set in arch/arm64/config/defconfig that don't apply to the Altera SoCs with Arm64 processors. For example, configs enabling different vendor platforms and peripherals

What I want is for there to be a defconfig in the Linux source tree which is specific for Altera boards with Arm64 HPS. There is such a config for Cyclone/Arria devices at arch/arm/config/socfpga_defconfig.

0 Kudos
JitLoonL_Altera
Employee
151 Views

Your understanding is excellent, and your process is well-structured. You're absolutely right in identifying the key issue: arch/arm64/configs/defconfig is too broad and includes configurations for platforms that are irrelevant to Intel SoCFPGA (like NXP, Broadcom, etc.).

You're also right that savedefconfig isn't a magic bullet — while it gives you only the non-default config options, it still starts from the global default (arch/arm64/configs/defconfig), which is the root of the problem you're trying to solve.

 

You want a clean, minimal defconfig just for Intel SoCFPGA ARM64 platforms (like Agilex, Stratix 10, etc.) — similar to arch/arm/configs/socfpga_defconfig that exists for the 32-bit ARM family.

Unfortunately, as of now: There is no upstream or Intel-maintained SoCFPGA-specific defconfig for ARM64 boards (like Agilex or Stratix 10).

Intel’s linux-socfpga fork assumes you start from defconfig + fragment, and doesn’t ship a dedicated socfpga_agilex_defconfig for arm64.

 

Your current approach is correct and you're on the right track by:

  • Using a fragment config to include only what you need

  • Building a custom defconfig based on your working config

  • Trimming with savedefconfig after boot to remove irrelevant noise

That script you wrote — automating extraction, cleanup, and placing a proper socfpga_agilex_defconfig — is exactly what Intel should provide but doesn’t.

Once you’ve confirmed your minimal config works, you can treat it as a private defconfig for your team or even contribute it upstream if desired.

0 Kudos
BoonBengT_Altera
Moderator
44 Views

Hi @fletcher-wadsworth,


Greetings, just checking in to see if there is any further doubts in regards to this matter.

Hope your doubts have been clarified.


Best Wishes

BB


0 Kudos
Reply