Merge pull request #1335 from lguohan/stretch

[baseimage]: upgrade baseimage to debian stretch
This commit is contained in:
lguohan 2018-08-12 01:13:46 -07:00 committed by GitHub
commit 9e37d50e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
537 changed files with 112586 additions and 5030 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@ fs.*
target/
*.deb
*.changes
*.buildinfo
# Subdirectories in src
src/hiredis/*

21
.gitmodules vendored Executable file → Normal file
View File

@ -4,6 +4,7 @@
[submodule "sonic-linux-kernel"]
path = src/sonic-linux-kernel
url = https://github.com/Azure/sonic-linux-kernel
branch = stretch
[submodule "sonic-sairedis"]
path = src/sonic-sairedis
url = https://github.com/Azure/sonic-sairedis
@ -38,27 +39,20 @@
[submodule "platform/broadcom/sonic-platform-modules-s6000"]
path = platform/broadcom/sonic-platform-modules-s6000
url = https://github.com/Azure/sonic-platform-modules-s6000
branch = stretch
[submodule "platform/broadcom/sonic-platform-modules-arista"]
path = platform/broadcom/sonic-platform-modules-arista
url = https://github.com/aristanetworks/sonic
[submodule "platform/broadcom/sonic-platform-modules-dell"]
path = platform/broadcom/sonic-platform-modules-dell
url = https://github.com/Azure/sonic-platform-modules-dell
[submodule "platform/broadcom/sonic-platform-modules-ingrasys"]
path = platform/broadcom/sonic-platform-modules-ingrasys
url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys
branch = stretch
[submodule "src/sonic-platform-common"]
path = src/sonic-platform-common
url = https://github.com/Azure/sonic-platform-common
[submodule "src/sonic-platform-daemons"]
path = src/sonic-platform-daemons
url = https://github.com/Azure/sonic-platform-daemons
[submodule "platform/broadcom/sonic-platform-modules-accton"]
path = platform/broadcom/sonic-platform-modules-accton
url = https://github.com/edge-core/sonic-platform-modules-accton.git
[submodule "platform/broadcom/sonic-platform-modules-cel"]
path = platform/broadcom/sonic-platform-modules-cel
url = https://github.com/celestica-Inc/sonic-platform-modules-cel.git
[submodule "src/sonic-frr/frr"]
path = src/sonic-frr/frr
url = https://github.com/FRRouting/frr.git
@ -71,12 +65,9 @@
[submodule "platform/nephos/sonic-platform-modules-ingrasys"]
path = platform/nephos/sonic-platform-modules-ingrasys
url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys-nephos.git
[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
[submodule "platform/barefoot/sonic-platform-modules-arista"]
path = platform/barefoot/sonic-platform-modules-arista
url = https://github.com/aristanetworks/sonic
[submodule "platform/mellanox/hw-management/hw-mgmt"]
path = platform/mellanox/hw-management/hw-mgmt
url = https://github.com/Mellanox/hw-mgmt/

View File

@ -30,11 +30,21 @@ $(shell rm -f .screen)
MAKEFLAGS += -B
ifeq ($(BLDENV), stretch)
SLAVE_BASE_TAG = $(shell sha1sum sonic-slave-stretch/Dockerfile | awk '{print substr($$1,0,11);}')
SLAVE_TAG = $(shell cat sonic-slave-stretch/Dockerfile.user sonic-slave-stretch/Dockerfile | sha1sum | awk '{print substr($$1,0,11);}')
SLAVE_BASE_IMAGE = sonic-slave-stretch-base
SLAVE_IMAGE = sonic-slave-stretch-$(USER)
SLAVE_DIR = sonic-slave-stretch
else
SLAVE_BASE_TAG = $(shell sha1sum sonic-slave/Dockerfile | awk '{print substr($$1,0,11);}')
SLAVE_TAG = $(shell cat sonic-slave/Dockerfile.user sonic-slave/Dockerfile | sha1sum | awk '{print substr($$1,0,11);}')
SLAVE_BASE_IMAGE = sonic-slave-base
SLAVE_IMAGE = sonic-slave-$(USER)
SLAVE_DIR = sonic-slave
endif
INSMOD_OVERLAY := sudo modprobe overlay
DOCKER_RUN := docker run --rm=true --privileged \
-v $(PWD):/sonic \
-w /sonic \
@ -46,7 +56,7 @@ DOCKER_BASE_BUILD = docker build --no-cache \
-t $(SLAVE_BASE_IMAGE) \
--build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \
sonic-slave && \
$(SLAVE_DIR) && \
docker tag $(SLAVE_BASE_IMAGE):latest $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
DOCKER_BUILD = docker build --no-cache \
@ -55,8 +65,8 @@ DOCKER_BUILD = docker build --no-cache \
--build-arg guid=$(shell id -g) \
--build-arg hostname=$(shell echo $$HOSTNAME) \
-t $(SLAVE_IMAGE) \
-f sonic-slave/Dockerfile.user \
sonic-slave && \
-f $(SLAVE_DIR)/Dockerfile.user \
$(SLAVE_DIR) && \
docker tag $(SLAVE_IMAGE):latest $(SLAVE_IMAGE):$(SLAVE_TAG)
SONIC_BUILD_INSTRUCTION := make \
@ -86,6 +96,7 @@ SONIC_BUILD_INSTRUCTION := make \
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
$(DOCKER_BUILD) ; }
@$(INSMOD_OVERLAY)
ifeq "$(KEEP_SLAVE_ON)" "yes"
ifdef SOURCE_FOLDER
@$(DOCKER_RUN) -v $(SOURCE_FOLDER):/var/$(USER)/src $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
@ -107,6 +118,7 @@ sonic-slave-bash :
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
$(DOCKER_BUILD) ; }
@$(INSMOD_OVERLAY)
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
showtag:

View File

@ -58,6 +58,10 @@ To build SONiC installer image and docker images, run the following commands:
# Execute make configure once to configure ASIC
make configure PLATFORM=[ASIC_VENDOR]
# build debian stretch required targets
BLDENV=stretch make stretch
# build SONiC image
make
**NOTE**:
@ -79,12 +83,6 @@ The SONiC installer contains all docker images needed. SONiC uses one image for
For Broadcom ASIC, we build ONIE and EOS image. EOS image is used for Arista devices, ONIE image is used for all other Broadcom ASIC based devices.
make configure PLATFORM=broadcom
# build ONIE image
make target/sonic-broadcom.bin
# build EOS image
make target/sonic-aboot-broadcom.swi
You may find the rules/config file useful. It contains configuration options for the build process, like adding more verbosity or showing dependencies, username and password for base image etc.
Every docker image is built and saved to target/ directory.

View File

@ -29,7 +29,8 @@
set -x -e
## docker engine version (with platform)
DOCKER_VERSION=1.11.1-0~jessie_amd64
DOCKER_VERSION=1.11.1-0~stretch_amd64
LINUX_KERNEL_VERSION=4.9.0-5
## Working directory to prepare the file system
FILESYSTEM_ROOT=./fsroot
@ -64,7 +65,7 @@ touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime
## Build a basic Debian system by debootstrap
echo '[INFO] Debootstrap...'
sudo http_proxy=$http_proxy debootstrap --variant=minbase --arch amd64 jessie $FILESYSTEM_ROOT http://debian-archive.trafficmanager.net/debian
sudo http_proxy=$http_proxy debootstrap --variant=minbase --arch amd64 stretch $FILESYSTEM_ROOT http://debian-archive.trafficmanager.net/debian
## Config hostname and hosts, otherwise 'sudo ...' will complain 'sudo: unable to resolve host ...'
sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '$HOSTNAME' > /etc/hostname"
@ -94,7 +95,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT bash -c 'apt-mark auto `apt-mark showmanual`
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y upgrade
echo '[INFO] Install packages for building image'
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install makedev psmisc
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install makedev psmisc systemd-sysv
## Create device files
echo '[INFO] MAKEDEV'
@ -108,12 +109,15 @@ sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c 'cd /dev && MAKEDEV generic'
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install busybox
echo '[INFO] Install SONiC linux kernel image'
## Note: duplicate apt-get command to ensure every line return zero
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/initramfs-tools-core_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/initramfs-tools_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/linux-image-3.16.0-5-amd64_*.deb || \
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/linux-image-${LINUX_KERNEL_VERSION}-amd64_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install acl
## Update initramfs for booting with squashfs+aufs
## Update initramfs for booting with squashfs+overlay
cat files/initramfs-tools/modules | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null
## Hook into initramfs: change fs type from vfat to ext4 on arista switches
@ -145,13 +149,10 @@ sudo cp files/initramfs-tools/mgmt-intf-dhcp $FILESYSTEM_ROOT/etc/initramfs-tool
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/mgmt-intf-dhcp
sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
sudo chroot $FILESYSTEM_ROOT update-initramfs -u
## Install latest intel igb driver
sudo cp target/debs/igb.ko $FILESYSTEM_ROOT/lib/modules/3.16.0-5-amd64/kernel/drivers/net/ethernet/intel/igb/igb.ko
pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd
## Install latest intel ixgbe driver
sudo cp target/debs/ixgbe.ko $FILESYSTEM_ROOT/lib/modules/3.16.0-5-amd64/kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
sudo cp target/debs/ixgbe.ko $FILESYSTEM_ROOT/lib/modules/${LINUX_KERNEL_VERSION}-amd64/kernel/drivers/net/ethernet/intel/ixgbe/ixgbe.ko
## Install docker
echo '[INFO] Install docker'
@ -220,6 +221,7 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
gdisk \
sysfsutils \
grub2-common \
rsyslog \
ethtool \
screen \
hping3 \
@ -227,10 +229,6 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
tcptraceroute \
mtr-tiny
# Install a newer version of rsyslog from jessie-backports in hopes of
# eliminating memory leaks
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y -t jessie-backports install rsyslog
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y download \
grub-pc-bin
@ -270,7 +268,7 @@ sudo sed -i '
' $FILESYSTEM_ROOT/etc/monit/monitrc
sudo tee -a $FILESYSTEM_ROOT/etc/monit/monitrc > /dev/null <<'EOF'
check filesystem root-aufs with path /
check filesystem root-overlay with path /
if space usage > 90% for 5 times within 10 cycles then alert
check filesystem var-log with path /var/log
if space usage > 90% for 5 times within 10 cycles then alert
@ -367,6 +365,9 @@ if [ "${enable_organization_extensions}" = "y" ]; then
fi
fi
## Update initramfs
sudo chroot $FILESYSTEM_ROOT update-initramfs -u
## Clean up apt
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get autoremove
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get autoclean

View File

@ -2,21 +2,21 @@
# ------------------------------------------------
#
bus "i2c-2" "SCD 0000:04:00.0 SMBus master 0 bus 0"
bus "i2c-3" "SCD 0000:04:00.0 SMBus master 0 bus 1"
bus "i2c-5" "SCD 0000:04:00.0 SMBus master 0 bus 3"
bus "i2c-6" "SCD 0000:04:00.0 SMBus master 0 bus 4"
bus "i2c-7" "SCD 0000:04:00.0 SMBus master 0 bus 5"
bus "i2c-5" "SCD 0000:04:00.0 SMBus master 0 bus 0"
bus "i2c-6" "SCD 0000:04:00.0 SMBus master 0 bus 1"
bus "i2c-8" "SCD 0000:04:00.0 SMBus master 0 bus 3"
bus "i2c-9" "SCD 0000:04:00.0 SMBus master 0 bus 4"
bus "i2c-10" "SCD 0000:04:00.0 SMBus master 0 bus 5"
chip "k10temp-pci-00c3"
label temp1 "Cpu temp sensor"
chip "lm73-i2c-3-48"
chip "lm73-i2c-6-48"
label temp1 "Back panel temp sensor"
set temp1_max 65
#set temp1_max_alarm 75 # read-only
chip "max6658-i2c-2-4c"
chip "max6658-i2c-5-4c"
label temp1 "Board temp sensor"
set temp1_max 65
set temp1_crit 75
@ -26,7 +26,7 @@ chip "max6658-i2c-2-4c"
set temp2_crit 75
# disabled because of some eeprom corruption risks
#chip "pmbus-i2c-3-4e"
#chip "pmbus-i2c-6-4e"
# label temp1 "Power controller sensor 1"
# set temp1_max 60
# set temp1_crit 70
@ -37,7 +37,7 @@ chip "max6658-i2c-2-4c"
# ignore curr1
chip "dps460-i2c-5-58"
chip "dps460-i2c-8-58"
label temp1 "Power supply 1 inlet temp sensor"
# maximum and critical thresholds are not supported for this psu
set temp1_max 60
@ -59,7 +59,7 @@ chip "dps460-i2c-5-58"
set curr2_max 36
set curr2_crit 37
chip "dps460-i2c-6-58"
chip "dps460-i2c-9-58"
label temp1 "Power supply 2 inlet temp sensor"
# maximum and critical thresholds are not supported for this psu
set temp1_max 60

View File

@ -0,0 +1,12 @@
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=2
DEVPATH=hwmon3=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-23/23-004d/ hwmon2=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-11/11-001a/hwmon/hwmon2
DEVNAME=hwmon3=emc2305 hwmon2=max6697
FCTEMPS=hwmon3/pwm1=hwmon2/temp2_input hwmon3/pwm2=hwmon2/temp2_input hwmon3/pwm4=hwmon2/temp2_input
FCFANS=hwmon3/device/pwm1=hwmon3/device/fan1_input hwmon3/device/pwm2=hwmon3/device/fan2_input hwmon3/device/pwm4=hwmon3/device/fan4_input
MINTEMP=hwmon3/device/pwm1=29 hwmon3/device/pwm2=29 hwmon3/device/pwm4=29
MAXTEMP=hwmon3/device/pwm1=44 hwmon3/device/pwm2=44 hwmon3/device/pwm4=44
MINSTART=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINSTOP=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MINPWM=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102
MAXPWM=hwmon3/device/pwm1=255 hwmon3/device/pwm2=255 hwmon3/device/pwm4=255

View File

@ -0,0 +1,23 @@
#!/usr/bin/env python
#############################################################################
# Celestica Haliburton
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################
try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError, e:
raise ImportError (str(e) + "- required module not found")
class board(eeprom_tlvinfo.TlvInfoDecoder):
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0050/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,12 @@
# libsensors configuration file for Celestica DX010.
# The i2c bus portion is omit because adapter name
# changes every time when system boot up.
chip "max6697-i2c-*-1a"
label temp1 "temp sensor 1"
label temp2 "temp sensor 2"
label temp3 "temp sensor 3"
label temp4 "temp sensor 4"
label temp5 "temp sensor 5"
ignore temp6
ignore temp7

View File

@ -36,33 +36,30 @@ chip "dps460-i2c-*-5b"
set in3_crit 13.0
set in3_lcrit 11.0
# These sensors located on CPU Board.
chip "dx010_lm75b-i2c-*-48"
label temp1 "CPU_external temp sensor"
set temp1_max 43
set temp1_max_hyst 28
chip "dx010_lm75b-i2c-*-4e"
label temp1 "Rear_panel temp sensor"
set temp1_max 43
set temp1_max_hyst 28
# These sensors located on Main Switch Board.
bus "i2c-5" "i2c-1-mux (chan_id 3)"
chip "dx010_lm75b-i2c-5-48"
label temp1 "Front_panel left temp sensor"
chip "lm75b-i2c-*-48"
label temp1 "Front-panel temp sensor 1"
set temp1_max 43
set temp1_max_hyst 28
bus "i2c-6" "i2c-1-mux (chan_id 4)"
chip "dx010_lm75b-i2c-6-49"
label temp1 "Front_panel right temp sensor"
chip "lm75b-i2c-*-49"
label temp1 "Front-panel temp sensor 2"
set temp1_max 43
set temp1_max_hyst 28
bus "i2c-7" "i2c-1-mux (chan_id 5)"
chip "dx010_lm75b-i2c-7-4a"
label temp1 "Switch_external temp sensor"
chip "lm75b-i2c-*-4a"
label temp1 "ASIC temp sensor"
set temp1_max 43
set temp1_max_hyst 28
# These sensors located on CPU Board.
chip "lm75b-i2c-*-48"
label temp1 "Rear-panel temp sensor 1"
set temp1_max 43
set temp1_max_hyst 28
chip "lm75b-i2c-*-4e"
label temp1 "Rear-panel temp sensor 2"
set temp1_max 43
set temp1_max_hyst 28

View File

@ -0,0 +1,65 @@
# name lanes alias index
Ethernet0 49,50,51,52 hundredGigE1/1 0
Ethernet4 53,54,55,56 hundredGigE1/2 1
Ethernet8 65,66,67,68 hundredGigE1/3 2
Ethernet12 69,70,71,72 hundredGigE1/4 3
Ethernet16 81,82,83,84 hundredGigE1/5 4
Ethernet20 85,86,87,88 hundredGigE1/6 5
Ethernet24 97,98,99,100 hundredGigE1/7 6
Ethernet28 101,102,103,104 hundredGigE1/8 7
Ethernet32 1,2,3,4 hundredGigE1/9 8
Ethernet36 5,6,7,8 hundredGigE1/10 9
Ethernet40 17,18,19,20 hundredGigE1/11 10
Ethernet44 21,22,23,24 hundredGigE1/12 11
Ethernet48 33,34,35,36 hundredGigE1/13 12
Ethernet52 37,38,39,40 hundredGigE1/14 13
Ethernet56 113,114,115,116 hundredGigE1/15 14
Ethernet60 117,118,119,120 hundredGigE1/16 15
Ethernet64 133,134,135,136 hundredGigE1/17 16
Ethernet68 129,130,131,132 hundredGigE1/18 17
Ethernet72 213,214,215,216 hundredGigE1/19 18
Ethernet76 209,210,211,212 hundredGigE1/20 19
Ethernet80 229,230,231,232 hundredGigE1/21 20
Ethernet84 225,226,227,228 hundredGigE1/22 21
Ethernet88 245,246,247,248 hundredGigE1/23 22
Ethernet92 241,242,243,244 hundredGigE1/24 23
Ethernet96 149,150,151,152 hundredGigE1/25 24
Ethernet100 145,146,147,148 hundredGigE1/26 25
Ethernet104 165,166,167,168 hundredGigE1/27 26
Ethernet108 161,162,163,164 hundredGigE1/28 27
Ethernet112 181,182,183,184 hundredGigE1/29 28
Ethernet116 177,178,179,180 hundredGigE1/30 29
Ethernet120 197,198,199,200 hundredGigE1/31 30
Ethernet124 193,194,195,196 hundredGigE1/32 31
Ethernet128 61,62,63,64 hundredGigE1/33 32
Ethernet132 57,58,59,60 hundredGigE1/34 33
Ethernet136 77,78,79,80 hundredGigE1/35 34
Ethernet140 73,74,75,76 hundredGigE1/36 35
Ethernet144 93,94,95,96 hundredGigE1/37 36
Ethernet148 89,90,91,92 hundredGigE1/38 37
Ethernet152 109,110,111,112 hundredGigE1/39 38
Ethernet156 105,106,107,108 hundredGigE1/40 39
Ethernet160 13,14,15,16 hundredGigE1/41 40
Ethernet164 9,10,11,12 hundredGigE1/42 41
Ethernet168 29,30,31,32 hundredGigE1/43 42
Ethernet172 25,26,27,28 hundredGigE1/44 43
Ethernet176 45,46,47,48 hundredGigE1/45 44
Ethernet180 41,42,43,44 hundredGigE1/46 45
Ethernet184 125,126,127,128 hundredGigE1/47 46
Ethernet188 121,122,123,124 hundredGigE1/48 47
Ethernet192 137,138,139,140 hundredGigE1/49 48
Ethernet196 141,142,143,144 hundredGigE1/50 49
Ethernet200 217,218,219,220 hundredGigE1/51 50
Ethernet204 221,222,223,224 hundredGigE1/52 51
Ethernet208 233,234,235,236 hundredGigE1/53 52
Ethernet212 237,238,239,240 hundredGigE1/54 53
Ethernet216 249,250,251,252 hundredGigE1/55 54
Ethernet220 253,254,255,256 hundredGigE1/56 55
Ethernet224 153,154,155,156 hundredGigE1/57 56
Ethernet228 157,158,159,160 hundredGigE1/58 57
Ethernet232 169,170,171,172 hundredGigE1/59 58
Ethernet236 173,174,175,176 hundredGigE1/60 59
Ethernet240 185,186,187,188 hundredGigE1/61 60
Ethernet244 189,190,191,192 hundredGigE1/62 61
Ethernet248 201,202,203,204 hundredGigE1/63 62
Ethernet252 205,206,207,208 hundredGigE1/64 63

View File

@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/th2-z9264f-64x100G.config.bcm

View File

@ -0,0 +1,3 @@
CONSOLE_PORT=0x3f8
CONSOLE_DEV=0
CONSOLE_SPEED=115200

View File

@ -0,0 +1,111 @@
# LED microprocessor initialization for DellEMC-Z9264f
m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=32 REMAP_PORT_2=33 REMAP_PORT_1=34 REMAP_PORT_0=35
m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=36 REMAP_PORT_6=37 REMAP_PORT_5=38 REMAP_PORT_4=39
m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=4 REMAP_PORT_10=5 REMAP_PORT_9=6 REMAP_PORT_8=7
m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=0 REMAP_PORT_14=1 REMAP_PORT_13=2 REMAP_PORT_12=3
m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=56 REMAP_PORT_18=57 REMAP_PORT_17=58 REMAP_PORT_16=59
m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=60 REMAP_PORT_22=61 REMAP_PORT_21=62 REMAP_PORT_20=63
m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=28 REMAP_PORT_26=29 REMAP_PORT_25=30 REMAP_PORT_24=31
m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=24 REMAP_PORT_30=25 REMAP_PORT_29=26 REMAP_PORT_28=27
m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=48 REMAP_PORT_34=49 REMAP_PORT_33=50 REMAP_PORT_32=51
m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=52 REMAP_PORT_38=53 REMAP_PORT_37=54 REMAP_PORT_36=55
m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=20 REMAP_PORT_42=21 REMAP_PORT_41=22 REMAP_PORT_40=23
m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=16 REMAP_PORT_46=17 REMAP_PORT_45=18 REMAP_PORT_44=19
m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=40 REMAP_PORT_50=41 REMAP_PORT_49=42 REMAP_PORT_48=43
m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=44 REMAP_PORT_54=45 REMAP_PORT_53=46 REMAP_PORT_52=47
m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=12 REMAP_PORT_58=13 REMAP_PORT_57=14 REMAP_PORT_56=15
m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=8 REMAP_PORT_62=9 REMAP_PORT_61=10 REMAP_PORT_60=11
m CMIC_LEDUP1_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=0 REMAP_PORT_2=1 REMAP_PORT_1=2 REMAP_PORT_0=3
m CMIC_LEDUP1_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=4 REMAP_PORT_6=5 REMAP_PORT_5=6 REMAP_PORT_4=7
m CMIC_LEDUP1_PORT_ORDER_REMAP_8_11 REMAP_PORT_9=38 REMAP_PORT_8=39 REMAP_PORT_11=36 REMAP_PORT_10=37
m CMIC_LEDUP1_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=32 REMAP_PORT_14=33 REMAP_PORT_13=34 REMAP_PORT_12=35
m CMIC_LEDUP1_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=8 REMAP_PORT_18=9 REMAP_PORT_17=10 REMAP_PORT_16=11
m CMIC_LEDUP1_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=12 REMAP_PORT_22=13 REMAP_PORT_21=14 REMAP_PORT_20=15
m CMIC_LEDUP1_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=44 REMAP_PORT_26=45 REMAP_PORT_25=46 REMAP_PORT_24=47
m CMIC_LEDUP1_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=40 REMAP_PORT_30=41 REMAP_PORT_29=42 REMAP_PORT_28=43
m CMIC_LEDUP1_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=16 REMAP_PORT_34=17 REMAP_PORT_33=18 REMAP_PORT_32=19
m CMIC_LEDUP1_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=20 REMAP_PORT_38=21 REMAP_PORT_37=22 REMAP_PORT_36=23
m CMIC_LEDUP1_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=52 REMAP_PORT_42=53 REMAP_PORT_41=54 REMAP_PORT_40=55
m CMIC_LEDUP1_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=48 REMAP_PORT_46=49 REMAP_PORT_45=50 REMAP_PORT_44=51
m CMIC_LEDUP1_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=24 REMAP_PORT_50=25 REMAP_PORT_49=26 REMAP_PORT_48=27
m CMIC_LEDUP1_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=28 REMAP_PORT_54=29 REMAP_PORT_53=30 REMAP_PORT_52=31
m CMIC_LEDUP1_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=60 REMAP_PORT_58=61 REMAP_PORT_57=62 REMAP_PORT_56=63
m CMIC_LEDUP1_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=56 REMAP_PORT_62=57 REMAP_PORT_61=58 REMAP_PORT_60=59
m CMIC_LEDUP2_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=60 REMAP_PORT_2=61 REMAP_PORT_1=62 REMAP_PORT_0=63
m CMIC_LEDUP2_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=56 REMAP_PORT_6=57 REMAP_PORT_5=58 REMAP_PORT_4=59
m CMIC_LEDUP2_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=24 REMAP_PORT_10=25 REMAP_PORT_9=26 REMAP_PORT_8=27
m CMIC_LEDUP2_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=28 REMAP_PORT_14=29 REMAP_PORT_13=30 REMAP_PORT_12=31
m CMIC_LEDUP2_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=52 REMAP_PORT_18=53 REMAP_PORT_17=54 REMAP_PORT_16=55
m CMIC_LEDUP2_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=48 REMAP_PORT_22=49 REMAP_PORT_21=50 REMAP_PORT_20=51
m CMIC_LEDUP2_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=16 REMAP_PORT_26=17 REMAP_PORT_25=18 REMAP_PORT_24=19
m CMIC_LEDUP2_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=20 REMAP_PORT_30=21 REMAP_PORT_29=22 REMAP_PORT_28=23
m CMIC_LEDUP2_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=44 REMAP_PORT_34=45 REMAP_PORT_33=46 REMAP_PORT_32=47
m CMIC_LEDUP2_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=40 REMAP_PORT_38=41 REMAP_PORT_37=42 REMAP_PORT_36=43
m CMIC_LEDUP2_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=8 REMAP_PORT_42=9 REMAP_PORT_41=10 REMAP_PORT_40=11
m CMIC_LEDUP2_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=12 REMAP_PORT_46=13 REMAP_PORT_45=14 REMAP_PORT_44=15
m CMIC_LEDUP2_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=36 REMAP_PORT_50=37 REMAP_PORT_49=38 REMAP_PORT_48=39
m CMIC_LEDUP2_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=32 REMAP_PORT_54=33 REMAP_PORT_53=34 REMAP_PORT_52=35
m CMIC_LEDUP2_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=0 REMAP_PORT_58=1 REMAP_PORT_57=2 REMAP_PORT_56=3
m CMIC_LEDUP2_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=4 REMAP_PORT_62=5 REMAP_PORT_61=6 REMAP_PORT_60=7
m CMIC_LEDUP3_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=28 REMAP_PORT_2=29 REMAP_PORT_1=30 REMAP_PORT_0=31
m CMIC_LEDUP3_PORT_ORDER_REMAP_4_7 REMAP_PORT_7=24 REMAP_PORT_6=25 REMAP_PORT_5=26 REMAP_PORT_4=27
m CMIC_LEDUP3_PORT_ORDER_REMAP_8_11 REMAP_PORT_11=56 REMAP_PORT_10=57 REMAP_PORT_9=58 REMAP_PORT_8=59
m CMIC_LEDUP3_PORT_ORDER_REMAP_12_15 REMAP_PORT_15=60 REMAP_PORT_14=61 REMAP_PORT_13=62 REMAP_PORT_12=63
m CMIC_LEDUP3_PORT_ORDER_REMAP_16_19 REMAP_PORT_19=4 REMAP_PORT_18=5 REMAP_PORT_17=6 REMAP_PORT_16=7
m CMIC_LEDUP3_PORT_ORDER_REMAP_20_23 REMAP_PORT_23=0 REMAP_PORT_22=1 REMAP_PORT_21=2 REMAP_PORT_20=3
m CMIC_LEDUP3_PORT_ORDER_REMAP_24_27 REMAP_PORT_27=32 REMAP_PORT_26=33 REMAP_PORT_25=34 REMAP_PORT_24=35
m CMIC_LEDUP3_PORT_ORDER_REMAP_28_31 REMAP_PORT_31=36 REMAP_PORT_30=37 REMAP_PORT_29=38 REMAP_PORT_28=39
m CMIC_LEDUP3_PORT_ORDER_REMAP_32_35 REMAP_PORT_35=12 REMAP_PORT_34=13 REMAP_PORT_33=14 REMAP_PORT_32=15
m CMIC_LEDUP3_PORT_ORDER_REMAP_36_39 REMAP_PORT_39=8 REMAP_PORT_38=9 REMAP_PORT_37=10 REMAP_PORT_36=11
m CMIC_LEDUP3_PORT_ORDER_REMAP_40_43 REMAP_PORT_43=40 REMAP_PORT_42=41 REMAP_PORT_41=42 REMAP_PORT_40=43
m CMIC_LEDUP3_PORT_ORDER_REMAP_44_47 REMAP_PORT_47=44 REMAP_PORT_46=45 REMAP_PORT_45=46 REMAP_PORT_44=47
m CMIC_LEDUP3_PORT_ORDER_REMAP_48_51 REMAP_PORT_51=20 REMAP_PORT_50=21 REMAP_PORT_49=22 REMAP_PORT_48=23
m CMIC_LEDUP3_PORT_ORDER_REMAP_52_55 REMAP_PORT_55=16 REMAP_PORT_54=17 REMAP_PORT_53=18 REMAP_PORT_52=19
m CMIC_LEDUP3_PORT_ORDER_REMAP_56_59 REMAP_PORT_59=48 REMAP_PORT_58=49 REMAP_PORT_57=50 REMAP_PORT_56=51
m CMIC_LEDUP3_PORT_ORDER_REMAP_60_63 REMAP_PORT_63=52 REMAP_PORT_62=53 REMAP_PORT_61=54 REMAP_PORT_60=55
m CMIC_LEDUP4_PORT_ORDER_REMAP_0_3 REMAP_PORT_3=1 REMAP_PORT_1=0
led 0 stop
led 0 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 0 auto on
led 0 start
led 1 stop
led 1 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 1 auto on
led 1 start
led 2 stop
led 2 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 2 auto on
led 2 start
led 3 stop
led 3 prog \
02 00 60 FE 2E FE 67 1C 86 FE 06 FE D2 40 71 04 \
12 FF 85 05 D2 05 71 1A 52 00 3A 80 32 08 97 71 \
23 77 4B 32 00 32 01 B7 97 75 32 12 BC FE FE 02 \
0A 50 12 BC FE FE 95 75 3C 85 77 44 16 FF DA 02 \
71 4B 77 44 22 0F 87 22 0E 87 57 22 0E 87 22 0E \
87 57 22 0E 87 22 0F 87 57 00 00 00 00 00 00 00
led 3 auto on
led 3 start

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
#############################################################################
# DellEMC Z9264f
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################
try:
from sonic_eeprom import eeprom_tlvinfo
except ImportError, e:
raise ImportError (str(e) + "- required module not found")
class board(eeprom_tlvinfo.TlvInfoDecoder):
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/class/i2c-adapter/i2c-0/0-0053/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,97 @@
#
# psuutil.py
# Platform-specific PSU status interface for SONiC
#
import os.path
import logging
import commands
Z9264F_MAX_PSUS = 2
IPMI_SENSOR_DATA = "ipmitool sdr list"
PSU_PRESENCE = "PSU{0}_state"
# Use this for older firmware
# PSU_PRESENCE="PSU{0}_prsnt"
ipmi_sdr_list = ""
try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")
class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
def __init__(self):
PsuBase.__init__(self)
# Fetch a BMC register
def get_pmc_register(self, reg_name):
status = 1
global ipmi_sdr_list
ipmi_dev_node = "/dev/pmi0"
ipmi_cmd = IPMI_SENSOR_DATA
status, ipmi_sdr_list = commands.getstatusoutput(ipmi_cmd)
if status:
logging.error('Failed to execute:' + ipmi_sdr_list)
sys.exit(0)
for item in ipmi_sdr_list.split("\n"):
if reg_name in item:
output = item.strip()
if not output:
print('\nFailed to fetch: ' + reg_name + ' sensor ')
sys.exit(0)
output = output.split('|')[1]
logging.basicConfig(level=logging.DEBUG)
return output
def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device
:return: An integer, the number of PSUs available on the device
"""
Z9264F_MAX_PSUS = 2
return Z9264F_MAX_PSUS
def get_psu_status(self, index):
"""
Retrieves the oprational status of power supply unit (PSU) defined
by index <index>
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is operating properly, False if PSU is\
faulty
"""
#Until psu_status is implemented this is hardcoded temporarily
status = 1
return status
def get_psu_presence(self, index):
"""
Retrieves the presence status of power supply unit (PSU) defined
by index <index>
:param index: An integer, index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
status = 0
psu_reg_name = PSU_PRESENCE.format(index)
psu_status = int(self.get_pmc_register(psu_reg_name),16)
if (psu_status != 'ERR'):
# Check for PSU presence
if (psu_status):
status = 1
return status

View File

@ -0,0 +1,192 @@
# sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
try:
import struct
import sys
import getopt
import time
from sonic_sfp.sfputilbase import SfpUtilBase
from os import *
from mmap import *
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 = 63
PORTS_IN_BLOCK = 32
BASE_RES_PATH = "/sys/bus/pci/devices/0000:04:00.0/resource0"
_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 pci_mem_read(self, mm, offset):
mm.seek(offset)
read_data_stream=mm.read(4)
reg_val=struct.unpack('I',read_data_stream)
mem_val = str(reg_val)[1:-2]
# print "reg_val read:%x"%reg_val
return mem_val
def pci_mem_write(self, mm, offset, data):
mm.seek(offset)
# print "data to write:%x"%data
mm.write(struct.pack('I',data))
def pci_set_value(self, resource, val, offset):
fd=open(resource,O_RDWR)
mm=mmap(fd,0)
return self.pci_mem_write(mm,offset,val)
def pci_get_value(self, resource, offset):
fd=open(resource,O_RDWR)
mm=mmap(fd,0)
return self.pci_mem_read(mm, offset)
def __init__(self):
eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom"
for x in range(0, self.port_end + 1):
port_num = x + 2
self.port_to_eeprom_mapping[x] = eeprom_path.format(
port_num)
port_num = 0
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
# Port offset starts with 0x4004
port_offset = 16388 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 4)
# ModPrsL is active low
if reg_value & mask == 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
# Port offset starts with 0x4000
port_offset = 16384 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 6)
# LPMode is active high
if reg_value & mask == 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
# Port offset starts with 0x4000
port_offset = 16384 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 6)
# 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
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
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
# Port offset starts with 0x4000
port_offset = 16384 + ((port_num) * 16)
status = self.pci_get_value(self.BASE_RES_PATH, port_offset)
reg_value = int(status)
# Absence of status throws error
if (reg_value == "" ):
return False
# Mask off 4th bit for presence
mask = (1 << 6)
# ResetL is active low
reg_value = reg_value & ~mask
# Convert our register value back to a hex string and write back
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
# Sleep 1 second to allow it to settle
time.sleep(1)
reg_value = reg_value | mask
# Convert our register value back to a hex string and write back
status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset)
return True

View File

@ -51,7 +51,7 @@ class SfpUtil(SfpUtilBase):
return False
try:
reg_file = open("/sys/devices/platform/delta-ag9032v1-cpld.0/sfp_present")
reg_file = open("/sys/devices/platform/delta-ag9032v1-swpld.0/sfp_present")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
@ -76,7 +76,7 @@ class SfpUtil(SfpUtilBase):
return False
try:
reg_file = open("/sys/devices/platform/delta-ag9032v1-cpld.0/sfp_lpmode")
reg_file = open("/sys/devices/platform/delta-ag9032v1-swpld.0/sfp_lpmode")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
@ -100,7 +100,7 @@ class SfpUtil(SfpUtilBase):
return False
try:
reg_file = open("/sys/devices/platform/delta-ag9032v1-cpld.0/sfp_lpmode", "r+")
reg_file = open("/sys/devices/platform/delta-ag9032v1-swpld.0/sfp_lpmode", "r+")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
@ -129,7 +129,7 @@ class SfpUtil(SfpUtilBase):
return True
def reset(self, port_num):
QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/devices/platform/delta-ag9032v1-cpld.0/sfp_reset"
QSFP_RESET_REGISTER_DEVICE_FILE = "/sys/devices/platform/delta-ag9032v1-swpld.0/sfp_reset"
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
@ -172,4 +172,4 @@ class SfpUtil(SfpUtilBase):
reg_file.write(hex(reg_value))
reg_file.close()
return True
return True

View File

@ -1,67 +1,65 @@
# name lanes alias index
Ethernet0 49,50,51,52 Ethernet1/1 1
Ethernet4 53,54,55,56 Ethernet2/1 2
Ethernet8 65,66,67,68 Ethernet3/1 3
Ethernet12 69,70,71,72 Ethernet4/1 4
Ethernet16 81,82,83,84 Ethernet5/1 5
Ethernet20 85,86,87,88 Ethernet6/1 6
Ethernet24 1,2,3,4 Ethernet7/1 7
Ethernet28 101,102,103,104 Ethernet8/1 8
Ethernet32 5,6,7,8 Ethernet9/1 9
Ethernet36 17,18,19,20 Ethernet10/1 10
Ethernet40 21,22,23,24 Ethernet11/1 11
Ethernet44 33,34,35,36 Ethernet12/1 12
Ethernet48 37,38,39,40 Ethernet13/1 13
Ethernet52 97,98,99,100 Ethernet14/1 14
Ethernet56 113,114,115,116 Ethernet15/1 15
Ethernet60 117,118,119,120 Ethernet16/1 16
Ethernet64 129,130,131,132 Ethernet17/1 17
Ethernet68 133,134,135,136 Ethernet18/1 18
Ethernet72 145,146,147,148 Ethernet19/1 19
Ethernet76 209,210,211,212 Ethernet20/1 20
Ethernet80 213,214,215,216 Ethernet21/1 21
Ethernet84 225,226,227,228 Ethernet22/1 22
Ethernet88 229,230,231,232 Ethernet23/1 23
Ethernet92 241,242,243,244 Ethernet24/1 24
Ethernet96 245,246,247,248 Ethernet25/1 25
Ethernet100 157,158,159,160 Ethernet26/1 26
Ethernet104 161,162,163,164 Ethernet27/1 27
Ethernet108 165,166,167,168 Ethernet28/1 28
Ethernet112 177,178,179,180 Ethernet29/1 29
Ethernet116 181,182,183,184 Ethernet30/1 30
Ethernet120 193,194,195,196 Ethernet31/1 31
Ethernet124 197,198,199,200 Ethernet32/1 32
Ethernet128 61,62,63,64 Ethernet33/1 33
Ethernet132 57,58,59,60 Ethernet34/1 34
Ethernet136 77,78,79,80 Ethernet35/1 35
Ethernet140 73,74,75,76 Ethernet36/1 36
Ethernet144 93,94,95,96 Ethernet37/1 37
Ethernet148 89,90,91,92 Ethernet38/1 38
Ethernet152 105,106,107,108 Ethernet39/1 39
Ethernet156 9,10,11,12 Ethernet40/1 40
Ethernet160 25,26,27,28 Ethernet41/1 41
Ethernet164 13,14,15,16 Ethernet42/1 42
Ethernet168 41,42,43,44 Ethernet43/1 43
Ethernet172 29,30,31,32 Ethernet44/1 44
Ethernet176 45,46,47,48 Ethernet45/1 45
Ethernet180 109,110,111,112 Ethernet46/1 46
Ethernet184 125,126,127,128 Ethernet47/1 47
Ethernet188 121,122,123,124 Ethernet48/1 48
Ethernet192 141,142,143,144 Ethernet49/1 49
Ethernet196 137,138,139,140 Ethernet50/1 50
Ethernet200 217,218,219,220 Ethernet51/1 51
Ethernet204 149,150,151,152 Ethernet52/1 52
Ethernet208 233,234,235,236 Ethernet53/1 53
Ethernet212 221,222,223,224 Ethernet54/1 54
Ethernet216 249,250,251,252 Ethernet55/1 55
Ethernet220 237,238,239,240 Ethernet56/1 56
Ethernet224 153,154,155,156 Ethernet57/1 57
Ethernet228 253,254,255,256 Ethernet58/1 58
Ethernet232 173,174,175,176 Ethernet59/1 59
Ethernet236 169,170,171,172 Ethernet60/1 60
Ethernet240 189,190,191,192 Ethernet61/1 61
Ethernet244 185,186,187,188 Ethernet62/1 62
Ethernet248 205,206,207,208 Ethernet63/1 63
Ethernet252 201,202,203,204 Ethernet64/1 64
Ethernet256 257 Ethernet65 65
Ethernet260 259 Ethernet66 66
# name lanes alias
Ethernet0 49,50,51,52 Ethernet1/1
Ethernet4 53,54,55,56 Ethernet2/1
Ethernet8 65,66,67,68 Ethernet3/1
Ethernet12 69,70,71,72 Ethernet4/1
Ethernet16 81,82,83,84 Ethernet5/1
Ethernet20 85,86,87,88 Ethernet6/1
Ethernet24 1,2,3,4 Ethernet7/1
Ethernet28 101,102,103,104 Ethernet8/1
Ethernet32 5,6,7,8 Ethernet9/1
Ethernet36 17,18,19,20 Ethernet10/1
Ethernet40 21,22,23,24 Ethernet11/1
Ethernet44 33,34,35,36 Ethernet12/1
Ethernet48 37,38,39,40 Ethernet13/1
Ethernet52 97,98,99,100 Ethernet14/1
Ethernet56 113,114,115,116 Ethernet15/1
Ethernet60 117,118,119,120 Ethernet16/1
Ethernet64 129,130,131,132 Ethernet17/1
Ethernet68 133,134,135,136 Ethernet18/1
Ethernet72 145,146,147,148 Ethernet19/1
Ethernet76 209,210,211,212 Ethernet20/1
Ethernet80 213,214,215,216 Ethernet21/1
Ethernet84 225,226,227,228 Ethernet22/1
Ethernet88 229,230,231,232 Ethernet23/1
Ethernet92 241,242,243,244 Ethernet24/1
Ethernet96 245,246,247,248 Ethernet25/1
Ethernet100 157,158,159,160 Ethernet26/1
Ethernet104 161,162,163,164 Ethernet27/1
Ethernet108 165,166,167,168 Ethernet28/1
Ethernet112 177,178,179,180 Ethernet29/1
Ethernet116 181,182,183,184 Ethernet30/1
Ethernet120 193,194,195,196 Ethernet31/1
Ethernet124 197,198,199,200 Ethernet32/1
Ethernet128 61,62,63,64 Ethernet33/1
Ethernet132 57,58,59,60 Ethernet34/1
Ethernet136 77,78,79,80 Ethernet35/1
Ethernet140 73,74,75,76 Ethernet36/1
Ethernet144 93,94,95,96 Ethernet37/1
Ethernet148 89,90,91,92 Ethernet38/1
Ethernet152 105,106,107,108 Ethernet39/1
Ethernet156 9,10,11,12 Ethernet40/1
Ethernet160 25,26,27,28 Ethernet41/1
Ethernet164 13,14,15,16 Ethernet42/1
Ethernet168 41,42,43,44 Ethernet43/1
Ethernet172 29,30,31,32 Ethernet44/1
Ethernet176 45,46,47,48 Ethernet45/1
Ethernet180 109,110,111,112 Ethernet46/1
Ethernet184 125,126,127,128 Ethernet47/1
Ethernet188 121,122,123,124 Ethernet48/1
Ethernet192 141,142,143,144 Ethernet49/1
Ethernet196 137,138,139,140 Ethernet50/1
Ethernet200 217,218,219,220 Ethernet51/1
Ethernet204 149,150,151,152 Ethernet52/1
Ethernet208 233,234,235,236 Ethernet53/1
Ethernet212 221,222,223,224 Ethernet54/1
Ethernet216 249,250,251,252 Ethernet55/1
Ethernet220 237,238,239,240 Ethernet56/1
Ethernet224 153,154,155,156 Ethernet57/1
Ethernet228 253,254,255,256 Ethernet58/1
Ethernet232 173,174,175,176 Ethernet59/1
Ethernet236 169,170,171,172 Ethernet60/1
Ethernet240 189,190,191,192 Ethernet61/1
Ethernet244 185,186,187,188 Ethernet62/1
Ethernet248 205,206,207,208 Ethernet63/1
Ethernet252 201,202,203,204 Ethernet64/1

View File

@ -0,0 +1,51 @@
# name lanes alias index
Ethernet0 1 1000 0
Ethernet1 2 1000 1
Ethernet2 3 1000 2
Ethernet3 4 1000 3
Ethernet4 5 1000 4
Ethernet5 6 1000 5
Ethernet6 7 1000 6
Ethernet7 8 1000 7
Ethernet8 9 1000 8
Ethernet9 10 1000 9
Ethernet10 11 1000 10
Ethernet11 12 1000 11
Ethernet12 13 1000 12
Ethernet13 14 1000 13
Ethernet14 15 1000 14
Ethernet15 16 1000 15
Ethernet16 17 1000 16
Ethernet17 18 1000 17
Ethernet18 19 1000 18
Ethernet19 20 1000 19
Ethernet20 21 1000 20
Ethernet21 22 1000 21
Ethernet22 23 1000 22
Ethernet23 24 1000 23
Ethernet24 25 1000 24
Ethernet25 26 1000 25
Ethernet26 27 1000 26
Ethernet27 28 1000 27
Ethernet28 29 1000 28
Ethernet29 30 1000 29
Ethernet30 31 1000 30
Ethernet31 32 1000 31
Ethernet32 33 1000 32
Ethernet33 34 1000 33
Ethernet34 35 1000 34
Ethernet35 36 1000 35
Ethernet36 37 1000 36
Ethernet37 38 1000 37
Ethernet38 39 1000 38
Ethernet39 40 1000 39
Ethernet40 41 1000 40
Ethernet41 42 1000 41
Ethernet42 43 1000 42
Ethernet43 44 1000 43
Ethernet44 45 1000 44
Ethernet45 46 1000 45
Ethernet46 47 1000 46
Ethernet47 48 1000 47
Ethernet48 54 10000 48
Ethernet49 53 10000 49

View File

@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/etc/bcm/helix4-et-6248brb-48x1G+2x10G.config.bcm

View File

@ -0,0 +1,12 @@
INTERVAL=10
DEVPATH=hwmon1=/sys/bus/i2c/devices
DEVNAME=hwmon1=adt7473
FCTEMPS=hwmon1/0-0048/hwmon/hwmon*/temp1_input hwmon1/7-0049/hwmon/hwmon*/temp1_input hwmon1/8-004a/hwmon/hwmon*/temp1_input
FCFANS=hwmon1/0-002e/fan1_input hwmon1/0-002e/fan2_input
FCTARGETS=hwmon1/0-002e/pwm1 hwmon1/0-002e/pwm2
MINTEMP=20
MAXTEMP=60
MINSTART=75
MINSTOP=22

