[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,7 +1,10 @@
|
|||||||
ifneq ($(KERNELRELEASE),)
|
ifneq ($(KERNELRELEASE),)
|
||||||
obj-m:= accton_as9716_32d_cpld.o accton_as9716_32d_fan.o \
|
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 \
|
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
|
else
|
||||||
ifeq (,$(KERNEL_SRC))
|
ifeq (,$(KERNEL_SRC))
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <linux/sysfs.h>
|
#include <linux/sysfs.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/dmi.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);
|
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;
|
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
|
#define MAX_SERIAL_NUMBER 19
|
||||||
|
|
||||||
enum psu_type {
|
enum psu_type {
|
||||||
PSU_TYPE_AC_110V,
|
|
||||||
PSU_TYPE_DC_48V,
|
|
||||||
PSU_TYPE_DC_12V,
|
|
||||||
PSU_TYPE_AC_ACBEL_FSF019,
|
PSU_TYPE_AC_ACBEL_FSF019,
|
||||||
PSU_TYPE_AC_ACBEL_FSH082,
|
PSU_TYPE_AC_ACBEL_FSH082,
|
||||||
PSU_TYPE_YESM1300
|
PSU_TYPE_YESM1300
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct model_name_info {
|
struct model_name_info {
|
||||||
@ -48,23 +44,15 @@ struct serial_number_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct model_name_info models[] = {
|
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_FSF019, 0x15, 10, 7, "FSF019-"},
|
||||||
{PSU_TYPE_AC_ACBEL_FSH082, 0x20, 10, 7, "FSH082-"},
|
{PSU_TYPE_AC_ACBEL_FSH082, 0x20, 10, 7, "FSH082-"},
|
||||||
{PSU_TYPE_YESM1300, 0x20, 11, 8, "YESM1300"},
|
{PSU_TYPE_YESM1300, 0x20, 11, 8, "YESM1300"},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct serial_number_info serials[] = {
|
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_FSF019, 0x2e, 16, 16, "FSF019-"},
|
||||||
{PSU_TYPE_AC_ACBEL_FSH082, 0x35, 18, 18, "FSH082-"},
|
{PSU_TYPE_AC_ACBEL_FSH082, 0x35, 18, 18, "FSH082-"},
|
||||||
{PSU_TYPE_YESM1300, 0x35, 20, 19, "YESM1300"},
|
{PSU_TYPE_YESM1300, 0x35, 20, 19, "YESM1300"},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pddf_psu_data {
|
struct pddf_psu_data {
|
||||||
|
@ -18,6 +18,52 @@ ir3570_check()
|
|||||||
fi
|
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
|
ir3570_check
|
||||||
|
|
||||||
echo "AS9716 post PDDF driver install completed"
|
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)
|
# Disable monitor, monitor-fan, monitor-psu (not enabling them would imply they will be disabled by default)
|
||||||
# Enable pddf-platform-monitor
|
# 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
|
depmod -a
|
||||||
|
#systemctl daemon-reload
|
||||||
systemctl enable pddf-platform-init.service
|
systemctl enable pddf-platform-init.service
|
||||||
systemctl start pddf-platform-init.service
|
systemctl start pddf-platform-init.service
|
||||||
systemctl enable as9716-32d-pddf-platform-monitor.service
|
systemctl enable as9716-32d-pddf-platform-monitor.service
|
||||||
|
Reference in New Issue
Block a user