Skip to content

Switchdev_SDK_for_3rd_party_Slim_mode

eladnachman edited this page Sep 28, 2022 · 4 revisions

Features by driver version

Driver Version 3.2.3 (Based dentOS v2.5 features) Based on Linux Kernel 5.15 Please use GitHub issues to report issues/request new enhancements.

INDEX

  1. Preparation
  2. Build Workflow
  3. Rebuilding sources after modifications
  4. Usage of custom source codes, such as custom Linux kernel
  5. Tested host configurations

This is the buildroot-external project to build an image for the Marvell's Prestera Switch.

  1. Preparation

Install OpenSSL on the host. For debian/Ubuntu: sudo apt-get install libssl-dev Make sure cpp and gcc have the same version: gcc -v && cpp -v

Location of deliverables from GitHub:

Customers with special agreement (3rd party firmware build) who have access to the CPSS agent source code should download it and extract it into the same build machine.

  1. Workflow This section describes the basic build workflow with buildroot to compile & deploy changes made for appDemo or switchdev driver.

In case 2540/2580 PHY is used, the PHY binary (hdr extension) needs to be downloaded from the Marvell support website at https://www.marvell.com/support/extranets.html (signing NDA is required, then you can obtain user and password from your Marvell or distributor FAE). Copy the downloaded 2540/2580 PHY binary files with the hdr extension to the following directory:

board/.../.../rootfs-overlay/etc/mvsw

If you are building the agent from source (special agreement customers only - 3rd party firmware build), please point the environment variable to the directory containing the extracted source, using the following environment setting command list below:

export CPSS_AGENT_SRC_OVERRIDE_SRCDIR=/your_local_extracted_source_directory

In order to build the output binary file for the specified board, the board specific defconfig must be specified in the build command. Hence you need to choose and build a configuration for the target board, for example, an AC5x board (AC5x SoC):

Normal builds with binary agent: $ ./build.sh ac5x_trampoline

Builds with agent built from source code (3rd party firmware build): $ ./build.sh ac5x_trampoline_src

When building For the first time, it may take a long time to download the required packages and build the kernel.

After a successful build, all of the related files, binaries, and copied sources for a selected build are located in output/ac5x_trampoline. The folder contains the standard Buildroot layout:

output/ac5x_trampoline/ images/ - generated rootfs, kernel, dtb binaries /rootfs.tar - archived target rootfs /Image - kernel image /*.dtb - DTB file.

                 target/ - libs, apps installed for target
                 host/ - libs, apps installed for the host (build machine)
                 build/xxx - xxx package sources with compiled files

Build packages: Buildroot has several packages which describe how to build components needed:

package/cpss/cpss-agent - Firmware Agent (Cloned as binary blob from github) package/cpss/cpss-prestera-swdev-kmod - prestera_sw package/cpss/cpss-drivers-kmod - Int, Dma, Mbus kernel modules

  1. Rebuilding sources after modification:

The following commands will clean-up and rebuild prestera_sw sources (full rebuild):

make -C output/ac5x_trampoline prestera-swdev-kmod-dirclean prestera-swdev-kmod-dirclean

The following will deploy rootfs, kernel and dtb to the tftpboot server for NFS boot:

To deploy everything via SSH to the user's home folder on the server for NFS boot, run the following:

make -C output/ac5x_trampoline deploy

it will deploy contents of output/<build_name>/images/deploy/* folder to SSH_IP:~/<build_name> Use custom sources

  1. To use custom sources for Buildroot packages (for example linux) it might be specified

from the command line:

$ LINUX_OVERRIDE_SRCDIR={PATH_TO_LINUX_SRC_DIR} make -C output/ac5x_trampoline

or

$ LINUX_OVERRIDE_SRCDIR={PATH_TO_LINUX_SRC_DIR} ./build.sh ac5x_trampoline This variable should be specified before each Buildroot invocation.

  1. Tested host configurations:

a. Ubuntu 20.04.1 LTS focal, gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) , kernel 5.4.0-52-generic x86_64 GNU/Linux

b. Ubuntu 18.04.5 LTS bionic, gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) , kernel 4.15.0-132-generic x86_64 GNU/Linux

Clone this wiki locally