View File

@ -0,0 +1,279 @@
#!/bin/bash
#
# Simple script implementing a temperature dependent fan speed control
# Supported Linux kernel versions: 2.6.5 and later
#
# Version 0.70
#
# Usage: fancontrol [CONFIGFILE]
#
# Dependencies:
# bash, egrep, sed, cut, sleep, readlink, lm_sensors :)
#
# Please send any questions, comments or success stories to
# marius.reiner@hdev.de
# Thanks!
#
# For configuration instructions and warnings please see fancontrol.txt, which
# can be found in the doc/ directory or at the website mentioned above.
#
#
# Copyright 2003 Marius Reiner <marius.reiner@hdev.de>
# Copyright (C) 2007-2009 Jean Delvare <khali@linux-fr.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA.
#
#
PIDFILE="/var/run/fancontrol.pid"
#DEBUG=1
MAX=255
function LoadConfig
{
local fcvcount fcv
echo "Loading configuration from $1 ..."
if [ ! -r "$1" ]
then
echo "Error: Can't read configuration file" >&2
exit 1
fi
# grep configuration from file
INTERVAL=`egrep '^INTERVAL=.*$' $1 | sed -e 's/INTERVAL=//g'`
DEVPATH=`egrep '^DEVPATH=.*$' $1 | sed -e 's/DEVPATH= *//g'`
DEVNAME=`egrep '^DEVNAME=.*$' $1 | sed -e 's/DEVNAME= *//g'`
FCTEMPS=`egrep '^FCTEMPS=.*$' $1 | sed -e 's/FCTEMPS=//g'`
MINTEMP=`egrep '^MINTEMP=.*$' $1 | sed -e 's/MINTEMP=//g'`
MAXTEMP=`egrep '^MAXTEMP=.*$' $1 | sed -e 's/MAXTEMP=//g'`
MINSTART=`egrep '^MINSTART=.*$' $1 | sed -e 's/MINSTART=//g'`
MINSTOP=`egrep '^MINSTOP=.*$' $1 | sed -e 's/MINSTOP=//g'`
HWMON=$( echo "$DEVPATH" | sed 's/=.*$//g')
FCDEVPATH=$( echo "$DEVPATH" | sed 's/^.*=//g')
FCMINTEMP=$MINTEMP
FCMAXTEMP=$MAXTEMP
FCMINSTART=$MINSTART
FCMINSTOP=$MINSTOP
AFCTEMP_1_LOWER=(00 39 36 41 46 55)
AFCTEMP_1_UPPER=(39 39 44 49 54 150)
AFCTEMP_2_LOWER=(00 61 65 69 73 82)
AFCTEMP_2_UPPER=(63 67 71 75 79 150)
AFCTEMP_3_LOWER=(00 51 55 59 63 71)
AFCTEMP_3_UPPER=(53 57 61 65 69 150)
FCFANS=`egrep '^FCFANS=.*$' $1 | sed -e 's/FCFANS=//g'`
FCTARGETS=`egrep '^FCTARGETS=.*$' $1 | sed -e 's/FCTARGETS=//g'`
# Check whether all mandatory settings are set
if [[ -z ${INTERVAL} || -z ${FCTEMPS} || -z ${MINTEMP} || -z ${MAXTEMP} || -z ${MINSTART} || -z ${MINSTOP} ]]
then
echo "Some mandatory settings missing, please check your config file!" >&2
exit 1
fi
if [ "$INTERVAL" -le 0 ]
then
echo "Error in configuration file:" >&2
echo "INTERVAL must be at least 1" >&2
exit 1
fi
# write settings to arrays for easier use and print them
echo
echo "Common settings:"
temp_string=$FCTEMPS
let fcvcount=0
for fcv in $FCTEMPS
do
fcvcount=$((fcvcount+1))
AFCTEMP[$fcvcount]=$( echo "$temp_string" | cut -d" " -f $fcvcount )
AFCTEMP[$fcvcount]=$( echo "${AFCTEMP[$fcvcount]}" | sed 's/hwmon1/\/sys\/bus\/i2c\/devices/g' )
AFCTEMP_PATH[$fcvcount]=$( echo "${AFCTEMP[$fcvcount]}" | sed 's/hwmon1/\/sys\/bus\/i2c\/devices/g' )
AFCTEMP[$fcvcount]=$( cat ${AFCTEMP[$fcvcount]} )
AFCTEMP[$fcvcount]=$(( AFCTEMP[$fcvcount]/1000 ))
done
fan_string=$FCFANS
fcvcount=0
for fcv in $FCFANS
do
fcvcount=$((fcvcount+1))
AFCFAN[$fcvcount]=$( echo "$fan_string" | cut -d" " -f $fcvcount )
AFCFAN_PATH[$fcvcount]=$( echo "${AFCFAN[$fcvcount]}" | sed 's/hwmon1/\/sys\/bus\/i2c\/devices/g' )
AFCFAN[$fcvcount]=$( cat ${AFCFAN_PATH[$fcvcount]} )
done
target_string=$FCTARGETS
fcvcount=0
for fcv in $FCTARGETS
do
fcvcount=$((fcvcount+1))
AFCTARGET[$fcvcount]=$( echo "$target_string" | cut -d" " -f $fcvcount )
AFCFAN_TARGET[$fcvcount]=$( echo "${AFCTARGET[$fcvcount]}" | sed 's/hwmon1/\/sys\/bus\/i2c\/devices/g' )
done
}
# Check that all referenced sysfs files exist
function CheckFiles
{
local outdated=0 fcvcount tsen fan
if [ $outdated -eq 1 ]
then
echo >&2
echo "At least one referenced file is missing. Either some required kernel" >&2
echo "modules haven't been loaded, or your configuration file is outdated." >&2
echo "In the latter case, you should run pwmconfig again." >&2
fi
return $outdated
}
LoadConfig $1
# Detect path to sensors
if [ ! -d $DIR ]
then
echo $0: 'No sensors found! (did you load the necessary modules?)' >&2
exit 1
fi
cd $DIR
# Check for configuration change
if [ "$DIR" != "/" ] && [ -z "$DEVPATH" -o -z "$DEVNAME" ]
then
echo "Configuration is too old, please run pwmconfig again" >&2
exit 1
fi
if [ "$DIR" = "/" -a -n "$DEVPATH" ]
then
echo "Unneeded DEVPATH with absolute device paths" >&2
exit 1
fi
CheckFiles || exit 1
if [ -f "$PIDFILE" ]
then
echo "File $PIDFILE exists, is fancontrol already running?" >&2
exit 1
fi
echo $$ > "$PIDFILE"
# main function
function UpdateThermalSensors
{
fcvcount=0
for fcv in $FCTEMPS
do
fcvcount=$((fcvcount+1))
AFCTEMP[$fcvcount]=$( cat ${AFCTEMP_PATH[$fcvcount]} )
AFCTEMP[$fcvcount]=$(( AFCTEMP[$fcvcount]/1000 ))
done
}
function UpdateThermalLevel
{
AFCTEMP_NUM=$((6-${AFCTEMP_LEVEL[$i]}))
AFCTEMP_UPPER_BUF=AFCTEMP_"$i"_UPPER["$AFCTEMP_NUM"]
AFCTEMP_LOWER_BUF=AFCTEMP_"$i"_LOWER["$AFCTEMP_NUM"]
AFCTEMP_UPPER=${!AFCTEMP_UPPER_BUF}
AFCTEMP_LOWER=${!AFCTEMP_LOWER_BUF}
if (( ("${AFCTEMP[$i]}" <= "$AFCTEMP_UPPER") && ("${AFCTEMP[$i]}" >= "$AFCTEMP_LOWER") )) ; then
FLAG=2
elif (( "${AFCTEMP[$i]}" > "$AFCTEMP_UPPER" )); then
AFCTEMP_LEVEL[$i]=$((${AFCTEMP_LEVEL[$i]} - 1))
FLAG=1
elif (( "${AFCTEMP[$i]}" < "$AFCTEMP_LOWER" )); then
AFCTEMP_LEVEL[$i]=$((${AFCTEMP_LEVEL[$i]} + 1))
FLAG=1
else
AFCTEMP_LEVEL[$i]=1
FLAG=2
fi
}
function UpdateFanSpeeds
{
#echo "num tmp lev F L H"
#Update level
for i in 1 2 3
do
#echo "----------------------"
FLAG=0
#FLAG=0 : initial flag
#FLAG=1 : update level
#FLAG=2 : final level
while [ $FLAG -ne 2 ]
do
UpdateThermalLevel
#echo " $i ${AFCTEMP[$i]} ${AFCTEMP_LEVEL[$i]} $FLAG $AFCTEMP_LOWER $AFCTEMP_UPPER "
done
done
min=${AFCTEMP_LEVEL[0]}
for j in "${AFCTEMP_LEVEL[@]}"; do
(( j < min )) && min=$j
done
if (($min == 1 || $min == 2)); then
FAN_PERCENTAGE=100
elif (($min == 3)); then
FAN_PERCENTAGE=80
elif (($min == 4)); then
FAN_PERCENTAGE=60
elif (($min == 5)); then
FAN_PERCENTAGE=40
elif (($min == 6)); then
FAN_PERCENTAGE=30
else
FAN_PERCENTAGE=100
fi
echo "The lowest level of thermal sensors: $min "
echo "Trying to set fan speed to $FAN_PERCENTAGE %"
#Set speed to fan1~fan10
FAN_PERCENTAGE=`expr $FAN_PERCENTAGE \* 255 / 100`
let fcvcount=0
for fcv in $FCFANS
do
fcvcount=$(( fcvcount + 1 ))
echo $FAN_PERCENTAGE > ${AFCFAN_TARGET[$fcvcount]}
AFCFAN[$fcvcount]=$( cat ${AFCFAN_PATH[$fcvcount]} )
echo "FAN fan$fcvcount = ${AFCFAN[$fcvcount]} (rpm)"
done
rm -f "$PIDFILE"
}
# main loop calling the main function at specified intervals
AFCTEMP_LEVEL=(9 4 4 4) #inttial level
while true
do
UpdateThermalSensors
UpdateFanSpeeds
echo "Sleep $INTERVAL seconds ..."
echo
# Sleep while still handling signals
sleep $INTERVAL &
wait $!
done

