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

Test PR, no need to review, thx #9652

Draft
wants to merge 196 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
e0870a7
Add support as9716 platform
jostar-yang Jun 12, 2019
b580e8a
Merge branch 'master' of https://github.com/jostar-yang/sonic-buildimage
jostar-yang Jun 12, 2019
7973485
remove as9716
jostar-yang Jun 12, 2019
78f4fc3
remove as9716 needed mk
jostar-yang Jun 12, 2019
8a6c679
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Jun 17, 2019
f7826e3
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Jun 20, 2019
94006a5
Add to support as9716 platform
jostar-yang Jul 17, 2019
a893a68
Add support build as9716 platform to mk file
jostar-yang Jul 17, 2019
4c21d0a
Add support AS5835_54T platform
jostar-yang Jul 17, 2019
f3220df
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Jul 19, 2019
2e2b8ac
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Aug 5, 2019
c517556
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Sep 5, 2019
5ded80f
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Sep 11, 2019
e9aba06
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Sep 25, 2019
c148f54
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Oct 25, 2019
ba21e6b
Correct the value checking.
roylee123 Dec 9, 2019
2716719
Replace cpr and ym psu drivers to support lm-sensors.
roylee123 Dec 9, 2019
c304eb6
Merge branch 'master' of https://github.com/Azure/sonic-buildimage in…
roylee123 Dec 11, 2019
e2bbad5
[as7816-64x] Support different PSU sequence for any CPLD version
brandonchuang Dec 12, 2019
fa793e0
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Jan 6, 2020
48a537c
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Jan 7, 2020
531f583
Merge branch 'master' of https://github.com/Azure/sonic-buildimage
jostar-yang Mar 5, 2020
9002b0f
Merge remote-tracking branch 'upstream/master'
Apr 8, 2021
9da12fb
Fix control file fail issue
Apr 9, 2021
8fe11e3
Fix file conflict
Apr 9, 2021
dd1644b
Remove extra 'import'
Apr 9, 2021
edc3acd
[as9716_32d] Modify to support new PSU SN
Feb 5, 2021
a07fcd7
[AS5835-54T] Support PDDF
May 5, 2021
210173f
Fix LGTM alerts
May 5, 2021
2ce5919
Fix LGTM alert
May 5, 2021
4ace65c
[device][platform] Add to support as7926-40xfb platform
brandonchuang May 11, 2021
418421b
[device][platform] Fix LGTM alerts of as7926-40xfb
brandonchuang May 12, 2021
a295463
Merge branch 'master' into as7926_40xfb
brandonchuang May 12, 2021
77dac33
[device][platform] Fix LGTM alerts of as7926-40xfb (Syntax error)
brandonchuang May 12, 2021
11190b9
[device][platform] Fix LGTM alerts of as7926-40xfb (BaseException error)
brandonchuang May 13, 2021
b29771a
[device] Add ast.ko into blacklist since VGA of BMC is not used.
brandonchuang May 17, 2021
abcc1a2
[AS7816-64x]Add PSU SN to ym2651y drv
May 17, 2021
40590f2
Use pddf api instead of old api for set fan
May 19, 2021
a629122
[platform] Add sonic-platform-accton-as7926-40xfb.install
brandonchuang May 24, 2021
4d529f3
[as7326-56x] Fix port57_58 sysfs to revert value
May 31, 2021
a992d7e
[Accton] support ACBEL FSF019 PSU
seanwu-ec May 14, 2021
2564453
[as5835-54x] Add to support PDDF
Jun 9, 2021
d7dd271
Fix LGTM alerts
Jun 16, 2021
dce218a
[platform] Support transceiver change event
brandonchuang Jun 22, 2021
c09976b
[AS7326-56X] Support mulit PSU SN in PDDF
Jun 24, 2021
75bfb59
Modify to "data.model_name[0] = '\0'"
Jun 24, 2021
9112a00
Modify to "data.model_name[models[i].length]"
Jun 24, 2021
ab15d45
Add get_sfp to chassis
Jun 25, 2021
a8e7457
Add sonic_platform and get_sfpt to chassis
Jun 28, 2021
3335a3b
[AS4630-54PE] Add to support PDDF
Jun 29, 2021
87aa7cd
Fix LGTM alerts
Jun 30, 2021
0865106
Fix LGTM alerts
Jun 30, 2021
9cb4830
Fix LGTM alerts
Jul 1, 2021
867d386
[AS7712-32X] Add to support PDDF
Jul 2, 2021
7931fdb
Fix LGTM alerts
Jul 2, 2021
f13144a
Fix LGTM alert
Jul 6, 2021
100dbc5
[Accton/AS4630] update reg use for new CPLD FW
seanwu-ec Jul 7, 2021
1ef791d
Modufy get_sfp() start from 1 in get_change_event()
Jul 9, 2021
4fce601
Modify get_sfp( ) start from in get_change_event
Jul 9, 2021
66805ef
[device][platform] Add to support as7535-32xb platform
brandonchuang Jul 9, 2021
64848d7
[Accton] Support ACBEL FSF045 PSU
seanwu-ec Jul 13, 2021
1cbad33
[platform] Remove python 2.7 related code for as7926-40xfb
brandonchuang Jul 13, 2021
07faed4
[AS7726-32X] Add to support mulit PSU in PDDF
Jul 13, 2021
6c69d45
[platform] Add new platform as4630-54npe
seanwu-ec Jul 19, 2021
57b5e9d
Update CPLD reg use according to PR8115
seanwu-ec Jul 20, 2021
af9a5f6
Add sensors.conf to AS4630-54NPE
seanwu-ec Jul 20, 2021
00bf33e
[AS4630-54NPE] Enable thermalctld, disable pcied
seanwu-ec Jul 20, 2021
a84d931
Fix LGTM alerts
seanwu-ec Jul 20, 2021
1052ae0
Migrate API2.0 from AS4630-54PE to AS4630-54NPE
seanwu-ec Jul 20, 2021
c2b9fd1
Remove redundancy in accton_as4630_54npe_util.py
seanwu-ec Jul 20, 2021
6d1bb14
Apply changes from PR#5297
seanwu-ec Jul 22, 2021
af42a80
Apply changes from PR#6035
seanwu-ec Jul 22, 2021
46b8e49
Apply changes from PR#8033
seanwu-ec Jul 22, 2021
fd94d09
Fix LGTM alerts
seanwu-ec Jul 22, 2021
61e7881
Fix missing sonic_platform whl pkg
seanwu-ec Jul 22, 2021
0e1d285
Make scripts executable
seanwu-ec Jul 22, 2021
19443ca
Fix python2-style print in util.py
seanwu-ec Jul 22, 2021
ac10c51
Add post_device.sh to turn off stk led
Jul 23, 2021
9da4c9e
Remove API 1.0 util python scripts
seanwu-ec Jul 23, 2021
2e3ee74
Make sonic_platform package installed while bootup
seanwu-ec Jul 23, 2021
d0784ba
Fix PSU model/serial num fetching
seanwu-ec Jul 23, 2021
daebd20
Implement thermal threshold APIs
seanwu-ec Jul 23, 2021
c398bd5
Merge branch 'master' into as4630_update_cpld_reg_use
seanwu-ec Jul 26, 2021
4034b4c
Revert "Remove API 1.0 util python scripts"
seanwu-ec Jul 26, 2021
8cec9bc
[as4630-54npe] fix errors in sfputil.py
seanwu-ec Aug 2, 2021
cd235ab
Modify YM-2651Y SN offet
Aug 2, 2021
2b42ac6
Add component.py
Aug 3, 2021
d23d3d7
Add component.py
Aug 3, 2021
f2c305e
Add sensors.conf for AS9726-32D
seanwu-ec Aug 5, 2021
3d0addc
[AS9726-32D] enable thermalctld, disable pcied
seanwu-ec Aug 5, 2021
140b328
[AS9726-32D] remove unneeded code in util.py
seanwu-ec Aug 5, 2021
a3a9242
[AS9726-32D] add MFR_MAX_TEMP_1 reading in driver
seanwu-ec Aug 5, 2021
2ec7542
[AS9726-32D] support system-health check
seanwu-ec Aug 5, 2021
0be970d
Fix LGTM alerts
seanwu-ec Aug 5, 2021
0c7b91d
[as9726-32d] add thermal thresholds defined by HW
seanwu-ec Aug 6, 2021
cf4aac3
[as9726-32d] skip psu.temperature health check
seanwu-ec Aug 6, 2021
51a6390
Modify psu_serial_numn to psu_mfr_serial
Aug 17, 2021
a5b4a4d
Fix LGTM alert
Aug 17, 2021
9decb81
[AS7326-5X] Fix code bug for led drv
Aug 23, 2021
a3903cd
[AS7712-32X]Fixes led drv and add fan_direction sysfs
Aug 25, 2021
69b20ac
[AS4630-54TE] Fix psu drv to support YM1151D PSU
Aug 31, 2021
f805b54
[sonic_platform] Disable buffering when open eeprom file.
brandonchuang Sep 7, 2021
dede7c1
[AS5812_54X] Support API2.0
Sep 15, 2021
97b5e92
Fix sfp/fan/thermal code error
Sep 16, 2021
2005300
Fix LGTM alerts
Sep 16, 2021
c869643
Add to support system_health
Sep 29, 2021
ae2ddb7
Support system health monitor
Sep 29, 2021
a2403e8
Support system health monitor
Sep 29, 2021
2cb56ba
Fix LGTM alert
Sep 29, 2021
5dbe325
Fix as4630-54npe xcvrd busy issue
seanwu-ec Oct 13, 2021
e067483
Add platform_asic file because PR#8542
seanwu-ec Oct 13, 2021
4c97abf
[AS4630-54TE] Add QSFP reset and lpmode sysfs
seanwu-ec Oct 14, 2021
e10f554
Fix xcvrd busy issue
Oct 18, 2021
78b9446
Correct the wait and timeout mechanism for better CPU usage
Oct 18, 2021
f22b555
Fix xcvrd busy issue
Oct 18, 2021
9f0352b
Fix as5835-54x xcvrd busy issue
Oct 18, 2021
8238ec3
Fix AS7712-32X xcvrd busy issue
Oct 18, 2021
180729f
Add event.c to support port evt change
Oct 19, 2021
d80c699
Fix Sfp.get_name() on AS9726-32D
seanwu-ec Oct 21, 2021
12eec92
Fix I2C bus order
Oct 26, 2021
4255163
Add check CC_Base api to sfp.py
Oct 28, 2021
80eccc6
Support API2.0
Oct 29, 2021
08168dc
Fix LGTM alerts
Oct 29, 2021
3abd4c7
Fix LGTM and port index error
Oct 29, 2021
fa571f6
Changes for R0C HW
seanwu-ec Nov 3, 2021
ccfc52c
Fix LGTM alerts, remove unused import
seanwu-ec Nov 3, 2021
e3f266f
[AS4630-54PE] Fix led drv and i2c bus order
Nov 4, 2021
2786c8a
Fix code bug
Nov 5, 2021
eeec97a
Remove led de due to another PR has this file
Nov 5, 2021
16bd234
Fix fan direction api
Nov 16, 2021
9caec9e
[platform][as7535-32xb] Support PSU/FAN payload
brandonchuang Nov 19, 2021
987ee86
[platform][as7926] Support more sonic_platform features
brandonchuang Nov 25, 2021
31ebff7
[platform][as7535-32xb] Modify thermal and psu data to match openbmc …
brandonchuang Nov 26, 2021
84227ae
[4630-54NPE] Add CPU coretemp to thermal.py
seanwu-ec Dec 9, 2021
0d63cd7
[AS9726-32D] Add CPU coretemp to thermal.py
seanwu-ec Dec 9, 2021
b635441
Merge branch 'master' into as9726-32x_support_systemhealth
seanwu-ec Dec 10, 2021
c2893a4
Add serial num sysfs node to PSU driver
seanwu-ec Dec 14, 2021
56263d4
Fix port mapping in sfp.py
Dec 14, 2021
29b3348
Add intel_iommu=off to installer.conf
Dec 23, 2021
9e73e95
Merge remote-tracking branch 'azure/pr/7615' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
7fd4f6c
Merge remote-tracking branch 'azure/pr/8115' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
38b1bdd
Merge remote-tracking branch 'azure/pr/8220' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
49c0028
Merge remote-tracking branch 'azure/pr/8346' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
b105e85
Merge remote-tracking branch 'azure/pr/7627' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
d3ef816
Merge remote-tracking branch 'azure/pr/6691' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
6a99f5d
Merge remote-tracking branch 'azure/pr/7520' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
b35d519
Merge remote-tracking branch 'azure/pr/7757' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
7520486
Merge remote-tracking branch 'azure/pr/7966' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
ef99765
Merge remote-tracking branch 'azure/pr/8164' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
fafc8e3
Merge remote-tracking branch 'azure/pr/8555' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
6e6d400
Merge remote-tracking branch 'azure/pr/8580' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
eb40ec5
Merge remote-tracking branch 'azure/pr/8638' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
5e77409
Merge remote-tracking branch 'azure/pr/8760' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
764c8ed
Merge remote-tracking branch 'azure/pr/9112' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
7bf5e38
Add led drv code
Dec 28, 2021
51354a8
Merge remote-tracking branch 'azure/pr/3866' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
16fef3e
Merge remote-tracking branch 'azure/pr/3882' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
5c50b31
Merge remote-tracking branch 'azure/pr/7577' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
f10145d
Merge remote-tracking branch 'azure/pr/8139' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
84a06cb
Merge remote-tracking branch 'azure/pr/7615' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
236b272
Merge remote-tracking branch 'azure/pr/8220' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
c01b798
Merge remote-tracking branch 'azure/pr/8346' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
92977a5
Merge remote-tracking branch 'azure/pr/8760' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
b8df976
Merge remote-tracking branch 'azure/pr/9170' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
2f3efa6
Merge remote-tracking branch 'azure/pr/7577' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
d808bb0
Merge remote-tracking branch 'azure/pr/8139' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
82f835d
Merge remote-tracking branch 'azure/pr/8014' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
d497412
Merge remote-tracking branch 'azure/pr/7828' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
a71c247
Merge remote-tracking branch 'azure/pr/8040' into all_PRs_include_ker…
seanwu-ec Dec 28, 2021
27d6239
[as7535/as7926] add missing platform_asic
seanwu-ec Dec 29, 2021
46b52e1
fix some LGTM alerts
seanwu-ec Dec 29, 2021
b3fe579
fix build err on fbfpgaiomodule.c
seanwu-ec Dec 29, 2021
fb3eaf9
fix LGTM alerts
seanwu-ec Dec 29, 2021
74d7af1
fix build err: missing minipack fpga whl
seanwu-ec Dec 30, 2021
b25019d
[AS7535-32XB] Fix ko build err
seanwu-ec Dec 30, 2021
4fa2e78
[AS7926-40XFB] Fix ko build err
seanwu-ec Dec 30, 2021
d21da0f
[AS7926-40XB/AS7535-27XB] util.py support python3
seanwu-ec Jan 6, 2022
84b707b
[AS7315-27XB]Add intel_iommu=off to installer.conf
seanwu-ec Jan 6, 2022
82debb6
[AS7315-27XB] remove customized at24 driver
seanwu-ec Jan 7, 2022
a12248e
[AS7315-27XB] pin I2C-0/I2C-1 bus order
seanwu-ec Jan 7, 2022
b49c3d7
[AS7315-27XB] fix i2c bus num for fan driver
seanwu-ec Jan 7, 2022
0848bc3
halfway to fix as7326 build err
seanwu-ec Jan 11, 2022
7ce4ae6
[pddf]: Update PDDF kernel modules with 5.10 kernel and fix some comp…
FuzailBrcm Jan 3, 2022
673afd3
[pddf]: Update PDDF utils and common platform APIs for Debian Bullsey…
FuzailBrcm Jan 3, 2022
0ce8483
halfway to fix as9716 build err
seanwu-ec Jan 12, 2022
45fca4c
[AS4630-54PE] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
31bae88
[AS5812-54X] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
a84b6f0
[AS5835-54T] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
e7ed714
[AS5835-54X] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
164af47
[AS7535-32XB] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
c45a429
[AS7712-32X] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
1dc3809
[AS7926-40XFB] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
2957f04
[minipack] Enable pca954x idle_disconnect
seanwu-ec Jan 13, 2022
ac395c6
[AS4630-54NPE]Fix kernel5.10 build err in cpld drv
seanwu-ec Jan 18, 2022
8476868
[AS4630-54NPE] Enable pca954x idle_disconnect
seanwu-ec Jan 18, 2022
7ee287d
Merge branch 'master' into all_PRs_include_kernelmodule
seanwu-ec Jan 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
rules/config.user

# Build artifacts
fsroot/
fsroot*/
fs.*
target/
*.deb
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# name lanes alias index speed autoneg
Ethernet0 26 thousandE1 1 1000 1
Ethernet1 25 thousandE2 2 1000 1
Ethernet2 28 thousandE3 3 1000 1
Ethernet3 27 thousandE4 4 1000 1
Ethernet4 30 thousandE5 5 1000 1
Ethernet5 29 thousandE6 6 1000 1
Ethernet6 32 thousandE7 7 1000 1
Ethernet7 31 thousandE8 8 1000 1
Ethernet8 38 thousandE9 9 1000 1
Ethernet9 37 thousandE10 10 1000 1
Ethernet10 40 thousandE11 11 1000 1
Ethernet11 39 thousandE12 12 1000 1
Ethernet12 34 thousandE13 13 1000 1
Ethernet13 33 thousandE14 14 1000 1
Ethernet14 36 thousandE15 15 1000 1
Ethernet15 35 thousandE16 16 1000 1
Ethernet16 46 thousandE17 17 1000 1
Ethernet17 45 thousandE18 18 1000 1
Ethernet18 48 thousandE19 19 1000 1
Ethernet19 47 thousandE20 20 1000 1
Ethernet20 42 thousandE21 21 1000 1
Ethernet21 41 thousandE22 22 1000 1
Ethernet22 44 thousandE23 23 1000 1
Ethernet23 43 thousandE24 24 1000 1
Ethernet24 2 thousandE25 25 1000 1
Ethernet25 1 thousandE26 26 1000 1
Ethernet26 4 thousandE27 27 1000 1
Ethernet27 3 thousandE28 28 1000 1
Ethernet28 6 thousandE29 29 1000 1
Ethernet29 5 thousandE30 30 1000 1
Ethernet30 8 thousandE31 31 1000 1
Ethernet31 7 thousandE32 32 1000 1
Ethernet32 10 thousandE33 33 1000 1
Ethernet33 9 thousandE34 34 1000 1
Ethernet34 12 thousandE35 35 1000 1
Ethernet35 11 thousandE36 36 1000 1
Ethernet36 14 thousandE37 37 1000 1
Ethernet37 13 thousandE38 38 1000 1
Ethernet38 16 thousandE39 39 1000 1
Ethernet39 15 thousandE40 40 1000 1
Ethernet40 18 thousandE41 41 1000 1
Ethernet41 17 thousandE42 42 1000 1
Ethernet42 20 thousandE43 43 1000 1
Ethernet43 19 thousandE44 44 1000 1
Ethernet44 22 thousandE45 45 1000 1
Ethernet45 21 thousandE46 46 1000 1
Ethernet46 24 thousandE47 47 1000 1
Ethernet47 23 thousandE48 48 1000 1
Ethernet48 67 twentyfiveGigE49 49 25000 0
Ethernet49 66 twentyfiveGigE50 50 25000 0
Ethernet50 65 twentyfiveGigE51 51 25000 0
Ethernet51 68 twentyfiveGigE52 52 25000 0
Ethernet52 73,74,75,76 hundredGigE53 53 100000 0
Ethernet56 69,70,71,72 hundredGigE54 54 100000 0
1 change: 1 addition & 0 deletions device/accton/x86_64-accton_as4630_54npe-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Accton-AS4630-54NPE t1
3 changes: 3 additions & 0 deletions device/accton/x86_64-accton_as4630_54npe-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200
1 change: 1 addition & 0 deletions device/accton/x86_64-accton_as4630_54npe-r0/platform_asic
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
broadcom
14 changes: 14 additions & 0 deletions device/accton/x86_64-accton_as4630_54npe-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python

