From 7ecf90d70450a91103f9660f66a082bf5e5d8fff Mon Sep 17 00:00:00 2001 From: roy_lee Date: Thu, 27 Dec 2018 17:32:38 +0800 Subject: [PATCH] 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 --- .../x86_64_accton_minipack_r0/__init__.py | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/platforms/accton/x86-64/x86-64-accton-minipack/platform-config/r0/src/python/x86_64_accton_minipack_r0/__init__.py b/packages/platforms/accton/x86-64/x86-64-accton-minipack/platform-config/r0/src/python/x86_64_accton_minipack_r0/__init__.py index 3b16ac0c..62da0b41 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-minipack/platform-config/r0/src/python/x86_64_accton_minipack_r0/__init__.py +++ b/packages/platforms/accton/x86-64/x86-64-accton-minipack/platform-config/r0/src/python/x86_64_accton_minipack_r0/__init__.py @@ -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