Skip to content

Commit 816e476

Browse files
authored
[action] [PR:26424] [Nokia-vs] Add fpga temp and fix error (#2179)
1) Add support for fpga temperature 2) Fix error of incorrect driver load <!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> #### Why I did it ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it #### How to verify it <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com> #### A picture of a cute animal (not mandatory but encouraged)
1 parent c3e358d commit 816e476

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
obj-m:= nokia_7215_ixs_c1_cpld.o cn9130_cpu_thermal_sensor.o cn9130_led.o
1+
MULE = mule
2+
$(MULE)-objs := mule_uart.o
3+
obj-m:= nokia_7215_ixs_c1_cpld.o cn9130_cpu_thermal_sensor.o cn9130_led.o \
4+
$(MULE).o

platform/nokia-vs/sonic-platform-nokia/7215-c1/scripts/nokia-7215-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ load_kernel_drivers() {
190190
sudo insmod /lib/modules/${KVER}/kernel/extra/nokia_7215_ixs_c1_cpld.ko
191191
fi
192192
sudo insmod /lib/modules/${KVER}/kernel/extra/cn9130_cpu_thermal_sensor.ko
193-
sudo insmod /lib/modules/${KVER}/kernel/extra/nokia_console_fpga.ko
193+
sudo insmod /lib/modules/${KVER}/kernel/extra/mule.ko
194194
sudo insmod /lib/modules/${KVER}/kernel/extra/cn9130_led.ko
195195
}
196196

platform/nokia-vs/sonic-platform-nokia/7215-c1/sonic_platform/thermal.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
raise ImportError(str(e) + "- required module not found")
1616

1717
sonic_logger = logger.Logger('thermal')
18-
18+
FPGA_DIR = "/sys/bus/pci/devices/0000:01:00.0/"
1919
class Thermal(ThermalBase):
2020
"""Nokia platform-specific Thermal class"""
2121

@@ -25,7 +25,7 @@ class Thermal(ThermalBase):
2525
['0-004a/hwmon/', 1])
2626

2727
CN9130_THERMAL_DIR = "/sys/class/hwmon/hwmon1/"
28-
FPGA_TEMP_INFO = "FPGA_TEMPERATURE_INFO"
28+
2929

3030
THERMAL_NAME = ("PCB BACK", "PCB FRONT", "PCB MID", "FPGA", "CPU CORE")
3131

@@ -157,8 +157,11 @@ def get_temperature(self):
157157
"""
158158

159159
if self.index == 4:
160-
#TODO: add FPGA temperature sensor
161-
thermal_temperature = 1
160+
thermal_temperature = self._read_sysfs_file(FPGA_DIR + "temp_cur")
161+
if (thermal_temperature != 'ERR'):
162+
thermal_temperature = float(thermal_temperature)
163+
else:
164+
thermal_temperature = 0
162165
else:
163166
thermal_temperature = self._read_sysfs_file(self.thermal_temperature_file)
164167
if (thermal_temperature != 'ERR'):

0 commit comments

Comments
 (0)