1. change i2c bus index for 4 SFP+'s eeprom.

2. Correct IDEEPROM and PSU sysfs path.
3. change to OnlPlatformPortConfig_48x25_8x100.
4. fix port 57&58's present bit.
Signed-off-by: roy_lee <roy_lee@accton.com>
This commit is contained in:
roy_lee
2018-03-27 14:29:23 +08:00
parent 23333f6692
commit 2ce2ba37cc
5 changed files with 15 additions and 16 deletions

View File

@@ -671,7 +671,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da,
break;
case MODULE_PRESENT_57 ... MODULE_PRESENT_58:
reg = 0x12;
mask = 0x1 << (( MODULE_PRESENT_58 - attr->index)+2);
mask = 0x1 << ((attr->index - MODULE_PRESENT_57)+2);
break;
case MODULE_PRESENT_49 ... MODULE_PRESENT_56: /*QSFP*/
reg = 0x13 ;
@@ -717,7 +717,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da,
return 0;
}
if (attr->index >= MODULE_PRESENT_1 && attr->index <= MODULE_PRESENT_56) {
if (attr->index >= MODULE_PRESENT_1 && attr->index <= MODULE_PRESENT_58) {
revert = 1;
}

View File

@@ -46,8 +46,8 @@
#define PSU1_AC_PMBUS_NODE(node) PSU1_AC_PMBUS_PREFIX#node
#define PSU2_AC_PMBUS_NODE(node) PSU2_AC_PMBUS_PREFIX#node
#define PSU2_AC_HWMON_PREFIX "/sys/bus/i2c/devices/17-0051/"
#define PSU1_AC_HWMON_PREFIX "/sys/bus/i2c/devices/13-0053/"
#define PSU1_AC_HWMON_PREFIX "/sys/bus/i2c/devices/17-0051/"
#define PSU2_AC_HWMON_PREFIX "/sys/bus/i2c/devices/13-0053/"
#define PSU1_AC_HWMON_NODE(node) PSU1_AC_HWMON_PREFIX#node
#define PSU2_AC_HWMON_NODE(node) PSU2_AC_HWMON_PREFIX#node
@@ -55,7 +55,7 @@
#define FAN_BOARD_PATH "/sys/bus/i2c/devices/11-0066/"
#define FAN_NODE(node) FAN_BOARD_PATH#node
#define IDPROM_PATH "/sys/class/i2c-adapter/i2c-1/0-0056/eeprom"
#define IDPROM_PATH "/sys/class/i2c-adapter/i2c-0/0-0056/eeprom"
int onlp_file_write_integer(char *filename, int value);
int onlp_file_read_binary(char *filename, char *buffer, int buf_size, int data_len);

View File

@@ -55,7 +55,6 @@ psu_status_info_get(int id, char *node, int *value)
else if (PSU2_ID == id) {
sprintf(path, "%s%s", PSU2_AC_HWMON_PREFIX, node);
}
if (onlp_file_read_int(value, path) < 0) {
AIM_LOG_ERROR("Unable to read status from file(%s)\r\n", path);
return ONLP_STATUS_E_INTERNAL;

View File

@@ -42,8 +42,8 @@
const int sfp_map[] = {
42,41,44,43,47,45,46,50,
48,49,51,52,53,56,55,54,
58,57,59,60,61,63,62,64,
48,49,52,51,53,56,55,54,
58,57,60,59,61,63,62,64,
66,68,65,67,69,71,72,70,
74,73,76,75,77,79,78,80,
81,82,84,85,83,87,88,86, /*port 41~48*/

View File

@@ -2,7 +2,7 @@ from onl.platform.base import *
from onl.platform.accton import *
class OnlPlatform_x86_64_accton_as7326_56x_r0(OnlPlatformAccton,
OnlPlatformPortConfig_48x25_6x100):
OnlPlatformPortConfig_48x25_8x100):
PLATFORM='x86-64-accton-as7326-56x-r0'
MODEL="AS7326-56X"
@@ -66,28 +66,28 @@ class OnlPlatform_x86_64_accton_as7326_56x_r0(OnlPlatformAccton,
sfp_map = [
42,41,44,43,47,45,46,50,
48,49,51,52,53,56,55,54,
58,57,59,60,61,63,62,64,
48,49,52,51,53,56,55,54,
58,57,60,59,61,63,62,64,
66,68,65,67,69,71,72,70,
74,73,76,75,77,79,78,80,
81,82,84,85,83,87,88,86, #port 41~48
25,26,27,28,29,30,31,32, #port 49~56 QSFP
22,23] #port 57~58 SFP+ from CPU NIF.
# initialize SFP+ port 1~54 and 57+58.
# initialize SFP+ port 1~56 and 57+58.
for port in range(1, 49):
bus = sfp_map[port-1]
self.new_i2c_device('optoe2', 0x50, bus)
self.new_i2c_device('optoe2', 0x50, sfp[56])
self.new_i2c_device('optoe2', 0x50, sfp[57])
self.new_i2c_device('optoe2', 0x50, sfp_map[57-1])
self.new_i2c_device('optoe2', 0x50, sfp_map[58-1])
# initialize QSFP port 49~56
for port in range(49, 58):
for port in range(49, 57):
bus = sfp_map[port-1]
self.new_i2c_device('optoe1', 0x50, bus)
for port in range(1, len(sfp)+1):
for port in range(1, len(sfp_map)):
bus = sfp_map[port-1]
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, bus), shell=True)