Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[platform/device] - Update sonic-platform-module-cel and device configuration for haliburton #1960

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 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
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# name lanes speed alias autoneg
Ethernet0 2 1000 etp1 1
Ethernet1 1 1000 etp2 1
Ethernet2 4 1000 etp3 1
Ethernet3 3 1000 etp4 1
Ethernet4 6 1000 etp5 1
Ethernet5 5 1000 etp6 1
Ethernet6 8 1000 etp7 1
Ethernet7 7 1000 etp8 1
Ethernet8 10 1000 etp9 1
Ethernet9 9 1000 etp10 1
Ethernet10 12 1000 etp11 1
Ethernet11 11 1000 etp12 1
Ethernet12 14 1000 etp13 1
Ethernet13 13 1000 etp14 1
Ethernet14 16 1000 etp15 1
Ethernet15 15 1000 etp16 1
Ethernet16 18 1000 etp17 1
Ethernet17 17 1000 etp18 1
Ethernet18 20 1000 etp19 1
Ethernet19 19 1000 etp20 1
Ethernet20 22 1000 etp21 1
Ethernet21 21 1000 etp22 1
Ethernet22 24 1000 etp23 1
Ethernet23 23 1000 etp24 1
Ethernet24 26 1000 etp25 1
Ethernet25 25 1000 etp26 1
Ethernet26 28 1000 etp27 1
Ethernet27 27 1000 etp28 1
Ethernet28 30 1000 etp29 1
Ethernet29 29 1000 etp30 1
Ethernet30 32 1000 etp31 1
Ethernet31 31 1000 etp32 1
Ethernet32 34 1000 etp33 1
Ethernet33 33 1000 etp34 1
Ethernet34 36 1000 etp35 1
Ethernet35 35 1000 etp36 1
Ethernet36 38 1000 etp37 1
Ethernet37 37 1000 etp38 1
Ethernet38 40 1000 etp39 1
Ethernet39 39 1000 etp40 1
Ethernet40 42 1000 etp41 1
Ethernet41 41 1000 etp42 1
Ethernet42 44 1000 etp43 1
Ethernet43 43 1000 etp44 1
Ethernet44 46 1000 etp45 1
Ethernet45 45 1000 etp46 1
Ethernet46 48 1000 etp47 1
Ethernet47 47 1000 etp48 1
Ethernet48 54 10000 etp49 0
Ethernet49 53 10000 etp50 0
Ethernet50 56 10000 etp51 0
Ethernet51 55 10000 etp52 0
# name lanes index speed alias autoneg
Ethernet0 2 1 1000 etp1 1
Ethernet1 1 2 1000 etp2 1
Ethernet2 4 3 1000 etp3 1
Ethernet3 3 4 1000 etp4 1
Ethernet4 6 5 1000 etp5 1
Ethernet5 5 6 1000 etp6 1
Ethernet6 8 7 1000 etp7 1
Ethernet7 7 8 1000 etp8 1
Ethernet8 10 9 1000 etp9 1
Ethernet9 9 10 1000 etp10 1
Ethernet10 12 11 1000 etp11 1
Ethernet11 11 12 1000 etp12 1
Ethernet12 14 13 1000 etp13 1
Ethernet13 13 14 1000 etp14 1
Ethernet14 16 15 1000 etp15 1
Ethernet15 15 16 1000 etp16 1
Ethernet16 18 17 1000 etp17 1
Ethernet17 17 18 1000 etp18 1
Ethernet18 20 19 1000 etp19 1
Ethernet19 19 20 1000 etp20 1
Ethernet20 22 21 1000 etp21 1
Ethernet21 21 22 1000 etp22 1
Ethernet22 24 23 1000 etp23 1
Ethernet23 23 24 1000 etp24 1
Ethernet24 26 25 1000 etp25 1
Ethernet25 25 26 1000 etp26 1
Ethernet26 28 27 1000 etp27 1
Ethernet27 27 28 1000 etp28 1
Ethernet28 30 29 1000 etp29 1
Ethernet29 29 30 1000 etp30 1
Ethernet30 32 31 1000 etp31 1
Ethernet31 31 32 1000 etp32 1
Ethernet32 34 33 1000 etp33 1
Ethernet33 33 34 1000 etp34 1
Ethernet34 36 35 1000 etp35 1
Ethernet35 35 36 1000 etp36 1
Ethernet36 38 37 1000 etp37 1
Ethernet37 37 38 1000 etp38 1
Ethernet38 40 39 1000 etp39 1
Ethernet39 39 40 1000 etp40 1
Ethernet40 42 41 1000 etp41 1
Ethernet41 41 42 1000 etp42 1
Ethernet42 44 43 1000 etp43 1
Ethernet43 43 44 1000 etp44 1
Ethernet44 46 45 1000 etp45 1
Ethernet45 45 46 1000 etp46 1
Ethernet46 48 47 1000 etp47 1
Ethernet47 47 48 1000 etp48 1
Ethernet48 54 49 10000 etp49 0
Ethernet49 53 50 10000 etp50 0
Ethernet50 56 51 10000 etp51 0
Ethernet51 55 52 10000 etp52 0
10 changes: 5 additions & 5 deletions device/celestica/x86_64-cel_e1031-r0/fancontrol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=2
DEVPATH=hwmon3=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-23/23-004d/ hwmon2=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-11/11-001a/hwmon/hwmon2
DEVPATH=hwmon3=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-23/23-004d hwmon2=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-11/11-001a
DEVNAME=hwmon3=emc2305 hwmon2=max6697
FCTEMPS=hwmon3/pwm1=hwmon2/temp2_input hwmon3/pwm2=hwmon2/temp2_input hwmon3/pwm4=hwmon2/temp2_input
FCTEMPS=hwmon3/device/pwm1=hwmon2/temp2_input hwmon3/device/pwm2=hwmon2/temp2_input hwmon3/device/pwm4=hwmon2/temp2_input
FCFANS=hwmon3/device/pwm1=hwmon3/device/fan1_input hwmon3/device/pwm2=hwmon3/device/fan2_input hwmon3/device/pwm4=hwmon3/device/fan4_input
MINTEMP=hwmon3/device/pwm1=29 hwmon3/device/pwm2=29 hwmon3/device/pwm4=29
MAXTEMP=hwmon3/device/pwm1=44 hwmon3/device/pwm2=44 hwmon3/device/pwm4=44
MINSTART=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINSTOP=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINPWM=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINSTART=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINSTOP=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINPWM=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MAXPWM=hwmon3/device/pwm1=255 hwmon3/device/pwm2=255 hwmon3/device/pwm4=255
61 changes: 61 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python

