mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 01:07:01 +00:00
Update the Support for Netberg Platforms
- remove the patch file "driver-i2c-bus-intel-ismt-netberg-aurora.patch".
- modify the method of reading EEPROM : access the binary data directly for EEPROMs on main board and PSU.
- remove the function "onlp_sysi_platform_set" in file "sysi.c".
- change the SYS_OBJECT_ID in file "__init__.py":
Aurora 620 : .620.1
Aurora 720 : .720.1
- remove the "/dev/rtc1" in file "__init__.py", because there is no ds1339 on Netberg Aurora platforms.
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
diff -Nu a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
|
||||
--- a/drivers/i2c/busses/i2c-ismt.c 2017-05-09 23:52:56.680565000 -0700
|
||||
+++ b/drivers/i2c/busses/i2c-ismt.c 2017-05-10 02:09:53.237489185 -0700
|
||||
@@ -614,6 +614,12 @@
|
||||
priv->head++;
|
||||
priv->head %= ISMT_DESC_ENTRIES;
|
||||
|
||||
+ if( ret != 0 )
|
||||
+ {
|
||||
+ dev_dbg(dev, "Retry i2c-ismt access\n");
|
||||
+ return -EAGAIN;
|
||||
+ }
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
1
packages/base/any/kernels/3.16-lts/patches/series
Executable file → Normal file
1
packages/base/any/kernels/3.16-lts/patches/series
Executable file → Normal file
@@ -25,5 +25,4 @@ platform-powerpc-85xx-Makefile.patch
|
||||
platform-powerpc-dni-7448-r0.patch
|
||||
platform-powerpc-quanta-lb9-r0.patch
|
||||
driver-support-intel-igb-bcm50210-phy.patch
|
||||
driver-i2c-bus-intel-ismt-netberg-aurora.patch
|
||||
driver-igb-netberg-aurora.patch
|
||||
|
||||
@@ -26,7 +26,7 @@ enum platform_type {
|
||||
#define W83795ADG_CHIP_ID 0x79
|
||||
|
||||
#define W83795ADG_TEMP_COUNT 2
|
||||
#define W83795ADG_FAN_COUNT 10
|
||||
#define W83795ADG_FAN_COUNT 8
|
||||
#define W83795ADG_FAN_SPEED_FACTOR 1350000 /* 1.35 * 10^6 */
|
||||
#define W83795ADG_FAN_POLES_NUMBER 4
|
||||
#define W83795ADG_VSEN_COUNT 7
|
||||
@@ -293,7 +293,7 @@ SFP_PORT_DATA_t sfpPortData_78F[] = {
|
||||
SFP_PORT_DATA_PORT_NCIIX_37, SFP_PORT_DATA_PORT_NCIIX_38, SFP_PORT_DATA_PORT_NCIIX_39, SFP_PORT_DATA_PORT_NCIIX_40,
|
||||
SFP_PORT_DATA_PORT_NCIIX_41, SFP_PORT_DATA_PORT_NCIIX_42, SFP_PORT_DATA_PORT_NCIIX_43, SFP_PORT_DATA_PORT_NCIIX_44,
|
||||
SFP_PORT_DATA_PORT_NCIIX_45, SFP_PORT_DATA_PORT_NCIIX_46, SFP_PORT_DATA_PORT_NCIIX_47, SFP_PORT_DATA_PORT_NCIIX_48,
|
||||
QSFP_PORT_DATA_PORT_NCIIX_1, QSFP_PORT_DATA_PORT_NCIIX_2, QSFP_PORT_DATA_PORT_NCIIX_3,
|
||||
QSFP_PORT_DATA_PORT_NCIIX_1, QSFP_PORT_DATA_PORT_NCIIX_2, QSFP_PORT_DATA_PORT_NCIIX_3,
|
||||
QSFP_PORT_DATA_PORT_NCIIX_4, QSFP_PORT_DATA_PORT_NCIIX_5, QSFP_PORT_DATA_PORT_NCIIX_6
|
||||
};
|
||||
|
||||
@@ -601,13 +601,6 @@ static int i2c_bus0_hardware_monitor_update_thread(void *p)
|
||||
fanErr = 0;
|
||||
for (i=0; i<W83795ADG_FAN_COUNT; i++)
|
||||
{
|
||||
/* only ASTERION support 10 FAN */
|
||||
if ((i>=8)&&(data->modelId!=ASTERION_WITH_BMC)&&(data->modelId!=ASTERION_WITHOUT_BMC))
|
||||
{
|
||||
FanErr[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
fanSpeed = 0;
|
||||
/* Choose W83795ADG bank 0 */
|
||||
i2c_smbus_write_byte_data(client, W83795ADG_REG_BANK, 0x00);
|
||||
@@ -1225,9 +1218,6 @@ static int i2c_bus1_hardware_monitor_update_thread(void *p)
|
||||
data->fanDir[0] = (value&0x8888);
|
||||
FanDir = data->fanDir[0];
|
||||
|
||||
/*
|
||||
printk(KERN_INFO "Step %d, value = 0x%04x, fanAbs[0] = 0x%04x, fanDir[0] = 0x%04x\n", step, value, data->fanAbs[0], data->fanDir[0]);
|
||||
*/
|
||||
step = 0;
|
||||
break;
|
||||
|
||||
@@ -1860,6 +1850,7 @@ static int i2c_bus1_hardware_monitor_update_thread(void *p)
|
||||
data->fanDir[0] = (value&0x8888);
|
||||
FanDir = data->fanDir[0];
|
||||
|
||||
|
||||
i2c_smbus_write_byte_data(client, 0, 0x00);
|
||||
step = 4;
|
||||
break;
|
||||
@@ -2380,7 +2371,7 @@ static SENSOR_DEVICE_ATTR(vsen4, S_IRUGO, show_voltage_sen, NULL, 3);
|
||||
static SENSOR_DEVICE_ATTR(vsen5, S_IRUGO, show_voltage_sen, NULL, 4);
|
||||
static SENSOR_DEVICE_ATTR(vsen7, S_IRUGO, show_voltage_sen, NULL, 6);
|
||||
|
||||
static struct attribute *i2c_bus0_hardware_monitor_attr[] = {
|
||||
static struct attribute *i2c_bus0_hardware_monitor_attr[] = {
|
||||
&dev_attr_mac_temp.attr,
|
||||
&dev_attr_chip_info.attr,
|
||||
&dev_attr_board_build_rev.attr,
|
||||
@@ -2426,8 +2417,55 @@ static SENSOR_DEVICE_ATTR(vsen7, S_IRUGO, show_voltage_sen, NULL, 6);
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute *i2c_bus0_hardware_monitor_attr_asterion[] = {
|
||||
|
||||
static struct attribute *i2c_bus0_hardware_monitor_attr_nc2x[] = {
|
||||
&dev_attr_mac_temp.attr,
|
||||
&dev_attr_chip_info.attr,
|
||||
&dev_attr_board_build_rev.attr,
|
||||
&dev_attr_board_hardware_rev.attr,
|
||||
&dev_attr_board_model_id.attr,
|
||||
&dev_attr_cpld_info.attr,
|
||||
&dev_attr_wd_refresh.attr,
|
||||
&dev_attr_wd_refresh_control.attr,
|
||||
&dev_attr_wd_refresh_time.attr,
|
||||
&dev_attr_wd_timeout_occurrence.attr,
|
||||
&dev_attr_rov.attr,
|
||||
|
||||
&sensor_dev_attr_psu1_pg.dev_attr.attr,
|
||||
&sensor_dev_attr_psu2_pg.dev_attr.attr,
|
||||
&sensor_dev_attr_psu1_abs.dev_attr.attr,
|
||||
&sensor_dev_attr_psu2_abs.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_fan1_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan2_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan3_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan4_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan5_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan6_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan7_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan8_rpm.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_fan1_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan2_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan3_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan4_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan5_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan6_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan7_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan8_duty.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_remote_temp1.dev_attr.attr,
|
||||
&sensor_dev_attr_remote_temp2.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_vsen1.dev_attr.attr,
|
||||
&sensor_dev_attr_vsen4.dev_attr.attr,
|
||||
&sensor_dev_attr_vsen5.dev_attr.attr,
|
||||
&sensor_dev_attr_vsen7.dev_attr.attr,
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute *i2c_bus0_hardware_monitor_attr_asterion[] = {
|
||||
&dev_attr_mac_temp.attr,
|
||||
&dev_attr_chip_info.attr,
|
||||
&dev_attr_board_build_rev.attr,
|
||||
@@ -2478,52 +2516,6 @@ static SENSOR_DEVICE_ATTR(vsen7, S_IRUGO, show_voltage_sen, NULL, 6);
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute *i2c_bus0_hardware_monitor_attr_nc2x[] = {
|
||||
&dev_attr_mac_temp.attr,
|
||||
&dev_attr_chip_info.attr,
|
||||
&dev_attr_board_build_rev.attr,
|
||||
&dev_attr_board_hardware_rev.attr,
|
||||
&dev_attr_board_model_id.attr,
|
||||
&dev_attr_cpld_info.attr,
|
||||
&dev_attr_wd_refresh.attr,
|
||||
&dev_attr_wd_refresh_control.attr,
|
||||
&dev_attr_wd_refresh_time.attr,
|
||||
&dev_attr_wd_timeout_occurrence.attr,
|
||||
&dev_attr_rov.attr,
|
||||
|
||||
&sensor_dev_attr_psu1_pg.dev_attr.attr,
|
||||
&sensor_dev_attr_psu2_pg.dev_attr.attr,
|
||||
&sensor_dev_attr_psu1_abs.dev_attr.attr,
|
||||
&sensor_dev_attr_psu2_abs.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_fan1_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan2_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan3_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan4_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan5_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan6_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan7_rpm.dev_attr.attr,
|
||||
&sensor_dev_attr_fan8_rpm.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_fan1_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan2_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan3_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan4_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan5_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan6_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan7_duty.dev_attr.attr,
|
||||
&sensor_dev_attr_fan8_duty.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_remote_temp1.dev_attr.attr,
|
||||
&sensor_dev_attr_remote_temp2.dev_attr.attr,
|
||||
|
||||
&sensor_dev_attr_vsen1.dev_attr.attr,
|
||||
&sensor_dev_attr_vsen4.dev_attr.attr,
|
||||
&sensor_dev_attr_vsen5.dev_attr.attr,
|
||||
&sensor_dev_attr_vsen7.dev_attr.attr,
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
static ssize_t show_port_abs(struct device *dev, struct device_attribute *devattr, char *buf)
|
||||
{
|
||||
@@ -2603,24 +2595,10 @@ static ssize_t show_port_data_a0(struct device *dev, struct device_attribute *de
|
||||
mutex_lock(&data->lock);
|
||||
memcpy(qsfpPortData, &(data->qsfpPortDataA0[attr->index][0]), QSFP_DATA_SIZE);
|
||||
mutex_unlock(&data->lock);
|
||||
#if 0
|
||||
{
|
||||
unsigned int index;
|
||||
char str[8];
|
||||
|
||||
count = 0;
|
||||
for (index=0; index<QSFP_DATA_SIZE; index++)
|
||||
{
|
||||
count += sprintf(str, "%02x", qsfpPortData[index]);
|
||||
strcat(buf, str);
|
||||
}
|
||||
count += sprintf(str, "\n");
|
||||
strcat(buf, str);
|
||||
}
|
||||
#else
|
||||
count = QSFP_DATA_SIZE;
|
||||
memcpy(buf, (char *)qsfpPortData, QSFP_DATA_SIZE);
|
||||
#endif
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -2636,24 +2614,10 @@ static ssize_t show_port_data_a2(struct device *dev, struct device_attribute *de
|
||||
mutex_lock(&data->lock);
|
||||
memcpy(qsfpPortData, &(data->qsfpPortDataA2[attr->index][0]), QSFP_DATA_SIZE);
|
||||
mutex_unlock(&data->lock);
|
||||
#if 0
|
||||
{
|
||||
unsigned int index;
|
||||
char str[8];
|
||||
|
||||
count = 0;
|
||||
for (index=0; index<QSFP_DATA_SIZE; index++)
|
||||
{
|
||||
count += sprintf(str, "%02x", qsfpPortData[index]);
|
||||
strcat(buf, str);
|
||||
}
|
||||
count += sprintf(str, "\n");
|
||||
strcat(buf, str);
|
||||
}
|
||||
#else
|
||||
count = QSFP_DATA_SIZE;
|
||||
memcpy(buf, (char *)qsfpPortData, QSFP_DATA_SIZE);
|
||||
#endif
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -2665,20 +2629,19 @@ static ssize_t show_fan_abs(struct device *dev, struct device_attribute *devattr
|
||||
unsigned int value = 0;
|
||||
unsigned int index = 0;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
if (attr->index<4)
|
||||
{
|
||||
mutex_lock(&data->lock);
|
||||
value = (unsigned int)data->fanAbs[0];
|
||||
mutex_unlock(&data->lock);
|
||||
index = attr->index;
|
||||
}
|
||||
else
|
||||
{
|
||||
mutex_lock(&data->lock);
|
||||
value = (unsigned int)data->fanAbs[1];
|
||||
mutex_unlock(&data->lock);
|
||||
index = (attr->index-3);
|
||||
}
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
value &= (0x0004<<(index*4));
|
||||
return sprintf(buf, "%d\n", value?0:1);
|
||||
}
|
||||
@@ -2691,21 +2654,20 @@ static ssize_t show_fan_dir(struct device *dev, struct device_attribute *devattr
|
||||
unsigned int value = 0;
|
||||
unsigned int index = 0;
|
||||
|
||||
mutex_lock(&data->lock);
|
||||
if (attr->index<4)
|
||||
{
|
||||
mutex_lock(&data->lock);
|
||||
value = (unsigned int)data->fanDir[0];
|
||||
mutex_unlock(&data->lock);
|
||||
index = attr->index;
|
||||
}
|
||||
else
|
||||
{
|
||||
mutex_lock(&data->lock);
|
||||
value = (unsigned int)data->fanDir[1];
|
||||
mutex_unlock(&data->lock);
|
||||
index = (attr->index-3);
|
||||
}
|
||||
value &= (0x0004<<(index*4));
|
||||
mutex_unlock(&data->lock);
|
||||
|
||||
value &= (0x0008<<(index*4));
|
||||
return sprintf(buf, "%d\n", value?0:1);
|
||||
}
|
||||
|
||||
@@ -2713,8 +2675,6 @@ static ssize_t show_eeprom(struct device *dev, struct device_attribute *devattr,
|
||||
{
|
||||
unsigned char eepromData[EEPROM_DATA_SIZE];
|
||||
ssize_t count = 0;
|
||||
unsigned int index;
|
||||
char str[8];
|
||||
int ret = 0;
|
||||
|
||||
memset(eepromData, 0, EEPROM_DATA_SIZE);
|
||||
@@ -2807,19 +2767,10 @@ static ssize_t show_eeprom(struct device *dev, struct device_attribute *devattr,
|
||||
}
|
||||
if (ret < 0)
|
||||
memset(eepromData, 0, EEPROM_DATA_SIZE);
|
||||
#if 1
|
||||
count = 0;
|
||||
for (index=0; index<EEPROM_DATA_SIZE; index++)
|
||||
{
|
||||
count += sprintf(str, "%02x", eepromData[index]);
|
||||
strcat(buf, str);
|
||||
}
|
||||
count += sprintf(str, "\n");
|
||||
strcat(buf, str);
|
||||
#else
|
||||
|
||||
count = EEPROM_DATA_SIZE;
|
||||
memcpy(buf, (char *)eepromData, EEPROM_DATA_SIZE);
|
||||
#endif
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -2830,7 +2781,6 @@ static ssize_t show_psu_eeprom(struct device *dev, struct device_attribute *deva
|
||||
struct i2c_bus1_hardware_monitor_data *data = i2c_get_clientdata(client);
|
||||
unsigned char eepromData[EEPROM_DATA_SIZE];
|
||||
ssize_t count = 0;
|
||||
char str[8];
|
||||
int ret = 0;
|
||||
unsigned short index=0;
|
||||
unsigned int psu_present = 0;
|
||||
@@ -2915,19 +2865,10 @@ static ssize_t show_psu_eeprom(struct device *dev, struct device_attribute *deva
|
||||
if (ret < 0)
|
||||
memset(eepromData, 0, EEPROM_DATA_SIZE);
|
||||
}
|
||||
#if 1
|
||||
count = 0;
|
||||
for (index=0; index<EEPROM_DATA_SIZE; index++)
|
||||
{
|
||||
count += sprintf(str, "%02x", eepromData[index]);
|
||||
strcat(buf, str);
|
||||
}
|
||||
count += sprintf(str, "\n");
|
||||
strcat(buf, str);
|
||||
#else
|
||||
|
||||
count = EEPROM_DATA_SIZE;
|
||||
memcpy(buf, (char *)eepromData, EEPROM_DATA_SIZE);
|
||||
#endif
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -6303,8 +6244,10 @@ static int w83795adg_hardware_monitor_remove(struct i2c_client *client)
|
||||
|
||||
/* turn off all LEDs of front port */
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_RESET_0x34, 0x00);
|
||||
#if 0 /* It's for Huracan Beta only, remove it. */
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_LED_0x40, 0x00);
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_LED_0x44, 0x00);
|
||||
#endif
|
||||
|
||||
hwmon_device_unregister(data->hwmon_dev);
|
||||
sysfs_remove_group(&client->dev.kobj, &data->hwmon_group);
|
||||
@@ -6336,8 +6279,10 @@ static void w83795adg_hardware_monitor_shutdown(struct i2c_client *client)
|
||||
|
||||
/* turn off all LEDs of front port */
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_RESET_0x34, 0x00);
|
||||
#if 0 /* It's for Huracan Beta only, remove it. */
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_LED_0x40, 0x00);
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_LED_0x44, 0x00);
|
||||
#endif
|
||||
/* reset MAC */
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_RESET_0x30, 0x6e);
|
||||
i2c_smbus_write_byte_data(&cpld_client, CPLD_REG_RESET_0x30, 0x6f);
|
||||
@@ -6357,6 +6302,6 @@ static void w83795adg_hardware_monitor_shutdown(struct i2c_client *client)
|
||||
|
||||
module_i2c_driver(w83795adg_hardware_monitor_driver);
|
||||
|
||||
MODULE_AUTHOR("Raymond Huey <raymond.yc.huey@foxconn.com>");
|
||||
MODULE_DESCRIPTION("Foxconn W83795ADG Hardware Monitor driver");
|
||||
MODULE_AUTHOR("Raymond Huey <raymond.huey@gmail.com>");
|
||||
MODULE_DESCRIPTION("W83795ADG Hardware Monitor driver");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -60,7 +60,7 @@ sys_fan_info_get__(onlp_fan_info_t* info, int id)
|
||||
if (rv != ONLP_STATUS_OK)
|
||||
return rv;
|
||||
|
||||
if (value == 0)
|
||||
if (value == 1)
|
||||
{
|
||||
info->status |= ONLP_FAN_STATUS_B2F;
|
||||
info->caps |= ONLP_FAN_CAPS_B2F;
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "x86_64_netberg_aurora_620_rangeley_int.h"
|
||||
#include "x86_64_netberg_aurora_620_rangeley_log.h"
|
||||
|
||||
extern int toHexValue(char ch);
|
||||
|
||||
#define VALIDATE(_id) \
|
||||
do { \
|
||||
if(!ONLP_OID_IS_PSU(_id)) { \
|
||||
@@ -59,12 +57,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
{
|
||||
int rv;
|
||||
int pid;
|
||||
uint8_t buffer[512];
|
||||
uint8_t data[256];
|
||||
int value = -1;
|
||||
int len;
|
||||
double dvalue;
|
||||
int i, j;
|
||||
int i;
|
||||
|
||||
VALIDATE(id);
|
||||
|
||||
@@ -84,17 +81,10 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
/* PSU is present. */
|
||||
info->status = ONLP_PSU_STATUS_PRESENT;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_eeprom", pid);
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_eeprom", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
j = 0;
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
data[i] = (toHexValue(buffer[j])<<4) + toHexValue(buffer[j+1]);
|
||||
j += 2;
|
||||
}
|
||||
i = 11;
|
||||
|
||||
/* Manufacturer Name */
|
||||
@@ -143,11 +133,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_iout", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_iout", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_IOUT;
|
||||
@@ -155,11 +145,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_vout", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_vout", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_VOUT;
|
||||
@@ -167,11 +157,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_pin", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_pin", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_PIN;
|
||||
@@ -179,11 +169,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_pout", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_pout", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_POUT;
|
||||
|
||||
@@ -11,19 +11,6 @@
|
||||
#include "x86_64_netberg_aurora_620_rangeley_int.h"
|
||||
#include "x86_64_netberg_aurora_620_rangeley_log.h"
|
||||
|
||||
int toHexValue(char ch)
|
||||
{
|
||||
if ((ch >= '0')&&(ch <= '9'))
|
||||
{
|
||||
return (ch-0x30);
|
||||
}
|
||||
else if (((ch >= 'a')&&(ch <= 'f'))||((ch >= 'A')&&(ch <= 'F')))
|
||||
{
|
||||
return (ch-0x57);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the first function called by the ONLP framework.
|
||||
*
|
||||
@@ -42,25 +29,6 @@ onlp_sysi_platform_get(void)
|
||||
return "x86-64-netberg-aurora-620-rangeley-r0";
|
||||
}
|
||||
|
||||
/*
|
||||
* This function will be called if onlp_sysi_platform_get()
|
||||
* returns a platform name that is not equal to the current platform.
|
||||
*
|
||||
* If you are compatible with the given platform then return ONLP_STATUS_OK.
|
||||
* If you can are not compatible return ONLP_STATUS_E_UNSUPPORTED.
|
||||
* - This is fatal and will abort platform initialization.
|
||||
*/
|
||||
|
||||
int
|
||||
onlp_sysi_platform_set(const char* name)
|
||||
{
|
||||
/*
|
||||
* For the purposes of this example we
|
||||
* accept all platforms.
|
||||
*/
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the first function the ONLP framework will call
|
||||
* after it has validated the the platform is supported using the mechanisms
|
||||
@@ -79,23 +47,14 @@ int
|
||||
onlp_sysi_onie_info_get(onlp_onie_info_t* onie)
|
||||
{
|
||||
int rv;
|
||||
uint8_t buffer[512];
|
||||
uint8_t data[256];
|
||||
int len;
|
||||
int i, j;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/eeprom");
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/eeprom");
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
j = 0;
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
data[i] = (toHexValue(buffer[j])<<4) + toHexValue(buffer[j+1]);
|
||||
j += 2;
|
||||
}
|
||||
rv = onlp_onie_decode(onie, (uint8_t*)data, 256);
|
||||
rv = onlp_onie_decode(onie, (uint8_t*)data, sizeof(data));
|
||||
if(rv >= 0)
|
||||
{
|
||||
onie->platform_name = aim_strdup("x86-64-netberg-aurora-620-rangeley-r0");
|
||||
|
||||
@@ -5,13 +5,8 @@ class OnlPlatform_x86_64_netberg_aurora_620_rangeley_r0(OnlPlatformNetberg,
|
||||
OnlPlatformPortConfig_48x25_6x100):
|
||||
PLATFORM='x86-64-netberg-aurora-620-rangeley-r0'
|
||||
MODEL="AURORA620"
|
||||
SYS_OBJECT_ID=".8.1"
|
||||
SYS_OBJECT_ID=".620.1"
|
||||
|
||||
def baseconfig(self):
|
||||
self.insmod("hardware_monitor")
|
||||
|
||||
# make ds1339 as default rtc
|
||||
os.system("ln -snf /dev/rtc1 /dev/rtc")
|
||||
os.system("hwclock --hctosys")
|
||||
|
||||
return True
|
||||
|
||||
@@ -60,7 +60,7 @@ sys_fan_info_get__(onlp_fan_info_t* info, int id)
|
||||
if (rv != ONLP_STATUS_OK)
|
||||
return rv;
|
||||
|
||||
if (value == 0)
|
||||
if (value == 1)
|
||||
{
|
||||
info->status |= ONLP_FAN_STATUS_B2F;
|
||||
info->caps |= ONLP_FAN_CAPS_B2F;
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "x86_64_netberg_aurora_720_rangeley_int.h"
|
||||
#include "x86_64_netberg_aurora_720_rangeley_log.h"
|
||||
|
||||
extern int toHexValue(char ch);
|
||||
|
||||
#define VALIDATE(_id) \
|
||||
do { \
|
||||
if(!ONLP_OID_IS_PSU(_id)) { \
|
||||
@@ -59,12 +57,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
{
|
||||
int rv;
|
||||
int pid;
|
||||
uint8_t buffer[512];
|
||||
uint8_t data[256];
|
||||
int value = -1;
|
||||
int len;
|
||||
double dvalue;
|
||||
int i, j;
|
||||
int i;
|
||||
|
||||
VALIDATE(id);
|
||||
|
||||
@@ -84,17 +81,10 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
/* PSU is present. */
|
||||
info->status = ONLP_PSU_STATUS_PRESENT;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_eeprom", pid);
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_eeprom", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
j = 0;
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
data[i] = (toHexValue(buffer[j])<<4) + toHexValue(buffer[j+1]);
|
||||
j += 2;
|
||||
}
|
||||
i = 11;
|
||||
|
||||
/* Manufacturer Name */
|
||||
@@ -143,11 +133,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_iout", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_iout", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_IOUT;
|
||||
@@ -155,11 +145,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_vout", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_vout", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_VOUT;
|
||||
@@ -167,11 +157,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_pin", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_pin", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_PIN;
|
||||
@@ -179,11 +169,11 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/psu%d_pout", pid);
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/psu%d_pout", pid);
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
dvalue = atof((const char *)buffer);
|
||||
dvalue = atof((const char *)data);
|
||||
if (dvalue > 0.0)
|
||||
{
|
||||
info->caps |= ONLP_PSU_CAPS_POUT;
|
||||
|
||||
@@ -11,19 +11,6 @@
|
||||
#include "x86_64_netberg_aurora_720_rangeley_int.h"
|
||||
#include "x86_64_netberg_aurora_720_rangeley_log.h"
|
||||
|
||||
int toHexValue(char ch)
|
||||
{
|
||||
if ((ch >= '0')&&(ch <= '9'))
|
||||
{
|
||||
return (ch-0x30);
|
||||
}
|
||||
else if (((ch >= 'a')&&(ch <= 'f'))||((ch >= 'A')&&(ch <= 'F')))
|
||||
{
|
||||
return (ch-0x57);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the first function called by the ONLP framework.
|
||||
*
|
||||
@@ -42,25 +29,6 @@ onlp_sysi_platform_get(void)
|
||||
return "x86-64-netberg-aurora-720-rangeley-r0";
|
||||
}
|
||||
|
||||
/*
|
||||
* This function will be called if onlp_sysi_platform_get()
|
||||
* returns a platform name that is not equal to the current platform.
|
||||
*
|
||||
* If you are compatible with the given platform then return ONLP_STATUS_OK.
|
||||
* If you can are not compatible return ONLP_STATUS_E_UNSUPPORTED.
|
||||
* - This is fatal and will abort platform initialization.
|
||||
*/
|
||||
|
||||
int
|
||||
onlp_sysi_platform_set(const char* name)
|
||||
{
|
||||
/*
|
||||
* For the purposes of this example we
|
||||
* accept all platforms.
|
||||
*/
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the first function the ONLP framework will call
|
||||
* after it has validated the the platform is supported using the mechanisms
|
||||
@@ -79,23 +47,14 @@ int
|
||||
onlp_sysi_onie_info_get(onlp_onie_info_t* onie)
|
||||
{
|
||||
int rv;
|
||||
uint8_t buffer[512];
|
||||
uint8_t data[256];
|
||||
int len;
|
||||
int i, j;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
memset(data, 0, sizeof(data));
|
||||
rv = onlp_file_read(buffer, sizeof(buffer), &len, SYS_HWMON2_PREFIX "/eeprom");
|
||||
rv = onlp_file_read(data, sizeof(data), &len, SYS_HWMON2_PREFIX "/eeprom");
|
||||
if (rv == ONLP_STATUS_OK)
|
||||
{
|
||||
j = 0;
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
data[i] = (toHexValue(buffer[j])<<4) + toHexValue(buffer[j+1]);
|
||||
j += 2;
|
||||
}
|
||||
rv = onlp_onie_decode(onie, (uint8_t*)data, 256);
|
||||
rv = onlp_onie_decode(onie, (uint8_t*)data, sizeof(data));
|
||||
if(rv >= 0)
|
||||
{
|
||||
onie->platform_name = aim_strdup("x86-64-netberg-aurora-720-rangeley-r0");
|
||||
|
||||
@@ -5,13 +5,8 @@ class OnlPlatform_x86_64_netberg_aurora_720_rangeley_r0(OnlPlatformNetberg,
|
||||
OnlPlatformPortConfig_32x100):
|
||||
PLATFORM='x86-64-netberg-aurora-720-rangeley-r0'
|
||||
MODEL="AURORA720"
|
||||
SYS_OBJECT_ID=".8.1"
|
||||
SYS_OBJECT_ID=".720.1"
|
||||
|
||||
def baseconfig(self):
|
||||
self.insmod("hardware_monitor")
|
||||
|
||||
# make ds1339 as default rtc
|
||||
os.system("ln -snf /dev/rtc1 /dev/rtc")
|
||||
os.system("hwclock --hctosys")
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user