View File

@ -0,0 +1,3 @@
CONSOLE_PORT=0x2f8
CONSOLE_DEV=1
CONSOLE_SPEED=115200

View File

@ -0,0 +1,46 @@
#ET_6248BRB Port_Remap
# Vlan set and port enable
clear c
port ge en=1
port hg en=1
# led0 port order remap
m CMIC_LEDUP0_PORT_ORDER_REMAP_0_3 REMAP_PORT_0=0 REMAP_PORT_1=1 REMAP_PORT_2=2 REMAP_PORT_3=3
m CMIC_LEDUP0_PORT_ORDER_REMAP_4_7 REMAP_PORT_4=4 REMAP_PORT_5=5 REMAP_PORT_6=6 REMAP_PORT_7=7
m CMIC_LEDUP0_PORT_ORDER_REMAP_8_11 REMAP_PORT_8=51 REMAP_PORT_9=50 REMAP_PORT_10=49 REMAP_PORT_11=48
m CMIC_LEDUP0_PORT_ORDER_REMAP_12_15 REMAP_PORT_12=47 REMAP_PORT_13=46 REMAP_PORT_14=45 REMAP_PORT_15=44
m CMIC_LEDUP0_PORT_ORDER_REMAP_16_19 REMAP_PORT_16=43 REMAP_PORT_17=42 REMAP_PORT_18=41 REMAP_PORT_19=40
m CMIC_LEDUP0_PORT_ORDER_REMAP_20_23 REMAP_PORT_20=39 REMAP_PORT_21=38 REMAP_PORT_22=37 REMAP_PORT_23=36
m CMIC_LEDUP0_PORT_ORDER_REMAP_24_27 REMAP_PORT_24=35 REMAP_PORT_25=34 REMAP_PORT_26=33 REMAP_PORT_27=32
m CMIC_LEDUP0_PORT_ORDER_REMAP_28_31 REMAP_PORT_28=31 REMAP_PORT_29=30 REMAP_PORT_30=29 REMAP_PORT_31=28
m CMIC_LEDUP0_PORT_ORDER_REMAP_32_35 REMAP_PORT_32=27 REMAP_PORT_33=26 REMAP_PORT_34=25 REMAP_PORT_35=24
m CMIC_LEDUP0_PORT_ORDER_REMAP_36_39 REMAP_PORT_36=23 REMAP_PORT_37=22 REMAP_PORT_38=21 REMAP_PORT_39=20
m CMIC_LEDUP0_PORT_ORDER_REMAP_40_43 REMAP_PORT_40=19 REMAP_PORT_41=18 REMAP_PORT_42=17 REMAP_PORT_43=16
m CMIC_LEDUP0_PORT_ORDER_REMAP_44_47 REMAP_PORT_44=15 REMAP_PORT_45=14 REMAP_PORT_46=13 REMAP_PORT_47=12
m CMIC_LEDUP0_PORT_ORDER_REMAP_48_51 REMAP_PORT_48=11 REMAP_PORT_49=10 REMAP_PORT_50=9 REMAP_PORT_51=8
m CMIC_LEDUP0_PORT_ORDER_REMAP_52_55 REMAP_PORT_52=7 REMAP_PORT_53=6 REMAP_PORT_54=5 REMAP_PORT_55=4
m CMIC_LEDUP0_PORT_ORDER_REMAP_56_59 REMAP_PORT_56=3 REMAP_PORT_57=2 REMAP_PORT_58=1 REMAP_PORT_59=0
m CMIC_LEDUP0_PORT_ORDER_REMAP_60_63 REMAP_PORT_60=60 REMAP_PORT_61=61 REMAP_PORT_62=62 REMAP_PORT_63=63
echo "ET_6248BRB LED Port Remap: Done."
#ET_6248BRB_LED
#--------------------------------------------------------------------------------------------------
#LED Auto link/up
led stop
led prog '\
02 00 60 E0 02 A0 60 E2 86 E6 02 00 60 E1 06 E0\
D2 30 75 28 02 00 2E E0 32 08 97 71 1F 77 44 2E\
E0 32 04 97 71 3C 77 40 02 00 2E E0 32 08 97 71\
33 77 44 2E E0 32 03 97 71 3C 77 40 02 02 77 44\
02 04 77 44 60 E3 2E E0 32 00 32 01 B7 97 02 00\
0E 00 12 E4 FE E1 50 12 E4 05 60 E5 12 E3 05 0A\
02 71 67 67 9A 77 69 67 86 12 E3 05 0A 01 71 74\
67 9A 77 76 67 86 06 E2 F2 01 60 E2 86 E0 06 E0\
D2 34 74 0A 3A 68 06 E5 D2 00 70 96 16 E6 99 99\
1A 00 71 96 77 9A 32 0F 87 57 32 0E 87 57 00 00\
'
led auto on
led start

View File

@ -0,0 +1,766 @@
<DeviceMiniGraph xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="Microsoft.Search.Autopilot.Evolution">
<CpgDec>
<IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
<PeeringSessions>
<BGPSession>
<StartRouter>ARISTA01T1</StartRouter>
<StartPeer>10.0.0.1</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.0</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA02T1</StartRouter>
<StartPeer>10.0.0.5</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.4</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA03T1</StartRouter>
<StartPeer>10.0.0.9</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.8</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA04T1</StartRouter>
<StartPeer>10.0.0.13</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.12</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA01T1</StartRouter>
<StartPeer>FC00::2</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>FC00::1</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA02T1</StartRouter>
<StartPeer>FC00::A</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>FC00::9</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA03T1</StartRouter>
<StartPeer>FC00::12</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>FC00::11</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA04T1</StartRouter>
<StartPeer>FC00::1A</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>FC00::19</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
</PeeringSessions>
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:BGPRouterDeclaration>
<a:ASN>64601</a:ASN>
<a:Hostname>sonic</a:Hostname>
<a:Peers>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>10.0.0.1</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>10.0.0.5</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>10.0.0.9</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>10.0.0.13</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>FC00::2</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>FC00::A</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>FC00::12</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>FC00::1A</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
</a:Peers>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64802</a:ASN>
<a:Hostname>ARISTA01T1</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64802</a:ASN>
<a:Hostname>ARISTA02T1</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64802</a:ASN>
<a:Hostname>ARISTA03T1</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64802</a:ASN>
<a:Hostname>ARISTA04T1</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
</Routers>
</CpgDec>
<DpgDec>
<DeviceDataPlaneInfo>
<IPSecTunnels/>
<LoopbackIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:LoopbackIPInterface>
<Name>HostIP</Name>
<AttachTo>Loopback0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>10.1.0.32/32</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>10.1.0.32/32</a:PrefixStr>
</a:LoopbackIPInterface>
<a:LoopbackIPInterface>
<Name>HostIP1</Name>
<AttachTo>Loopback0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>FC00:1::32/128</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>FC00:1::32/128</a:PrefixStr>
</a:LoopbackIPInterface>
</LoopbackIPInterfaces>
<ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:ManagementIPInterface>
<Name>HostIP</Name>
<AttachTo>eth0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>10.251.0.243/23</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>10.251.0.243/23</a:PrefixStr>
</a:ManagementIPInterface>
</ManagementIPInterfaces>
<MplsInterfaces/>
<MplsTeInterfaces/>
<RsvpInterfaces/>
<Hostname>sonic</Hostname>
<PortChannelInterfaces/>
<VlanInterfaces>
<VlanInterface>
<ElementType>VlanInterface</ElementType>
<Name>Vlan2</Name>
<AttachTo>Ethernet0;Ethernet1;Ethernet2;Ethernet3;Ethernet4;Ethernet5;Ethernet6;Ethernet7;Ethernet8;Ethernet9;Ethernet10;Ethernet11;Ethernet12;Ethernet13;Ethernet14;Ethernet15;Ethernet16;Ethernet17;Ethernet18;Ethernet19;Ethernet20;Ethernet21;Ethernet22;Ethernet23;Ethernet24;Ethernet25;Ethernet26;Ethernet27;Ethernet28;Ethernet29;Ethernet30;Ethernet31;Ethernet32;Ethernet33;Ethernet34;Ethernet35;Ethernet36;Ethernet37;Ethernet38;Ethernet39;Ethernet40;Ethernet41;Ethernet42;Ethernet43;Ethernet44;Ethernet45;Ethernet46;Ethernet47</AttachTo>
<NoDhcpRelay>False</NoDhcpRelay>
<StaticDHCPRelay>0.0.0.0/0</StaticDHCPRelay>
<Type i:nil="true"/>
<VlanID>2</VlanID>
<Tag>2</Tag>
<Subnets>172.0.0.0/26</Subnets>
</VlanInterface>
</VlanInterfaces>
<IPInterfaces>
<IPInterface>
<ElementType>IPInterface</ElementType>
<Name i:Name="true"/>
<AttachTo>Ethernet48</AttachTo>
<Prefix>10.0.0.0/31</Prefix>
</IPInterface>
<IPInterface>
<ElementType>IPInterface</ElementType>
<Name i:Name="true"/>
<AttachTo>Ethernet49</AttachTo>
<Prefix>10.0.0.4/31</Prefix>
</IPInterface>
<IPInterface>
<ElementType>IPInterface</ElementType>
<Name i:Name="true"/>
<AttachTo>Ethernet48</AttachTo>
<Prefix>FC00::1/126</Prefix>
</IPInterface>
<IPInterface>
<ElementType>IPInterface</ElementType>
<Name i:Name="true"/>
<AttachTo>Ethernet49</AttachTo>
<Prefix>FC00::9/126</Prefix>
</IPInterface>
<IPInterface>
<ElementType>IPInterface</ElementType>
<Name i:nil="true"/>
<AttachTo>Vlan2</AttachTo>
<Prefix>172.0.0.1/26</Prefix>
</IPInterface>
</IPInterfaces>
<DataAcls/>
<AclInterfaces/>
<DownstreamSummaries/>
<DownstreamSummarySet xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</DeviceDataPlaneInfo>
</DpgDec>
<PngDec>
<DeviceInterfaceLinks>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>10000</Bandwidth>
<EndDevice>ARISTA01T1</EndDevice>
<EndPort>Ethernet1</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>sonic</StartDevice>
<StartPort>Ethernet48</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>10000</Bandwidth>
<EndDevice>ARISTA02T1</EndDevice>
<EndPort>Ethernet1</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>sonic</StartDevice>
<StartPort>Ethernet49</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet0</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-01</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet1</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-02</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet2</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-03</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet3</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-04</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet4</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-05</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet5</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-06</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet6</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-07</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet7</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-08</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet8</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-09</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet9</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-10</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet10</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-11</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet11</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-12</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet12</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-13</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet13</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-14</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet14</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-15</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet15</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-16</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet16</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-17</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet17</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-18</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet18</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-19</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet19</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-20</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet20</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-21</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet21</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-22</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet22</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-23</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet23</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-24</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet24</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-25</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet25</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-26</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet26</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-27</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet27</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-28</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet28</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-29</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet29</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-30</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet30</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-31</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet31</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-32</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet32</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-33</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet33</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-34</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet34</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-35</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet35</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-36</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet36</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-37</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet37</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-38</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet38</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-39</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet39</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-40</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet40</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-41</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet41</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-42</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet42</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-43</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet43</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-44</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet44</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-45</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet45</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-46</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet46</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-47</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
<DeviceLinkBase i:type="DeviceInterfaceLink">
<ElementType>DeviceInterfaceLink</ElementType>
<AutoNegotiation>true</AutoNegotiation>
<Bandwidth>1000</Bandwidth>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet47</EndPort>
<FlowControl>true</FlowControl>
<StartDevice>server-48</StartDevice>
<StartPort>0</StartPort>
</DeviceLinkBase>
</DeviceInterfaceLinks>
<Devices>
<Device i:type="ToRRouter">
<Hostname>sonic</Hostname>
<HwSku>Delta-et-6248brb</HwSku>
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
<a:IPPrefix>10.251.0.243</a:IPPrefix>
</ManagementAddress>
</Device>
</Devices>
</PngDec>
<Hostname>sonic</Hostname>
<HwSku>Delta-et-6248brb</HwSku>
</DeviceMiniGraph>

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python
#############################################################################
# Mellanox
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################
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/devices/pci0000:00/0000:00:13.0/i2c-1/1-0054/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,55 @@
import os.path
try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError (str(e) + "- required module not found")
class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
def __init__(self):
PsuBase.__init__(self)
self.psu_path = "/sys/devices/platform/delta-et6248brb-gpio.0/PSU/psu{}_pg"
self.psu_oper_status = "in1_input"
self.psu_presence = "/sys/devices/platform/delta-et6248brb-gpio.0/PSU/psu{}_pres"
def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device
:return: An integer, the number of PSUs available on the device
"""
return 2
def get_psu_status(self, index):
if index is None:
return False
try:
reg_file = open(self.psu_path.format(index))
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
if int(reg_file.readline()) == 1:
return True
return False
def get_psu_presence(self, index):
if index is None:
return False
try:
reg_file = open(self.psu_presence.format(index))
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
if int(reg_file.readline()) == 0:
return True
return False

View File

@ -0,0 +1,88 @@
# 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 = 48
PORT_END = 49
PORTS_IN_BLOCK = 1
EEPROM_OFFSET = 44
_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)
@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):
if x >= self.port_start and x <= self.port_end:
self._port_to_eeprom_mapping[x] = eeprom_path.format(x - self.EEPROM_OFFSET)
else:
self._port_to_eeprom_mapping[x] = eeprom_path.format(x - x)
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
presence_path = "/sys/devices/platform/delta-et6248brb-gpio.0/SFP/sfp_mod_p{}"
try:
reg_file = open(presence_path.format(port_num - 47))
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
if int(reg_file.readline()) == 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
return False
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
return False
def reset(self, port_num):
# Check for invalid port_num
if port_num < self.port_start or port_num > self.port_end:
return False
return False

View File

@ -0,0 +1,15 @@
# libsensors configuration file for et-6248brb
# ------------------------------------------------
chip "tmp75-i2c-0-48"
label temp1 "0-0048 thermal sensor"
chip "tmp75-i2c-7-49"
label temp1 "7-0048 thermal sensor"
chip "tmp75-i2c-8-4a"
label temp1 "8-004a thermal sensor"
chip "adt7473-i2c-0-2e"
label fan1 "FANTRAY 1"
label fan2 "FANTRAY 2"

View File

@ -0,0 +1,23 @@
# name lanes
Ethernet0 0
Ethernet4 4
Ethernet8 8
Ethernet12 12
Ethernet16 16
Ethernet20 20
Ethernet24 24
Ethernet28 28
Ethernet32 32
Ethernet36 36
Ethernet40 40
Ethernet44 44
Ethernet48 48
Ethernet52 52
Ethernet56 56
Ethernet60 60
Ethernet64 64
Ethernet68 68
Ethernet72 72,73,74,75
Ethernet76 76,77,78,79
Ethernet80 80,81,82,83
Ethernet84 84,85,86,87

View File

@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sai_2010.xml

View File

@ -0,0 +1 @@
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="acpi_enforce_resources=lax acpi=noirq"

View File

@ -0,0 +1,855 @@
<DeviceMiniGraph xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="Microsoft.Search.Autopilot.Evolution">
<CpgDec>
<IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
<PeeringSessions>
<BGPSession>
<StartRouter>ARISTA01T0</StartRouter>
<StartPeer>10.0.0.33</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.32</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.0</StartPeer>
<EndRouter>ARISTA01T2</EndRouter>
<EndPeer>10.0.0.1</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA02T0</StartRouter>
<StartPeer>10.0.0.35</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.34</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.2</StartPeer>
<EndRouter>ARISTA02T2</EndRouter>
<EndPeer>10.0.0.3</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA03T0</StartRouter>
<StartPeer>10.0.0.37</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.36</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.4</StartPeer>
<EndRouter>ARISTA03T2</EndRouter>
<EndPeer>10.0.0.5</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA04T0</StartRouter>
<StartPeer>10.0.0.39</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.38</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.6</StartPeer>
<EndRouter>ARISTA04T2</EndRouter>
<EndPeer>10.0.0.7</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA05T0</StartRouter>
<StartPeer>10.0.0.41</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.40</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.8</StartPeer>
<EndRouter>ARISTA05T2</EndRouter>
<EndPeer>10.0.0.9</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA06T0</StartRouter>
<StartPeer>10.0.0.43</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.42</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.10</StartPeer>
<EndRouter>ARISTA06T2</EndRouter>
<EndPeer>10.0.0.11</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA07T0</StartRouter>
<StartPeer>10.0.0.45</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.44</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.12</StartPeer>
<EndRouter>ARISTA07T2</EndRouter>
<EndPeer>10.0.0.13</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA08T0</StartRouter>
<StartPeer>10.0.0.47</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.46</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.14</StartPeer>
<EndRouter>ARISTA08T2</EndRouter>
<EndPeer>10.0.0.15</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA09T0</StartRouter>
<StartPeer>10.0.0.49</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.48</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.16</StartPeer>
<EndRouter>ARISTA09T2</EndRouter>
<EndPeer>10.0.0.17</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA10T0</StartRouter>
<StartPeer>10.0.0.51</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.50</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.18</StartPeer>
<EndRouter>ARISTA10T2</EndRouter>
<EndPeer>10.0.0.19</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA11T0</StartRouter>
<StartPeer>10.0.0.53</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.52</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.20</StartPeer>
<EndRouter>ARISTA11T2</EndRouter>
<EndPeer>10.0.0.21</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA12T0</StartRouter>
<StartPeer>10.0.0.55</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.54</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.22</StartPeer>
<EndRouter>ARISTA12T2</EndRouter>
<EndPeer>10.0.0.23</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA13T0</StartRouter>
<StartPeer>10.0.0.57</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.56</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.24</StartPeer>
<EndRouter>ARISTA13T2</EndRouter>
<EndPeer>10.0.0.25</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA14T0</StartRouter>
<StartPeer>10.0.0.59</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.58</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.26</StartPeer>
<EndRouter>ARISTA14T2</EndRouter>
<EndPeer>10.0.0.27</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA15T0</StartRouter>
<StartPeer>10.0.0.61</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.60</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.28</StartPeer>
<EndRouter>ARISTA15T2</EndRouter>
<EndPeer>10.0.0.29</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>ARISTA16T0</StartRouter>
<StartPeer>10.0.0.63</StartPeer>
<EndRouter>sonic</EndRouter>
<EndPeer>10.0.0.62</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>sonic</StartRouter>
<StartPeer>10.0.0.30</StartPeer>
<EndRouter>ARISTA16T2</EndRouter>
<EndPeer>10.0.0.31</EndPeer>
<Multihop>1</Multihop>
<HoldTime>180</HoldTime>
<KeepAliveTime>60</KeepAliveTime>
</BGPSession>
</PeeringSessions>
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:BGPRouterDeclaration>
<a:ASN>65100</a:ASN>
<a:Hostname>sonic</a:Hostname>
<a:Peers>
<BGPPeer>
<Address>10.0.0.33</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.1</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.35</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.3</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.37</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.5</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.39</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.7</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.41</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.9</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.43</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.11</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.45</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.13</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.47</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.15</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.49</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.17</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.51</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.19</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.53</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.21</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.55</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.23</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.57</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.25</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.59</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.27</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.61</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.29</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.63</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
<BGPPeer>
<Address>10.0.0.31</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
</BGPPeer>
</a:Peers>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64001</a:ASN>
<a:Hostname>ARISTA01T0</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>65200</a:ASN>
<a:Hostname>ARISTA01T2</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64002</a:ASN>
<a:Hostname>ARISTA02T0</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>65200</a:ASN>
<a:Hostname>ARISTA02T2</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64003</a:ASN>
<a:Hostname>ARISTA03T0</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>65200</a:ASN>
<a:Hostname>ARISTA03T2</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64004</a:ASN>
<a:Hostname>ARISTA04T0</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>65200</a:ASN>
<a:Hostname>ARISTA04T2</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64005</a:ASN>
<a:Hostname>ARISTA05T0</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>65200</a:ASN>
<a:Hostname>ARISTA05T2</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
<a:BGPRouterDeclaration>
<a:ASN>64006</a:ASN>
<a:Hostname>ARISTA06T0</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
</Routers>
</CpgDec>
<DpgDec>
<DeviceDataPlaneInfo>
<IPSecTunnels/>
<LoopbackIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:LoopbackIPInterface>
<Name>HostIP</Name>
<AttachTo>Loopback0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>10.1.0.32/32</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>10.1.0.32/32</a:PrefixStr>
</a:LoopbackIPInterface>
</LoopbackIPInterfaces>
<ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
</ManagementIPInterfaces>
<MplsInterfaces/>
<MplsTeInterfaces/>
<RsvpInterfaces/>
<Hostname>sonic</Hostname>
<PortChannelInterfaces/>
<VlanInterfaces/>
<IPInterfaces>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet0</AttachTo>
<Prefix>10.0.0.0/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet4</AttachTo>
<Prefix>10.0.0.2/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet8</AttachTo>
<Prefix>10.0.0.4/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet12</AttachTo>
<Prefix>10.0.0.6/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet16</AttachTo>
<Prefix>10.0.0.8/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet20</AttachTo>
<Prefix>10.0.0.10/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet24</AttachTo>
<Prefix>10.0.0.12/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet28</AttachTo>
<Prefix>10.0.0.14/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet32</AttachTo>
<Prefix>10.0.0.16/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet36</AttachTo>
<Prefix>10.0.0.18/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet40</AttachTo>
<Prefix>10.0.0.20/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet44</AttachTo>
<Prefix>10.0.0.22/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet48</AttachTo>
<Prefix>10.0.0.24/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet52</AttachTo>
<Prefix>10.0.0.26/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet56</AttachTo>
<Prefix>10.0.0.28/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet60</AttachTo>
<Prefix>10.0.0.30/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet64</AttachTo>
<Prefix>10.0.0.32/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet68</AttachTo>
<Prefix>10.0.0.34/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet72</AttachTo>
<Prefix>10.0.0.36/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet76</AttachTo>
<Prefix>10.0.0.38/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet80</AttachTo>
<Prefix>10.0.0.40/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>Ethernet84</AttachTo>
<Prefix>10.0.0.42/31</Prefix>
</IPInterface>
</IPInterfaces>
<DataAcls/>
<AclInterfaces/>
<DownstreamSummaries/>
<DownstreamSummarySet xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</DeviceDataPlaneInfo>
</DpgDec>
<PngDec>
<DeviceInterfaceLinks>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet0</EndPort>
<StartDevice>ARISTA01T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet4</EndPort>
<StartDevice>ARISTA02T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet8</EndPort>
<StartDevice>ARISTA03T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet12</EndPort>
<StartDevice>ARISTA04T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet16</EndPort>
<StartDevice>ARISTA05T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet20</EndPort>
<StartDevice>ARISTA06T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet24</EndPort>
<StartDevice>ARISTA07T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet28</EndPort>
<StartDevice>ARISTA08T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet32</EndPort>
<StartDevice>ARISTA09T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet36</EndPort>
<StartDevice>ARISTA10T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet40</EndPort>
<StartDevice>ARISTA11T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet44</EndPort>
<StartDevice>ARISTA12T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet48</EndPort>
<StartDevice>ARISTA13T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet52</EndPort>
<StartDevice>ARISTA14T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet56</EndPort>
<StartDevice>ARISTA15T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet60</EndPort>
<StartDevice>ARISTA16T2</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet64</EndPort>
<StartDevice>ARISTA01T0</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet68</EndPort>
<StartDevice>ARISTA02T0</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet72</EndPort>
<StartDevice>ARISTA03T0</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet76</EndPort>
<StartDevice>ARISTA04T0</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet80</EndPort>
<StartDevice>ARISTA05T0</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>sonic</EndDevice>
<EndPort>Ethernet84</EndPort>
<StartDevice>ARISTA06T0</StartDevice>
<StartPort>Ethernet1</StartPort>
</DeviceLinkBase>
</DeviceInterfaceLinks>
<Devices>
<Device i:type="LeafRouter">
<Hostname>sonic</Hostname>
<HwSku>ACS-MSN2010</HwSku>
</Device>
</Devices>
</PngDec>
<MetadataDeclaration>
<Devices xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:DeviceMetadata>
<a:Name>sonic</a:Name>
<a:Properties>
<a:DeviceProperty>
<a:Name>DhcpResources</a:Name>
<a:Reference i:nil="true"/>
<a:Value></a:Value>
</a:DeviceProperty>
<a:DeviceProperty>
<a:Name>NtpResources</a:Name>
<a:Reference i:nil="true"/>
<a:Value>0.debian.pool.ntp.org;1.debian.pool.ntp.org;2.debian.pool.ntp.org;3.debian.pool.ntp.org</a:Value>
</a:DeviceProperty>
<a:DeviceProperty>
<a:Name>SyslogResources</a:Name>
<a:Reference i:nil="true"/>
<a:Value></a:Value>
</a:DeviceProperty>
<a:DeviceProperty>
<a:Name>ErspanDestinationIpv4</a:Name>
<a:Reference i:nil="true"/>
<a:Value>2.2.2.2</a:Value>
</a:DeviceProperty>
</a:Properties>
</a:DeviceMetadata>
</Devices>
<Properties xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</MetadataDeclaration>
<Hostname>sonic</Hostname>
<HwSku>ACS-MSN2010</HwSku>
</DeviceMiniGraph>

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python
#############################################################################
# Mellanox
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################
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 = "/bsp/eeprom/vpd_info"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -0,0 +1,73 @@
#!/usr/bin/env python
#############################################################################
# Mellanox
#
# Module contains an implementation of SONiC PSU Base API and
# provides the PSUs status which are available in the platform
#
#############################################################################
import os.path
try:
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError (str(e) + "- required module not found")
class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
def __init__(self):
PsuBase.__init__(self)
self.psu_path = "/bsp/module/"
self.psu_presence = "psu{}_pwr_status"
self.psu_oper_status = "psu{}_pwr_status"
def get_num_psus(self):
"""
Retrieves the number of PSUs available on the device
:return: An integer, the number of PSUs available on the device
"""
return 2
def get_psu_status(self, index):
"""
Retrieves the oprational status of power supply unit (PSU) defined
by 1-based index <index>
:param index: An integer, 1-based index of the PSU of which to query status
:return: Boolean, True if PSU is operating properly, False if PSU is faulty
"""
if index is None:
return False
status = 0
try:
with open(self.psu_path + self.psu_oper_status.format(index), 'r') as power_status:
status = int(power_status.read())
except IOError:
return False
return status == 1
def get_psu_presence(self, index):
"""
Retrieves the presence status of power supply unit (PSU) defined
by 1-based index <index>
:param index: An integer, 1-based index of the PSU of which to query status
:return: Boolean, True if PSU is plugged, False if not
"""
if index is None:
return False
try:
with open(self.psu_path + self.psu_presence.format(index), 'r') as presence_status:
return True
except IOError:
return False
return False

View File

@ -0,0 +1,43 @@
#!/usr/bin/env python
import sys, errno
import os
from python_sdk_api.sxd_api import *
from python_sdk_api.sx_api import *
# Check if SFP port number is provided
if len(sys.argv) < 2:
print "SFP module number is missed."
print "Usage: sfplpmget.py <SFP module>"
sys.exit(errno.EINVAL)
# Init SDK API
rc, handle = sx_api_open(None)
if (rc != SX_STATUS_SUCCESS):
print "Failed to open api handle.\nPlease check that SDK is running."
sys.exit(errno.EACCES)
pid = os.getpid()
rc = sxd_access_reg_init(pid, None, 0)
if (rc != 0):
print "Failed to initializing register access.\nPlease check that SDK is running."
sys.exit(errno.EACCES)
# Get SFP module number
sfp_module = int(sys.argv[1])
# Get MCION
mcion = ku_mcion_reg()
mcion.module = sfp_module
meta = sxd_reg_meta_t()
meta.dev_id = 1
meta.swid = 0
meta.access_cmd = SXD_ACCESS_CMD_GET
rc = sxd_access_reg_mcion(mcion, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_mcion failed, rc = %d" % rc
# Get low power mode status
lpm_mask = 1 << 8
lpm_status = (lpm_mask & mcion.module_status_bits) != 0
print "LPM ON" if lpm_status else "LPM OFF"

View File

@ -0,0 +1,107 @@
#!/usr/bin/env python
import sys, errno
import time
import os
from python_sdk_api.sxd_api import *
from python_sdk_api.sx_api import *
def get_log_ports(handle, sfp_module):
port_attributes_list = new_sx_port_attributes_t_arr(64)
port_cnt_p = new_uint32_t_p()
uint32_t_p_assign(port_cnt_p, 64)
rc = sx_api_port_device_get(handle, 1 , 0, port_attributes_list, port_cnt_p)
assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc
port_cnt = uint32_t_p_value(port_cnt_p)
log_port_list = []
for i in range(0, port_cnt):
port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list, i)
if port_attributes.port_mapping.module_port == sfp_module:
log_port_list.append(port_attributes.log_port)
return log_port_list
def set_sfp_admin_status(handle, meta, sfp_module, sfp_log_port_list, admin_status):
# Get PMAOS
pmaos = ku_pmaos_reg()
pmaos.module = sfp_module
meta.access_cmd = SXD_ACCESS_CMD_GET
rc = sxd_access_reg_pmaos(pmaos, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_pmaos failed, rc = %d" % rc
# Set admin status to PMAOS
pmaos.ase = 1
pmaos.ee = 1
pmaos.e = 2
pmaos.rst = 0
if admin_status == SX_PORT_ADMIN_STATUS_DOWN:
pmaos.admin_status = 2
else:
pmaos.admin_status = 1
meta.access_cmd = SXD_ACCESS_CMD_SET
rc = sxd_access_reg_pmaos(pmaos, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_pmaos failed, rc = %d" % rc
# Check if SFP port number is provided
if len(sys.argv) < 3:
print "SFP module number or LPM is missed."
print "Usage: sfplpmset.py <SFP module> <on|off>"
sys.exit(errno.EINVAL)
lpm_enable = None
if sys.argv[2] == 'on':
lpm_enable = True
elif sys.argv[2] == 'off':
lpm_enable = False
else:
print "Unrecognized LPM parameter. Please use <on> or <off> values"
sys.exit(errno.EINVAL)
# Init SDK API
rc, handle = sx_api_open(None)
if (rc != SX_STATUS_SUCCESS):
print "Failed to open api handle.\nPlease check that SDK is running."
sys.exit(errno.EACCES)
pid = os.getpid()
rc = sxd_access_reg_init(pid, None, 0)
if (rc != 0):
print "Failed to initializing register access.\nPlease check that SDK is running."
sys.exit(errno.EACCES);
# Get SFP module and log ports number and LPM status
sfp_module = int(sys.argv[1])
log_port_list = get_log_ports(handle, sfp_module)
if not log_port_list:
print "Failed to get log ports"
sys.exit(errno.EACCES)
# Get PMMP
pmmp = ku_pmmp_reg()
pmmp.module = sfp_module
meta = sxd_reg_meta_t()
meta.dev_id = 1
meta.swid = 0
meta.access_cmd = SXD_ACCESS_CMD_GET
rc = sxd_access_reg_pmmp(pmmp, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_pmmp failed, rc = %d" % rc
# Disable admin status before LPM settings
set_sfp_admin_status(handle, meta, sfp_module, log_port_list, SX_PORT_ADMIN_STATUS_DOWN)
# Set low power mode status
lpm_mask = 1 << 8
if lpm_enable:
pmmp.eeprom_override = pmmp.eeprom_override | lpm_mask
else:
pmmp.eeprom_override = pmmp.eeprom_override & (~lpm_mask)
meta.access_cmd = SXD_ACCESS_CMD_SET
rc = sxd_access_reg_pmmp(pmmp, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_pmmp failed, rc = %d" % rc
# Enable admin status after LPM settings
set_sfp_admin_status(handle, meta, sfp_module, log_port_list, SX_PORT_ADMIN_STATUS_UP)

View File

@ -0,0 +1,45 @@
#!/usr/bin/env python
import sys, errno
import os
from python_sdk_api.sxd_api import *
from python_sdk_api.sx_api import *
# Check if SFP port number is provided
if len(sys.argv) < 2:
print "SFP module number or LPM is missed."
print "Usage: sfpreset.py <SFP module>"
sys.exit(errno.EINVAL)
# Init SDK API
rc, handle = sx_api_open(None)
if (rc != SX_STATUS_SUCCESS):
print "Failed to open api handle.\nPlease check that SDK is running."
sys.exit(errno.EACCES)
pid = os.getpid()
rc = sxd_access_reg_init(pid, None, 0)
if (rc != 0):
print "Failed to initializing register access.\nPlease check that SDK is running."
sys.exit(errno.EACCES)
# Get SFP module number
sfp_module = int(sys.argv[1])
# Get PMAOS
pmaos = ku_pmaos_reg()
pmaos.module = sfp_module
meta = sxd_reg_meta_t()
meta.dev_id = 1
meta.swid = 0
meta.access_cmd = SXD_ACCESS_CMD_GET
rc = sxd_access_reg_pmaos(pmaos, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_pmaos failed, rc = %d" % rc
# Reset SFP
pmaos.rst = 1
meta.access_cmd = SXD_ACCESS_CMD_SET
rc = sxd_access_reg_pmaos(pmaos, meta, 1, None, None)
assert rc == SXD_STATUS_SUCCESS, "sxd_access_reg_pmaos failed, rc = %d" % rc
print "Reset flag is set"

View File

@ -0,0 +1,151 @@
# sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
try:
import time
import subprocess
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 = 55
PORTS_IN_BLOCK = 56
EEPROM_OFFSET = 1
_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 = "/bsp/qsfp/qsfp{0}"
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
try:
reg_file = open("/bsp/qsfp/qsfp%d_status" % (port_num+1))
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
content = reg_file.readline().rstrip()
# content is a string with the qsfp status
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
lpm_cmd = "docker exec syncd python /usr/share/sonic/platform/plugins/sfplpmget.py {}".format(port_num)
try:
output = subprocess.check_output(lpm_cmd, shell=True)
if 'LPM ON' in output:
return True
except subprocess.CalledProcessError as e:
print "Error! Unable to get LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output)
return False
return False
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
curr_lpmode = self.get_low_power_mode(port_num)
if curr_lpmode == lpmode:
return True
lpm = 'on' if lpmode else 'off'
lpm_cmd = "docker exec syncd python /usr/share/sonic/platform/plugins/sfplpmset.py {} {}".format(port_num, lpm)
sfp_port_names = self.physical_to_logical[port_num]
# Get port admin status
try:
enabled_ports = subprocess.check_output("ip link show up", shell=True)
except subprocess.CalledProcessError as e:
print "Error! Unable to get ports status, err msg: {}".format(e.output)
return False
port_to_disable = []
for port in sfp_port_names:
if port in enabled_ports:
port_to_disable.append(port)
# Disable ports before LPM settings
for port in port_to_disable:
try:
subprocess.check_output("ifconfig {} down".format(port), shell=True)
except subprocess.CalledProcessError as e:
print "Error! Unable to set admin status to DOWN for {}, rc = {}, err msg: {}".format(port, e.returncode, e.output)
return False
time.sleep(3)
# Set LPM
try:
subprocess.check_output(lpm_cmd, shell=True)
except subprocess.CalledProcessError as e:
print "Error! Unable to set LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output)
return False
# Enable ports after LPM settings
for port in port_to_disable:
try:
subprocess.check_output("ifconfig {} up".format(port), shell=True)
except subprocess.CalledProcessError as e:
print "Error! Unable to set admin status to UP for {}, rc = {}, err msg: {}".format(port, e.returncode, e.output)
return False
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
lpm_cmd = "docker exec syncd python /usr/share/sonic/platform/plugins/sfpreset.py {}".format(port_num)
try:
subprocess.check_output(lpm_cmd, shell=True)
return True
except subprocess.CalledProcessError as e:
print "Error! Unable to set LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output)
return False
return False

View File

@ -0,0 +1,19 @@
bus "i2c-2" "i2c-1-mux (chan_id 1)"
chip "mlxsw-i2c-2-48"
label temp1 "ASIC Temp"
bus "i2c-7" "i2c-1-mux (chan_id 6)"
chip "lm75-*"
label temp1 "Ambient Port Temp"
bus "i2c-5" "i2c-1-mux (chan_id 4)"
chip "tps53679-*"
label vin "TPS vin"
label vout1 "TPS vout1"
label vout2 "TPS vout2"
label temp1 "TPS Temp1"
label temp2 "TPS Temp2"
label pout1 "TPS pouti1"
label pout2 "TPS pout2"
label iout1 "TPS iout1"
label iout2 "TPS iout2"

View File

@ -1 +0,0 @@
/etc/mlnx/msn2100

View File

@ -28,5 +28,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder):
_TLV_INFO_MAX_LEN = 256
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/bsp/eeprom/sys_eeprom"
self.eeprom_path = "/bsp/eeprom/vpd_info"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -1 +0,0 @@
/etc/mlnx/msn2410

View File

@ -28,5 +28,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder):
_TLV_INFO_MAX_LEN = 256
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/bsp/eeprom/sys_eeprom"
self.eeprom_path = "/bsp/eeprom/vpd_info"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -1 +0,0 @@
/etc/mlnx/msn2700

View File

@ -28,5 +28,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder):
_TLV_INFO_MAX_LEN = 256
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/bsp/eeprom/sys_eeprom"
self.eeprom_path = "/bsp/eeprom/vpd_info"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -1 +0,0 @@
/etc/mlnx/msn2740

View File

@ -28,5 +28,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder):
_TLV_INFO_MAX_LEN = 256
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/bsp/eeprom/sys_eeprom"
self.eeprom_path = "/bsp/eeprom/vpd_info"
super(board, self).__init__(self.eeprom_path, 0, '', True)

View File

@ -10,7 +10,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
# Install required packages
RUN apt-get install -y python-pip libpython2.7 sensord fancontrol
RUN apt-get install -y python-pip libpython2.7 sensord fancontrol ipmitool
{% if docker_platform_monitor_debs.strip() -%}
# Copy locally-built Debian package dependencies

View File

@ -153,12 +153,12 @@ platform_specific() {
if [ "$platform" = "raven" ]; then
aboot_machine=arista_7050_qx32
flash_size=2000
echo "modprobe.blacklist=radeon" >>/tmp/append
echo "modprobe.blacklist=radeon,sp5100_tco acpi=off" >>/tmp/append
fi
if [ "$platform" = "crow" ]; then
aboot_machine=arista_7050_qx32s
flash_size=3700
echo "modprobe.blacklist=radeon" >>/tmp/append
echo "modprobe.blacklist=radeon,sp5100_tco" >>/tmp/append
fi
if [ "$sid" = "Upperlake" ] || [ "$sid" = "UpperlakeES" ]; then
aboot_machine=arista_7060_cx32s
@ -175,6 +175,8 @@ platform_specific() {
echo "hugepages=128" >> /tmp/append
fi
if [ "$platform" = "rook" ]; then
echo "iommu=on intel_iommu=on tsc=reliable pcie_ports=native" >>/tmp/append
echo "rhash_entries=1 usb-storage.delay_use=0" >>/tmp/append
if [ -x /bin/readprefdl ]; then
readprefdl -f /tmp/.system-prefdl -d > /mnt/flash/.system-prefdl
elif [ -f /etc/prefdl ]; then
@ -191,6 +193,8 @@ platform_specific() {
fi
echo "varlog_size=$varlog_size" >>/tmp/append
# disable deterministic interface naming
echo "net.ifnames=0" >>/tmp/append
}
get_uuid_for() {

View File

@ -1,8 +1,7 @@
## Debian mirror on Microsoft Azure
## Ref: http://debian-archive.trafficmanager.net/
deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free
deb-src http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free
deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free
deb-src http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free
deb http://debian-archive.trafficmanager.net/debian/ jessie-backports main contrib non-free
deb http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free
deb-src http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free
deb http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free
deb-src http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free

View File

@ -21,6 +21,17 @@ function postStartAction()
rm -fr /host/fast-reboot
fi
docker exec swss touch /ready # signal swssconfig.sh to go
{%- elif docker_container_name == "pmon" %}
DEVPATH="/usr/share/sonic/device"
REBOOT="platform_reboot"
PSENSOR="/usr/local/bin/platform_sensors.py"
if [ -d ${DEVPATH}/${PLATFORM} ] && [ -f $PSENSOR ]; then
exist=`docker exec -i pmon ls /usr/bin/platform_sensors.py "$@" 2>/dev/null`
if [ -z "$exist" ]; then
docker cp $PSENSOR pmon:/usr/bin/
fi
fi
{%- elif docker_container_name == "snmp" %}
docker exec -i database redis-cli -n 6 HSET 'DEVICE_METADATA|localhost' chassis_serial_number $(decode-syseeprom -s)
{%- else %}

View File

@ -42,7 +42,9 @@ clean_sys() {
trap_push clean_sys
sudo LANG=C chroot $FILESYSTEM_ROOT mount sysfs /sys -t sysfs
sudo bash -c "echo \"DOCKER_OPTS=\"--storage-driver=overlay\"\" >> $FILESYSTEM_ROOT/etc/default/docker"
sudo chroot $FILESYSTEM_ROOT service docker start
sudo chroot $FILESYSTEM_ROOT docker info
# Apply apt configuration files
sudo cp $IMAGE_CONFIGS/apt/sources.list $FILESYSTEM_ROOT/etc/apt/
@ -100,11 +102,6 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-click*_all.deb || \
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/python-sonic-utilities_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
# Install customized bash version to patch memory-leak issue. This instruction shall be removed
# once the migration to Debian-9 (Stretch) is completed.
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/bash_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
# SONiC utilities installs bash-completion as a dependency. However, it is disabled by default
# in bash.bashrc, so we copy a version of the file with it enabled here.
sudo cp -f $IMAGE_CONFIGS/bash/bash.bashrc $FILESYSTEM_ROOT/etc/
@ -114,9 +111,12 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/sonic-device-data_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
# Install pam-tacplus and nss-tacplus
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libtac2_*.deb
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libpam-tacplus_*.deb
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libnss-tacplus_*.deb
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libtac2_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libpam-tacplus_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo dpkg --root=$FILESYSTEM_ROOT -i target/debs/libnss-tacplus_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
# Disable tacplus by default
sudo LANG=C chroot $FILESYSTEM_ROOT pam-auth-update --remove tacplus
sudo sed -i -e '/^passwd/s/ tacplus//' $FILESYSTEM_ROOT/etc/nsswitch.conf

View File

@ -2,16 +2,16 @@
Description=switch state service
Requires=database.service updategraph.service
{% if sonic_asic_platform == 'broadcom' %}
Requires=opennsl-modules-3.16.0-5-amd64.service
Requires=opennsl-modules-4.9.0-5-amd64.service
{% elif sonic_asic_platform == 'nephos' %}
Requires=nps-modules-3.16.0-5-amd64.service
Requires=nps-modules-4.9.0-5-amd64.service
{% endif %}
After=database.service updategraph.service
After=interfaces-config.service
{% if sonic_asic_platform == 'broadcom' %}
After=opennsl-modules-3.16.0-5-amd64.service
After=opennsl-modules-4.9.0-5-amd64.service
{% elif sonic_asic_platform == 'nephos' %}
After=nps-modules-3.16.0-5-amd64.service
After=nps-modules-4.9.0-5-amd64.service
{% endif %}
[Service]
@ -31,7 +31,7 @@ ExecStartPre=/usr/bin/mst start
ExecStartPre=/usr/bin/mlnx-fw-upgrade.sh
ExecStartPre=/etc/init.d/sxdkernel start
ExecStartPre=/sbin/modprobe i2c-dev
ExecStartPre=/bin/bash -c "/usr/share/sonic/device/$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)/hw-management start"
ExecStartPre=/bin/bash -c "/etc/mlnx/mlnx-hw-management start"
{% elif sonic_asic_platform == 'cavium' %}
ExecStartPre=/etc/init.d/xpnet.sh start
{% endif %}
@ -44,7 +44,7 @@ ExecStop=/usr/bin/{{docker_container_name}}.sh stop
ExecStopPost=/usr/bin/syncd.sh stop
{% if sonic_asic_platform == 'mellanox' %}
ExecStopPost=/bin/bash -c "/usr/share/sonic/device/$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)/hw-management stop"
ExecStartPre=/bin/bash -c "/etc/mlnx/mlnx-hw-management stop"
ExecStopPost=/etc/init.d/sxdkernel stop
ExecStopPost=/usr/bin/mst stop
{% elif sonic_asic_platform == 'cavium' %}

View File

@ -1,3 +1,3 @@
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=aufs --bip=240.127.1.1/24 --iptables=false
ExecStart=/usr/bin/docker daemon -H fd:// --storage-driver=overlay --bip=240.127.1.1/24 --iptables=false

View File

@ -1,3 +1,2 @@
deb http://debian-archive.trafficmanager.net/debian/ jessie main contrib non-free
deb http://debian-archive.trafficmanager.net/debian-security/ jessie/updates main contrib non-free
deb http://debian-archive.trafficmanager.net/debian/ jessie-backports main contrib non-free
deb http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free
deb http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free

View File

@ -41,6 +41,9 @@ get_flash_dev() {
wait_for_root_dev() {
local try_rounds=30
while [ $try_rounds -gt 0 ]; do
if blkid | sed 's/"//g' | grep -q "$root_dev"; then
return 0
fi
if [ -e "$root_dev" ]; then
return 0
fi

View File

@ -1,5 +1,6 @@
squashfs
aufs
overlay
vfat
nls_ascii
nls_cp437
nls_utf8

View File

@ -0,0 +1,10 @@
--- a/udev 2017-09-02 23:13:45.078773236 +0000
+++ b/udev 2017-09-02 22:40:08.502773236 +0000
@@ -1,6 +1,6 @@
#!/bin/sh -e
-PREREQS=""
+PREREQS="union-mount"
prereqs() { echo "$PREREQS"; }

View File

@ -11,18 +11,19 @@ case $1 in
;;
esac
## Mount the aufs file system: rw layer over squashfs
## Mount the overlay file system: rw layer over squashfs
image_dir=$(cat /proc/cmdline | sed -e 's/.*loop=\(\S*\)\/.*/\1/')
mkdir -p ${rootmnt}/host/$image_dir/rw
mount -n -o dirs=${rootmnt}/host/$image_dir/rw:${rootmnt}=ro -t aufs root-aufs ${rootmnt}
mkdir -p ${rootmnt}/host/$image_dir/work
mount -n -o lowerdir=${rootmnt},upperdir=${rootmnt}/host/$image_dir/rw,workdir=${rootmnt}/host/$image_dir/work -t overlay root-overlay ${rootmnt}
## Check if the root block device is still there
[ -b ${ROOT} ] || mdev -s
## Mount the raw partition again
mount ${ROOT} ${rootmnt}/host
## Mount the working directory of docker engine in the raw partition, bypass the aufs
## Mount the working directory of docker engine in the raw partition, bypass the overlay
mkdir -p ${rootmnt}/var/lib/docker
mount --bind ${rootmnt}/host/$image_dir/{{ DOCKERFS_DIR }} ${rootmnt}/var/lib/docker
## Mount the boot directory in the raw partition, bypass the aufs
## Mount the boot directory in the raw partition, bypass the overlay
mkdir -p ${rootmnt}/boot
mount --bind ${rootmnt}/host/$image_dir/boot ${rootmnt}/boot
## Mount loop device for /var/log

View File

@ -1,6 +1,6 @@
#!/bin/bash
[ -r /etc/ssh/ssh_host_key ] || {
[ -r /etc/ssh/ssh_host_rsa_key ] || {
rm -f /etc/ssh/ssh_host_*_key*
/usr/bin/ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key
/usr/bin/ssh-keygen -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key

View File

@ -570,11 +570,12 @@ menuentry '$demo_grub_entry' {
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
linux /$image_dir/boot/vmlinuz-3.16.0-5-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \
linux /$image_dir/boot/vmlinuz-4.9.0-5-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \
net.ifnames=0 biosdevname=0 \
loop=$image_dir/$FILESYSTEM_SQUASHFS loopfstype=squashfs \
apparmor=1 security=apparmor varlog_size=$VAR_LOG_SIZE usbcore.autosuspend=-1 $ONIE_PLATFORM_EXTRA_CMDLINE_LINUX
echo 'Loading $demo_volume_label $demo_type initial ramdisk ...'
initrd /$image_dir/boot/initrd.img-3.16.0-5-amd64
initrd /$image_dir/boot/initrd.img-4.9.0-5-amd64
}
EOF

View File

@ -21,3 +21,5 @@ $(eval $(call add_extra_package,$(ARISTA_PLATFORM_MODULE),$(ARISTA_PLATFORM_MODU
export ARISTA_PLATFORM_MODULE ARISTA_PLATFORM_MODULE_PYTHON2 ARISTA_PLATFORM_MODULE_PYTHON3 ARISTA_PLATFORM_MODULE_DRIVERS
export ARISTA_SCD_DRIVER_CONFIG=m
SONIC_STRETCH_DEBS += $(ARISTA_PLATFORM_MODULE)

View File

@ -9,3 +9,5 @@ $(BFN_MONTARA_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-module
$(BFN_MONTARA_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(BFN_MONTARA_PLATFORM_MODULE)_PLATFORM = x86_64-accton_wedge100bf_32x-r0
SONIC_DPKG_DEBS += $(BFN_MONTARA_PLATFORM_MODULE)
# SONIC_STRETCH_DEBS += $(BFN_MONTARA_PLATFORM_MODULE)

View File

@ -16,3 +16,5 @@ INGRASYS_S9280_64X_PLATFORM_MODULE = sonic-platform-ingrasys-s9280-64x_$(INGRASY
$(INGRASYS_S9280_64X_PLATFORM_MODULE)_PLATFORM = x86_64-ingrasys_s9280_64x-r0
$(eval $(call add_extra_package,$(INGRASYS_S9180_32X_PLATFORM_MODULE),$(INGRASYS_S9280_64X_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(INGRASYS_S9180_32X_PLATFORM_MODULE)

View File

@ -9,3 +9,5 @@ $(WNC_OSW1800_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-module
$(WNC_OSW1800_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(WNC_OSW1800_PLATFORM_MODULE)_PLATFORM = x86_64-wnc_osw1800-r0
SONIC_DPKG_DEBS += $(WNC_OSW1800_PLATFORM_MODULE)
# SONIC_STRETCH_DEBS += $(WNC_OSW1800_PLATFORM_MODULE)

@ -1 +1 @@
Subproject commit 8f65ad92c5b5dfec24e8faf068cc9d2374244edf
Subproject commit a4d1d8d2737cf49bd6cc802dbc6c8c0ff682fa87

View File

@ -20,7 +20,7 @@ debs/{{ deb }}{{' '}}
{%- endfor %}
## TODO: add kmod into Depends
RUN apt-get install -f kmod
RUN apt-get install -yf kmod
COPY ["files/dsserve", "files/bcmcmd", "start.sh", "bcmsh", "/usr/bin/"]
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd

View File

@ -5,6 +5,7 @@ $(SONIC_ONE_IMAGE)_MACHINE = broadcom
$(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie
$(SONIC_ONE_IMAGE)_INSTALLS += $(BRCM_OPENNSL_KERNEL)
$(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(DELL_Z9264F_PLATFORM_MODULE) \
$(DELL_Z9100_PLATFORM_MODULE) \
$(DELL_S6100_PLATFORM_MODULE) \
$(INGRASYS_S8900_54XC_PLATFORM_MODULE) \
@ -22,9 +23,11 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(INVENTEC_D7032Q28B_PLATFORM_MODULE) \
$(INVENTEC_D7054Q28B_PLATFORM_MODULE) \
$(CEL_DX010_PLATFORM_MODULE) \
$(CEL_HALIBURTON_PLATFORM_MODULE) \
$(DELTA_AG9032V1_PLATFORM_MODULE) \
$(DELTA_AG9064_PLATFORM_MODULE) \
$(DELTA_AG5648_PLATFORM_MODULE) \
$(DELTA_ET6248BRB_PLATFORM_MODULE) \
$(QUANTA_IX1B_32X_PLATFORM_MODULE) \
$(MITAC_LY1200_32X_PLATFORM_MODULE)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES)

View File

@ -46,3 +46,4 @@ ACCTON_AS7716_32XB_PLATFORM_MODULE = sonic-platform-accton-as7716-32xb_$(ACCTON_
$(ACCTON_AS7716_32XB_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as7716_32xb-r0
$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS7716_32XB_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(ACCTON_AS7712_32X_PLATFORM_MODULE)

View File

@ -21,3 +21,7 @@ $(eval $(call add_extra_package,$(ARISTA_PLATFORM_MODULE),$(ARISTA_PLATFORM_MODU
export ARISTA_PLATFORM_MODULE ARISTA_PLATFORM_MODULE_PYTHON2 ARISTA_PLATFORM_MODULE_PYTHON3 ARISTA_PLATFORM_MODULE_DRIVERS
export ARISTA_SCD_DRIVER_CONFIG=m
SONIC_STRETCH_DEBS += $(ARISTA_PLATFORM_MODULE)
export ARISTA_SCD_DRIVER_CONFIG=m

View File

@ -1,11 +1,19 @@
# Celestica DX010 Platform modules
# Celestica DX010 and Haliburton Platform modules
CEL_DX010_PLATFORM_MODULE_VERSION = 0.8
CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.8
export CEL_DX010_PLATFORM_MODULE_VERSION
export CEL_HALIBURTON_PLATFORM_MODULE_VERSION
CEL_DX010_PLATFORM_MODULE = platform-modules-dx010_$(CEL_DX010_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_DX010_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-cel
$(CEL_DX010_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(CEL_DX010_PLATFORM_MODULE)_PLATFORM = x86_64-cel_seastone-r0
SONIC_DPKG_DEBS += $(CEL_DX010_PLATFORM_MODULE)
CEL_HALIBURTON_PLATFORM_MODULE = platform-modules-haliburton_$(CEL_HALIBURTON_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_HALIBURTON_PLATFORM_MODULE)_PLATFORM = x86_64-cel_e1031-r0
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_HALIBURTON_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(CEL_DX010_PLATFORM_MODULE)

View File

@ -1,8 +1,10 @@
# Dell Z9100 and S6100 Platform modules
# Dell Z9100, S6100, Z9264F Platform modules
DELL_Z9264F_PLATFORM_MODULE_VERSION = 1.1
DELL_Z9100_PLATFORM_MODULE_VERSION = 1.1
DELL_S6100_PLATFORM_MODULE_VERSION = 1.1
export DELL_Z9264F_PLATFORM_MODULE_VERSION
export DELL_Z9100_PLATFORM_MODULE_VERSION
export DELL_S6100_PLATFORM_MODULE_VERSION
@ -15,3 +17,10 @@ SONIC_DPKG_DEBS += $(DELL_Z9100_PLATFORM_MODULE)
DELL_S6100_PLATFORM_MODULE = platform-modules-s6100_$(DELL_S6100_PLATFORM_MODULE_VERSION)_amd64.deb
$(DELL_S6100_PLATFORM_MODULE)_PLATFORM = x86_64-dell_s6100_c2538-r0
$(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_S6100_PLATFORM_MODULE)))
DELL_Z9264F_PLATFORM_MODULE = platform-modules-z9264f_$(DELL_Z9264F_PLATFORM_MODULE_VERSION)_amd64.deb
$(DELL_Z9264F_PLATFORM_MODULE)_PLATFORM = x86_64-dellemc_z9264f_c3538-r0
$(eval $(call add_extra_package,$(DELL_Z9100_PLATFORM_MODULE),$(DELL_Z9264F_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(DELL_Z9100_PLATFORM_MODULE)

View File

@ -3,10 +3,12 @@
DELTA_AG9032V1_PLATFORM_MODULE_VERSION = 1.1
DELTA_AG9064_PLATFORM_MODULE_VERSION = 1.1
DELTA_AG5648_PLATFORM_MODULE_VERSION = 1.1
DELTA_ET6248BRB_PLATFORM_MODULE_VERSION = 1.1
export DELTA_AG9032V1_PLATFORM_MODULE_VERSION
export DELTA_AG9064_PLATFORM_MODULE_VERSION
export DELTA_AG5648_PLATFORM_MODULE_VERSION
export DELTA_ET6248BRB_PLATFORM_MODULE_VERSION
DELTA_AG9032V1_PLATFORM_MODULE = platform-modules-ag9032v1_$(DELTA_AG9032V1_PLATFORM_MODULE_VERSION)_amd64.deb
$(DELTA_AG9032V1_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-delta
@ -14,7 +16,6 @@ $(DELTA_AG9032V1_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_CO
$(DELTA_AG9032V1_PLATFORM_MODULE)_PLATFORM = x86_64-delta_ag9032v1-r0
SONIC_DPKG_DEBS += $(DELTA_AG9032V1_PLATFORM_MODULE)
DELTA_AG9064_PLATFORM_MODULE = platform-modules-ag9064_$(DELTA_AG9064_PLATFORM_MODULE_VERSION)_amd64.deb
$(DELTA_AG9064_PLATFORM_MODULE)_PLATFORM = x86_64-delta_ag9064-r0
$(eval $(call add_extra_package,$(DELTA_AG9032V1_PLATFORM_MODULE),$(DELTA_AG9064_PLATFORM_MODULE)))
@ -23,3 +24,8 @@ DELTA_AG5648_PLATFORM_MODULE = platform-modules-ag5648_$(DELTA_AG5648_PLATFORM_M
$(DELTA_AG5648_PLATFORM_MODULE)_PLATFORM = x86_64-delta_ag5648-r0
$(eval $(call add_extra_package,$(DELTA_AG9032V1_PLATFORM_MODULE),$(DELTA_AG5648_PLATFORM_MODULE)))
DELTA_ET6248BRB_PLATFORM_MODULE = platform-modules-et-6248brb_$(DELTA_ET6248BRB_PLATFORM_MODULE_VERSION)_amd64.deb
$(DELTA_ET6248BRB_PLATFORM_MODULE)_PLATFORM = x86_64-delta_et-6248brb-r0
$(eval $(call add_extra_package,$(DELTA_AG9032V1_PLATFORM_MODULE),$(DELTA_ET6248BRB_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(DELTA_AG9032V1_PLATFORM_MODULE)

View File

@ -34,3 +34,5 @@ $(eval $(call add_extra_package,$(INGRASYS_S9100_PLATFORM_MODULE),$(INGRASYS_S89
$(eval $(call add_extra_package,$(INGRASYS_S9100_PLATFORM_MODULE),$(INGRASYS_S8900_54XC_PLATFORM_MODULE)))
$(eval $(call add_extra_package,$(INGRASYS_S9100_PLATFORM_MODULE),$(INGRASYS_S8810_32Q_PLATFORM_MODULE)))
$(eval $(call add_extra_package,$(INGRASYS_S9100_PLATFORM_MODULE),$(INGRASYS_S9200_64X_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(INGRASYS_S9100_PLATFORM_MODULE)

View File

@ -15,3 +15,5 @@ SONIC_DPKG_DEBS += $(INVENTEC_D7032Q28B_PLATFORM_MODULE)
INVENTEC_D7054Q28B_PLATFORM_MODULE = platform-modules-d7054q28b_$(INVENTEC_D7054Q28B_PLATFORM_MODULE_VERSION)_amd64.deb
$(INVENTEC_D7054Q28B_PLATFORM_MODULE)_PLATFORM = x86_64-inventec_d7054q28b-r0
$(eval $(call add_extra_package,$(INVENTEC_D7032Q28B_PLATFORM_MODULE),$(INVENTEC_D7054Q28B_PLATFORM_MODULE)))
SONIC_STRETCH_DEBS += $(INVENTEC_D7032Q28B_PLATFORM_MODULE)

View File

@ -9,3 +9,5 @@ $(MITAC_LY1200_32X_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-m
$(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)
SONIC_STRETCH_DEBS += $(MITAC_LY1200_32X_PLATFORM_MODULE)

View File

@ -10,4 +10,4 @@ $(QUANTA_IX1B_32X_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_C
$(QUANTA_IX1B_32X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix1b_32x-r0
SONIC_DPKG_DEBS += $(QUANTA_IX1B_32X_PLATFORM_MODULE)
SONIC_STRETCH_DEBS += $(QUANTA_IX1B_32X_PLATFORM_MODULE)

View File

@ -9,3 +9,5 @@ $(DELL_S6000_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules
$(DELL_S6000_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
$(DELL_S6000_PLATFORM_MODULE)_PLATFORM = x86_64-dell_s6000_s1220-r0
SONIC_DPKG_DEBS += $(DELL_S6000_PLATFORM_MODULE)
SONIC_STRETCH_DEBS += $(DELL_S6000_PLATFORM_MODULE)

View File

@ -1,4 +1,4 @@
include $(PLATFORM_PATH)/sdk.mk
include $(PLATFORM_PATH)/sai-modules.mk
include $(PLATFORM_PATH)/sai.mk
include $(PLATFORM_PATH)/platform-modules-s6000.mk
include $(PLATFORM_PATH)/platform-modules-dell.mk
@ -9,7 +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)/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

View File

@ -0,0 +1,11 @@
# Broadcom SAI modules
KVERSION = 4.9.0-5-amd64
BRCM_OPENNSL_KERNEL_VERSION = 3.4.1.11-1
BRCM_OPENNSL_KERNEL = opennsl-modules-$(KVERSION)_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb
$(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules
$(BRCM_OPENNSL_KERNEL)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON)
SONIC_DPKG_DEBS += $(BRCM_OPENNSL_KERNEL)
SONIC_STRETCH_DEBS += $(BRCM_OPENNSL_KERNEL)

View File

@ -0,0 +1,4 @@
*.debhelper.log
*.debhelper
*.substvars
*.ko

View File

@ -0,0 +1,48 @@
opennsl (3.4.1.11-1) unstable; urgency=medium
* Port Broadcom SAI 3.4.1.11
* Cherry-pick change from master branch, 3.4.1.11-1
-- Ying Xie <yinxi@microsoft.com> Fri, 05 Jan 2018 23:21:47 +0000
opennsl (3.4.1.10-1) unstable; urgency=medium
* Upgrade to 3.4.1.10-1
-- Ying Xie <yinxi@microsoft.com> Tue, 19 Dec 2017 21:33:48 +0000
opennsl (3.4.1.9-1) unstable; urgency=medium
* Upgrade to 3.4.1.9-1
-- Ying Xie <yinxi@microsoft.com> Thu, 14 Dec 2017 22:04:11 +0000
opennsl (3.4.1.7-2) unstable; urgency=medium
* Add Arista 7260cx3 Rev2 hardware support
-- Ying Xie <yinxi@microsoft.com> Mon, 27 Nov 2017 18:13:50 +0000
opennsl (3.4.1.7-1) unstable; urgency=medium
* Importing opennsl 3.4.1.7
-- Ying Xie <yinxi@microsoft.com> Mon, 23 Oct 2017 23:47:25 +0000
opennsl (3.4.1.5-2) unstable; urgency=medium
* Importing TD2 changes from opennsl 3.2.2.2
-- Ying Xie <yinxi@microsoft.com> Tue, 26 Sep 2017 01:28:44 +0000
opennsl (3.4.1.5-1) unstable; urgency=medium
* Importing opennsl 3.4.1.5
-- Ying Xie <yinxi@microsoft.com> Wed, 20 Sep 2017 16:42:12 +0000
opennsl (3.4.1.3-1) unstable; urgency=low
* Initial release
-- Guohan Lu <gulv@microsoft.com> Fri, 17 Jul 2015 04:46:01 -0700

View File

@ -0,0 +1 @@
8

View File

@ -0,0 +1,14 @@
Source: opennsl
Section: main
Priority: extra
Maintainer: Guohan Lu <gulv@microsoft.com>
Build-Depends: debhelper (>= 8.0.0), bzip2
Standards-Version: 3.9.3
#Vcs-Git: git://git.debian.org/collab-maint/bcmsdk.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/bcmsdk.git;a=summary
Package: opennsl-modules-4.9.0-5-amd64
Architecture: amd64
Section: main
Depends: linux-image-4.9.0-5-amd64
Description: kernel modules for broadcom SAI

View File

@ -0,0 +1 @@
lib/modules/4.9.0-5-amd64/extra

View File

@ -0,0 +1,47 @@
#!/bin/bash
# This script load/unload opennsl kernel modules
### BEGIN INIT INFO
# Provides: load-opennsl-modules
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Load OpenNSL kernel modules
### END INIT INFO
case "$1" in
start)
echo -n "Load OpenNSL kernel modules... "
modprobe linux-kernel-bde dmasize=32M maxpayload=128
modprobe linux-user-bde
modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238
echo "done."
;;
stop)
echo -n "Unload OpenNSL kernel modules... "
rmmod linux-bcm-knet
rmmod linux-user-bde
rmmod linux-kernel-bde
echo "done."
;;
force-reload|restart)
echo "Not supported"
;;
*)
echo "Usage: /etc/init.d/opennsl-modules-4.9.0-5-amd64.init {start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,4 @@
systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/4.9.0-5-amd64/extra
systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/4.9.0-5-amd64/extra
systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/4.9.0-5-amd64/extra
systemd/opennsl-modules-4.9.0-5-amd64.service lib/systemd/system

View File

@ -0,0 +1,183 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# This version is for a hypothetical package that can build a kernel modules
# architecture-dependant package via make-kpkg, as well as an
# architecture-independent module source package, and other packages
# either dep/indep for things like common files or userspace components
# needed for the kernel modules.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# some default definitions, important!
#
# Name of the source package
psource:=opennsl-source
# The short upstream name, used for the module source directory
sname:=opennsl
### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules
# prefix of the target package name
PACKAGE=opennsl-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make
# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)
# The kdist_config target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the neccessary debian/ files
kdist_config: prep-deb-files
# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: clean
dh_testdir
dh_clean
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 KERNDIR=/usr/src/linux-headers-4.9.0-5-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-5-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean
# rm -f driver/*.o driver/*.ko
#
### end KERNEL SETUP
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build-arch: configure-stamp build-arch-stamp
build-arch-stamp:
dh_testdir
# Add here command to compile/build the package.
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 KERNDIR=/usr/src/linux-headers-4.9.0-5-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-5-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6
touch $@
#k = $(shell echo $(KVERS) | grep -q ^2.6 && echo k)
build-indep: configure-stamp build-indep-stamp
build-indep-stamp:
dh_testdir
# Add here command to compile/build the arch indep package.
# It's ok not to do anything here, if you don't need to build
# anything for this package.
#docbook-to-man debian/opennsl.sgml > opennsl.1
touch $@
build: build-arch
clean:
dh_testdir
#dh_testroot
rm -f build-arch-stamp build-indep-stamp configure-stamp
# Add here commands to clean up after the build process.
SDK=$(realpath .) LINUX_UAPI_SPLIT=1 DEBIAN_LINUX_HEADER=1 KERNDIR=/usr/src/linux-headers-4.9.0-5-amd64 KERNEL_SRC=/usr/src/linux-headers-4.9.0-5-amd64 $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
dh_install
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installchangelogs -i
dh_installdocs -i
dh_installexamples -i
# dh_install -i
# dh_installmenu -i
# dh_installdebconf -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
# dh_installmime -i
# dh_installinit -i
# dh_installcron -i
# dh_installinfo -i
dh_installman -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
# dh_perl -i
# dh_makeshlibs -i
dh_installdeb -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -s
dh_testroot -s
# dh_installdebconf -s
dh_installdocs -s
dh_installexamples -s
dh_installmenu -s
# dh_installlogrotate -s
# dh_installemacsen -s
# dh_installpam -s
# dh_installmime -s
dh_installmodules -s
dh_systemd_enable -s
dh_installinit -s
dh_systemd_start -s
dh_installcron -s
# dh_installman -s
dh_installinfo -s
dh_installchangelogs -s
dh_strip -s
dh_link -s
dh_compress -s
dh_fixperms -s
dh_makeshlibs -s
dh_installdeb -s
# dh_perl -s
dh_shlibdeps -s
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure binary-modules kdist kdist_configure kdist_image kdist_clean

View File

@ -0,0 +1,158 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: ibde.h,v 1.27 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
#ifndef __IBDE_H__
#define __IBDE_H__
#include <sal/types.h>
/*
* Represents a collection of devices
*/
typedef struct ibde_dev_s {
uint16 device;
uint8 rev;
sal_vaddr_t base_address;
sal_vaddr_t base_address1;
sal_vaddr_t base_address2;
} ibde_dev_t;
typedef struct ibde_s {
const char *(*name)(void);
/* Returns the number of devices available */
/* Each device is is accessed through a handle */
/* Handles are assumed to index the array of devices */
/* Support SWITCH or ETHERNET or CPU devices */
int (*num_devices)(int type);
#define BDE_ALL_DEVICES 0
#define BDE_SWITCH_DEVICES 1
#define BDE_ETHER_DEVICES 2
#define BDE_CPU_DEVICES 3
const ibde_dev_t *(*get_dev)(int d);
/*
* Get types of underlaying devices.
* A combination of bus type and functional type is returned.
* In case of bus type, support PCI and SPI device types.
* In case of functional type, specify if underlaying device is
* a switching or ethernet device.
*/
uint32 (*get_dev_type)(int d);
#define BDE_PCI_DEV_TYPE SAL_PCI_DEV_TYPE /* PCI device */
#define BDE_SPI_DEV_TYPE SAL_SPI_DEV_TYPE /* SPI device */
#define BDE_EB_DEV_TYPE SAL_EB_DEV_TYPE /* EB device */
#define BDE_ICS_DEV_TYPE SAL_ICS_DEV_TYPE /* ICS device */
#define BDE_MII_DEV_TYPE SAL_MII_DEV_TYPE /* MII device */
#define BDE_I2C_DEV_TYPE SAL_I2C_DEV_TYPE /* I2C device */
#define BDE_AXI_DEV_TYPE SAL_AXI_DEV_TYPE /* AXI device */
#define BDE_EMMI_DEV_TYPE SAL_EMMI_DEV_TYPE /* EMMI device */
#define BDE_DEV_BUS_ALT SAL_DEV_BUS_ALT /* Alternate Access */
#define BDE_DEV_BUS_MSI SAL_DEV_BUS_MSI /* Message-signaled interrupts */
#define BDE_DEV_BUS_TYPE_MASK SAL_DEV_BUS_TYPE_MASK
#define BDE_SWITCH_DEV_TYPE SAL_SWITCH_DEV_TYPE /* Switch device */
#define BDE_ETHER_DEV_TYPE SAL_ETHER_DEV_TYPE /* Ethernet device */
#define BDE_CPU_DEV_TYPE SAL_CPU_DEV_TYPE /* CPU device */
#define BDE_BYTE_SWAP 0x01000000 /* SW byte swap */
#define BDE_NO_IPROC 0x02000000 /* Device uses two BARs, but is not iProc */
#define BDE_256K_REG_SPACE 0x20000000 /* Map 256K (v 64K) */
#define BDE_128K_REG_SPACE 0x40000000 /* Map 128K (v 64K) */
#define BDE_320K_REG_SPACE 0x80000000 /* Map 256K+64K */
/* Bus supports only 16bit reads */
#define BDE_DEV_BUS_RD_16BIT SAL_DEV_BUS_RD_16BIT
/* Bus supports only 16bit writes */
#define BDE_DEV_BUS_WR_16BIT SAL_DEV_BUS_WR_16BIT
/* Backward compatibility */
#define BDE_ET_DEV_TYPE BDE_MII_DEV_TYPE
#define BDE_DEV_MEM_MAPPED(_d) \
((_d) & (BDE_PCI_DEV_TYPE | BDE_ICS_DEV_TYPE | BDE_EB_DEV_TYPE |\
BDE_EMMI_DEV_TYPE | BDE_AXI_DEV_TYPE))
/*
* PCI Bus Access
*/
uint32 (*pci_conf_read)(int d, uint32 addr);
int (*pci_conf_write)(int d, uint32 addr, uint32 data);
void (*pci_bus_features)(int d, int *be_pio, int *be_packet,
int *be_other);
uint32 (*read)(int d, uint32 addr);
int (*write)(int d, uint32 addr, uint32 data);
uint32* (*salloc)(int d, int size, const char *name);
void (*sfree)(int d, void *ptr);
int (*sflush)(int d, void *addr, int length);
int (*sinval)(int d, void *addr, int length);
int (*interrupt_connect)(int d, void (*)(void*), void *data);
int (*interrupt_disconnect)(int d);
sal_paddr_t (*l2p)(int d, void *laddr);
void* (*p2l)(int d, sal_paddr_t paddr);
/*
* SPI Access via SMP
*/
int (*spi_read)(int d, uint32 addr, uint8 *buf, int len);
int (*spi_write)(int d, uint32 addr, uint8 *buf, int len);
/* Special SPI access addresses */
#define BDE_DEV_OP_EMMI_INIT SAL_DEV_OP_EMMI_INIT
/*
* iProc register access
*/
uint32 (*iproc_read)(int d, uint32 addr);
int (*iproc_write)(int d, uint32 addr, uint32 data);
/*
* Shared memory access
*/
uint32 (*shmem_read)(int dev, uint32 addr, uint8 *buf, uint32 len);
void (*shmem_write)(int dev, uint32 addr, uint8 *buf, uint32 len);
sal_vaddr_t (*shmem_map)(int dev, uint32 addr, uint32 size);
/*
* cmic
*/
int (*get_cmic_ver)(int d, uint32 *ver);
} ibde_t;
/* System BDE */
extern ibde_t *bde;
#endif /* __IBDE_H__ */

View File

@ -0,0 +1,541 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: kcom.h,v 1.9 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
* File: kcom.h
* Purpose: User/Kernel message definitions
*/
#ifndef _KCOM_H
#define _KCOM_H
#include <sal/types.h>
#define KCOM_CHAN_KNET "KCOM_KNET"
/*
* Message types
*/
#define KCOM_MSG_TYPE_CMD 1 /* Command */
#define KCOM_MSG_TYPE_RSP 2 /* Command response */
#define KCOM_MSG_TYPE_EVT 3 /* Unsolicited event */
/*
* Message opcodes
*/
#define KCOM_M_NONE 0 /* Should not be used */
#define KCOM_M_VERSION 1 /* Protocol version */
#define KCOM_M_STRING 2 /* For debug messages */
#define KCOM_M_HW_RESET 3 /* H/W not ready */
#define KCOM_M_HW_INIT 4 /* H/W initialized */
#define KCOM_M_ETH_HW_CONFIG 5 /* ETH HW config*/
#define KCOM_M_DETACH 6 /* Detach kernel module */
#define KCOM_M_NETIF_CREATE 11 /* Create network interface */
#define KCOM_M_NETIF_DESTROY 12 /* Destroy network interface */
#define KCOM_M_NETIF_LIST 13 /* Get list of network interface IDs */
#define KCOM_M_NETIF_GET 14 /* Get network interface info */
#define KCOM_M_FILTER_CREATE 21 /* Create Rx filter */
#define KCOM_M_FILTER_DESTROY 22 /* Destroy Rx filter */
#define KCOM_M_FILTER_LIST 23 /* Get list of Rx filter IDs */
#define KCOM_M_FILTER_GET 24 /* Get Rx filter info */
#define KCOM_M_DMA_INFO 31 /* Tx/Rx DMA info */
#define KCOM_M_DBGPKT_SET 41 /* Enbale debug packet function */
#define KCOM_M_DBGPKT_GET 42 /* Get debug packet function info */
#define KCOM_VERSION 8 /* Protocol version */
/*
* Message status codes
*/
#define KCOM_E_NONE 0 /* No errors */
#define KCOM_E_PARAM 1 /* Invalid/unsupported parameter */
#define KCOM_E_RESOURCE 2 /* Out of memory or other resource */
#define KCOM_E_NOT_FOUND 3 /* Requested object not found */
typedef struct kcom_msg_hdr_s {
uint8 type;
uint8 opcode;
uint8 seqno;
uint8 status;
uint8 unit;
uint8 reserved;
uint16 id;
} kcom_msg_hdr_t;
/*
* Object types
*/
/*
* System network interface
*
* Network interface types:
*
* KCOM_NETIF_T_VLAN
* Transmits to this interface will go to ingress PIPE of switch
* CPU port using specified VLAN ID. Packet will be switched.
*
* KCOM_NETIF_T_PORT
* Transmits to this interface will go to unmodified to specified
* physical switch port. All switching logic is bypassed.
*
* KCOM_NETIF_T_META
* Transmits to this interface will be done using raw meta data
* as DMA descriptors. Currently used for RCPU mode only.
*
* Network interface flags:
*
* KCOM_NETIF_F_ADD_TAG
* Add VLAN tag to packets sent directly to physical port.
*
* KCOM_NETIF_F_RCPU_ENCAP
* Use RCPU encapsulation for packets that enter and exit this
* interface.
*/
#define KCOM_NETIF_T_VLAN 0
#define KCOM_NETIF_T_PORT 1
#define KCOM_NETIF_T_META 2
#define KCOM_NETIF_F_ADD_TAG (1U << 0)
#define KCOM_NETIF_F_RCPU_ENCAP (1U << 1)
/* If a netif has this flag, the packet sent to the netif can't be stripped tag or added tag */
#define KCOM_NETIF_F_KEEP_RX_TAG (1U << 2)
#define KCOM_NETIF_NAME_MAX 16
typedef struct kcom_netif_s {
uint16 id;
uint8 type;
uint8 flags;
uint32 cb_user_data;
uint8 port;
uint8 reserved;
uint16 vlan;
uint16 qnum;
uint8 macaddr[6];
uint8 ptch[2];
uint8 itmh[4];
char name[KCOM_NETIF_NAME_MAX];
} kcom_netif_t;
/*
* Packet filters
*
* Filters work like software TCAMs where a mask is applied to the
* source data, and the result is then compared to the filter data.
*
* Filters are checked in priority order with the lowest priority
* values being checked first (i.e. 0 is the highest priority).
*
* Filter types:
*
* KCOM_FILTER_T_RX_PKT
* Filter data and mask are applied to the Rx DMA control block
* as well as to the Rx packet contents.
*
* Destination types:
*
* KCOM_DEST_T_NULL
* Packet is dropped.
*
* KCOM_DEST_T_NETIF
* Packet is sent to network interface with ID <dest_id>.
*
* KCOM_DEST_T_API
* Packet is sent to Rx API through queue <dest_id>.
*
* KCOM_DEST_T_CB
* Packet destination is obtained from kernel call-back function.
*
* Filter flags:
*
* KCOM_FILTER_F_ANY_DATA
* When this flags is set the filter will match any packet on
* the associated unit.
*
* KCOM_FILTER_F_STRIP_TAG
* Strip VLAN tag before packet is sent to destination.
* This flag only applies to KCOM_DEST_T_NETIF.
*
*/
#define KCOM_FILTER_BYTES_MAX 256
#define KCOM_FILTER_WORDS_MAX BYTES2WORDS(KCOM_FILTER_BYTES_MAX)
#define KCOM_FILTER_T_RX_PKT 1
#define KCOM_DEST_T_NULL 0
#define KCOM_DEST_T_NETIF 1
#define KCOM_DEST_T_API 2
#define KCOM_DEST_T_CB 3
#define KCOM_FILTER_F_ANY_DATA (1U << 0)
#define KCOM_FILTER_F_STRIP_TAG (1U << 1)
#define KCOM_FILTER_DESC_MAX 32
typedef struct kcom_filter_s {
uint16 id;
uint8 type;
uint8 priority;
char desc[KCOM_FILTER_DESC_MAX];
uint32 flags;
uint32 cb_user_data;
uint16 dest_type;
uint16 dest_id;
uint16 dest_proto;
uint16 mirror_type;
uint16 mirror_id;
uint16 mirror_proto;
uint16 oob_data_offset;
uint16 oob_data_size;
uint16 pkt_data_offset;
uint16 pkt_data_size;
union {
uint8 b[KCOM_FILTER_BYTES_MAX];
uint32 w[KCOM_FILTER_WORDS_MAX];
} data;
union {
uint8 b[KCOM_FILTER_BYTES_MAX];
uint32 w[KCOM_FILTER_WORDS_MAX];
} mask;
} kcom_filter_t;
/*
* DMA buffer information
*
* Cookie field is reserved use by application (32/64-bit pointer).
*
* For Tx operation the application will submit the start address of
* the Tx DCB chain which is queued for transfer by the kernel module.
* Once DMA is done a DMA event is returned to the application with an
* optional sequence number.
*
* For Rx operation the application will submit the start address of
* the Rx DCB chain which should be use for packet reception by the
* kernel module. Once DMA is done a DMA event is returned to the
* application with an optional sequence number.
*
* Cookie field is reserved use by application (32/64-bit pointer).
*
* Packet info types:
*
* KCOM_DMA_INFO_T_TX_DCB
* Data is physical start address of Tx DCB chain.
*
* KCOM_DMA_INFO_T_RX_DCB
* Data is physical start address of Rx DCB chain.
*
* Packet info flags:
*
* KCOM_DMA_INFO_F_TX_DONE
* This flag is set by the kernel module and means that one or more
* packets have been sent.
*
* KCOM_DMA_INFO_F_RX_DONE
* This flag is set by the kernel module and means that one or more
* Rx buffers contain valid packet data.
*/
#define KCOM_DMA_INFO_T_TX_DCB 1
#define KCOM_DMA_INFO_T_RX_DCB 2
#define KCOM_DMA_INFO_F_TX_DONE (1U << 0)
#define KCOM_DMA_INFO_F_RX_DONE (1U << 1)
typedef struct kcom_dma_info_s {
uint8 type;
uint8 cnt;
uint16 size;
uint16 chan;
uint16 flags;
union {
void *p;
uint8 b[8];
} cookie;
union {
uint32 dcb_start;
struct {
uint32 tx;
uint32 rx;
} seqno;
} data;
} kcom_dma_info_t;
/* Default channel configuration */
#define KCOM_DMA_TX_CHAN 0
#define KCOM_DMA_RX_CHAN 1
#define KCOM_ETH_HW_T_RESET 1
#define KCOM_ETH_HW_T_INIT 2
#define KCOM_ETH_HW_T_OTHER 3
#define KCOM_ETH_HW_C_ALL 0xff
#define KCOM_ETH_HW_RESET_F_TX (1U << 0)
#define KCOM_ETH_HW_RESET_F_RX (1U << 1)
#define KCOM_ETH_HW_RESET_F_TX_RECLAIM (1U << 2)
#define KCOM_ETH_HW_RESET_F_RX_RECLAIM (1U << 3)
#define KCOM_ETH_HW_INIT_F_TX (1U << 0)
#define KCOM_ETH_HW_INIT_F_RX (1U << 1)
#define KCOM_ETH_HW_INIT_F_RX_FILL (1U << 2)
#define KCOM_ETH_HW_OTHER_F_FIFO_LOOPBACK (1U << 0)
#define KCOM_ETH_HW_OTHER_F_INTERRUPT (1U << 1)
typedef struct kcom_eth_hw_config_s {
uint8 type;
uint8 chan;
uint32 flags;
uint32 value;
} kcom_eth_hw_config_t;
/*
* Message types
*/
/*
* Request KCOM interface version of kernel module.
*/
typedef struct kcom_msg_version_s {
kcom_msg_hdr_t hdr;
uint32 version;
uint32 netif_max;
uint32 filter_max;
} kcom_msg_version_t;
/*
* Send literal string to/from kernel module.
* Mainly for debugging purposes.
*/
#define KCOM_MSG_STRING_MAX 128
typedef struct kcom_msg_string_s {
kcom_msg_hdr_t hdr;
uint32 len;
char val[KCOM_MSG_STRING_MAX];
} kcom_msg_string_t;
/*
* Indicate that eth hardware is about to be reset. Active
* DMA operations should be aborted and DMA and interrupts
* should be disabled.
*/
/*
* Indicate that eth hardware has been properly initialized
* for DMA operation to commence.
*/
typedef struct kcom_msg_eth_hw_config_s {
kcom_msg_hdr_t hdr;
kcom_eth_hw_config_t config;
} kcom_msg_eth_hw_config_t;
/*
* Indicate that switch hardware is about to be reset. Active
* DMA operations should be aborted and DMA and interrupts
* should be disabled.
*/
typedef struct kcom_msg_hw_reset_s {
kcom_msg_hdr_t hdr;
uint32 channels;
} kcom_msg_hw_reset_t;
/*
* Indicate that switch hardware has been properly initialized
* for DMA operation to commence.
*/
typedef struct kcom_msg_hw_init_s {
kcom_msg_hdr_t hdr;
uint16 dcb_size;
uint16 dcb_type;
uint32 cdma_channels;
} kcom_msg_hw_init_t;
/*
* Release blocked IOCTL threads and clean up as necessary.
*/
typedef struct kcom_msg_detach_s {
kcom_msg_hdr_t hdr;
uint32 flags;
} kcom_msg_detach_t;
/*
* Enable/Disable debugging packet function.
*/
typedef struct kcom_msg_dbg_pkt_set_s {
kcom_msg_hdr_t hdr;
int enable;
} kcom_msg_dbg_pkt_set_t;
/*
* Get debugging packet function info.
*/
typedef struct kcom_msg_dbg_pkt_get_s {
kcom_msg_hdr_t hdr;
int value;
} kcom_msg_dbg_pkt_get_t;
/*
* Create new system network interface. The network interface will
* be associated with the specified switch unit number.
* The interface id and name will be assigned by the kernel module.
*/
typedef struct kcom_msg_netif_create_s {
kcom_msg_hdr_t hdr;
kcom_netif_t netif;
} kcom_msg_netif_create_t;
/*
* Destroy system network interface.
*/
typedef struct kcom_msg_netif_destroy_s {
kcom_msg_hdr_t hdr;
} kcom_msg_netif_destroy_t;
/*
* Get list of currently defined system network interfaces.
*/
#ifndef KCOM_NETIF_MAX
#define KCOM_NETIF_MAX 128
#endif
typedef struct kcom_msg_netif_list_s {
kcom_msg_hdr_t hdr;
uint32 ifcnt;
uint16 id[KCOM_NETIF_MAX];
} kcom_msg_netif_list_t;
/*
* Get detailed network interface information.
*/
typedef struct kcom_msg_netif_get_s {
kcom_msg_hdr_t hdr;
kcom_netif_t netif;
} kcom_msg_netif_get_t;
/*
* Create new packet filter.
* The filter id will be assigned by the kernel module.
*/
typedef struct kcom_msg_filter_create_s {
kcom_msg_hdr_t hdr;
kcom_filter_t filter;
} kcom_msg_filter_create_t;
/*
* Destroy packet filter.
*/
typedef struct kcom_msg_filter_destroy_s {
kcom_msg_hdr_t hdr;
} kcom_msg_filter_destroy_t;
/*
* Get list of currently defined packet filters.
*/
#ifndef KCOM_FILTER_MAX
/* OPENNSL_FIXUP - Increased the filters to 1024 from 128 */
#define KCOM_FILTER_MAX 1024
#endif
typedef struct kcom_msg_filter_list_s {
kcom_msg_hdr_t hdr;
uint32 fcnt;
uint16 id[KCOM_FILTER_MAX];
} kcom_msg_filter_list_t;
/*
* Get detailed packet filter information.
*/
typedef struct kcom_msg_filter_get_s {
kcom_msg_hdr_t hdr;
kcom_filter_t filter;
} kcom_msg_filter_get_t;
/*
* DMA info
*/
typedef struct kcom_msg_dma_info_s {
kcom_msg_hdr_t hdr;
kcom_dma_info_t dma_info;
} kcom_msg_dma_info_t;
/*
* All messages (e.g. for generic receive)
*/
typedef union kcom_msg_s {
kcom_msg_hdr_t hdr;
kcom_msg_version_t version;
kcom_msg_string_t string;
kcom_msg_hw_reset_t hw_reset;
kcom_msg_hw_init_t hw_init;
kcom_msg_eth_hw_config_t eth_hw_config;
kcom_msg_detach_t detach;
kcom_msg_netif_create_t netif_create;
kcom_msg_netif_destroy_t netif_destroy;
kcom_msg_netif_list_t netif_list;
kcom_msg_netif_get_t netif_get;
kcom_msg_filter_create_t filter_create;
kcom_msg_filter_destroy_t filter_destroy;
kcom_msg_filter_list_t filter_list;
kcom_msg_filter_get_t filter_get;
kcom_msg_dma_info_t dma_info;
kcom_msg_dbg_pkt_set_t dbg_pkt_set;
kcom_msg_dbg_pkt_get_t dbg_pkt_get;
} kcom_msg_t;
/*
* KCOM communication channel vectors
*
* open
* Open KCOM channel.
*
* close
* Close KCOM channel.
*
* send
* Send KCOM message. If bufsz is non-zero, a synchronous send will be
* performed (if supported) and the function will return the number of
* bytes in the response.
*
* recv
* Receive KCOM message. This function is used t oreceive unsolicited
* messages from the kernel. If synchronous send is not supported, this
* function is also used to retrieve responses to command messages.
*/
typedef struct kcom_chan_s {
void *(*open)(char *name);
int (*close)(void *handle);
int (*send)(void *handle, void *msg, unsigned int len, unsigned int bufsz);
int (*recv)(void *handle, void *msg, unsigned int bufsz);
} kcom_chan_t;
#endif /* _KCOM_H */

View File

@ -0,0 +1,39 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: sync.h,v 1.1 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
#ifndef _SAL_SYNC_H
#define _SAL_SYNC_H
typedef struct sal_sem_s{
char sal_opaque_type;
} *sal_sem_t;
#define sal_sem_FOREVER (-1)
#define sal_sem_BINARY 1
#define sal_sem_COUNTING 0
sal_sem_t sal_sem_create(char *desc, int binary, int initial_count);
void sal_sem_destroy(sal_sem_t b);
int sal_sem_take(sal_sem_t b, int usec);
int sal_sem_give(sal_sem_t b);
#endif /* !_SAL_SYNC_H */

View File

@ -0,0 +1,31 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: thread.h,v 1.1 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*/
#ifndef _SAL_THREAD_H
#define _SAL_THREAD_H
#include <sal/types.h>
void sal_usleep(uint32 usec);
void sal_udelay(uint32 usec);
#endif /* !_SAL_THREAD_H */

View File

@ -0,0 +1,156 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: types.h,v 1.3 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
* File: types.h
* Purpose: SAL type definitions
*/
#ifndef _SAL_TYPES_H
#define _SAL_TYPES_H
/*
* Define platform-independent types
*/
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0
#endif
#ifndef DONT_CARE
#define DONT_CARE 0
#endif
#define VOL volatile
/*
* 64-bit type
*/
#ifdef LONGS_ARE_64BITS
#define COMPILER_64BIT
#define COMPILER_UINT64 unsigned long
#define u64_H(v) (((uint32 *) &(v))[u64_MSW])
#define u64_L(v) (((uint32 *) &(v))[u64_LSW])
#else /* !LONGS_ARE_64BITS */
#define COMPILER_64BIT
#define COMPILER_UINT64 unsigned long long
#define u64_H(v) (((uint32 *) &(v))[u64_MSW])
#define u64_L(v) (((uint32 *) &(v))[u64_LSW])
#endif /* LONGS_ARE_64BITS */
/*
* Define unsigned and signed integers with guaranteed sizes.
* Adjust if your compiler uses different sizes for short or int.
*/
typedef unsigned char uint8; /* 8-bit quantity */
typedef unsigned short uint16; /* 16-bit quantity */
typedef unsigned int uint32; /* 32-bit quantity */
typedef COMPILER_UINT64 uint64; /* 64-bit quantity */
typedef signed char int8; /* 8-bit quantity */
typedef signed short int16; /* 16-bit quantity */
typedef signed int int32; /* 32-bit quantity */
#define BITS2BYTES(x) (((x) + 7) / 8)
#define BITS2WORDS(x) (((x) + 31) / 32)
#define BYTES2BITS(x) ((x) * 8)
#define BYTES2WORDS(x) (((x) + 3) / 4)
#define WORDS2BITS(x) ((x) * 32)
#define WORDS2BYTES(x) ((x) * 4)
#define COUNTOF(ary) ((int) (sizeof (ary) / sizeof ((ary)[0])))
typedef uint32 sal_paddr_t; /* Physical address (PCI address) */
#ifdef PTRS_ARE_64BITS
typedef uint64 sal_vaddr_t; /* Virtual address (Host address) */
#define PTR_TO_INT(x) ((uint32)(((sal_vaddr_t)(x))&0xFFFFFFFF))
#else
typedef uint32 sal_vaddr_t; /* Virtual address (Host address) */
#define PTR_TO_INT(x) ((uint32)(x))
#endif
#define INT_TO_PTR(x) ((void *)((sal_vaddr_t)(x)))
#define PTR_TO_UINTPTR(x) ((sal_vaddr_t)(x))
#define UINTPTR_TO_PTR(x) ((void *)(x))
typedef union
{
uint8 u8;
uint16 u16;
uint32 u32;
uint64 u64;
sal_paddr_t paddr;
sal_vaddr_t vaddr;
void *ptr;
} any_t;
/* Device bus types */
#define SAL_PCI_DEV_TYPE 0x00001 /* PCI device */
#define SAL_SPI_DEV_TYPE 0x00002 /* SPI device */
#define SAL_EB_DEV_TYPE 0x00004 /* EB device */
#define SAL_ICS_DEV_TYPE 0x00008 /* ICS device */
#define SAL_MII_DEV_TYPE 0x00010 /* MII device */
#define SAL_RCPU_DEV_TYPE 0x00020 /* RCPU device */
#define SAL_I2C_DEV_TYPE 0x00040 /* I2C device */
#define SAL_AXI_DEV_TYPE 0x00080 /* AXI device */
#define SAL_EMMI_DEV_TYPE 0x10000 /* EMMI device */
#define SAL_DEV_BUS_TYPE_MASK 0xf00ff /* Odd for historical reasons */
/* Device types */
#define SAL_SWITCH_DEV_TYPE 0x00100 /* Switch device */
#define SAL_ETHER_DEV_TYPE 0x00200 /* Ethernet device */
#define SAL_CPU_DEV_TYPE 0x00400 /* CPU device */
#define SAL_DEV_TYPE_MASK 0x00f00
/* Access types */
#define SAL_DEV_BUS_RD_16BIT 0x01000 /* 16 bit reads on bus */
#define SAL_DEV_BUS_WR_16BIT 0x02000 /* 16 bit writes on bus */
#define SAL_DEV_BUS_ALT 0x04000 /* Alternate access */
#define SAL_DEV_BUS_MSI 0x08000 /* Message-signaled interrupts */
#define SAL_DEV_FLAG_MASK 0x0f000
/* BDE reserved mask (cannot be used by SAL) */
#define SAL_DEV_BDE_MASK 0xff000000
/* Backward compatibility */
#define SAL_ET_DEV_TYPE SAL_MII_DEV_TYPE
/* Special access addresses */
#define SAL_DEV_OP_EMMI_INIT 0x0fff1000
#endif /* !_SAL_TYPES_H */

View File

@ -0,0 +1,46 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: sdk_config.h,v 1.5 Broadcom SDK $
* $Copyright: (c) 2006 Broadcom Corp.
* All Rights Reserved.$
*
*
*/
#ifndef __SDK_CONFIG_H__
#define __SDK_CONFIG_H__
/*
* Include custom overrides
*/
#ifdef SDK_INCLUDE_CUSTOM_CONFIG
#include <sdk_custom_config.h>
#endif
/*
* Memory Barrier operation if required.
* Defaults to nothing.
*/
#ifndef SDK_CONFIG_MEMORY_BARRIER
#define SDK_CONFIG_MEMORY_BARRIER
#endif
#endif /* __SDK_CONFIG_H__ */

View File

@ -0,0 +1,38 @@
/*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to
* you under the terms of the GNU General Public License version 2 (the
* "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
* with the following added to such license:
*
* As a special exception, the copyright holders of this software give
* you permission to link this software with independent modules, and to
* copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent
* module, the terms and conditions of the license of that module. An
* independent module is a module which is not derived from this
* software. The special exception does not apply to any modifications
* of the software.
*/
/*
* $Id: cmic.h,v 1.1 Broadcom SDK $
* $Copyright: (c) 2005 Broadcom Corp.
* All Rights Reserved.$
*
* File: cmic.h
* Purpose: Maps out structures used for CMIC operations and
* exports routines and constants.
*/
#ifndef _SOC_CMIC_H
#define _SOC_CMIC_H
/* IRQ Register (RO) */
#define CMIC_IRQ_STAT 0x00000144
/* IRQ Mask Registers (R/W) */
#define CMIC_IRQ_MASK 0x00000148
#define CMIC_IRQ_MASK_1 0x0000006C
#define CMIC_IRQ_MASK_2 0x00000070
#endif /* !_SOC_CMIC_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,364 @@
#
# Unless you and Broadcom execute a separate written software license
# agreement governing use of this software, this software is licensed to
# you under the terms of the GNU General Public License version 2 (the
# "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
# with the following added to such license:
#
# As a special exception, the copyright holders of this software give
# you permission to link this software with independent modules, and to
# copy and distribute the resulting executable under terms of your
# choice, provided that you also meet, for each linked independent
# module, the terms and conditions of the license of that module. An
# independent module is a module which is not derived from this
# software. The special exception does not apply to any modifications
# of the software.
#
# $Id: Make.config,v 1.3 Broadcom SDK $
# $Copyright: (c) 2005 Broadcom Corp.
# All Rights Reserved.$
#
ifneq ($(strip $(override-target)),)
override TARGET=$(override-target)
endif
export TARGET
#
# Set up the target name, and the target base variables.
#
# target = The full name of the target such as vxworks-bmw
# targetbase = 1st part of target (e.g. vxworks)
# targetplat = 2nd part of target (e.g. x86) if any; otherwise same as 1st
#
target = ${TARGET}
targetsplt = $(subst -, , ${target}) # change hyphens to spaces
targetbase = $(word 1,${targetsplt})
targetplat = $(subst ${targetbase}-,,${TARGET})
#
# Common configuration for all platforms
# (Additional platform-dependent configurations are in Makefile.xxx)
#
#
# THIS FILE SHOULD NOT BE MODIFIED LOCALLY, to override, add a file
# $SDK/make/Make.local that sets your local settings, and/or provide
# a path to your settings using the MAKE_LOCAL variable. If
# either of these files exists, their values will override those in this makefile.
#
ifdef MAKE_LOCAL
-include ${MAKE_LOCAL}
endif
-include ${SDK}/make/Make.local
ifdef ALL_CHIPS
ROBO_CHIPS = 1
ESW_CHIPS = 1
else
ifndef ROBO_CHIPS
ESW_CHIPS = 1
endif
endif # ALL_CHIPS
#
# By default, turn off the "changing directory" message.
#
MAKEFLAGS += --no-print-directory
#
# Use gmake by default
#
include ${SDK}/make/Make.tools
include ${SDK}/make/Makefile.${target}
# use QUIET=1 to control printing of compilation lines
ifdef QUIET
Q:=@
else
Q:=
endif
#
# Suffix to add to the "target" files to allow local builds with different
# flags. Set "target_suffix" to XXX to cause the build to put built objects
# in ${target}${target_suffix}. This allows things like building a debug
# version with different flags. This may also be set in another Makefile.
#
#target_suffix :=
#
# Optional suffix to add to the build directory and output binary files
# to allow multiple builds to co-exist for various reasons.
#
#chip_suffix := -$(shell echo $(CHIP) | tr A-Z a-z)
#
# Combined suffixes
#
all_suffix = ${chip_suffix}${target_suffix}
#
# Default location to place binaries and make depend files for building
# purposes.
#
ifeq "$(HOSTTYPE)" "Windows2000PC"
BLDROOTWITHDRIVE = ${SDK}/build/${target}${all_suffix}${bldroot_suffix}
BLDROOT = ${SDK_NO_DRIVE_NAME}/build/${target}${all_suffix}${bldroot_suffix}
else # ifeq "$(HOSTTYPE)" "Windows2000PC"
ifndef SDKBUILD
SDKBUILD :=build
endif
BLDROOT = ${SDK}/${SDKBUILD}/$(if ${BLDCONFIG},${BLDCONFIG}/)${target}${all_suffix}${bldroot_suffix}
endif # ifeq "$(HOSTTYPE)" "Windows2000PC"
# This is needed because we cannot include Make.vxworks before Make.config
ifndef DEST_DIR_SUFFIX
export DEST_DIR_SUFFIX :=$(subst $(realpath $(SDK))/systems,,$(realpath $(CURDIR)/$(dir ($(firstword $(MAKEFILE_LIST))))))
ifeq ($(MAKELEVEL),0)
endif
endif
ifeq ($(DEST_DIR),)
export DEST_DIR :=${SDK}/${SDKBUILD}$(if ${BLDCONFIG},/${BLDCONFIG})$(DEST_DIR_SUFFIX)
endif
ifdef LOCALDIR
BLDDIR = ${BLDROOT}/${LOCALDIR}
ifeq "$(HOSTTYPE)" "Windows2000PC"
BLDDIRWITHDRIVE = ${BLDROOTWITHDRIVE}/${LOCALDIR}
endif
else # ifdef LOCALDIR
BLDDIR = ${BLDROOT}
ifeq "$(HOSTTYPE)" "Windows2000PC"
BLDDIRWITHDRIVE = ${BLDROOTWITHDRIVE}
endif
endif # ifdef LOCALDIR
LIBDIR = ${BLDROOT}
#
# Export directory, where build objects used by the outside world are
# placed (exported header files, libs, bins)
#
EXPDIR = ${SDK}/export/${target}${all_suffix}
#
# Standard include paths
#
INCDIR = ${SDK}/include
#
# Compilation Flags
#
# Flags may be added to (see below)
#
INCFLAGS = -I${INCDIR} -I${SDK}/systems
CFLAGS += ${INCFLAGS}
CXXFLAGS += ${INCFLAGS}
CPPFLAGS += ${INCFLAGS}
#
# Debug #ifdef control
#
# Compiling out #ifdef DEBUG code saves about 1.3% on executable size.
# It is recommended to leave debug enabled when developing applications.
#
ifndef DEBUG_IFDEFS
DEBUG_IFDEFS=TRUE
endif
ifeq ($(DEBUG_IFDEFS),TRUE)
CFLAGS += -DBROADCOM_DEBUG
CXXFLAGS += -DBROADCOM_DEBUG
CPPFLAGS += -DBROADCOM_DEBUG
endif
#
# Debug symbol information control
#
ifndef DEBUG_SYMBOLS
DEBUG_SYMBOLS=TRUE
endif
ifeq ($(DEBUG_SYMBOLS),TRUE)
CFLAGS += -g
CXXFLAGS += -g
CPPFLAGS += -g
endif
#
# If DEBUG_CFLAGS is set, add its contents to CFLAGS.
# May be useful for setting on the command line or adding to Make.local.
# Example: gmake DEBUG_CFLAGS=-save-temps system.c
#
ifneq ($(DEBUG_CFLAGS),)
CFLAGS += $(DEBUG_CFLAGS)
CXXFLAGS += $(DEBUG_CFLAGS)
CPPFLAGS += $(DEBUG_CFLAGS)
endif
#
# Optimization level
#
# Set DEBUG_OPTIMIZE to TRUE (default) to use a normal optimization
# determined by OPTFLAGS_DEFAULT in the platform Makefile.
# Set DEBUG_OPTIMIZE to FALSE to use no optimization,
# strongly recommended when using any debugger.
# Set DEBUG_OPTIMIZE to any other option string to request specific
# optimization flags (for example -O2).
#
ifndef DEBUG_OPTIMIZE
DEBUG_OPTIMIZE=TRUE
endif
ifeq ($(DEBUG_OPTIMIZE),TRUE)
OPTFLAGS += $(OPTFLAGS_DEFAULT)
else
ifneq ($(DEBUG_OPTIMIZE),FALSE)
OPTFLAGS += $(DEBUG_OPTIMIZE)
endif
endif
#
# Debug assertion control.
#
# Compiling out assert() saves about 1.1% on executable size,
# however doing so is VERY MUCH discouraged.
#
ifndef DEBUG_ASSERTS
DEBUG_ASSERTS=TRUE
endif
ifeq ($(DEBUG_ASSERTS),FALSE)
CFLAGS += -DNDEBUG
CXXFLAGS += -DNDEBUG
CPPFLAGS += -DNDEBUG
endif
#
# GCC pedantic mode.
#
ifeq ($(DEBUG_PEDANTIC),TRUE)
CFGFLAGS += -D__PEDANTIC__
CFLAGS += --pedantic
CXXFLAGS += --pedantic
endif
#
# In each directory, build a list of local sources, objects, and headers
#
LSRCS = $(wildcard *.c *.cpp *.s *.cc *.C)
LOBJS = $(addsuffix .o, $(basename ${LSRCS}))
BOBJS = $(addprefix ${BLDDIR}/,${LOBJS})
LHDRS = $(wildcard *.h *.H)
LDOTIS = $(wildcard *.i)
#
# Rule to create object file (build) directory
#
.PHONY: all install clean distclean
.PRECIOUS: ${BLDDIR}/.tree
%/.tree:
@$(ECHO) 'Creating build directory $(dir $@)'
@$(MKDIR) $(dir $@)
@$(ECHO) "Build Directory for ${LOCALDIR} Created" > $@
# Rule allowing build through CPP only, creates .E file from .c file.
%.E: %.c
$Q${CC} -E ${CFLAGS} $< | sed -e '/^ *$$/d' -e p -e d > $@
# Rule allowing build through source only, creates .s file from .c file.
%.s: %.c
$Q${CC} -S ${CFLAGS} $<
#
# Default Build rules for .c --> .o, leaving the binary in BLDDIR/X.o,
# even if file not built from directory of source.
#
ifeq ($(FAST),1)
${BLDDIR}/%.o: %.c
else
ifdef GENERATE_C_FILES
${BLDDIR}/%.o: %.c
else
${BLDDIR}/%.o: %.c
endif
endif
ifdef QUIET
@${ECHO} Compiling ${LOCALDIR}/$<
endif
ifdef LOCAL_D_FILE
$Q$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $< --write-user-dependencies
-@/bin/cp $*.d $(BLDDIR)/$*.d
-@/bin/rm -f $*.d
else
$Q$(CC) -MD -MF $(BLDDIR)/$*.d $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
endif
@/bin/cp $(BLDDIR)/$*.d $(BLDDIR)/$*.tmp;\
/bin/sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' \
< $(BLDDIR)/$*.d >> $(BLDDIR)/$*.tmp; \
/bin/sed \
-e 's| \([0-9a-zA-Z]\)| '$(SDK)/$(LOCALDIR)'\/\1|g' \
-e 's|^\([0-9a-zA-Z]\)|'$(SDK)/$(LOCALDIR)'/\1|g' \
-e 's| \(\.\.\/\)| '$(SDK)/$(LOCALDIR)'\/\1|g' \
-e 's|'$(SDK)'|'$$\{SDK\}'|g' \
-e 's/\w*\/\.\.\/*//g' \
-e 's/\w*\/\.\.\/*//g' \
-e 's/\w*\/\.\.\/*//g' \
< $(BLDDIR)/$*.tmp > $(BLDDIR)/$*.P; \
/bin/rm -f $(BLDDIR)/$*.d $(BLDDIR)/$*.tmp
${BLDDIR}/%.o: %.s
ifdef QUIET
@${ECHO} Assembling ${LOCALDIR}/$<
endif
$Q${CC} ${CFLAGS} ${EXTRA_CFLAGS} -c $< -o $@
${BLDDIR}/%.o: %.cpp
ifdef QUIET
@${ECHO} Compiling ${LOCALDIR}/$<
endif
$Q${CXX} -c ${CXXFLAGS} -c $< -o $@
${BLDDIR}/%.o: %.cc ${BLDDIR}/.tree
ifdef QUIET
@${ECHO} Compiling ${LOCALDIR}/$<
endif
$Q${CXX} -c ${CXXFLAGS} -c $< -o $@
#
# Cause "make foo.o" in any subdirectory to put the object in the build
# directory instead of the local directory.
#
%.o: ${BLDDIR}/%.o
@
#
# List of directories where built objects live.
# (we are not making the export directories for now)
#
#DIRS = ${BLDDIR} ${EXPDIR}/lib ${EXPDIR}/bin ${EXPDIR}/include
DIRS = ${BLDDIR}
ifeq (C_COMPILER,$(MAKECMDGOALS))
C_COMPILER:
@echo $(CC)
endif

Some files were not shown because too many files have changed in this diff Show More