Skip to content

Commit

Permalink
[platform/broadcom] Add Celestica Silverstone-DP platform module
Browse files Browse the repository at this point in the history
  • Loading branch information
pphuchar committed Oct 8, 2019
1 parent 75104bb commit 18c9222
Show file tree
Hide file tree
Showing 19 changed files with 3,118 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONSOLE_SPEED=115200
3 changes: 2 additions & 1 deletion platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(ALPHANETWORKS_SNH60B0_640F_PLATFORM_MODULE) \
$(BRCM_XLR_GTS_PLATFORM_MODULE) \
$(DELTA_AG9032V2A_PLATFORM_MODULE) \
$(JUNIPER_QFX5210_PLATFORM_MODULE)
$(JUNIPER_QFX5210_PLATFORM_MODULE) \
$(CEL_SILVERSTONE-DP_PLATFORM_MODULE)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
Expand Down
8 changes: 7 additions & 1 deletion platform/broadcom/platform-modules-cel.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Celestica DX010 and Haliburton Platform modules
# Celestica Platform modules

CEL_DX010_PLATFORM_MODULE_VERSION = 0.9
CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.9
CEL_SILVERSTONE-DP_PLATFORM_MODULE_VERSION = 0.9

export CEL_DX010_PLATFORM_MODULE_VERSION
export CEL_HALIBURTON_PLATFORM_MODULE_VERSION
export CEL_SILVERSTONE-DP_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
Expand All @@ -16,4 +18,8 @@ CEL_HALIBURTON_PLATFORM_MODULE = platform-modules-haliburton_$(CEL_HALIBURTON_PL
$(CEL_HALIBURTON_PLATFORM_MODULE)_PLATFORM = x86_64-cel_e1031-r0
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_HALIBURTON_PLATFORM_MODULE)))

CEL_SILVERSTONE-DP_PLATFORM_MODULE = platform-modules-silverstone-dp_$(CEL_SILVERSTONE-DP_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_SILVERSTONE-DP_PLATFORM_MODULE)_PLATFORM = x86_64-cel_silverstone_dp-r0
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_SILVERSTONE-DP_PLATFORM_MODULE)))

SONIC_STRETCH_DEBS += $(CEL_DX010_PLATFORM_MODULE)
5 changes: 5 additions & 0 deletions platform/broadcom/sonic-platform-modules-cel/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ Package: platform-modules-haliburton
Architecture: amd64
Depends: linux-image-4.9.0-9-2-amd64
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-silverstone-dp
Architecture: amd64
Depends: linux-image-4.9.0-9-2-amd64
Description: kernel modules for platform devices such as led, sfp.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

### BEGIN INIT INFO
# Provides: setup-board
# Required-Start: $portmap
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: S
# Default-Stop: 0 6
# Short-Description: Setup SilverStone DP board.
### END INIT INFO


case "$1" in
start)
echo -n "Setting up board... "

modprobe i2c-dev
modprobe ipmi_devintf
modprobe mc24lc64t
modprobe baseboard-lpc
modprobe i2c-ocores
modprobe cls-switchboard
modprobe xcvr-cls
modprobe switch_cpld

# Instantiate TLV EEPROM device on I801 bus
devname=`cat /sys/bus/i2c/devices/i2c-0/name`
if [[ $devname == 'SMBus I801 adapter at '* ]]; then
echo 24lc64t 0x56 > /sys/bus/i2c/devices/i2c-0/new_device
fi

# Clear syseeprom cache
decode-syseeprom --init 2> /dev/null &

# Attach switchboard CPLD i2c device
echo switch_cpld 0x30 > /sys/bus/i2c/devices/i2c-4/new_device

# Attach Optical Module EEPROM
# use optoe1 for QSFP, use optoe3 for QSFP-DD.
for i in {10..33}
do
echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-$i/new_device
done

for i in {34..39}
do
echo optoe3 0x50 > /sys/bus/i2c/devices/i2c-$i/new_device
done

echo "done."
;;

stop)
echo "done."
;;

force-reload|restart)
echo "Not supported"
;;

*)
echo "Usage: /etc/init.d/platform-modules-silverstone.init {start|stop}"
exit 1
;;
esac

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
silverstone-dp/cfg/silverstone-dp-modules.conf etc/modules-load.d
silverstone-dp/systemd/platform-modules-silverstone-dp.service lib/systemd/system
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
depmod -a
systemctl enable platform-modules-silverstone-dp.service
systemctl start platform-modules-silverstone-dp.service
2 changes: 1 addition & 1 deletion platform/broadcom/sonic-platform-modules-cel/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export INSTALL_MOD_DIR:=extra
KVERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KVERSION)
MOD_SRC_DIR:= $(shell pwd)
MODULE_DIRS:= dx010 haliburton
MODULE_DIRS:= dx010 haliburton silverstone-dp

%:
dh $@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-i801
i2c-isch
i2c-ismt
i2c-dev
i2c-mux
i2c-smbus

i2c-mux-pca954x
ipmi_devintf
ipmi_si
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-m := baseboard-lpc.o mc24lc64t.o cls-switchboard.o xcvr-cls.o i2c-ocores.o switch_cpld.o
Loading

0 comments on commit 18c9222

Please sign in to comment.