Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Feb 2015 05:19:50 +0900
From:      "Daisuke Aoyama" <aoyama@peach.ne.jp>
To:        <freebsd-arm@freebsd.org>
Subject:   Ready for NAS4Free on ODROID-C1
Message-ID:  <1DA948EA255F4963ACBC0EBE7D046401@ad.peach.ne.jp>

next in thread | raw e-mail | index | archive | help
Hello all,

I've created and uploaded first version of NAS4Free for ODROID-C1.
http://shell.peach.ne.jp/aoyama/archives/3044

This is another porting of FreeBSD for ODROID-C1 from scratch.
It is intended to use NAS4Free production server.
It's specialized for ODROID-C1 only. Any other hardware is never supported.
Also I have no plan to create plain FreeBSD image or patch until initial fix and cleanup are
finished.
While preparing and building for NAS4Free (over 300 ports and kernel self build with 4cores),
it's very fast and stable without any kernel panic or freeze.

Hardware main spec:
Amlogic S805 (Cortex-A5 1.5GHz Quad Core/L1 32KB/L2 512KB)
1GB memory (initial Framebuffer 24MB+1MB)
Gigabit Ethernet (direct bus not USB)
eMMC HS200/SDR50 MicroSD (one of SDHC or SDIO)
DWC OTG USB 2.0 (HW rev 3.10a/DOTG_GSNPSID=0x4f54310a)

Basic SMP kernel performance without NAS4Free:

eMMC 8GB -> R:35.6MB/s W:10.6MB/s (8bit 52MHz/actual 850/17=50MHz)
MicroSD 16GB -> R:34.6MB/s W:9.4MB/s (4bit 100MHz/actual 850/9=94MHz)
iperf3 onboard LAN -> 396Mbps (32k window / E-350 amd64 server)

NAS4Free performance:

SMB share on USB HDD -> R:35MB/s W:3MB/s (writing is teribble!)
SMB share on /dev/md0 -> R:37MB/s W:35MB/s (excellent)

It seems USB is poor, should be modified or replaced dwc_otg.c.

This version contains RaspberryPi version of patches like C++ exception, mount_smbfs.
Also it contains customized u-boot loader built by Ubuntu14.

You can get latest test image of NAS4Free 9.3.0.2 for ODROID-C1(2GB eMMC or MicroSD card) from:
http://www.peach.ne.jp/archives/nas4free/test/NAS4Free-oc1-SD-9.3.0.2.1349-20150222.img.gz

Download the image, decompress it, and write it to the eMMC module or MicroSD card of 2GB or
more capacity.
You need serial console cable or USB keyboard/HDMI display for initial IP address setup.

You can boot from either eMMC or MicroSD but booted device will be assigned to mmcsd0 if not
fail.
Since first boot media is always eMMC, you need a jumper for Boot media selector if you want
boot from MicroSD with eMMC installed.
You don't need a jumper if you use only one of eMMC or MircoSD.

For more info:
http://www.hardkernel.com/main/products/prdt_info.php?g_code=G141578608433&tab_idx=2
I've soldered a pin header of 2 pins and added a jumper for debugging.

Amlogic S805 Datasheet is here:
http://dn.odroid.com/S805/Datasheet/S805_Datasheet%20V0.8%2020150126.pdf

Known Problems:
--------------------------------------------------------------------------------------
At this time, you can't build the kernel without breaking existing all other arm kernels.

geom_part is stupid for partition alignment.
The image is aligned by BSD partion instead of MBR partition.

movt can't be used.
You need -mllvm -arm-use-movt=0 if you use -march=armv7-a. This is bad solution.
It should be fixed.

You can't access eMMC and MicroSD same time.
There is 4 of control ways for ODROID-C1.
SDHC=1or4or8bit/selectable freq src, SDIO=1or4bit/fixed freq src

eMMC - SDHC, MicroSD - SDIO < linux use this if boot from eMMC
eMMC - SDIO, MicroSD - SDHC < linux use this if boot from MicroSD
eMMC - SDHC, MicroSD - SDHC < my kernel use this
eMMC - SDIO, MicroSD - SDIO < u-boot use this

Current driver use SDHC only and share register and GPIO pins.
This means across eMMC and MicroSD is high cost operation.
For example, copying MicroSD to eMMC works but very slow due to switching GPIO pins everytime
when MMC command is issued.

# dd if=NAS4Free-oc1-SD-9.3.0.2.1349.img of=/dev/mmcsd1 bs=16k
92160+0 records in
92160+0 records out
1509949440 bytes transferred in 665.589181 secs (2268591 bytes/sec)

How to use extra partition:
--------------------------------------------------------------------------------------
If you write NAS4Free to the module/card of 2GB or more capacity, you can use extra partition as
data area.

