diff --git a/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/port_config.ini b/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/port_config.ini old mode 100644 new mode 100755 index 61325e1ec43c..f41bf2ef648f --- a/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/port_config.ini +++ b/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/port_config.ini @@ -1,74 +1,73 @@ -# name lanes alias -Ethernet0 13 tenGigE0 -Ethernet1 14 tenGigE1 -Ethernet2 15 tenGigE2 -Ethernet3 16 tenGigE3 -Ethernet4 21 tenGigE4 -Ethernet5 22 tenGigE5 -Ethernet6 23 tenGigE6 -Ethernet7 24 tenGigE7 -Ethernet8 25 tenGigE8 -Ethernet9 26 tenGigE9 -Ethernet10 27 tenGigE10 -Ethernet11 28 tenGigE11 -Ethernet12 29 tenGigE12 -Ethernet13 30 tenGigE13 -Ethernet14 31 tenGigE14 -Ethernet15 32 tenGigE15 -Ethernet16 45 tenGigE16 -Ethernet17 46 tenGigE17 -Ethernet18 47 tenGigE18 -Ethernet19 48 tenGigE19 -Ethernet20 49 tenGigE20 -Ethernet21 50 tenGigE21 -Ethernet22 51 tenGigE22 -Ethernet23 52 tenGigE23 -Ethernet24 53 tenGigE24 -Ethernet25 54 tenGigE25 -Ethernet26 55 tenGigE26 -Ethernet27 56 tenGigE27 -Ethernet28 57 tenGigE28 -Ethernet29 58 tenGigE29 -Ethernet30 59 tenGigE30 -Ethernet31 60 tenGigE31 -Ethernet32 61 tenGigE32 -Ethernet33 62 tenGigE33 -Ethernet34 63 tenGigE34 -Ethernet35 64 tenGigE35 -Ethernet36 65 tenGigE36 -Ethernet37 66 tenGigE37 -Ethernet38 67 tenGigE38 -Ethernet39 68 tenGigE39 -Ethernet40 69 tenGigE40 -Ethernet41 70 tenGigE41 -Ethernet42 71 tenGigE42 -Ethernet43 72 tenGigE43 -Ethernet44 73 tenGigE44 -Ethernet45 74 tenGigE45 -Ethernet46 75 tenGigE46 -Ethernet47 76 tenGigE47 -Ethernet48 97 tenGigE48 -Ethernet49 98 tenGigE49 -Ethernet50 99 tenGigE50 -Ethernet51 100 tenGigE51 -Ethernet52 101 tenGigE52 -Ethernet53 102 tenGigE53 -Ethernet54 103 tenGigE54 -Ethernet55 104 tenGigE55 -Ethernet56 81 tenGigE56 -Ethernet57 82 tenGigE57 -Ethernet58 83 tenGigE58 -Ethernet59 84 tenGigE59 -Ethernet60 105 tenGigE60 -Ethernet61 106 tenGigE61 -Ethernet62 107 tenGigE62 -Ethernet63 108 tenGigE63 -Ethernet64 109 tenGigE64 -Ethernet65 110 tenGigE65 -Ethernet66 111 tenGigE66 -Ethernet67 112 tenGigE67 -Ethernet68 77 tenGigE68 -Ethernet69 78 tenGigE69 -Ethernet70 79 tenGigE70 -Ethernet71 80 tenGigE71 - +# name lanes alias index +Ethernet0 13 tenGigE0 0 +Ethernet1 14 tenGigE1 1 +Ethernet2 15 tenGigE2 2 +Ethernet3 16 tenGigE3 3 +Ethernet4 21 tenGigE4 4 +Ethernet5 22 tenGigE5 5 +Ethernet6 23 tenGigE6 6 +Ethernet7 24 tenGigE7 7 +Ethernet8 25 tenGigE8 8 +Ethernet9 26 tenGigE9 9 +Ethernet10 27 tenGigE10 10 +Ethernet11 28 tenGigE11 11 +Ethernet12 29 tenGigE12 12 +Ethernet13 30 tenGigE13 13 +Ethernet14 31 tenGigE14 14 +Ethernet15 32 tenGigE15 15 +Ethernet16 45 tenGigE16 16 +Ethernet17 46 tenGigE17 17 +Ethernet18 47 tenGigE18 18 +Ethernet19 48 tenGigE19 19 +Ethernet20 49 tenGigE20 20 +Ethernet21 50 tenGigE21 21 +Ethernet22 51 tenGigE22 22 +Ethernet23 52 tenGigE23 23 +Ethernet24 53 tenGigE24 24 +Ethernet25 54 tenGigE25 25 +Ethernet26 55 tenGigE26 26 +Ethernet27 56 tenGigE27 27 +Ethernet28 57 tenGigE28 28 +Ethernet29 58 tenGigE29 29 +Ethernet30 59 tenGigE30 30 +Ethernet31 60 tenGigE31 31 +Ethernet32 61 tenGigE32 32 +Ethernet33 62 tenGigE33 33 +Ethernet34 63 tenGigE34 34 +Ethernet35 64 tenGigE35 35 +Ethernet36 65 tenGigE36 36 +Ethernet37 66 tenGigE37 37 +Ethernet38 67 tenGigE38 38 +Ethernet39 68 tenGigE39 39 +Ethernet40 69 tenGigE40 40 +Ethernet41 70 tenGigE41 41 +Ethernet42 71 tenGigE42 42 +Ethernet43 72 tenGigE43 43 +Ethernet44 73 tenGigE44 44 +Ethernet45 74 tenGigE45 45 +Ethernet46 75 tenGigE46 46 +Ethernet47 76 tenGigE47 47 +Ethernet48 97 tenGigE48 48 +Ethernet49 98 tenGigE49 49 +Ethernet50 99 tenGigE50 50 +Ethernet51 100 tenGigE51 51 +Ethernet52 101 tenGigE52 52 +Ethernet53 102 tenGigE53 53 +Ethernet54 103 tenGigE54 54 +Ethernet55 104 tenGigE55 55 +Ethernet56 81 tenGigE56 56 +Ethernet57 82 tenGigE57 57 +Ethernet58 83 tenGigE58 58 +Ethernet59 84 tenGigE59 59 +Ethernet60 105 tenGigE60 60 +Ethernet61 106 tenGigE61 61 +Ethernet62 107 tenGigE62 62 +Ethernet63 108 tenGigE63 63 +Ethernet64 109 tenGigE64 64 +Ethernet65 110 tenGigE65 65 +Ethernet66 111 tenGigE66 66 +Ethernet67 112 tenGigE67 67 +Ethernet68 77 tenGigE68 68 +Ethernet69 78 tenGigE69 69 +Ethernet70 79 tenGigE70 70 +Ethernet71 80 tenGigE71 71 diff --git a/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/sai.profile b/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/sai.profile old mode 100644 new mode 100755 index 7fafa54db963..01d0f6642549 --- a/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/sai.profile +++ b/device/accton/x86_64-accton_as5712_54x-r0/Accton-AS5712-54X/sai.profile @@ -1,2 +1 @@ SAI_INIT_CONFIG_FILE=/etc/bcm/td2-as5712-72x10G.config.bcm - diff --git a/device/accton/x86_64-accton_as5712_54x-r0/minigraph.xml b/device/accton/x86_64-accton_as5712_54x-r0/minigraph.xml old mode 100644 new mode 100755 index 8d89f28b0d86..bf0b2e9c0fcd --- a/device/accton/x86_64-accton_as5712_54x-r0/minigraph.xml +++ b/device/accton/x86_64-accton_as5712_54x-r0/minigraph.xml @@ -4,18 +4,18 @@ OCPSCH0104001MS - 10.10.1.26 - switch1 - 10.10.1.25 + 10.10.1.2 + OCPSCH01040AALF + 10.10.1.1 1 10 3 OCPSCH0104002MS - 10.10.2.26 - switch1 - 10.10.2.25 + 10.10.2.2 + OCPSCH01040AALF + 10.10.2.1 1 10 3 @@ -24,15 +24,15 @@ 64536 - switch1 + OCPSCH01040AALF -
10.10.1.26
+
10.10.1.1
-
10.10.2.26
+
10.10.2.1
@@ -59,29 +59,37 @@ HostIP Loopback0 - 100.0.0.9/32 + 100.0.0.3/32 - 100.0.0.9/32 + 100.0.0.3/32 + + ManagementIP1 + Management0 + + 192.168.200.12/24 + + 192.168.200.12/24 + - switch1 + OCPSCH01040AALF - Ethernet48 - 10.10.1.25/30 + tenGigE0 + 10.10.1.1/30 - Ethernet52 - 10.10.2.25/30 + tenGigE4 + 10.10.2.1/30 @@ -93,59 +101,33 @@ - 40000 + 10000 DeviceInterfaceLink OCPSCH0104001MS - Ethernet24 - switch1 - Ethernet48 + tenGigE0 + OCPSCH01040AALF + tenGigE0 - 40000 + 10000 DeviceInterfaceLink OCPSCH0104002MS - Ethernet24 - switch1 - Ethernet52 + tenGigE0 + OCPSCH01040AALF + tenGigE4 - + - switch1 + OCPSCH01040AALF Accton-AS5712-54X - + - - - switch1 - - - DhcpResources - - - - - NtpResources - - 0.debian.pool.ntp.org;1.debian.pool.ntp.org;2.debian.pool.ntp.org;3.debian.pool.ntp.org - - - SyslogResources - - - - - ErspanDestinationIpv4 - - 2.2.2.2 - - - - + - switch1 + OCPSCH01040AALF Accton-AS5712-54X diff --git a/device/accton/x86_64-accton_as5712_54x-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as5712_54x-r0/plugins/sfputil.py old mode 100644 new mode 100755 index 070b1da934cb..c9862957bf31 --- a/device/accton/x86_64-accton_as5712_54x-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as5712_54x-r0/plugins/sfputil.py @@ -14,12 +14,90 @@ class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 - PORT_END = 31 - PORTS_IN_BLOCK = 32 + PORT_END = 71 + PORTS_IN_BLOCK = 72 + QSFP_PORT_START = 72 + QSFP_PORT_END = 72 - EEPROM_OFFSET = 20 + BASE_VAL_PATH = "/sys/class/i2c-adapter/i2c-{0}/{1}-0050/" + + _port_to_is_present = {} _port_to_eeprom_mapping = {} + _port_to_i2c_mapping = { + 0: [2, 2], + 1: [3, 3], + 2: [4, 4], + 3: [5, 5], + 4: [6, 6], + 5: [7, 7], + 6: [8, 8], + 7: [9, 9], + 8: [10, 10], + 9: [11, 11], + 10: [12, 12], + 11: [13, 13], + 12: [14, 14], + 13: [15, 15], + 14: [16, 16], + 15: [17, 17], + 16: [18, 18], + 17: [19, 19], + 18: [20, 20], + 19: [21, 21], + 20: [22, 22], + 21: [23, 23], + 22: [24, 24], + 23: [25, 25], + 24: [26, 26], + 25: [27, 27], + 26: [28, 28], + 27: [29, 29], + 28: [30, 30], + 29: [31, 31], + 30: [32, 32], + 31: [33, 33], + 32: [34, 34], + 33: [35, 35], + 34: [36, 36], + 35: [37, 37], + 36: [38, 38], + 37: [39, 39], + 38: [40, 40], + 39: [41, 41], + 40: [42, 42], + 41: [43, 43], + 42: [44, 44], + 43: [45, 45], + 44: [46, 46], + 45: [47, 47], + 46: [48, 48], + 47: [49, 49], + 48: [50, 50], #QSFP49 + 49: [50, 50], + 50: [50, 50], + 51: [50, 50], + 52: [52, 52], #QSFP50 + 53: [52, 52], + 54: [52, 52], + 55: [52, 52], + 56: [54, 54], #QSFP51 + 57: [54, 54], + 58: [54, 54], + 59: [54, 54], + 60: [51, 51], #QSFP52 + 61: [51, 51], + 62: [51, 51], + 63: [51, 51], + 64: [53, 53], #QSFP53 + 65: [53, 53], + 66: [53, 53], + 67: [53, 53], + 68: [55, 55], #QSFP54 + 69: [55, 55], + 70: [55, 55], + 71: [55, 55], + } @property def port_start(self): @@ -31,17 +109,19 @@ def port_end(self): @property def qsfp_ports(self): - return range(0, self.PORTS_IN_BLOCK + 1) + return range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1) @property def port_to_eeprom_mapping(self): return self._port_to_eeprom_mapping def __init__(self): - eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" + eeprom_path = self.BASE_VAL_PATH + "sfp_eeprom" - for x in range(0, self.port_end + 1): - self._port_to_eeprom_mapping[x] = eeprom_path.format(x + self.EEPROM_OFFSET) + for x in range(0, self.port_end+1): + self.port_to_eeprom_mapping[x] = eeprom_path.format( + self._port_to_i2c_mapping[x][0], + self._port_to_i2c_mapping[x][1]) SfpUtilBase.__init__(self) @@ -50,126 +130,29 @@ def get_presence(self, port_num): if port_num < self.port_start or port_num > self.port_end: return False + present_path = self.BASE_VAL_PATH + "sfp_is_present" + self.__port_to_is_present = present_path.format(self._port_to_i2c_mapping[port_num][0], self._port_to_i2c_mapping[port_num][1]) + try: - reg_file = open("/sys/devices/platform/accton/qsfp_modprs") + val_file = open(self.__port_to_is_present) except IOError as e: - print "Error: unable to open file: %s" % str(e) + print "Error: unable to open file: %s" % str(e) return False - content = reg_file.readline().rstrip() - - # content is a string containing the hex representation of the register - reg_value = int(content, 16) - - # Mask off the bit corresponding to our port - mask = (1 << port_num) + content = val_file.readline().rstrip() + val_file.close() - # ModPrsL is active low - if reg_value & mask == 0: + # content is a string, either "0" or "1" + if content == "1": return True return False def get_low_power_mode(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - try: - reg_file = open("/sys/devices/platform/accton/qsfp_lpmode") - except IOError as e: - print "Error: unable to open file: %s" % str(e) - - content = reg_file.readline().rstrip() - - # content is a string containing the hex representation of the register - reg_value = int(content, 16) - - # Mask off the bit corresponding to our port - mask = (1 << port_num) - - # LPMode is active high - if reg_value & mask == 0: - return False - - return True + raise NotImplementedError def set_low_power_mode(self, port_num, lpmode): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - try: - reg_file = open("/sys/devices/platform/accton/qsfp_lpmode", "r+") - except IOError as e: - print "Error: unable to open file: %s" % str(e) - return False - - content = reg_file.readline().rstrip() - - # content is a string containing the hex representation of the register - reg_value = int(content, 16) - - # Mask off the bit corresponding to our port - mask = (1 << port_num) - - # LPMode is active high; set or clear the bit accordingly - if lpmode is True: - reg_value = reg_value | mask - else: - reg_value = reg_value & ~mask - - # Convert our register value back to a hex string and write back - content = hex(reg_value) - - reg_file.seek(0) - reg_file.write(content) - reg_file.close() - - return True + raise NotImplementedError def reset(self, port_num): - QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/devices/platform/accton/qsfp_reset" - - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - try: - reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "r+") - except IOError as e: - print "Error: unable to open file: %s" % str(e) - return False - - content = reg_file.readline().rstrip() - - # File content is a string containing the hex representation of the register - reg_value = int(content, 16) - - # Mask off the bit corresponding to our port - mask = (1 << port_num) - - # ResetL is active low - reg_value = reg_value & ~mask - - # Convert our register value back to a hex string and write back - reg_file.seek(0) - reg_file.write(hex(reg_value)) - reg_file.close() - - # Sleep 1 second to allow it to settle - time.sleep(1) - - # Flip the bit back high and write back to the register to take port out of reset - try: - reg_file = open(QSFP_RESET_REGISTER_DEVICE_FILE, "w") - except IOError as e: - print "Error: unable to open file: %s" % str(e) - return False - - reg_value = reg_value | mask - reg_file.seek(0) - reg_file.write(hex(reg_value)) - reg_file.close() - - return True + raise NotImplementedError diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk old mode 100644 new mode 100755 index ca9da1134eb2..378129d4da03 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -12,6 +12,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(INGRASYS_S9100_PLATFORM_MODULE) \ $(INGRASYS_S8810_32Q_PLATFORM_MODULE) \ $(ACCTON_AS7712_32X_PLATFORM_MODULE) \ + $(ACCTON_AS5712_54X_PLATFORM_MODULE) \ $(INVENTEC_D7032Q28B_PLATFORM_MODULE) \ $(INVENTEC_D7054Q28B_PLATFORM_MODULE) \ $(CEL_DX010_PLATFORM_MODULE) diff --git a/platform/broadcom/platform-modules-accton.mk b/platform/broadcom/platform-modules-accton.mk old mode 100644 new mode 100755 index e5357c5e9f14..6a2bf8c04b6f --- a/platform/broadcom/platform-modules-accton.mk +++ b/platform/broadcom/platform-modules-accton.mk @@ -1,11 +1,19 @@ # Accton Platform modules -ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION = 1.0 +ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION = 1.1 +ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION = 1.1 export ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION +export ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION ACCTON_AS7712_32X_PLATFORM_MODULE = sonic-platform-accton-as7712-32x_$(ACCTON_AS7712_32X_PLATFORM_MODULE_VERSION)_amd64.deb $(ACCTON_AS7712_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton $(ACCTON_AS7712_32X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(ACCTON_AS7712_32X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7712_32x-r0 SONIC_DPKG_DEBS += $(ACCTON_AS7712_32X_PLATFORM_MODULE) + +ACCTON_AS5712_54X_PLATFORM_MODULE = sonic-platform-accton-as5712-54x_$(ACCTON_AS5712_54X_PLATFORM_MODULE_VERSION)_amd64.deb +$(ACCTON_AS5712_54X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-accton +$(ACCTON_AS5712_54X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +$(ACCTON_AS5712_54X_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as5712_54x-r0 +SONIC_DPKG_DEBS += $(ACCTON_AS5712_54X_PLATFORM_MODULE) diff --git a/platform/broadcom/sonic-platform-modules-accton b/platform/broadcom/sonic-platform-modules-accton index 99607d63220d..3fbde584ba15 160000 --- a/platform/broadcom/sonic-platform-modules-accton +++ b/platform/broadcom/sonic-platform-modules-accton @@ -1 +1 @@ -Subproject commit 99607d63220de336a61d81f6b4d1e64062761abe +Subproject commit 3fbde584ba15f0178dc22cb7e56f2bb8481692d4