RaspberryPi3

Differences between revisions 1 and 16 (spanning 15 versions)
Revision 1 as of 2016-05-05 02:02:46
Size: 4508
Editor: fo0bar
Comment:
Revision 16 as of 2017-09-26 19:21:30
Size: 3620
Editor: adamsmith
Comment: Removed dated 64bit info
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
The [[ARM/RaspberryPi|Raspberry Pi]] 3 was released in early April 2016, shortly before the release of Ubuntu 14.04 (Xenial) LTS, but too short to have proper support. It is possible to run Xenial's kernel (minus built-in Bluetooth and Wifi support) and a full Ubuntu installation, but it requires replacing the firmware, bootloader and some other hacks. The [[ARM/RaspberryPi|Raspberry Pi]] 3 was released in early March 2016, shortly before the release of Ubuntu 16.04 (Xenial) LTS, but too short to have proper support. It is possible to run Xenial's kernel and a full Ubuntu installation, but it requires replacing the firmware, bootloader and some other hacks.
Line 7: Line 7:
While the BCM2710 is a 64-bit CPU, as of this writing there is no firmware or kernel support for it arm64 mode yet. As such, you will be left with a 32-bit installation. == Fresh installation ==

One-off raspi3 images are available which include the ppa-rpi3 PPA pre-installed. For installation details, see [[ARM/RaspberryPi]].

== Cross-hardware upgrade ==
Line 13: Line 17:
== Xenial upgrade procedure == Install a PPA which contains updated u-boot-rpi, flash-kernel and linux-firmware-raspi2 packages, and upgrade.
{{{
add-apt-repository ppa:ubuntu-raspi2/ppa-rpi3
apt-get update
apt-get -u dist-upgrade
}}}
Line 15: Line 24:
First, grab and install a new u-boot bootloader. The one provided by u-boot-rpi on xenial is not new enough. The one provided on finnie.org is a straight "make rpi_3_32b_defconfig && make" compilation on u-boot's git HEAD (b38eaec53570821043c94ad44eabcb23747d9969 as of this writing), but 2016.05 (still in RC as of this writing) or later should be fine if you want to compile it yourself. Install the RPi3 u-boot loader.
Line 17: Line 26:
wget -O /tmp/u-boot.bin http://www.finnie.org/software/raspberrypi/ubuntu-rpi3/u-boot-b38eaec.bin apt-get install binutils # Required by mkknlimg, may not be installed
Line 20: Line 29:
/tmp/mkknlimg --dtok /tmp/u-boot.bin /boot/firmware/uboot.bin /tmp/mkknlimg --dtok /usr/lib/u-boot/rpi_3_32b/u-boot.bin /boot/firmware/uboot.bin
Line 23: Line 32:
Likewise, the firmware in xenial multiverse is too old. HEAD should work, but this will download a known good set: Remove uboot.env, as the updated flash-kernel package switches to using boot.scr on the RPi3. Run flash-kernel to install the new components.
Line 25: Line 34:
for i in bootcode.bin \
  fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \
  start.elf start_cd.elf start_db.elf start_x.elf; do
  wget -O /boot/firmware/${i} https://github.com/raspberrypi/firmware/raw/6832d9a431a98b640accb2b76eac38a420d7c680/boot/${i}
done
}}}

Update flash-kernel to recognize and handle the RPi3. flash-kernel on Xenial for the RPi2 would create a compiled uboot.env for u-boot with the same information, but for some reason the newer u-boot will not recognize this uboot.env. So instead, this RPi3 flash-kernel profile will compile a boot.scr, which is functionally identical, but is recognized by the newer u-boot.
{{{
cat <<"EOM" >/usr/share/flash-kernel/bootscript/bootscr.rpi3
fdt addr 0x100
fdt get value bootargs /chosen bootargs
setenv kernel_addr_r 0x01000000
setenv ramdisk_addr_r 0x02100000
fatload mmc 0:1 ${kernel_addr_r} vmlinuz
fatload mmc 0:1 ${ramdisk_addr_r} initrd.img
setenv initrdsize $filesize
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${initrdsize} 0x100
EOM

cat <<"EOM" >>/usr/share/flash-kernel/db/all.db

# RaspberryPi3+
Machine: BCM2710
Machine: Raspberry Pi 3 Model B
Machine: Raspberry Pi 3 Model B Rev 1.2
U-Boot-Script-Name: bootscr.rpi3
Required-Packages: u-boot-tools
Boot-Dtb-Path: /boot/firmware/bcm2710-rpi-3-b.dtb
Boot-Kernel-Path: /boot/firmware/vmlinuz
Boot-Initrd-Path: /boot/firmware/initrd.img
Boot-Script-Path: /boot/firmware/boot.scr
DTB-Id: bcm2710-rpi-3-b.dtb
# XXX we should copy the entire overlay dtbs dir too
EOM
Line 62: Line 35:
flash-kernel flash-kernel --machine "Raspberry Pi 3 Model B"
Line 70: Line 43:
device_tree=bcm2710-rpi-3-b.dtb
Line 80: Line 52:
Remove linux-firmware-raspi2 (contains now-unusable firmware which would overwrite your local firmware if upgraded), and hold flash-kernel (because of the local modifications).
{{{
apt-get --purge remove linux-firmware-raspi2
echo "flash-kernel hold" | dpkg --set-selections
}}}
Line 92: Line 58:

== 64-bit kernel/userland ==
See [[https://wiki.ubuntu.com/ARM/RaspberryPi#Ubuntu_arm64.2FAArch64|ARM/RaspberryPi]].

Known issues:
 * !VideoCore userland utilities are [[https://github.com/raspberrypi/userland/issues/314|not yet available]] for arm64.

== Bugs filed ==

 * [[https://bugs.launchpad.net/ubuntu/+source/flash-kernel/+bug/1578505|LP: #1578505]] - flash-kernel: Raspberry Pi 3 support
 * [[https://bugs.launchpad.net/ubuntu/+source/u-boot/+bug/1580323|LP: #1580323]] - u-boot: Pull/merge 2016.05~rc3+dfsg1-1 from Debian experimental
   * Upstream Debian: [[https://bugs.debian.org/823524|Debian: #823524]] - u-boot: Add rpi_3_32b target to u-boot-rpi
 * [[https://bugs.launchpad.net/ubuntu/+source/linux-firmware-raspi2/+bug/1578745|LP: #1578745]] - linux-firmware-raspi2: Update firmware for Raspberry Pi 3 support
 * [[https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1580326|LP: #1580326]] - livecd-rootfs: Add raspi3 subarch
   * [[https://code.launchpad.net/~fo0bar/livecd-rootfs/raspi2-rpi3/+merge/293959|MP: #293959]] - livecd-rootfs: Add raspi3 subarch

Raspberry Pi 3

The Raspberry Pi 3 was released in early March 2016, shortly before the release of Ubuntu 16.04 (Xenial) LTS, but too short to have proper support. It is possible to run Xenial's kernel and a full Ubuntu installation, but it requires replacing the firmware, bootloader and some other hacks.

Fresh installation

One-off raspi3 images are available which include the ppa-rpi3 PPA pre-installed. For installation details, see ARM/RaspberryPi.

Cross-hardware upgrade

This procedure assumes a working Ubuntu Xenial Raspberry Pi 2 installation. You will be converting a few things over to work on the RPi3, then doing a hardware swap from an RPi2 to an RPi3.

Be sure you have proper backups! This is not a foolproof or well-tested procedure; if it breaks, you get to keep both pieces.

Install a PPA which contains updated u-boot-rpi, flash-kernel and linux-firmware-raspi2 packages, and upgrade.

add-apt-repository ppa:ubuntu-raspi2/ppa-rpi3
apt-get update
apt-get -u dist-upgrade

Install the RPi3 u-boot loader.

apt-get install binutils # Required by mkknlimg, may not be installed
wget -O /tmp/mkknlimg https://raw.githubusercontent.com/raspberrypi/tools/master/mkimage/mkknlimg
chmod 0755 /tmp/mkknlimg 
/tmp/mkknlimg --dtok /usr/lib/u-boot/rpi_3_32b/u-boot.bin /boot/firmware/uboot.bin

Remove uboot.env, as the updated flash-kernel package switches to using boot.scr on the RPi3. Run flash-kernel to install the new components.

rm -f /boot/firmware/uboot.env
flash-kernel --machine "Raspberry Pi 3 Model B"

Check that bcm2710-rpi-3-b.dtb and boot.scr have been created in /boot/firmware by flash-kernel.

Modify /boot/firmware/config.txt with at least the following configs:

enable_uart=1
device_tree_address=0x100
device_tree_end=0x8000
kernel=uboot.bin
dtparam=i2c_arm=on
dtparam=spi=on

enable_uart is needed by u-boot for all RPi3 modes, even if you have no intention of using a serial console. The device_tree options are needed to explicitly declare the DTB area, as the DTB is slightly larger than 16,128 bytes, and the bootloader otherwise assumes an address space of 0x100 through 0x4000.

Shut down the system.

poweroff

Swap out the hardware from the RPi2 to the RPi3 and boot.

64-bit kernel/userland

See ARM/RaspberryPi.

Known issues:

Bugs filed

  • LP: #1578505 - flash-kernel: Raspberry Pi 3 support

  • LP: #1580323 - u-boot: Pull/merge 2016.05~rc3+dfsg1-1 from Debian experimental

    • Upstream Debian: Debian: #823524 - u-boot: Add rpi_3_32b target to u-boot-rpi

  • LP: #1578745 - linux-firmware-raspi2: Update firmware for Raspberry Pi 3 support

  • LP: #1580326 - livecd-rootfs: Add raspi3 subarch

ARM/RaspberryPi/RaspberryPi3 (last edited 2017-09-26 19:21:30 by adamsmith)