Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions builds/any/rootfs/buster/standard/standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ Multistrap:

ONL:
packages: *Packages
source: http://apt.opennetlinux.org/debian
suite: unstable
source: http://archive.debian.org/debian/
suite: ${ONL_DEBIAN_SUITE}
keyring: debian-archive-keyring
omitdebsrc: true
arches: amd64, arm64, armel

ONL-Local:
packages: *Packages
source: http://${APT_CACHE}apt.opennetlinux.org/debian
suite: unstable
source: http://${APT_CACHE}archive.debian.org/debian/
suite: ${ONL_DEBIAN_SUITE}
keyring: debian-archive-keyring
omitdebsrc: true
arches: amd64, arm64, armel

Local-All:
source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-all
Expand Down
10 changes: 6 additions & 4 deletions builds/any/rootfs/jessie/standard/standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ Multistrap:

ONL:
packages: *Packages
source: http://apt.opennetlinux.org/debian
suite: unstable
source: http://archive.debian.org/debian/
suite: ${ONL_DEBIAN_SUITE}
keyring: debian-archive-keyring
omitdebsrc: true

ONL-Local:
packages: *Packages
source: http://${APT_CACHE}apt.opennetlinux.org/debian
suite: unstable
source: http://${APT_CACHE}archive.debian.org/debian/
suite: ${ONL_DEBIAN_SUITE}
keyring: debian-archive-keyring
omitdebsrc: true

Local-All:
Expand Down
1 change: 0 additions & 1 deletion builds/any/rootfs/stretch/common/amd64-base-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- smartmontools
- grub2
- onl-upgrade
- hw-management
- onl-kernel-4.9-lts-x86-64-all-modules
- onl-kernel-4.14-lts-x86-64-all-modules
- onl-kernel-4.19-lts-x86-64-all-modules
Expand Down
12 changes: 6 additions & 6 deletions builds/any/rootfs/stretch/standard/standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ Multistrap:

ONL:
packages: *Packages
source: http://apt.opennetlinux.org/debian
suite: unstable
source: http://archive.debian.org/debian/
suite: ${ONL_DEBIAN_SUITE}
keyring: debian-archive-keyring
omitdebsrc: true
arches: amd64, arm64, armel

ONL-Local:
packages: *Packages
source: http://${APT_CACHE}apt.opennetlinux.org/debian
suite: unstable
source: http://${APT_CACHE}archive.debian.org/debian/
suite: ${ONL_DEBIAN_SUITE}
keyring: debian-archive-keyring
omitdebsrc: true
arches: amd64, arm64, armel

Local-All:
source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-all
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Add 'delay' module param to the driver.

From: Cumulus Networks <support@cumulusnetworks.com>

This is needed on S6000 for safe PMBUS access.
Without setting the 'delay', the ismt driver throws 'completion wait
timed out' error message.
---
drivers/i2c/busses/i2c-ismt.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
index a35a27c32..b89fbb60d 100644
--- a/drivers/i2c/busses/i2c-ismt.c
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -66,6 +66,7 @@
#include <linux/i2c.h>
#include <linux/acpi.h>
#include <linux/interrupt.h>
+#include <linux/delay.h>

#include <linux/io-64-nonatomic-lo-hi.h>

@@ -190,9 +191,12 @@ static const struct pci_device_id ismt_ids[] = {
MODULE_DEVICE_TABLE(pci, ismt_ids);

/* Bus speed control bits for slow debuggers - refer to the docs for usage */
-static unsigned int bus_speed;
+static unsigned int bus_speed = 100;
+static unsigned int delay = 1000;
module_param(bus_speed, uint, S_IRUGO);
-MODULE_PARM_DESC(bus_speed, "Bus Speed in kHz (0 = BIOS default)");
+MODULE_PARM_DESC(bus_speed, "Bus Speed in kHz (1000 by default)");
+module_param(delay, uint, S_IRUGO);
+MODULE_PARM_DESC(delay, "Delay in microsecs before access (1000 by default)");

/**
* __ismt_desc_dump() - dump the contents of a specific descriptor
@@ -400,6 +404,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
struct device *dev = &priv->pci_dev->dev;
u8 *dma_buffer = PTR_ALIGN(&priv->buffer[0], 16);

+ if (delay > 0)
+ udelay(delay);
+
desc = &priv->hw[priv->head];

/* Initialize the DMA buffer */
@@ -759,7 +766,7 @@ static void ismt_hw_init(struct ismt_priv *priv)
bus_speed = 1000;
break;
}
- dev_dbg(dev, "SMBus clock is running at %d kHz\n", bus_speed);
+ dev_info(dev, "SMBus clock is running at %d kHz with delay %d us\n", bus_speed, delay);
}

