Commit Graph

37 Commits

Author SHA1 Message Date
jostar-yang
6ed491db74 [Edgecore][sonic-platform-modules-accton]Support kernel 6.1 and bookworm (#16982)
* [Edgecore][sonic-platform-modules-accton]Support kernel 6.1 and bookworm

* Modify pddf drv code for i2c_remove_callback function fail
2023-11-21 18:53:15 -08:00
Ramasamy Chandramouli
c436ce20be [PR:16737, PR:16739] platform-modules: pddf, broadcom/cel: adapt for kernel 6.1 and bookworm (#16954)
* sonic-platform-modules-cel: broadcom: adapt for kernel 6.1 and bookworm

The i2c_driver->remove API declaration has been updated to return void instead
of int, as part of cleanup patches in 6.1. More details can be referred from
here: [1]. Update the remove API definition in the modules accordingly and
cleanup variables that go unused from the remove API.

Update python build commands for bookworm. The packaging based on calling
setup.py is deprecated and using build module/pip utility is the recommended
method for python packaging/installation. Further details can be referred to
from here: [2], [3]. The build module is picky about the package information file,
which needs to be either setup.py or pyproject.toml.

Additionally, fix formatting inconsistencies in debian/changelog reported by
`dh_installchangelogs` during the build.

Tested the changes by compiling the changes as below:

    make sonic-slave-bash NOBUSTER=1 NOBULLSEYE=1
    sudo dpkg -i target/debs/bookworm/linux-headers-6.1.0-11-2-*.deb
    cd platform/broadcom/sonic-platform-modules-cel
    KVERSION=6.1.0-11-2-amd64 dpkg-buildpackage

Also verified the python scripts under the sonic-platform-modules-cel with
pyflakes to ensure no new errors are flagged (with exception of unused modules).

References:
   [1] - https://github.com/torvalds/linux/commit/ed5c2f5f
   [2] - https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.htm
   [3] - 0b20a4863 (Update Python build commands for Bookworm, 2023-09-07)

Signed-off-by: Ramasamy Chandramouli <rachandr@celestica.com>

* platform/pddf: i2c: adapt for kernel 6.1 and bookworm

   * Fixup i2c_driver->remove API due to changes in the function
     prototype (ref: [1]).

   * Cleanup `MODULE_SUPPORTED_DEVICE` macros that were cleaned up in
     the upstream (ref: [2]).

   * Sanitize python packaging and installation using the `build` module
   instead of calling the setup.py directly (ref: [3]. [4]).

Tested the changes by compiling pddf module as below:

     make sonic-slave-bash NOBUSTER=1 NOBULLSEYE=1
     sudo dpkg -i target/debs/bookworm/linux-headers-6.1.0-11-2-*.deb
     cd platform/pddf/i2c
     KVERSION=6.1.0-11-2-amd64 dpkg-buildpackage

References:
    [1] - https://github.com/torvalds/linux/commit/ed5c2f5f
    [2] - https://github.com/torvalds/linux/commit/6417f031
    [2] - https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.htm
    [3] - 0b20a4863 (Update Python build commands for Bookworm, 2023-09-07)

Signed-off-by: Ramasamy Chandramouli <rachandr@celestica.com>

* platform/broadcom: include platform-modules-cel in builds

With pddf modules patched for 6.1, platform-modules-cel can be compiled
and included in the final image.

Testing by building sonic-broadcom.bin/sonic-broadcom-dnx.bin.

Signed-off-by: Ramasamy Chandramouli <rachandr@celestica.com>

* pddf/i2c: revert correct rootdir for pip install

The pip install directory has been set to test-pkg1/ for testing the build and
incorrectly retained as is. Revert this to the correct path $(PACKAGE_PRE_NAME).

Signed-off-by: Ramasamy Chandramouli <rachandr@celestica.com>

* platform/broadcom: include pddf/modules-cel in the base package

Without this change, the modules were built but not packaged in the final .bin.

The final sonic-broadcom.bin has been tested for bootup on Celestica's
Silverstone platform.

   admin@sonic:~$ uname -a
   Linux sonic 6.1.0-11-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-4 (2023-08-08) x86_64 GNU/Linux
   admin@sonic:~$ show platform summary
   Platform: x86_64-cel_silverstone-r0
   HwSKU: Silverstone
   ASIC: broadcom
   ASIC Count: 1
   Serial Number: R4009B2F062504LK200024
   Model Number: N/A
   Hardware Revision: N/A
   admin@sonic:~$ show version | head

   SONiC Software Version: SONiC.g0aad6c67c-rachandr
   SONiC OS Version: 12
   Distribution: Debian 12.2
   Kernel: 6.1.0-11-2-amd64
   Build commit: 0aad6c67c
   Build date: Thu Oct 26 07:13:47 UTC 2023
   Built by: rachandr@AZUHPS14

   Platform: x86_64-cel_silverstone-r0

Signed-off-by: Ramasamy Chandramouli <rachandr@celestica.com>

---------

Signed-off-by: Ramasamy Chandramouli <rachandr@celestica.com>
2023-11-21 18:53:15 -08:00
Paul Menzel
554700a2f0
[doc]: Improve platform/pddf/readme.md (#16525)
* platform/pddf/README.md: Fix typo in *development*
* platform/pddf/README.md: Remove trailing space
* platform/pddf/README.md: Remove leading space from all lines
2023-09-23 00:11:03 -07:00
Christian Svensson
566fe1eb1b
[pddf] Enable deselect logic for CPLDMUX (#14631)
This feature was meant to be enabled but was accidentally left disabled.

Also downgrades the select/deselect messages to KERN_INFO to reduce log
spam.

Fixes #14546.

Signed-off-by: Christian Svensson <blue@cmd.nu>
2023-09-11 11:36:39 -07:00
FuzailBrcm
bb8ce50cbe
Adding support for extra GPIO chips in the common PDDF driver (#16082) 2023-08-11 09:31:18 -07:00
FuzailBrcm
8524e563d3
PDDF: Supporting extra system fans in the common PDDF drivers (#15956) 2023-08-08 14:59:36 -07:00
FuzailBrcm
37eddd479d
[pddf]: Adding S3IP supported attribute for FAN in PDDF (#15075)
The S3IP (Simplified Switch System INtegration Program) sysfs specification defines a unified interface to access peripheral hardware on devices from different vendors, making it easier for SONiC to support different devices and platforms.

PDDF is a framework to simplify the driver and SONiC platform APIs development for new platforms. This effort is first step in combining the two frameworks.

This specific PR adds S3IP supported sysfs attribute in common FAN driver of PDDF.
2023-05-18 14:06:46 -07:00
FuzailBrcm
d6768b3259
[pddf]: Adding S3IP supported attribute for LEDs in PDDF (#15074)
The S3IP (Simplified Switch System INtegration Program) sysfs specification defines a unified interface to access peripheral hardware on devices from different vendors, making it easier for SONiC to support different devices and platforms.

PDDF is a framework to simplify the driver and SONiC platform APIs development for new platforms. This effort is first step in combining the two frameworks.

This specific PR adds the S3IP supported sysfs attributes in PDDF common LED driver.
2023-05-18 14:06:19 -07:00
FuzailBrcm
771a1170d8
[pddf]: Adding and enabling S3IP support in PDDF (#15073)
Why I did it
The S3IP (Simplified Switch System INtegration Program) sysfs specification defines a unified interface to access peripheral hardware on devices from different vendors, making it easier for SONiC to support different devices and platforms.

PDDF is a framework to simplify the driver and SONiC platform APIs development for new platforms. This effort is first step in combining the two frameworks.

This specific PR adds support for pddf-s3ip-init.service and enables it in PDDF.
2023-05-18 13:13:16 -07:00
FuzailBrcm
d3e3565a6c
Fix issue: enhancing PDDF common eeprom APIs to use caching (#13835) (#13848)
Why I did it
To enhance pddf_eeprom.py to use caching and fix #13835

How I did it
Utilising the in-built caching mechanism in the base class eeprom_base.py.
Adding a cache file to store the eeprom data.

How to verify it
By running 'decode-syseeprom' or 'show platform syseeprom' commands.
2023-03-14 17:54:58 -07:00
FuzailBrcm
f822373e53
Enabling FPGA device support in PDDF (#13477)
Why I did it
To enable FPGA support in PDDF.

How I did it
Added FPGAI2C and FPGAPCI in the build path for the PDDF debian package
Added the support for FPGA access APIs in the drivers of fan, xcvr, led etc.
Added the FPGA device creation support in PDDF utils and parsers

How to verify it
These changes can be verified on some platform using such FPGAs. For testing purpose, we took Dell S5232f platform and brought it up using PDDF. In doing so, FPGA devices are created using PDDF and optics eeproms were accessed using common FPGA drivers. Below are some of the logs.
2023-03-14 17:53:35 -07:00
FuzailBrcm
0704ff5e6c
[pddf]: Adding support for FPGAPCIe in PDDF (#13476)
Why I did it
Some of the platform vendors use FPGA in the HW design. This FPGA is connected to the CPU via PCIe interface. This FPGA also works as an I2C controller having other devices attached to the I2C channels emanating from it. Adding a common module, a driver and a platform specific algorithm module to be used for such FPGA in PDDF.

How I did it
Added 'pddf_fpgapci_module', 'pddf_fpgapci_driver' and a sample algorithm module for Xilinx device 7021. Kernel modules which takes the platform dependent data from PDDF JSON files and initialises the PCIe FPGA. The sample algorithm module can be used by the ODMs in case the communication algorithms are same for their device. Else, they need to come up with similar algo module.

How to verify it
Any platform having such an FPGA and brought up using PDDF would use these kernel modules. The detail representation of such a device in PDDF JSON file is covered in the HLD.
2023-02-06 13:48:31 -08:00
FuzailBrcm
120aa78b07
[pddf]: Modifying the PDDF common platform APIs as per the LED driver changes (#13474)
Why I did it
LED driver changed due to introduction of FPGA support. The PDDF parser and APIs need to be updated. In turn the common platform APIs also require changes.

How I did it
Changed the get/set status LED APIs for PSU, fan and fan_drawer.
Changed the color strings to plain color name. e.g. 'STATUS_LED_COLOR_GREEN' has been changed to 'green'
Added support for LED color get operation via BMC
How to verify it
Verified the new changes on Accton AS7816-64X platform.

root@sonic:/home/admin#
root@sonic:/home/admin# show platform summary
Platform: x86_64-accton_as7816_64x-r0
HwSKU: Accton-AS7816-64X
ASIC: broadcom
ASIC Count: 1
Serial Number: AAA1903AAEV
Model Number: FP3AT7664000A
Hardware Revision: N/A
root@sonic:/home/admin#
root@sonic:/home/admin# show ver |more

SONiC Software Version: SONiC.master.0-dirty-20230111.010655
Distribution: Debian 11.6
Kernel: 5.10.0-18-2-amd64
Build commit: 3176b15ae
Build date: Wed Jan 11 09:12:54 UTC 2023
Built by: fk410167@sonic-lvn-csg-006

Platform: x86_64-accton_as7816_64x-r0
HwSKU: Accton-AS7816-64X
ASIC: broadcom
ASIC Count: 1
Serial Number: AAA1903AAEV
Model Number: FP3AT7664000A
Hardware Revision: N/A
Uptime: 09:24:42 up 4 days, 22:45,  1 user,  load average: 1.97, 1.80, 1.51
Date: Mon 23 Jan 2023 09:24:42

Docker images:
REPOSITORY                    TAG                              IMAGE ID       SI
ZE
docker-orchagent              latest                           63262c7468d7   38
5MB
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_ledutil getstatusled LOC_LED
off
root@sonic:/home/admin# pddf_ledutil getstatusled DIAG_LED
green
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_ledutil setstatusled DIAG_LED red
True
root@sonic:/home/admin# pddf_ledutil getstatusled DIAG_LED
red
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_ledutil setstatusled DIAG_LED amber
Invalid color
False
root@sonic:/home/admin# pddf_ledutil getstatusled DIAG_LED
red
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_ledutil setstatusled DIAG_LED green
True
root@sonic:/home/admin# pddf_ledutil getstatusled DIAG_LED
green
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# pddf_ledutil getstatusled LOC_LED
off
root@sonic:/home/admin# pddf_ledutil setstatusled LOC_LED amber
True
root@sonic:/home/admin# pddf_ledutil getstatusled LOC_LED
amber
root@sonic:/home/admin# pddf_ledutil setstatusled LOC_LED off
True
root@sonic:/home/admin# pddf_ledutil getstatusled LOC_LED
off
root@sonic:/home/admin#
2023-02-02 11:23:30 -08:00
FuzailBrcm
0abc4f0c4a
[pddd]: Adding support for I2CFPGA in PDDF (#13475)
Why I did it
Some of the platform vendors use FPGA in the HW design. This FPGA is connected to the CPU via I2C bus. Adding a common module and a driver to be used for such FPGA in PDDF.

How I did it
Added 'pddf_fpgai2c_module' and 'pddf_fpgai2c_driver' kernel modules which takes the platform dependent data from PDDF JSON files and creates an I2C client for the FPGA.

How to verify it
Any platform having such an FPGA and brought up using PDDF would use these kernel modules. The detail representation of such a device in PDDF JSON file is covered in the HLD.
2023-02-02 11:20:59 -08:00
pettershao-ragilenetworks
bce4aa1412
[ragile] adapter for kernel 5.x (#10762)
Why I did it
Ragile adapter ra-b6510-32c ra-b6510-48v8c ra-b6910-64c ra-b6920-4s to kernel 5.x

Signed-off-by: “pettershao” pettershao@ragilenetworks.com
2023-01-12 18:01:47 -08:00
FuzailBrcm
8788f1cc0f
[pddf]: fix Observing the following error while running 'sfputil show lpmode' command. (#12636)
Why I did it
Fixes #12634

Observing the following error while running 'sfputil show lpmode' command.
AttributeError: 'Sfp' object has no attribute 'get_power_set'

Root Cause: get_power_set() is defined for QSFP28 and QSFP+ i.e. Sff8636 and Sff8634. However, the function is not defined in the optoe_base class.

How I did it
To use get_power_set(), we need to initialise the 'api' via get_xcvr_api() and then use it to run get_power_set().
2022-12-17 14:42:15 -08:00
FuzailBrcm
abc8ed8a79
[pddf]: Adding PDDF common framework enhancements. (#12863)
- Consolidating multiple read functions in a PSU driver on the basis of byte, word or block read,
- Enhancing PDDF parsing script support for CPU and PCH temperature reading,
- Adding missing methods in PDDF common APIs

Why I did it
- PSU driver changes are to optimize the code and increase the code coverage
- PDDF parser script enhancements to accommodate the CPU and PCH temp reading using hwmon device path
- Some of the new APIs were missing from the PDDF common platform classes

How I did it
Added code changes and verified them on AS7816 adn AS7726 platforms.
2022-12-17 14:36:52 -08:00
FuzailBrcm
0a8dd3f4f8
Adding support for get/set low power mode for QSFPs in PDDF common APIs (#11786)
* Adding support for get/set low pwer mode for QSFPs in PDDF common APIs

* Adding support for get/set low pwer mode for QSFPs in PDDF common APIs - Review comments
2022-09-09 14:33:12 -07:00
FuzailBrcm
f579f61e4c
Fix for Accton platform build failure when doing incremental build (#10541) 2022-05-09 12:17:38 -07:00
FuzailBrcm
0ed671c9af
Fixing some python errors in the common PDDF platform classes (#10669) 2022-05-09 10:49:25 -07:00
FuzailBrcm
122cb90695
Fix AS7726 not showing serial number in 'show platform summary' (#10489) (#10509) 2022-04-20 13:06:22 -07:00
FuzailBrcm
d3f2da8679
[pddf]: Adding support for fan_drawer class in PDDF common platform APIs (#10213)
Why I did it
fan_drawer support was missing in PDDF common platform APIs. This resulted in 'thermalctld' not working and 'show platform fan' and 'show platfomr temperature' commands not working.
_thermal_list array inside PSU class was not initialized. Made changes to attach the PSU related thermal sensors in the PSU instance.
How I did it
Added a common class pddf_fan_drawer.py. This class uses the PDDF JSON to fetch the platform specific data. A platform which uses PDDF would follow the below hierarchy.

fan_drawer_base.py ---> pddf_fan_drawer.py ---> fan_drawer.py

How to verify it
Run the 'show platform fan' and 'show platform temperature' commands and check the o/p.

o/p on AS7326:

root@sonic:/home/admin# show platform fan
s  Drawer    LED         FAN    Speed    Direction    Presence    Status          Timestamp
--------  -----  ----------  -------  -----------  ----------  --------  -----------------
Fantray1  green  Fantray1_1      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray1  green  Fantray1_2      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray2  green  Fantray2_1      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray2  green  Fantray2_2      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray3  green  Fantray3_1      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray3  green  Fantray3_2      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray4  green  Fantray4_1      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray4  green  Fantray4_2      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray5  green  Fantray5_1      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray5  green  Fantray5_2      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray6  green  Fantray6_1      38%      EXHAUST     Present        OK  20220311 04:15:03
Fantray6  green  Fantray6_2      38%      EXHAUST     Present        OK  20220311 04:15:03
     N/A    off   PSU1_FAN1       0%                  Present    Not OK  20220311 04:15:05
     N/A  green   PSU2_FAN1      34%      EXHAUST     Present        OK  20220311 04:15:05
hroot@sonic:/home/admin# show platform temperature
    Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
PSU1_TEMP1            0          N/A       N/A             N/A            N/A      False  20220311 04:15:05
PSU2_TEMP1           37          N/A       N/A             N/A            N/A      False  20220311 04:15:05
     TEMP1           37         80.0       N/A             N/A            N/A      False  20220311 04:15:05
     TEMP2           27         80.0       N/A             N/A            N/A      False  20220311 04:15:05
     TEMP3           28.5       80.0       N/A             N/A            N/A      False  20220311 04:15:05
     TEMP4           30.5       80.0       N/A             N/A            N/A      False  20220311 04:15:05
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
o/p on AS7726:

root@as7726-32x-2:~# show platform fan
  Drawer    LED         FAN    Speed    Direction    Presence    Status          Timestamp
--------  -----  ----------  -------  -----------  ----------  --------  -----------------
Fantray1  green  Fantray1_1      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray1  green  Fantray1_2      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray2  green  Fantray2_1      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray2  green  Fantray2_2      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray3  green  Fantray3_1      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray3  green  Fantray3_2      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray4  green  Fantray4_1      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray4  green  Fantray4_2      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray5  green  Fantray5_1      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray5  green  Fantray5_2      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray6  green  Fantray6_1      38%      EXHAUST     Present        OK  20220311 08:13:04
Fantray6  green  Fantray6_2      38%      EXHAUST     Present        OK  20220311 08:13:04
     N/A  green   PSU1_FAN1      23%      EXHAUST     Present        OK  20220311 08:13:04
     N/A  green   PSU2_FAN1      22%      EXHAUST     Present        OK  20220311 08:13:04
root@as7726-32x-2:~# show platform temp
    Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
PSU1_TEMP1           28          N/A       N/A             N/A            N/A      False  20220311 08:13:04
PSU2_TEMP1           25          N/A       N/A             N/A            N/A      False  20220311 08:13:04
     TEMP1           23.5       80.0       N/A             N/A            N/A      False  20220311 08:13:04
     TEMP2           27         80.0       N/A             N/A            N/A      False  20220311 08:13:04
     TEMP3           24         80.0       N/A             N/A            N/A      False  20220311 08:13:04
     TEMP4           27         80.0       N/A             N/A            N/A      False  20220311 08:13:04
     TEMP5           24         80.0       N/A             N/A            N/A      False  20220311 08:13:04
2022-03-18 11:14:10 -07:00
FuzailBrcm
98cfec2982
Using SFP refactoring framework in PDDF sfp class (#10047)
* Using SFP refactoring framework in PDDF sfp class

* Fixing a typo error
2022-03-16 06:35:34 +05:30
FuzailBrcm
482ff1ca50
[pddf]: Support for idle_state device parameter is required for muxes using i2c_mux_pca954x driver (#10060)
As per linux kernel 5.10, 'force_deselct_on_exit' parameter used for driver i2c_mux_pca954x is no longer valid. Instead an attribute 'idle_state' is added per MUX device. This needs to be set to
-1 : For leaving the mux state as is
-2 : For deselecting the channel upon exit
: To always set a channel upon exit

This needs to be accommodated inside the PDDF JSON parser as well.
2022-03-03 15:58:34 -08:00
FuzailBrcm
6ed0c434b3
[pddf]: Adding pre_pddf_init script in the service file (#7834)
Why I did it
Some platforms need to run few steps before the PDDF service is actually started.

* Adding pre_pddf_init script in the service file
* Raising exception for get_target_speed() for PSU-fan in PDDF (#8129)
2022-01-02 22:28:48 -08:00
FuzailBrcm
fa361f164c
[pddf]: Update PDDF utils and common platform APIs for Debian Bullseye (#9585)
- Why I did it
PDDF utils were python2 compliant and they needed to be migrated to Python3 (as per Bullseye)
PDDF common platform APIs file name changed as the name was already in use
Indentation issues
Dead/redundant code needed to be removed

- How I did it
Made files Python3 compliant
Indentation corrected
Redundant code removed

- How to verify it
AS7326 Accton platform uses PDDF. PDDF utils were run on this platform to verify.
2022-01-02 22:27:01 -08:00
FuzailBrcm
93247a6e24
[pddf]: Update PDDF kernel modules with 5.10 kernel and fix some compilation (#9582)
- Why I did it
There were compilation errors and warnings like,

/usr/src/linux-headers-5.10.0-8-2-common/scripts/Makefile.build:69: You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.

fatal error: linux/platform_data/pca954x.h: No such file or directory

hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().

If PDDF kernel module compilation fails, the PDDF debian package was not detecting the break.

- How I did it
Modified the code with new kernel 5.10 APIs.
Modified the Makefiles to use 'obj-m' instead of 'subdir-y'

- How to verify it
PDDF is supported on Accton platform. Load the build on AS7326 setup and check the 'dmesg'
2022-01-02 22:24:19 -08:00
Aravind Mani
ac2885a988
[SFP-Refactor] Modify transceiver key name (#9447)
* Modify transceiever key name

* fix alignment
2021-12-09 12:38:45 +05:30
Saikrishna Arcot
d01d8ca5d5 Make changes needed to build a basic Broadcom image
Vendor-specific SAI modules have been commented out. Bootup has not been
tested.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2021-11-10 15:27:22 -08:00
Saikrishna Arcot
a1d30e3aa0 Python 2 removal/cleanup
Remove Python 2 package installation from the base image. For container
builds, reference Python 2 packages only if we're not building for
Bullseye.

For libyang, don't build Python 2 bindings at all, since they don't seem
to be used.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2021-11-10 15:27:22 -08:00
fk410167
42d22f4953
Invoking python3 installation for PDDF 2.0 PAI package (#7100)
Adjusting the PDDF utility with python3 commands
2021-04-08 08:21:17 -07:00
fk410167
0144258121
Few more python3 compatibility changes, PEP8 standard changes and add missing methods in PDDF common base APIs (#7021)
#### Why I did it
- Python3 compatibility changes for PDDF eeprom class
- Adding API for temperature in PDDF psu class
- PEP8 standard changes and adding missing method in PDDF sfp class

#### How I did it
- Using python3 to invoke the sonic_platform module in PDDF based platform
- Running autopep8 tool to comply to PEP8 standards
2021-03-12 11:49:22 -08:00
fk410167
20f0f069c1
Making PDDF 2.0 base classes python3 compliant (#6924)
- Made python2 to python3 changes
- Removed ord() func as python3 return int instead of str
- Had to change chr(..) to bytes([..]) function while using ctypes class methods
2021-03-01 09:48:59 -08:00
Joe LeVeque
18f2c5cfdd
[platform] Update QSFP method name 'parse_qsfp_dom_capability' -> 'parse_dom_capability' (#6695)
**- Why I did it**
PR https://github.com/Azure/sonic-platform-common/pull/102 modified the name of the SFF-8436 (QSFP) method to align the method name between all drivers, renaming it from `parse_qsfp_dom_capability` to `parse_dom_capability`. Once the submodule was updated, the callers using the old nomenclature broke. This PR updates all callers to use the new naming convention.

**- How I did it**

Update the name of the function globally for all calls into the SFF-8436 driver.

Note that the QSFP-DD driver still uses the old nomenclature and should be modified similarly. I will open a PR to handle this separately.
2021-02-05 14:41:05 -08:00
Joe LeVeque
e52581e919
[PDDF] Build and install Python 3 package (#6286)
- Make PDDF code compliant with both Python 2 and Python 3
- Align code with PEP8 standards using autopep8
- Build and install both Python 2 and Python 3 PDDF packages
2021-01-07 10:03:29 -08:00
Joe LeVeque
7f4ab8fbd8
[sonic-utilities] Update submodule; Build and install as a Python 3 wheel (#5926)
Submodule updates include the following commits:

* src/sonic-utilities 9dc58ea...f9eb739 (18):
  > Remove unnecessary calls to str.encode() now that the package is Python 3; Fix deprecation warning (#1260)
  > [generate_dump] Ignoring file/directory not found Errors (#1201)
  > Fixed porstat rate and util issues (#1140)
  > fix error: interface counters is mismatch after warm-reboot (#1099)
  > Remove unnecessary calls to str.decode() now that the package is Python 3 (#1255)
  > [acl-loader] Make list sorting compliant with Python 3 (#1257)
  > Replace hard-coded fast-reboot with variable. And some typo corrections (#1254)
  > [configlet][portconfig] Remove calls to dict.has_key() which is not available in Python 3 (#1247)
  > Remove unnecessary conversions to list() and calls to dict.keys() (#1243)
  > Clean up LGTM alerts (#1239)
  > Add 'requests' as install dependency in setup.py (#1240)
  > Convert to Python 3 (#1128)
  > Fix mock SonicV2Connector in python3: use decode_responses mode so caller code will be the same as python2 (#1238)
  > [tests] Do not trim from PATH if we did not append to it; Clean up/fix shebangs in scripts (#1233)
  > Updates to bgp config and show commands with BGP_INTERNAL_NEIGHBOR table (#1224)
  > [cli]: NAT show commands newline issue after migrated to Python3 (#1204)
  > [doc]: Update Command-Reference.md (#1231)
  > Added 'import sys' in feature.py file (#1232)

* src/sonic-py-swsssdk 9d9f0c6...1664be9 (2):
  > Fix: no need to decode() after redis client scan, so it will work for both python2 and python3 (#96)
  > FieldValueMap `contains`(`in`)  will also work when migrated to libswsscommon(C++ with SWIG wrapper) (#94)

- Also fix Python 3-related issues:
    - Use integer (floor) division in config_samples.py (sonic-config-engine)
    - Replace print statement with print function in eeprom.py plugin for x86_64-kvm_x86_64-r0 platform
    - Update all platform plugins to be compatible with both Python 2 and Python 3
    - Remove shebangs from plugins files which are not intended to be executable
    - Replace tabs with spaces in Python plugin files and fix alignment, because Python 3 is more strict
    - Remove trailing whitespace from plugins files
2020-11-25 10:28:36 -08:00
fk410167
a3dd3f55f9
Platform Driver Developement Framework (PDDF) (#4756)
This change introduces PDDF which is described here: https://github.com/Azure/SONiC/pull/536

Most of the platform bring up effort goes in developing the platform device drivers, SONiC platform APIs and validating them. Typically each platform vendor writes their own drivers and platform APIs which is very tailor made to that platform. This involves writing code, building, installing it on the target platform devices and testing. Many of the details of the platform are hard coded into these drivers, from the HW spec. They go through this cycle repetitively till everything works fine, and is validated before upstreaming the code.
PDDF aims to make this platform driver and platform APIs development process much simpler by providing a data driven development framework. This is enabled by:

JSON descriptor files for platform data
Generic data-driven drivers for various devices
Generic SONiC platform APIs
Vendor specific extensions for customisation and extensibility

Signed-off-by: Fuzail Khan <fuzail.khan@broadcom.com>
2020-11-12 10:22:38 -08:00