Differences between revisions 42 and 50 (spanning 8 versions)
Revision 42 as of 2017-01-25 12:05:42
Size: 10339
Editor: ?UweKleine-König
Comment: fix microcom cmdline
Revision 50 as of 2017-01-31 09:38:39
Size: 13890
Editor: PaulWise
Comment: another layer of bootcmd indirection can be handy if going back to the default and then back to debian
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
/!\ This page should be rebased on the [[InstallingDebianOn/ComputerTemplate|template]]. #language en
#pragma description How to install Debian/Linux on a XXXXX
##
## Read http://wiki.debian.org/InstallingDebianOn/HowToContribute before modifying this page
##
## You will find some comments like this one below to help you write a report.
## ------------------------------------------------------------------------------------------
##
## Location Bar + DebianOn compatibility rating
~-Translation(s): none-~

||<tablestyle="width:100%" style="width:96px;border-right-style:none">||<style="border-left-style:none"><<Include(InstallingDebianOn/PageFragments/Philosophy)>>||

~-''Models covered''-~<<BR>>'''Turris Omnia'''

~- Sub-models options :<<BR>> - RAM (1GiB or 2GiB)-~

The [[https://omnia.turris.cz/en/|Turris Omnia]] is an ARM-based (mostly) open hardware router board developed by [[https://www.turris.cz/en/|Project Turris]] of [[https://www.nic.cz/|CZ.NIC]]. It was kickstarted at [[http://igg.me/at/turris-omnia|Indiegogo]] and is [[https://omnia.turris.cz/en/#buy|available in a few shops]] now. By default it runs an [[https://www.openwrt.org/|OpenWRT]] derivative called [[https://github.com/CZ-NIC/turris-os|TurrisOS]].

= Overall Status =

||||<tablestyle="margin-left:3em;width:90%">'''Core Components'''||<|10 style="text-align:right;border-style:none;vertical-align:top;"> {{attachment:photo.png}}||
||Boot Standard Kernel: || {OK} ||
|| WAN network card: || {OK} ||
|| Switch network port: || /!\ ||
|| SFP network port: || /!\ ||
|| Detect storage: || {OK} ||
||||'''Extra Features'''||
|| CPU Frequency Scaling || [?] ||
|| Hibernation || [?] ||
|| Sleep/Suspend || [?] ||
|| Shutdown || /!\ ||
|| Modem || [?] ||
|| WiFi || {i} X-( ||
|| Watchdog || {i} ||
|| RTC || {i} ||
~-Legend :<<BR>> {OK} = OK ; {X} Unsupported(No Driver) ; /!\ = Error (Couldn't get it working); [?] Unknown, Not Test ; [-] Not-applicable <<BR>> {i} = Configuration Required; X-( = Only works with a non-free driver and or firmware-~
Line 5: Line 41:
= Installing Debian On The Turris Omnia Router =

The [[https://omnia.turris.cz/en/|Turris Omnia]] is an ARM-based (mostly) open hardware router board developed by [[https://www.turris.cz/en/|Project Turris]] of [[https://www.nic.cz/|CZ.NIC]]. It was kickstarted at [[http://igg.me/at/turris-omnia|Indiegogo]] and is [[https://omnia.turris.cz/en/#buy|available in a few shops]] now.

By default it runs an [[https://www.openwrt.org/|OpenWRT]] derivative called TurrisOS, but Debian armhf userland can run on it, too. For now it though needs a custom (read non-Debian) kernel as well as some additional scripts to get all the features. The custom kernel is based on some Linux 4.x branch and is maintained [[https://github.com/tmshlvck/omnia-linux/|on Github]]. (Update: it is unclear if that repository is the official one. The official repository is the [[https://github.com/CZ-NIC/turris-os/|OpenWRT fork]] and has a different set of patches.)

== Installing vanilla Debian ==

The u-boot shipped on the device does not have USB support so you will need to connect the WAN port on the device to a DHCP managed network, which you can get on your computer with NetworkManager by sharing your Internet connection.

If you are on unstable, install the debian-installer-netboot-armhf virtual package. If you don't want to install it, you can just download it with apt and then unpack it with dpkg-deb. For stretch or earlier, you can add unstable to your sources.list. If you don't want to modify your sources.list, then use a [[DebianMan:1/chdist|chdist]] or [[DebianPackage:apt-venv]] to download it with apt and unpack it with dpkg-deb. You will need these files:
= Important Notes =

== Installation ==

=== Booting ===

The u-boot bootloader shipped on the device does not have USB support. This means that the only mechanisms available to boot the Debian installer are TFTP, eMMC or mSATA. The documentation below uses a TFTP setup.

Connect the WAN Ethernet port on the device to a DHCP managed network, which you can get on your computer with NetworkManager by sharing your Internet connection.

==== Setup ====

If you are on stretch or later, install the debian-installer-netboot-armhf virtual package. If you don't want to install it, you can just download it with apt and then unpack it with dpkg-deb. For jessie or earlier, you can add stretch to your sources.list. If you don't want to modify your sources.list, then use a [[DebianMan:1/chdist|chdist]] or [[DebianPackage:apt-venv]] to download it with apt and unpack it with dpkg-deb. You will need these files:
Line 23: Line 61:
To enter the u-boot prompt, plug the UART to USB cable ([[https://www.youtube.com/watch?v=LVhzU5dzZCI|video]]) into the 4 pin (black yellow red empty) header to the right of the LEDs and plug the USB end into your computer. Start your favourite serial console tool, like GNU screen, minicom or microcom, or busybox microcom and connect to the USB serial console device. The busybox microcom should already be installed on your computer if you are running Debian. To enter the u-boot prompt, remove the case, plug the UART to USB cable ([[https://www.youtube.com/watch?v=LVhzU5dzZCI|video]]) into the 4 pin (black yellow red empty) header to the right of the LEDs and plug the USB end into your computer. Start your favourite serial console tool, like GNU screen, minicom or microcom, or busybox microcom and connect to the USB serial console device. The busybox microcom should already be installed on your computer if you are running Debian.
Line 52: Line 90:
==== Bootloader update ====
Line 57: Line 97:
your U-Boot needs an update. The U-Boot images that are about to be released by cz.nic are fixed, you can find them at https://api.turris.cz/openwrt-repo/omnia-test/nor_fw/. Update as follows after downloading the image to your tftp directory: your U-Boot needs an update.

The Debian u-boot package does not yet support the device.

The [[https://api.turris.cz/openwrt-repo/omnia-test/nor_fw/|U-Boot images released by cz.nic]] are fixed for this issue.

Place the `uboot-turris-omnia-spl.kwb` file into your tftp directory and run the following commands at the u-boot prompt:
Line 68: Line 114:
Once you are in the Debian Installer you will see a blue screen with a language choice (English or C). At this point you can use the standard GNU screen keys (Ctrl+a n, Ctrl+a p etc) to switch between the Debian Installer virtual terminals.

Choose English and other parameters and stop at the partitioning step to read the next paragraph. You will want to use the eth2 device for network if you have a cable connected to the WAN port.
=== Info ===

Once you are in the Debian Installer you will see a blue screen with a language choice (English or C).

At this point you can use the standard GNU screen keys (Ctrl+a 1/2/3/4, Ctrl+a n, Ctrl+a p etc) to switch between the Debian Installer virtual terminals.

You will want to use the eth2 device for network if you have a cable connected to the WAN port.

Choose language and other parameters and stop at the partitioning step to read the next section.

=== Storage ===

<<Anchor(preserve-turrisos)>>
==== Use BTRFS and keep TurrisOS ====
Line 114: Line 171:
setenv bootcmd 'i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0; if test $rescue -ge 2; then echo BOOT RESCUE; run rescueboot; else if test $rescue -ge 1; then echo BOOT eMMC TurrisOS FS; run mmcboot; else echo BOOT eMMC Debian FS; run debboot; fi; fi' setenv debbootcmd 'i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0; if test $rescue -ge 2; then echo BOOT RESCUE; run rescueboot; else if test $rescue -ge 1; then echo BOOT eMMC TurrisOS FS; run mmcboot; else echo BOOT eMMC Debian FS; run debboot; fi; fi'
setenv bootcmd "$debbootcmd"
Line 118: Line 176:
There are some missing parts yet, so the SFP and switch port doesn't work.
With the Debian kernel the wifi driver fails to probe, while this works with a monolithic (vanilla) kernel compiled for mvebu + ath10k.

=== Watchdog handling ===
==== Remove TurrisOS and use other filesystems ====

Just go through the installer as per normal. The Debian DebianPackage:flash-kernel package does not yet support the device so you will have to write your own u-boot commands to boot Debian, based on the [[#preserve-turrisos|BTRFS section]], the [[#u-boot-config|default u-boot configuration]] and the [[http://www.denx.de/wiki/U-Boot/Documentation|u-boot documentation]].

== Alternative install methods ==

For an alternative installation using a self compiled Linux kernel (instead of a Debian Linux kernel as above) see the [[https://github.com/tmshlvck/omnia-debian/wiki|omnia-debian wiki]]. If you follow this one, you're not keen on cross-compiling and accept to trust images downloaded unencrypted from the internet, you can find an ready-made image on
http://aule.elfove.cz/%7Ebrill/omnia-debian/.

== Linux version ==

For now the device needs a custom non-Debian Linux kernel version as well as some additional scripts to get all the features. The custom kernel is based on some Linux 4.x branch and is maintained [[https://github.com/tmshlvck/omnia-linux/|on Github]]. (Update: it is unclear if that repository is the official one. The official repository is the [[https://github.com/CZ-NIC/turris-os/|OpenWRT fork]] and has a different set of patches.)

== Watchdog ==
Line 129: Line 198:
=== MAC address === == Ethernet ==
Line 145: Line 215:
=== RTC === == Power Management ==

The device will not power off on shutdown, LEDs remain on and the CPU heatsink remains hot.

Suspend/etc are untested.

== RTC ==
Line 153: Line 229:
=== Wifi === == WiFi ==
Line 158: Line 234:
}}} on the kernel command line, then the wifi drivers probe correctly.

== Installing with self-build kernel ==

For an alternative installation using a self compiled kernel (instead of a debian kernel as above) see the [[https://github.com/tmshlvck/omnia-debian/wiki|omnia-debian wiki]]. If you follow this one, you're not keen on cross-compiling and accept to trust images downloaded unencrypted from the internet, you can find an ready-made image on
http://aule.elfove.cz/%7Ebrill/omnia-debian/.
}}} on the Linux kernel command line, then the wifi drivers probe correctly.

X-( The ath90k driver requires the non-free DebianPackage:firmware-atheros package to be installed, otherwise the second WiFi device will not work.

== Modem ==

One of the perks was a [[http://osmocom.org/projects/quectel-modems/wiki/EC20|Quectel EC20 LTE miniPCIe modem]]. The modem itself runs Linux and some models of Quectel modems, including the EC20, are being [[http://osmocom.org/projects/quectel-modems/|reverse engineered]] by the [[http://osmocom.org/|osmocom project]].

------

= System Summary =

<<Anchor(u-boot-config)>>
Line 167: Line 249:
{{{ ~-{{{
Line 182: Line 264:
}}}

== See also ==
}}}-~

== lspci ==

~-{{{
00:01.0 PCI bridge [0604]: Marvell Technology Group Ltd. Device [11ab:6820] (rev 04)
00:02.0 PCI bridge [0604]: Marvell Technology Group Ltd. Device [11ab:6820] (rev 04)
00:03.0 PCI bridge [0604]: Marvell Technology Group Ltd. Device [11ab:6820] (rev 04)
01:00.0 Network controller [0280]: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) [168c:002e] (rev 01)
02:00.0 Network controller [0280]: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter [168c:003c] (rev ff)
}}}-~

== lsusb ==

Empty except for controllers.

= Resources =
<<Anchor(attachments)>>
== Attachments ==
<<AttachList>>

== Useful Links ==
Line 187: Line 288:

----
CategoryEmbeddedComputer

Translation(s): none

DebianOn is an effort to document how to install, configure and use Debian on some specific hardware. Therefore potential buyers would know if that hardware is supported and owner would know how get the best out of that hardware.

The purpose is not to duplicate the Debian Official Documentation, but to document how to install Debian on some specific hardware.

Models covered
Turris Omnia

Sub-models options :
- RAM (1GiB or 2GiB)

The Turris Omnia is an ARM-based (mostly) open hardware router board developed by Project Turris of CZ.NIC. It was kickstarted at Indiegogo and is available in a few shops now. By default it runs an OpenWRT derivative called TurrisOS.

Overall Status

Core Components

[ATTACH]

Boot Standard Kernel:

{OK}

WAN network card:

{OK}

Switch network port:

/!\

SFP network port:

/!\

Detect storage:

{OK}

Extra Features

CPU Frequency Scaling

[?]

Hibernation

[?]

Sleep/Suspend

[?]

Shutdown

/!\

Modem

[?]

WiFi

{i} X-(

Watchdog

{i}

RTC

{i}

Legend :
{OK} = OK ; {X} Unsupported(No Driver) ; /!\ = Error (Couldn't get it working); [?] Unknown, Not Test ; [-] Not-applicable
{i} = Configuration Required; X-( = Only works with a non-free driver and or firmware

Important Notes

Installation

Booting

The u-boot bootloader shipped on the device does not have USB support. This means that the only mechanisms available to boot the Debian installer are TFTP, eMMC or mSATA. The documentation below uses a TFTP setup.

Connect the WAN Ethernet port on the device to a DHCP managed network, which you can get on your computer with NetworkManager by sharing your Internet connection.

Setup

If you are on stretch or later, install the debian-installer-netboot-armhf virtual package. If you don't want to install it, you can just download it with apt and then unpack it with dpkg-deb. For jessie or earlier, you can add stretch to your sources.list. If you don't want to modify your sources.list, then use a chdist or apt-venv to download it with apt and unpack it with dpkg-deb. You will need these files:

/usr/lib/debian-installer/images/9/armhf/text/debian-installer/armhf/vmlinuz
/usr/lib/debian-installer/images/9/armhf/text/debian-installer/armhf/initrd.gz
/usr/lib/debian-installer/images/9/armhf/text/debian-installer/armhf/dtbs/armada-385-turris-omnia.dtb

To enter the u-boot prompt, remove the case, plug the UART to USB cable (video) into the 4 pin (black yellow red empty) header to the right of the LEDs and plug the USB end into your computer. Start your favourite serial console tool, like GNU screen, minicom or microcom, or busybox microcom and connect to the USB serial console device. The busybox microcom should already be installed on your computer if you are running Debian.

busybox microcom -X -s 115200 /dev/ttyUSB0
microcom -s 115200 -p /dev/ttyUSB0
minicom /dev/ttyUSB0
screen /dev/ttyUSB0 115200

Then power on or reset the device and hit any key to interrupt autoboot at this point:

Hit any key to stop autoboot:  3 

Then install a tftp server like tftpd-hpa on your computer, put the above files in /srv/tftp and on the serial console enter the following in U-Boot:

mw 0xf1020300 0x403 #disable watchdog
dhcp
setenv serverip <your_tftp_server_legacy_ip_address>
tftpboot 0x01000000 vmlinuz
tftpboot 0x02000000 armada-385-turris-omnia.dtb
tftpboot 0x03000000 initrd.gz
bootz 0x01000000 0x03000000:$filesize 0x02000000

Bootloader update

If this fails for you with

Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid

your U-Boot needs an update.

The Debian u-boot package does not yet support the device.

The U-Boot images released by cz.nic are fixed for this issue.

Place the uboot-turris-omnia-spl.kwb file into your tftp directory and run the following commands at the u-boot prompt:

dhcp
tftpboot 0x1000000 uboot-turris-omnia-spl.kwb
sf probe
sf update 0x1000000 0 $filesize

Once the update is done, you will need to reboot to start the new version of U-Boot and then go back to the start of the TFTP stage above.

Info

Once you are in the Debian Installer you will see a blue screen with a language choice (English or C).

At this point you can use the standard GNU screen keys (Ctrl+a 1/2/3/4, Ctrl+a n, Ctrl+a p etc) to switch between the Debian Installer virtual terminals.

You will want to use the eth2 device for network if you have a cable connected to the WAN port.

Choose language and other parameters and stop at the partitioning step to read the next section.

Storage

Use BTRFS and keep TurrisOS

Is possible to preserve the existing TurrisOS installation and install Debian into a subvolume of the existing btrfs filesystem on the eMMC storage. This means both TurrisOS and Debian will share the same filesystem/partition but use separate btrfs subvolumes. The Debian Installer doesn't yet support btrfs subvolumes but you can use them by switching to expert mode. When you get to the partitioning step, press tab to switch to "Go Back" and press enter. Go down to "Change debconf priority" and press enter, continue and choose "low" then go back to the partitioning step. Choose to use the btrfs volume as / but do *not* format it (a format will delete TurrisOS). After the partitioning, but before the software installation, you will need to unmount the install directory, mount the root subvolume, create a new Debian subvolume and then mount the new Debian subvolume. You can substitute @debian for any subvolume name other than @ and @factory, which are TurrisOS subvolumes.

# Check what volume is mounted
mount
# If there is something other than subvol=/ then remount
umount /target
mount -o subvol=/ /dev/mmcblk0p1 /target
# Create the Debian subvolume
btrfs subvolume create /target/@debian
# move all non-subvolume files/dirs to the Debian subvolume
# Anything with @ in the name is likely a subvolume
mv /target/etc /target/media /target/@debian
# Remount with the Debian subvolume
umount /target
mount -o subvol=@debian /dev/mmcblk0p1 /target

Before ending the installation switch back to a shell, add the Debian subvolume to the rootfs mount options and put the dtb into the Debian rootfs as /target/boot/dtb.

chroot /target sed -i s/defaults/defaults,subvol=@debian/ /etc/fstab
cp /sys/firmware/fdt /target/boot/dtb

After the installation, reboot into the uboot prompt. At this point you need to create a command to boot Debian.

To create the command to boot Debian:

setenv debbootargs earlyprintk console=ttyS0,115200 rootfstype=btrfs rootwait root=/dev/mmcblk0p1 rootflags=subvol=@debian,commit=5 rw
setenv debboot 'setenv bootargs "$debbootargs cfg80211.freg=$regdomain"; btrload mmc 0 0x01000000 boot/vmlinuz @debian; btrload mmc 0 0x02000000 boot/dtb @debian; btrload mmc 0 0x03000000 boot/initrd.img @debian; bootz 0x01000000 0x03000000:$filesize 0x02000000'
saveenv

You can then set the default to boot from Debian, but run TurrisOS in rescue mode 1 (aka LED 5) (normal rescue mode moves to rescue mode 2 (aka LED 6)).

# Save the default bootcmd for a backup
# in case you want to revert to defaults.
setenv defbootcmd "$bootcmd"
# Add Debian to the boot command by default and relegate TurrisOS to rescue mode 1
setenv debbootcmd 'i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0; if test $rescue -ge 2; then echo BOOT RESCUE; run rescueboot; else if test $rescue -ge 1; then echo BOOT eMMC TurrisOS FS; run mmcboot; else echo BOOT eMMC Debian FS; run debboot; fi; fi'
setenv bootcmd "$debbootcmd"
saveenv

Remove TurrisOS and use other filesystems

Just go through the installer as per normal. The Debian flash-kernel package does not yet support the device so you will have to write your own u-boot commands to boot Debian, based on the BTRFS section, the default u-boot configuration and the u-boot documentation.

Alternative install methods

For an alternative installation using a self compiled Linux kernel (instead of a Debian Linux kernel as above) see the omnia-debian wiki. If you follow this one, you're not keen on cross-compiling and accept to trust images downloaded unencrypted from the internet, you can find an ready-made image on http://aule.elfove.cz/%7Ebrill/omnia-debian/.

Linux version

For now the device needs a custom non-Debian Linux kernel version as well as some additional scripts to get all the features. The custom kernel is based on some Linux 4.x branch and is maintained on Github. (Update: it is unclear if that repository is the official one. The official repository is the OpenWRT fork and has a different set of patches.)

Watchdog

The bootloader enables the watchdog of the SoC. To handle this you either have to disable it again in the bootloader (see above) or pet it regularly. For the latter just add

[Manager]
RuntimeWatchdogSec=10s

to /etc/systemd/system.conf.

Ethernet

U-Boot doesn't provide the mac addresses to be used in the device tree. To make the Debian system use the right ones I did:

cat > /etc/systemd/network/00-eth0.link
[Match]
Path=platform-f1070000.ethernet
[Link]
MACAddress=...
EOF

and the same for eth1 (platform-f1030000.ethernet) and eth2 (platform-f1034000.ethernet).

The mac address reserved for your machine is saved in the crypto chip. To find out the base check U-Boot's ethaddr variable. You "own" this and the two following addresses.

Power Management

The device will not power off on shutdown, LEDs remain on and the CPU heatsink remains hot.

Suspend/etc are untested.

RTC

The in-SoC RTC isn't working properly. It is somewhat working after doing

mw 0xf10184a0 0xfd4d4cfa

in U-Boot. If you don't do this, the driver only reads 2016-12-19 22:00:34 from it.

WiFi

The Debian kernel fails to probe the wifi drivers. There is already a bug report about this. As a work around add

pcie_aspm=off

on the Linux kernel command line, then the wifi drivers probe correctly.

X-( The ath90k driver requires the non-free firmware-atheros package to be installed, otherwise the second WiFi device will not work.

Modem

One of the perks was a Quectel EC20 LTE miniPCIe modem. The modem itself runs Linux and some models of Quectel modems, including the EC20, are being reverse engineered by the osmocom project.


System Summary

Default uboot env

baudrate=115200
bootargs=earlyprintk console=ttyS0,115200 rootfstype=btrfs rootdelay=2 root=b301 rootflags=subvol=@,commit=5 rw
bootcmd=i2c dev 1; i2c read 0x2a 0x9 1 0x00FFFFF0; setexpr.b rescue *0x00FFFFF0; if test $rescue -ge 1; then echo BOOT RESCUE; run rescueboot; else echo BOOT eMMC FS; run mmcboot; fi
bootdelay=3
ethact=neta2
ethaddr=d8:58:d7:XX:XX:XX
fdt_high=0x10000000
initrd_high=0x10000000
mmcboot=setenv bootargs "$bootargs cfg80211.freg=$regdomain"; btrload mmc 0 0x01000000 boot/zImage @; btrload mmc 0 0x02000000 boot/dtb @; bootz 0x01000000 - 0x02000000
regdomain=**
rescueboot=i2c mw 0x2a.1 0x3 0x1c 1; i2c mw 0x2a.1 0x4 0x1c 1; mw.l 0x01000000 0x00ff000c; i2c write 0x01000000 0x2a.1 0x5 4 -s; setenv bootargs "$bootargs omniarescue=$rescue"; sf probe; sf read 0x1000000 0x100000 0x700000; bootz 0x1000000
stderr=serial@12000
stdin=serial@12000
stdout=serial@12000

lspci

00:01.0 PCI bridge [0604]: Marvell Technology Group Ltd. Device [11ab:6820] (rev 04)
00:02.0 PCI bridge [0604]: Marvell Technology Group Ltd. Device [11ab:6820] (rev 04)
00:03.0 PCI bridge [0604]: Marvell Technology Group Ltd. Device [11ab:6820] (rev 04)
01:00.0 Network controller [0280]: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) [168c:002e] (rev 01)
02:00.0 Network controller [0280]: Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter [168c:003c] (rev ff)

lsusb

Empty except for controllers.

Resources

Attachments

  • [get | view] (2017-01-28 04:36:25, 0.6 KB) [[attachment:cpuinfo.txt]]
  • [get | view] (2017-01-28 04:35:13, 22.4 KB) [[attachment:dmesg.txt]]
  • [get | view] (2017-01-28 03:17:35, 1.8 KB) [[attachment:lsmod.txt]]
 All files | Selected Files: delete move to page


?CategoryEmbeddedComputer