Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[platform/pegatron] Update kernel version & device setting #2470

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions device/pegatron/x86_64-pegatron_porsche-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ def read_porttab_mappings(self, porttabfile):
fp_port_index = portname.split("Ethernet").pop()
fp_port_index = int(fp_port_index.split("s").pop(0))/4

if ((len(self.sfp_ports) > 0) and (fp_port_index not in self.sfp_ports)):
continue
#Peter remove - 2018.04.13, this will cause can't show qsfp module when sfp_pot was set
#if ((len(self.sfp_ports) > 0) and (fp_port_index not in self.sfp_ports)):
#continue

if first == 1:
# Initialize last_[physical|logical]_port
Expand Down Expand Up @@ -233,6 +234,14 @@ def read_porttab_mappings(self, porttabfile):
print "logical to physical: " + self.logical_to_physical
print "physical to logical: " + self.physical_to_logical
"""

def get_transceiver_change_event(self):
"""
TODO: This function need to be implemented
when decide to support monitoring SFP(Xcvrd)
on this platform.
"""
raise NotImplementedError



96 changes: 48 additions & 48 deletions device/pegatron/x86_64-pegatron_porsche-r0/porsche/port_config.ini
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
#name lanes alias index speed
Ethernet0 8 Ethernet1/1 0 10000
Ethernet1 9 Ethernet2/1 1 10000
Ethernet2 10 Ethernet3/1 2 10000
Ethernet3 11 Ethernet4/1 3 10000
Ethernet4 12 Ethernet5/1 4 10000
Ethernet5 13 Ethernet6/1 5 10000
Ethernet6 14 Ethernet7/1 6 10000
Ethernet7 15 Ethernet8/1 7 10000
Ethernet8 16 Ethernet9/1 8 10000
Ethernet9 17 Ethernet10/1 9 10000
Ethernet10 18 Ethernet11/1 10 10000
Ethernet11 19 Ethernet12/1 11 10000
Ethernet12 20 Ethernet13/1 12 10000
Ethernet13 21 Ethernet14/1 13 10000
Ethernet14 22 Ethernet15/1 14 10000
Ethernet15 23 Ethernet16/1 15 10000
Ethernet16 32 Ethernet17/1 16 10000
Ethernet17 33 Ethernet18/1 17 10000
Ethernet18 34 Ethernet19/1 18 10000
Ethernet19 35 Ethernet20/1 19 10000
Ethernet20 40 Ethernet21/1 20 10000
Ethernet21 41 Ethernet22/1 21 10000
Ethernet22 42 Ethernet23/1 22 10000
Ethernet23 43 Ethernet24/1 23 10000
Ethernet24 48 Ethernet25/1 24 10000
Ethernet25 49 Ethernet26/1 25 10000
Ethernet26 50 Ethernet27/1 26 10000
Ethernet27 51 Ethernet28/1 27 10000
Ethernet28 56 Ethernet29/1 28 10000
Ethernet29 57 Ethernet30/1 29 10000
Ethernet30 58 Ethernet31/1 30 10000
Ethernet31 59 Ethernet32/1 31 10000
Ethernet32 64 Ethernet33/1 32 10000
Ethernet33 65 Ethernet34/1 33 10000
Ethernet34 66 Ethernet35/1 34 10000
Ethernet35 67 Ethernet36/1 35 10000
Ethernet36 68 Ethernet37/1 36 10000
Ethernet37 69 Ethernet38/1 37 10000
Ethernet38 70 Ethernet39/1 38 10000
Ethernet39 71 Ethernet40/1 39 10000
Ethernet40 72 Ethernet41/1 40 10000
Ethernet41 73 Ethernet42/1 41 10000
Ethernet42 74 Ethernet43/1 42 10000
Ethernet43 75 Ethernet44/1 43 10000
Ethernet44 76 Ethernet45/1 44 10000
Ethernet45 77 Ethernet46/1 45 10000
Ethernet46 78 Ethernet47/1 46 10000
Ethernet47 79 Ethernet48/1 47 10000
Ethernet0 8 Ethernet1/1 0 25000
Ethernet1 9 Ethernet2/1 1 25000
Ethernet2 10 Ethernet3/1 2 25000
Ethernet3 11 Ethernet4/1 3 25000
Ethernet4 12 Ethernet5/1 4 25000
Ethernet5 13 Ethernet6/1 5 25000
Ethernet6 14 Ethernet7/1 6 25000
Ethernet7 15 Ethernet8/1 7 25000
Ethernet8 16 Ethernet9/1 8 25000
Ethernet9 17 Ethernet10/1 9 25000
Ethernet10 18 Ethernet11/1 10 25000
Ethernet11 19 Ethernet12/1 11 25000
Ethernet12 20 Ethernet13/1 12 25000
Ethernet13 21 Ethernet14/1 13 25000
Ethernet14 22 Ethernet15/1 14 25000
Ethernet15 23 Ethernet16/1 15 25000
Ethernet16 32 Ethernet17/1 16 25000
Ethernet17 33 Ethernet18/1 17 25000
Ethernet18 34 Ethernet19/1 18 25000
Ethernet19 35 Ethernet20/1 19 25000
Ethernet20 40 Ethernet21/1 20 25000
Ethernet21 41 Ethernet22/1 21 25000
Ethernet22 42 Ethernet23/1 22 25000
Ethernet23 43 Ethernet24/1 23 25000
Ethernet24 48 Ethernet25/1 24 25000
Ethernet25 49 Ethernet26/1 25 25000
Ethernet26 50 Ethernet27/1 26 25000
Ethernet27 51 Ethernet28/1 27 25000
Ethernet28 56 Ethernet29/1 28 25000
Ethernet29 57 Ethernet30/1 29 25000
Ethernet30 58 Ethernet31/1 30 25000
Ethernet31 59 Ethernet32/1 31 25000
Ethernet32 64 Ethernet33/1 32 25000
Ethernet33 65 Ethernet34/1 33 25000
Ethernet34 66 Ethernet35/1 34 25000
Ethernet35 67 Ethernet36/1 35 25000
Ethernet36 68 Ethernet37/1 36 25000
Ethernet37 69 Ethernet38/1 37 25000
Ethernet38 70 Ethernet39/1 38 25000
Ethernet39 71 Ethernet40/1 39 25000
Ethernet40 72 Ethernet41/1 40 25000
Ethernet41 73 Ethernet42/1 41 25000
Ethernet42 74 Ethernet43/1 42 25000
Ethernet43 75 Ethernet44/1 43 25000
Ethernet44 76 Ethernet45/1 44 25000
Ethernet45 77 Ethernet46/1 45 25000
Ethernet46 78 Ethernet47/1 46 25000
Ethernet47 79 Ethernet48/1 47 25000
Ethernet48 80,81,82,83 Ethernet49/1 48 100000
Ethernet49 84,85,86,87 Ethernet50/1 49 100000
Ethernet50 104,105,106,107 Ethernet51/1 50 100000
Expand Down
98 changes: 49 additions & 49 deletions device/pegatron/x86_64-pegatron_porsche-r0/porsche/tau-porsche.dsh
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
init start stage unit=0 low-level
init set port-map unit=0 port=0 eth-macro=2 lane=0 max-speed=10g active=true
init set port-map unit=0 port=1 eth-macro=2 lane=1 max-speed=10g active=true
init set port-map unit=0 port=2 eth-macro=2 lane=2 max-speed=10g active=true
init set port-map unit=0 port=3 eth-macro=2 lane=3 max-speed=10g active=true
init set port-map unit=0 port=4 eth-macro=3 lane=0 max-speed=10g active=true
init set port-map unit=0 port=5 eth-macro=3 lane=1 max-speed=10g active=true
init set port-map unit=0 port=6 eth-macro=3 lane=2 max-speed=10g active=true
init set port-map unit=0 port=7 eth-macro=3 lane=3 max-speed=10g active=true
init set port-map unit=0 port=8 eth-macro=4 lane=0 max-speed=10g active=true
init set port-map unit=0 port=9 eth-macro=4 lane=1 max-speed=10g active=true
init set port-map unit=0 port=10 eth-macro=4 lane=2 max-speed=10g active=true
init set port-map unit=0 port=11 eth-macro=4 lane=3 max-speed=10g active=true
init set port-map unit=0 port=12 eth-macro=5 lane=0 max-speed=10g active=true
init set port-map unit=0 port=13 eth-macro=5 lane=1 max-speed=10g active=true
init set port-map unit=0 port=14 eth-macro=5 lane=2 max-speed=10g active=true
init set port-map unit=0 port=15 eth-macro=5 lane=3 max-speed=10g active=true
init set port-map unit=0 port=16 eth-macro=8 lane=0 max-speed=10g active=true
init set port-map unit=0 port=17 eth-macro=8 lane=1 max-speed=10g active=true
init set port-map unit=0 port=18 eth-macro=8 lane=2 max-speed=10g active=true
init set port-map unit=0 port=19 eth-macro=8 lane=3 max-speed=10g active=true
init set port-map unit=0 port=20 eth-macro=10 lane=0 max-speed=10g active=true
init set port-map unit=0 port=21 eth-macro=10 lane=1 max-speed=10g active=true
init set port-map unit=0 port=22 eth-macro=10 lane=2 max-speed=10g active=true
init set port-map unit=0 port=23 eth-macro=10 lane=3 max-speed=10g active=true
init set port-map unit=0 port=24 eth-macro=12 lane=0 max-speed=10g active=true
init set port-map unit=0 port=25 eth-macro=12 lane=1 max-speed=10g active=true
init set port-map unit=0 port=26 eth-macro=12 lane=2 max-speed=10g active=true
init set port-map unit=0 port=27 eth-macro=12 lane=3 max-speed=10g active=true
init set port-map unit=0 port=28 eth-macro=14 lane=0 max-speed=10g active=true
init set port-map unit=0 port=29 eth-macro=14 lane=1 max-speed=10g active=true
init set port-map unit=0 port=30 eth-macro=14 lane=2 max-speed=10g active=true
init set port-map unit=0 port=31 eth-macro=14 lane=3 max-speed=10g active=true
init set port-map unit=0 port=32 eth-macro=16 lane=0 max-speed=10g active=true
init set port-map unit=0 port=33 eth-macro=16 lane=1 max-speed=10g active=true
init set port-map unit=0 port=34 eth-macro=16 lane=2 max-speed=10g active=true
init set port-map unit=0 port=35 eth-macro=16 lane=3 max-speed=10g active=true
init set port-map unit=0 port=36 eth-macro=17 lane=0 max-speed=10g active=true
init set port-map unit=0 port=37 eth-macro=17 lane=1 max-speed=10g active=true
init set port-map unit=0 port=38 eth-macro=17 lane=2 max-speed=10g active=true
init set port-map unit=0 port=39 eth-macro=17 lane=3 max-speed=10g active=true
init set port-map unit=0 port=40 eth-macro=18 lane=0 max-speed=10g active=true
init set port-map unit=0 port=41 eth-macro=18 lane=1 max-speed=10g active=true
init set port-map unit=0 port=42 eth-macro=18 lane=2 max-speed=10g active=true
init set port-map unit=0 port=43 eth-macro=18 lane=3 max-speed=10g active=true
init set port-map unit=0 port=44 eth-macro=19 lane=0 max-speed=10g active=true
init set port-map unit=0 port=45 eth-macro=19 lane=1 max-speed=10g active=true
init set port-map unit=0 port=46 eth-macro=19 lane=2 max-speed=10g active=true
init set port-map unit=0 port=47 eth-macro=19 lane=3 max-speed=10g active=true
init set port-map unit=0 port=0 eth-macro=2 lane=0 max-speed=25g active=true
init set port-map unit=0 port=1 eth-macro=2 lane=1 max-speed=25g active=true
init set port-map unit=0 port=2 eth-macro=2 lane=2 max-speed=25g active=true
init set port-map unit=0 port=3 eth-macro=2 lane=3 max-speed=25g active=true
init set port-map unit=0 port=4 eth-macro=3 lane=0 max-speed=25g active=true
init set port-map unit=0 port=5 eth-macro=3 lane=1 max-speed=25g active=true
init set port-map unit=0 port=6 eth-macro=3 lane=2 max-speed=25g active=true
init set port-map unit=0 port=7 eth-macro=3 lane=3 max-speed=25g active=true
init set port-map unit=0 port=8 eth-macro=4 lane=0 max-speed=25g active=true
init set port-map unit=0 port=9 eth-macro=4 lane=1 max-speed=25g active=true
init set port-map unit=0 port=10 eth-macro=4 lane=2 max-speed=25g active=true
init set port-map unit=0 port=11 eth-macro=4 lane=3 max-speed=25g active=true
init set port-map unit=0 port=12 eth-macro=5 lane=0 max-speed=25g active=true
init set port-map unit=0 port=13 eth-macro=5 lane=1 max-speed=25g active=true
init set port-map unit=0 port=14 eth-macro=5 lane=2 max-speed=25g active=true
init set port-map unit=0 port=15 eth-macro=5 lane=3 max-speed=25g active=true
init set port-map unit=0 port=16 eth-macro=8 lane=0 max-speed=25g active=true
init set port-map unit=0 port=17 eth-macro=8 lane=1 max-speed=25g active=true
init set port-map unit=0 port=18 eth-macro=8 lane=2 max-speed=25g active=true
init set port-map unit=0 port=19 eth-macro=8 lane=3 max-speed=25g active=true
init set port-map unit=0 port=20 eth-macro=10 lane=0 max-speed=25g active=true
init set port-map unit=0 port=21 eth-macro=10 lane=1 max-speed=25g active=true
init set port-map unit=0 port=22 eth-macro=10 lane=2 max-speed=25g active=true
init set port-map unit=0 port=23 eth-macro=10 lane=3 max-speed=25g active=true
init set port-map unit=0 port=24 eth-macro=12 lane=0 max-speed=25g active=true
init set port-map unit=0 port=25 eth-macro=12 lane=1 max-speed=25g active=true
init set port-map unit=0 port=26 eth-macro=12 lane=2 max-speed=25g active=true
init set port-map unit=0 port=27 eth-macro=12 lane=3 max-speed=25g active=true
init set port-map unit=0 port=28 eth-macro=14 lane=0 max-speed=25g active=true
init set port-map unit=0 port=29 eth-macro=14 lane=1 max-speed=25g active=true
init set port-map unit=0 port=30 eth-macro=14 lane=2 max-speed=25g active=true
init set port-map unit=0 port=31 eth-macro=14 lane=3 max-speed=25g active=true
init set port-map unit=0 port=32 eth-macro=16 lane=0 max-speed=25g active=true
init set port-map unit=0 port=33 eth-macro=16 lane=1 max-speed=25g active=true
init set port-map unit=0 port=34 eth-macro=16 lane=2 max-speed=25g active=true
init set port-map unit=0 port=35 eth-macro=16 lane=3 max-speed=25g active=true
init set port-map unit=0 port=36 eth-macro=17 lane=0 max-speed=25g active=true
init set port-map unit=0 port=37 eth-macro=17 lane=1 max-speed=25g active=true
init set port-map unit=0 port=38 eth-macro=17 lane=2 max-speed=25g active=true
init set port-map unit=0 port=39 eth-macro=17 lane=3 max-speed=25g active=true
init set port-map unit=0 port=40 eth-macro=18 lane=0 max-speed=25g active=true
init set port-map unit=0 port=41 eth-macro=18 lane=1 max-speed=25g active=true
init set port-map unit=0 port=42 eth-macro=18 lane=2 max-speed=25g active=true
init set port-map unit=0 port=43 eth-macro=18 lane=3 max-speed=25g active=true
init set port-map unit=0 port=44 eth-macro=19 lane=0 max-speed=25g active=true
init set port-map unit=0 port=45 eth-macro=19 lane=1 max-speed=25g active=true
init set port-map unit=0 port=46 eth-macro=19 lane=2 max-speed=25g active=true
init set port-map unit=0 port=47 eth-macro=19 lane=3 max-speed=25g active=true
init set port-map unit=0 port=48 eth-macro=20 lane=0 max-speed=100g active=true
init set port-map unit=0 port=49 eth-macro=21 lane=0 max-speed=100g active=true
init set port-map unit=0 port=50 eth-macro=26 lane=0 max-speed=100g active=true
Expand Down Expand Up @@ -488,7 +488,7 @@ phy set pre-emphasis unit=0 portlist=53 lane-cnt=4 property=c2 data=0x02.02.02.0
phy set pre-emphasis unit=0 portlist=53 lane-cnt=4 property=cn1 data=0x00.00.00.00
phy set pre-emphasis unit=0 portlist=53 lane-cnt=4 property=c0 data=0x1A.1A.1A.1A
phy set pre-emphasis unit=0 portlist=53 lane-cnt=4 property=c1 data=0x07.07.07.07
port set property unit=0 portlist=0-47 speed=10g
port set property unit=0 portlist=0-47 speed=25g
port set property unit=0 portlist=0-47 medium-type=sr
port set property unit=0 portlist=48-53 speed=100g
port set property unit=0 portlist=48-53 medium-type=sr4
Expand Down
3 changes: 2 additions & 1 deletion platform/nephos/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(NEPHOS_NPS_KERNEL)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9130_32X_PLATFORM_MODULE) \
$(INGRASYS_S9230_64X_PLATFORM_MODULE) \
$(ACCTON_AS7116_54X_PLATFORM_MODULE)
$(ACCTON_AS7116_54X_PLATFORM_MODULE) \
$(PEGATRON_PORSCHE_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)
2 changes: 1 addition & 1 deletion platform/nephos/platform-modules-pegatron.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ $(PEGATRON_PORSCHE_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_
$(PEGATRON_PORSCHE_PLATFORM_MODULE)_PLATFORM = x86_64-pegatron_porsche-r0
SONIC_DPKG_DEBS += $(PEGATRON_PORSCHE_PLATFORM_MODULE)

$(eval $(call add_extra_package,$(PEGATRON_PORSCHE_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(PEGATRON_PORSCHE_PLATFORM_MODULE)
1 change: 1 addition & 0 deletions platform/nephos/rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/platform-modules-pegatron.mk
include $(PLATFORM_PATH)/platform-modules-ingrasys.mk
include $(PLATFORM_PATH)/platform-modules-accton.mk
include $(PLATFORM_PATH)/docker-orchagent-nephos.mk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Standards-Version: 3.9.3

Package: sonic-platform-pegatron-porsche
Architecture: amd64
Depends: linux-image-3.16.0-5-amd64
Depends: linux-image-4.9.0-8-amd64
Description: kernel modules for platform devices such as fan, led, sfp

Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
enum cpld_croups { cpld_group_a, cpld_group_b, cpld_group_c};

static const unsigned short normal_i2c[] = { SFP_EEPROM_A0_ADDR, SFP_EEPROM_A2_ADDR, I2C_CLIENT_END };
static char *SFP_CPLD_GROUPA_MAPPING[CPLDA_SFP_NUM][16]={0};
static char *SFP_CPLD_GROUPB_MAPPING[CPLDB_SFP_NUM][16]={0};
static char *SFP_CPLD_GROUPC_MAPPING[CPLDC_SFP_NUM][16]={0};
static char SFP_CPLD_GROUPA_MAPPING[CPLDA_SFP_NUM][16]={0};
static char SFP_CPLD_GROUPB_MAPPING[CPLDB_SFP_NUM][16]={0};
static char SFP_CPLD_GROUPC_MAPPING[CPLDC_SFP_NUM][16]={0};

/*
* This parameter is to help this driver avoid blocking other drivers out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
kernel_module = ['i2c_dev', 'i2c-mux-pca954x force_deselect_on_exit=1', 'at24', 'pegatron_porsche_cpld', 'pegatron_hwmon_mcu', 'pegatron_porsche_sfp']
moduleID = ['pca9544', 'pca9544', '24c02', 'porsche_hwmon_mcu', 'porsche_cpld', 'porsche_cpld', 'porsche_cpld', 'porsche_sfpA', 'porsche_sfpB', 'porsche_sfpC']
i2c_check_node = ['i2c-0', 'i2c-1']
uninstall_check_node = ['-0072', '-0073']
device_address = ['0x72', '0x73', '0x54', '0x70', '0x74', '0x75', '0x76', '0x50', '0x50', '0x50']
device_node= ['i2c-2', 'i2c-6', 'i2c-4', 'i2c-5', 'i2c-6', 'i2c-7', 'i2c-8', 'i2c-6', 'i2c-7', 'i2c-8']

Expand All @@ -54,6 +55,16 @@ def do_cmd(cmd, show):
print('Failed :' + cmd)
return status, output

def install_driver():
status, output = do_cmd("depmod -a", 1)

for i in range(0, len(kernel_module)):
status, output = do_cmd("modprobe " + kernel_module[i], 1)
if status:
return status

return

def check_device_position(num):
for i in range(0, len(i2c_check_node)):
status, output = do_cmd("echo " + moduleID[num] + " " + device_address[num] + " > " + i2c_prefix + i2c_check_node[i] + "/new_device", 0)
Expand Down Expand Up @@ -94,10 +105,17 @@ def do_install():

def do_uninstall():
for i in range(0, len(kernel_module)):
status, output = do_cmd("modprobe -r " + kernel_module[i], 1)
status, output = do_cmd("modprobe -rq " + kernel_module[i], 0)

for i in range(0, len(moduleID)):
status, output = do_cmd("echo " + device_address[i] + " > " + i2c_prefix + i2c_check_node[i] + "/delete_device", 0)
if moduleID[i] == "pca9544":
for node in range(0, len(i2c_check_node)):
status, output = do_cmd("ls " + i2c_prefix + str(node) + uninstall_check_node[i], 0)
if not status:
status, output = do_cmd("echo " + device_address[i] + " > " + i2c_prefix + i2c_check_node[node] + "/delete_device", 0)

else:
status, output = do_cmd("echo " + device_address[i] + " > " + i2c_prefix + device_node[i] + "/delete_device", 0)

return

Expand Down Expand Up @@ -177,7 +195,7 @@ def main():

command:
install : install drivers and generate related sysfs nodes
clean : uninstall drivers and remove related sysfs nodes
uninstall : uninstall drivers and remove related sysfs nodes
set : change board setting [led]
debug : debug info [on/off]
"""
Expand Down