Skip to content

[Edgecore][AS7327-56X] Support BMC Enable#100

Open
rayxhuangEC wants to merge 3 commits intoaccton:support_new_platform_and_syncfrom
rayxhuangEC:support_new_platform_and_sync
Open

[Edgecore][AS7327-56X] Support BMC Enable#100
rayxhuangEC wants to merge 3 commits intoaccton:support_new_platform_and_syncfrom
rayxhuangEC:support_new_platform_and_sync

Conversation

@rayxhuangEC
Copy link

What did I do:

  • Add BMC enable sysfs in cpld driver
  • Add as7327-56x-psu_bmc and as7327-56x-thermal_bmc driver
  • Fix ONLP psui, fani, thermali to get different sysfs node according to the BMC status.
  • Add onlp_dir_read to list the directory

What did I do:
* Add BMC enable sysfs in cpld driver
* Add as7327-56x-psu_bmc and as7327-56x-thermal_bmc driver
* Fix ONLP psui, fani, thermali to get different sysfs node according to
  the BMC status.
* Add onlp_dir_read to list the directory

Signed-off-by: rayx_huang <rayx_huang@edge-core.com>
@rayxhuangEC
Copy link
Author

@vincentchiang-ec please help review

int subdir_path_get(char *root, char *prefix, int prefix_len, char *path, int path_len)
{
int rv = 0;
char tmp[30];

Choose a reason for hiding this comment

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

30 is quite small length, better to enlarge it to 100.

Copy link
Author

Choose a reason for hiding this comment

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

Done


static void
onlp_psu_str_check(char *str, int buffer_size)
{

Choose a reason for hiding this comment

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

Better to add a check whether "strlen(str)" is 0, or it will lead to access "str[-1]".

Copy link
Author

Choose a reason for hiding this comment

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

Done

# initiate PSU-2
('as7327_56x_psu2', 0x59, 2),
])
time.sleep(1)

Choose a reason for hiding this comment

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

Sleep 1 second is not a reliable operation, add a check mechanism.

timeout = 5
while timeout > 0:
    if os.path.exists(BMC_ENABLE_NODE):
        break
    time.sleep(1)
    timeout -= 1

Copy link
Author

Choose a reason for hiding this comment

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

Done


val = as7327_56x_cpld_read_internal(client, 0x82);
if(val < 0)
return -1;

Choose a reason for hiding this comment

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

Keep the original faliure error code.

Copy link
Author

Choose a reason for hiding this comment

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

Done


val = as7327_56x_cpld_read_internal(client, 0x80);
if(val < 0)
return -1;

Choose a reason for hiding this comment

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

Keep the original faliure error code.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@rayxhuangEC
Copy link
Author

rayxhuangEC commented Mar 3, 2026

Output of onlpdump

