DB 88F8040 Modular - MarvellEmbeddedProcessors/openwrt-dd GitHub Wiki

Image configuration

Go to the distribution working directory and update the repository and package feeds:

git fetch && git rebase
./scripts/feeds update -a
./scripts/feeds install -a

Invoke the image configuration dialog:

make menuconfig

In the menu, select the following:

Target System --->
    Marvell 64b Boards
Target Profile --->
    Marvell Armada 8040 DB (DB-88F8040-A1)
Target Images  --->
    [x] ramdisk  --->
    * Root filesystem archives *
    [x] tar.gz
    * Root filesystem images *
    [x] ext4  --->
[x] Advanced configuration options (for developers)  --->
    (/opt/kernel/openwrt-kernel) Use external kernel tree
Tip
Replace kernel_dir with the distribution kernel directory and kernel_branch with appropriate release version.

Build the image with make command. To speed up the build process, you can utilize multiple cores with the following command:

make -j$(($(nproc)+1))

Binary directories

The binaries will be generated in:

  • bin/mvebu64/ directory for the OpenWrt distribution

  • bin/target/mvebu64/generic/ for the LEDE.

Booting the image

Tip
Instruction will assume the u-boot version is 17.06.2 or later. Variables may differ on the older versions.
Note
A8K has multiple serial interfaces. To connect to the serial console, select the /dev/ttyUSB0

Once the board is powered on, press any key to get into the u-boot shell.

Initramfs boot

On the host, start the tftp server in the binaries directory:

sudo in.tftpd -L -s (binaries directory)
Note
The rest of commands are executed from the board.

Set the server (PC) and client (board) IP:

setenv serverip 192.168.x.x
setenv ipaddr 192.168.x.x

Set the network interface for the second RJ-45 port (CPO_GE/CON57)

setenv ethprime egiga1
setenv netdev egiga1
setenv ethact mvpp2-2

Setup the RSS support for the network driver:

setenv extra_params 'mvpp2x.queue_mode=1; mvpp2x.rss_mode=1'

Get the image from the host:

tftpboot 0x5000000 openwrt-armada-a8k-8040-db-Image-initramfs
tftpboot 0x1500000 armada-a8k-8040-db-A.dtb

Set bootargs, and boot the image:

setenv bootargs $console $mtdparts $extra_params
booti 0x5000000 - 0x1500000

USB boot

Create a new partition on the USB. In the example below /dev/sdb will be used.

Make sure you have selected the correct device on your host before you proceed any further!

First remove any existing partitions from the usb with the dd command:

sudo dd count=1 bs=512 if=/dev/zero of=/dev/sdb && sync

1+0 records in
1+0 records out
512 bytes copied, 0.00229965 s, 223 kB/s

Then create a new linux partition:

sudo fdisk /dev/sdb

Disk /dev/sdb: 7.2 GiB, 7746879488 bytes, 15130624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2ebd3aca

Command (m for help): o
Created a new DOS disklabel with disk identifier 0xf07b8425.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-15130623, default 2048): [enter]
Last sector, +sectors or +size{K,M,G,T,P} (2048-15130623, default 15130623): [enter]

Created a new partition 1 of type 'Linux' and of size 7.2 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Format the newly created partition as ext4:

sudo mkfs.ext4 /dev/sdb1

Mount the partition on the host:

sudo mount /dev/sdb1 /mnt

While in the OpenWrt directory, extract the roofs to the USB and copy the kernel and device-tree binary:

sudo tar -xf bin/mvebu64/openwrt-mvebu64-armada-a8k-8040-db-rootfs.tar.gz -C /mnt
sudo mkdir -p /mnt/boot
sudo cp bin/mvebu64/armada-a8k-8040-db-A.dtb /mnt/boot/
sudo cp bin/mvebu64/openwrt-armada-a8k-8040-db-Image /mnt/boot/
sync
sudo umount /mnt

Plug the USB to the board and power it on. Press any key to get into the u-boot shell.

Set the environment variables:

setenv bootargs_root 'root=/dev/sda1 rw rootwait'
setenv image_name 'openwrt-armada-a8k-8040-db-Image'
setenv fdt_name 'armada-a8k-8040-db-A.dtb'
setenv extra_params 'mvpp2x.queue_mode=1; mvpp2x.rss_mode=1'
setenv bootargs $console $mtdparts $bootargs_root $extra_params
setenv bootcmd 'usb start; ext4load usb 0:1 $kernel_addr /boot/$image_name; ext4load usb 0:1 $fdt_addr boot/$fdt_name; booti $kernel_addr - $fdt_addr'

To preserve the configuration across the reboot:

saveenv

Boot the board:

boot
⚠️ **GitHub.com Fallback** ⚠️