Skip to content

Commit

Permalink
[Platform][ixs7215]: Platform API test required files with Updates an…
Browse files Browse the repository at this point in the history
…d Improvements (#6738)

- Why I did it
Enable platform API tests to run successfully by providing required test infrastructure files along with supporting changes.

- How I did it
Added platform.json along with supporting changes.
- Addition of pcie.yaml supporting pcied
- Addition of Real fan drawer support vs Virtual
- Removal of python2 wheel with support in place for python3
- supporting changes platform api tests
  • Loading branch information
carl-nokia authored Feb 11, 2021
1 parent 9cd9ff7 commit 2bf1806
Show file tree
Hide file tree
Showing 16 changed files with 522 additions and 123 deletions.
226 changes: 226 additions & 0 deletions device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
{
"chassis": {
"name": "7215 IXS-T1",
"components": [
{
"name": "System-CPLD"
},
{
"name": "U-Boot"
}
],
"fans": [
{
"name": "Fan1"
},
{
"name": "Fan2"
}
],
"fan_drawers": [
{
"name": "drawer1",
"fans": [
{
"name": "Fan1"
}
]
},
{
"name": "drawer2",
"fans": [
{
"name": "Fan2"
}
]
}
],
"psus": [
{
"name": "PSU1"
},
{
"name": "PSU2"
}
],
"thermals": [
{
"name": "PCB PHY"
},
{
"name": "PCB MAC"
},
{
"name": "ADT7473-CPU"
},
{
"name": "ADT7473-LOC"
},
{
"name": "ADT7473-MAC"
},
{
"name": "CPU Core"
}
],
"sfps": [
{
"name": "Ethernet0"
},
{
"name": "Ethernet1"
},
{
"name": "Ethernet2"
},
{
"name": "Ethernet3"
},
{
"name": "Ethernet4"
},
{
"name": "Ethernet5"
},
{
"name": "Ethernet6"
},
{
"name": "Ethernet7"
},
{
"name": "Ethernet8"
},
{
"name": "Ethernet9"
},
{
"name": "Ethernet10"
},
{
"name": "Ethernet11"
},
{
"name": "Ethernet12"
},
{
"name": "Ethernet13"
},
{
"name": "Ethernet14"
},
{
"name": "Ethernet15"
},
{
"name": "Ethernet16"
},
{
"name": "Ethernet17"
},
{
"name": "Ethernet18"
},
{
"name": "Ethernet19"
},
{
"name": "Ethernet20"
},
{
"name": "Ethernet21"
},
{
"name": "Ethernet22"
},
{
"name": "Ethernet23"
},
{
"name": "Ethernet24"
},
{
"name": "Ethernet25"
},
{
"name": "Ethernet26"
},
{
"name": "Ethernet27"
},
{
"name": "Ethernet28"
},
{
"name": "Ethernet29"
},
{
"name": "Ethernet30"
},
{
"name": "Ethernet31"
},
{
"name": "Ethernet32"
},
{
"name": "Ethernet33"
},
{
"name": "Ethernet34"
},
{
"name": "Ethernet35"
},
{
"name": "Ethernet36"
},
{
"name": "Ethernet37"
},
{
"name": "Ethernet38"
},
{
"name": "Ethernet39"
},
{
"name": "Ethernet40"
},
{
"name": "Ethernet41"
},
{
"name": "Ethernet42"
},
{
"name": "Ethernet43"
},
{
"name": "Ethernet44"
},
{
"name": "Ethernet45"
},
{
"name": "Ethernet46"
},
{
"name": "Ethernet47"
},
{
"name": "Ethernet48"
},
{
"name": "Ethernet49"
},
{
"name": "Ethernet50"
},
{
"name": "Ethernet51"
}
]
},
"interfaces": {}
}
20 changes: 20 additions & 0 deletions device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/pcie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- bus: '00'
dev: '01'
fn: '0'
id: '6820'
name: 'PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 0a)'
- bus: '00'
dev: '02'
fn: '0'
id: '6820'
name: 'PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 0a)'
- bus: '01'
dev: '00'
fn: '0'
id: c804
name: 'Ethernet controller: Marvell Technology Group Ltd. Device c804'
- bus: '02'
dev: '00'
fn: '0'
id: c804
name: 'Ethernet controller: Marvell Technology Group Ltd. Device c804'
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ chmod 644 /sys/class/i2c-adapter/i2c-0/0-0053/eeprom
echo eeprom 0x55 > /sys/class/i2c-adapter/i2c-0/new_device
echo eeprom 0x56 > /sys/class/i2c-adapter/i2c-0/new_device

# Enumerate psu eeprom devices
echo eeprom 0x51 > /sys/class/i2c-adapter/i2c-1/new_device
echo eeprom 0x52 > /sys/class/i2c-adapter/i2c-1/new_device

# Enable optical SFP Tx
i2cset -y -m 0x0f 0 0x41 0x5 0x00

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sonic_platform.sfp import Sfp
from sonic_platform.eeprom import Eeprom
from sonic_platform.fan import Fan
from .fan_drawer import VirtualDrawer
from .fan_drawer import RealDrawer
from sonic_platform.psu import Psu
from sonic_platform.thermal import Thermal
from sonic_platform.component import Component
Expand All @@ -35,8 +35,8 @@
PORT_END = 52

# Device counts
MAX_7215_FAN_DRAWER = 1
MAX_7215_FAN = 2
MAX_7215_FAN_DRAWERS = 2
MAX_7215_FANS_PER_DRAWER = 1
MAX_7215_PSU = 2
MAX_7215_THERMAL = 6

Expand Down Expand Up @@ -89,9 +89,9 @@ def __init__(self):
self._eeprom = Eeprom()

# Construct lists fans, power supplies, thermals & components
drawer_num = MAX_7215_FAN_DRAWER
fan_num_per_drawer = MAX_7215_FAN
drawer_ctor = VirtualDrawer
drawer_num = MAX_7215_FAN_DRAWERS
fan_num_per_drawer = MAX_7215_FANS_PER_DRAWER
drawer_ctor = RealDrawer
fan_index = 0
for drawer_index in range(drawer_num):
drawer = drawer_ctor(drawer_index)
Expand Down Expand Up @@ -159,14 +159,6 @@ def get_model(self):
"""
return self._eeprom.part_number_str()

def get_serial(self):
"""
Retrieves the serial number of the chassis (Service tag)
Returns:
string: Serial number of chassis
"""
return self._eeprom.serial_str()

def get_status(self):
"""
Retrieves the operational status of the chassis
Expand All @@ -186,7 +178,7 @@ def get_base_mac(self):
"""
return self._eeprom.base_mac_addr()

def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Expand Down Expand Up @@ -307,7 +299,7 @@ def set_status_led(self, color):

# Write sys led
if smbus_present == 0:
sonic_logger.log_info("PMON LED SET ERROR-> smbus present = 0")
sonic_logger.log_warning("PMON LED SET -> smbus present = 0")
else:
bus = smbus.SMBus(0)
DEVICE_ADDRESS = 0x41
Expand All @@ -328,7 +320,7 @@ def get_status_led(self):
"""
# Read sys led
if smbus_present == 0:
sonic_logger.log_info("PMON LED GET ERROR-> smbus present = 0")
sonic_logger.log_warning("PMON LED GET -> smbus present = 0")
return False
else:
bus = smbus.SMBus(0)
Expand Down Expand Up @@ -372,6 +364,23 @@ def get_watchdog(self):
watchdog_device_path = "/dev/watchdog0"
self._watchdog = WatchdogImplBase(watchdog_device_path)
except Exception as e:
sonic_logger.log_info("Fail to load watchdog {}".format(repr(e)))
sonic_logger.log_warning(" Fail to load watchdog {}".format(repr(e)))

return self._watchdog

def get_position_in_parent(self):
"""
Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position
for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned
Returns:
integer: The 1-based relative physical position in parent device or -1 if cannot determine the position
"""
return -1

def is_replaceable(self):
"""
Indicate whether this device is replaceable.
Returns:
bool: True if it is replaceable.
"""
return False
Loading

0 comments on commit 2bf1806

Please sign in to comment.