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:
roy_lee
2018-12-27 17:32:38 +08:00
parent 1e59735ada
commit 7ecf90d704

View File

@@ -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