Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

WindRiver-Labs/marvell-cn9xxx

Repository files navigation

		Marvell CN9XXX BSP


1. About this document
======================
This document describes the common and non-hardware specific information.
Please refer to README.hardware for hardware specific information.

Dependencies
------------
This layer depends on the oe-core version supplied with linux-yocto kernel.

Maintenance
-----------
This layer is maintained by Wind River Systems, Inc.
Contact <[email protected]> or your support representative for more
information on submitting changes.

Building the marvell-cn9xxx layer
---------------------------------
This layer should be added to bblayers.conf. This is done automatically
when using the Wind River setup.sh wrapper.

License
-------
Copyright (C) 2019 Wind River Systems, Inc.

The right to copy, distribute or otherwise make use of this software may
be licensed only pursuant to the terms of an applicable Wind River license
agreement. No license to Wind River intellectual properly rights is granted
herein. All rights not licensed by Wind River are reserved by Wind River.

Source code included in tree for individual recipes is under the LICENSE
stated in each recipe (.bb file) unless other stated.


2. BSP Kernel and Distros
=========================

The following table summarizes the valid Wind River Linux distros for this BSP.
'Y' in each content cell stands for supported; 'N' stands for not supported:

  +--------------+-------------+-------------+-------------+
  | valid/distro |   wrlinux   | wrlinux-cgl | wrlinux-ovp |
  +--------------+-------------+-------------+-------------+
  |    valid     |      Y      |      N      |      N      |
  +--------------+-------------+-------------+-------------+

For the supported kernel type for this BSP, please check the TARGET_SUPPORTED_KTYPES
by running 'bitbake -e virtual/kernel | grep "^TARGET_SUPPORTED_KTYPES="'.

Note: The preempt-rt ktype is not available for this BSP/Machine at this time.


3. Board Specific Patches
=========================

To get a list of patches applied to the kernel specific to this BSP
along with patch descriptions use git whatchanged on the default
kernel (git whatchanged <kernel_type>..<bsp_name>). For example:

  # cd tmp-glibc/work-shared/<bsp_name>/kernel-source
  # git whatchanged standard/base..standard/<machine name>


4. Boot Instructions
====================

The typical u-boot settings apply to these boards. You will need to use
setenv, printenv and saveenv, to configure, display and store respectively
your network configuration details and kernel command line. In order to
TFTP a kernel, you need at a minimum to set the following:

	- ipaddr
	- gatewayip
	- netmask
	- serverip
	- loadaddr
	- dtbfile
	- dtbaddr
	- ethaddr
	- eth1addr

Your board may ship with the values for the MAC address of
the Ethernet interfaces set to the defaults compiled into the
u-boot image.  You should set the ethaddr, eth1addr and so on
as per the manufacturer assigned values, usually indicated with
a sticker on the board.

Target specifics are usually set in the "bootargs" variable, and the
kernel image is set in the "bootfile" variable. Don't forget that if you
want these values to be available after a power cycle you will need to run
the saveenv command.

Typically convenience macros exist that will create a complete bootargs
command line for the kernel based on variables that contain individual
settings.  Since these macros exist as env variables themselves, they
may or may not be present depending on who installed and configured
u-boot for the board.

The console device for the board is ttyS0(cn91xx) and ttyAMA0(cn96xx) at
115200 baud. For the DTB address, 0x6f00000(cn91xx) was used with success
by Wind River. The load address must be high enough to not interfere with
kernel decompression.  A value of 0x7000000 was used with success for all
kernels tested by Wind River.

4.1 NFS Root File System
------------------------

Example settings for the monitor (u-boot) are shown below:

nfsboot=setenv bootargs root=/dev/nfs rw nfsroot=$serverip:$rootpath \
ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off \
console=$consoledev,$baudrate $othbootargs;tftp $loadaddr $bootfile; \
tftp $fdtaddr $fdtfile;booti $loadaddr - $fdtaddr
ethaddr=00:04:9F:02:00:FD
eth1addr=00:04:9F:02:01:FD
eth2addr=00:04:9F:02:02:FD
loadaddr=0x6000000
fdtaddr=0x6f00000
gatewayip=192.168.1.1
netmask=255.255.255.0
ipaddr=192.168.1.100
serverip=192.168.1.2
netdev=eth1
ethact=eth1
ethprime=asix_eth
bootfile=Image
fdtfile=cn9130-db-A.dtb
rootpath=/tftpboot/rootfs
consoledev=ttyS0
baudrate=115200

5. DPDK
=======

5.1 Build Configuration
-----------------------
Please refer to the "Build Configuration" section in the feature/dpdk/README
for more details about how to enable it.

5.2.1 Running the DPDK Examples on CN91XX
-----------------------------------------
The following uses the testpmd as an example to demonstrate how to run the DPDK
examples:
  1. Setup hugepages:
     # echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

  2. Bring the interfaces up:
     # ip link set dev eth0 up
     # ip link set dev eth2 up

  3. Insert kernel modules:
     # rmmod uio_pdrv_genirq
     # modprobe musdk_cma
     # modprobe uio_pdrv_genirq of_id="generic-uio"

  4. Run the Application:
     # testpmd --vdev=net_mvpp2,iface=eth0,iface=eth2

