mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-24 16:57:02 +00:00
Revert "[as5712-54x] Add support for OOM driver"
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -131,8 +131,8 @@ static ssize_t fan_set_duty_cycle(struct device *dev,
|
||||
static ssize_t fan_show_value(struct device *dev,
|
||||
struct device_attribute *da, char *buf);
|
||||
|
||||
extern int as5712_54x_cpld_read(unsigned short cpld_addr, u8 reg);
|
||||
extern int as5712_54x_cpld_write(unsigned short cpld_addr, u8 reg, u8 value);
|
||||
extern int as5712_54x_i2c_cpld_read(unsigned short cpld_addr, u8 reg);
|
||||
extern int as5712_54x_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value);
|
||||
|
||||
|
||||
/*******************/
|
||||
@@ -258,12 +258,12 @@ static const struct attribute_group accton_as5712_54x_fan_group = {
|
||||
|
||||
static int accton_as5712_54x_fan_read_value(u8 reg)
|
||||
{
|
||||
return as5712_54x_cpld_read(0x60, reg);
|
||||
return as5712_54x_i2c_cpld_read(0x60, reg);
|
||||
}
|
||||
|
||||
static int accton_as5712_54x_fan_write_value(u8 reg, u8 value)
|
||||
{
|
||||
return as5712_54x_cpld_write(0x60, reg, value);
|
||||
return as5712_54x_i2c_cpld_write(0x60, reg, value);
|
||||
}
|
||||
|
||||
static void accton_as5712_54x_fan_update_device(struct device *dev)
|
||||
@@ -394,6 +394,11 @@ static int __init accton_as5712_54x_fan_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
extern int platform_accton_as5712_54x(void);
|
||||
if(!platform_accton_as5712_54x()) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = platform_driver_register(&accton_as5712_54x_fan_driver);
|
||||
if (ret < 0) {
|
||||
goto exit;
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#include <linux/leds.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
extern int as5712_54x_cpld_read (unsigned short cpld_addr, u8 reg);
|
||||
extern int as5712_54x_cpld_write(unsigned short cpld_addr, u8 reg, u8 value);
|
||||
extern int as5712_54x_i2c_cpld_read (unsigned short cpld_addr, u8 reg);
|
||||
extern int as5712_54x_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value);
|
||||
|
||||
extern void led_classdev_unregister(struct led_classdev *led_cdev);
|
||||
extern int led_classdev_register(struct device *parent, struct led_classdev *led_cdev);
|
||||
@@ -220,12 +220,12 @@ static u8 led_light_mode_to_reg_val(enum led_type type,
|
||||
|
||||
static int accton_as5712_54x_led_read_value(u8 reg)
|
||||
{
|
||||
return as5712_54x_cpld_read(0x60, reg);
|
||||
return as5712_54x_i2c_cpld_read(0x60, reg);
|
||||
}
|
||||
|
||||
static int accton_as5712_54x_led_write_value(u8 reg, u8 value)
|
||||
{
|
||||
return as5712_54x_cpld_write(0x60, reg, value);
|
||||
return as5712_54x_i2c_cpld_write(0x60, reg, value);
|
||||
}
|
||||
|
||||
static void accton_as5712_54x_led_update(void)
|
||||
@@ -552,6 +552,10 @@ static int __init accton_as5712_54x_led_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
extern int platform_accton_as5712_54x(void);
|
||||
if(!platform_accton_as5712_54x()) {
|
||||
return -ENODEV;
|
||||
}
|
||||
ret = platform_driver_register(&accton_as5712_54x_led_driver);
|
||||
if (ret < 0) {
|
||||
goto exit;
|
||||
|
||||
@@ -43,7 +43,7 @@ static ssize_t show_index(struct device *dev, struct device_attribute *da, char
|
||||
static ssize_t show_status(struct device *dev, struct device_attribute *da, char *buf);
|
||||
static ssize_t show_model_name(struct device *dev, struct device_attribute *da, char *buf);
|
||||
static int as5712_54x_psu_read_block(struct i2c_client *client, u8 command, u8 *data,int data_len);
|
||||
extern int as5712_54x_cpld_read(unsigned short cpld_addr, u8 reg);
|
||||
extern int as5712_54x_i2c_cpld_read(unsigned short cpld_addr, u8 reg);
|
||||
static int as5712_54x_psu_model_name_get(struct device *dev);
|
||||
|
||||
/* Addresses scanned
|
||||
@@ -329,7 +329,7 @@ static struct as5712_54x_psu_data *as5712_54x_psu_update_device(struct device *d
|
||||
|
||||
|
||||
/* Read psu status */
|
||||
status = as5712_54x_cpld_read(PSU_STATUS_I2C_ADDR, PSU_STATUS_I2C_REG_OFFSET);
|
||||
status = as5712_54x_i2c_cpld_read(PSU_STATUS_I2C_ADDR, PSU_STATUS_I2C_REG_OFFSET);
|
||||
|
||||
if (status < 0) {
|
||||
dev_dbg(&client->dev, "cpld reg (0x%x) err %d\n", PSU_STATUS_I2C_ADDR, status);
|
||||
@@ -349,9 +349,24 @@ exit:
|
||||
return data;
|
||||
}
|
||||
|
||||
module_i2c_driver(as5712_54x_psu_driver);
|
||||
static int __init as5712_54x_psu_init(void)
|
||||
{
|
||||
extern int platform_accton_as5712_54x(void);
|
||||
if(!platform_accton_as5712_54x()) {
|
||||
return -ENODEV;
|
||||
}
|
||||
return i2c_add_driver(&as5712_54x_psu_driver);
|
||||
}
|
||||
|
||||
static void __exit as5712_54x_psu_exit(void)
|
||||
{
|
||||
i2c_del_driver(&as5712_54x_psu_driver);
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Brandon Chuang <brandon_chuang@accton.com.tw>");
|
||||
MODULE_DESCRIPTION("accton as5712_54x_psu driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
module_init(as5712_54x_psu_init);
|
||||
module_exit(as5712_54x_psu_exit);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,24 +24,20 @@
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/sfpi.h>
|
||||
#include <onlplib/i2c.h>
|
||||
#include <onlplib/file.h>
|
||||
#include "x86_64_accton_as5712_54x_int.h"
|
||||
#include "x86_64_accton_as5712_54x_log.h"
|
||||
|
||||
#include <fcntl.h> /* For O_RDWR && open */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <onlplib/i2c.h>
|
||||
#include "platform_lib.h"
|
||||
|
||||
#define MAX_SFP_PATH 64
|
||||
static char sfp_node_path[MAX_SFP_PATH] = {0};
|
||||
#define CPLD_MUX_BUS_START_INDEX 2
|
||||
|
||||
#define PORT_EEPROM_FORMAT "/sys/bus/i2c/devices/%d-0050/eeprom"
|
||||
#define MODULE_PRESENT_FORMAT "/sys/bus/i2c/devices/0-00%d/module_present_%d"
|
||||
#define MODULE_RXLOS_FORMAT "/sys/bus/i2c/devices/0-00%d/module_rx_los_%d"
|
||||
#define MODULE_TXFAULT_FORMAT "/sys/bus/i2c/devices/0-00%d/module_tx_fault_%d"
|
||||
#define MODULE_TXDISABLE_FORMAT "/sys/bus/i2c/devices/0-00%d/module_tx_disable_%d"
|
||||
#define MODULE_PRESENT_ALL_ATTR_CPLD2 "/sys/bus/i2c/devices/0-0061/module_present_all"
|
||||
#define MODULE_PRESENT_ALL_ATTR_CPLD3 "/sys/bus/i2c/devices/0-0062/module_present_all"
|
||||
#define MODULE_RXLOS_ALL_ATTR_CPLD2 "/sys/bus/i2c/devices/0-0061/module_rx_los_all"
|
||||
#define MODULE_RXLOS_ALL_ATTR_CPLD3 "/sys/bus/i2c/devices/0-0062/module_rx_los_all"
|
||||
|
||||
static int front_port_bus_index(int port)
|
||||
static int front_port_to_cpld_mux_index(int port)
|
||||
{
|
||||
int rport = 0;
|
||||
|
||||
@@ -67,6 +63,38 @@ static int front_port_bus_index(int port)
|
||||
return (rport + CPLD_MUX_BUS_START_INDEX);
|
||||
}
|
||||
|
||||
static int
|
||||
as5712_54x_sfp_node_read_int(char *node_path, int *value, int data_len)
|
||||
{
|
||||
int ret = 0;
|
||||
char buf[8] = {0};
|
||||
*value = 0;
|
||||
|
||||
ret = deviceNodeReadString(node_path, buf, sizeof(buf), data_len);
|
||||
|
||||
if (ret == 0) {
|
||||
*value = atoi(buf);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char*
|
||||
as5712_54x_sfp_get_port_path_addr(int port, int addr, char *node_name)
|
||||
{
|
||||
sprintf(sfp_node_path, "/sys/bus/i2c/devices/%d-00%d/%s",
|
||||
front_port_to_cpld_mux_index(port), addr,
|
||||
node_name);
|
||||
return sfp_node_path;
|
||||
}
|
||||
|
||||
static char*
|
||||
as5712_54x_sfp_get_port_path(int port, char *node_name)
|
||||
{
|
||||
return as5712_54x_sfp_get_port_path_addr(port, 50, node_name);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************
|
||||
*
|
||||
* SFPI Entry Points
|
||||
@@ -175,10 +203,10 @@ onlp_sfpi_is_present(int port)
|
||||
* Return < 0 if error.
|
||||
*/
|
||||
int present;
|
||||
int addr = (port < 24) ? 61 : 62;
|
||||
|
||||
if (onlp_file_read_int(&present, MODULE_PRESENT_FORMAT, addr, (port+1)) < 0) {
|
||||
AIM_LOG_ERROR("Unable to read present status from port(%d)\r\n", port);
|
||||
char* path = as5712_54x_sfp_get_port_path(port, "sfp_is_present");
|
||||
|
||||
if (as5712_54x_sfp_node_read_int(path, &present, 1) != 0) {
|
||||
AIM_LOG_INFO("Unable to read present status from port(%d)\r\n", port);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
@@ -189,35 +217,29 @@ int
|
||||
onlp_sfpi_presence_bitmap_get(onlp_sfp_bitmap_t* dst)
|
||||
{
|
||||
uint32_t bytes[7];
|
||||
char* path;
|
||||
FILE* fp;
|
||||
|
||||
/* Read present status of port 0~23 */
|
||||
fp = fopen(MODULE_PRESENT_ALL_ATTR_CPLD2, "r");
|
||||
path = as5712_54x_sfp_get_port_path(0, "sfp_is_present_all");
|
||||
fp = fopen(path, "r");
|
||||
|
||||
if(fp == NULL) {
|
||||
AIM_LOG_ERROR("Unable to open the module_present_all device file of CPLD2.");
|
||||
AIM_LOG_ERROR("Unable to open the sfp_is_present_all device file.");
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
int count = fscanf(fp, "%x %x %x", bytes+0, bytes+1, bytes+2);
|
||||
int count = fscanf(fp, "%x %x %x %x %x %x %x",
|
||||
bytes+0,
|
||||
bytes+1,
|
||||
bytes+2,
|
||||
bytes+3,
|
||||
bytes+4,
|
||||
bytes+5,
|
||||
bytes+6
|
||||
);
|
||||
fclose(fp);
|
||||
if(count != 3) {
|
||||
if(count != AIM_ARRAYSIZE(bytes)) {
|
||||
/* Likely a CPLD read timeout. */
|
||||
AIM_LOG_ERROR("Unable to read all fields the module_present_all device file of CPLD2.");
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
/* Read present status of port 24~53 */
|
||||
fp = fopen(MODULE_PRESENT_ALL_ATTR_CPLD3, "r");
|
||||
if(fp == NULL) {
|
||||
AIM_LOG_ERROR("Unable to open the module_present_all device file of CPLD3.");
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
count = fscanf(fp, "%x %x %x %x", bytes+3, bytes+4, bytes+5, bytes+6);
|
||||
fclose(fp);
|
||||
if(count != 4) {
|
||||
/* Likely a CPLD read timeout. */
|
||||
AIM_LOG_ERROR("Unable to read all fields the module_present_all device file of CPLD3.");
|
||||
AIM_LOG_ERROR("Unable to read all fields from the sfp_is_present_all device file.");
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
@@ -246,39 +268,33 @@ onlp_sfpi_presence_bitmap_get(onlp_sfp_bitmap_t* dst)
|
||||
int
|
||||
onlp_sfpi_rx_los_bitmap_get(onlp_sfp_bitmap_t* dst)
|
||||
{
|
||||
uint32_t bytes[6];
|
||||
uint32_t *ptr = bytes;
|
||||
uint32_t bytes[7];
|
||||
char* path;
|
||||
FILE* fp;
|
||||
|
||||
/* Read present status of port 0~23 */
|
||||
int addr, i = 0;
|
||||
path = as5712_54x_sfp_get_port_path(0, "sfp_rx_los_all");
|
||||
fp = fopen(path, "r");
|
||||
|
||||
for (addr = 61; addr <= 62; addr++) {
|
||||
if (addr == 61) {
|
||||
fp = fopen(MODULE_RXLOS_ALL_ATTR_CPLD2, "r");
|
||||
}
|
||||
else {
|
||||
fp = fopen(MODULE_RXLOS_ALL_ATTR_CPLD3, "r");
|
||||
}
|
||||
|
||||
if(fp == NULL) {
|
||||
AIM_LOG_ERROR("Unable to open the module_rx_los_all device file of CPLD(0x%d)", addr);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
int count = fscanf(fp, "%x %x %x", ptr+0, ptr+1, ptr+2);
|
||||
fclose(fp);
|
||||
if(count != 3) {
|
||||
/* Likely a CPLD read timeout. */
|
||||
AIM_LOG_ERROR("Unable to read all fields from the module_rx_los_all device file of CPLD(0x%d)", addr);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
ptr += count;
|
||||
if(fp == NULL) {
|
||||
AIM_LOG_ERROR("Unable to open the sfp_rx_los_all device file.");
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
int count = fscanf(fp, "%x %x %x %x %x %x",
|
||||
bytes+0,
|
||||
bytes+1,
|
||||
bytes+2,
|
||||
bytes+3,
|
||||
bytes+4,
|
||||
bytes+5
|
||||
);
|
||||
fclose(fp);
|
||||
if(count != 6) {
|
||||
AIM_LOG_ERROR("Unable to read all fields from the sfp_rx_los_all device file.");
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
/* Convert to 64 bit integer in port order */
|
||||
i = 0;
|
||||
int i = 0;
|
||||
uint64_t rx_los_all = 0 ;
|
||||
for(i = 5; i >= 0; i--) {
|
||||
rx_los_all <<= 8;
|
||||
@@ -299,22 +315,18 @@ onlp_sfpi_rx_los_bitmap_get(onlp_sfp_bitmap_t* dst)
|
||||
int
|
||||
onlp_sfpi_eeprom_read(int port, uint8_t data[256])
|
||||
{
|
||||
char* path = as5712_54x_sfp_get_port_path(port, "sfp_eeprom");
|
||||
|
||||
/*
|
||||
* Read the SFP eeprom into data[]
|
||||
*
|
||||
* Return MISSING if SFP is missing.
|
||||
* Return OK if eeprom is read
|
||||
*/
|
||||
int size = 0;
|
||||
memset(data, 0, 256);
|
||||
|
||||
if(onlp_file_read(data, 256, &size, PORT_EEPROM_FORMAT, front_port_bus_index(port)) != ONLP_STATUS_OK) {
|
||||
AIM_LOG_ERROR("Unable to read eeprom from port(%d)\r\n", port);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
if (size != 256) {
|
||||
AIM_LOG_ERROR("Unable to read eeprom from port(%d), size is different!\r\n", port);
|
||||
if (deviceNodeReadBinary(path, (char*)data, 256, 256) != 0) {
|
||||
AIM_LOG_INFO("Unable to read eeprom from port(%d)\r\n", port);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
@@ -324,26 +336,11 @@ onlp_sfpi_eeprom_read(int port, uint8_t data[256])
|
||||
int
|
||||
onlp_sfpi_dom_read(int port, uint8_t data[256])
|
||||
{
|
||||
FILE* fp;
|
||||
char file[64] = {0};
|
||||
|
||||
sprintf(file, PORT_EEPROM_FORMAT, front_port_bus_index(port));
|
||||
fp = fopen(file, "r");
|
||||
if(fp == NULL) {
|
||||
AIM_LOG_ERROR("Unable to open the eeprom device file of port(%d)", port);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
char* path = as5712_54x_sfp_get_port_path_addr(port, 51, "sfp_eeprom");
|
||||
memset(data, 0, 256);
|
||||
|
||||
if (fseek(fp, 256, SEEK_CUR) != 0) {
|
||||
fclose(fp);
|
||||
AIM_LOG_ERROR("Unable to set the file position indicator of port(%d)", port);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
int ret = fread(data, 1, 256, fp);
|
||||
fclose(fp);
|
||||
if (ret != 256) {
|
||||
AIM_LOG_ERROR("Unable to read the module_eeprom device file of port(%d)", port);
|
||||
if (deviceNodeReadBinary(path, (char*)data, 256, 256) != 0) {
|
||||
AIM_LOG_INFO("Unable to read eeprom from port(%d)\r\n", port);
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
@@ -353,28 +350,28 @@ onlp_sfpi_dom_read(int port, uint8_t data[256])
|
||||
int
|
||||
onlp_sfpi_dev_readb(int port, uint8_t devaddr, uint8_t addr)
|
||||
{
|
||||
int bus = front_port_bus_index(port);
|
||||
int bus = front_port_to_cpld_mux_index(port);
|
||||
return onlp_i2c_readb(bus, devaddr, addr, ONLP_I2C_F_FORCE);
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sfpi_dev_writeb(int port, uint8_t devaddr, uint8_t addr, uint8_t value)
|
||||
{
|
||||
int bus = front_port_bus_index(port);
|
||||
int bus = front_port_to_cpld_mux_index(port);
|
||||
return onlp_i2c_writeb(bus, devaddr, addr, value, ONLP_I2C_F_FORCE);
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sfpi_dev_readw(int port, uint8_t devaddr, uint8_t addr)
|
||||
{
|
||||
int bus = front_port_bus_index(port);
|
||||
int bus = front_port_to_cpld_mux_index(port);
|
||||
return onlp_i2c_readw(bus, devaddr, addr, ONLP_I2C_F_FORCE);
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sfpi_dev_writew(int port, uint8_t devaddr, uint8_t addr, uint16_t value)
|
||||
{
|
||||
int bus = front_port_bus_index(port);
|
||||
int bus = front_port_to_cpld_mux_index(port);
|
||||
return onlp_i2c_writew(bus, devaddr, addr, value, ONLP_I2C_F_FORCE);
|
||||
}
|
||||
|
||||
@@ -387,13 +384,13 @@ onlp_sfpi_control_set(int port, onlp_sfp_control_t control, int value)
|
||||
return ONLP_STATUS_E_UNSUPPORTED;
|
||||
}
|
||||
|
||||
int addr = (port < 24) ? 61 : 62;
|
||||
|
||||
switch(control)
|
||||
{
|
||||
case ONLP_SFP_CONTROL_TX_DISABLE:
|
||||
{
|
||||
if (onlp_file_write_int(value, MODULE_TXDISABLE_FORMAT, addr, (port+1)) < 0) {
|
||||
char* path = as5712_54x_sfp_get_port_path(port, "sfp_tx_disable");
|
||||
|
||||
if (deviceNodeWriteInt(path, value, 0) != 0) {
|
||||
AIM_LOG_ERROR("Unable to set tx_disable status to port(%d)\r\n", port);
|
||||
rv = ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -415,18 +412,19 @@ int
|
||||
onlp_sfpi_control_get(int port, onlp_sfp_control_t control, int* value)
|
||||
{
|
||||
int rv;
|
||||
char* path = NULL;
|
||||
|
||||
if (port < 0 || port >= 48) {
|
||||
return ONLP_STATUS_E_UNSUPPORTED;
|
||||
}
|
||||
|
||||
int addr = (port < 24) ? 61 : 62;
|
||||
|
||||
switch(control)
|
||||
{
|
||||
case ONLP_SFP_CONTROL_RX_LOS:
|
||||
{
|
||||
if (onlp_file_read_int(value, MODULE_RXLOS_FORMAT, addr, (port+1)) < 0) {
|
||||
path = as5712_54x_sfp_get_port_path(port, "sfp_rx_loss");
|
||||
|
||||
if (as5712_54x_sfp_node_read_int(path, value, 1) != 0) {
|
||||
AIM_LOG_ERROR("Unable to read rx_loss status from port(%d)\r\n", port);
|
||||
rv = ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -438,7 +436,9 @@ onlp_sfpi_control_get(int port, onlp_sfp_control_t control, int* value)
|
||||
|
||||
case ONLP_SFP_CONTROL_TX_FAULT:
|
||||
{
|
||||
if (onlp_file_read_int(value, MODULE_TXFAULT_FORMAT, addr, (port+1)) < 0) {
|
||||
path = as5712_54x_sfp_get_port_path(port, "sfp_tx_fault");
|
||||
|
||||
if (as5712_54x_sfp_node_read_int(path, value, 1) != 0) {
|
||||
AIM_LOG_ERROR("Unable to read tx_fault status from port(%d)\r\n", port);
|
||||
rv = ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
@@ -450,7 +450,9 @@ onlp_sfpi_control_get(int port, onlp_sfp_control_t control, int* value)
|
||||
|
||||
case ONLP_SFP_CONTROL_TX_DISABLE:
|
||||
{
|
||||
if (onlp_file_read_int(value, MODULE_TXDISABLE_FORMAT, addr, (port+1)) < 0) {
|
||||
path = as5712_54x_sfp_get_port_path(port, "sfp_tx_disable");
|
||||
|
||||
if (as5712_54x_sfp_node_read_int(path, value, 0) != 0) {
|
||||
AIM_LOG_ERROR("Unable to read tx_disabled status from port(%d)\r\n", port);
|
||||
rv = ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
@@ -9,10 +9,9 @@ class OnlPlatform_x86_64_accton_as5712_54x_r0(OnlPlatformAccton,
|
||||
SYS_OBJECT_ID=".5712.54"
|
||||
|
||||
def baseconfig(self):
|
||||
self.insmod('optoe')
|
||||
self.insmod('cpr_4011_4mxx')
|
||||
self.insmod("ym2651y")
|
||||
for m in [ 'cpld', 'fan', 'psu', 'leds' ]:
|
||||
for m in [ 'cpld', 'fan', 'psu', 'leds', 'sfp' ]:
|
||||
self.insmod("x86-64-accton-as5712-54x-%s.ko" % m)
|
||||
|
||||
########### initialize I2C bus 0 ###########
|
||||
@@ -26,22 +25,15 @@ class OnlPlatform_x86_64_accton_as5712_54x_r0(OnlPlatformAccton,
|
||||
)
|
||||
# initialize SFP devices
|
||||
for port in range(1, 49):
|
||||
self.new_i2c_device('optoe2', 0x50, port+1)
|
||||
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, port+1), shell=True)
|
||||
self.new_i2c_device('as5712_54x_port%d' % port, 0x50, port+1)
|
||||
|
||||
# Initialize QSFP devices
|
||||
self.new_i2c_device('optoe1', 0x50, 50)
|
||||
self.new_i2c_device('optoe1', 0x50, 51)
|
||||
self.new_i2c_device('optoe1', 0x50, 52)
|
||||
self.new_i2c_device('optoe1', 0x50, 53)
|
||||
self.new_i2c_device('optoe1', 0x50, 54)
|
||||
self.new_i2c_device('optoe1', 0x50, 55)
|
||||
subprocess.call('echo port49 > /sys/bus/i2c/devices/50-0050/port_name', shell=True)
|
||||
subprocess.call('echo port52 > /sys/bus/i2c/devices/51-0050/port_name', shell=True)
|
||||
subprocess.call('echo port50 > /sys/bus/i2c/devices/52-0050/port_name', shell=True)
|
||||
subprocess.call('echo port53 > /sys/bus/i2c/devices/53-0050/port_name', shell=True)
|
||||
subprocess.call('echo port51 > /sys/bus/i2c/devices/54-0050/port_name', shell=True)
|
||||
subprocess.call('echo port54 > /sys/bus/i2c/devices/55-0050/port_name', shell=True)
|
||||
self.new_i2c_device('as5712_54x_port49', 0x50, 50)
|
||||
self.new_i2c_device('as5712_54x_port52', 0x50, 51)
|
||||
self.new_i2c_device('as5712_54x_port50', 0x50, 52)
|
||||
self.new_i2c_device('as5712_54x_port53', 0x50, 53)
|
||||
self.new_i2c_device('as5712_54x_port51', 0x50, 54)
|
||||
self.new_i2c_device('as5712_54x_port54', 0x50, 55)
|
||||
|
||||
########### initialize I2C bus 1 ###########
|
||||
self.new_i2c_devices(
|
||||
|
||||
Reference in New Issue
Block a user