Cavium: SDK Install and build Debian image

From Define Wiki
Jump to navigation Jump to search

Prerequisits

Host OS dependancies

Ensure you install the following:

yum groupinstall "Development Tools"
yum install patch screen

Obtain the SDK from Cavium

Obtain the following two RPM packages from the Cavium support site:

  • OCTEON-SDK-3.1.0-515.i386.rpm
  • OCTEON-LINUX-3.1.0-515.i386.rpm

A USB storage device <16GB

Connect a USB storage device (e.g. USB flash drive, USB connected CF card, etc).
Identify the USB device (using lsblk in this case):

[root@mips-host ~]# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                           8:0    0 931.5G  0 disk 
├─sda1                        8:1    0   500M  0 part /boot
└─sda2                        8:2    0   931G  0 part 
  ├─VolGroup-lv_root (dm-0) 253:0    0    50G  0 lvm  /
  ├─VolGroup-lv_swap (dm-1) 253:1    0   7.9G  0 lvm  [SWAP]
  └─VolGroup-lv_home (dm-2) 253:2    0 873.2G  0 lvm  /home
sdb                           8:16   1   3.8G  0 disk 
├─sdb1                        8:17   1  67.6M  0 part 
└─sdb2                        8:18   1   3.7G  0 part

Installation

Install the two RPM packages:

[root@mips-host ~]# rpm -i --prefix /opt/310 OCTEON-* 

The OCTEON-SDK package has been successfully installed under the
/opt/310 directory.

The installation requires the OCTEON_MODEL environment variable
to be set. To set this environment variable, cd to the
/opt/310/OCTEON-SDK directory, and invoke

	  source env-setup <OCTEON_MODEL>

script. Valid OCTEON_MODELs are listed in octeon-models.txt file
under OCTEON-SDK directory.

You may want to copy the OCTEON-SDK package to your home directory to allow
modification without root privileges.
 
For more information please refer to the online SDK documentation:
file:///opt/310/OCTEON-SDK/docs/html/index.html
 
 

The Linux Kernel has been successfully installed under the directory
/opt/310/OCTEON-SDK/linux

Please refer to file:///opt/310/OCTEON-SDK/docs/html/linux.html
on how to use Linux on the OCTEON.

Build a Debian Image

Run scripts and set environment variables

Scripts

[root@mips-host ~]# cd /opt/310/OCTEON-SDK/
[root@mips-host OCTEON-SDK]# /opt/310/OCTEON-SDK/env-setup.pl OCTEON_CN66XX
export OCTEON_CPPFLAGS_GLOBAL_ADD=" -DUSE_RUNTIME_MODEL_CHECKS=1 -DCVMX_ENABLE_PARAMETER_CHECKING=0 -DCVMX_ENABLE_CSR_ADDRESS_CHECKING=0 -DCVMX_ENABLE_POW_CHECKS=0" OCTEON_MODEL="OCTEON_CN66XX" OCTEON_ROOT="/opt/310/OCTEON-SDK" ;export OCTEON_LE=

Environment Variables

[root@mips-host OCTEON-SDK]# export OCTEON_CPPFLAGS_GLOBAL_ADD=" -DUSE_RUNTIME_MODEL_CHECKS=1 -DCVMX_ENABLE_PARAMETER_CHECKING=0 -DCVMX_ENABLE_CSR_ADDRESS_CHECKING=0 -DCVMX_ENABLE_POW_CHECKS=0" OCTEON_MODEL="OCTEON_CN66XX" OCTEON_ROOT="/opt/310/OCTEON-SDK" ;export OCTEON_LE=

Start the build

[root@mips-host OCTEON-SDK]# cd linux/debian/
[root@mips-host OCTEON-SDK]# make DISK=/dev/sdb compact-flash

NB: This process can take a while (~15 minutes) depending on the storage device and the power of the host system