5.2.2 Running the DPDK examples on CN96XX (non-sso)
---------------------------------------------------
The following uses the testpmd as an example to demonstrate how to run the DPDK
examples:
  1. Setup hugepages:
     # echo 24 >/proc/sys/vm/nr_hugepages

  2. Bind the interfaces:
     # dpdk-devbind -u 0002:03:00.0 0002:05:00.0
     # dpdk-devbind -b vfio-pci 0002:03:00.0 0002:05:00.0

  3. Run the Application:
     # testpmd

5.2.3 Running the DPDK examples on CN96XX (sso)
-----------------------------------------------
The following uses the dpdk-test-eventdev as an example to demonstrate how to
run the DPDK examples:
  1. Setup hugepages:
     # echo 24 >/proc/sys/vm/nr_hugepages

  2. Bind the interfaces:
     # dpdk-devbind -u 0002:0e:00.0 0002:05:00.0
     # dpdk-devbind -b vfio-pci 0002:0e:00.0 0002:05:00.0

  3. Create SSO VFs and bind to vfio-pci:
     # echo "177d a0f9" >/sys/bus/pci/drivers/vfio-pci/new_id

  4. Clear limits of all devices created with “a0f9” device id as below:
     # echo 0 > /sys/bus/pci/devices/0002:0a:00.0/limits/sso
     # echo 0 > /sys/bus/pci/devices/0002:0a:00.0/limits/ssow
     # echo 0 > /sys/bus/pci/devices/0002:0b:00.0/limits/sso
     # echo 0 > /sys/bus/pci/devices/0002:0b:00.0/limits/ssow
     # echo 0 > /sys/bus/pci/devices/0002:0c:00.0/limits/sso
     # echo 0 > /sys/bus/pci/devices/0002:0c:00.0/limits/ssow
     # echo 0 > /sys/bus/pci/devices/0002:0d:00.0/limits/sso
     # echo 0 > /sys/bus/pci/devices/0002:0d:00.0/limits/ssow
     # echo 0 > /sys/bus/pci/devices/0002:0e:00.0/limits/sso
     # echo 0 > /sys/bus/pci/devices/0002:0e:00.0/limits/ssow

  5. Set limits as below:
     # echo 0 > /sys/bus/pci/devices/0002:0e:00.0/limits/tim
     # echo 1 > /sys/bus/pci/devices/0002:0e:00.0/limits/npa
     # echo 16 > /sys/bus/pci/devices/0002:0e:00.0/limits/sso
     # echo 26 > /sys/bus/pci/devices/0002:0e:00.0/limits/ssow

  6. Run the Application:
     # dpdk-test-eventdev -l 22-23 -w 0002:0e:0.0 -w 0002:05:0.0 -- --prod_type_ethdev --nb_pkts=0 --verbose 2 --test=pipeline_atq --stlist=A --w
lcores=23

6. WIC Image
============
Please refer to the Yocto manual for the detailed info about WIC. After building
the project, the WIC image is at:
   tmp-glibc/deploy/images/marvell-cn91xx/wrlinux-image-glibc-std-<machine name>.wic

Then user can burn this image to a SD card.

6.1 Burn the image to SD card
-----------------------------
    # dd if=wrlinux-image-glibc-std-<machine name>.wic of=/dev/your_sd_dev bs=1M conv=fsync

6.2 Set uboot env for cn91xx
----------------------------
    # setenv kernel_addr_r 0x7000000
    # setenv fdt_addr_r 0x6f00000
    # fatload mmc 1 $kernel_addr_r Image
    # fatload mmc 1 $fdt_addr_r cn9130-db-A.dtb
    # setenv bootargs console=ttyS0,115200 root=/dev/mmcblk1p2 pci=pcie_bus_safe cpuidle.off=1 rootwait
    # booti $kernel_addr_r - $fdt_addr_r

6.3 Set uboot env for cn96xx
----------------------------
    # setenv loadaddr 0x040080000
    # fatload mmc 0:2 $loadaddr Image
    # setenv bootargs console=ttyAMA0,115200 root=/dev/mmcblk0p3 maxcpus=24 rootwait coherent_pool=16M net.ifnames=0
    # booti $loadaddr - $fdtaddr

    If you want to boot from the SD card, you also need to burn the boot
    firmware to the SD card with command like this after burning the WIC image:
        sudo dd if=octeontx-bootfs-uboot-t96.img of=/dev/your_sd_dev bs=512 seek=128 skip=128 conv=fsync

    Please ask the Marvell for the cn96xx boot firmware image.

About

Marvell CN9xxx BSP layer for Wind River Linux

Resources

Stars

Watchers

Forks

Packages

No packages published