Skip to content

SONiC support for BMC cards based on Aspeed AST2720#24898

Merged
yxieca merged 19 commits intosonic-net:masterfrom
nexthop-ai:bmc-ast2720-arm64
Mar 6, 2026
Merged

SONiC support for BMC cards based on Aspeed AST2720#24898
yxieca merged 19 commits intosonic-net:masterfrom
nexthop-ai:bmc-ast2720-arm64

Conversation

@chinmoy-nexthop
Copy link
Contributor

@chinmoy-nexthop chinmoy-nexthop commented Dec 18, 2025

Why I did it

We need to be able to run SONIC on BMC cards based on AST2720 (ARM64 SOC)

How I did it

  • New Aspeed platform for ARM64 architecture
  • Kernel drivers merged via separate PR to sonic-linux-kernel repo.
  • Build infrastructure: platform/aspeed + device/{aspeed, nexthop ...}
  • Single sonic-aspeed-arm64.bin target image across all vendors using
    this SOC
  • Initial platform infrastructure under platform/aspeed and
    device/{aspeed, nexthop...} directories
  • SONiC installer support with single partition and
    multiple directory-based installs along with updating U-Boot environment
    variables for proper boot management
  • Ability for vendors to bundle their card specific packages, kernel modules
    etc to the image and install them at run time (first boot) using the existing
    SONiC lazy install infra.
  • Removed many unwanted dockers and .debs not relevant to the BMC platform

How to verify it

Which release branch to backport (provide reason below if selected)

  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chinmoy-nexthop chinmoy-nexthop changed the title Changes to support compilation of a SONIC image to be loaded to Aspeed AST2720 eval board Support for SONiC image compilation and deployment on Aspeed AST2720 eval board Dec 19, 2025
@chinmoy-nexthop chinmoy-nexthop changed the title Support for SONiC image compilation and deployment on Aspeed AST2720 eval board [WIP] Support for SONiC image compilation and deployment on Aspeed AST2720 eval board Dec 19, 2025
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

…eval board

   Platform Introduction:
     • New Aspeed platform for ARM64 architecture
     • Kernel drivers via src/sonic-linux-kernel (separate PR)
     • Build infrastructure: platform/aspeed + device/aspeed → sonic-aspeed.bin target
     • eMMC installation tooling with ext4 image creation scripts

   Installation & Image Management:
     • Initial platform infrastructure under platform/aspeed and device/aspeed directories
     • SONiC installer-based approach with single partition and multiple directory-based
       installs (replacing two-partition setup)
     • eMMC image download support via HTTP/SCP with flashing capabilities
     • U-Boot environment variable configuration for proper boot management
     • Fixed sonic-installer for bootonce logic and image creation

   System Services & Configuration:
     • New sonic-bmc-platform-aspeed debian package for BMC initialization and management
     • Reorganized systemd services: added/removed/masked units as needed
     • Enhanced service dependencies (config-topology, config-setup, etc.)

   Build & Packaging:
     • Modernized Debian packaging for debhelper-compat 13 compatibility
     • Rust stable version 1.86 for build stability
     • Multi-distribution support: Trixie and Bookworm
     • Database Docker container support for BMC

   Hardware Monitoring & Services:
     • Platform support for fan, temperature sensors, thermal monitoring, reboot cause, and
       watchdog
     • GNMI service auto-start on BMC boot with ASIC dependencies removed
     • New bmcdb database type (similar to dpudb) to avoid BMP_STATE_DB dependencies

Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca requested a review from saiarcot895 January 5, 2026 17:11
Copy link

@nats-nokia nats-nokia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Chinmoy – we are also building and using the AST2700 eval board to load SONIC build. We would like to leverage your commit but there are several files that are using the FIT implementation rather than a UEFI implementation. We would like the scripts to support a UEFI installation. Are you planning to add UEFI support?

@lguohan @yxieca

# Aspeed BMC platform: Filter services for BMC use case
if [[ $CONFIGURED_PLATFORM == aspeed ]]; then
# Show original service count
ORIGINAL_COUNT=$(wc -l < $GENERATED_SERVICE_FILE)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build error is observed.