/**
1 change: 1 addition & 0 deletions packages/base/any/kernels/6.1-lts/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
driver-i2c-bus-intel-ismt-add-delay-param.patch
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!include $ONL_TEMPLATES/platform-modules.yml VENDOR=accton BASENAME=x86-64-accton-as5835-54x ARCH=amd64 KERNELS="onl-kernel-4.14-lts-x86-64-all:amd64"
!include $ONL_TEMPLATES/platform-modules.yml VENDOR=accton BASENAME=x86-64-accton-as5835-54x ARCH=amd64 KERNELS="onl-kernel-6.1-lts-x86-64-all:amd64"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KERNELS := onl-kernel-4.14-lts-x86-64-all:amd64
KMODULES := $(wildcard *.c)
KERNELS := onl-kernel-6.1-lts-x86-64-all:amd64
KMODULES := src
VENDOR := accton
BASENAME := x86-64-accton-as5835-54x
ARCH := x86_64
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
obj-m += x86-64-accton-as5835-54x-cpld.o
obj-m += x86-64-accton-as5835-54x-fan.o
obj-m += x86-64-accton-as5835-54x-leds.o
obj-m += x86-64-accton-as5835-54x-psu.o
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ static int as5835_54x_cpld_probe(struct i2c_client *client,
return ret;
}

static int as5835_54x_cpld_remove(struct i2c_client *client)
static void as5835_54x_cpld_remove(struct i2c_client *client)
{
struct as5835_54x_cpld_data *data = i2c_get_clientdata(client);
const struct attribute_group *group = NULL;
Expand All @@ -1083,8 +1083,6 @@ static int as5835_54x_cpld_remove(struct i2c_client *client)
}

kfree(data);

return 0;
}

static int as5835_54x_cpld_read_internal(struct i2c_client *client, u8 reg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,27 @@ static ssize_t show_version(struct device *dev, struct device_attribute *attr, c
return sprintf(buf, "%d\n", val);
}

static umode_t as5835_54x_fan_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{
return 0;
}

static const struct hwmon_channel_info *as5835_54x_fan_info[] = {
HWMON_CHANNEL_INFO(fan, HWMON_F_ENABLE),
NULL,
};

static const struct hwmon_ops as5835_54x_fan_hwmon_ops = {
.is_visible = as5835_54x_fan_is_visible,
};

static const struct hwmon_chip_info as5835_54x_fan_chip_info = {
.ops = &as5835_54x_fan_hwmon_ops,
.info = as5835_54x_fan_info,
};

static int as5835_54x_fan_probe(struct i2c_client *client,
const struct i2c_device_id *dev_id)
{
Expand Down Expand Up @@ -437,7 +458,7 @@ static int as5835_54x_fan_probe(struct i2c_client *client,
}

data->hwmon_dev = hwmon_device_register_with_info(&client->dev, "as5835_54x_fan",
NULL, NULL, NULL);
NULL, &as5835_54x_fan_chip_info, NULL);
if (IS_ERR(data->hwmon_dev)) {
status = PTR_ERR(data->hwmon_dev);
goto exit_remove;
Expand All @@ -456,13 +477,11 @@ static int as5835_54x_fan_probe(struct i2c_client *client,
return status;
}

static int as5835_54x_fan_remove(struct i2c_client *client)
static void as5835_54x_fan_remove(struct i2c_client *client)
{
struct as5835_54x_fan_data *data = i2c_get_clientdata(client);
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5835_54x_fan_group);

return 0;
}

/* Addresses to scan */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,27 @@ static const struct attribute_group as5835_54x_psu_group = {
.attrs = as5835_54x_psu_attributes,
};

static umode_t as5835_54x_psu_is_visible(const void *drvdata,
enum hwmon_sensor_types type,
u32 attr, int channel)
{
return 0;
}

static const struct hwmon_channel_info *as5835_54x_psu_info[] = {
HWMON_CHANNEL_INFO(power, HWMON_P_ENABLE),
NULL,
};

static const struct hwmon_ops as5835_54x_psu_hwmon_ops = {
.is_visible = as5835_54x_psu_is_visible,
};

static const struct hwmon_chip_info as5835_54x_psu_chip_info = {
.ops = &as5835_54x_psu_hwmon_ops,
.info = as5835_54x_psu_info,
};

static int as5835_54x_psu_probe(struct i2c_client *client,
const struct i2c_device_id *dev_id)
{
Expand Down Expand Up @@ -181,7 +202,7 @@ static int as5835_54x_psu_probe(struct i2c_client *client,
}

data->hwmon_dev = hwmon_device_register_with_info(&client->dev, "as5835_54x_psu",
NULL, NULL, NULL);
NULL, &as5835_54x_psu_chip_info, NULL);
if (IS_ERR(data->hwmon_dev)) {
status = PTR_ERR(data->hwmon_dev);
goto exit_remove;
Expand All @@ -201,15 +222,13 @@ static int as5835_54x_psu_probe(struct i2c_client *client,
return status;
}

static int as5835_54x_psu_remove(struct i2c_client *client)
static void as5835_54x_psu_remove(struct i2c_client *client)
{
struct as5835_54x_psu_data *data = i2c_get_clientdata(client);

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&client->dev.kobj, &as5835_54x_psu_group);
kfree(data);

return 0;
}

