<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: Turris Omnia]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?turris_omnia</link>
<description></description>
<pubDate>Wed, 26 May 2021 06:36:09 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[Turris Omnia]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?turris_omnia</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div class="wiki">
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#documentation">Dobrica Pavlinušić's random unstructured stuff (documentation)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] documentation} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#reset_modes">Dobrica Pavlinušić's random unstructured stuff (reset modes)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] reset modes} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#vlan">Dobrica Pavlinušić's random unstructured stuff (vlan)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] vlan} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#gpio_pinout">Dobrica Pavlinušić's random unstructured stuff (GPIO pinout)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] GPIO pinout} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#pwm_same_on_all_pins">Dobrica Pavlinušić's random unstructured stuff (PWM same on all pins)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] PWM same on all pins} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#debian">Dobrica Pavlinušić's random unstructured stuff (Debian)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] Debian} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#u_boot_problem">Dobrica Pavlinušić's random unstructured stuff (u-boot problem)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] u-=boot problem} --></span></li>

<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#rescue_image">Dobrica Pavlinušić's random unstructured stuff (rescue image)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] rescue image} --></span></li>
</ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#update_from_shell">Dobrica Pavlinušić's random unstructured stuff (update from shell)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] update from shell} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="documentation">documentation</h1>
<ul>
<li><a target="_blank" title="(external link)" href="https://www.turris.cz/doc/en/start">https://www.turris.cz/doc/en/start</a></li>
</ul>
<h2 id="reset_modes">reset modes</h2>
<p>
<a target="_blank" title="(external link)" href="https://www.turris.cz/doc/en/howto/omnia_factory_reset">https://www.turris.cz/doc/en/howto/omnia_factory_reset</a></p>
<p>
&nbsp;Available reset modes:</p>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;1 LED: Standard (re)boot<br />
&nbsp;&nbsp;&nbsp;&nbsp;2 LEDs: Rollback to latest snapshot<br />
&nbsp;&nbsp;&nbsp;&nbsp;3 LEDs: Rollback to factory reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;4 LEDs: Re-flash router from flash drive<br />
&nbsp;&nbsp;&nbsp;&nbsp;5 LEDs or more: Boot to rescue shell</p>
<h1 id="vlan">vlan</h1>
<ul>
<li><a target="_blank" title="(external link)" href="https://www.turris.cz/doc/en/howto/vlan_settings_omnia">https://www.turris.cz/doc/en/howto/vlan_settings_omnia</a></li>
</ul>
<h1 id="gpio_pinout">GPIO pinout</h1>
<span class="nlw_phrase"><img alt="omnia-pin-header.png" src="https://saturn.ffzg.hr/rot13/index.cgi/omnia-pin-header.png?action=attachments_download;page_name=turris_omnia;id=20171007133151-0-18764" /><!-- wiki: {image: omnia-=pin-=header.png} --></span><br /><br /><h2 id="pwm_same_on_all_pins">PWM same on all pins</h2>
<ul>
<li><a target="_blank" title="(external link)" href="https://forum.turris.cz/t/gpio-documentation/2869/5">https://forum.turris.cz/t/gpio-documentation/2869/5</a></li>
</ul>
<h1 id="debian">Debian</h1>
<ul>
<li><a target="_blank" title="(external link)" href="https://github.com/tmshlvck/omnia-debian/wiki">https://github.com/tmshlvck/omnia-debian/wiki</a></li>
<li><a target="_blank" title="(external link)" href="https://wiki.debian.org/InstallingDebianOn/TurrisOmnia">https://wiki.debian.org/InstallingDebianOn/TurrisOmnia</a></li>
</ul>
<pre>
root@turris:/mnt/tmp# wget http://aule.elfove.cz/~brill/omnia-debian/omnia-medkit-20170330.tar.gz

# boot into rescue mode

root@(none):~# mount /dev/mmcblk0p1 /target/

root@(none):~# btrfs subvolume create /target/@debian