+ sudo rm -f syslog-counter_1.0.0_arm64.deb
+ [[ aspeed == aspeed ]]
++ wc -l
./sonic_debian_extension.sh: line 1288: ./fsroot-aspeed/etc/sonic/generated_services.conf: Permission denied
+ ORIGINAL_COUNT=
+ clean_sys

This line requires sudo to resolve
ORIGINAL_COUNT=$(sudo bash -c "wc -l < $GENERATED_SERVICE_FILE")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nats-nokia , thank you for the feedback. somehow missed notification earlier. We’ll look into this and provide an update soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, adding sudo would improve consistency and help safeguard against potential umask changes. Thank you for pointing this out.

It was not identified earlier because, the file is created using sudo tee (for example, lines 413 and 418), which results in a root owned file with default permissions of 644 (rw-r--r--). The ubuntu user falls under the “others” category and therefore has read permission .However, if a stricter umask were in effect (for example, 077), the file would be created with permission 600 (owner-only), and the command would fail without sudo. We will push the change.

[05:01:53] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  ls -l fsroot-aspeed/etc/sonic/generated_services.conf
-rw-r--r-- 1 root root 433 Jan 12 15:53 fsroot-aspeed/etc/sonic/generated_services.conf
[05:02:43] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  wc -l < fsroot-aspeed/etc/sonic/generated_services.conf
19
[05:03:14] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  sudo bash -c "wc -l < fsroot-aspeed/etc/sonic/generated_services.conf"
19
[05:03:49] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  whoami
ubuntu
[05:04:36] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  groups
ubuntu adm dialout cdrom floppy sudo audio dip video plugdev netdev lxd docker
[05:04:40] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  sudo -n true
[05:04:53] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed)  
$  umask
0002
[05:08:53] ubuntu@ip-172-31-7-82:~/private-sonic-buildimage (chinmoy-aspeed) 
$  sudo sh -c 'umask' <===== Created with this umask
0022

Minor fix: adding missing 'sudo'
  - adding sudo would improve consistency and
    help safeguard against potential umask changes.

Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@@ -0,0 +1,2 @@
# BMC platform environment
export BMC_PLATFORM=1 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need "export"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"skip_ledd": true,
"skip_xcvrd": true,
"skip_psud": true,
"skip_syseepromd": true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have syseepromd NOT skipped in BMC to get EEPROM data and store in DB ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is placeholder code and needs a revisit when the hardware is fully ready

'procdockerstatsd.service', # Container resource monitoring

# Time synchronization
'ntp.service', # NTP time synchronization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if NTP is replaced with chrony in sonic master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will look into this and share an update, @judyjoseph . Kindly let us know if addressing this in the next PR works for you.

Copy link
Contributor

@chander-nexthop chander-nexthop Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do and take up enabling of all the required systemd services (and docker containers) as a follow up PR. Same for all the comments that follow. Hope thats fine?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


# SONiC NOS services - not needed for BMC
'sonic-hostservice.service', # SONiC host services (VLAN, LAG, etc.) - NOS-specific
'hostcfgd.service', # SONiC host config daemon - NOS-specific
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need hostcfgd service .. this is one which handles AAA/PAM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @judyjoseph , will take care.

