Skip to content

Commit f586cfa

Browse files
zzhiyuanlguohan
authored andcommitted
[devices]: Fix configurations for 7050QX-32S-S4Q31 (#2119)
- Correct lane map in broadcom configuration - Add writes to txdisable bits for SFPs in hwsku-init - Add correct hwsku-init implementation for 201803 branch
1 parent f333342 commit f586cfa

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,52 @@
1-
echo 1 > /sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/mux
1+
#!/usr/bin/python
2+
from __future__ import print_function
3+
4+
import mmap
5+
import os
6+
import sys
7+
from struct import pack, unpack
8+
9+
class MmapResource( object ):
10+
"""Resource implementation for a directly-mapped memory region."""
11+
def __init__( self, path ):
12+
try:
13+
fd = os.open( path, os.O_RDWR )
14+
except EnvironmentError:
15+
print( "FAIL can not open scd memory-map resource file" )
16+
print( "FAIL are you running on the proper platform?" )
17+
sys.exit( 1 )
18+
try:
19+
size = os.fstat( fd ).st_size
20+
except EnvironmentError:
21+
print( "FAIL can not fstat scd memory-map resource file" )
22+
print( "FAIL are you running on the proper platform?" )
23+
sys.exit( 1 )
24+
try:
25+
self.mmap_ = mmap.mmap( fd, size, mmap.MAP_SHARED,
26+
mmap.PROT_READ | mmap.PROT_WRITE )
27+
except EnvironmentError:
28+
print( "FAIL can not map scd memory-map file" )
29+
print( "FAIL are you running on the proper platform?" )
30+
sys.exit( 1 )
31+
finally:
32+
try:
33+
# Note that closing the file descriptor has no effect on the memory map
34+
os.close( fd )
35+
except EnvironmentError:
36+
print( "FAIL failed to close scd memory-map file" )
37+
sys.exit( 1 )
38+
def read32( self, addr ):
39+
return unpack( '<L', self.mmap_[ addr : addr + 4 ] )[ 0 ]
40+
def write32( self, addr, value ):
41+
self.mmap_[ addr: addr + 4 ] = pack( '<L', value )
42+
43+
m = MmapResource( '/sys/bus/pci/devices/0000:02:00.0/resource0' )
44+
for addr in range( 0x5210, 0x5250, 0x10 ):
45+
v = m.read32( addr )
46+
m.write32( addr, v & ~( 1 << 6 ) )
47+
print( "orig=%04x new=%04x" % ( v, m.read32( addr ) ) )
48+
49+
with open( "/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/mux_sfp_qsfp/direction", "w" ) as fdir:
50+
fdir.write( "out" )
51+
with open( "/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/mux_sfp_qsfp/value", "w" ) as fval:
52+
fval.write( "1" )

device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/td2-a7050-q31s4-31x40G-4x10G.config.bcm

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ stable_size=0x2000000
248248
tdma_timeout_usec.0=15000000
249249
tslam_timeout_usec.0=15000000
250250
xgxs_lcpll_xtal_refclk.0=1
251-
xgxs_rx_lane_map_1.0=0x0123
251+
xgxs_rx_lane_map_1.0=0x3210
252252
xgxs_rx_lane_map_5.0=0x0321
253253
xgxs_rx_lane_map_9.0=0x1302
254254
xgxs_rx_lane_map_13.0=0x0213
@@ -280,7 +280,7 @@ xgxs_rx_lane_map_101.0=0x0213
280280
xgxs_rx_lane_map_102.0=0x1302
281281
xgxs_rx_lane_map_103.0=0x0123
282282
xgxs_rx_lane_map_104.0=0x2031
283-
xgxs_tx_lane_map_1.0=0x3210
283+
xgxs_tx_lane_map_1.0=0x0123
284284
xgxs_tx_lane_map_5.0=0x0321
285285
xgxs_tx_lane_map_9.0=0x2031
286286
xgxs_tx_lane_map_13.0=0x0213

0 commit comments

Comments
 (0)