Boot any version of NAS4Free or FreeBSD based on 11-CURRENT.
Insert the module/card written new version to USB card reader, then attach to booted host.
If your card is detected as da0, run following commands:
(please replace da0 with your USB card reader's device)

# gpart resize -i4 da0
# gpart resize -a4m -i1 da0s4
# newfs -U -j /dev/da0s4a

Now you have formatted data area in the end of the card.

Note: You can't modify correctly after booting.
Using USB card reader before booting is very important.

After booting resized new version, go to "Disks|Management" and click "Import disks".
Next, go to "Disks|Mount Point|Management", and add mount point.
Select "Disk" -> your card, "Partition type" -> MBR partition,
"Partition number" -> 4, "Mount point name" -> any string.
Click Add button.
Finally, apply the change.

Now above /dev/da0s4a is mounted on /mnt/<mount point name>.
You can add shares on it.
--------------------------------------------------------------------------------------

Detailed result:
----------------------------------------------------------------------
# dd if=/dev/mmcsd0 of=/dev/null bs=1m count=16
16+0 records in
16+0 records out
16777216 bytes transferred in 0.483878 secs (34672409 bytes/sec)

# dd if=/dev/zero of=/dev/mmcsd0s2b bs=1m count=16
16+0 records in
16+0 records out
16777216 bytes transferred in 1.769085 secs (9483556 bytes/sec)

# dd if=/dev/mmcsd1 of=/dev/null bs=1m count=16
16+0 records in
16+0 records out
16777216 bytes transferred in 0.470816 secs (35634337 bytes/sec)

# dd if=/dev/zero of=/dev/mmcsd1s2b bs=1m count=16
16+0 records in
16+0 records out
16777216 bytes transferred in 1.579612 secs (10621099 bytes/sec)

# iperf3 -c 172.18.0.135 -w 32k
Connecting to host 172.18.0.135, port 5201
[  4] local 172.18.0.136 port 11405 connected to 172.18.0.135 port 5201
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-1.00   sec  47.4 MBytes   397 Mbits/sec
[  4]   1.00-2.00   sec  47.6 MBytes   399 Mbits/sec
[  4]   2.00-3.00   sec  47.7 MBytes   400 Mbits/sec
[  4]   3.00-4.00   sec  47.6 MBytes   399 Mbits/sec
[  4]   4.00-5.00   sec  45.2 MBytes   379 Mbits/sec
[  4]   5.00-6.00   sec  46.6 MBytes   391 Mbits/sec
[  4]   6.00-7.00   sec  47.3 MBytes   397 Mbits/sec
[  4]   7.00-8.00   sec  47.4 MBytes   398 Mbits/sec
[  4]   8.00-9.00   sec  48.2 MBytes   404 Mbits/sec
[  4]   9.00-10.00  sec  47.5 MBytes   398 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bandwidth
[  4]   0.00-10.00  sec   472 MBytes   396 Mbits/sec                  sender
[  4]   0.00-10.00  sec   472 MBytes   396 Mbits/sec                  receiver

-----------------------------------------------------------------------
CrystalDiskMark 3.0.2 Shizuku Edition x64 (C) 2007-2012 hiyohiyo
                           Crystal Dew World : http://crystalmark.info/
-----------------------------------------------------------------------
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]

           Sequential Read :    35.816 MB/s
          Sequential Write :     3.125 MB/s
         Random Read 512KB :    36.367 MB/s
        Random Write 512KB :     2.443 MB/s
    Random Read 4KB (QD=1) :     6.309 MB/s [  1540.2 IOPS]
   Random Write 4KB (QD=1) :     0.062 MB/s [    15.2 IOPS]
   Random Read 4KB (QD=32) :     6.622 MB/s [  1616.7 IOPS]
  Random Write 4KB (QD=32) :     0.067 MB/s [    16.4 IOPS]

  Test : 100 MB [Z: 3.8% (11.3/298.1 GB)] (x5)
  Date : 2015/02/21 16:57:25
    OS : Windows 7 Ultimate Edition SP1 [6.1 Build 7601] (x64)
    USB HDD

-----------------------------------------------------------------------
CrystalDiskMark 3.0.2 Shizuku Edition x64 (C) 2007-2012 hiyohiyo
                           Crystal Dew World : http://crystalmark.info/
-----------------------------------------------------------------------
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]

           Sequential Read :    37.418 MB/s
          Sequential Write :    35.369 MB/s
         Random Read 512KB :    37.112 MB/s
        Random Write 512KB :    35.103 MB/s
    Random Read 4KB (QD=1) :     5.964 MB/s [  1456.0 IOPS]
   Random Write 4KB (QD=1) :     4.473 MB/s [  1092.1 IOPS]
   Random Read 4KB (QD=32) :     6.638 MB/s [  1620.5 IOPS]
  Random Write 4KB (QD=32) :     5.085 MB/s [  1241.4 IOPS]

  Test : 100 MB [V: 8.0% (19.8/247.5 MB)] (x5)
  Date : 2015/02/21 18:25:16
    OS : Windows 7 Ultimate Edition SP1 [6.1 Build 7601] (x64)
    /dev/md0 on ODROID-C1
----------------------------------------------------------------------

Enjoy NAS4Free world yourself.
-- 
Daisuke Aoyama

 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1DA948EA255F4963ACBC0EBE7D046401>