# Services to REMOVE for BMC platform (not needed)
BMC_EXCLUDED_SERVICES = {
# AAA/TACACS - not needed on BMC
'tacacs-config.service',
Copy link
Contributor

@judyjoseph judyjoseph Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need AAA/TACACS in BMC - as we can login to BMC directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure @judyjoseph , we will take care.

'[email protected]', # Local console - only if VGA/HDMI available

# Optional services - can be excluded for minimal BMC
'auditd.service', # Security audit - only needed for compliance
Copy link
Contributor

@judyjoseph judyjoseph Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auditd also would be needed @qiluo-msft could you confirm if we can skip this service

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

'pmon.service', # Platform monitor container (sensors, fans, PSU, etc.)

# Telemetry and monitoring
'gnmi.service', # gNMI telemetry service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include sysmgr.service, this is needed alone with gnmi for remote reboot backend implementation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, @judyjoseph thank you for sharing your comments here . Shall we plan to address the systemd-related feedback in the next PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added all the containers requested for. @judyjoseph please have a look.

set -e

# Configuration
GADGET_NAME="g1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, I’m not sure whether this script and the service that starts it on system boot can be fully vendor‑independent. It’s possible that initialization of the usb0 network interface varies by vendor, in which case this logic should be moved into the vendor‑specific folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add more details on what all will be vendor specific? I would prefer to have this in common services, till more details emerge

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that at this moment I'm not sure whether the creation and initialization of the usb0 device will be the same for NVIDIA as it is for Nexhop. For now, let's keep it as is, but we may need to revisit this implementation in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course! Refactoring should be done when we have more vendors adding support for their platforms.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the USB creation to Nexthop platform module.

$(SONIC_ONE_IMAGE)_ARCH = arm64
$(SONIC_ONE_IMAGE)_MACHINE = aspeed
$(SONIC_ONE_IMAGE)_PLATFORM = aspeed
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm whether the generated image is compatible with the sonic-installer that runs on platforms using U-Boot?
Reference: https://github.com/sonic-net/sonic-utilities/blob/master/sonic_installer/bootloader/uboot.py

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we use uboot in our hardware and the eval board. Port first burn to eMMC, we use sonic-installer install to install subsequent images.

$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(ASPEED_EVB_AST2700_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(ASPEED_NEXTHOP_B27_PLATFORM_MODULE)
# $(SONIC_ONE_IMAGE)_DOCKERS = $(DOCKER_DATABASE) $(DOCKER_GNMI) $(DOCKER_RESTAPI) $(DOCKER_OBMC_CONSOLE) $(DOCKER_PLATFORM_MONITOR) $(DOCKER_BMCWEB)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this line is not needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use it for our internal dev. Will be upstreamed when ready.

- Move TACACS+, hostcfgd, auditd, sysmgr to BMC_REQUIRED_SERVICES
- Switch from ntp to chrony for time synchronization
- Add BMC overrides for sysmgr and telemetry (remove swss/syncd deps)
- Add telemetry, sysmgr, lldp docker images to BMC platform
- Fix telemetry auto-start by adding [Install] section to service template
- Remove unused BMC_PLATFORM variable from platform_env.conf

Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
GADGET_NAME="g1"
FUNCTION_TYPE="ncm" # Options: ncm, ecm, eem, rndis
INTERFACE_NAME="usb0"
SUBNET_MASK="24"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUBNET_MASK variable is not used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix. Thanks for pointing out.


# Step 1: Load kernel modules
logger -t usb-network "Loading kernel modules..."
modprobe libcomposite 2>/dev/null || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason why the drivers are loaded from the script rather than by modprobe at system start?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These modules pertain to USB gadget configuration for aspeed. So has to be aspeed specific. I will investigate if there is a way to do this in a platform specific way, without having to rely on the platform specific debian package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the USB network initialization to the Nexthop vendor platform module

modprobe libcomposite 2>/dev/null || true
modprobe usb_f_${FUNCTION_TYPE} 2>/dev/null || true
modprobe u_ether 2>/dev/null || true
modprobe aspeed_vhub 2>/dev/null || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not redirect errors during driver loading to /dev/null. If the driver is critical and required for the USB interface, any error that occurs during loading should be logged along with the return code; otherwise, debugging will be impossible.

If we can safely ignore a failure to load the driver, then is the driver needed at all?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix.

- Update debian/rules to support multi-package build (common + card-specific)
- Add build caching (.dep files) for NextHop and EVB platforms
- Add postinst script for common package to handle module loading
- Update setup.py to build shared wheel from common/sonic_platform
- Remove duplicate b27/setup.py

Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@chander-nexthop
Copy link
Contributor

@Blueve and @apoorv-arista Please have a look at commit 40f4febf70f3217b844712c7fcea81377fc49fe6 that just got pushed to this PR.

consutil can work.

Signed-off-by: Chandrasekaran Swaminathan <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@yxieca yxieca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per offline discussions. This PR doesn't pose blocking issues and is building a foundation for the BMC project to move forward.

There are open issues from this PR, we agreed to continue working on them with subsequent quick iterations.

},
"components": [
{
"name": "BMC"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove BMC as component. not sure why we need this . Same applies to other platform/sku

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done via #26002

"chassis": {
"AST2700-EVB-BMC": {
"component": {
"BMC": {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BMC as a component here too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done via #26002

@yxieca yxieca merged commit f015004 into sonic-net:master Mar 6, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants