Table of contents
$this->bbcode_list('1')
$this->bbcode_list('1')
$this->bbcode_list('1')
$this->bbcode_list('1')
1. Requirements
I am going with the cross compilation method, because compiling on the plug takes few hours and it could be problematic to re-compile after every change of the configuration. Open up a terminal and let's begin.
You will need an ARM compiler toolchain to do this. I recommend arm-linux-gnueabi-gcc[1], so search for it and install with your package manager.
Also you will need to install the so called build essentials. On debian-based systems $this->bbcode_second_pass_code('', 'apt-get install build-essential') and on Arch $this->bbcode_second_pass_code('', 'pacman -S kernel26-headers file base-devel abs') will do the trick.
For installing the latest U-Boot you will need the JTAG developer kit from GlobalScale and get OpenOCD utility installed.
It is optional, but to deploy the binaries on Dreamplug the easy way I recommend installing netcat utility.
Setting up the root file-system can be done according to the Quick start guide PDF putting your favorite distro on it.
There is one exception: the latest U-Boot can handle ext2 filesystem, so you may want to format the /boot partition to ext2.
2 What will/will not be working?
- [WORKING] Linux kernel 3.7.8 with Flattened Device Tree (FDT) support[4]
- [WORKING] The latest Arch Linux ARM as OS
- [WORKING] Networking via. Gigabit Ethernet
- [WORKING Audio playback
- [WORKING] USB mass storage device (external HDDs)
- [WORKING] Controlling LEDs
- [NOT TESTED] eSATA ports
- [NOT TESTED] SD card socket
- [NOT WORKING] WIFI AP mode
- [NOT WORKING] WIFI client mode
3 Linux kernel[3][4]
Grab and unpack the source code:
$this->bbcode_second_pass_code('', 'wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.8.tar.bz2
tar xvfj linux-3.7.8.tar.bz2
')
Here is my .config file which is only for the Dreamplug. Wireless and audio drivers set as modules, others features will be built into the kernel image. Of course it can be or should be changed to meet your needs.
$this->bbcode_second_pass_code('', 'wget http://pastebin.com/raw.php?i=Z0MicyJ3 -O linux-3.7.8/.config')
3.1. Compiling[3][4]
$this->bbcode_second_pass_code('', 'cd linux-3.7.8
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
make oldconfig
make menuconfig # Can be skipped if you don not want to change the configuration
make all
make uImage
mkdir -p modules_install
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=modules_install/ modules_install
sudo tar cfz modules-3.7.8-dreamplug.tar.gz -C modules_install/ .')
3.2. Install kernel and modules[4]
Terminal for your computer is represented as user@dev and Dreamplug as root@dreamplug in command lines below:
$this->bbcode_second_pass_code('', 'user@dev$ netcat -l -p 6666 < arch/arm/boot/uImage
root@dreamplug /boot# netcat 10.42.54.158 6666 > uImage-3.7.8
root@dreamplug /boot# rm uImage
root@dreamplug /boot# ln -s uImage-3.7.8 uImage
user@dev$ netcat -l -p 6666 < arch/arm/boot/kirkwood-dreamplug.dtb
root@dreamplug /boot# netcat 10.42.54.158 6666 > kirkwood-dreamplug.dtb
user@dev$ netcat -l -p 6666 < modules-3.7.8-dreamplug.tar.gz
root@dreamplug /boot# netcat 10.42.54.158 6666 > modules-3.7.8-dreamplug.tar.gz
root@dreamplug /boot# cd /tmp/
root@dreamplug /tmp# tar xvfz /boot/modules-3.7.8-dreamplug.tar.gz .
root@dreamplug /tmp# cp -R lib/modules/3.7.8-dreamplug/ /lib/modules')
4.1. Compiling
$this->bbcode_second_pass_code('', 'cd u-boot-2013.01
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
make dreamplug_config
make all
make u-boot.kwb')
4.2. Install to SPI flash[4]
Prepare the JTAG developer kit according to the User guide.
Install and start TFTP server (tftpd) and issue
$this->bbcode_second_pass_code('', 'cp u-boot.kwb /srv/tftp/u-boot.kwb')
Terminal1:
$this->bbcode_second_pass_code('', 'cd /path/to/u-boot_build_dir
make u-boot.elf
mv u-boot.elf uboot.elf
openocd -f /usr/share/openocd/scripts/board/sheevaplug.cfg')
Terminal2:
$this->bbcode_second_pass_code('', 'telnet localhost 4444
reset ; init ; sheevaplug_load_uboot')
Terminal3:
Instead of screen, minicom can be used as well.
$this->bbcode_second_pass_code('', 'screen /dev/ttyUSB0 115200
Marvell>> setenv ipaddr 192.168.1.2
Marvell>> setenv serverip 192.168.1.1
Marvell>> tftpboot 0x6400000 u-boot.kwb
Marvell>> sf probe 0
Marvell>> sf erase 0x0 0x100000
Marvell>> sf write 0x6400000 0x0 0x2fd74
Where "0x2fd74" is the size of u-boot.kwb image.')
4.3. Setup environment[2]
$this->bbcode_second_pass_code('', 'Marvell>> setenv x_bootcmd_fdt ext2load usb 0 0xd000000 kirkwood-dreamplug.dtb
Marvell>> setenv x_bootcmd_kernel ext2load usb 0 0x6400000 uImage
Marvell>> setenv bootcmd '${x_bootcmd_usb}; ${x_bootcmd_kernel}; ${x_bootcmd_fdt}; setenv bootargs ${x_bootargs} ${x_bootargs_root}; bootm 0x6400000 - 0xd000000;'
Marvell>> saveenv
Marvell>> reset')
5.1. Bluetooth[4]
Installing and enabling the service:
$this->bbcode_second_pass_code('', 'pacman -S bluez
systemctl enable bluetooth.service')
Currently two drivers provides support for Marvell Bluetooth devices 8688/8787/8797 are libertas_sdio and btmrvl_sdio. For some reason or another they are in conflict with each other so libertas module should be disabled:
$this->bbcode_second_pass_code('', 'nano /etc/modprobe.d/blacklist.conf
# add lines:
# Do not load, because it conflicts with btmrvl_sdio driver.
blacklist libertas_sdio')
On the other hand it requires binary firmware from marvell. The file sd8688.bin and sd8688_helper.bin are used by btmrvl module and must be available under /lib/firmware directory. If they are missing you will see an error message in dmesg output. To solve this first install linux-firmware package, then create symlinks for them like this:
$this->bbcode_second_pass_code('', 'cd /lib/firmware
ln -s libertas/sd8688.bin sd8688.bin
ln -s libertas/sd8688_helper.bin sd8688_helper.bin')
5.1.1. Turning the LED on/off using systemd
This will turn on the blue LED of the Dreamplug when bluetooth.service is started at boot time. Put the following text into bluetooth-led.service file under /etc/systemd/system directory.
$this->bbcode_second_pass_quote('', '[')Unit]
Description=Bluetooth LED service
Requires=bluetooth.service
After=bluetooth.service
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo "timer" > /sys/class/leds/dreamplug\:blue\:bluetooth/trigger; echo "1300" > /sys/class/leds/dreamplug\:blue\:bluetooth/delay_off'
RemainAfterExit=yes
ExecStop=/bin/bash -c 'echo "none" > /sys/class/leds/dreamplug\:blue\:bluetooth/trigger'
[Install]
WantedBy=bluetooth.target