Support centec platform (#376)

This commit is contained in:
Min Yao 2017-03-04 18:17:38 +08:00 committed by lguohan
parent 701d5ddb8a
commit b9c624520e
18 changed files with 2273 additions and 0 deletions

View File

@ -0,0 +1,33 @@
# name lanes
Ethernet0 1
Ethernet4 2
Ethernet8 3
Ethernet12 4
Ethernet16 5
Ethernet20 6
Ethernet24 7
Ethernet28 8
Ethernet32 9
Ethernet36 10
Ethernet40 11
Ethernet44 12
Ethernet48 13
Ethernet52 14
Ethernet56 15
Ethernet60 16
Ethernet64 17
Ethernet68 18
Ethernet72 19
Ethernet76 20
Ethernet80 21
Ethernet84 22
Ethernet88 23
Ethernet92 24
Ethernet96 25
Ethernet100 26
Ethernet104 27
Ethernet108 28
Ethernet112 29
Ethernet116 30
Ethernet120 31
Ethernet124 32

View File

@ -0,0 +1 @@
BOARD_CONFIG_FILE_PATH=/etc/centec/E582-48x6q.json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
# name lanes
Ethernet0 1
Ethernet4 2
Ethernet8 3
Ethernet12 4
Ethernet16 5
Ethernet20 6
Ethernet24 7
Ethernet28 8
Ethernet32 9
Ethernet36 10
Ethernet40 11
Ethernet44 12
Ethernet48 13
Ethernet52 14
Ethernet56 15
Ethernet60 16
Ethernet64 17
Ethernet68 18
Ethernet72 19
Ethernet76 20
Ethernet80 21
Ethernet84 22
Ethernet88 23
Ethernet92 24
Ethernet96 25
Ethernet100 26
Ethernet104 27
Ethernet108 28
Ethernet112 29
Ethernet116 30
Ethernet120 31
Ethernet124 32

View File

@ -0,0 +1 @@
BOARD_CONFIG_FILE_PATH=/etc/centec/ES6428A-X48Q2H4.json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
docker-orchagent

View File

@ -0,0 +1 @@
CONSOLE_SPEED=115200

View File

@ -0,0 +1 @@
CONSOLE_SPEED=115200

View File

@ -0,0 +1,16 @@
# docker image for orchagent
DOCKER_ORCHAGENT_CENTEC = docker-orchagent-centec.gz
$(DOCKER_ORCHAGENT_CENTEC)_PATH = $(DOCKERS_PATH)/docker-orchagent
$(DOCKER_ORCHAGENT_CENTEC)_DEPENDS += $(SWSS) $(REDIS_TOOLS)
$(DOCKER_ORCHAGENT_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CENTEC)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CENTEC)
$(DOCKER_ORCHAGENT_CENTEC)_CONTAINER_NAME = swss
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += --net=host --privileged -t
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += --volumes-from database
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/network/interfaces:/etc/network/interfaces:ro
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/network/interfaces.d/:/etc/network/interfaces.d/:ro
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /host/machine.conf:/host/machine.conf
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

View File

@ -0,0 +1,15 @@
# docker image for centec syncd
DOCKER_SYNCD_CENTEC = docker-syncd-centec.gz
$(DOCKER_SYNCD_CENTEC)_PATH = $(PLATFORM_PATH)/docker-syncd-centec
$(DOCKER_SYNCD_CENTEC)_DEPENDS += $(SYNCD)
$(DOCKER_SYNCD_CENTEC)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC)
$(DOCKER_SYNCD_CENTEC)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += --net=host --privileged -t
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += --volumes-from database
$(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

View File

@ -0,0 +1,29 @@
FROM docker-base
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
COPY \
{% for deb in docker_syncd_centec_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_syncd_centec_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
## TODO: add kmod into Depends
RUN apt-get install -f kmod
COPY ["start.sh", "/usr/bin/"]
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]

View File

@ -0,0 +1,14 @@
#!/bin/bash
function clean_up {
service syncd stop
service rsyslog stop
exit
}
trap clean_up SIGTERM SIGKILL
service rsyslog start
service syncd start
read

View File

@ -0,0 +1,8 @@
# sonic centec one image installer
SONIC_ONE_IMAGE = sonic-centec.bin
$(SONIC_ONE_IMAGE)_MACHINE = centec
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_DEPENDS += $(CENTEC_SDK_KERNEL)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)
SONIC_INSTALLERS += $(SONIC_ONE_IMAGE)

View File

13
platform/centec/rules.mk Normal file
View File

@ -0,0 +1,13 @@
include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/docker-orchagent-centec.mk
include $(PLATFORM_PATH)/docker-syncd-centec.mk
include $(PLATFORM_PATH)/one-image.mk
SONIC_ALL += $(SONIC_ONE_IMAGE)
# Inject centec sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(CENTEC_SAI)
# Runtime dependency on centec sai is set only for syncd
$(SYNCD)_RDEPENDS += $(CENTEC_SAI)

5
platform/centec/sai.mk Normal file
View File

@ -0,0 +1,5 @@
# Centec SAI
CENTEC_SAI = libsai_1.0.0_amd64.deb
$(CENTEC_SAI)_URL = https://github.com/CentecNetworks/goldengate-sai/raw/master/lib/SONiC_0.9.4/libsai_1.0.0_amd64.deb
SONIC_ONLINE_DEBS += $(CENTEC_SAI)

4
platform/centec/sdk.mk Normal file
View File

@ -0,0 +1,4 @@
CENTEC_SDK_KERNEL = centec-gg-sdk3.5-modules-3.16.36-1-amd64.deb
$(CENTEC_SDK_KERNEL)_URL = "https://github.com/CentecNetworks/goldengate-sai/raw/master/lib/centec-gg-sdk3.5-modules-3.16.36-1-amd64.deb"
SONIC_ONLINE_DEBS += $(CENTEC_SDK_KERNEL)