root@localhost:~# onlpdump
   System Information: = {
       Product Name: 7327-56X-O-AC-F
       Part Number: F0PEC7327001S
       Serial Number: 732756X2545006
       MAC: 94:ef:97:a5:2c:c0
       MAC Range: 32
       Manufacturer: Accton
       Manufacture Date: 11/12/2025 11:08:00
       Vendor: Accton
       Platform Name: x86_64-accton_as7327_56x-r0
       Label Revision: R0A
       Country Code: CN
       Diag Version: 0.1.0
       ONIE Version: 2020.08.00.01
   }
   thermal @ 1 = {
       Description: CPU Core
       Status: 0x00000001 [ PRESENT ]
       Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
       Temperature: 46000
       thresholds = {
           Warning: 82000
           Error: 104000
           Shutdown: 104000
       }
   }
   thermal @ 2 = {
       Description: MAC Around(0x4C)
       Status: 0x00000001 [ PRESENT ]
       Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
       Temperature: 42000
       thresholds = {
           Warning: 68000
           Error: 70000
           Shutdown: 70000
       }
   }
   thermal @ 3 = {
       Description: COMe bottom(0x4B)
       Status: 0x00000001 [ PRESENT ]
       Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
       Temperature: 29000
       thresholds = {
           Warning: 68000
           Error: 70000
           Shutdown: 70000
       }
   }
   thermal @ 4 = {
       Description: Air Outlet(0x4A)
       Status: 0x00000001 [ PRESENT ]
       Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
       Temperature: 33000
       thresholds = {
           Warning: 68000
           Error: 70000
           Shutdown: 70000
       }
   }
   led @ 1 = {
       Description: Chassis LED 1 (SYS LED)
       Status: 0x00000005 [ PRESENT,ON ]
       Caps:   0x00030400 [ RED,GREEN,GREEN_BLINKING ]
       Mode: RED
       Char:
   }
   led @ 2 = {
       Description: Chassis LED 2 (BMC LED)
       Status: 0x00000005 [ PRESENT,ON ]
       Caps:   0x00031401 [ ON_OFF,RED,ORANGE,GREEN,GREEN_BLINKING ]
       Mode: ORANGE
       Char:
   }
   led @ 3 = {
       Description: Chassis LED 3 (ID LED)
       Status: 0x00000005 [ PRESENT,ON ]
       Caps:   0x00040001 [ ON_OFF,BLUE ]
       Mode: BLUE
       Char:
   }
   led @ 4 = {
       Description: Chassis LED 4 (ACT LED)
       Status: 0x00000001 [ PRESENT ]
       Caps:   0x00030401 [ ON_OFF,RED,GREEN,GREEN_BLINKING ]
       Mode: OFF
       Char:
   }
   psu @ 1 = {
       Description: PSU-1
       Model:  G1342-0800W
       SN:     1342801N0H2543
       Status: 0x00000003 [ PRESENT,FAILED ]
       Caps:   0x00000001 [ AC ]
       Vin:    0
       Vout:   0
       Iin:    0
       Iout:   0
       Pin:    0
       Pout:   0
   }
   psu @ 2 = {
       Description: PSU-2
       Model:  G1342-0800W
       SN:     1342801N0H2543
       Status: 0x00000001 [ PRESENT ]
       Caps:   0x00000001 [ AC ]
       Vin:    0
       Vout:   0
       Iin:    0
       Iout:   0
       Pin:    0
       Pout:   0
       fan @ 10 = {
           Description: PSU 2 - Fan 1
           Status: 0x00000009 [ PRESENT,F2B ]
           Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
           RPM:    6881
           Per:    29
           Model:  NULL
           SN:     NULL
       }
       thermal @ 8 = {
           Description: PSU-2 Thermal Sensor 1
           Status: 0x00000001 [ PRESENT ]
           Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
           Temperature: 32250
           thresholds = {
               Warning: 60000
               Error: 70000
               Shutdown: 70000
           }
       }
       thermal @ 9 = {
           Description: PSU-2 Thermal Sensor 2
           Status: 0x00000001 [ PRESENT ]
           Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
           Temperature: 43937
           thresholds = {
               Warning: 100000
               Error: 120000
               Shutdown: 120000
           }
       }
       thermal @ 10 = {
           Description: PSU-2 Thermal Sensor 3
           Status: 0x00000001 [ PRESENT ]
           Caps:   0x0000000f [ GET_TEMPERATURE,GET_WARNING_THRESHOLD,GET_ERROR_THRESHOLD,GET_SHUTDOWN_THRESHOLD ]
           Temperature: 37687
           thresholds = {
               Warning: 100000
               Error: 120000
               Shutdown: 120000
           }
       }
   }
   fan @ 1 = {
       Description: Chassis Fan - FAN_BOX1_FRONT 1
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    9150
       Per:    30
       Model:  NULL
       SN:     NULL
   }
   fan @ 2 = {
       Description: Chassis Fan - FAN_BOX1_FRONT 2
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    9150
       Per:    30
       Model:  NULL
       SN:     NULL
   }
   fan @ 3 = {
       Description: Chassis Fan - FAN_BOX2_FRONT 3
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    9000
       Per:    30
       Model:  NULL
       SN:     NULL
   }
   fan @ 4 = {
       Description: Chassis Fan - FAN_BOX2_FRONT 4
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    9150
       Per:    30
       Model:  NULL
       SN:     NULL
   }
   fan @ 5 = {
       Description: Chassis Fan - FAN_BOX1_REAR 1
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    7950
       Per:    31
       Model:  NULL
       SN:     NULL
   }
   fan @ 6 = {
       Description: Chassis Fan - FAN_BOX1_REAR 2
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    7950
       Per:    31
       Model:  NULL
       SN:     NULL
   }
   fan @ 7 = {
       Description: Chassis Fan - FAN_BOX2_REAR 3
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    7950
       Per:    31
       Model:  NULL
       SN:     NULL
   }
   fan @ 8 = {
       Description: Chassis Fan - FAN_BOX2_REAR 4
       Status: 0x00000009 [ PRESENT,F2B ]
       Caps:   0x00000030 [ GET_RPM,GET_PERCENTAGE ]
       RPM:    7950
       Per:    31
       Model:  NULL
       SN:     NULL
   }


What did I do
* Add psu fan direction
* Remove ONLP_FAN_CAPS_SET_PERCENTAGE from psu fan
* Remove ONLP_FAN_CAPS_SET_PERCENTAGE from chassis fan when BMC is enabled
* Add retry 5 times in the platform init

Signed-off-by: rayx_huang <rayx_huang@edge-core.com>
What did I do:
* Keep the original faliure error code

Signed-off-by: rayx_huang <rayx_huang@edge-core.com>
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.

2 participants