mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 09:17:08 +00:00
Due to PIM can not present at init and hot inserted,
not spawn i2c buses from mux, but dynamically set the channel of muxes. Signed-off-by: roy_lee <roy_lee@accton.com>
This commit is contained in:
@@ -16,27 +16,13 @@ class OnlPlatform_x86_64_accton_minipack_r0(OnlPlatformAccton,
|
||||
self.new_i2c_devices([
|
||||
('pca9548', 0x70, 1),
|
||||
('24c64', 0x57, 1),
|
||||
('optoe1', 0x50, 1)
|
||||
])
|
||||
|
||||
# initialize multiplexer for 8 PIMs
|
||||
for pim in range(2, 10):
|
||||
for pim in range(0, 32):
|
||||
self.new_i2c_devices([
|
||||
('pca9548', 0x72, pim),
|
||||
('pca9548', 0x71, pim),
|
||||
('optoe1', 0x50, 1),
|
||||
('optoe1', 0x50, 199),
|
||||
])
|
||||
|
||||
return True
|
||||
# Initialize QSFP devices
|
||||
for port in range(1, 129):
|
||||
base = ((port-1)/8*8) + 10
|
||||
index = (port - 1) % 8
|
||||
index = 7 - index
|
||||
if (index%2):
|
||||
index = index -1
|
||||
else:
|
||||
index = index +1
|
||||
bus = base + index
|
||||
self.new_i2c_device('optoe1', 0x50, bus)
|
||||
subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, bus), shell=True)
|
||||
|
||||
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user