[device] Add a new platform ly1200 for MiTAC (#1369)
* [device] Add a new platform ly1200 for MiTAC Signed-off-by: Eddy Weng <eddy.weng@mic.com.tw> * [platform/broadcom/sonic-platform-modules-mitac] Update dependency for new kernel. Signed-off-by: Stane Shieh <stane.shieh@mic.com.tw> * [minigraph]: Set hostname in all default minigraphs to 'sonic' Signed-off-by: Stane Shieh <stane.shieh@mic.com.tw> * [kernel]: update linux kernel to support ly1200 of MiTAC Signed-off-by: Stane Shieh <stane.shieh@mic.com.tw> * [platform/broadcom/sonic-platform-modules-mitac] adapt PSU driver for linux kernel upgrade. Signed-off-by: Stane Shieh <stane.shieh@mic.com.tw> * Resolve the conflict with Quanta modified files are as below. .gitmodules platform/broadcom/one-image.mk platform/broadcom/rules.mk Signed-off-by: Stane Shieh <stane.shieh@mic.com.tw>
This commit is contained in:
parent
02e0fadca2
commit
46ec35df81
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -77,4 +77,6 @@
|
||||
[submodule "platform/broadcom/sonic-platform-modules-quanta"]
|
||||
path = platform/broadcom/sonic-platform-modules-quanta
|
||||
url = https://github.com/QuantaSwitchONIE/sonic-platform-modules-quanta.git
|
||||
|
||||
[submodule "platform/broadcom/sonic-platform-modules-mitac"]
|
||||
path = platform/broadcom/sonic-platform-modules-mitac
|
||||
url = https://github.com/MiTAC-EBU/sonic-platform-modules-mitac.git
|
||||
|
@ -0,0 +1,33 @@
|
||||
# name lanes alias
|
||||
Ethernet0 49,50,51,52 hundredGigE1
|
||||
Ethernet4 53,54,55,56 hundredGigE2
|
||||
Ethernet8 57,58,59,60 hundredGigE3
|
||||
Ethernet12 61,62,63,64 hundredGigE4
|
||||
Ethernet16 65,66,67,68 hundredGigE5
|
||||
Ethernet20 69,70,71,72 hundredGigE6
|
||||
Ethernet24 73,74,75,76 hundredGigE7
|
||||
Ethernet28 77,78,79,80 hundredGigE8
|
||||
Ethernet32 33,34,35,36 hundredGigE9
|
||||
Ethernet36 37,38,39,40 hundredGigE10
|
||||
Ethernet40 41,42,43,44 hundredGigE11
|
||||
Ethernet44 45,46,47,48 hundredGigE12
|
||||
Ethernet48 81,82,83,84 hundredGigE13
|
||||
Ethernet52 85,86,87,88 hundredGigE14
|
||||
Ethernet56 89,90,91,92 hundredGigE15
|
||||
Ethernet60 93,94,95,96 hundredGigE16
|
||||
Ethernet64 97,98,99,100 hundredGigE17
|
||||
Ethernet68 101,102,103,104 hundredGigE18
|
||||
Ethernet72 105,106,107,108 hundredGigE19
|
||||
Ethernet76 109,110,111,112 hundredGigE20
|
||||
Ethernet80 17,18,19,20 hundredGigE21
|
||||
Ethernet84 21,22,23,24 hundredGigE22
|
||||
Ethernet88 25,26,27,28 hundredGigE23
|
||||
Ethernet92 29,30,31,32 hundredGigE24
|
||||
Ethernet96 113,114,115,116 hundredGigE25
|
||||
Ethernet100 117,118,119,120 hundredGigE26
|
||||
Ethernet104 121,122,123,124 hundredGigE27
|
||||
Ethernet108 125,126,127,128 hundredGigE28
|
||||
Ethernet112 1,2,3,4 hundredGigE29
|
||||
Ethernet116 5,6,7,8 hundredGigE30
|
||||
Ethernet120 9,10,11,12 hundredGigE31
|
||||
Ethernet124 13,14,15,16 hundredGigE32
|
@ -0,0 +1 @@
|
||||
SAI_INIT_CONFIG_FILE=/etc/bcm/th-ly1200-32x100G.config.bcm
|
@ -0,0 +1,4 @@
|
||||
CONSOLE_PORT=0x3f8
|
||||
CONSOLE_DEV=0
|
||||
CONSOLE_SPEED=115200
|
||||
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax pcie_aspm=off irqpoll"
|
@ -0,0 +1,43 @@
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=31 REMAP_PORT_1=30 REMAP_PORT_2=29 REMAP_PORT_3=28
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=27 REMAP_PORT_5=26 REMAP_PORT_6=25 REMAP_PORT_7=24
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=23 REMAP_PORT_9=22 REMAP_PORT_10=21 REMAP_PORT_11=20
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=19 REMAP_PORT_13=18 REMAP_PORT_14=17 REMAP_PORT_15=16
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=63 REMAP_PORT_17=62 REMAP_PORT_18=61 REMAP_PORT_19=60
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=59 REMAP_PORT_21=58 REMAP_PORT_22=57 REMAP_PORT_23=56
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=55 REMAP_PORT_25=54 REMAP_PORT_26=53 REMAP_PORT_27=52
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=51 REMAP_PORT_29=50 REMAP_PORT_30=49 REMAP_PORT_31=48
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=47 REMAP_PORT_33=46 REMAP_PORT_34=45 REMAP_PORT_35=44
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=43 REMAP_PORT_37=42 REMAP_PORT_38=41 REMAP_PORT_39=40
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=39 REMAP_PORT_41=38 REMAP_PORT_42=37 REMAP_PORT_43=36
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=35 REMAP_PORT_45=34 REMAP_PORT_46=33 REMAP_PORT_47=32
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=15 REMAP_PORT_49=14 REMAP_PORT_50=13 REMAP_PORT_51=12
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=11 REMAP_PORT_53=10 REMAP_PORT_54=9 REMAP_PORT_55=8
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=7 REMAP_PORT_57=6 REMAP_PORT_58=5 REMAP_PORT_59=4
|
||||
m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=3 REMAP_PORT_61=2 REMAP_PORT_62=1 REMAP_PORT_63=0
|
||||
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=35 REMAP_PORT_1=34 REMAP_PORT_2=33 REMAP_PORT_3=32
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=39 REMAP_PORT_5=38 REMAP_PORT_6=37 REMAP_PORT_7=36
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=43 REMAP_PORT_9=42 REMAP_PORT_10=41 REMAP_PORT_11=40
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=47 REMAP_PORT_13=46 REMAP_PORT_14=45 REMAP_PORT_15=44
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=3 REMAP_PORT_17=2 REMAP_PORT_18=1 REMAP_PORT_19=0
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=7 REMAP_PORT_21=6 REMAP_PORT_22=5 REMAP_PORT_23=4
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=11 REMAP_PORT_25=10 REMAP_PORT_26=9 REMAP_PORT_27=8
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=15 REMAP_PORT_29=14 REMAP_PORT_30=13 REMAP_PORT_31=12
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=19 REMAP_PORT_33=18 REMAP_PORT_34=17 REMAP_PORT_35=16
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 REMAP_PORT_37=22 REMAP_PORT_38=21 REMAP_PORT_39=20
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=27 REMAP_PORT_41=26 REMAP_PORT_42=25 REMAP_PORT_43=24
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=31 REMAP_PORT_45=30 REMAP_PORT_46=29 REMAP_PORT_47=28
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=51 REMAP_PORT_49=50 REMAP_PORT_50=49 REMAP_PORT_51=48
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=55 REMAP_PORT_53=54 REMAP_PORT_54=53 REMAP_PORT_55=52
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=59 REMAP_PORT_57=58 REMAP_PORT_58=57 REMAP_PORT_59=56
|
||||
m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=63 REMAP_PORT_61=62 REMAP_PORT_62=61 REMAP_PORT_63=60
|
||||
|
||||
led 0 prog 06 EE 80 D2 0A 71 08 E0 60 EE E9 D2 05 75 10 81 61 ED 02 00 12 A0 F8 15 67 22 F2 01 D2 40 74 14 3A 80 28 32 08 97 71 2A 77 65 1A 07 71 30 77 3C 1A 02 27 1A 03 27 C7 97 71 5E 77 4A 28 32 00 32 01 B7 26 ED C7 97 75 50 77 65 1A 02 71 50 77 57 32 0E 87 32 0F 87 57 32 0F 87 32 0E 87 57 32 0E 87 32 0E 87 57 32 0F 87 32 0F 87 57
|
||||
|
||||
led 0 start
|
||||
|
||||
led 1 prog 06 EE 80 D2 0A 71 08 E0 60 EE E9 D2 05 75 10 81 61 ED 02 00 12 A0 F8 15 67 22 F2 01 D2 40 74 14 3A 80 28 32 08 97 71 2A 77 65 1A 07 71 30 77 3C 1A 02 27 1A 03 27 C7 97 71 5E 77 4A 28 32 00 32 01 B7 26 ED C7 97 75 50 77 65 1A 02 71 50 77 57 32 0E 87 32 0F 87 57 32 0F 87 32 0E 87 57 32 0E 87 32 0E 87 57 32 0F 87 32 0F 87 57
|
||||
|
||||
led 1 start
|
||||
|
||||
led auto on
|
1074
device/mitac/x86_64-mitac_ly1200_b32h0_c3-r0/minigraph.xml
Normal file
1074
device/mitac/x86_64-mitac_ly1200_b32h0_c3-r0/minigraph.xml
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
try:
|
||||
import exceptions
|
||||
import binascii
|
||||
import time
|
||||
import optparse
|
||||
import warnings
|
||||
import os
|
||||
import sys
|
||||
from sonic_eeprom import eeprom_base
|
||||
from sonic_eeprom import eeprom_tlvinfo
|
||||
import subprocess
|
||||
except ImportError, e:
|
||||
raise ImportError (str(e) + "- required module not found")
|
||||
|
||||
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
||||
_TLV_INFO_MAX_LEN = 256
|
||||
def __init__(self, name, path, cpld_root, ro):
|
||||
self.eeprom_path = "/sys/bus/i2c/devices/2-0050/eeprom"
|
||||
#Two i2c buses might get flipped order, check them both.
|
||||
if not os.path.exists(self.eeprom_path):
|
||||
self.eeprom_path = "/sys/bus/i2c/devices/2-0050/eeprom"
|
||||
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
182
device/mitac/x86_64-mitac_ly1200_b32h0_c3-r0/plugins/sfputil.py
Normal file
182
device/mitac/x86_64-mitac_ly1200_b32h0_c3-r0/plugins/sfputil.py
Normal file
@ -0,0 +1,182 @@
|
||||
# sfputil.py
|
||||
#
|
||||
# Platform-specific SFP transceiver interface for SONiC
|
||||
#
|
||||
|
||||
try:
|
||||
import time
|
||||
from sonic_sfp.sfputilbase import SfpUtilBase
|
||||
except ImportError as e:
|
||||
raise ImportError("%s - required module not found" % str(e))
|
||||
|
||||
|
||||
class SfpUtil(SfpUtilBase):
|
||||
"""Platform-specific SfpUtil class"""
|
||||
|
||||
PORT_START = 0
|
||||
PORT_END = 31
|
||||
PORTS_IN_BLOCK = 32
|
||||
|
||||
EEPROM_OFFSET = 10
|
||||
|
||||
_port_to_eeprom_mapping = {}
|
||||
|
||||
@property
|
||||
def port_start(self):
|
||||
return self.PORT_START
|
||||
|
||||
@property
|
||||
def port_end(self):
|
||||
return self.PORT_END
|
||||
|
||||
@property
|
||||
def qsfp_ports(self):
|
||||
return range(0, 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"
|
||||
|
||||
for x in range(0, self.port_end + 1):
|
||||
self._port_to_eeprom_mapping[x] = eeprom_path.format(x + self.EEPROM_OFFSET)
|
||||
|
||||
SfpUtilBase.__init__(self)
|
||||
|
||||
def get_presence(self, port_num):
|
||||
# Check for invalid port_num
|
||||
if port_num < self.port_start or port_num > self.port_end:
|
||||
return False
|
||||
|
||||
if port_num > 16:
|
||||
cpld_addr=33
|
||||
else:
|
||||
cpld_addr=32
|
||||
|
||||
file_path="/sys/bus/i2c/devices/1-00" + str(cpld_addr) + "/port" + str(port_num) + "/port" + str(port_num) + "_present"
|
||||
|
||||
try:
|
||||
reg_file = open("file_path")
|
||||
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)
|
||||
|
||||
|
||||
# ModPrsL is active low
|
||||
if reg_value == 0:
|
||||
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
|
||||
|
||||
if port_num > 16:
|
||||
cpld_addr=33
|
||||
else:
|
||||
cpld_addr=32
|
||||
|
||||
|
||||
file_path="/sys/bus/i2c/devices/1-00" + str(cpld_addr) + "/port" + str(port_num) + "/port" + str(port_num) + "_lpmode"
|
||||
|
||||
try:
|
||||
reg_file = open(file_path)
|
||||
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)
|
||||
|
||||
# LPMode is active high
|
||||
if reg_value == 0:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
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
|
||||
|
||||
if port_num > 16:
|
||||
cpld_addr=33
|
||||
else:
|
||||
cpld_addr=32
|
||||
|
||||
file_path="/sys/bus/i2c/devices/1-00" + str(cpld_num) + "/port" + str(port_num) + "/port" + str(port_num) + "_lpmode"
|
||||
|
||||
try:
|
||||
reg_file = open(file_path, "r+")
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
# LPMode is active high; set or clear the bit accordingly
|
||||
if lpmode is True:
|
||||
reg_value = 1
|
||||
else:
|
||||
reg_value = 0
|
||||
|
||||
# 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
|
||||
|
||||
def reset(self, port_num):
|
||||
|
||||
# Check for invalid port_num
|
||||
if port_num < self.port_start or port_num > self.port_end:
|
||||
return False
|
||||
|
||||
if port_num > 16:
|
||||
cpld_addr=33
|
||||
else:
|
||||
cpld_addr=32
|
||||
|
||||
file_path="/sys/bus/i2c/devices/1-00" + str(cpld_num) + "/port" + str(port_num) + "/port" + str(port_num) + "_rst"
|
||||
|
||||
try:
|
||||
reg_file = open(file_path, "r+")
|
||||
except IOError as e:
|
||||
print "Error: unable to open file: %s" % str(e)
|
||||
return False
|
||||
|
||||
# ResetL is active low
|
||||
reg_value = 0
|
||||
|
||||
# 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 = 1
|
||||
reg_file.seek(0)
|
||||
reg_file.write(hex(reg_value))
|
||||
reg_file.close()
|
||||
|
||||
return True
|
@ -20,6 +20,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
|
||||
$(INVENTEC_D7054Q28B_PLATFORM_MODULE) \
|
||||
$(CEL_DX010_PLATFORM_MODULE) \
|
||||
$(DELTA_AG9032V1_PLATFORM_MODULE) \
|
||||
$(QUANTA_IX1B_32X_PLATFORM_MODULE)
|
||||
$(QUANTA_IX1B_32X_PLATFORM_MODULE) \
|
||||
$(MITAC_LY1200_32X_PLATFORM_MODULE)
|
||||
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
|
||||
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
|
||||
|
11
platform/broadcom/platform-modules-mitac.mk
Normal file
11
platform/broadcom/platform-modules-mitac.mk
Normal file
@ -0,0 +1,11 @@
|
||||
# MiTAC Platform modules
|
||||
|
||||
MITAC_LY1200_32X_PLATFORM_MODULE_VERSION = 1.0
|
||||
|
||||
export MITAC_LY1200_32X_PLATFORM_MODULE_VERSION
|
||||
|
||||
MITAC_LY1200_32X_PLATFORM_MODULE = sonic-platform-mitac-ly1200-32x_$(MITAC_LY1200_32X_PLATFORM_MODULE_VERSION)_amd64.deb
|
||||
$(MITAC_LY1200_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-mitac
|
||||
$(MITAC_LY1200_32X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
|
||||
$(MITAC_LY1200_32X_PLATFORM_MODULE)_PLATFORM = x86_64-mitac_ly1200_b32h0_c3-r0
|
||||
SONIC_DPKG_DEBS += $(MITAC_LY1200_32X_PLATFORM_MODULE)
|
@ -9,6 +9,7 @@ include $(PLATFORM_PATH)/platform-modules-inventec.mk
|
||||
include $(PLATFORM_PATH)/platform-modules-cel.mk
|
||||
include $(PLATFORM_PATH)/platform-modules-delta.mk
|
||||
include $(PLATFORM_PATH)/platform-modules-quanta.mk
|
||||
include $(PLATFORM_PATH)/platform-modules-mitac.mk
|
||||
include $(PLATFORM_PATH)/docker-orchagent-brcm.mk
|
||||
include $(PLATFORM_PATH)/docker-syncd-brcm.mk
|
||||
include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk
|
||||
|
1
platform/broadcom/sonic-platform-modules-mitac
Submodule
1
platform/broadcom/sonic-platform-modules-mitac
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit ed807feb6f8efc612ae57dea3123256d972506c5
|
@ -1 +1 @@
|
||||
Subproject commit 02b5c0b08f5812d1d7af98f77dfdb2bb11ad1991
|
||||
Subproject commit 5341a8f75f845240ca73d88738a7708af7e62406
|
Loading…
Reference in New Issue
Block a user