mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-26 17:57:01 +00:00
1. Rename 54x to be 54xk.
2. IDPROM changes to I2C address 0x56 instead of 0x54. Signed-off-by: roy_lee <roy_lee@accton.com>
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
*x86*64*accton*as5916*54x*.mk
|
||||
*x86*64*accton*as5916*54xk*.mk
|
||||
onlpdump.mk
|
||||
|
||||
@@ -1 +1 @@
|
||||
!include $ONL_TEMPLATES/platform-modules.yml VENDOR=accton BASENAME=x86-64-accton-as5916-54x ARCH=amd64 KERNELS="onl-kernel-3.16-lts-x86-64-all:amd64"
|
||||
!include $ONL_TEMPLATES/platform-modules.yml VENDOR=accton BASENAME=x86-64-accton-as5916-54xk ARCH=amd64 KERNELS="onl-kernel-3.16-lts-x86-64-all:amd64"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
KERNELS := onl-kernel-3.16-lts-x86-64-all:amd64
|
||||
KMODULES := $(wildcard *.c)
|
||||
VENDOR := accton
|
||||
BASENAME := x86-64-accton-as5916-54x
|
||||
BASENAME := x86-64-accton-as5916-54xk
|
||||
ARCH := x86_64
|
||||
include $(ONL)/make/kmodule.mk
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* A hwmon driver for the Accton as5916 54x fan
|
||||
* A hwmon driver for the Accton as5916 54xk fan
|
||||
*
|
||||
* Copyright (C) 2016 Accton Technology Corporation.
|
||||
* Brandon Chuang <brandon_chuang@accton.com.tw>
|
||||
@@ -30,10 +30,10 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/dmi.h>
|
||||
|
||||
#define DRVNAME "as5916_54x_fan"
|
||||
#define DRVNAME "as5916_54xk_fan"
|
||||
#define MAX_FAN_SPEED_RPM 25500
|
||||
|
||||
static struct as5916_54x_fan_data *as5916_54x_fan_update_device(struct device *dev);
|
||||
static struct as5916_54xk_fan_data *as5916_54xk_fan_update_device(struct device *dev);
|
||||
static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, char *buf);
|
||||
static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da,
|
||||
const char *buf, size_t count);
|
||||
@@ -59,7 +59,7 @@ static const u8 fan_reg[] = {
|
||||
};
|
||||
|
||||
/* Each client has this additional data */
|
||||
struct as5916_54x_fan_data {
|
||||
struct as5916_54xk_fan_data {
|
||||
struct device *hwmon_dev;
|
||||
struct mutex update_lock;
|
||||
char valid; /* != 0 if registers are valid */
|
||||
@@ -171,7 +171,7 @@ DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(6);
|
||||
/* 1 fan duty cycle attribute in this platform */
|
||||
DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR();
|
||||
|
||||
static struct attribute *as5916_54x_fan_attributes[] = {
|
||||
static struct attribute *as5916_54xk_fan_attributes[] = {
|
||||
/* fan related attributes */
|
||||
DECLARE_FAN_FAULT_ATTR(1),
|
||||
DECLARE_FAN_FAULT_ATTR(2),
|
||||
@@ -206,12 +206,12 @@ static struct attribute *as5916_54x_fan_attributes[] = {
|
||||
#define FAN_MAX_DUTY_CYCLE 100
|
||||
#define FAN_REG_VAL_TO_SPEED_RPM_STEP 100
|
||||
|
||||
static int as5916_54x_fan_read_value(struct i2c_client *client, u8 reg)
|
||||
static int as5916_54xk_fan_read_value(struct i2c_client *client, u8 reg)
|
||||
{
|
||||
return i2c_smbus_read_byte_data(client, reg);
|
||||
}
|
||||
|
||||
static int as5916_54x_fan_write_value(struct i2c_client *client, u8 reg, u8 value)
|
||||
static int as5916_54xk_fan_write_value(struct i2c_client *client, u8 reg, u8 value)
|
||||
{
|
||||
return i2c_smbus_write_byte_data(client, reg, value);
|
||||
}
|
||||
@@ -244,7 +244,7 @@ static u8 reg_val_to_is_present(u8 reg_val, enum fan_id id)
|
||||
return !(reg_val & BIT(id));
|
||||
}
|
||||
|
||||
static u8 is_fan_fault(struct as5916_54x_fan_data *data, enum fan_id id)
|
||||
static u8 is_fan_fault(struct as5916_54xk_fan_data *data, enum fan_id id)
|
||||
{
|
||||
u8 ret = 1;
|
||||
int front_fan_index = FAN1_FRONT_SPEED_RPM + id;
|
||||
@@ -273,8 +273,8 @@ static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da,
|
||||
if (value < 0 || value > FAN_MAX_DUTY_CYCLE)
|
||||
return -EINVAL;
|
||||
|
||||
as5916_54x_fan_write_value(client, 0x33, 0); /* Disable fan speed watch dog */
|
||||
as5916_54x_fan_write_value(client, fan_reg[FAN_DUTY_CYCLE_PERCENTAGE], duty_cycle_to_reg_val(value));
|
||||
as5916_54xk_fan_write_value(client, 0x33, 0); /* Disable fan speed watch dog */
|
||||
as5916_54xk_fan_write_value(client, fan_reg[FAN_DUTY_CYCLE_PERCENTAGE], duty_cycle_to_reg_val(value));
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ static ssize_t fan_show_value(struct device *dev, struct device_attribute *da,
|
||||
char *buf)
|
||||
{
|
||||
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
|
||||
struct as5916_54x_fan_data *data = as5916_54x_fan_update_device(dev);
|
||||
struct as5916_54xk_fan_data *data = as5916_54xk_fan_update_device(dev);
|
||||
ssize_t ret = 0;
|
||||
|
||||
if (data->valid) {
|
||||
@@ -345,14 +345,14 @@ static ssize_t fan_show_value(struct device *dev, struct device_attribute *da,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct attribute_group as5916_54x_fan_group = {
|
||||
.attrs = as5916_54x_fan_attributes,
|
||||
static const struct attribute_group as5916_54xk_fan_group = {
|
||||
.attrs = as5916_54xk_fan_attributes,
|
||||
};
|
||||
|
||||
static struct as5916_54x_fan_data *as5916_54x_fan_update_device(struct device *dev)
|
||||
static struct as5916_54xk_fan_data *as5916_54xk_fan_update_device(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct as5916_54x_fan_data *data = i2c_get_clientdata(client);
|
||||
struct as5916_54xk_fan_data *data = i2c_get_clientdata(client);
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
@@ -360,13 +360,13 @@ static struct as5916_54x_fan_data *as5916_54x_fan_update_device(struct device *d
|
||||
!data->valid) {
|
||||
int i;
|
||||
|
||||
dev_dbg(&client->dev, "Starting as5916_54x_fan update\n");
|
||||
dev_dbg(&client->dev, "Starting as5916_54xk_fan update\n");
|
||||
data->valid = 0;
|
||||
|
||||
/* Update fan data
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(data->reg_val); i++) {
|
||||
int status = as5916_54x_fan_read_value(client, fan_reg[i]);
|
||||
int status = as5916_54xk_fan_read_value(client, fan_reg[i]);
|
||||
|
||||
if (status < 0) {
|
||||
data->valid = 0;
|
||||
@@ -388,10 +388,10 @@ static struct as5916_54x_fan_data *as5916_54x_fan_update_device(struct device *d
|
||||
return data;
|
||||
}
|
||||
|
||||
static int as5916_54x_fan_probe(struct i2c_client *client,
|
||||
static int as5916_54xk_fan_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *dev_id)
|
||||
{
|
||||
struct as5916_54x_fan_data *data;
|
||||
struct as5916_54xk_fan_data *data;
|
||||
int status;
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
|
||||
@@ -399,7 +399,7 @@ static int as5916_54x_fan_probe(struct i2c_client *client,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
data = kzalloc(sizeof(struct as5916_54x_fan_data), GFP_KERNEL);
|
||||
data = kzalloc(sizeof(struct as5916_54xk_fan_data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
status = -ENOMEM;
|
||||
goto exit;
|
||||
@@ -412,7 +412,7 @@ static int as5916_54x_fan_probe(struct i2c_client *client,
|
||||
dev_info(&client->dev, "chip found\n");
|
||||
|
||||
/* Register sysfs hooks */
|
||||
status = sysfs_create_group(&client->dev.kobj, &as5916_54x_fan_group);
|
||||
status = sysfs_create_group(&client->dev.kobj, &as5916_54xk_fan_group);
|
||||
if (status) {
|
||||
goto exit_free;
|
||||
}
|
||||
@@ -429,7 +429,7 @@ static int as5916_54x_fan_probe(struct i2c_client *client,
|
||||
return 0;
|
||||
|
||||
exit_remove:
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54x_fan_group);
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54xk_fan_group);
|
||||
exit_free:
|
||||
kfree(data);
|
||||
exit:
|
||||
@@ -437,11 +437,11 @@ exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
static int as5916_54x_fan_remove(struct i2c_client *client)
|
||||
static int as5916_54xk_fan_remove(struct i2c_client *client)
|
||||
{
|
||||
struct as5916_54x_fan_data *data = i2c_get_clientdata(client);
|
||||
struct as5916_54xk_fan_data *data = i2c_get_clientdata(client);
|
||||
hwmon_device_unregister(data->hwmon_dev);
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54x_fan_group);
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54xk_fan_group);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -449,37 +449,37 @@ static int as5916_54x_fan_remove(struct i2c_client *client)
|
||||
/* Addresses to scan */
|
||||
static const unsigned short normal_i2c[] = { 0x66, I2C_CLIENT_END };
|
||||
|
||||
static const struct i2c_device_id as5916_54x_fan_id[] = {
|
||||
{ "as5916_54x_fan", 0 },
|
||||
static const struct i2c_device_id as5916_54xk_fan_id[] = {
|
||||
{ "as5916_54xk_fan", 0 },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, as5916_54x_fan_id);
|
||||
MODULE_DEVICE_TABLE(i2c, as5916_54xk_fan_id);
|
||||
|
||||
static struct i2c_driver as5916_54x_fan_driver = {
|
||||
static struct i2c_driver as5916_54xk_fan_driver = {
|
||||
.class = I2C_CLASS_HWMON,
|
||||
.driver = {
|
||||
.name = DRVNAME,
|
||||
},
|
||||
.probe = as5916_54x_fan_probe,
|
||||
.remove = as5916_54x_fan_remove,
|
||||
.id_table = as5916_54x_fan_id,
|
||||
.probe = as5916_54xk_fan_probe,
|
||||
.remove = as5916_54xk_fan_remove,
|
||||
.id_table = as5916_54xk_fan_id,
|
||||
.address_list = normal_i2c,
|
||||
};
|
||||
|
||||
static int __init as5916_54x_fan_init(void)
|
||||
static int __init as5916_54xk_fan_init(void)
|
||||
{
|
||||
return i2c_add_driver(&as5916_54x_fan_driver);
|
||||
return i2c_add_driver(&as5916_54xk_fan_driver);
|
||||
}
|
||||
|
||||
static void __exit as5916_54x_fan_exit(void)
|
||||
static void __exit as5916_54xk_fan_exit(void)
|
||||
{
|
||||
i2c_del_driver(&as5916_54x_fan_driver);
|
||||
i2c_del_driver(&as5916_54xk_fan_driver);
|
||||
}
|
||||
|
||||
module_init(as5916_54x_fan_init);
|
||||
module_exit(as5916_54x_fan_exit);
|
||||
module_init(as5916_54xk_fan_init);
|
||||
module_exit(as5916_54xk_fan_exit);
|
||||
|
||||
MODULE_AUTHOR("Brandon Chuang <brandon_chuang@accton.com.tw>");
|
||||
MODULE_DESCRIPTION("as5916_54x_fan driver");
|
||||
MODULE_DESCRIPTION("as5916_54xk_fan driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* A LED driver for the accton_as5916_54x_led
|
||||
* A LED driver for the accton_as5916_54xk_led
|
||||
*
|
||||
* Copyright (C) 2016 Accton Technology Corporation.
|
||||
* Brandon Chuang <brandon_chuang@accton.com.tw>
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <linux/leds.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#define DRVNAME "accton_as5916_54x_led"
|
||||
#define DRVNAME "accton_as5916_54xk_led"
|
||||
|
||||
#define DEBUG_MODE 1
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
extern int accton_i2c_cpld_read(unsigned short cpld_addr, u8 reg);
|
||||
extern int accton_i2c_cpld_write(unsigned short cpld_addr, u8 reg, u8 value);
|
||||
|
||||
struct accton_as5916_54x_led_data {
|
||||
struct accton_as5916_54xk_led_data {
|
||||
struct platform_device *pdev;
|
||||
struct mutex update_lock;
|
||||
char valid; /* != 0 if registers are valid */
|
||||
@@ -51,7 +51,7 @@ struct accton_as5916_54x_led_data {
|
||||
2 ~ 4 = SYSTEM LED */
|
||||
};
|
||||
|
||||
static struct accton_as5916_54x_led_data *ledctl = NULL;
|
||||
static struct accton_as5916_54xk_led_data *ledctl = NULL;
|
||||
|
||||
#define LED_CNTRLER_I2C_ADDRESS (0x60)
|
||||
|
||||
@@ -155,17 +155,17 @@ static u8 led_light_mode_to_reg_val(enum led_type type,
|
||||
return reg_val;
|
||||
}
|
||||
|
||||
static int accton_as5916_54x_led_read_value(u8 reg)
|
||||
static int accton_as5916_54xk_led_read_value(u8 reg)
|
||||
{
|
||||
return accton_i2c_cpld_read(LED_CNTRLER_I2C_ADDRESS, reg);
|
||||
}
|
||||
|
||||
static int accton_as5916_54x_led_write_value(u8 reg, u8 value)
|
||||
static int accton_as5916_54xk_led_write_value(u8 reg, u8 value)
|
||||
{
|
||||
return accton_i2c_cpld_write(LED_CNTRLER_I2C_ADDRESS, reg, value);
|
||||
}
|
||||
|
||||
static void accton_as5916_54x_led_update(void)
|
||||
static void accton_as5916_54xk_led_update(void)
|
||||
{
|
||||
mutex_lock(&ledctl->update_lock);
|
||||
|
||||
@@ -173,13 +173,13 @@ static void accton_as5916_54x_led_update(void)
|
||||
|| !ledctl->valid) {
|
||||
int i;
|
||||
|
||||
dev_dbg(&ledctl->pdev->dev, "Starting accton_as5916_54x_led update\n");
|
||||
dev_dbg(&ledctl->pdev->dev, "Starting accton_as5916_54xk_led update\n");
|
||||
ledctl->valid = 0;
|
||||
|
||||
/* Update LED data
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(ledctl->reg_val); i++) {
|
||||
int status = accton_as5916_54x_led_read_value(led_reg[i]);
|
||||
int status = accton_as5916_54xk_led_read_value(led_reg[i]);
|
||||
|
||||
if (status < 0) {
|
||||
dev_dbg(&ledctl->pdev->dev, "reg %d, err %d\n", led_reg[i], status);
|
||||
@@ -197,14 +197,14 @@ exit:
|
||||
mutex_unlock(&ledctl->update_lock);
|
||||
}
|
||||
|
||||
static void accton_as5916_54x_led_set(struct led_classdev *led_cdev,
|
||||
static void accton_as5916_54xk_led_set(struct led_classdev *led_cdev,
|
||||
enum led_brightness led_light_mode,
|
||||
u8 reg, enum led_type type)
|
||||
{
|
||||
int reg_val;
|
||||
|
||||
mutex_lock(&ledctl->update_lock);
|
||||
reg_val = accton_as5916_54x_led_read_value(reg);
|
||||
reg_val = accton_as5916_54xk_led_read_value(reg);
|
||||
|
||||
if (reg_val < 0) {
|
||||
dev_dbg(&ledctl->pdev->dev, "reg %d, err %d\n", reg, reg_val);
|
||||
@@ -212,91 +212,91 @@ static void accton_as5916_54x_led_set(struct led_classdev *led_cdev,
|
||||
}
|
||||
|
||||
reg_val = led_light_mode_to_reg_val(type, led_light_mode, reg_val);
|
||||
accton_as5916_54x_led_write_value(reg, reg_val);
|
||||
accton_as5916_54xk_led_write_value(reg, reg_val);
|
||||
ledctl->valid = 0;
|
||||
|
||||
exit:
|
||||
mutex_unlock(&ledctl->update_lock);
|
||||
}
|
||||
|
||||
static void accton_as7312_54x_led_auto_set(struct led_classdev *led_cdev,
|
||||
static void accton_as7312_54xk_led_auto_set(struct led_classdev *led_cdev,
|
||||
enum led_brightness led_light_mode)
|
||||
{
|
||||
}
|
||||
|
||||
static enum led_brightness accton_as7312_54x_led_auto_get(struct led_classdev *cdev)
|
||||
static enum led_brightness accton_as7312_54xk_led_auto_get(struct led_classdev *cdev)
|
||||
{
|
||||
return LED_MODE_AUTO;
|
||||
}
|
||||
|
||||
static void accton_as5916_54x_led_diag_set(struct led_classdev *led_cdev,
|
||||
static void accton_as5916_54xk_led_diag_set(struct led_classdev *led_cdev,
|
||||
enum led_brightness led_light_mode)
|
||||
{
|
||||
accton_as5916_54x_led_set(led_cdev, led_light_mode, led_reg[0], LED_TYPE_DIAG);
|
||||
accton_as5916_54xk_led_set(led_cdev, led_light_mode, led_reg[0], LED_TYPE_DIAG);
|
||||
}
|
||||
|
||||
static enum led_brightness accton_as5916_54x_led_diag_get(struct led_classdev *cdev)
|
||||
static enum led_brightness accton_as5916_54xk_led_diag_get(struct led_classdev *cdev)
|
||||
{
|
||||
accton_as5916_54x_led_update();
|
||||
accton_as5916_54xk_led_update();
|
||||
return led_reg_val_to_light_mode(LED_TYPE_DIAG, ledctl->reg_val[0]);
|
||||
}
|
||||
|
||||
static enum led_brightness accton_as5916_54x_led_loc_get(struct led_classdev *cdev)
|
||||
static enum led_brightness accton_as5916_54xk_led_loc_get(struct led_classdev *cdev)
|
||||
{
|
||||
accton_as5916_54x_led_update();
|
||||
accton_as5916_54xk_led_update();
|
||||
return led_reg_val_to_light_mode(LED_TYPE_LOC, ledctl->reg_val[0]);
|
||||
}
|
||||
|
||||
static void accton_as5916_54x_led_loc_set(struct led_classdev *led_cdev,
|
||||
static void accton_as5916_54xk_led_loc_set(struct led_classdev *led_cdev,
|
||||
enum led_brightness led_light_mode)
|
||||
{
|
||||
accton_as5916_54x_led_set(led_cdev, led_light_mode, led_reg[0], LED_TYPE_LOC);
|
||||
accton_as5916_54xk_led_set(led_cdev, led_light_mode, led_reg[0], LED_TYPE_LOC);
|
||||
}
|
||||
|
||||
static struct led_classdev accton_as5916_54x_leds[] = {
|
||||
static struct led_classdev accton_as5916_54xk_leds[] = {
|
||||
[LED_TYPE_LOC] = {
|
||||
.name = "accton_as5916_54x_led::loc",
|
||||
.name = "accton_as5916_54xk_led::loc",
|
||||
.default_trigger = "unused",
|
||||
.brightness_set = accton_as5916_54x_led_loc_set,
|
||||
.brightness_get = accton_as5916_54x_led_loc_get,
|
||||
.brightness_set = accton_as5916_54xk_led_loc_set,
|
||||
.brightness_get = accton_as5916_54xk_led_loc_get,
|
||||
.max_brightness = LED_MODE_ORANGE,
|
||||
},
|
||||
[LED_TYPE_DIAG] = {
|
||||
.name = "accton_as5916_54x_led::diag",
|
||||
.name = "accton_as5916_54xk_led::diag",
|
||||
.default_trigger = "unused",
|
||||
.brightness_set = accton_as5916_54x_led_diag_set,
|
||||
.brightness_get = accton_as5916_54x_led_diag_get,
|
||||
.brightness_set = accton_as5916_54xk_led_diag_set,
|
||||
.brightness_get = accton_as5916_54xk_led_diag_get,
|
||||
.max_brightness = LED_MODE_GREEN,
|
||||
},
|
||||
[LED_TYPE_PSU1] = {
|
||||
.name = "accton_as5916_54x_led::psu1",
|
||||
.name = "accton_as5916_54xk_led::psu1",
|
||||
.default_trigger = "unused",
|
||||
.brightness_set = accton_as7312_54x_led_auto_set,
|
||||
.brightness_get = accton_as7312_54x_led_auto_get,
|
||||
.brightness_set = accton_as7312_54xk_led_auto_set,
|
||||
.brightness_get = accton_as7312_54xk_led_auto_get,
|
||||
.max_brightness = LED_MODE_AUTO,
|
||||
},
|
||||
[LED_TYPE_PSU2] = {
|
||||
.name = "accton_as5916_54x_led::psu2",
|
||||
.name = "accton_as5916_54xk_led::psu2",
|
||||
.default_trigger = "unused",
|
||||
.brightness_set = accton_as7312_54x_led_auto_set,
|
||||
.brightness_get = accton_as7312_54x_led_auto_get,
|
||||
.brightness_set = accton_as7312_54xk_led_auto_set,
|
||||
.brightness_get = accton_as7312_54xk_led_auto_get,
|
||||
.max_brightness = LED_MODE_AUTO,
|
||||
},
|
||||
[LED_TYPE_FAN] = {
|
||||
.name = "accton_as5916_54x_led::fan",
|
||||
.name = "accton_as5916_54xk_led::fan",
|
||||
.default_trigger = "unused",
|
||||
.brightness_set = accton_as7312_54x_led_auto_set,
|
||||
.brightness_get = accton_as7312_54x_led_auto_get,
|
||||
.brightness_set = accton_as7312_54xk_led_auto_set,
|
||||
.brightness_get = accton_as7312_54xk_led_auto_get,
|
||||
.max_brightness = LED_MODE_AUTO,
|
||||
},
|
||||
};
|
||||
|
||||
static int accton_as5916_54x_led_probe(struct platform_device *pdev)
|
||||
static int accton_as5916_54xk_led_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret, i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(accton_as5916_54x_leds); i++) {
|
||||
ret = led_classdev_register(&pdev->dev, &accton_as5916_54x_leds[i]);
|
||||
for (i = 0; i < ARRAY_SIZE(accton_as5916_54xk_leds); i++) {
|
||||
ret = led_classdev_register(&pdev->dev, &accton_as5916_54xk_leds[i]);
|
||||
|
||||
if (ret < 0) {
|
||||
break;
|
||||
@@ -304,48 +304,48 @@ static int accton_as5916_54x_led_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* Check if all LEDs were successfully registered */
|
||||
if (i != ARRAY_SIZE(accton_as5916_54x_leds)){
|
||||
if (i != ARRAY_SIZE(accton_as5916_54xk_leds)){
|
||||
int j;
|
||||
|
||||
/* only unregister the LEDs that were successfully registered */
|
||||
for (j = 0; j < i; j++) {
|
||||
led_classdev_unregister(&accton_as5916_54x_leds[i]);
|
||||
led_classdev_unregister(&accton_as5916_54xk_leds[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int accton_as5916_54x_led_remove(struct platform_device *pdev)
|
||||
static int accton_as5916_54xk_led_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(accton_as5916_54x_leds); i++) {
|
||||
led_classdev_unregister(&accton_as5916_54x_leds[i]);
|
||||
for (i = 0; i < ARRAY_SIZE(accton_as5916_54xk_leds); i++) {
|
||||
led_classdev_unregister(&accton_as5916_54xk_leds[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver accton_as5916_54x_led_driver = {
|
||||
.probe = accton_as5916_54x_led_probe,
|
||||
.remove = accton_as5916_54x_led_remove,
|
||||
static struct platform_driver accton_as5916_54xk_led_driver = {
|
||||
.probe = accton_as5916_54xk_led_probe,
|
||||
.remove = accton_as5916_54xk_led_remove,
|
||||
.driver = {
|
||||
.name = DRVNAME,
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init accton_as5916_54x_led_init(void)
|
||||
static int __init accton_as5916_54xk_led_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = platform_driver_register(&accton_as5916_54x_led_driver);
|
||||
ret = platform_driver_register(&accton_as5916_54xk_led_driver);
|
||||
if (ret < 0) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ledctl = kzalloc(sizeof(struct accton_as5916_54x_led_data), GFP_KERNEL);
|
||||
ledctl = kzalloc(sizeof(struct accton_as5916_54xk_led_data), GFP_KERNEL);
|
||||
if (!ledctl) {
|
||||
ret = -ENOMEM;
|
||||
goto exit_driver;
|
||||
@@ -364,23 +364,23 @@ static int __init accton_as5916_54x_led_init(void)
|
||||
exit_free:
|
||||
kfree(ledctl);
|
||||
exit_driver:
|
||||
platform_driver_unregister(&accton_as5916_54x_led_driver);
|
||||
platform_driver_unregister(&accton_as5916_54xk_led_driver);
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void __exit accton_as5916_54x_led_exit(void)
|
||||
static void __exit accton_as5916_54xk_led_exit(void)
|
||||
{
|
||||
platform_device_unregister(ledctl->pdev);
|
||||
platform_driver_unregister(&accton_as5916_54x_led_driver);
|
||||
platform_driver_unregister(&accton_as5916_54xk_led_driver);
|
||||
kfree(ledctl);
|
||||
}
|
||||
|
||||
late_initcall(accton_as5916_54x_led_init);
|
||||
module_exit(accton_as5916_54x_led_exit);
|
||||
late_initcall(accton_as5916_54xk_led_init);
|
||||
module_exit(accton_as5916_54xk_led_exit);
|
||||
|
||||
MODULE_AUTHOR("Brandon Chuang <brandon_chuang@accton.com.tw>");
|
||||
MODULE_DESCRIPTION("accton_as5916_54x_led driver");
|
||||
MODULE_DESCRIPTION("accton_as5916_54xk_led driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* An hwmon driver for accton as5916_54x Power Module
|
||||
* An hwmon driver for accton as5916_54xk Power Module
|
||||
*
|
||||
* Copyright (C) 2014 Accton Technology Corporation.
|
||||
* Brandon Chuang <brandon_chuang@accton.com.tw>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
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 as5916_54x_psu_read_block(struct i2c_client *client, u8 command, u8 *data,int data_len);
|
||||
static int as5916_54xk_psu_read_block(struct i2c_client *client, u8 command, u8 *data,int data_len);
|
||||
extern int accton_i2c_cpld_read(unsigned short cpld_addr, u8 reg);
|
||||
|
||||
/* Addresses scanned
|
||||
@@ -45,7 +45,7 @@ static const unsigned short normal_i2c[] = { I2C_CLIENT_END };
|
||||
|
||||
/* Each client has this additional data
|
||||
*/
|
||||
struct as5916_54x_psu_data {
|
||||
struct as5916_54xk_psu_data {
|
||||
struct device *hwmon_dev;
|
||||
struct mutex update_lock;
|
||||
char valid; /* !=0 if registers are valid */
|
||||
@@ -55,9 +55,9 @@ struct as5916_54x_psu_data {
|
||||
char model_name[9]; /* Model name, read from eeprom */
|
||||
};
|
||||
|
||||
static struct as5916_54x_psu_data *as5916_54x_psu_update_device(struct device *dev);
|
||||
static struct as5916_54xk_psu_data *as5916_54xk_psu_update_device(struct device *dev);
|
||||
|
||||
enum as5916_54x_psu_sysfs_attributes {
|
||||
enum as5916_54xk_psu_sysfs_attributes {
|
||||
PSU_PRESENT,
|
||||
PSU_MODEL_NAME,
|
||||
PSU_POWER_GOOD
|
||||
@@ -69,7 +69,7 @@ static SENSOR_DEVICE_ATTR(psu_present, S_IRUGO, show_status, NULL, PSU_PRE
|
||||
static SENSOR_DEVICE_ATTR(psu_model_name, S_IRUGO, show_model_name,NULL, PSU_MODEL_NAME);
|
||||
static SENSOR_DEVICE_ATTR(psu_power_good, S_IRUGO, show_status, NULL, PSU_POWER_GOOD);
|
||||
|
||||
static struct attribute *as5916_54x_psu_attributes[] = {
|
||||
static struct attribute *as5916_54xk_psu_attributes[] = {
|
||||
&sensor_dev_attr_psu_present.dev_attr.attr,
|
||||
&sensor_dev_attr_psu_model_name.dev_attr.attr,
|
||||
&sensor_dev_attr_psu_power_good.dev_attr.attr,
|
||||
@@ -80,7 +80,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da,
|
||||
char *buf)
|
||||
{
|
||||
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
|
||||
struct as5916_54x_psu_data *data = as5916_54x_psu_update_device(dev);
|
||||
struct as5916_54xk_psu_data *data = as5916_54xk_psu_update_device(dev);
|
||||
u8 status = 0;
|
||||
|
||||
if (attr->index == PSU_PRESENT) {
|
||||
@@ -96,19 +96,19 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da,
|
||||
static ssize_t show_model_name(struct device *dev, struct device_attribute *da,
|
||||
char *buf)
|
||||
{
|
||||
struct as5916_54x_psu_data *data = as5916_54x_psu_update_device(dev);
|
||||
struct as5916_54xk_psu_data *data = as5916_54xk_psu_update_device(dev);
|
||||
|
||||
return sprintf(buf, "%s\n", data->model_name);
|
||||
}
|
||||
|
||||
static const struct attribute_group as5916_54x_psu_group = {
|
||||
.attrs = as5916_54x_psu_attributes,
|
||||
static const struct attribute_group as5916_54xk_psu_group = {
|
||||
.attrs = as5916_54xk_psu_attributes,
|
||||
};
|
||||
|
||||
static int as5916_54x_psu_probe(struct i2c_client *client,
|
||||
static int as5916_54xk_psu_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *dev_id)
|
||||
{
|
||||
struct as5916_54x_psu_data *data;
|
||||
struct as5916_54xk_psu_data *data;
|
||||
int status;
|
||||
|
||||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
|
||||
@@ -116,7 +116,7 @@ static int as5916_54x_psu_probe(struct i2c_client *client,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
data = kzalloc(sizeof(struct as5916_54x_psu_data), GFP_KERNEL);
|
||||
data = kzalloc(sizeof(struct as5916_54xk_psu_data), GFP_KERNEL);
|
||||
if (!data) {
|
||||
status = -ENOMEM;
|
||||
goto exit;
|
||||
@@ -130,7 +130,7 @@ static int as5916_54x_psu_probe(struct i2c_client *client,
|
||||
dev_info(&client->dev, "chip found\n");
|
||||
|
||||
/* Register sysfs hooks */
|
||||
status = sysfs_create_group(&client->dev.kobj, &as5916_54x_psu_group);
|
||||
status = sysfs_create_group(&client->dev.kobj, &as5916_54xk_psu_group);
|
||||
if (status) {
|
||||
goto exit_free;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ static int as5916_54x_psu_probe(struct i2c_client *client,
|
||||
return 0;
|
||||
|
||||
exit_remove:
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54x_psu_group);
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54xk_psu_group);
|
||||
exit_free:
|
||||
kfree(data);
|
||||
exit:
|
||||
@@ -155,12 +155,12 @@ exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
static int as5916_54x_psu_remove(struct i2c_client *client)
|
||||
static int as5916_54xk_psu_remove(struct i2c_client *client)
|
||||
{
|
||||
struct as5916_54x_psu_data *data = i2c_get_clientdata(client);
|
||||
struct as5916_54xk_psu_data *data = i2c_get_clientdata(client);
|
||||
|
||||
hwmon_device_unregister(data->hwmon_dev);
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54x_psu_group);
|
||||
sysfs_remove_group(&client->dev.kobj, &as5916_54xk_psu_group);
|
||||
kfree(data);
|
||||
|
||||
return 0;
|
||||
@@ -168,29 +168,29 @@ static int as5916_54x_psu_remove(struct i2c_client *client)
|
||||
|
||||
enum psu_index
|
||||
{
|
||||
as5916_54x_psu1,
|
||||
as5916_54x_psu2
|
||||
as5916_54xk_psu1,
|
||||
as5916_54xk_psu2
|
||||
};
|
||||
|
||||
static const struct i2c_device_id as5916_54x_psu_id[] = {
|
||||
{ "as5916_54x_psu1", as5916_54x_psu1 },
|
||||
{ "as5916_54x_psu2", as5916_54x_psu2 },
|
||||
static const struct i2c_device_id as5916_54xk_psu_id[] = {
|
||||
{ "as5916_54xk_psu1", as5916_54xk_psu1 },
|
||||
{ "as5916_54xk_psu2", as5916_54xk_psu2 },
|
||||
{}
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, as5916_54x_psu_id);
|
||||
MODULE_DEVICE_TABLE(i2c, as5916_54xk_psu_id);
|
||||
|
||||
static struct i2c_driver as5916_54x_psu_driver = {
|
||||
static struct i2c_driver as5916_54xk_psu_driver = {
|
||||
.class = I2C_CLASS_HWMON,
|
||||
.driver = {
|
||||
.name = "as5916_54x_psu",
|
||||
.name = "as5916_54xk_psu",
|
||||
},
|
||||
.probe = as5916_54x_psu_probe,
|
||||
.remove = as5916_54x_psu_remove,
|
||||
.id_table = as5916_54x_psu_id,
|
||||
.probe = as5916_54xk_psu_probe,
|
||||
.remove = as5916_54xk_psu_remove,
|
||||
.id_table = as5916_54xk_psu_id,
|
||||
.address_list = normal_i2c,
|
||||
};
|
||||
|
||||
static int as5916_54x_psu_read_block(struct i2c_client *client, u8 command, u8 *data,
|
||||
static int as5916_54xk_psu_read_block(struct i2c_client *client, u8 command, u8 *data,
|
||||
int data_len)
|
||||
{
|
||||
int result = 0;
|
||||
@@ -219,10 +219,10 @@ static int as5916_54x_psu_read_block(struct i2c_client *client, u8 command, u8 *
|
||||
return result;
|
||||
}
|
||||
|
||||
static struct as5916_54x_psu_data *as5916_54x_psu_update_device(struct device *dev)
|
||||
static struct as5916_54xk_psu_data *as5916_54xk_psu_update_device(struct device *dev)
|
||||
{
|
||||
struct i2c_client *client = to_i2c_client(dev);
|
||||
struct as5916_54x_psu_data *data = i2c_get_clientdata(client);
|
||||
struct as5916_54xk_psu_data *data = i2c_get_clientdata(client);
|
||||
|
||||
mutex_lock(&data->update_lock);
|
||||
|
||||
@@ -231,7 +231,7 @@ static struct as5916_54x_psu_data *as5916_54x_psu_update_device(struct device *d
|
||||
int status;
|
||||
int power_good = 0;
|
||||
|
||||
dev_dbg(&client->dev, "Starting as5916_54x update\n");
|
||||
dev_dbg(&client->dev, "Starting as5916_54xk update\n");
|
||||
|
||||
/* Read psu status */
|
||||
status = accton_i2c_cpld_read(0x60, 0x2);
|
||||
@@ -248,7 +248,7 @@ static struct as5916_54x_psu_data *as5916_54x_psu_update_device(struct device *d
|
||||
power_good = data->status & BIT(3 - data->index);
|
||||
|
||||
if (power_good) {
|
||||
status = as5916_54x_psu_read_block(client, 0x20, data->model_name,
|
||||
status = as5916_54xk_psu_read_block(client, 0x20, data->model_name,
|
||||
ARRAY_SIZE(data->model_name)-1);
|
||||
|
||||
if (status < 0) {
|
||||
@@ -269,20 +269,20 @@ static struct as5916_54x_psu_data *as5916_54x_psu_update_device(struct device *d
|
||||
return data;
|
||||
}
|
||||
|
||||
static int __init as5916_54x_psu_init(void)
|
||||
static int __init as5916_54xk_psu_init(void)
|
||||
{
|
||||
return i2c_add_driver(&as5916_54x_psu_driver);
|
||||
return i2c_add_driver(&as5916_54xk_psu_driver);
|
||||
}
|
||||
|
||||
static void __exit as5916_54x_psu_exit(void)
|
||||
static void __exit as5916_54xk_psu_exit(void)
|
||||
{
|
||||
i2c_del_driver(&as5916_54x_psu_driver);
|
||||
i2c_del_driver(&as5916_54xk_psu_driver);
|
||||
}
|
||||
|
||||
module_init(as5916_54x_psu_init);
|
||||
module_exit(as5916_54x_psu_exit);
|
||||
module_init(as5916_54xk_psu_init);
|
||||
module_exit(as5916_54xk_psu_exit);
|
||||
|
||||
MODULE_AUTHOR("Brandon Chuang <brandon_chuang@accton.com.tw>");
|
||||
MODULE_DESCRIPTION("as5916_54x_psu driver");
|
||||
MODULE_DESCRIPTION("as5916_54xk_psu driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SFP driver for accton as5916_54x sfp
|
||||
* SFP driver for accton as5916_54xk sfp
|
||||
*
|
||||
* Copyright (C) Brandon Chuang <brandon_chuang@accton.com.tw>
|
||||
*
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#define DRIVER_NAME "as5916_54x_sfp" /* Platform dependent */
|
||||
#define DRIVER_NAME "as5916_54xk_sfp" /* Platform dependent */
|
||||
|
||||
#define DEBUG_MODE 0
|
||||
|
||||
@@ -181,30 +181,30 @@ static struct attribute *sfp_ddm_attributes[] = {
|
||||
#define CPLD_PORT_TO_FRONT_PORT(port) (port+1)
|
||||
|
||||
enum port_numbers {
|
||||
as5916_54x_sfp1, as5916_54x_sfp2, as5916_54x_sfp3, as5916_54x_sfp4, as5916_54x_sfp5, as5916_54x_sfp6, as5916_54x_sfp7, as5916_54x_sfp8,
|
||||
as5916_54x_sfp9, as5916_54x_sfp10, as5916_54x_sfp11, as5916_54x_sfp12, as5916_54x_sfp13, as5916_54x_sfp14, as5916_54x_sfp15, as5916_54x_sfp16,
|
||||
as5916_54x_sfp17, as5916_54x_sfp18, as5916_54x_sfp19, as5916_54x_sfp20, as5916_54x_sfp21, as5916_54x_sfp22, as5916_54x_sfp23, as5916_54x_sfp24,
|
||||
as5916_54x_sfp25, as5916_54x_sfp26, as5916_54x_sfp27, as5916_54x_sfp28, as5916_54x_sfp29, as5916_54x_sfp30, as5916_54x_sfp31, as5916_54x_sfp32,
|
||||
as5916_54x_sfp33, as5916_54x_sfp34, as5916_54x_sfp35, as5916_54x_sfp36, as5916_54x_sfp37, as5916_54x_sfp38, as5916_54x_sfp39, as5916_54x_sfp40,
|
||||
as5916_54x_sfp41, as5916_54x_sfp42, as5916_54x_sfp43, as5916_54x_sfp44, as5916_54x_sfp45, as5916_54x_sfp46, as5916_54x_sfp47, as5916_54x_sfp48,
|
||||
as5916_54x_sfp49, as5916_54x_sfp50, as5916_54x_sfp51, as5916_54x_sfp52, as5916_54x_sfp53, as5916_54x_sfp54
|
||||
as5916_54xk_sfp1, as5916_54xk_sfp2, as5916_54xk_sfp3, as5916_54xk_sfp4, as5916_54xk_sfp5, as5916_54xk_sfp6, as5916_54xk_sfp7, as5916_54xk_sfp8,
|
||||
as5916_54xk_sfp9, as5916_54xk_sfp10, as5916_54xk_sfp11, as5916_54xk_sfp12, as5916_54xk_sfp13, as5916_54xk_sfp14, as5916_54xk_sfp15, as5916_54xk_sfp16,
|
||||
as5916_54xk_sfp17, as5916_54xk_sfp18, as5916_54xk_sfp19, as5916_54xk_sfp20, as5916_54xk_sfp21, as5916_54xk_sfp22, as5916_54xk_sfp23, as5916_54xk_sfp24,
|
||||
as5916_54xk_sfp25, as5916_54xk_sfp26, as5916_54xk_sfp27, as5916_54xk_sfp28, as5916_54xk_sfp29, as5916_54xk_sfp30, as5916_54xk_sfp31, as5916_54xk_sfp32,
|
||||
as5916_54xk_sfp33, as5916_54xk_sfp34, as5916_54xk_sfp35, as5916_54xk_sfp36, as5916_54xk_sfp37, as5916_54xk_sfp38, as5916_54xk_sfp39, as5916_54xk_sfp40,
|
||||
as5916_54xk_sfp41, as5916_54xk_sfp42, as5916_54xk_sfp43, as5916_54xk_sfp44, as5916_54xk_sfp45, as5916_54xk_sfp46, as5916_54xk_sfp47, as5916_54xk_sfp48,
|
||||
as5916_54xk_sfp49, as5916_54xk_sfp50, as5916_54xk_sfp51, as5916_54xk_sfp52, as5916_54xk_sfp53, as5916_54xk_sfp54
|
||||
};
|
||||
|
||||
static const struct i2c_device_id sfp_device_id[] = {
|
||||
{ "as5916_54x_sfp1", as5916_54x_sfp1 }, { "as5916_54x_sfp2", as5916_54x_sfp2 }, { "as5916_54x_sfp3", as5916_54x_sfp3 }, { "as5916_54x_sfp4", as5916_54x_sfp4 },
|
||||
{ "as5916_54x_sfp5", as5916_54x_sfp5 }, { "as5916_54x_sfp6", as5916_54x_sfp6 }, { "as5916_54x_sfp7", as5916_54x_sfp7 }, { "as5916_54x_sfp8", as5916_54x_sfp8 },
|
||||
{ "as5916_54x_sfp9", as5916_54x_sfp9 }, { "as5916_54x_sfp10", as5916_54x_sfp10 }, { "as5916_54x_sfp11", as5916_54x_sfp11 }, { "as5916_54x_sfp12", as5916_54x_sfp12 },
|
||||
{ "as5916_54x_sfp13", as5916_54x_sfp13 }, { "as5916_54x_sfp14", as5916_54x_sfp14 }, { "as5916_54x_sfp15", as5916_54x_sfp15 }, { "as5916_54x_sfp16", as5916_54x_sfp16 },
|
||||
{ "as5916_54x_sfp17", as5916_54x_sfp17 }, { "as5916_54x_sfp18", as5916_54x_sfp18 }, { "as5916_54x_sfp19", as5916_54x_sfp19 }, { "as5916_54x_sfp20", as5916_54x_sfp20 },
|
||||
{ "as5916_54x_sfp21", as5916_54x_sfp21 }, { "as5916_54x_sfp22", as5916_54x_sfp22 }, { "as5916_54x_sfp23", as5916_54x_sfp23 }, { "as5916_54x_sfp24", as5916_54x_sfp24 },
|
||||
{ "as5916_54x_sfp25", as5916_54x_sfp25 }, { "as5916_54x_sfp26", as5916_54x_sfp26 }, { "as5916_54x_sfp27", as5916_54x_sfp27 }, { "as5916_54x_sfp28", as5916_54x_sfp28 },
|
||||
{ "as5916_54x_sfp29", as5916_54x_sfp29 }, { "as5916_54x_sfp30", as5916_54x_sfp30 }, { "as5916_54x_sfp31", as5916_54x_sfp31 }, { "as5916_54x_sfp32", as5916_54x_sfp32 },
|
||||
{ "as5916_54x_sfp33", as5916_54x_sfp33 }, { "as5916_54x_sfp34", as5916_54x_sfp34 }, { "as5916_54x_sfp35", as5916_54x_sfp35 }, { "as5916_54x_sfp36", as5916_54x_sfp36 },
|
||||
{ "as5916_54x_sfp37", as5916_54x_sfp37 }, { "as5916_54x_sfp38", as5916_54x_sfp38 }, { "as5916_54x_sfp39", as5916_54x_sfp39 }, { "as5916_54x_sfp40", as5916_54x_sfp40 },
|
||||
{ "as5916_54x_sfp41", as5916_54x_sfp41 }, { "as5916_54x_sfp42", as5916_54x_sfp42 }, { "as5916_54x_sfp43", as5916_54x_sfp43 }, { "as5916_54x_sfp44", as5916_54x_sfp44 },
|
||||
{ "as5916_54x_sfp45", as5916_54x_sfp45 }, { "as5916_54x_sfp46", as5916_54x_sfp46 }, { "as5916_54x_sfp47", as5916_54x_sfp47 }, { "as5916_54x_sfp48", as5916_54x_sfp48 },
|
||||
{ "as5916_54x_sfp49", as5916_54x_sfp49 }, { "as5916_54x_sfp50", as5916_54x_sfp50 }, { "as5916_54x_sfp51", as5916_54x_sfp51 }, { "as5916_54x_sfp52", as5916_54x_sfp52 },
|
||||
{ "as5916_54x_sfp53", as5916_54x_sfp53 }, { "as5916_54x_sfp54", as5916_54x_sfp54 },
|
||||
{ "as5916_54xk_sfp1", as5916_54xk_sfp1 }, { "as5916_54xk_sfp2", as5916_54xk_sfp2 }, { "as5916_54xk_sfp3", as5916_54xk_sfp3 }, { "as5916_54xk_sfp4", as5916_54xk_sfp4 },
|
||||
{ "as5916_54xk_sfp5", as5916_54xk_sfp5 }, { "as5916_54xk_sfp6", as5916_54xk_sfp6 }, { "as5916_54xk_sfp7", as5916_54xk_sfp7 }, { "as5916_54xk_sfp8", as5916_54xk_sfp8 },
|
||||
{ "as5916_54xk_sfp9", as5916_54xk_sfp9 }, { "as5916_54xk_sfp10", as5916_54xk_sfp10 }, { "as5916_54xk_sfp11", as5916_54xk_sfp11 }, { "as5916_54xk_sfp12", as5916_54xk_sfp12 },
|
||||
{ "as5916_54xk_sfp13", as5916_54xk_sfp13 }, { "as5916_54xk_sfp14", as5916_54xk_sfp14 }, { "as5916_54xk_sfp15", as5916_54xk_sfp15 }, { "as5916_54xk_sfp16", as5916_54xk_sfp16 },
|
||||
{ "as5916_54xk_sfp17", as5916_54xk_sfp17 }, { "as5916_54xk_sfp18", as5916_54xk_sfp18 }, { "as5916_54xk_sfp19", as5916_54xk_sfp19 }, { "as5916_54xk_sfp20", as5916_54xk_sfp20 },
|
||||
{ "as5916_54xk_sfp21", as5916_54xk_sfp21 }, { "as5916_54xk_sfp22", as5916_54xk_sfp22 }, { "as5916_54xk_sfp23", as5916_54xk_sfp23 }, { "as5916_54xk_sfp24", as5916_54xk_sfp24 },
|
||||
{ "as5916_54xk_sfp25", as5916_54xk_sfp25 }, { "as5916_54xk_sfp26", as5916_54xk_sfp26 }, { "as5916_54xk_sfp27", as5916_54xk_sfp27 }, { "as5916_54xk_sfp28", as5916_54xk_sfp28 },
|
||||
{ "as5916_54xk_sfp29", as5916_54xk_sfp29 }, { "as5916_54xk_sfp30", as5916_54xk_sfp30 }, { "as5916_54xk_sfp31", as5916_54xk_sfp31 }, { "as5916_54xk_sfp32", as5916_54xk_sfp32 },
|
||||
{ "as5916_54xk_sfp33", as5916_54xk_sfp33 }, { "as5916_54xk_sfp34", as5916_54xk_sfp34 }, { "as5916_54xk_sfp35", as5916_54xk_sfp35 }, { "as5916_54xk_sfp36", as5916_54xk_sfp36 },
|
||||
{ "as5916_54xk_sfp37", as5916_54xk_sfp37 }, { "as5916_54xk_sfp38", as5916_54xk_sfp38 }, { "as5916_54xk_sfp39", as5916_54xk_sfp39 }, { "as5916_54xk_sfp40", as5916_54xk_sfp40 },
|
||||
{ "as5916_54xk_sfp41", as5916_54xk_sfp41 }, { "as5916_54xk_sfp42", as5916_54xk_sfp42 }, { "as5916_54xk_sfp43", as5916_54xk_sfp43 }, { "as5916_54xk_sfp44", as5916_54xk_sfp44 },
|
||||
{ "as5916_54xk_sfp45", as5916_54xk_sfp45 }, { "as5916_54xk_sfp46", as5916_54xk_sfp46 }, { "as5916_54xk_sfp47", as5916_54xk_sfp47 }, { "as5916_54xk_sfp48", as5916_54xk_sfp48 },
|
||||
{ "as5916_54xk_sfp49", as5916_54xk_sfp49 }, { "as5916_54xk_sfp50", as5916_54xk_sfp50 }, { "as5916_54xk_sfp51", as5916_54xk_sfp51 }, { "as5916_54xk_sfp52", as5916_54xk_sfp52 },
|
||||
{ "as5916_54xk_sfp53", as5916_54xk_sfp53 }, { "as5916_54xk_sfp54", as5916_54xk_sfp54 },
|
||||
{ /* LIST END */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, sfp_device_id);
|
||||
@@ -351,7 +351,7 @@ static struct sfp_port_data* sfp_update_tx_rx_status(struct device *dev)
|
||||
return data;
|
||||
}
|
||||
|
||||
DEBUG_PRINT("Starting as5916_54x sfp tx rx status update");
|
||||
DEBUG_PRINT("Starting as5916_54xk sfp tx rx status update");
|
||||
mutex_lock(&data->update_lock);
|
||||
data->msa->valid = 0;
|
||||
memset(data->msa->status, 0, sizeof(data->msa->status));
|
||||
@@ -1220,7 +1220,7 @@ static int sfp_device_probe(struct i2c_client *client,
|
||||
data->port = dev_id->driver_data;
|
||||
data->client = client;
|
||||
|
||||
if (dev_id->driver_data >= as5916_54x_sfp1 && dev_id->driver_data <= as5916_54x_sfp48) {
|
||||
if (dev_id->driver_data >= as5916_54xk_sfp1 && dev_id->driver_data <= as5916_54xk_sfp48) {
|
||||
if (client->addr == SFP_EEPROM_A0_I2C_ADDR) {
|
||||
data->driver_type = DRIVER_TYPE_SFP_MSA;
|
||||
return sfp_msa_probe(client, dev_id, &data->msa);
|
||||
@@ -1230,7 +1230,7 @@ static int sfp_device_probe(struct i2c_client *client,
|
||||
return sfp_ddm_probe(client, dev_id, &data->ddm);
|
||||
}
|
||||
}
|
||||
else { /* as5916_54x_sfp49 ~ as5916_54x_sfp54 */
|
||||
else { /* as5916_54xk_sfp49 ~ as5916_54xk_sfp54 */
|
||||
if (client->addr == SFP_EEPROM_A0_I2C_ADDR) {
|
||||
data->driver_type = DRIVER_TYPE_QSFP;
|
||||
return qsfp_probe(client, dev_id, &data->qsfp);
|
||||
@@ -1306,7 +1306,7 @@ static void __exit sfp_exit(void)
|
||||
}
|
||||
|
||||
MODULE_AUTHOR("Brandon Chuang <brandon_chuang@accton.com.tw>");
|
||||
MODULE_DESCRIPTION("accton as5916_54x_sfp driver");
|
||||
MODULE_DESCRIPTION("accton as5916_54xk_sfp driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
late_initcall(sfp_init);
|
||||
|
||||
@@ -1 +1 @@
|
||||
!include $ONL_TEMPLATES/onlp-platform-revision.yml PLATFORM=x86-64-accton-as5916-54x ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu REVISION=r1
|
||||
!include $ONL_TEMPLATES/onlp-platform-revision.yml PLATFORM=x86-64-accton-as5916-54xk ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu REVISION=r1
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
############################################################
|
||||
include $(ONL)/make/config.amd64.mk
|
||||
|
||||
MODULE := libonlp-x86-64-accton-as5916-54x
|
||||
MODULE := libonlp-x86-64-accton-as5916-54xk
|
||||
include $(BUILDER)/standardinit.mk
|
||||
|
||||
DEPENDMODULES := AIM IOF x86_64_accton_as5916_54x onlplib
|
||||
DEPENDMODULES := AIM IOF x86_64_accton_as5916_54xk onlplib
|
||||
DEPENDMODULE_HEADERS := sff
|
||||
|
||||
include $(BUILDER)/dependmodules.mk
|
||||
|
||||
SHAREDLIB := libonlp-x86-64-accton-as5916-54x.so
|
||||
SHAREDLIB := libonlp-x86-64-accton-as5916-54xk.so
|
||||
$(SHAREDLIB)_TARGETS := $(ALL_TARGETS)
|
||||
include $(BUILDER)/so.mk
|
||||
.DEFAULT_GOAL := $(SHAREDLIB)
|
||||
|
||||
@@ -29,7 +29,7 @@ include $(ONL)/make/config.amd64.mk
|
||||
MODULE := onlpdump
|
||||
include $(BUILDER)/standardinit.mk
|
||||
|
||||
DEPENDMODULES := AIM IOF onlp x86_64_accton_as5916_54x onlplib onlp_platform_defaults sff cjson cjson_util timer_wheel OS
|
||||
DEPENDMODULES := AIM IOF onlp x86_64_accton_as5916_54xk onlplib onlp_platform_defaults sff cjson cjson_util timer_wheel OS
|
||||
|
||||
include $(BUILDER)/dependmodules.mk
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
name: x86_64_accton_as5916_54x
|
||||
name: x86_64_accton_as5916_54xk
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
#
|
||||
###############################################################################
|
||||
include ../../init.mk
|
||||
MODULE := x86_64_accton_as5916_54x
|
||||
AUTOMODULE := x86_64_accton_as5916_54x
|
||||
MODULE := x86_64_accton_as5916_54xk
|
||||
AUTOMODULE := x86_64_accton_as5916_54xk
|
||||
include $(BUILDER)/definemodule.mk
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_accton_as5916_54x README
|
||||
# x86_64_accton_as5916_54xk README
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_accton_as5916_54x Autogeneration
|
||||
# x86_64_accton_as5916_54xk Autogeneration
|
||||
#
|
||||
###############################################################################
|
||||
x86_64_accton_as5916_54x_AUTO_DEFS := module/auto/x86_64_accton_as5916_54x.yml
|
||||
x86_64_accton_as5916_54x_AUTO_DIRS := module/inc/x86_64_accton_as5916_54x module/src
|
||||
x86_64_accton_as5916_54xk_AUTO_DEFS := module/auto/x86_64_accton_as5916_54xk.yml
|
||||
x86_64_accton_as5916_54xk_AUTO_DIRS := module/inc/x86_64_accton_as5916_54xk module/src
|
||||
include $(BUILDER)/auto.mk
|
||||
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
###############################################################################
|
||||
#
|
||||
# x86_64_accton_as5916_54x Autogeneration Definitions.
|
||||
# x86_64_accton_as5916_54xk Autogeneration Definitions.
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
cdefs: &cdefs
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING:
|
||||
doc: "Include or exclude logging."
|
||||
default: 1
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT:
|
||||
doc: "Default enabled log options."
|
||||
default: AIM_LOG_OPTIONS_DEFAULT
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT:
|
||||
doc: "Default enabled log bits."
|
||||
default: AIM_LOG_BITS_DEFAULT
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT:
|
||||
doc: "Default enabled custom log bits."
|
||||
default: 0
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB:
|
||||
doc: "Default all porting macros to use the C standard libraries."
|
||||
default: 1
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS:
|
||||
doc: "Include standard library headers for stdlib porting macros."
|
||||
default: X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI:
|
||||
default: X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI:
|
||||
doc: "Include generic uCli support."
|
||||
default: 0
|
||||
- X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION:
|
||||
- X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION:
|
||||
doc: "Assume chassis fan direction is the same as the PSU fan direction."
|
||||
default: 0
|
||||
|
||||
|
||||
definitions:
|
||||
cdefs:
|
||||
X86_64_ACCTON_AS5916_54X_CONFIG_HEADER:
|
||||
X86_64_ACCTON_AS5916_54XK_CONFIG_HEADER:
|
||||
defs: *cdefs
|
||||
basename: x86_64_accton_as5916_54x_config
|
||||
basename: x86_64_accton_as5916_54xk_config
|
||||
|
||||
portingmacro:
|
||||
x86_64_accton_as5916_54x:
|
||||
x86_64_accton_as5916_54xk:
|
||||
macros:
|
||||
- malloc
|
||||
- free
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
/* <--auto.start.xmacro(ALL).define> */
|
||||
/* <auto.end.xmacro(ALL).define> */
|
||||
|
||||
@@ -1,102 +1,102 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* @file
|
||||
* @brief x86_64_accton_as5916_54x Configuration Header
|
||||
* @brief x86_64_accton_as5916_54xk Configuration Header
|
||||
*
|
||||
* @addtogroup x86_64_accton_as5916_54x-config
|
||||
* @addtogroup x86_64_accton_as5916_54xk-config
|
||||
* @{
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_ACCTON_AS5916_54X_CONFIG_H__
|
||||
#define __X86_64_ACCTON_AS5916_54X_CONFIG_H__
|
||||
#ifndef __X86_64_ACCTON_AS5916_54XK_CONFIG_H__
|
||||
#define __X86_64_ACCTON_AS5916_54XK_CONFIG_H__
|
||||
|
||||
#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG
|
||||
#include <global_custom_config.h>
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_INCLUDE_CUSTOM_CONFIG
|
||||
#include <x86_64_accton_as5916_54x_custom_config.h>
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_INCLUDE_CUSTOM_CONFIG
|
||||
#include <x86_64_accton_as5916_54xk_custom_config.h>
|
||||
#endif
|
||||
|
||||
/* <auto.start.cdefs(X86_64_ACCTON_AS5916_54X_CONFIG_HEADER).header> */
|
||||
/* <auto.start.cdefs(X86_64_ACCTON_AS5916_54XK_CONFIG_HEADER).header> */
|
||||
#include <AIM/aim.h>
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING
|
||||
*
|
||||
* Include or exclude logging. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING 1
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
*
|
||||
* Default enabled log options. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT
|
||||
*
|
||||
* Default enabled log bits. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
*
|
||||
* Default enabled custom log bits. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB
|
||||
*
|
||||
* Default all porting macros to use the C standard libraries. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB 1
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
*
|
||||
* Include standard library headers for stdlib porting macros. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI
|
||||
*
|
||||
* Include generic uCli support. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI 0
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
* X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
*
|
||||
* Assume chassis fan direction is the same as the PSU fan direction. */
|
||||
|
||||
|
||||
#ifndef X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
#define X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0
|
||||
#ifndef X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
#define X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION 0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -106,32 +106,32 @@
|
||||
*/
|
||||
|
||||
/** Configuration settings structure. */
|
||||
typedef struct x86_64_accton_as5916_54x_config_settings_s {
|
||||
typedef struct x86_64_accton_as5916_54xk_config_settings_s {
|
||||
/** name */
|
||||
const char* name;
|
||||
/** value */
|
||||
const char* value;
|
||||
} x86_64_accton_as5916_54x_config_settings_t;
|
||||
} x86_64_accton_as5916_54xk_config_settings_t;
|
||||
|
||||
/** Configuration settings table. */
|
||||
/** x86_64_accton_as5916_54x_config_settings table. */
|
||||
extern x86_64_accton_as5916_54x_config_settings_t x86_64_accton_as5916_54x_config_settings[];
|
||||
/** x86_64_accton_as5916_54xk_config_settings table. */
|
||||
extern x86_64_accton_as5916_54xk_config_settings_t x86_64_accton_as5916_54xk_config_settings[];
|
||||
|
||||
/**
|
||||
* @brief Lookup a configuration setting.
|
||||
* @param setting The name of the configuration option to lookup.
|
||||
*/
|
||||
const char* x86_64_accton_as5916_54x_config_lookup(const char* setting);
|
||||
const char* x86_64_accton_as5916_54xk_config_lookup(const char* setting);
|
||||
|
||||
/**
|
||||
* @brief Show the compile-time configuration.
|
||||
* @param pvs The output stream.
|
||||
*/
|
||||
int x86_64_accton_as5916_54x_config_show(struct aim_pvs_s* pvs);
|
||||
int x86_64_accton_as5916_54xk_config_show(struct aim_pvs_s* pvs);
|
||||
|
||||
/* <auto.end.cdefs(X86_64_ACCTON_AS5916_54X_CONFIG_HEADER).header> */
|
||||
/* <auto.end.cdefs(X86_64_ACCTON_AS5916_54XK_CONFIG_HEADER).header> */
|
||||
|
||||
#include "x86_64_accton_as5916_54x_porting.h"
|
||||
#include "x86_64_accton_as5916_54xk_porting.h"
|
||||
|
||||
#endif /* __X86_64_ACCTON_AS5916_54X_CONFIG_H__ */
|
||||
#endif /* __X86_64_ACCTON_AS5916_54XK_CONFIG_H__ */
|
||||
/* @} */
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* x86_64_accton_as5916_54x Doxygen Header
|
||||
* x86_64_accton_as5916_54xk Doxygen Header
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_ACCTON_AS5916_54X_DOX_H__
|
||||
#define __X86_64_ACCTON_AS5916_54X_DOX_H__
|
||||
#ifndef __X86_64_ACCTON_AS5916_54XK_DOX_H__
|
||||
#define __X86_64_ACCTON_AS5916_54XK_DOX_H__
|
||||
|
||||
/**
|
||||
* @defgroup x86_64_accton_as5916_54x x86_64_accton_as5916_54x - x86_64_accton_as5916_54x Description
|
||||
* @defgroup x86_64_accton_as5916_54xk x86_64_accton_as5916_54xk - x86_64_accton_as5916_54xk Description
|
||||
*
|
||||
|
||||
The documentation overview for this module should go here.
|
||||
@@ -15,12 +15,12 @@ The documentation overview for this module should go here.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup x86_64_accton_as5916_54x-x86_64_accton_as5916_54x Public Interface
|
||||
* @defgroup x86_64_accton_as5916_54x-config Compile Time Configuration
|
||||
* @defgroup x86_64_accton_as5916_54x-porting Porting Macros
|
||||
* @defgroup x86_64_accton_as5916_54xk-x86_64_accton_as5916_54xk Public Interface
|
||||
* @defgroup x86_64_accton_as5916_54xk-config Compile Time Configuration
|
||||
* @defgroup x86_64_accton_as5916_54xk-porting Porting Macros
|
||||
*
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* __X86_64_ACCTON_AS5916_54X_DOX_H__ */
|
||||
#endif /* __X86_64_ACCTON_AS5916_54XK_DOX_H__ */
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* @file
|
||||
* @brief x86_64_accton_as5916_54x Porting Macros.
|
||||
* @brief x86_64_accton_as5916_54xk Porting Macros.
|
||||
*
|
||||
* @addtogroup x86_64_accton_as5916_54x-porting
|
||||
* @addtogroup x86_64_accton_as5916_54xk-porting
|
||||
* @{
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __X86_64_ACCTON_AS5916_54X_PORTING_H__
|
||||
#define __X86_64_ACCTON_AS5916_54X_PORTING_H__
|
||||
#ifndef __X86_64_ACCTON_AS5916_54XK_PORTING_H__
|
||||
#define __X86_64_ACCTON_AS5916_54XK_PORTING_H__
|
||||
|
||||
|
||||
/* <auto.start.portingmacro(ALL).define> */
|
||||
#if X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1
|
||||
#if X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -20,88 +20,88 @@
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_MALLOC
|
||||
#ifndef x86_64_accton_as5916_54xk_MALLOC
|
||||
#if defined(GLOBAL_MALLOC)
|
||||
#define x86_64_accton_as5916_54x_MALLOC GLOBAL_MALLOC
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_MALLOC malloc
|
||||
#define x86_64_accton_as5916_54xk_MALLOC GLOBAL_MALLOC
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_MALLOC malloc
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_MALLOC is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_MALLOC is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_FREE
|
||||
#ifndef x86_64_accton_as5916_54xk_FREE
|
||||
#if defined(GLOBAL_FREE)
|
||||
#define x86_64_accton_as5916_54x_FREE GLOBAL_FREE
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_FREE free
|
||||
#define x86_64_accton_as5916_54xk_FREE GLOBAL_FREE
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_FREE free
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_FREE is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_FREE is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_MEMSET
|
||||
#ifndef x86_64_accton_as5916_54xk_MEMSET
|
||||
#if defined(GLOBAL_MEMSET)
|
||||
#define x86_64_accton_as5916_54x_MEMSET GLOBAL_MEMSET
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_MEMSET memset
|
||||
#define x86_64_accton_as5916_54xk_MEMSET GLOBAL_MEMSET
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_MEMSET memset
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_MEMSET is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_MEMSET is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_MEMCPY
|
||||
#ifndef x86_64_accton_as5916_54xk_MEMCPY
|
||||
#if defined(GLOBAL_MEMCPY)
|
||||
#define x86_64_accton_as5916_54x_MEMCPY GLOBAL_MEMCPY
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_MEMCPY memcpy
|
||||
#define x86_64_accton_as5916_54xk_MEMCPY GLOBAL_MEMCPY
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_MEMCPY memcpy
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_MEMCPY is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_MEMCPY is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_STRNCPY
|
||||
#ifndef x86_64_accton_as5916_54xk_STRNCPY
|
||||
#if defined(GLOBAL_STRNCPY)
|
||||
#define x86_64_accton_as5916_54x_STRNCPY GLOBAL_STRNCPY
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_STRNCPY strncpy
|
||||
#define x86_64_accton_as5916_54xk_STRNCPY GLOBAL_STRNCPY
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_STRNCPY strncpy
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_STRNCPY is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_STRNCPY is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_VSNPRINTF
|
||||
#ifndef x86_64_accton_as5916_54xk_VSNPRINTF
|
||||
#if defined(GLOBAL_VSNPRINTF)
|
||||
#define x86_64_accton_as5916_54x_VSNPRINTF GLOBAL_VSNPRINTF
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_VSNPRINTF vsnprintf
|
||||
#define x86_64_accton_as5916_54xk_VSNPRINTF GLOBAL_VSNPRINTF
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_VSNPRINTF vsnprintf
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_VSNPRINTF is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_VSNPRINTF is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_SNPRINTF
|
||||
#ifndef x86_64_accton_as5916_54xk_SNPRINTF
|
||||
#if defined(GLOBAL_SNPRINTF)
|
||||
#define x86_64_accton_as5916_54x_SNPRINTF GLOBAL_SNPRINTF
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_SNPRINTF snprintf
|
||||
#define x86_64_accton_as5916_54xk_SNPRINTF GLOBAL_SNPRINTF
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_SNPRINTF snprintf
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_SNPRINTF is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_SNPRINTF is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef x86_64_accton_as5916_54x_STRLEN
|
||||
#ifndef x86_64_accton_as5916_54xk_STRLEN
|
||||
#if defined(GLOBAL_STRLEN)
|
||||
#define x86_64_accton_as5916_54x_STRLEN GLOBAL_STRLEN
|
||||
#elif X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54x_STRLEN strlen
|
||||
#define x86_64_accton_as5916_54xk_STRLEN GLOBAL_STRLEN
|
||||
#elif X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB == 1
|
||||
#define x86_64_accton_as5916_54xk_STRLEN strlen
|
||||
#else
|
||||
#error The macro x86_64_accton_as5916_54x_STRLEN is required but cannot be defined.
|
||||
#error The macro x86_64_accton_as5916_54xk_STRLEN is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* <auto.end.portingmacro(ALL).define> */
|
||||
|
||||
|
||||
#endif /* __X86_64_ACCTON_AS5916_54X_PORTING_H__ */
|
||||
#endif /* __X86_64_ACCTON_AS5916_54XK_PORTING_H__ */
|
||||
/* @} */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
###############################################################################
|
||||
THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
x86_64_accton_as5916_54x_INCLUDES := -I $(THIS_DIR)inc
|
||||
x86_64_accton_as5916_54x_INTERNAL_INCLUDES := -I $(THIS_DIR)src
|
||||
x86_64_accton_as5916_54x_DEPENDMODULE_ENTRIES := init:x86_64_accton_as5916_54x ucli:x86_64_accton_as5916_54x
|
||||
x86_64_accton_as5916_54xk_INCLUDES := -I $(THIS_DIR)inc
|
||||
x86_64_accton_as5916_54xk_INTERNAL_INCLUDES := -I $(THIS_DIR)src
|
||||
x86_64_accton_as5916_54xk_DEPENDMODULE_ENTRIES := init:x86_64_accton_as5916_54xk ucli:x86_64_accton_as5916_54xk
|
||||
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
###############################################################################
|
||||
|
||||
ucli:
|
||||
@../../../../tools/uclihandlers.py x86_64_accton_as5916_54x_ucli.c
|
||||
@../../../../tools/uclihandlers.py x86_64_accton_as5916_54xk_ucli.c
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <onlp/platformi/ledi.h>
|
||||
#include "platform_lib.h"
|
||||
|
||||
#define LED_FORMAT "/sys/class/leds/accton_as5916_54x_led::%s/brightness"
|
||||
#define LED_FORMAT "/sys/class/leds/accton_as5916_54xk_led::%s/brightness"
|
||||
|
||||
#define VALIDATE(_id) \
|
||||
do { \
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
LIBRARY := x86_64_accton_as5916_54x
|
||||
LIBRARY := x86_64_accton_as5916_54xk
|
||||
$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
include $(BUILDER)/lib.mk
|
||||
|
||||
4
packages/platforms/accton/x86-64/x86-64-accton-as5916-54xk/onlp/builds/src/module/src/platform_lib.h
Normal file → Executable file
4
packages/platforms/accton/x86-64/x86-64-accton-as5916-54xk/onlp/builds/src/module/src/platform_lib.h
Normal file → Executable file
@@ -26,7 +26,7 @@
|
||||
#ifndef __PLATFORM_LIB_H__
|
||||
#define __PLATFORM_LIB_H__
|
||||
|
||||
#include "x86_64_accton_as5916_54x_log.h"
|
||||
#include "x86_64_accton_as5916_54xk_log.h"
|
||||
|
||||
#define CHASSIS_FAN_COUNT 6
|
||||
#define CHASSIS_THERMAL_COUNT 5
|
||||
@@ -51,7 +51,7 @@
|
||||
#define FAN_BOARD_PATH "/sys/bus/i2c/devices/9-0066/"
|
||||
#define FAN_NODE(node) FAN_BOARD_PATH#node
|
||||
|
||||
#define IDPROM_PATH "/sys/bus/i2c/devices/0-0054/eeprom"
|
||||
#define IDPROM_PATH "/sys/bus/i2c/devices/0-0056/eeprom"
|
||||
|
||||
enum onlp_thermal_id
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <onlplib/file.h>
|
||||
#include "platform_lib.h"
|
||||
|
||||
#include "x86_64_accton_as5916_54x_log.h"
|
||||
#include "x86_64_accton_as5916_54xk_log.h"
|
||||
|
||||
#define NUM_OF_SFP_PORT 54
|
||||
#define MAX_PORT_PATH 64
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
#include <onlp/platformi/psui.h>
|
||||
#include "platform_lib.h"
|
||||
|
||||
#include "x86_64_accton_as5916_54x_int.h"
|
||||
#include "x86_64_accton_as5916_54x_log.h"
|
||||
#include "x86_64_accton_as5916_54xk_int.h"
|
||||
#include "x86_64_accton_as5916_54xk_log.h"
|
||||
|
||||
#define CPLD_VERSION_FORMAT "/sys/bus/i2c/devices/%s/version"
|
||||
#define NUM_OF_CPLD 2
|
||||
@@ -49,7 +49,7 @@ static char* cpld_path[NUM_OF_CPLD] =
|
||||
const char*
|
||||
onlp_sysi_platform_get(void)
|
||||
{
|
||||
return "x86-64-accton-as5916-54x-r1";
|
||||
return "x86-64-accton-as5916-54xk-r1";
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -3,78 +3,78 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
/* <auto.start.cdefs(x86_64_accton_as5916_54x_CONFIG_HEADER).source> */
|
||||
#define __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(_x) #_x
|
||||
#define __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(_x) __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(_x)
|
||||
x86_64_accton_as5916_54x_config_settings_t x86_64_accton_as5916_54x_config_settings[] =
|
||||
/* <auto.start.cdefs(x86_64_accton_as5916_54xk_CONFIG_HEADER).source> */
|
||||
#define __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(_x) #_x
|
||||
#define __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(_x) __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(_x)
|
||||
x86_64_accton_as5916_54xk_config_settings_t x86_64_accton_as5916_54xk_config_settings[] =
|
||||
{
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_LOGGING(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_LOGGING(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_STDLIB(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_STDLIB(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_UCLI(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_UCLI(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
{ __x86_64_accton_as5916_54x_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) },
|
||||
#ifdef X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION
|
||||
{ __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME(X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION), __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE(X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION) },
|
||||
#else
|
||||
{ X86_64_ACCTON_AS5916_54X_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_accton_as5916_54x_config_STRINGIFY_NAME), "__undefined__" },
|
||||
{ X86_64_ACCTON_AS5916_54XK_CONFIG_INCLUDE_DEFAULT_FAN_DIRECTION(__x86_64_accton_as5916_54xk_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#undef __x86_64_accton_as5916_54x_config_STRINGIFY_VALUE
|
||||
#undef __x86_64_accton_as5916_54x_config_STRINGIFY_NAME
|
||||
#undef __x86_64_accton_as5916_54xk_config_STRINGIFY_VALUE
|
||||
#undef __x86_64_accton_as5916_54xk_config_STRINGIFY_NAME
|
||||
|
||||
const char*
|
||||
x86_64_accton_as5916_54x_config_lookup(const char* setting)
|
||||
x86_64_accton_as5916_54xk_config_lookup(const char* setting)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; x86_64_accton_as5916_54x_config_settings[i].name; i++) {
|
||||
if(strcmp(x86_64_accton_as5916_54x_config_settings[i].name, setting)) {
|
||||
return x86_64_accton_as5916_54x_config_settings[i].value;
|
||||
for(i = 0; x86_64_accton_as5916_54xk_config_settings[i].name; i++) {
|
||||
if(strcmp(x86_64_accton_as5916_54xk_config_settings[i].name, setting)) {
|
||||
return x86_64_accton_as5916_54xk_config_settings[i].value;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
x86_64_accton_as5916_54x_config_show(struct aim_pvs_s* pvs)
|
||||
x86_64_accton_as5916_54xk_config_show(struct aim_pvs_s* pvs)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; x86_64_accton_as5916_54x_config_settings[i].name; i++) {
|
||||
aim_printf(pvs, "%s = %s\n", x86_64_accton_as5916_54x_config_settings[i].name, x86_64_accton_as5916_54x_config_settings[i].value);
|
||||
for(i = 0; x86_64_accton_as5916_54xk_config_settings[i].name; i++) {
|
||||
aim_printf(pvs, "%s = %s\n", x86_64_accton_as5916_54xk_config_settings[i].name, x86_64_accton_as5916_54xk_config_settings[i].value);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/* <auto.end.cdefs(x86_64_accton_as5916_54x_CONFIG_HEADER).source> */
|
||||
/* <auto.end.cdefs(x86_64_accton_as5916_54xk_CONFIG_HEADER).source> */
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
/* <--auto.start.enum(ALL).source> */
|
||||
/* <auto.end.enum(ALL).source> */
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* x86_64_accton_as5916_54x Internal Header
|
||||
* x86_64_accton_as5916_54xk Internal Header
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __x86_64_accton_as5916_54x_INT_H__
|
||||
#define __x86_64_accton_as5916_54x_INT_H__
|
||||
#ifndef __x86_64_accton_as5916_54xk_INT_H__
|
||||
#define __x86_64_accton_as5916_54xk_INT_H__
|
||||
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
|
||||
#endif /* __x86_64_accton_as5916_54x_INT_H__ */
|
||||
#endif /* __x86_64_accton_as5916_54xk_INT_H__ */
|
||||
@@ -3,16 +3,16 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
#include "x86_64_accton_as5916_54x_log.h"
|
||||
#include "x86_64_accton_as5916_54xk_log.h"
|
||||
/*
|
||||
* x86_64_accton_as5916_54x log struct.
|
||||
* x86_64_accton_as5916_54xk log struct.
|
||||
*/
|
||||
AIM_LOG_STRUCT_DEFINE(
|
||||
X86_64_ACCTON_AS5916_54X_CONFIG_LOG_OPTIONS_DEFAULT,
|
||||
X86_64_ACCTON_AS5916_54X_CONFIG_LOG_BITS_DEFAULT,
|
||||
X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_OPTIONS_DEFAULT,
|
||||
X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_BITS_DEFAULT,
|
||||
NULL, /* Custom log map */
|
||||
X86_64_ACCTON_AS5916_54X_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
X86_64_ACCTON_AS5916_54XK_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
);
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __x86_64_accton_as5916_54x_LOG_H__
|
||||
#define __x86_64_accton_as5916_54x_LOG_H__
|
||||
#ifndef __x86_64_accton_as5916_54xk_LOG_H__
|
||||
#define __x86_64_accton_as5916_54xk_LOG_H__
|
||||
|
||||
#define AIM_LOG_MODULE_NAME x86_64_accton_as5916_54x
|
||||
#define AIM_LOG_MODULE_NAME x86_64_accton_as5916_54xk
|
||||
#include <AIM/aim_log.h>
|
||||
|
||||
#endif /* __x86_64_accton_as5916_54x_LOG_H__ */
|
||||
#endif /* __x86_64_accton_as5916_54xk_LOG_H__ */
|
||||
@@ -3,19 +3,19 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
#include "x86_64_accton_as5916_54x_log.h"
|
||||
#include "x86_64_accton_as5916_54xk_log.h"
|
||||
|
||||
static int
|
||||
datatypes_init__(void)
|
||||
{
|
||||
#define x86_64_accton_as5916_54x_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL);
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x.x>
|
||||
#define x86_64_accton_as5916_54xk_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL);
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk.x>
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __x86_64_accton_as5916_54x_module_init__(void)
|
||||
void __x86_64_accton_as5916_54xk_module_init__(void)
|
||||
{
|
||||
AIM_LOG_STRUCT_REGISTER();
|
||||
datatypes_init__();
|
||||
|
||||
@@ -3,46 +3,46 @@
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
#include <x86_64_accton_as5916_54x/x86_64_accton_as5916_54x_config.h>
|
||||
#include <x86_64_accton_as5916_54xk/x86_64_accton_as5916_54xk_config.h>
|
||||
|
||||
#if x86_64_accton_as5916_54x_CONFIG_INCLUDE_UCLI == 1
|
||||
#if x86_64_accton_as5916_54xk_CONFIG_INCLUDE_UCLI == 1
|
||||
|
||||
#include <uCli/ucli.h>
|
||||
#include <uCli/ucli_argparse.h>
|
||||
#include <uCli/ucli_handler_macros.h>
|
||||
|
||||
static ucli_status_t
|
||||
x86_64_accton_as5916_54x_ucli_ucli__config__(ucli_context_t* uc)
|
||||
x86_64_accton_as5916_54xk_ucli_ucli__config__(ucli_context_t* uc)
|
||||
{
|
||||
UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_accton_as5916_54x)
|
||||
UCLI_HANDLER_MACRO_MODULE_CONFIG(x86_64_accton_as5916_54xk)
|
||||
}
|
||||
|
||||
/* <auto.ucli.handlers.start> */
|
||||
/* <auto.ucli.handlers.end> */
|
||||
|
||||
static ucli_module_t
|
||||
x86_64_accton_as5916_54x_ucli_module__ =
|
||||
x86_64_accton_as5916_54xk_ucli_module__ =
|
||||
{
|
||||
"x86_64_accton_as5916_54x_ucli",
|
||||
"x86_64_accton_as5916_54xk_ucli",
|
||||
NULL,
|
||||
x86_64_accton_as5916_54x_ucli_ucli_handlers__,
|
||||
x86_64_accton_as5916_54xk_ucli_ucli_handlers__,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
ucli_node_t*
|
||||
x86_64_accton_as5916_54x_ucli_node_create(void)
|
||||
x86_64_accton_as5916_54xk_ucli_node_create(void)
|
||||
{
|
||||
ucli_node_t* n;
|
||||
ucli_module_init(&x86_64_accton_as5916_54x_ucli_module__);
|
||||
n = ucli_node_create("x86_64_accton_as5916_54x", NULL, &x86_64_accton_as5916_54x_ucli_module__);
|
||||
ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_accton_as5916_54x"));
|
||||
ucli_module_init(&x86_64_accton_as5916_54xk_ucli_module__);
|
||||
n = ucli_node_create("x86_64_accton_as5916_54xk", NULL, &x86_64_accton_as5916_54xk_ucli_module__);
|
||||
ucli_node_subnode_add(n, ucli_module_log_node_create("x86_64_accton_as5916_54xk"));
|
||||
return n;
|
||||
}
|
||||
|
||||
#else
|
||||
void*
|
||||
x86_64_accton_as5916_54x_ucli_node_create(void)
|
||||
x86_64_accton_as5916_54xk_ucli_node_create(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=accton BASENAME=x86-64-accton-as5916-54x REVISION=r1
|
||||
!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=amd64 VENDOR=accton BASENAME=x86-64-accton-as5916-54xk REVISION=r1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#
|
||||
######################################################################
|
||||
|
||||
x86-64-accton-as5916-54x-r1:
|
||||
x86-64-accton-as5916-54xk-r1:
|
||||
|
||||
grub:
|
||||
|
||||
|
||||
22
packages/platforms/accton/x86-64/x86-64-accton-as5916-54xk/platform-config/r1/src/python/x86_64_accton_as5916_54xk_r1/__init__.py
Normal file → Executable file
22
packages/platforms/accton/x86-64/x86-64-accton-as5916-54xk/platform-config/r1/src/python/x86_64_accton_as5916_54xk_r1/__init__.py
Normal file → Executable file
@@ -1,17 +1,17 @@
|
||||
from onl.platform.base import *
|
||||
from onl.platform.accton import *
|
||||
|
||||
class OnlPlatform_x86_64_accton_as5916_54x_r1(OnlPlatformAccton,
|
||||
class OnlPlatform_x86_64_accton_as5916_54xk_r1(OnlPlatformAccton,
|
||||
OnlPlatformPortConfig_48x10_6x40):
|
||||
PLATFORM='x86-64-accton-as5916-54x-r1'
|
||||
MODEL="AS5916-54X"
|
||||
PLATFORM='x86-64-accton-as5916-54xk-r1'
|
||||
MODEL="AS5916-54XK"
|
||||
SYS_OBJECT_ID=".5916.54"
|
||||
|
||||
def baseconfig(self):
|
||||
self.insmod("accton_i2c_cpld")
|
||||
self.insmod("ym2651y")
|
||||
for m in [ "sfp", "psu", "fan", "leds" ]:
|
||||
self.insmod("x86-64-accton-as5916-54x-%s" % m)
|
||||
self.insmod("x86-64-accton-as5916-54xk-%s" % m)
|
||||
|
||||
########### initialize I2C bus 0 ###########
|
||||
self.new_i2c_devices(
|
||||
@@ -21,7 +21,7 @@ class OnlPlatform_x86_64_accton_as5916_54x_r1(OnlPlatformAccton,
|
||||
('pca9548', 0x76, 1),
|
||||
|
||||
# initiate chassis fan
|
||||
('as5916_54x_fan', 0x66, 9),
|
||||
('as5916_54xk_fan', 0x66, 9),
|
||||
|
||||
# inititate LM75
|
||||
('lm75', 0x48, 10),
|
||||
@@ -37,11 +37,11 @@ class OnlPlatform_x86_64_accton_as5916_54x_r1(OnlPlatformAccton,
|
||||
('pca9548', 0x74, 2),
|
||||
|
||||
# initiate PSU-1 AC Power
|
||||
('as5916_54x_psu1', 0x53, 18),
|
||||
('as5916_54xk_psu1', 0x53, 18),
|
||||
('ym2651', 0x5b, 18),
|
||||
|
||||
# initiate PSU-2 AC Power
|
||||
('as5916_54x_psu2', 0x50, 17),
|
||||
('as5916_54xk_psu2', 0x50, 17),
|
||||
('ym2651', 0x58, 17),
|
||||
|
||||
# initialize multiplexer (PCA9548)
|
||||
@@ -55,18 +55,18 @@ class OnlPlatform_x86_64_accton_as5916_54x_r1(OnlPlatformAccton,
|
||||
('pca9548', 0x75, 31),
|
||||
|
||||
# initiate IDPROM
|
||||
('24c02', 0x54, 0),
|
||||
('24c02', 0x56, 0),
|
||||
]
|
||||
)
|
||||
|
||||
# initialize SFP devices
|
||||
for port in range(1, 49):
|
||||
self.new_i2c_device('as5916_54x_sfp%d' % port, 0x50, port+32)
|
||||
self.new_i2c_device('as5916_54x_sfp%d' % port, 0x51, port+32)
|
||||
self.new_i2c_device('as5916_54xk_sfp%d' % port, 0x50, port+32)
|
||||
self.new_i2c_device('as5916_54xk_sfp%d' % port, 0x51, port+32)
|
||||
|
||||
# initialize QSFP devices
|
||||
for port in range(49, 55):
|
||||
self.new_i2c_device('as5916_54x_sfp%d' % port, 0x50, port+32)
|
||||
self.new_i2c_device('as5916_54xk_sfp%d' % port, 0x50, port+32)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user