Skip to content

Commit

Permalink
Merge pull request 'develop/evb_8t_rel' (clounix#3) from develop/evb_…
Browse files Browse the repository at this point in the history
…8t_rel into evb_8t_rel

Reviewed-on: http://172.168.120.89:3000/flks/sonic-buildimage-new/pulls/3
Reviewed-by: chengxiang <xiang.chen@phoenixcompany.cn>
Reviewed-by: wangjingwu <jingwu.wang@phoenixcompany.cn>
  • Loading branch information
cw committed Aug 8, 2023
2 parents 6e24242 + 293a59f commit 5aa2555
Show file tree
Hide file tree
Showing 11 changed files with 949 additions and 64 deletions.
10 changes: 10 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ if [ ! -d $FILESYSTEM_ROOT/usr/bin ]; then
sudo chown -R root:root $FILESYSTEM_ROOT/usr/bin
fi
sudo cp -f files/vtysh_bin/vtysh $FILESYSTEM_ROOT/usr/local/bin/
if [ ! -d $FILESYSTEM_ROOT/var/vtysh ]; then
sudo mkdir -p $FILESYSTEM_ROOT/var/vtysh
sudo chown -R root:root $FILESYSTEM_ROOT/var/vtysh
fi
sudo cp -f files/vtysh_bin/all.sh $FILESYSTEM_ROOT/var/vtysh
sudo cp -f files/vtysh_bin/all_other.sh $FILESYSTEM_ROOT/var/vtysh
if [ ! -d $FILESYSTEM_ROOT/usr/lib/systemd/system/ ]; then
sudo mkdir -p $FILESYSTEM_ROOT/usr/lib/systemd/system/
fi
sudo cp -f files/vtysh_bin/vtysh.service $FILESYSTEM_ROOT/usr/lib/systemd/system/
sudo cp -f files/clounix_bin/clx_fpga $FILESYSTEM_ROOT/usr/bin/
sudo cp -f files/clounix_bin/cpld_update_app $FILESYSTEM_ROOT/usr/bin/
sudo chown root:root $FILESYSTEM_ROOT/usr/local/bin/vtysh
Expand Down
413 changes: 413 additions & 0 deletions files/vtysh_bin/all.sh

Large diffs are not rendered by default.

419 changes: 419 additions & 0 deletions files/vtysh_bin/all_other.sh

Large diffs are not rendered by default.

Binary file modified files/vtysh_bin/vtysh
Binary file not shown.
13 changes: 13 additions & 0 deletions files/vtysh_bin/vtysh.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=VTYSH Service
After=network.target
BindsTo=sonic.target
After=sonic.target
StartLimitIntervalSec=0

[Service]
Type=simple
ExecStart=/usr/local/bin/vtysh

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def doBurnInTest():
def main():
args = common.sys.argv[1:]

doBurnInTest()
if len(args[0:]) < 1:
common.sys.exit(0)

Expand All @@ -173,6 +172,7 @@ def main():
do_platformApiInit()
do_platformApiInstall()
device.deviceInit()
doBurnInTest()

if args[0] == 'uninstall':
common.RUN = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,50 +149,73 @@ ssize_t adm1166_fault_log_addr_show(struct device *dev, struct device_attribute

static void process_elec_data(unsigned long long *data, unsigned char index, unsigned short addr)
{
*data = ((*data * ref_voltage_mV)/((1 << adc_bits) - 1));


switch (index) {
case 0xa0:
if (addr == 0x34) {
*data = (*data*4363)/1000;
} else {
*data = (*data*2181)/1000;
}
break;
*data = ((*data * ref_voltage_mV) / ((1 << adc_bits) - 1));

switch (index)
{
case 0xa0:
if (addr == 0x34)
{
*data = (*data * 4363) / 1000;
}
else
{
*data = (*data * 2181) / 1000;
}
break;

case 0xa2:
if (addr == 0x34) {
*data = (*data*4363)/1000;
} else {
*data = (*data);
}
break;
case 0xa2:
if (addr == 0x34)
{
*data = (*data * 4363) / 1000;
}
else
{
*data = (*data);
}
break;

case 0xa4:
if (addr == 0x34) {
*data = (*data);
} else {
*data = (*data*4363)/1000;
}
break;
case 0xa4:
if (addr == 0x34)
{
*data = (*data);
}
else
{
*data = (*data * 4363) / 1000;
}
break;

case 0xa6:
if (addr == 0x34) {
*data = (*data*11519)/1000;
} else {
*data = (*data*4363)/1000;
}
case 0xa6:
if (addr == 0x34)
{
*data = (*data * 11519) / 1000;
}
else
{
*data = (*data * 4363) / 1000;
}

break;
break;

case 0xa8:
*data = (*data*10472)/1000;
break;
case 0xa8:
*data = (*data * 10472) / 1000;
break;

default:
case 0xb0:
if (addr == 0x34)
{
*data = (*data);
break;
}
else
{
*data = (*data * 3);
}
break;

default:
*data = (*data);
break;
}
/* cacl over return value's unit is mV */
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ int drv_sysled_init(void **sysled_driver)
sysled->sysled_if.get_id_led_status = drv_get_id_led_status;
sysled->sysled_if.set_id_led_status = drv_set_id_led_status;
*sysled_driver = sysled;
drv_set_sys_led_status(sysled, USER_SYSLED_GREEN);
LOG_INFO(CLX_DRIVER_TYPES_SYSLED, "SYSLED driver clx8000 initialization done.\r\n");
return DRIVER_OK;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ static int get_sfp_porttype(unsigned int eth_index, u8 platform_type)
if (eth_index >= QSFP_START_PORT)
return PORT_QSFP;
else
return PORT_DSFP;
return PORT_SFP;
}
return DRIVER_ERR;
}
Expand Down Expand Up @@ -1144,11 +1144,11 @@ static ssize_t platformc_xcvr_get_eth_tx_fault_status(struct clounix_priv_data *
switch (get_sfp_porttype(eth_index, sfp->platform_type))
{
case PORT_DSFP:
return get_sfp_tx_fault(sfp, eth_index, buf, count);
return -ENOSYS;
case PORT_QSFP:
return -ENOSYS;
case PORT_SFP:
return -ENOSYS;
return get_sfp_tx_fault(sfp, eth_index, buf, count);
default:
return -ENOSYS;
}
Expand Down Expand Up @@ -1226,11 +1226,11 @@ static ssize_t platformc_xcvr_get_eth_tx_disable_status(struct clounix_priv_data
switch (get_sfp_porttype(eth_index, sfp->platform_type))
{
case PORT_DSFP:
return get_sfp_tx_disable(sfp, eth_index, buf, count);
return -ENOSYS;
case PORT_QSFP:
return -ENOSYS;
case PORT_SFP:
return -ENOSYS;
return get_sfp_tx_disable(sfp, eth_index, buf, count);

default:
return -ENOSYS;
Expand Down Expand Up @@ -1312,11 +1312,11 @@ static int platformc_xcvr_set_eth_tx_disable_status(struct clounix_priv_data *sf
switch (get_sfp_porttype(eth_index, sfp->platform_type))
{
case PORT_DSFP:
return set_sfp_tx_disable(sfp, eth_index, status);
return -ENOSYS;
case PORT_QSFP:
return -ENOSYS;
case PORT_SFP:
return -ENOSYS;
return set_sfp_tx_disable(sfp, eth_index, status);
default:
return -ENOSYS;
}
Expand Down Expand Up @@ -1366,11 +1366,11 @@ static ssize_t platformc_xcvr_get_eth_rx_los_status(struct clounix_priv_data *sf
switch (get_sfp_porttype(eth_index, sfp->platform_type))
{
case PORT_DSFP:
return get_sfp_rx_los(sfp, eth_index, buf, count);
return -ENOSYS;
case PORT_QSFP:
return -ENOSYS;
case PORT_SFP:
return -ENOSYS;
return get_sfp_rx_los(sfp, eth_index, buf, count);
default:
return -ENOSYS;
}
Expand Down Expand Up @@ -1446,11 +1446,16 @@ static ssize_t get_qsfp_present(struct clounix_priv_data *sfp,
static ssize_t get_sfp_present(struct clounix_priv_data *sfp,
unsigned int eth_index, char *buf, size_t count)
{
uint32_t data = 0, val = 0;
uint32_t data = 0, val = 0, idx = 0, reg;

data = fpga_reg_read(sfp, SFP_STATUS_ADDRESS_BASE);
LOG_DBG(CLX_DRIVER_TYPES_XCVR, " reg: %x, data: %x\r\n", SFP_STATUS_ADDRESS_BASE, data);
GET_BIT((data >> SFP_STATUS_PRESENT_OFFSET), (eth_index - SFP_START_PORT), val);
idx = sfp->chip[eth_index].cpld_idx;
GET_DSFP_PRESENT_ADDRESS(idx, reg);
data = fpga_reg_read(sfp, reg);
LOG_DBG(CLX_DRIVER_TYPES_XCVR, "eth_index:%d, reg: %x, data: %x\r\n", eth_index, reg, data);
if (eth_index >= xcvr_cpld_index[sfp->platform_type][0])
GET_BIT(data, (eth_index - xcvr_cpld_index[sfp->platform_type][0]), val);
else
GET_BIT(data, eth_index, val);

return sprintf(buf, "%d\n", val);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,23 @@ static unsigned short process_power(struct i2c_client *client, int page, int reg
return power;
}

static unsigned int process_iout(struct i2c_client *client, int page, int reg)
static unsigned short process_iout(struct i2c_client *client, int page, int reg)
{
unsigned int data;
unsigned int exp;
unsigned short data;
unsigned short exp;

data = pmbus_read_word_data(client, page, reg);
exp = data >> 11;
exp = (data >> 11) & 0x1f;
data = data & 0x7ff;

data = data*10;

if (exp == 0x1f)
data = data / 2;
else if (exp == 0x1e)
data = data / 4;
{
data = (data / 2);
}
else
data = 0;

{
data = (data / 4);
}
return data;
}

Expand Down
6 changes: 4 additions & 2 deletions rules/config
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ TRUSTED_GPG_URLS = https://packages.trafficmanager.net/debian/public_key.gpg,htt
# web : web packages, downloaded by wget, curl
# git : git repositories, donloaded by git clone
# docker: docker base images
SONIC_VERSION_CONTROL_COMPONENTS ?= none
SONIC_VERSION_CONTROL_COMPONENTS ?= py2,py3,web,git,docker

# MIRROR_SNAPSHOT - support mirror snapshot flag
MIRROR_SNAPSHOT ?= y
# SONiC docker registry
#
# Set the env variable ENABLE_DOCKER_BASE_PULL = y to enable pulling sonic-slave docker from registry
Expand All @@ -196,4 +198,4 @@ REGISTRY_SERVER ?= sonicdev-microsoft.azurecr.io
INCLUDE_MUX = y

# reset default container registry from dockerhub to other
DEFAULT_CONTAINER_REGISTRY ?=
DEFAULT_CONTAINER_REGISTRY ?= publicmirror.azurecr.io

0 comments on commit 5aa2555

Please sign in to comment.