import os.path

try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""

def __init__(self):
PsuBase.__init__(self)

self.psu_path = "/sys/devices/platform/e1031.smc/"
self.psu_presence = "psu{}_prs"
self.psu_oper_status = "psu{}_status"

def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device

:return: An integer, the number of PSUs available on the device
"""
return 2

def get_psu_status(self, index):
"""
Retrieves the oprational status of power supply unit (PSU) defined by 1-based index <index>

:param index: An integer, 1-based index of the PSU of which to query status
:return: Boolean, True if PSU is operating properly, False if PSU is faulty
"""
psu_location = ["R", "L"]
status = 0
try:
with open(self.psu_path + self.psu_oper_status.format(psu_location[index - 1]), 'r') as power_status:
status = int(power_status.read())
except IOError:
return False

return status == 1

def get_psu_presence(self, index):
"""
Retrieves the presence status of power supply unit (PSU) defined by 1-based index <index>

:param index: An integer, 1-based index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
psu_location = ["R", "L"]
status = 0
try:
with open(self.psu_path + self.psu_presence.format(psu_location[index - 1]), 'r') as psu_prs:
status = int(psu_prs.read())
except IOError:
return False

return status == 1
123 changes: 123 additions & 0 deletions device/celestica/x86_64-cel_e1031-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/usr/bin/env python

try:
import time
import os
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))


class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""

PORT_START = 1
PORT_END = 52
port_to_i2c_mapping = {
1 : None,
2 : None,
3 : None,
4 : None,
5 : None,
6 : None,
7 : None,
8 : None,
9 : None,
10 : None,
11 : None,
12 : None,
13 : None,
14 : None,
15 : None,
16 : None,
17 : None,
18 : None,
19 : None,
20 : None,
21 : None,
22 : None,
23 : None,
24 : None,
25 : None,
26 : None,
27 : None,
28 : None,
29 : None,
30 : None,
31 : None,
32 : None,
33 : None,
34 : None,
35 : None,
36 : None,
37 : None,
38 : None,
39 : None,
40 : None,
41 : None,
42 : None,
43 : None,
44 : None,
45 : None,
46 : None,
47 : None,
48 : None,
49 : 15,
50 : 14,
51 : 17,
52 : 16
}
_port_to_eeprom_mapping = {}
_sfp_port = range(49, PORT_END + 1)

