mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-11-01 10:48:18 +00:00
Fix gpon port eeprom mapping i2c device
This commit is contained in:
@@ -36,14 +36,14 @@
|
||||
#define MODULE_TXDISABLE_FORMAT "/sys/bus/i2c/devices/%d-00%d/module_tx_disable_%d"
|
||||
|
||||
int sfp_map_bus[] ={
|
||||
41,42,43,44,45,46,47,48,
|
||||
49,50,51,52,53,54,55,56,
|
||||
57,58,59,60,61,62,63,64,
|
||||
65,66,67,68,69,70,71,72,
|
||||
73,74,75,76,77,78,79,80,
|
||||
81,82,83,84,85,86,87,88,
|
||||
89,90,91,92,93,94,95,96,
|
||||
97,98,99,100,101,102,103,104,
|
||||
41,42,56,55,43,44,54,53,
|
||||
45,46,52,51,47,48,50,49,
|
||||
57,58,72,71,59,60,70,69,
|
||||
61,62,68,67,63,64,66,65,
|
||||
73,74,88,87,75,76,86,85,
|
||||
77,78,84,83,79,80,82,81,
|
||||
89,90,104,103,91,92,102,101,
|
||||
93,94,100,99,95,96,98,97,
|
||||
20, 21,
|
||||
25, 26, 27, 28, 29, 30, 31, 32,};
|
||||
|
||||
|
||||
@@ -35,6 +35,25 @@ class OnlPlatform_x86_64_accton_asgvolt64_r0(OnlPlatformAccton,
|
||||
MODEL="ASGVOLT64"
|
||||
SYS_OBJECT_ID=".volt.64"
|
||||
|
||||
port_map={
|
||||
1: 0,
|
||||
2: 1,
|
||||
3: 15,
|
||||
4: 14,
|
||||
5: 2,
|
||||
6: 3,
|
||||
7: 13,
|
||||
8: 12,
|
||||
9: 4,
|
||||
10:5,
|
||||
11:11,
|
||||
12:10,
|
||||
13:6,
|
||||
14:7,
|
||||
15:9,
|
||||
16:8
|
||||
}
|
||||
|
||||
def baseconfig(self):
|
||||
#self.insmod('ym2651y')
|
||||
self.insmod('optoe')
|
||||
@@ -73,11 +92,19 @@ class OnlPlatform_x86_64_accton_asgvolt64_r0(OnlPlatformAccton,
|
||||
# initialize XFP port 1~64
|
||||
for port in range(41, 105):
|
||||
self.new_i2c_device('optoe2', 0x50, port)
|
||||
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port-40, port), shell=True)
|
||||
|
||||
base=41
|
||||
for port in range(1, 65):
|
||||
q=port/16
|
||||
r=port%16
|
||||
if r==0:
|
||||
r=16
|
||||
q=q-1
|
||||
bus=base+q*16+self.port_map[r]
|
||||
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, bus), shell=True)
|
||||
|
||||
# initialize QSFP port 1~2 (port_name=port65~66)
|
||||
for port in range(20, 22):
|
||||
self.new_i2c_device('optoe1', 0x50, port)
|
||||
self.new_i2c_device('optoe1', 0x50, port)
|
||||
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port+45, port), shell=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user