Skip to content

Commit

Permalink
[Nokia-7215-A1] Update platform to add DC support (#20592)
Browse files Browse the repository at this point in the history
1) Add support for DC PSU
2) Enhance watchdog service
  • Loading branch information
Pavan-Nokia authored and mssonicbld committed Nov 13, 2024
1 parent fc845fc commit 34493c9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Unit]
Description=CPU WDT
Conflicts=watchdog-control.service
After=nokia-7215init.service
[Service]
ExecStart=/usr/local/bin/cpu_wdt.py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def __init__(self):
self._fan_list.append(fan)

for i in range(MAX_7215_PSU):
psu = Psu(i)
psu = Psu(i, self.get_model())
self._psu_list.append(psu)

for i in range(MAX_7215_THERMAL):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0):
if self.is_psu_eeprom:
self.index = psu_index
self.part_number = '1'
self.model_str = 'PJT-12V100WBBA'
self.model_str = 'NA'
self.serial_number = 'NA'

if self.is_fan_eeprom:
self.index = fan_index
self.part_number = '1'
self.model_str = 'FFB0412UHN-BC2EA12'
self.model_str = 'NA'
self.serial_number = 'NA'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def get_direction(self):
"""
ch_model=self.get_chassis_model()
#compare first 8 characters of chassis molel string
if(ch_model[:8]=='3HE18723'):
if(ch_model[:8]=='3HE18723' or ch_model[:8]=='3HE20994' ):
direction = 'intake'
else:
direction = 'exhaust'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
class Psu(PsuBase):
"""Nokia platform-specific PSU class for 7215 """

def __init__(self, psu_index):
def __init__(self, psu_index, chassis_model):
PsuBase.__init__(self)
# PSU is 1-based in Nokia platforms
self.index = psu_index + 1
self._fan_list = []

self.chassis_model = chassis_model

# PSU eeprom
self.eeprom = Eeprom(is_psu=True, psu_index=self.index)
Expand Down Expand Up @@ -90,7 +90,16 @@ def _get_active_psus(self):
active_psus = int(psu1_good) + int(psu2_good)

return active_psus

def get_chassis_model(self):
"""
Retrieves the model number of the Fan
Returns:
string: Model number of Fan. Use part number for this.
"""
return self.chassis_model

def get_name(self):
"""
Retrieves the name of the device
Expand Down Expand Up @@ -118,7 +127,14 @@ def get_model(self):
Returns:
string: Part number of PSU
"""
return self.eeprom.modelstr()
ch_model=self.get_chassis_model()
#compare first 8 characters of chassis molel string
if(ch_model[:8]=='3HE18723' or ch_model[:8]=='3HE18724' ):
model = 'AC-PSU'
else:
model = 'DC-PSU'

return model

def get_serial(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ case "$1" in
systemctl enable nokia-7215init.service
systemctl start nokia-7215init.service

systemctl mask --now watchdog-control.service
systemctl enable cpu_wdt.service
systemctl start cpu_wdt.service

Expand Down

0 comments on commit 34493c9

Please sign in to comment.