try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class board(eeprom_tlvinfo.TlvInfoDecoder):
_TLV_INFO_MAX_LEN = 256

def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)
60 changes: 60 additions & 0 deletions device/accton/x86_64-accton_as4630_54npe-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python

#############################################################################
# Accton
#
# Module contains an implementation of SONiC PSU Base API and
# provides the PSUs status which are available in the platform
#
#############################################################################

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/bus/i2c/devices/"
self.psu_presence = "/psu_present"
self.psu_oper_status = "/psu_power_good"
self.psu_mapping = {
1: "10-0050",
2: "11-0051",
}

def get_num_psus(self):
return len(self.psu_mapping)

def get_psu_status(self, index):
if index is None:
return False

status = 0
node = self.psu_path + self.psu_mapping[index] + self.psu_oper_status
try:
with open(node, 'r') as power_status:
status = int(power_status.read())
except IOError:
return False

return status == 1

def get_psu_presence(self, index):
if index is None:
return False

status = 0
node = self.psu_path + self.psu_mapping[index] + self.psu_presence
try:
with open(node, 'r') as presence_status:
status = int(presence_status.read())
except IOError:
return False

return status == 1
211 changes: 211 additions & 0 deletions device/accton/x86_64-accton_as4630_54npe-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#

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

SFP_STATUS_INSERTED = '1'
SFP_STATUS_REMOVED = '0'


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

