Comments (5)
Some hints for Accton developers
Our AS5812-54X chassis has AC power supplies. Power supplies info is in a file system as expected:
cd /sys/bus/i2c/devices/57-0050
ls -al
total 0
drwxr-xr-x 3 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
lrwxrwxrwx 1 root root 0 Nov 19 20:40 driver -> ../../../../../../bus/i2c/drivers/as5812_54x_psu
drwxr-xr-x 3 root root 0 Nov 19 20:40 hwmon
-r--r--r-- 1 root root 4096 Nov 19 21:16 modalias
-r--r--r-- 1 root root 4096 Nov 19 21:16 name
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_index
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_model_name
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_power_good
-r--r--r-- 1 root root 4096 Nov 19 21:16 psu_present
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent
cd /sys/bus/i2c/devices/58-0053
ls -al
total 0
drwxr-xr-x 3 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
lrwxrwxrwx 1 root root 0 Nov 19 20:40 driver -> ../../../../../../bus/i2c/drivers/as5812_54x_psu
drwxr-xr-x 3 root root 0 Nov 19 20:40 hwmon
-r--r--r-- 1 root root 4096 Nov 19 21:18 modalias
-r--r--r-- 1 root root 4096 Nov 19 21:18 name
-r--r--r-- 1 root root 4096 Nov 19 21:18 psu_index
-r--r--r-- 1 root root 4096 Nov 19 20:58 psu_model_name
-r--r--r-- 1 root root 4096 Nov 19 21:18 psu_power_good
-r--r--r-- 1 root root 4096 Nov 19 21:18 psu_present
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent
Looks like ONLP library is looking for info in a wrong place where CD power supplies info is supposed to be but is not present. Library header file platform_lib.h had wrong definitions for PSU1_AC_EEPROM_PREFIX, PSU1_DC_EEPROM_PREFIX, PSU2_AC_EEPROM_PREFIX and PSU2_DC_EEPROM_PREFIX. "AC" and "DC" are reversed.
from opennetworklinux.
Hi, could you show the output of "onlpdump"?
This model support 2 kinds of PSUs, you can find corresponding devices on 57-0050/58-0053 and 57-0038/58-003B.
But your unit is supposed to equip with PSUx_AC_EEPROM_PREFIX.
That's why psu_status_info_get() is always called with is_ac=1.
from opennetworklinux.
I have no onlpdump:
onlpdump
-sh: onlpdump: not found
which onlpdump
pwd
/sys/bus/i2c/devices/57-0038
ls -al
total 0
drwxr-xr-x 2 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
-r--r--r-- 1 root root 4096 Nov 19 21:16 modalias
-r--r--r-- 1 root root 4096 Nov 19 21:16 name
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent
cd ../58-003b
ls -al
total 0
drwxr-xr-x 2 root root 0 Nov 19 20:40 .
drwxr-xr-x 7 root root 0 Nov 19 20:40 ..
-r--r--r-- 1 root root 4096 Nov 26 17:40 modalias
-r--r--r-- 1 root root 4096 Nov 26 17:40 name
lrwxrwxrwx 1 root root 0 Nov 19 20:40 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Nov 19 20:40 uevent
My power supplies are both AC, information is taken by the driver and placed to the file system under
/sys/bus/i2c/devices/57-0050 and /sys/bus/i2c/devices/58-0053
ONLP library function onlp_psu_info_get() is looking into /sys/bus/i2c/devices/57-0038 and /sys/bus/i2c/devices/58-003b instead and obviously is not finding file "psu_present".
If you look into OpenNetworkLinux/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/onlp/builds/src/module/src/platform_lib.h
you can find:
#define PSU1_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0038/"
#define PSU1_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0050/"
#define PSU2_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-003b/"
#define PSU2_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-0053/"
which is incorrect: AC and DC paths are reversed. It should be:
#define PSU1_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0038/"
#define PSU1_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/57-0050/"
#define PSU2_DC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-003b/"
#define PSU2_AC_EEPROM_PREFIX "/sys/bus/i2c/devices/58-0053/"
from opennetworklinux.
Hi,
I can read psu_present at 4 locations you mentioned.
All of them are working.
It supposed you created device with wrong names.
Please check your scripts with
from opennetworklinux.
Changing I2C devices creation from
echo as5812_54x_psu 0x38 > /sys/bus/i2c/devices/i2c-57/new_device
echo as5812_54x_psu 0x3b > /sys/bus/i2c/devices/i2c-58/new_device
to
echo as5812_54x_psu1 0x38 > /sys/bus/i2c/devices/i2c-57/new_device
echo as5812_54x_psu2 0x3b > /sys/bus/i2c/devices/i2c-58/new_device
in a start-up script resolves this issue.
from opennetworklinux.
Related Issues (20)
- Build Issue for fetch jessie binary-amd64 packages HOT 2
- CRITICAL:docker_shell:The binfmt_misc system could not be mounted. HOT 1
- 'cat etc/onl/platform' is unknown HOT 1
- Facing below failure when build the ONL "ERROR:onlrfs:Exception 'Could not mount proc in rfs.' in OnlRfsContext::__enter__" HOT 2
- OpenNetworkLinux - Change user login credentials as "admin/onl" instead of default login as "root/onl" in Source code
- systemd-udevd[643]: Process '/sbin/initblockdev xxx add' failed with exit code 1. HOT 2
- Is building from non-Ubuntu possible at all ? HOT 1
- hello
- No module named x86_64_delta_dds64c8_r0
- Looking to build this to support cel_redstone-powerpc
- Specify onie img file HOT 5
- Specify onie img file
- Specify onie img file
- Specify onie img file
- How to make `onlpdusmp -S ` support OSFP HOT 2
- [ONL Arm64] ONL-BOOT partition size cannot be customized HOT 6
- Checksums for latest Stretch build
- Migration plan HOT 1
- Package all does not exist.
- Creating Users on ONL (Open Network Linux) with Different Privileges
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opennetworklinux.