Getting Started with MUSDK


The source code branches xxx-17.04 are based on Marvell engineering drop, minimum tests are performed on MACCHIATObin board with this version of software. Please proceed with caution.

Download MUSDK package

Marvell User-Space SDK(MUSDK) is publicly available from the github. To build the MUSDK for MACCHIATObin board, firstly we need to create a directory in the local build machine and download the MUSDK package to the directory.

mcbin@buildserver:~$ mkdir musdk
mcbin@buildserver:~$ cd musdk/
mcbin@buildserver:~/musdk$ git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell .

Checkout to the branch musdk-armada-17.04-macchiatobin used for MACCHIATObin:

mcbin@buildserver:~/musdk$ git checkout musdk-armada-17.04-macchiatobin
Branch musdk-armada-17.04-macchiatobin set up to track remote branch musdk-armada-17.04-macchiatobin from origin.
Switched to a new branch 'musdk-armada-17.04-macchiatobin'


Patch and rebuild the kernel

Linux Kernel needs to be patched and rebuilt in order to run MUSDK on the MACCHIATObin board. Before patching the Linux, you'll need to download the kernel source from the repository https://github.com/MarvellEmbeddedProcessors/linux-marvell and check out to the branch linux-4.4.52-armada-17.04.

mcbin@buildserver:~/kernel/4.4.52$ git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell .
mcbin@buildserver:~/kernel/4.4.52$ git checkout linux-4.4.52-armada-17.04

Then, patch the Kernel source with the patches available in the MUSDK repository you have downloaded previously. The Kernel patches are located in the sub directory patches/linux.

mcbin@buildserver:~/kernel/4.4.52$ git am ~/musdk/patches/linux/*.patch

Now you have the Kernel source with all the patches applied, build the kernel.

mcbin@buildserver:~/kernel/4.4.52$ make mvebu_v8_lsp_defconfig
mcbin@buildserver:~/kernel/4.4.52$ make -j5

Once you have your kernel rebuilt, the Image will be available at the arch/arm64/boot directory, and the dtb file armada-8040-mcbin.dtb is located at the directory arch/arm64/boot/dts/marvell.

Build required Kernel modules

Please make sure the CROSS_COMPILE is setup correctly - you should have already done so since you have successfully built you kernel. Setup the Kernel directory prior to build the Kernel modules in MUSDK source code.

mcbin@buildserver:~/musdk$ export KDIR=~/kernel/4.4.52/

Build MUSDD UIO kernel module:

mcbin@buildserver:~/musdk$ cd modules/uio/
mcbin@buildserver:~/musdk/modules/uio$ make

Build PP2 kernel module:

mcbin@buildserver:~/musdk$ cd modules/pp2/
mcbin@buildserver:~/musdk/modules/pp2$ make

Build SAM UIO kernel module:

mcbin@buildserver:~/musdk$ cd modules/sam/
mcbin@buildserver:~/musdk/modules/sam$ make


Configure and Build MUSDK

To build the MUSDK package, first you'll need to run the bootstrap:

mcbin@buildserver:~/musdk$ ./bootstrap

Run configure and make:

mcbin@buildserver:~/musdk$ ./configure
mcbin@buildserver:~/musdk$ make -j5

After the make finishes, run make install to install the binaries. By default the binaries will be installed in the usr/local sub-directory under your MUSDK dir.

mcbin@buildserver:~/musdk$ make install


Run the MUSDK application examples

Before you proceed, we assume you already have a working Buildroot root file system for your MACCHIATObin board. If you have not done so, please find the instructions in Build from source - Buildroot to build a root file system for your board.

Please copy all the binaries you built following the instructions within this page to your bootable storage media, including kernel image/dtb, kernel modules and MUSDK binaries. Then, boot your MACCHIATObin with the new kernel. To confirm you have boot to the right kernel, you may use the uname and dmesg to check the output.

# uname -a
Linux buildroot 4.4.52-devel-17.04.2-g18e61f4 #1 SMP PREEMPT Thu Apr 13 14:52:29 PDT 2017 aarch64 GNU/Linux
# dmesg |grep pp2
[    3.003286] mvpp2 f2000000.ppv22: mvpp2x: interrupt_tx_done override to false
[    3.012132] mvpp2 f2000000.ppv22 eth0: Status: non-kernel
[    3.017562] mvpp2 f2000000.ppv22 eth0: Using device tree mac address 02:50:43:ff:ff:01
[    3.030517] mvpp2 f2000000.ppv22 pp2_lpbk0: Status: non-kernel
[    3.036573] mvpp2 f2000000.ppv22 pp2_lpbk0: Using random mac address a6:8e:a4:1c:6b:fd
[    3.054564] mvpp2 f4000000.ppv22 eth1: Status: non-kernel
[    3.060184] mvpp2 f4000000.ppv22 eth1: Using device tree mac address 02:50:43:ff:ff:02
[    3.081076] mvpp2 f4000000.ppv22 eth2: Status: okay
[    3.086173] mvpp2 f4000000.ppv22 eth2: Using device tree mac address 02:50:43:ff:ff:03
[    3.107167] mvpp2 f4000000.ppv22 eth3: Status: okay
[    3.112268] mvpp2 f4000000.ppv22 eth3: Using device tree mac address 02:50:43:ff:ff:04
[    3.125252] mvpp2 f4000000.ppv22 pp2_lpbk1: Status: non-kernel
[    3.131304] mvpp2 f4000000.ppv22 pp2_lpbk1: Using random mac address e6:50:cb:bb:c8:69

The non-kernel status shown in the example output above for the eth0 port means the eth0 is reserved for MUSDK use. Now, you'll need to bring up these Ethernet ports with ifconfig.

# ifconfig eth0 up
# ifconfig eth0 promisc
# ifconfig eth1 up
# ifconfig eth1 promisc

Next, insert kernel modules before run the MUSDK examples:

# insmod musdk_uio.ko
# insmod mv_pp_uio.ko

To run the DMA memory test, please use the musdk_dma_mem application.

# cd /usr/local/bin/
# ./musdk_dma_mem
Marvell Armada US (Build: Apr 13 2017 15:08:51)
DMA memory test:

To run MUSDK pkt-echo application to bridge the eth0 and eth1 Ethernet ports, use the command below:

# ./musdk_pkt_echo -i eth0,eth1 -c 1 -m f:1 --no-echo