meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
nsa310:debian [2015/04/01 08:28] – [Encrypted partition] niziakhw:nsa310:debian [2020/11/06 11:42] niziak
Line 1: Line 1:
 +====== Debian ======
 +
 ====== References ====== ====== References ======
 +
 OpenWRT packages: [[http://bartekk.pdg.pl/openwrt/]] OpenWRT packages: [[http://bartekk.pdg.pl/openwrt/]]
  
Line 12: Line 15:
 [[http://openrouter.info/forum/viewtopic.php?f=19&t=1581&start=80]] [[http://openrouter.info/forum/viewtopic.php?f=19&t=1581&start=80]]
  
-====== Serial converter ====== 
- 
-3,3V level converter 
-115200 8N1 
- 
-^ 1  ^ 2  ^ 3  ^ 4 ^ 5   ^ 
-|Vcc | RX | TX | nc | GND | 
- 
-<code> 
-         __  __                      _ _ 
-        |  \/  | __ _ _ ____   _____| | | 
-        | |\/| |/ _` | '__\ \ / / _ \ | | 
-        | |  | | (_| | |   \ V /  __/ | | 
-        |_|  |_|\__,_|_|    \_/ \___|_|_| 
-       ____              _ 
-| | | |   | __ )  ___   ___ | |_ 
-| | | |___|  _ \ / _ \ / _ \| __| 
-| |_| |___| |_) | (_) | (_) | |_ 
- \___/    |____/ \___/ \___/ \__| 
- ** MARVELL BOARD: RD-88F6281A LE 
- 
-U-Boot 1.1.4 (Jun  8 2011 - 18:48:37) Marvell version: 3.4.19 
- 
-U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CFEE0 
- 
-Soc: 88F6281 A1 (DDR2) 
-CPU running @ 1200Mhz L2 running @ 400Mhz 
-SysClock = 400Mhz , TClock = 200Mhz 
- 
-DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6 
-DRAM CS[0] base 0x00000000   size 256MB 
-DRAM Total size 256MB  16bit width 
-Addresses 10M - 0M are saved for the U-Boot usage. 
-Mem malloc Initialization (10M - 7M): Done 
-NAND:128 MB 
-Flash:  0 kB 
- 
-CPU : Marvell Feroceon (Rev 1) 
-Kernel address is 0x4640000. 
- 
-Streaming disabled 
-Write allocate disabled 
- 
-Module 0 is RGMII 
-Module 1 is TDM 
- 
-USB 0: host mode 
-PEX 0: PCI Express Root Complex Interface 
-PEX interface detected Link X1 
-Net:   egiga0, egiga1 [PRIME] 
-Hit any key to stop autoboot:  0 
- 
-</code> 
  
 ====== Preparation ===== ====== Preparation =====
Line 231: Line 181:
  
 </code> </code>
- 
-====== Encrypted partition ====== 
- 
-<code> 
-apt-get install cryptsetup-bin 
-</code> 
- 
-Enable HW acceleration. Which is a bit slower than software :P 
- 
-<code> 
-modprobe mv_cesa 
-cat /proc/crypto | grep mv_cesa -B 2 -A 7 
-</code> 
- 
-Is providing only: 
-  - hmac(sha1) 
-  - sha1 
-  - cbc(aes) 
-  - ecb(aes) 
- 
-There are also additional kernel modules optimised for ARM:  
-  - sha1_arm 
-  - aes_arm 
- 
- 
-<code> 
-cryptsetup benchmark 
-</code> 
- 
-^  Algorithm  ^ Key  ^  Encryption    Decryption  ^  accel  ^ 
-^     aes-cbc | 128b |  12.8 MiB/s    13.4 MiB/s  |         | 
-^                  |  13.4 MiB/s    14.1 MiB/s  |  arm    | 
-^                  |**19.7 MiB/s** |**20.2 MiB/s**|  mv_cesa| 
-^ serpent-cbc | 128b |  11.1 MiB/s    11.6 MiB/s  |         | 
-^ twofish-cbc | 128b |  13.0 MiB/s    13.4 MiB/s  |         | 
-^     aes-cbc | 256b |  10.1 MiB/s    10.5 MiB/s  |         | 
-^                  |  11.0 MiB/s    11.4 MiB/s  |  arm    | 
-^                  |**18.9 MiB/s** |**19.2 MiB/s**|  mv_cesa| 
-^ serpent-cbc | 256b |  11.1 MiB/s    11.6 MiB/s  |         | 
-^ twofish-cbc | 256b |  13.0 MiB/s    13.4 MiB/s  |         | 
-^     aes-xts | 256b |  13.1 MiB/s    13.3 MiB/s  |         | 
-^                  |  14.6 MiB/s    14.7 MiB/s  |  arm    | 
-^ serpent-xts | 256b |  11.5 MiB/s    11.6 MiB/s  |         | 
-^ twofish-xts | 256b |  13.4 MiB/s    13.2 MiB/s  |         | 
-^     aes-xts | 512b |  10.2 MiB/s    10.4 MiB/s  |         | 
-^                  |  11.4 MiB/s    11.8 MiB/s  |  arm    | 
-^ serpent-xts | 512b |  11.5 MiB/s    11.6 MiB/s  |          
-^ twofish-xts | 512b |  13.4 MiB/s    13.2 MiB/s  |         | 
- 
- 
-My own benchmarks 
-Each cipher was tested with following steps: 
-  * //luksFormat /dev/sda5// 
-  * //luksOpen /dev/sda5 sda5// 
-  * benchmarks described in table below on /dev/mapper/sda5 
-  * create ext4fs on /dev/mapper/sda5 
-  * the same benchmarks but on mounted ext4 (writing/reading from file).  
- 
-^  test    command line            ^ description                                                    ^ 
-^ hdparm  | //hdparm -t /dev/...//       | Buffered read test                                             | 
-^ WR      | //dd bs=16M count=128//      | Normal buffered transfer, but with sync before exit            |  
-^ WR S    | //dd bs=16M count=128// 
-^ WR DS   | //dd bs=16M count=128// 
-^ RD      | //dd bs=16M count=128// 
- 
-REMARKS: 
-  - For XTS, only half of key is used, so for 128b cipher I need to specify -s 256. 
-  - Ext4 by default was created with lazy_init, to speed up creation process, but it can make impact on tests. 
-  - Before each test, flush by //sync && echo 3 > .../drop_caches// was issued. 
- 
- 
- 
-^  128b key  ^^^^^^^^^^^^^ 
-^                      Block device                       ^^^^^^ ^  EXT4                      ^^^^   
-^                 ^ acc ^  hdparm ^ ^ WR  ^ WR S ^  WR DS ^  RD    ^ ^   WR  ^ WR S ^ WR DS ^   RD   ^ 
-^cbc-plain        | HW  |   8.82  | | 7.0 | 6.1  |   7.3  |   9.2  | |   8.0 | 5.5  | 5.8     9.3  | 
-^                 | SW  |  11.80  | | 8.2 | 7.4  |   8.7  |  12.40 | |   9.5 | 6.2  | 6.4    12.40 | 
-^                 | ARM |  12.76  | | 8.9 | 7.2  |   9.2  |  13.60 | |  10.2 | 6.4  | 6.4    13.60 | 
-^cbc-plain64      | HW  |   8.79  | | 6.9 | 6.1  |   7.5  |   9.2  | |   7.9 | 5.3  | 5.6     9.0  | 
-^                 | SW  |  11.83  | | 8.2 | 7.4  |   9.2  |  12.40 | |   9.5 | 6.2  | 6.6    12.40 | 
-^                 | ARM |  12.73  | | 8.9 | 7.2  |   9.3  |  13.60 | |  10.2 | 6.2  | 6.1    13.60 | 
-^cbc-essiv:sha256 | HW  |   7.7   | | 6.2 | 5.5  |   6.9  |   8.1  | |   7.2 | 5.2  | 5.2     8.1  | 
-^                 | SW  |   9.7   | | 7.8 | 6.9  |   8.7  |  11.40 | |   9.1 | 6.2  | 6.5    11.40 | 
-^                 | ARM |  12.36  | | 8.7 | 7.0  |   9.1  |  13.20 | |   9.9 | 6.3  | 6.2    13.20 | 
-^xts-plain        | SW  |  11.29  | | 8.2 | 7.4  |   8.7  |  11.80 | |   9.5 | 6.1  | 6.5    11.90 | 
-^                 | ARM |  12.79  | | 9.3 | 7.5  |  10.1  |  13.60 | |  10.6 | 6.3  | 5.9    13.70 | 
-^xts-plain64      | SW  |  11.27  | | 8.2 | 7.4  |   8.7  |  11.80 | |   9.5 | 6.2  | 6.5    11.70 | 
-^                 | ARM |  12.84  | | 9.3 | 7.5  |  10.2  |  13.70 | |  10.6 | 6.4  | 6.1    13.70 | 
-^xts-essiv:sha256 | SW  |  10.30  | | 7.9 | 7.2  |   8.7  |  11.10 | |   9.1 | 6.1  | 6.5    11.10 | 
-^                 | ARM |  12.40  | | 9.1 | 7.5  |   9.3  |  13.20 | |  10.4 | 6.3  | 6.1    13.30 | 
-^  256b key  ^^^^^^^^^^^^^ 
-^                      Block device                       ^^^^^^ ^  EXT4                      ^^^^   
-^                 ^ acc ^  hdparm ^ ^  WR ^ WR S ^  WR DS ^   RD   ^ ^  WR   ^ WR S ^ WR DS ^   RD   ^ 
-^cbc-plain        | HW  |   8.43  | | 6.7 | 6.1  |   7.5  |   8.9  | |   7.7 | 5.5  | 5.7     8.9  | 
-^                 | SW  |   9.17  | | 6.7 | 6.1  |   7.4  |   9.6  | |   7.7 | 5.5  | 5.8     9.6  | 
-^                 | ARM |  10.32  | | 7.6 | 6.3  |   7.9  |  10.80 | |   8.5 | 5.5  | 6.0    10.80 | 
-^cbc-plain64      | HW  |   8.44  | | 6.7 | 6.1  |   7.5  |   8.9  | |   7.7 | 5.5  | 5.7     8.8  | 
-^                 | SW  |   9.15  | | 6.8 | 6.1  |   7.5  |   9.5  | |   7.6 | 5.5  | 5.8     9.7  | 
-^                 | ARM |  10.24  | | 7.6 | 6.2  |   7.8  |  10.70 | |   8.4 | 5.1  | 5.5    10.00 | 
-^cbc-essiv:sha256 | HW  |   7.47  | | 6.0 | 5.5  |   6.5  |   7.8  | |   6.9 | 5.0  | 5.2     7.8  | 
-^                 | SW  |   8.59  | | 6.7 | 6.1  |   7.5  |   9.0  | |   7.5 | 5.3  | 5.5     8.9  
-^                 | ARM |   9.83  | | 7.5 | 6.2  |   7.9  |  10.50 | |   8.3 | 5.5  | 5.7    10.60 | 
-^xts-plain        | SW  |   8.70  | | 6.8 | 6.1  |   7.5  |   9.1  | |   7.6 | 5.5  | 5.6     9.2  | 
-^                 | ARM |  10.09  | | 7.9 | 6.6  |   8.5  |  10.7  | |   8.8 | 5.2  | 5.6    10.80 | 
-^xts-plain64      | SW  |   8.70  | | 6.8 | 6.1  |   7.5  |   9.2  | |   7.6 | 5.5  | 5.6     9.2  | 
-^                 | ARM |  10.14  | | 7.9 | 6.6  |   8.4  |  10.80 | |   8.8 | 5.4  | 5.7    10.80 | 
-^xts-essiv:sha256 | SW  |   8.37  | | 6.7 | 6.1  |   7.0  |   8.8  | |   7.3 | 5.1  | 5.4     8.4  | 
-^                 | ARM |   9.94  | | 7.7 | 6.3  |   7.9  |  10.40 | |   8.5 | 4.9  | 5.2     9.7  | 
-^  without encryption  ^^^^^^^^^^^^^ 
-^                      Block device                       ^^^^^^ ^  EXT4                 ^^^^   
-^                 ^ acc ^  hdparm ^ ^ WR  ^ WR S ^  WR DS ^   RD   ^ ^  WR   ^ WR S ^ WR DS ^   RD   ^ 
-^  /dev/sda5      |      137    | | 91  | 33.7 |  51.7  |   149  | |   69  | 13   | 15    |   149  | 
- 
-Comparison SW & HW with loaded system 
-<code>stress -v -c 1</code> 
-^                      Block device                   ^^^^^^ ^  EXT4                 ^^^^   
-^                 ^ acc ^ hdparm ^ ^ WR  ^ WR S ^ WR DS ^ RD   ^ ^ WR  ^ WR S ^ WR DS ^ RD  ^ 
-^cbc-plain-128    | HW  |  4.65  | | 3.9 | 3.7  | 3.9   | 4.9  | | 4.1 | 3.3  | 3.4   | 4.9 | 
-^                 | SW  |  6.15  | | 4.4 | 4.2  | 5.3   | 6.5  | | 4.9 | 3.6  | 3.7   | 6.0 | 
-^cbc-plain-256    | HW  |  4.72  | | 3.8 | 3.6  | 3.9   | 4.9  | | 4.0 | 3.3  | 3.4   | 4.8 | 
-^                 | SW  |  4.74  | | 3.6 | 3.5  | 4.0   | 5.0  | | 4.0 | 3.3  | 3.5   | 5.0 | 
- 
-**Twofish** cipher (SW only): 
-^                      Block device                   ^^^^^^ ^  EXT4                 ^^^^   
-^                 ^ key ^ hdparm ^ ^ WR  ^ WR S ^ WR DS ^ RD   ^ ^ WR  ^ WR S ^ WR DS ^ RD  ^ 
-^cbc-plain        | 128 | 11.80  | | 8.4 | 7.4  | 9.5   | 12.4 | | 9.6 | 6.0  | 6.1   |11.5 | 
-^cbc-essiv:sha256 | 128 | 11.35  | | 8.2 | 7.4  | 8.7   | 11.9 | | 9.5 | 6.2  | 6.5   |11.9 | 
-^xts-plain        | 128 | 11.61  | | 8.4 | 7.4  | 9.4   | 12.2 | | 9.5 | 6.2  | 6.6   |12.3 | 
-^xts-essiv:sha256 | 128 | 11.06  | | 8.0 | 7.4  | 8.7   | 11.6 | | 9.1 | 6.2  | 6.5   |11.7 | 
-^cbc-plain        | 256 | 11.82  | | 8.4 | 7.4  | 9.5   | 12.4 | | 9.7 | 6.5  | 6.6   |12.4 | 
-^cbc-essiv:sha256 | 256 | 11.34  | | 8.2 | 7.4  | 8.7   | 11.9 | | 9.5 | 6.2  | 6.6   |12.0 | 
-^xts-plain        | 256 | 11.64  | | 8.4 | 7.4  | 9.4   | 12.2 | | 9.6 | 6.2  | 6.6   |12.3 | 
-^xts-essiv:sha256 | 256 | 11.04  | | 8.0 | 7.4  | 8.7   | 11.6 | | 9.3 | 6.2  | 6.5   |11.7 | 
  
  
-\\ 
-~~COMPLEX_TABLES~~ 
  
 ====== Features ====== ====== Features ======
Line 376: Line 191:
  
 ====== Own kernel ====== ====== Own kernel ======
-here's no need to keep pestering the poor guy over simple config changes. It's easy to build your own kernel; the instructions are right there in the first post. On a debian host you need to add the emdebian repo and install gcc-4.7-arm-linux-gnueabi (or whatever version) and u-boot-tools to build the kernel.+There's no need to keep pestering the poor guy over simple config changes. It's easy to build your own kernel; the instructions are right there in the first post. On a debian host you need to add the emdebian repo and install gcc-4.7-arm-linux-gnueabi (or whatever version) and u-boot-tools to build the kernel.
  
 I just built one with device mapper and crypto target support, and threw in netfilter NAT stuff for giggles. I just built one with device mapper and crypto target support, and threw in netfilter NAT stuff for giggles.
Line 384: Line 199:
  
  
-==== Kernel 3.18 ====+===== Kernel 3.18 =====
  
 Download lastest Jessie rootfs from: [[http://forum.doozan.com/read.php?2,12096|Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs]] Download lastest Jessie rootfs from: [[http://forum.doozan.com/read.php?2,12096|Linux Kernel 3.18 (FDT) and 3.16 (non-FDT) Kirkwood package and rootfs]]
  
-Or locally: {{:nsa310:linux-3.18.5-kirkwood-tld-1-bodhi.tar.bz2|linux-3.18.5-kirkwood-tld-1-bodhi.tar.bz2}}  {{:nsa310:debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2|debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2}}+Or locally: {{hw:nsa310:linux-3.18.5-kirkwood-tld-1-bodhi.tar.bz2|linux-3.18.5-kirkwood-tld-1-bodhi.tar.bz2}}  {{hw:nsa310:debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2|debian-3.18.5-kirkwood-tld-1-rootfs-bodhi.tar.bz2}}
  
 Unpack rootfs to media, can be USB pendrive for now. Unpack rootfs to media, can be USB pendrive for now.
Line 398: Line 213:
  
 Inside rootfs, there is /boot directory which contains bootable kernel, initrd and deveice trees. Go to newly unpacked roots directory and create images recognizable by u-boot. If command //mkimage// is missing, please install //u-boot-tools//. Inside rootfs, there is /boot directory which contains bootable kernel, initrd and deveice trees. Go to newly unpacked roots directory and create images recognizable by u-boot. If command //mkimage// is missing, please install //u-boot-tools//.
-=== Boot without Flattened Device Tree ===+===== Boot without Flattened Device Tree =====
  
 This method is supported by old (stock) U-BOOT. In this case FDT structure is appended at end of kernel. This method is supported by old (stock) U-BOOT. In this case FDT structure is appended at end of kernel.
Line 429: Line 244:
 </code> </code>
  
-=== Boot with Flattened Device Tree ===+===== Boot with Flattened Device Tree =====
  
-**NOT SUPPORTED BY OLD (default U-BOOT**+**NOT SUPPORTED BY OLD (default U-BOOT)**
 <code> <code>
 cd boot cd boot
Line 458: Line 273:
 </code> </code>
  
-=== Adapt own devie tree file ===+===== Adapt own devie tree file =====
 There are multiple HW versions of NSA310 on market, but only 2 device tree are defined in kernel: There are multiple HW versions of NSA310 on market, but only 2 device tree are defined in kernel:
   - kirkwood-nsa310.dtb - all LEDs are bicolor (red and green), sensors device 'adt7476' on I2C bus   - kirkwood-nsa310.dtb - all LEDs are bicolor (red and green), sensors device 'adt7476' on I2C bus
   - kirkwood-nsa310a.dtb - like above but without red USB led, and sensor device 'lm85'   - kirkwood-nsa310a.dtb - like above but without red USB led, and sensor device 'lm85'
  
-My NSA310 version is like nsa310 but with lm85 :), so I've created {{:nsa310:kirkwood-nsa310b.dts|kirkwood-nsa310b.dts}} based on kirkwood-nsa310.dts with LM85 section from kirkwood-nsa310a.dts.+My NSA310 version is like nsa310 but with lm85 :), so I've created {{hw:nsa310:kirkwood-nsa310b.dts|kirkwood-nsa310b.dts}} based on kirkwood-nsa310.dts with LM85 section from kirkwood-nsa310a.dts.
  
 <code> <code>