-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support for BMC cards based on Aspeed 2720 - Phase 2 #26002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chander-nexthop
wants to merge
5
commits into
sonic-net:master
Choose a base branch
from
nexthop-ai:bmc-review-comments
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
725925e
- Address review comments to remove BMC component from platform json
chander-nexthop e15a942
Replace the logic to get the UDC port to be more specific
chander-nexthop 737fbdf
1. Create a new aspeed platform services package that installs the
chander-nexthop b216b82
platform/aspeed: Add Nexthop BMC platform support with dual serial nu…
chander-nexthop 11da766
Derive a SwitchHostModule class from ModuleBase that identifies
chander-nexthop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,6 @@ | |
| "colors": ["green", "amber", "off"] | ||
| }, | ||
| "components": [ | ||
| { | ||
| "name": "BMC" | ||
| }, | ||
| { | ||
| "name": "BIOS" | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| "chassis": { | ||
| "AST2700-EVB-BMC": { | ||
| "component": { | ||
| "BMC": {}, | ||
| "BIOS": {} | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Aspeed BMC USB Network Gadget Interface Renaming Rule | ||
| # Renames USB NCM gadget interface from usb0 to bmc0 for consistent naming | ||
|
|
||
| # Match USB NCM gadget interface with BMC MAC address and rename to bmc0 | ||
| SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="02:00:00:00:00:01", NAME="bmc0" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "usb_network": { | ||
| "interface": "bmc0", | ||
| "bmc_ipv4": "192.168.100.1/24", | ||
| "switch_host_ipv4": "192.168.100.2" | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
device/nexthop/arm64-nexthop_b27-r0/nexthop_bmc_chassis_db_init.supervisord.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [program:nexthop_bmc_chassis_db_init] | ||
| command=/usr/local/bin/nexthop_bmc_chassis_db_init | ||
| priority=1 | ||
| autostart=true | ||
| autorestart=false | ||
| startsecs=0 | ||
| stdout_logfile=syslog | ||
| stderr_logfile=syslog | ||
| dependent_startup=true | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
| "chassis": { | ||
| "NH-B27-BMC": { | ||
| "component": { | ||
| "BMC": {}, | ||
| "BIOS": {} | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Aspeed Platform Services Package | ||
| # Vendor-independent services for all Aspeed platforms | ||
| # | ||
| ASPEED_PLATFORM_SERVICES = aspeed-platform-services_1.0.0_all.deb | ||
| $(ASPEED_PLATFORM_SERVICES)_SRC_PATH = $(PLATFORM_PATH)/aspeed-platform-services | ||
| SONIC_DPKG_DEBS += $(ASPEED_PLATFORM_SERVICES) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .PHONY: clean | ||
|
|
||
| clean: | ||
| rm -rf debian/aspeed-platform-services | ||
| rm -rf debian/.debhelper | ||
| rm -f debian/files | ||
| rm -f debian/*.log | ||
| rm -f debian/*.substvars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| aspeed-platform-services (1.0.0) unstable; urgency=low | ||
|
|
||
| * Initial release | ||
| * Consolidate Aspeed platform initialization services | ||
| * Add watchdog keepalive daemon (180s timeout, 60s interval) | ||
|
|
||
| -- SONiC Team <[email protected]> Mon, 16 Mar 2026 00:00:00 +0000 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| 10 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| Source: aspeed-platform-services | ||
| Section: misc | ||
| Priority: optional | ||
| Maintainer: SONiC Team <[email protected]> | ||
| Build-Depends: debhelper (>= 10) | ||
| Standards-Version: 3.9.6 | ||
|
|
||
| Package: aspeed-platform-services | ||
| Architecture: all | ||
| Depends: ${misc:Depends} | ||
| Description: Aspeed platform services for SONiC | ||
| This package provides platform-specific services for Aspeed-based BMC platforms: | ||
| - Machine configuration initialization | ||
| - Platform initialization | ||
| - Switch CPU console initialization | ||
| - U-Boot environment initialization | ||
| - Watchdog keepalive daemon | ||
| . | ||
| The watchdog keepalive daemon keeps the hardware watchdog armed and sends | ||
| periodic keepalive signals to prevent system resets. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/make -f | ||
|
|
||
| %: | ||
| dh $@ | ||
|
|
||
| override_dh_auto_build: | ||
| # Nothing to build | ||
|
|
||
| override_dh_auto_install: | ||
| # Install scripts | ||
| install -d $(CURDIR)/debian/aspeed-platform-services/usr/bin | ||
| install -m 0755 $(CURDIR)/scripts/*.sh $(CURDIR)/debian/aspeed-platform-services/usr/bin/ | ||
|
|
||
| # Install systemd service files | ||
| install -d $(CURDIR)/debian/aspeed-platform-services/lib/systemd/system | ||
| install -m 0644 $(CURDIR)/systemd/*.service $(CURDIR)/debian/aspeed-platform-services/lib/systemd/system/ | ||
|
|
||
| override_dh_installsystemd: | ||
| dh_installsystemd --name=sonic-machine-conf-init sonic-machine-conf-init.service | ||
| dh_installsystemd --name=sonic-platform-init sonic-platform-init.service | ||
| dh_installsystemd --name=sonic-switchcpu-console-init sonic-switchcpu-console-init.service | ||
| dh_installsystemd --name=sonic-uboot-env-init sonic-uboot-env-init.service | ||
| dh_installsystemd --name=watchdog-keepalive watchdog-keepalive.service | ||
|
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
80 changes: 80 additions & 0 deletions
80
platform/aspeed/aspeed-platform-services/scripts/watchdog-keepalive.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Watchdog keepalive daemon for Aspeed platforms. | ||
| # | ||
| # This daemon keeps the hardware watchdog alive by sending periodic keepalive | ||
| # signals. It opens /dev/watchdog and writes 'w' character every 60 seconds | ||
| # (with a 180 second watchdog timeout). | ||
| # | ||
|
|
||
| WATCHDOG_DEVICE="/dev/watchdog0" | ||
| KEEPALIVE_INTERVAL=60 # seconds | ||
| LOG_FILE="/var/log/aspeed-watchdog.log" | ||
| MAX_RETAINED_LOGS=5 | ||
|
|
||
| # Rotate old logs | ||
| rotate_logs() { | ||
| ls -t /var/log/aspeed-watchdog*.log 2>/dev/null | cat -n | while read n f; do | ||
| if [ $n -gt $MAX_RETAINED_LOGS ]; then | ||
| rm -f "$f" | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| # Signal handler for graceful shutdown | ||
| cleanup() { | ||
| echo "$(date -u): Watchdog keepalive daemon stopping" >> "$LOG_FILE" | ||
|
|
||
| # Disarm the watchdog using watchdogutil | ||
| if command -v watchdogutil &> /dev/null; then | ||
| watchdogutil disarm >> "$LOG_FILE" 2>&1 || { | ||
| echo "$(date -u): WARNING: Failed to disarm watchdog - system may reboot" >> "$LOG_FILE" | ||
| } | ||
| else | ||
| echo "$(date -u): WARNING: watchdogutil not found - cannot disarm watchdog" >> "$LOG_FILE" | ||
| fi | ||
|
|
||
| # Close the file descriptor | ||
| exec {wdt_fd}>&- 2>/dev/null || true | ||
|
|
||
| echo "$(date -u): Watchdog keepalive daemon stopped" >> "$LOG_FILE" | ||
| exit 0 | ||
| } | ||
|
|
||
| trap 'cleanup' SIGTERM SIGINT | ||
|
|
||
| # Rotate logs | ||
| rotate_logs | ||
|
|
||
| # Start logging | ||
| echo "$(date -u): Watchdog keepalive daemon starting" > "$LOG_FILE" | ||
|
|
||
| # Set watchdog interval to 180 seconds | ||
| # Set watchdog timeout to 180 seconds | ||
| if command -v watchdogutil &> /dev/null; then | ||
| watchdogutil arm -s 180 >> "$LOG_FILE" 2>&1 | ||
| echo "$(date -u): Watchdog timeout set to 180 seconds" >> "$LOG_FILE" | ||
| else | ||
| echo "$(date -u): WARNING: watchdogutil not found, using default timeout" >> "$LOG_FILE" | ||
| fi | ||
|
|
||
| # Open watchdog device and assign FD to variable wdt_fd | ||
| exec {wdt_fd}>"$WATCHDOG_DEVICE" | ||
| if [ $? -ne 0 ]; then | ||
| echo "$(date -u): ERROR: Failed to open $WATCHDOG_DEVICE" >> "$LOG_FILE" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "$(date -u): Opened $WATCHDOG_DEVICE with FD $wdt_fd" >> "$LOG_FILE" | ||
|
|
||
| # Send first keepalive | ||
| echo "w" >&${wdt_fd} | ||
| echo "$(date -u): First watchdog keepalive sent" >> "$LOG_FILE" | ||
|
|
||
| # Main keepalive loop | ||
| while true; do | ||
| sleep $KEEPALIVE_INTERVAL | ||
| echo "w" >&${wdt_fd} | ||
| echo "$(date -u): Watchdog keepalive sent" >> "$LOG_FILE" | ||
| done | ||
|
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
platform/aspeed/aspeed-platform-services/systemd/watchdog-keepalive.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [Unit] | ||
| Description=Watchdog Keepalive Daemon | ||
| Documentation=man:watchdog(8) | ||
| After=multi-user.target | ||
| Before=shutdown.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| ExecStart=/usr/bin/watchdog-keepalive.sh | ||
| Restart=always | ||
| RestartSec=5 | ||
| StandardOutput=journal | ||
| StandardError=journal | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need infra change to copy the watchdog script from platform/aspeed/aspeed-platform-services/scripts/watchdog-keepalive.sh to /usr/bin -- as I see some line relating to this removed in build_debian.sh ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we now have a separate debian package, aspeed-platform-services. Its install rules takes care of this. Earlier we were doing it from build_debian.sh directly with a platform check. That was a stop gap.