PORT_START = 49
PORT_END = 54
PORTS_IN_BLOCK = 54
QSFP_START = 53

BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/"
BASE_CPLD_PATH = "/sys/bus/i2c/devices/3-0060/"

_port_to_is_present = {}
_port_to_lp_mode = {}

_port_to_eeprom_mapping = {}
_port_to_i2c_mapping = {
49: [18],
50: [19],
51: [20],
52: [21],
53: [22],
54: [23],
}

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

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

@property
def qsfp_ports(self):
return range(self.QSFP_START, self.PORTS_IN_BLOCK + 1)

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

def __init__(self):
eeprom_path = self.BASE_OOM_PATH + "eeprom"
for x in range(self.port_start, self.port_end + 1):
self.port_to_eeprom_mapping[x] = eeprom_path.format(
self._port_to_i2c_mapping[x][0])
SfpUtilBase.__init__(self)

def get_presence(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False

present_path = self.BASE_CPLD_PATH + "module_present_" + str(port_num)
self.__port_to_is_present = present_path

try:
val_file = open(self.__port_to_is_present)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print("Error: unable to access file: %s" % str(e))
return False

if content == "1":
return True

return False

def get_low_power_mode(self, port_num):
# Check for invalid port_num
if port_num < self.QSFP_START or port_num > self.port_end:
return False

try:
eeprom = None
if not self.get_presence(port_num):
return False
eeprom = open(self.port_to_eeprom_mapping[port_num], "rb")
eeprom.seek(93)
lpmode = ord(eeprom.read(1))

# if "Power override" bit is 1 and "Power set" bit is 1
if ((lpmode & 0x3) == 0x3):
return True

# High Power Mode if one of the following conditions is matched:
# 1. "Power override" bit is 0
# 2. "Power override" bit is 1 and "Power set" bit is 0
else:
return False

except IOError as e:
print("Error: unable to open file: %s" % str(e))
return False
finally:
if eeprom is not None:
eeprom.close()
time.sleep(0.01)

def set_low_power_mode(self, port_num, lpmode):
# Check for invalid port_num
if port_num < self.QSFP_START or port_num > self.port_end:
return False

try:
eeprom = None
if not self.get_presence(port_num):
return False # Port is not present, unable to set the eeprom

# Fill in write buffer
# 0x3:Low Power Mode, 0x1:High Power Mode
regval = 0x3 if lpmode else 0x1

buffer = create_string_buffer(1)
buffer[0] = regval

# Write to eeprom
eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b")
eeprom.seek(93)
eeprom.write(buffer[0])
return True
except IOError as e:
print("Error: unable to open file: %s" % str(e))
return False
finally:
if eeprom is not None:
eeprom.close()
time.sleep(0.01)

def reset(self, port_num):
if not port_num in self.qsfp_ports:
return False

path = self.BASE_CPLD_PATH + "module_reset_" + str(port_num)
self.__port_to_mod_rst = path
try:
reg_file = open(self.__port_to_mod_rst, 'r+')
except IOError as e:
print("Error: unable to open file: %s" % str(e))
return False

#toggle reset
reg_file.seek(0)
reg_file.write('1')
time.sleep(1)
reg_file.seek(0)
reg_file.write('0')
reg_file.close()
return True

@property
def _get_presence_bitmap(self):

bits = []
for x in range(self.port_start, self.port_end + 1):
bits.append(str(int(self.get_presence(x))))

rev = "".join(bits[::-1])
return int(rev, 2)

data = {'present': 0}

def get_transceiver_change_event(self, timeout=0):
port_dict = {}

if timeout == 0:
cd_ms = sys.maxsize
else:
cd_ms = timeout

# poll per second
while cd_ms > 0:
reg_value = self._get_presence_bitmap
changed_ports = self.data['present'] ^ reg_value
if changed_ports != 0:
break
time.sleep(1)
cd_ms = cd_ms - 1000

if changed_ports != 0:
for port in range(self.port_start, self.port_end + 1):
# Mask off the bit corresponding to our port
mask = (1 << (port - self.port_start))
if changed_ports & mask:
if (reg_value & mask) == 0:
port_dict[port] = SFP_STATUS_REMOVED
else:
port_dict[port] = SFP_STATUS_INSERTED

# Update cache
self.data['present'] = reg_value
return True, port_dict
else:
return True, {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"skip_ledd": true,
"skip_pcied": true
}
Loading