Skip to content

Commit 7d6865c

Browse files
akokhanzhenggen-xu
authored andcommitted
[barefoot] Added Newport platform support (sonic-net#3709)
[barefoot] Added Newport platform support Signed-off-by: Andriy Kokhan <[email protected]>
1 parent 773bf6b commit 7d6865c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3951
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
newport t1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONSOLE_SPEED=57600
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{%- set default_topo = 't0' %}
2+
{%- include 'buffers_config.j2' %}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{% set default_cable = '5m' %}
2+
{% set ingress_lossless_pool_size = '4194304' %}
3+
{% set ingress_lossy_pool_size = '7340032' %}
4+
{% set egress_lossless_pool_size = '16777152' %}
5+
{% set egress_lossy_pool_size = '7340032' %}
6+
7+
{%- macro generate_port_lists(PORT_ALL) %}
8+
{# Generate list of ports #}
9+
{%- for port_idx in range(0,32) %}
10+
{%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %}
11+
{%- endfor %}
12+
{%- endmacro %}
13+
14+
{%- macro generate_buffer_pool_and_profiles() %}
15+
"BUFFER_POOL": {
16+
"ingress_lossless_pool": {
17+
"size": "{{ ingress_lossless_pool_size }}",
18+
"type": "ingress",
19+
"mode": "dynamic",
20+
"xoff": "2867200"
21+
},
22+
"ingress_lossy_pool": {
23+
"size": "{{ ingress_lossy_pool_size }}",
24+
"type": "ingress",
25+
"mode": "dynamic"
26+
},
27+
"egress_lossless_pool": {
28+
"size": "{{ egress_lossless_pool_size }}",
29+
"type": "egress",
30+
"mode": "dynamic"
31+
},
32+
"egress_lossy_pool": {
33+
"size": "{{ egress_lossy_pool_size }}",
34+
"type": "egress",
35+
"mode": "dynamic"
36+
}
37+
},
38+
"BUFFER_PROFILE": {
39+
"ingress_lossy_profile": {
40+
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
41+
"size":"4096",
42+
"dynamic_th":"3"
43+
},
44+
"egress_lossless_profile": {
45+
"pool":"[BUFFER_POOL|egress_lossless_pool]",
46+
"size":"0",
47+
"dynamic_th":"7"
48+
},
49+
"egress_lossy_profile": {
50+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
51+
"size":"4096",
52+
"dynamic_th":"3"
53+
},
54+
"q_lossy_profile": {
55+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
56+
"size":"4096",
57+
"dynamic_th":"3"
58+
}
59+
},
60+
{%- endmacro %}
61+
62+
{%- macro generate_queue_buffers(port_names) %}
63+
"BUFFER_QUEUE": {
64+
"{{ port_names }}|3-4": {
65+
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
66+
},
67+
"{{ port_names }}|0-1": {
68+
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
69+
}
70+
}
71+
{%- endmacro %}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{% set default_cable = '5m' %}
2+
{% set ingress_lossless_pool_size = '2097152' %}
3+
{% set ingress_lossy_pool_size = '5242880' %}
4+
{% set egress_lossless_pool_size = '16777152' %}
5+
{% set egress_lossy_pool_size = '5242880' %}
6+
7+
{%- macro generate_port_lists(PORT_ALL) %}
8+
{# Generate list of ports #}
9+
{%- for port_idx in range(0,32) %}
10+
{%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %}
11+
{%- endfor %}
12+
{%- endmacro %}
13+
14+
{%- macro generate_buffer_pool_and_profiles() %}
15+
"BUFFER_POOL": {
16+
"ingress_lossless_pool": {
17+
"size": "{{ ingress_lossless_pool_size }}",
18+
"type": "ingress",
19+
"mode": "dynamic",
20+
"xoff": "2867200"
21+
},
22+
"ingress_lossy_pool": {
23+
"size": "{{ ingress_lossy_pool_size }}",
24+
"type": "ingress",
25+
"mode": "dynamic"
26+
},
27+
"egress_lossless_pool": {
28+
"size": "{{ egress_lossless_pool_size }}",
29+
"type": "egress",
30+
"mode": "dynamic"
31+
},
32+
"egress_lossy_pool": {
33+
"size": "{{ egress_lossy_pool_size }}",
34+
"type": "egress",
35+
"mode": "dynamic"
36+
}
37+
},
38+
"BUFFER_PROFILE": {
39+
"ingress_lossy_profile": {
40+
"pool":"[BUFFER_POOL|ingress_lossy_pool]",
41+
"size":"4096",
42+
"dynamic_th":"3"
43+
},
44+
"egress_lossless_profile": {
45+
"pool":"[BUFFER_POOL|egress_lossless_pool]",
46+
"size":"0",
47+
"dynamic_th":"7"
48+
},
49+
"egress_lossy_profile": {
50+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
51+
"size":"4096",
52+
"dynamic_th":"3"
53+
},
54+
"q_lossy_profile": {
55+
"pool":"[BUFFER_POOL|egress_lossy_pool]",
56+
"size":"4096",
57+
"dynamic_th":"3"
58+
}
59+
},
60+
{%- endmacro %}
61+
62+
{%- macro generate_queue_buffers(port_names) %}
63+
"BUFFER_QUEUE": {
64+
"{{ port_names }}|3-4": {
65+
"profile" : "[BUFFER_PROFILE|egress_lossless_profile]"
66+
},
67+
"{{ port_names }}|0-1": {
68+
"profile" : "[BUFFER_PROFILE|q_lossy_profile]"
69+
}
70+
}
71+
{%- endmacro %}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# PG lossless profiles.
2+
# speed cable size xon xoff threshold
3+
10000 5m 34816 18432 16384 7
4+
25000 5m 34816 18432 16384 7
5+
40000 5m 34816 18432 16384 7
6+
50000 5m 34816 18432 16384 7
7+
100000 5m 36864 18432 18432 7
8+
400000 5m 36864 18432 18432 7
9+
10000 40m 36864 18432 18432 7
10+
25000 40m 39936 18432 21504 7
11+
40000 40m 41984 18432 23552 7
12+
50000 40m 41984 18432 23552 7
13+
100000 40m 54272 18432 35840 7
14+
400000 40m 54272 18432 35840 7
15+
10000 300m 49152 18432 30720 7
16+
25000 300m 71680 18432 53248 7
17+
40000 300m 94208 18432 75776 7
18+
50000 300m 94208 18432 75776 7
19+
100000 300m 184320 18432 165888 7
20+
400000 300m 184320 18432 165888 7
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# name lanes alias index speed autoneg fec
2+
Ethernet0 0,1,2,3,4,5,6,7 Ethernet0 1 400000 0 rs
3+
Ethernet8 8,9,10,11,12,13,14,15 Ethernet8 2 400000 0 rs
4+
Ethernet16 16,17,18,19,20,21,22,23 Ethernet16 3 400000 0 rs
5+
Ethernet24 24,25,26,27,28,29,30,31 Ethernet24 4 400000 0 rs
6+
Ethernet32 32,33,34,35,36,37,38,39 Ethernet32 5 400000 0 rs
7+
Ethernet40 40,41,42,43,44,45,46,47 Ethernet40 6 400000 0 rs
8+
Ethernet48 48,49,50,51,52,53,54,55 Ethernet48 7 400000 0 rs
9+
Ethernet56 56,57,58,59,60,61,62,63 Ethernet56 8 400000 0 rs
10+
Ethernet64 64,65,66,67,68,69,70,71 Ethernet64 9 400000 0 rs
11+
Ethernet72 72,73,74,75,76,77,78,79 Ethernet72 10 400000 0 rs
12+
Ethernet80 80,81,82,83,84,85,86,87 Ethernet80 11 400000 0 rs
13+
Ethernet88 88,89,90,91,92,93,94,95 Ethernet88 12 400000 0 rs
14+
Ethernet96 96,97,98,99,100,101,102,103 Ethernet96 13 400000 0 rs
15+
Ethernet104 104,105,106,107,108,109,110,111 Ethernet104 14 400000 0 rs
16+
Ethernet112 112,113,114,115,116,117,118,119 Ethernet112 15 400000 0 rs
17+
Ethernet120 120,121,122,123,124,125,126,127 Ethernet120 16 400000 0 rs
18+
Ethernet128 128,129,130,131,132,133,134,135 Ethernet128 17 400000 0 rs
19+
Ethernet136 136,137,138,139,140,141,142,143 Ethernet136 18 400000 0 rs
20+
Ethernet144 144,145,146,147,148,149,150,151 Ethernet144 19 400000 0 rs
21+
Ethernet152 152,153,154,155,156,157,158,159 Ethernet152 20 400000 0 rs
22+
Ethernet160 160,161,162,163,164,165,166,167 Ethernet160 21 400000 0 rs
23+
Ethernet168 168,169,170,171,172,173,174,175 Ethernet168 22 400000 0 rs
24+
Ethernet176 176,177,178,179,180,181,182,183 Ethernet176 23 400000 0 rs
25+
Ethernet184 184,185,186,187,188,189,190,191 Ethernet184 24 400000 0 rs
26+
Ethernet192 192,193,194,195,196,197,198,199 Ethernet192 25 400000 0 rs
27+
Ethernet200 200,201,202,203,204,205,206,207 Ethernet200 26 400000 0 rs
28+
Ethernet208 208,209,210,211,212,213,214,215 Ethernet208 27 400000 0 rs
29+
Ethernet216 216,217,218,219,220,221,222,223 Ethernet216 28 400000 0 rs
30+
Ethernet224 224,225,226,227,228,229,230,231 Ethernet224 29 400000 0 rs
31+
Ethernet232 232,233,234,235,236,237,238,239 Ethernet232 30 400000 0 rs
32+
Ethernet240 240,241,242,243,244,245,246,247 Ethernet240 31 400000 0 rs
33+
Ethernet248 248,249,250,251,252,253,254,255 Ethernet248 32 400000 0 rs
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{%- macro generate_tc_to_pg_map() %}
2+
"TC_TO_PRIORITY_GROUP_MAP": {
3+
"AZURE": {
4+
"3": "3",
5+
"4": "4"
6+
}
7+
},
8+
{%- endmacro %}
9+
10+
{%- include 'qos_config.j2' %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SAI_KEY_WARM_BOOT_WRITE_FILE=/var/warmboot/sai-warmboot.bin
2+
SAI_KEY_WARM_BOOT_READ_FILE=/var/warmboot/sai-warmboot.bin
3+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"instance": 0,
3+
"chip_list": [
4+
{
5+
"id": "asic-0",
6+
"chip_family": "Tofino2",
7+
"instance": 0,
8+
"pcie_sysfs_prefix": "/sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0",
9+
"pcie_domain": 0,
10+
"pcie_bus": 5,
11+
"pcie_fn": 0,
12+
"pcie_dev": 0,
13+
"pcie_int_mode": 1,
14+
"sds_fw_path": "share/tofino_sds_fw/avago/firmware"
15+
}
16+
],
17+
"p4_devices": [
18+
{
19+
"device-id": 0,
20+
"agent0": "lib/platform/x86_64-accton_as9516bf_32d-r0/libpltfm_mgr.so",
21+
"p4_programs": [
22+
{
23+
"p4_pipelines": [
24+
{
25+
"p4_pipeline_name": "pipe",
26+
"config": "share/switch/pipe/tofino2.bin",
27+
"context": "share/switch/pipe/context.json"
28+
}
29+
],
30+
"program-name": "switch",
31+
"switchsai": "lib/libswitchsai.so",
32+
"bfrt-config": "share/switch/bf-rt.json",
33+
"model_json_path" : "share/switch/aug_model.json",
34+
"switchapi_port_add": false,
35+
"non_default_port_ppgs": 5
36+
}
37+
]
38+
}
39+
]
40+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../x86_64-accton_wedge100bf_32x-r0/plugins/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"skip_ledd": true,
3+
"skip_xcvrd": false,
4+
"skip_psud": false,
5+
"skip_syseepromd": false
6+
}

platform/barefoot/one-image.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $(SONIC_ONE_IMAGE)_INSTALLS += $(BFN_MODULE) $(PYTHON_THRIFT)
77
$(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
88
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_PLATFORM_MODULE)
99
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_MONTARA_PLATFORM_MODULE)
10+
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(BFN_NEWPORT_PLATFORM_MODULE)
1011
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(WNC_OSW1800_PLATFORM_MODULE)
1112
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9180_32X_PLATFORM_MODULE)
1213
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(INGRASYS_S9280_64X_PLATFORM_MODULE)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BFN Platform modules
2+
3+
BFN_NEWPORT_PLATFORM_MODULE_VERSION = 1.0
4+
5+
export BFN_NEWPORT_PLATFORM_MODULE_VERSION
6+
7+
BFN_NEWPORT_PLATFORM_MODULE = sonic-platform-modules-bfn-newport_$(BFN_NEWPORT_PLATFORM_MODULE_VERSION)_amd64.deb
8+
$(BFN_NEWPORT_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-bfn-newport
9+
$(BFN_NEWPORT_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
10+
$(BFN_NEWPORT_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as9516bf_32d-r0
11+
SONIC_DPKG_DEBS += $(BFN_NEWPORT_PLATFORM_MODULE)
12+
13+
SONIC_STRETCH_DEBS += $(BFN_NEWPORT_PLATFORM_MODULE)

platform/barefoot/rules.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include $(PLATFORM_PATH)/platform-modules-arista.mk
22
include $(PLATFORM_PATH)/platform-modules-bfn.mk
33
include $(PLATFORM_PATH)/platform-modules-bfn-montara.mk
4+
include $(PLATFORM_PATH)/platform-modules-bfn-newport.mk
45
include $(PLATFORM_PATH)/platform-modules-wnc-osw1800.mk
56
include $(PLATFORM_PATH)/platform-modules-ingrasys.mk
67
include $(PLATFORM_PATH)/bfn-sai.mk
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright (C) 2016 Microsoft, Inc
2+
3+
This program is free software; you can redistribute it and/or
4+
modify it under the terms of the GNU General Public License
5+
as published by the Free Software Foundation; either version 2
6+
of the License, or (at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program; if not, write to the Free Software
15+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This file describes the maintainers for sonic-platform-modules-bfn-newport
2+
# See the SONiC project governance document for more information
3+
Mailinglist = [email protected]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# sonic-platform-modules-bfn-newport
2+
Device drivers for support of BFN platform for the SONiC project
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# BMC interface
2+
auto usb0
3+
allow-hotplug usb0
4+
iface usb0 inet6
5+
up ifconfig usb0 txqueuelen 64
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sonic-platform-modules-bfn-newport (1.0) unstable; urgency=low
2+
3+
* Initial release
4+
5+
-- Support <[email protected]> Mon, 27 Sep 2019 18:00:00 -0800
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Source: sonic-platform-modules-bfn-newport
2+
Section: main
3+
Priority: extra
4+
Maintainer: Support <[email protected]>
5+
Build-Depends: debhelper (>= 8.0.0), bzip2
6+
Standards-Version: 3.9.3
7+
8+
Package: sonic-platform-modules-bfn-newport
9+
Architecture: amd64
10+
Depends: linux-image-4.9.0-9-2-amd64
11+
Description: kernel module for bfn platform fpga and scripts for the devices such as fan, led, sfp
12+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Provides linux kernel driver for BF PCIe devices
2+
3+
This program is free software; you can redistribute it and/or
4+
modify it under the terms of the GNU General Public License
5+
as published by the Free Software Foundation; either version 2
6+
of the License, or (at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
13+
You should have received a copy of the GNU General Public License
14+
along with this program; if not, write to the Free Software
15+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

0 commit comments

Comments
 (0)