Skip to content

Commit

Permalink
Update Centec platform support for Bullseye and 5.10 kernel (#7)
Browse files Browse the repository at this point in the history
1. Fix build for armhf and arm64
2. upgrade centec tsingma bsp support to 5.10 kernel
3. modify centec platform driver for linux 5.10

Co-authored-by: Shi Lei <shil@centecnetworks.com>
  • Loading branch information
2 people authored and saiarcot895 committed Nov 10, 2021
1 parent b4dda1c commit 5b28476
Show file tree
Hide file tree
Showing 80 changed files with 8,258 additions and 8,073 deletions.
20 changes: 10 additions & 10 deletions files/apt/sources.list.arm64
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Debian mirror for ARM
## Not the repo mirror site can change in future, and needs to be updated to be in sync

deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free
deb [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free
deb [arch=arm64] http://ftp.debian.org/debian buster-backports main
deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster main contrib non-free
deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian buster main contrib non-free
deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free
deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free
deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster-backports main
deb [arch=arm64] http://deb.debian.org/debian bullseye main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian bullseye main contrib non-free
deb [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb [arch=arm64] http://ftp.debian.org/debian bullseye-backports main
# deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free
# deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free
# deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free
# deb-src [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free
# deb [arch=arm64] http://packages.trafficmanager.net/debian/debian bullseye-backports main
20 changes: 10 additions & 10 deletions files/apt/sources.list.armhf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Debian mirror for ARM
## Not the repo mirror site can change in future, and needs to be updated to be in sync

deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free
deb [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free
deb [arch=armhf] http://ftp.debian.org/debian buster-backports main
deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster main contrib non-free
deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian buster main contrib non-free
deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free
deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free
deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster-backports main
deb [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free
deb [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb [arch=armhf] http://ftp.debian.org/debian bullseye-backports main
# deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free
# deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye main contrib non-free
# deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free
# deb-src [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-updates main contrib non-free
# deb [arch=armhf] http://packages.trafficmanager.net/debian/debian bullseye-backports main
2 changes: 1 addition & 1 deletion files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ clean_proc() {
sudo umount /proc || true
}
trap_push clean_proc
sudo mount proc /proc -t proc
sudo mount proc /proc -t proc || true
sudo mkdir $FILESYSTEM_ROOT/target
sudo mount --bind target $FILESYSTEM_ROOT/target
sudo LANG=C DOCKER_HOST="$DOCKER_HOST" chroot $FILESYSTEM_ROOT docker info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free
deb [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free
deb [arch=arm64] http://security.debian.org buster/updates main contrib non-free
deb-src [arch=arm64] http://security.debian.org buster/updates main contrib non-free
deb [arch=arm64] https://download.docker.com/linux/debian buster stable
deb [arch=arm64] http://ftp.debian.org/debian buster-backports main
deb [arch=arm64] http://deb.debian.org/debian bullseye main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian bullseye main contrib non-free
deb [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src [arch=arm64] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb [arch=arm64] http://security.debian.org bullseye-security main contrib non-free
deb-src [arch=arm64] http://security.debian.org bullseye-security main contrib non-free
deb [arch=arm64] https://download.docker.com/linux/debian bullseye stable
deb [arch=arm64] http://ftp.debian.org/debian bullseye-backports main

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free
deb [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free
deb [arch=armhf] http://security.debian.org buster/updates main contrib non-free
deb-src [arch=armhf] http://security.debian.org buster/updates main contrib non-free
deb [arch=armhf] https://download.docker.com/linux/debian buster stable
deb [arch=armhf] http://ftp.debian.org/debian buster-backports main
deb [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian bullseye main contrib non-free
deb [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src [arch=armhf] http://deb.debian.org/debian bullseye-updates main contrib non-free
deb [arch=armhf] http://security.debian.org bullseye-security main contrib non-free
deb-src [arch=armhf] http://security.debian.org bullseye-security main contrib non-free
deb [arch=armhf] https://download.docker.com/linux/debian bullseye stable
deb [arch=armhf] http://ftp.debian.org/debian bullseye-backports main

2 changes: 1 addition & 1 deletion platform/centec-arm64/modules
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ rtc-sd2405
ctc5236_switch
ctc5236_mdio
ctcmac
ctcmac_test
ctc5236-mc
ctc_wdt
ehci-ctc
Expand All @@ -20,3 +19,4 @@ pwm-ctc
ext4
overlay
squashfs
mars
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
KBUILD_EXTRA_SYMBOLS = /sonic/platform/centec-arm64/sonic-platform-modules-e530/pca954x/Module.symvers

obj-m := centec_e530_24x2c_platform.o
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/platform_data/pca954x.h>
#include <linux/device.h>
#include <linux/kdev_t.h>
#include <linux/leds.h>
Expand Down Expand Up @@ -129,7 +128,7 @@ static int e530_24x2c_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio0 = i2c_new_device(i2c_adp_gpio0, &i2c_dev_gpio0);
i2c_client_gpio0 = i2c_new_client_device(i2c_adp_gpio0, &i2c_dev_gpio0);
if(IS_INVALID_PTR(i2c_client_gpio0))
{
i2c_client_gpio0 = NULL;
Expand All @@ -145,7 +144,7 @@ static int e530_24x2c_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio1 = i2c_new_device(i2c_adp_gpio1, &i2c_dev_gpio1);
i2c_client_gpio1 = i2c_new_client_device(i2c_adp_gpio1, &i2c_dev_gpio1);
if(IS_INVALID_PTR(i2c_client_gpio1))
{
i2c_client_gpio1 = NULL;
Expand All @@ -161,7 +160,7 @@ static int e530_24x2c_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio2 = i2c_new_device(i2c_adp_gpio2, &i2c_dev_gpio2);
i2c_client_gpio2 = i2c_new_client_device(i2c_adp_gpio2, &i2c_dev_gpio2);
if(IS_INVALID_PTR(i2c_client_gpio2))
{
i2c_client_gpio2 = NULL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
KBUILD_EXTRA_SYMBOLS = /sonic/platform/centec-arm64/sonic-platform-modules-e530/pca954x/Module.symvers

obj-m := centec_e530_24x2q_platform.o
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/platform_data/pca954x.h>
#include <linux/device.h>
#include <linux/kdev_t.h>
#include <linux/leds.h>
Expand Down Expand Up @@ -129,7 +128,7 @@ static int e530_24x2q_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio0 = i2c_new_device(i2c_adp_gpio0, &i2c_dev_gpio0);
i2c_client_gpio0 = i2c_new_client_device(i2c_adp_gpio0, &i2c_dev_gpio0);
if(IS_INVALID_PTR(i2c_client_gpio0))
{
i2c_client_gpio0 = NULL;
Expand All @@ -145,7 +144,7 @@ static int e530_24x2q_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio1 = i2c_new_device(i2c_adp_gpio1, &i2c_dev_gpio1);
i2c_client_gpio1 = i2c_new_client_device(i2c_adp_gpio1, &i2c_dev_gpio1);
if(IS_INVALID_PTR(i2c_client_gpio1))
{
i2c_client_gpio1 = NULL;
Expand All @@ -161,7 +160,7 @@ static int e530_24x2q_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio2 = i2c_new_device(i2c_adp_gpio2, &i2c_dev_gpio2);
i2c_client_gpio2 = i2c_new_client_device(i2c_adp_gpio2, &i2c_dev_gpio2);
if(IS_INVALID_PTR(i2c_client_gpio2))
{
i2c_client_gpio2 = NULL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
KBUILD_EXTRA_SYMBOLS = /sonic/platform/centec-arm64/sonic-platform-modules-e530/pca954x/Module.symvers

obj-m := centec_e530_48s4x_platform.o
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/platform_data/pca954x.h>
#include <linux/device.h>
#include <linux/kdev_t.h>
#include <linux/leds.h>
Expand Down Expand Up @@ -197,7 +196,7 @@ static int e530_48s4x_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio0 = i2c_new_device(i2c_adp_gpio0, &i2c_dev_gpio0);
i2c_client_gpio0 = i2c_new_client_device(i2c_adp_gpio0, &i2c_dev_gpio0);
if(IS_INVALID_PTR(i2c_client_gpio0))
{
i2c_client_gpio0 = NULL;
Expand All @@ -213,7 +212,7 @@ static int e530_48s4x_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio1 = i2c_new_device(i2c_adp_gpio1, &i2c_dev_gpio1);
i2c_client_gpio1 = i2c_new_client_device(i2c_adp_gpio1, &i2c_dev_gpio1);
if(IS_INVALID_PTR(i2c_client_gpio1))
{
i2c_client_gpio1 = NULL;
Expand Down Expand Up @@ -274,7 +273,7 @@ static int e530_48s4x_init_i2c_epld(void)
return -1;
}

i2c_client_epld = i2c_new_device(i2c_adp_master, &i2c_dev_epld);
i2c_client_epld = i2c_new_client_device(i2c_adp_master, &i2c_dev_epld);
if(IS_INVALID_PTR(i2c_client_epld))
{
i2c_client_epld = NULL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
KBUILD_EXTRA_SYMBOLS = /sonic/platform/centec-arm64/sonic-platform-modules-e530/pca954x/Module.symvers

obj-m := centec_e530_48t4x_p_platform.o
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/platform_data/pca954x.h>
#include <linux/device.h>
#include <linux/kdev_t.h>
#include <linux/leds.h>
Expand Down Expand Up @@ -195,7 +194,7 @@ static int e530_48t4x_p_init_i2c_gpio(void)
return -1;
}

i2c_client_gpio0 = i2c_new_device(i2c_adp_gpio0, &i2c_dev_gpio0);
i2c_client_gpio0 = i2c_new_client_device(i2c_adp_gpio0, &i2c_dev_gpio0);
if(IS_INVALID_PTR(i2c_client_gpio0))
{
i2c_client_gpio0 = NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ Standards-Version: 3.9.3

Package: platform-modules-e530-48t4x-p
Architecture: arm64
Depends: linux-image-4.19.0-12-2-arm64-unsigned
Depends: linux-image-5.10.0-8-2-arm64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-e530-24x2c
Architecture: arm64
Depends: linux-image-4.19.0-12-2-arm64-unsigned
Depends: linux-image-5.10.0-8-2-arm64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-e530-48s4x
Architecture: arm64
Depends: linux-image-4.19.0-12-2-arm64-unsigned
Depends: linux-image-5.10.0-8-2-arm64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp

Package: platform-modules-e530-24x2q
Architecture: arm64
Depends: linux-image-4.19.0-12-2-arm64-unsigned
Depends: linux-image-5.10.0-8-2-arm64-unsigned
Description: kernel modules for platform devices such as fan, led, sfp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ function install_python_api_package()
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

rv=$(pip2 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip2 install $device/$platform/sonic_platform-1.0-py2-none-any.whl)
fi
rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)
Expand All @@ -34,6 +30,7 @@ function load_kernel_modules()
ifconfig eth0 hw ether $hwaddr
fi
depmod -a
modprobe ctc-i2c-mux-pca954x
modprobe centec_e530_24x2c_platform
modprobe fan-ctc5236
modprobe dal
Expand All @@ -48,6 +45,7 @@ function remove_kernel_modules()
modprobe -r dal
modprobe -r fan-ctc5236
modprobe -r centec_e530_24x2c_platform
modprobe -r ctc-i2c-mux-pca954x
}

case "$1" in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
24x2c/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/arm64-centec_e530_24x2c-r0
24x2c/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-centec_e530_24x2c-r0
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ function install_python_api_package()
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

rv=$(pip2 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip2 install $device/$platform/sonic_platform-1.0-py2-none-any.whl)
fi
rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)
Expand All @@ -34,6 +30,7 @@ function load_kernel_modules()
ifconfig eth0 hw ether $hwaddr
fi
depmod -a
modprobe ctc-i2c-mux-pca954x
modprobe centec_e530_24x2q_platform
modprobe fan-ctc5236
modprobe dal
Expand All @@ -48,6 +45,7 @@ function remove_kernel_modules()
modprobe -r dal
modprobe -r fan-ctc5236
modprobe -r centec_e530_24x2q_platform
modprobe -r ctc-i2c-mux-pca954x
}

case "$1" in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
24x2q/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/arm64-centec_e530_24x2q-r0
24x2q/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-centec_e530_24x2q-r0
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ function install_python_api_package()
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

rv=$(pip2 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip2 install $device/$platform/sonic_platform-1.0-py2-none-any.whl)
fi
rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)
Expand All @@ -34,6 +30,7 @@ function load_kernel_modules()
ifconfig eth0 hw ether $hwaddr
fi
depmod -a
modprobe ctc-i2c-mux-pca954x
modprobe centec_e530_48s4x_platform
modprobe fan-ctc5236
modprobe dal
Expand All @@ -48,6 +45,7 @@ function remove_kernel_modules()
modprobe -r dal
modprobe -r fan-ctc5236
modprobe -r centec_e530_48s4x_platform
modprobe -r ctc-i2c-mux-pca954x
}

case "$1" in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
48s4x/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/arm64-centec_e530_48s4x-r0
48s4x/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-centec_e530_48s4x-r0
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ function install_python_api_package()
device="/usr/share/sonic/device"
platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

rv=$(pip2 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip2 install $device/$platform/sonic_platform-1.0-py2-none-any.whl)
fi
rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null)
if [ $? -ne 0 ]; then
rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl)
Expand All @@ -34,6 +30,7 @@ function load_kernel_modules()
ifconfig eth0 hw ether $hwaddr
fi
depmod -a
modprobe ctc-i2c-mux-pca954x
modprobe centec_e530_48t4x_p_platform
modprobe fan-ctc5236
modprobe dal
Expand All @@ -48,6 +45,7 @@ function remove_kernel_modules()
modprobe -r dal
modprobe -r fan-ctc5236
modprobe -r centec_e530_48t4x_p_platform
modprobe -r ctc-i2c-mux-pca954x
}

case "$1" in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
48t4x-p/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/arm64-centec_e530_48t4x_p-r0
48t4x-p/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/arm64-centec_e530_48t4x_p-r0
Loading

0 comments on commit 5b28476

Please sign in to comment.