</pre>
<br /><p>
watchdog will timeout, but you will eventually have subvolume visible from u-boot (which is not case if you just create subvolume from Turris OS</p>
<pre>
root@turris:/# btrfs sub create @debian
Create subvolume './@debian'

root@turris:/# cd /@debian
root@turris:/@debian# tar xf /mnt/tmp/omnia-medkit-20170330.tar.gz 
root@turris:/@debian# btrfs fi df .
System, single: total=32.00MiB, used=4.00KiB
Data+Metadata, single: total=3.68GiB, used=2.25GiB
GlobalReserve, single: total=48.00MiB, used=0.00B

root@turris:/@debian# vi etc/network/interfaces
auto br0
iface br0 inet static
        bridge_ports wlan0 eth0 eth2
        address 192.168.3.254
        netmask 255.255.255.0
        gateway 192.168.3.1
root@turris:~# echo b &gt; /proc/sysrq-trigger
[54760.278340] sysrq: SysRq : Resetting
[54760.282039] CPU1: stopping
   
U-Boot SPL 2015.10-rc2 (Aug 18 2016 - 20:43:35)
High speed PHY - Version: 2.0
SERDES0 card detect: NONE
   
Initialize Turris board topology
Detected Device ID 6820
board SerDes lanes topology details:
 | Lane #  | Speed |  Type       |
 --------------------------------
 |   0    |  5   |  PCIe0       |
 |   1    |  5   |  USB3 HOST0  |
 |   2    |  5   |  PCIe1       |
 |   3    |  5   |  USB3 HOST1  |
 |   4    |  5   |  PCIe2       |
 |   5    |  0   |  SGMII2      |
 --------------------------------
poll_op_execute: TIMEOUT
PCIe, Idx 0: detected no link
PCIe, Idx 1: detected no link
PCIe, Idx 2: detected no link
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.29.0
Memory config in EEPROM: 0x01
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully

   
U-Boot 2015.10-rc2 (Aug 18 2016 - 20:43:35 +0200), Build: jenkins-omnia-master-23
   
SoC:   MV88F6820-A0
       Watchdog enabled
I2C:   ready
SPI:   ready
DRAM:  1 GiB (ECC not enabled)
Enabling Armada 385 watchdog.
Disabling MCU startup watchdog.
Regdomain set to **
MMC:   mv_sdh: 0
SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
*** Warning - bad CRC, using default environment
   
Model: Marvell Armada 385 GP
Board: Turris Omnia SN: 0000000B0000B8E5
Regdomain set to **
SCSI:  MVEBU SATA INIT
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq led only pmp fbss pio slum part sxs
Net:   neta2
Hit any key to stop autoboot:  0
=&gt; 

=&gt; setenv debbootargs earlyprintk console=ttyS0,115200 rootfstype=btrfs rootwait root=/dev/mmcblk0p1 rootflags=subvol=@debian,commit=5 rw
=&gt; setenv debboot 'setenv bootargs &quot;$debbootargs cfg80211.freg=$regdomain&quot;; 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'
=&gt; saveenv
Saving Environment to SPI Flash...
SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
Erasing SPI flash...Writing to SPI flash...done

=&gt; setenv defbootcmd &quot;$bootcmd&quot;
=&gt; 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'
=&gt; setenv bootcmd &quot;$debbootcmd&quot;
=&gt; saveenv
Saving Environment to SPI Flash...
Erasing SPI flash...Writing to SPI flash...done
</pre>
<br /><h1 id="u_boot_problem">u-boot problem</h1>
<pre>
Kernel image @ 0x1000000 [ 0x000000 - 0x332588 ]
Wrong Ramdisk Image Format
Ramdisk image is corrupt or invalid
</pre>
<br /><p>
<a target="_blank" title="(external link)" href="https://docs.turris.cz/hw/omnia/serial-boot/#u-boot">https://docs.turris.cz/hw/omnia/serial-boot/#u-boot</a></p>
<p>
update u-boot</p>
<pre>
=&gt; dhcp
neta2:1 is connected to neta2.  Reconnecting to neta2
neta2 Waiting for PHY auto negotiation to complete............ done
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
*** Unhandled DHCP Option in OFFER/ACK: 208
*** Unhandled DHCP Option in OFFER/ACK: 208
DHCP client bound to address 192.168.4.113 (5583 ms)
*** Warning: no boot file name; using 'C0A80471.img'
Using neta2 device
TFTP from server 192.168.4.1; our IP address is 192.168.4.113
Filename 'C0A80471.img'.
Load address: 0x800000
Loading: *
TFTP error: 'file /var/tftp/C0A80471.img not found' (1)
Not retrying...
=&gt; tftpboot 0x1000000 uboot-turris-omnia-spl.kwb
Using neta2 device
TFTP from server 192.168.4.1; our IP address is 192.168.4.113
Filename 'uboot-turris-omnia-spl.kwb'.
Load address: 0x1000000
Loading: #####################################
         2.6 MiB/s
done
Bytes transferred = 534240 (826e0 hex)
=&gt; sf probe
SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
=&gt; sf update 0x1000000 0 $filesize
device 0 offset 0x0, size 0x826e0
534240 bytes written, 0 bytes skipped in 10.563s, speed 51765 B/s
</pre>
<br /><p>
fix default variables and boot from mmc (I did 4 leds rescue before)</p>
<pre>
env default -a
saveenv
run mmcboot
</pre>
<br /><h2 id="rescue_image">rescue image</h2>
<pre>
root@x230:/var/tftp# wget https://repo.turris.cz/hbs/omnia/packages/turrispackages/rescue-image_3.4-1_arm_cortex-a9_vfpv3-d16.ipk
root@x230:/var/tftp# mkdir tmp
root@x230:/var/tftp# cd tmp/
root@x230:/var/tftp/tmp# tar xvf ../rescue-image_3.4-1_arm_cortex-a9_vfpv3-d16.ipk
./debian-binary
./data.tar.gz
./control.tar.gz
root@x230:/var/tftp/tmp# tar xvf data.tar.gz
./
./usr/
./usr/share/
./usr/share/rescue-image/
./usr/share/rescue-image/image.fit
./usr/share/rescue-image/image.fit.lzma
root@x230:/var/tftp/tmp# cp usr/share/rescue-image/image.fit.lzma ../
</pre>
<br /><p>
now flash new rescue</p>
<pre>
=&gt; tftpboot ${kernel_addr_r} image.fit.lzma
Using neta2 device
TFTP from server 192.168.4.1; our IP address is 192.168.4.113
Filename 'image.fit.lzma'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###########################
         2.4 MiB/s
done
Bytes transferred = 6115919 (5d524f hex)

=&gt; sf probe
SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
=&gt; sf update ${kernel_addr_r} 0x00100000 ${filesize}
device 0 offset 0x5d524f, size 0x22adb1
SPI flash failed in erase step
</pre>
<br /><h1 id="update_from_shell">update from shell</h1>
<pre>
opkg install u-boot-omnia
opkg install rescue-image

root@turris:~# nor-update -d
Verifying /dev/mtd0 against /usr/share/omnia/uboot-devel ...
a107291f748c9b3d9d96dd718e3e471a - /dev/mtd0
15b3b8e4100351677e85b983ef659921 - /usr/share/omnia/uboot-devel
Failed
Unlocking /dev/mtd0 ...
Erasing /dev/mtd0 ...

Writing from /usr/share/omnia/uboot-devel to /dev/mtd0 ...
Verifying /dev/mtd1 against /usr/share/rescue-image/image.fit.lzma ...
1ea91207d0fbd4479bb4c8b4a3957371 - /dev/mtd1
82194bc8fc95193cc3f3491a047b0c88 - /usr/share/rescue-image/image.fit.lzma
Failed
Unlocking /dev/mtd1 ...
Erasing /dev/mtd1 ...

Writing from /usr/share/rescue-image/image.fit.lzma to /dev/mtd1 ...
</pre>
<br /><p>
This will make route unbootable :-(</p>
<p>
Reflash router via usb <a target="_blank" title="(external link)" href="https://docs.turris.cz/hw/omnia/rescue-modes/#re-flash-router">https://docs.turris.cz/hw/omnia/rescue-modes/#re-flash-router</a></p>
</div>
<hr/><div>Attachments: omnia-pin-header.png</div>]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category></category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?turris_omnia</guid>
<pubDate>Wed, 26 May 2021 06:36:09 -0000</pubDate>
</item>
</channel>
</rss>