[AS9716-32d] Modify check eeprom via pre_pddf sh (#7827)
Modify to use pre_pddf_init.sh to check eeprom is 0x57 or 0x56. Signed-off-by: Jostar Yang <jostar_yang@accton.com.tw>
This commit is contained in:
parent
47d9b26063
commit
b617ffd88c
@ -1,8 +1,11 @@
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
obj-m:= accton_as9716_32d_cpld.o accton_as9716_32d_fan.o \
|
||||
accton_as9716_32d_leds.o accton_as9716_32d_psu.o accton_i2c_psu.o \
|
||||
pddf_custom_psu.o
|
||||
pddf_custom_psu.o
|
||||
|
||||
CFLAGS_pddf_custom_psu.o := -I$(M)/../../../../pddf/i2c/modules/include
|
||||
KBUILD_EXTRA_SYMBOLS := $(M)/../../../../pddf/i2c/Module.symvers.PDDF
|
||||
|
||||
else
|
||||
ifeq (,$(KERNEL_SRC))
|
||||
#$(error KERNEL_SRC is not defined)
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/dmi.h>
|
||||
#include "../../../../pddf/i2c/modules/include/pddf_psu_defs.h"
|
||||
#include "pddf_psu_defs.h"
|
||||
|
||||
ssize_t pddf_show_custom_psu_v_out(struct device *dev, struct device_attribute *da, char *buf);
|
||||
extern PSU_SYSFS_ATTR_DATA access_psu_v_out;
|
||||
@ -22,13 +22,9 @@ extern PSU_SYSFS_ATTR_DATA access_psu_serial_num;
|
||||
#define MAX_SERIAL_NUMBER 19
|
||||
|
||||
enum psu_type {
|
||||
PSU_TYPE_AC_110V,
|
||||
PSU_TYPE_DC_48V,
|
||||
PSU_TYPE_DC_12V,
|
||||
PSU_TYPE_AC_ACBEL_FSF019,
|
||||
PSU_TYPE_AC_ACBEL_FSH082,
|
||||
PSU_TYPE_YESM1300
|
||||
|
||||
};
|
||||
|
||||
struct model_name_info {
|
||||
@ -48,23 +44,15 @@ struct serial_number_info {
|
||||
};
|
||||
|
||||
struct model_name_info models[] = {
|
||||
{PSU_TYPE_AC_110V, 0x20, 8, 8, "YM-2651Y"},
|
||||
{PSU_TYPE_DC_48V, 0x20, 8, 8, "YM-2651V"},
|
||||
{PSU_TYPE_DC_12V, 0x00, 11, 11, "PSU-12V-750"},
|
||||
{PSU_TYPE_AC_ACBEL_FSF019, 0x15, 10, 7, "FSF019-"},
|
||||
{PSU_TYPE_AC_ACBEL_FSH082, 0x20, 10, 7, "FSH082-"},
|
||||
{PSU_TYPE_YESM1300, 0x20, 11, 8, "YESM1300"},
|
||||
|
||||
};
|
||||
|
||||
struct serial_number_info serials[] = {
|
||||
{PSU_TYPE_AC_110V, 0x2e, 18, 18, "YM-2651Y"},
|
||||
{PSU_TYPE_DC_48V, 0x2e, 18, 18, "YM-2651V"},
|
||||
{PSU_TYPE_DC_12V, 0x2e, 18, 18, "PSU-12V-750"},
|
||||
{PSU_TYPE_AC_ACBEL_FSF019, 0x2e, 16, 16, "FSF019-"},
|
||||
{PSU_TYPE_AC_ACBEL_FSH082, 0x35, 18, 18, "FSH082-"},
|
||||
{PSU_TYPE_YESM1300, 0x35, 20, 19, "YESM1300"},
|
||||
|
||||
};
|
||||
|
||||
struct pddf_psu_data {
|
||||
|
@ -18,6 +18,52 @@ ir3570_check()
|
||||
fi
|
||||
}
|
||||
|
||||
# Some initializations
|
||||
#============================================================
|
||||
# cpld_reset_stop
|
||||
#i2cset -y 0 0x65 0x3 0x0
|
||||
|
||||
# Select the mux channels
|
||||
i2cset -y 0 0x77 0x1
|
||||
i2cset -y 0 0x76 0x4
|
||||
|
||||
# Diag LED: Boot successfully (SOLID GREEN) --- DO THIS STEP IN POST DEVICE CREATION
|
||||
# i2cset -y 0 0x60 0x64 4
|
||||
|
||||
# 10G Merlin Ports
|
||||
# SetModeXFI()
|
||||
echo "Set Mux(retimer) to 2x10G XFI."
|
||||
i2cset -y 0 0x76 0x20
|
||||
i2cset -y 0 0x18 0x7 0x3
|
||||
i2cset -y 0 0x19 0x7 0x3
|
||||
i2cset -y 0 0x1a 0x7 0x3
|
||||
i2cset -y 0 0x1b 0x7 0x3
|
||||
|
||||
|
||||
# SetVOD()
|
||||
#set channel B
|
||||
i2cset -y 0 0x18 0xff 0x05
|
||||
i2cset -y 0 0x19 0xff 0x05
|
||||
#write output voltage to 800mV
|
||||
i2cset -y 0 0x18 0x2d 0x82
|
||||
i2cset -y 0 0x19 0x2d 0x82
|
||||
#write de-emphasis to -3.5dB
|
||||
i2cset -y 0 0x18 0x15 0x12
|
||||
i2cset -y 0 0x19 0x15 0x12
|
||||
#read output voltage
|
||||
#i2cget -y 0 0x18 0x2d
|
||||
#i2cget -y 0 0x19 0x2d
|
||||
#read de-emphasis
|
||||
#i2cget -y 0 0x18 0x15
|
||||
#i2cget -y 0 0x19 0x15
|
||||
#clr channel B
|
||||
i2cset -y 0 0x18 0xff 0x00
|
||||
i2cset -y 0 0x19 0xff 0x00
|
||||
|
||||
# De-select the mux channels which were selected for above configs
|
||||
i2cset -y 0 0x76 0x0
|
||||
i2cset -y 0 0x77 0x0
|
||||
|
||||
ir3570_check
|
||||
|
||||
echo "AS9716 post PDDF driver install completed"
|
||||
|
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Steps to check syseeprom i2c address
|
||||
modprobe i2c-i801
|
||||
modprobe i2c-dev
|
||||
use_57_eeprom=false
|
||||
(i2cget -y -f 0 0x57 0x0) > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
use_57_eeprom=true
|
||||
fi
|
||||
|
||||
if $use_57_eeprom ; then
|
||||
echo "The board has system EEPROM at I2C address 0x57"
|
||||
if [ -f /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf_support ] && \
|
||||
[ -f /usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json ]; then
|
||||
# syseeprom is at the i2c address 0x57. Change the PDDF JSON file
|
||||
sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c02"},@\
|
||||
"topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \
|
||||
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json
|
||||
sync
|
||||
fi
|
||||
fi
|
@ -2,25 +2,8 @@
|
||||
# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default)
|
||||
# Enable pddf-platform-monitor
|
||||
|
||||
# Steps to check syseeprom i2c address
|
||||
modprobe i2c-i801
|
||||
modprobe i2c-dev
|
||||
use_57_eeprom=false
|
||||
(i2cget -y -f 0 0x57 0x0) > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
use_57_eeprom=true
|
||||
fi
|
||||
|
||||
if $use_57_eeprom ; then
|
||||
echo "The board has system EEPROM at I2C address 0x57"
|
||||
# syseeprom is at the i2c address 0x57. Change the PDDF JSON file
|
||||
sed -i 's@"topo_info": {"parent_bus": "0x0", "dev_addr": "0x56", "dev_type": "24c02"},@\
|
||||
"topo_info": {"parent_bus": "0x0", "dev_addr": "0x57", "dev_type": "24c02"},@g' \
|
||||
/usr/share/sonic/device/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json
|
||||
sync
|
||||
fi
|
||||
|
||||
depmod -a
|
||||
#systemctl daemon-reload
|
||||
systemctl enable pddf-platform-init.service
|
||||
systemctl start pddf-platform-init.service
|
||||
systemctl enable as9716-32d-pddf-platform-monitor.service
|
||||
|
Loading…
Reference in New Issue
Block a user