Skip to content

psanford/mirabox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

Globalsale Mirabox Unofficial Documentation

There's not a lot of good documentation about Globalscale Technology's Mirabox so this repo is intended to be a place to document and share what the community knows about it.

This was originally a gist (https://gist.github.com/psanford/6416725) but I've moved it to a full repository so that it is easier for others to contribute to.

Hardware

The Mirabox uses a Marvell Armada 370 SoC ARM chip. The Armada 370 uses the ARMv7-A architecture2. The Mirabox comes with:1

  • 1GB of RAM
  • 1GB of NAND flash
  • 2 10/100/1000 ethernet ports
  • 2 USB 3.0 host ports
  • 1 microsd card reader (2? 1 external and 1 internal)
  • 1 Mini PCIe expansion slot (taken by Wifi chip on latest revision)
  • 3 GPIO LEDs
  • 1 button (older models this was a GPIO button, newer ones it is a hardware reset)
  • 802.11b/g/n Wifi (88W8766 or 88W8787)
  • Bluetooth 4.0 (88W8766 or 88W8787) (older hardware revs had BT 3.0)

In June 2014 Marvell released detail specs for the Armada 370 SoC:

Old vs new hardware

There have been at least 3 hardware revisions of the Mirabox hardware. The following is based on my observations of different hardware units and is probably incomplete:

Rev1:

  • Metal side with "Mirabox" machined into it
  • Button on a GPIO line
  • 88W8787 combo Wifi/Bluetooth

Rev2

  • Plastic side with adhesive "Mirabox - LX" label
  • Button is hardware reset

Rev3

  • Plastic side with adhesive "Mirabox - LX" label
  • Button is hardware reset
  • 88W8766 Wifi/Bluetooth chip using the PCIe slot (the chip uses the USB bus)
  • No internal sdcard slot (the fold type); the external slot is still there

Kernel

The Mirabox originally came with a modified 2.6.35.9 kernel. More recent versions now ship with a modified 3.2.36 kernel.

Fortunately there is good support for the Armada 370 in more recent versions of the linux kernel.

What works in >= 3.14 kernel?

  • USB
  • LEDs
  • Ethernet*
  • SDCard
  • Wireless**
  • NAND flash (since 3.14)

*Ethernet works properly, but by default the NICs will have randomly assigned mac addresses. This can be done via uBoot10 if the mvneta is compiled into the kernel (not as a module). You can also read the uBoot variables for ethaddr and eth1addr using fw_printenv and set the mac addresses from an init script.

**Wireless works, but for the 88W8787 chip you must load the mvsdio kernel module with nodma=1 option11.

Building a kernel

You will need a cross compiling toolchain to build the kernel. The easiest way to get that is by downloading the one provided by Globalscale. To actually build the kernel run the following commands:

export PATH="/home/build/armv7-marvell-linux-gnueabi/bin:$PATH"
make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- mvebu_v7_defconfig
make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- zImage
make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- armada-370-mirabox.dtb
cp arch/arm/boot/zImage zImage-with-dtb
cat arch/arm/boot/dts/armada-370-mirabox.dtb >> zImage-with-dtb
./scripts/mkuboot.sh -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-marvell' -d zImage-with-dtb uImage

The uBoot version that ships with the Mirabox doesn't support device tree, you you need to append the device tree to the kernel (and select the Use appended device tree option in the kernel config.

Bootloader

The Mirabox comes with an old version of U-Boot, modified to support the hardware. Currently there is no support in mainline U-Boot for the Mirabox.

Initial work has been done to support the Mirabox in the Barebox Bootloader by Free Electrons. This is currently limited to booting via serial port7.

Building Barebox

You will need to extract a binary blob from an existing bootloader for the mirabox. The easiest way to do this is to download the u-boot image from Globalscale.

# cd into barebox root dir
mkdir /tmp/mirabox
cd scripts
make kwbimage
./kwbimage -x -i ~/downloads/u-boot-db88f6710bp_nand.bin -o /tmp/mirabox

To build barebox:

# cd into barebox root dir
export PATH="/home/build/armv7-marvell-linux-gnueabi/bin:$PATH"
cp /tmp/mirabox/kwbimage.cfg kwbimage.cfg
sed -i -e 's/nand/uart/' kwbimage.cfg
make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- mvebu_defconfig
make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi-

To boot to barebox, run the following command:

# cd into barebox root dir
./scripts/kwboot -t -b barebox-flash-image  -B 115200 /dev/ttyUSB0

What are kwbimage and kwboot?

Marvell EBU SoC supports booting an image over UART8, kwboot is a tool that implements this protocol.

The Marvell SoC requires a binary blob on boot for DDR3 training9. This is bundled with the bootloader in a specific format. kwbimage can be used to extract that binary blob from one image and add it to a new bootloader image.

Resources

Source and binaries from Globalscale can be found at:

Thanks

I want to thank the folks at Free Electrons for the work they have done to support the Armada 370 and the Mirabox.

About

Globalscale Mirabox Info

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published