Skip to content

Commit

Permalink
[platform/broadcom] Add Celestica seastone2 platform module
Browse files Browse the repository at this point in the history
  • Loading branch information
pphuchar committed Nov 6, 2019
1 parent 6cb445c commit acbfc34
Show file tree
Hide file tree
Showing 14 changed files with 2,745 additions and 3 deletions.
1 change: 1 addition & 0 deletions platform/broadcom/one-image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \
$(INVENTEC_D6356_PLATFORM_MODULE) \
$(CEL_DX010_PLATFORM_MODULE) \
$(CEL_HALIBURTON_PLATFORM_MODULE) \
$(CEL_SEASTONE2_PLATFORM_MODULE) \
$(DELTA_AG9032V1_PLATFORM_MODULE) \
$(DELTA_AG9064_PLATFORM_MODULE) \
$(DELTA_AG5648_PLATFORM_MODULE) \
Expand Down
6 changes: 6 additions & 0 deletions platform/broadcom/platform-modules-cel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

CEL_DX010_PLATFORM_MODULE_VERSION = 0.9
CEL_HALIBURTON_PLATFORM_MODULE_VERSION = 0.9
CEL_SEASTONE2_PLATFORM_MODULE_VERSION = 0.9
CEL_SILVERSTONE_PLATFORM_MODULE_VERSION = 0.9

export CEL_DX010_PLATFORM_MODULE_VERSION
export CEL_HALIBURTON_PLATFORM_MODULE_VERSION
export CEL_SEASTONE2_PLATFORM_MODULE_VERSION
export CEL_SILVERSTONE_PLATFORM_MODULE_VERSION

CEL_DX010_PLATFORM_MODULE = platform-modules-dx010_$(CEL_DX010_PLATFORM_MODULE_VERSION)_amd64.deb
Expand All @@ -18,6 +20,10 @@ 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_SEASTONE2_PLATFORM_MODULE = platform-modules-seastone2_$(CEL_SEASTONE2_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_SEASTONE2_PLATFORM_MODULE)_PLATFORM = x86_64-cel_seastone_2-r0
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_SEASTONE2_PLATFORM_MODULE)))

CEL_SILVERSTONE_PLATFORM_MODULE = platform-modules-silverstone_$(CEL_SILVERSTONE_PLATFORM_MODULE_VERSION)_amd64.deb
$(CEL_SILVERSTONE_PLATFORM_MODULE)_PLATFORM = x86_64-cel_silverstone-r0
$(eval $(call add_extra_package,$(CEL_DX010_PLATFORM_MODULE),$(CEL_SILVERSTONE_PLATFORM_MODULE)))
Expand Down
2 changes: 1 addition & 1 deletion platform/broadcom/sonic-platform-modules-cel/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
platform drivers for Celestica DX010 and Haliburton for the SONiC project
platform drivers of Celestica network switchs for the SONiC project
7 changes: 6 additions & 1 deletion platform/broadcom/sonic-platform-modules-cel/debian/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Source: sonic-cel-platform-modules
Section: main
Priority: extra
Maintainer: Abhisit Sangjan <asang@celestica.com>
Maintainer: Wirut Getbamrung <wgetbumr@celestica.com>
Build-Depends: debhelper (>= 8.0.0), bzip2
Standards-Version: 3.9.3

Expand All @@ -16,6 +16,11 @@ 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-seastone2
Architecture: amd64
Depends: linux-image-4.9.0-9-2-amd64
Description: kernel modules for platform devices such as led, sfp

Package: platform-modules-silverstone
Architecture: amd64
Depends: linux-image-4.9.0-9-2-amd64
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/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 seastone2 board.
### END INIT INFO

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

# Add driver to support HW
modprobe i2c-dev
modprobe ipmi_devintf
modprobe ipmi_si
modprobe baseboard_cpld
modprobe switchboard_fpga
modprobe mc24lc64t

# Add driver to support TLV - EEPROM
for devnum in 0 1; do
devname=`cat /sys/bus/i2c/devices/i2c-${devnum}/name`
if [[ $devname == 'SMBus iSMT adapter at '* ]]; then
echo 24lc64t 0x56 > /sys/bus/i2c/devices/i2c-${devnum}/new_device
break
fi
done
sleep 1
echo "done."
;;

stop)
echo "done."
;;

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

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

exit 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
seastone2/cfg/seastone2-modules.conf etc/modules-load.d
seastone2/systemd/platform-modules-seastone2.service lib/systemd/system
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
depmod -a
systemctl enable platform-modules-seastone2.service
systemctl start platform-modules-seastone2.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 silverstone
MODULE_DIRS:= dx010 haliburton silverstone seastone2

%:
dh $@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# /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-gpio
i2c-mux-pca954x
ipmi_devintf
ipmi_si
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
KBUILD_CFLAGS+=-DSEASTONE2
obj-m := mc24lc64t.o baseboard_cpld.o switchboard_fpga.o
Loading

0 comments on commit acbfc34

Please sign in to comment.