enum psu_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ _onlp_get_fan_direction_on_psu(void)
continue;
}

if (PSU_TYPE_AC_F2B == psu_type) {
if (PSU_TYPE_AC_F2B == psu_type || PSU_TYPE_DC_F2B == psu_type) {
return ONLP_FAN_STATUS_F2B;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ psu_type_t get_psu_type(int id, char* modelname, int modelname_len)

AIM_FREE_IF_PTR(fd);
}
else if (strncmp(mn, "YM-2401HCR", 10) == 0) {
ptype = PSU_TYPE_DC_F2B;
}
else if (strncmp(mn, "YM-2401HDR", 10) == 0) {
ptype = PSU_TYPE_DC_B2F;
}
else if (strncmp(mn, "DPS400AB33A", PSU_MODEL_NAME_LEN) == 0) {
ptype = PSU_TYPE_AC_F2B;
}
Expand Down Expand Up @@ -152,4 +158,4 @@ int psu_ym1401_pmbus_info_set(int id, char *node, int value)
}

return ONLP_STATUS_OK;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
#define FAN_BOARD_PATH "/sys/bus/i2c/devices/3-0063/"
#define FAN_NODE(node) FAN_BOARD_PATH#node

#define IDPROM_PATH "/sys/class/i2c-adapter/i2c-1/1-0057/eeprom"
#define IDPROM_PATH_1 "/sys/bus/i2c/devices/0-0057/eeprom"
#define IDPROM_PATH_2 "/sys/bus/i2c/devices/1-0057/eeprom"

int psu_ym1401_pmbus_info_get(int id, char *node, int *value);
int psu_ym1401_pmbus_info_set(int id, char *node, int value);
Expand All @@ -69,12 +70,16 @@ enum onlp_thermal_id
typedef enum psu_type {
PSU_TYPE_UNKNOWN,
PSU_TYPE_AC_F2B,
PSU_TYPE_AC_B2F
PSU_TYPE_AC_B2F,
PSU_TYPE_DC_F2B,
PSU_TYPE_DC_B2F
} psu_type_t;

psu_type_t get_psu_type(int id, char* modelname, int modelname_len);
int get_psu_serial_number(int id, char *serial, int serial_len);

#define IS_DC_INPUT(psu_type) (PSU_TYPE_DC_F2B == psu_type || PSU_TYPE_DC_B2F == psu_type)

#define DEBUG_MODE 0

#if (DEBUG_MODE == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ onlp_psui_init(void)
}

static int
psu_ym1401_info_get(onlp_psu_info_t* info)
psu_ym1401_info_get(onlp_psu_info_t* info, bool is_dc_input)
{
int val = 0;
int index = ONLP_OID_ID_GET(info->hdr.id);

/* Set capability
*/
info->caps = ONLP_PSU_CAPS_AC;
info->caps = (is_dc_input)? ONLP_PSU_CAPS_DC48 : ONLP_PSU_CAPS_AC;

if (info->status & ONLP_PSU_STATUS_FAILED) {
return ONLP_STATUS_OK;
}
if (info->status & ONLP_PSU_STATUS_FAILED) {
return ONLP_STATUS_OK;
}

/* Set the associated oid_table */
info->hdr.coids[0] = ONLP_FAN_ID_CREATE(index + CHASSIS_FAN_COUNT);
Expand Down Expand Up @@ -162,7 +162,9 @@ onlp_psui_info_get(onlp_oid_t id, onlp_psu_info_t* info)
switch (psu_type) {
case PSU_TYPE_AC_F2B:
case PSU_TYPE_AC_B2F:
ret = psu_ym1401_info_get(info);
case PSU_TYPE_DC_F2B:
case PSU_TYPE_DC_B2F:
ret = psu_ym1401_info_get(info, IS_DC_INPUT(psu_type));
break;
case PSU_TYPE_UNKNOWN: /* User insert a unknown PSU or unplugged.*/
info->status |= ONLP_PSU_STATUS_UNPLUGGED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ int
onlp_sysi_onie_data_get(uint8_t** data, int* size)
{
uint8_t* rdata = aim_zmalloc(256);
if(onlp_file_read(rdata, 256, size, IDPROM_PATH) == ONLP_STATUS_OK) {
if (onlp_file_read(rdata, 256, size, IDPROM_PATH_1) == ONLP_STATUS_OK) {
if(*size == 256) {
*data = rdata;
return ONLP_STATUS_OK;
}
} else if (onlp_file_read(rdata, 256, size, IDPROM_PATH_2) == ONLP_STATUS_OK) {
if(*size == 256) {
*data = rdata;
return ONLP_STATUS_OK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ x86-64-accton-as5835-54x-r0:
--stop=1

kernel:
<<: *kernel-4-14
<<: *kernel-6-1

args: >-
nopat
Expand Down
Loading