@property
def port_start(self):
return self.PORT_START

@property
def port_end(self):
return self.PORT_END

@property
def qsfp_ports(self):
return []

@property
def port_to_eeprom_mapping(self):
return self._port_to_eeprom_mapping

def __init__(self):
# Override port_to_eeprom_mapping for class initialization
eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom'
for x in range(self.PORT_START, self.PORT_END + 1):
port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x])
self.port_to_eeprom_mapping[x] = port_eeprom_path
SfpUtilBase.__init__(self)

def get_presence(self, port_num):
sfp_modabs_path = '/sys/devices/platform/e1031.smc/SFP/SFP{0}/sfp_modabs'

if port_num not in self._sfp_port:
return False

status = 1
try:
with open(sfp_modabs_path.format(port_num - 48), 'r') as port_status:
status = int(port_status.read())
except IOError:
return False

return status == 0


def get_low_power_mode(self, port_num):
raise NotImplementedError

def set_low_power_mode(self, port_num, lpmode):
raise NotImplementedError

def reset(self, port_num):
raise NotImplementedError

def get_transceiver_change_event(self):
raise NotImplementedError
39 changes: 30 additions & 9 deletions device/celestica/x86_64-cel_e1031-r0/sensors.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
# libsensors configuration file for Celestica DX010.
# libsensors configuration file for Celestica E1031.
# The i2c bus portion is omit because adapter name
# changes every time when system boot up.

chip "max6697-i2c-*-1a"
label temp1 "temp sensor 1"
label temp2 "temp sensor 2"
label temp3 "temp sensor 3"
label temp4 "temp sensor 4"
label temp5 "temp sensor 5"
ignore temp6
ignore temp7
bus "i2c-3" "i2c-0-mux (chan_id 1)"
bus "i2c-11" "i2c-8-mux (chan_id 1)"

chip "max6697-i2c-3-1a"
label temp1 "CPU board temperature sensor : 1"
label temp2 "CPU board temperature sensor : 2"
label temp3 "CPU board temperature sensor : 3"
ignore temp4
ignore temp5
ignore temp6
ignore temp7

chip "max6697-i2c-11-1a"
label temp1 "Main board temperature sensor : 1"
label temp2 "Main board temperature sensor : 2"
label temp3 "Main board temperature sensor : 3"
label temp4 "Main board temperature sensor : 4"
label temp5 "Main board temperature sensor : 5"
ignore temp6
ignore temp7


chip "emc2305-i2c-*-4d"
ignore fan3
ignore fan5
label fan4 "Fan 1 :"
label fan2 "Fan 2 :"
label fan1 "Fan 3 :"

4 changes: 2 additions & 2 deletions platform/broadcom/platform-modules-cel.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Celestica DX010 and Haliburton Platform modules

CEL_DX010_PLATFORM_MODULE_VERSION = 0.8
CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.8
CEL_DX010_PLATFORM_MODULE_VERSION = 0.9
CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.9

export CEL_DX010_PLATFORM_MODULE_VERSION
export CEL_HALIBURTON_PLATFORM_MODULE_VERSION
Expand Down
11 changes: 9 additions & 2 deletions platform/broadcom/sonic-platform-modules-cel/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
sonic-cel-platform-modules (0.9) unstable; urgency=low

* Add haliburton platform module.

-- Wirut Getbamrung <wgetbumr@celestica.com> Fri, 17 Aug 2018 10:10:10 +0700

sonic-cel-platform-modules (0.8) unstable; urgency=low

* Add haliburton platform
* Add dx010 platform fan led control.
* The platform gpio init moved to kernel space.

-- Supakit Fuangkaew <sfuangk@celestica.com> Thu, 5 Apr 2018 09:09:09 +0700
-- Pradchaya Phucharoen <pphuchar@celestica.com> Mon, 1 Jul 2018 11:09:13 +0700

sonic-cel-platform-modules (0.7) unstable; urgency=low

Expand Down
Loading