From 5a7995e15015aff018c162c75649637d56dcd41c Mon Sep 17 00:00:00 2001 From: Steven Noble Date: Fri, 25 Dec 2015 01:52:35 +0000 Subject: [PATCH] updated init.py for Accton AS5812 --- .../x86_64_accton_as5812_54x_r0/__init__.py | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/python/x86_64_accton_as5812_54x_r0/__init__.py b/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/python/x86_64_accton_as5812_54x_r0/__init__.py index a6e42e20..a8d9bee9 100644 --- a/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/python/x86_64_accton_as5812_54x_r0/__init__.py +++ b/packages/platforms/accton/x86-64/x86-64-accton-as5812-54x/platform-config/r0/src/python/x86_64_accton_as5812_54x_r0/__init__.py @@ -17,5 +17,47 @@ class OnlPlatform_x86_64_accton_as5812_54x_r0(OnlPlatformAccton): return ".5812.54" def baseconfig(self): - return os.system(os.path.join(self.platform_basedir(), "boot", "x86-64-accton-as5812-54x-r0-devices.sh")) == 0 + ########### initialize I2C bus 0 ########### + + # initialize CPLDs + self.new_i2c_devices( + [ + ('as5812_54x_cpld1', 0x60, 0), + ('as5812_54x_cpld2', 0x61, 0), + ('as5812_54x_cpld3', 0x62, 0), + ] + ) + # initialize SFP devices + for port in range(1, 49): + self.new_i2c_device('as5812_54x_sfp%d' % port, 0x50, port+1) + self.new_i2c_device('as5812_54x_sfp%d' % port, 0x51, port+1) + + # Initialize QSFP devices + self.new_i2c_device('as5812_54x_sfp49', 0x50, 50) + self.new_i2c_device('as5812_54x_sfp52', 0x50, 51) + self.new_i2c_device('as5812_54x_sfp50', 0x50, 52) + self.new_i2c_device('as5812_54x_sfp53', 0x50, 53) + self.new_i2c_device('as5812_54x_sfp51', 0x50, 54) + self.new_i2c_device('as5812_54x_sfp54', 0x50, 55) + + ########### initialize I2C bus 1 ########### + self.new_i2c_devices( + [ + # initiate multiplexer (PCA9548) + ('pca9548', 0x70, 1), + + # initiate PSU-1 AC Power + ('as5812_54x_psu', 0x38, 57), + ('cpr_4011_4mxx', 0x3c, 57), + + # initiate PSU-2 AC Power + ('as5812_54x_psu', 0x3b, 58), + ('cpr_4011_4mxx', 0x3f, 58), + + # initiate lm75 + ('lm75', 0x48, 61), + ('lm75', 0x49, 62), + ('lm75', 0x4a, 63), + ] + ) return True