From 94b167d4429a180fdf26d2242e304cdf1aa2526b Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Thu, 29 Aug 2019 20:41:20 +0000 Subject: [PATCH] 8v89307 custom PLL initialization. --- .../x86_64_accton_as7326_56x_r0/__init__.py | 17 ++++++++-- .../x86_64_accton_as7726_32x_r0/__init__.py | 34 ++++++++++++------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/packages/platforms/accton/x86-64/as7326-56x/platform-config/r0/src/python/x86_64_accton_as7326_56x_r0/__init__.py b/packages/platforms/accton/x86-64/as7326-56x/platform-config/r0/src/python/x86_64_accton_as7326_56x_r0/__init__.py index d28a2aee..7f42caf3 100755 --- a/packages/platforms/accton/x86-64/as7326-56x/platform-config/r0/src/python/x86_64_accton_as7326_56x_r0/__init__.py +++ b/packages/platforms/accton/x86-64/as7326-56x/platform-config/r0/src/python/x86_64_accton_as7326_56x_r0/__init__.py @@ -4,7 +4,7 @@ from onl.platform.accton import * import commands #IR3570A chip casue problem when read eeprom by i2c-block mode. -#It happen when read 16th-byte offset that value is 0x8. So disable chip +#It happen when read 16th-byte offset that value is 0x8. So disable chip def disable_i2c_ir3570a(addr): check_i2c="i2cget -y 0 0x4 0x1" status, output = commands.getstatusoutput(check_i2c) @@ -36,6 +36,16 @@ def ir3570_check(): return -1 return ret +def _8v89307_init(): + script = os.path.join(os.path.dirname(os.path.realpath(__file__)), "8v89307_init.sh") + if os.path.exists(script): + status, output = commands.getstatusoutput(script) + print output + if status != 0: + print "Error in 8v89307_init: " + str(e) + return False + return True + class OnlPlatform_x86_64_accton_as7326_56x_r0(OnlPlatformAccton, OnlPlatformPortConfig_48x25_8x100): @@ -113,7 +123,7 @@ class OnlPlatform_x86_64_accton_as7326_56x_r0(OnlPlatformAccton, for port in range(1, 49): bus = sfp_map[port-1] self.new_i2c_device('optoe2', 0x50, bus) - + self.new_i2c_device('optoe2', 0x50, sfp_map[57-1]) self.new_i2c_device('optoe2', 0x50, sfp_map[58-1]) @@ -127,5 +137,8 @@ class OnlPlatform_x86_64_accton_as7326_56x_r0(OnlPlatformAccton, subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, bus), shell=True) self.new_i2c_device('24c04', 0x56, 0) + ir3570_check() + _8v89307_init() + return True diff --git a/packages/platforms/accton/x86-64/as7726-32x/platform-config/r0/src/python/x86_64_accton_as7726_32x_r0/__init__.py b/packages/platforms/accton/x86-64/as7726-32x/platform-config/r0/src/python/x86_64_accton_as7726_32x_r0/__init__.py index e9697ecb..6b042170 100755 --- a/packages/platforms/accton/x86-64/as7726-32x/platform-config/r0/src/python/x86_64_accton_as7726_32x_r0/__init__.py +++ b/packages/platforms/accton/x86-64/as7726-32x/platform-config/r0/src/python/x86_64_accton_as7726_32x_r0/__init__.py @@ -4,7 +4,7 @@ from onl.platform.accton import * import commands #IR3570A chip casue problem when read eeprom by i2c-block mode. -#It happen when read 16th-byte offset that value is 0x8. So disable chip +#It happen when read 16th-byte offset that value is 0x8. So disable chip def disable_i2c_ir3570a(addr): check_i2c="i2cget -y 0 0x4 0x1" status, output = commands.getstatusoutput(check_i2c) @@ -36,6 +36,15 @@ def ir3570_check(): return -1 return ret +def _8v89307_init(): + script = os.path.join(os.path.dirname(os.path.realpath(__file__)), "8v89307_init.sh") + if os.path.exists(script): + status, output = commands.getstatusoutput(script) + print output + if status != 0: + print "Error in 8v89307_init: " + str(e) + return False + return True class OnlPlatform_x86_64_accton_as7726_32x_r0(OnlPlatformAccton, OnlPlatformPortConfig_48x25_6x100): @@ -51,7 +60,7 @@ class OnlPlatform_x86_64_accton_as7726_32x_r0(OnlPlatformAccton, self.insmod("x86-64-accton-as7726-32x-%s.ko" % m) ########### initialize I2C bus 0 ########### - # initialize multiplexer (PCA9548) + # initialize multiplexer (PCA9548) self.new_i2c_device('pca9548', 0x77, 0) # initiate multiplexer (PCA9548) self.new_i2c_devices( @@ -65,7 +74,7 @@ class OnlPlatform_x86_64_accton_as7726_32x_r0(OnlPlatformAccton, ('pca9548', 0x71, 2) ] ) - + self.new_i2c_devices([ # initialize CPLD ('as7726_32x_cpld1', 0x60, 11), @@ -98,17 +107,17 @@ class OnlPlatform_x86_64_accton_as7726_32x_r0(OnlPlatformAccton, for port in range(1, 5): self.new_i2c_device('optoe1', 0x50, port+20) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, port+20), shell=True) - - self.new_i2c_device('optoe1', 0x50, 26) + + self.new_i2c_device('optoe1', 0x50, 26) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (5, 26), shell=True) - self.new_i2c_device('optoe1', 0x50, 25) + self.new_i2c_device('optoe1', 0x50, 25) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (6, 25), shell=True) - self.new_i2c_device('optoe1', 0x50, 28) + self.new_i2c_device('optoe1', 0x50, 28) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (7, 28), shell=True) - self.new_i2c_device('optoe1', 0x50, 27) + self.new_i2c_device('optoe1', 0x50, 27) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (8, 27), shell=True) - - # initialize QSFP port 9~16 + + # initialize QSFP port 9~16 for port in range(9, 13): self.new_i2c_device('optoe1', 0x50, port+8) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, port+8), shell=True) @@ -128,7 +137,7 @@ class OnlPlatform_x86_64_accton_as7726_32x_r0(OnlPlatformAccton, for port in range(25, 33): self.new_i2c_device('optoe1', 0x50, port+12) subprocess.call('echo port%d > /sys/bus/i2c/devices/%d-0050/port_name' % (port, port+12), shell=True) - + # initialize SFP port 33~34 for port in range(33, 35): self.new_i2c_device('optoe1', 0x50, port-18) @@ -136,6 +145,7 @@ class OnlPlatform_x86_64_accton_as7726_32x_r0(OnlPlatformAccton, self.new_i2c_device('24c02', 0x56, 0) - ir3570_check() + ir3570_check() + _8v89307_init() return True