0
Isala Piyarisi

Banana Pi M2U won't Boot

Recommended Posts

I have worked with Raspberry pi for some time but I need a board with SATA port so I can plug in my hard drive directly so I got a Banana Pi M2U from ebay. When It arrived I thought this will be normal as my Raspberry pi So I downloaded image (Raspbian Jiessie) from http://www.banana-pi.org/m2u-download.html and burn it to SD card and boot up. It booted up I worked it with for few weeks and noticed it's not stable Pi Randomly Crash and I can't use a sata port multiplier. Then I found about armbian, So I went to armbian site and download the image for banana pi m2 and burn it with etcher and put the sd card to pi but it won't boot up, no display and and only one led on the board light up and ethernet lights also not turning on. Is this because I download the image for banana pi m2 not for m2u(there is not image for m2u) ?

Share this post


Link to post
Share on other sites
On 17.9.2017 at 8:00 AM, Isala Piyarisi said:

there is not image for m2u

 

Exactly. M2 Ultra is not supported and this huge bunch of totally incompatible Bananas all with M2 in their name is just that: incompatible to each other. So you can't boot any M2 image on a M2+, M2U, M2M, M2 Berry or Zero of course. That's not an Armbian problem, that's a naming problem and hardware incompatibility (all these boards/SoCs need different bootloaders/kernels at the time of this writing -- only exceptions: M2+ and M2 Zero software is interchangeable, same with M2 Ultra and Berry). Wrt Armbian and Bananas:

  • We support the real Bananas (A20 based M1/Pro) in every regard (only Lamobo R1 support phased out in the meantime since support nightmare)
  • We support A31 based M2 for historical reasons since vendor's 'official OS images' were absolutely unusable while at that time back then most buyers weren't aware that more recent Bananas have nothing in common with the good original Bananas
  • We support H3 based M2+ since 'just another H3 board' and it looked easy to add support (we learned only later that this vendor sent us partially defective dev samples, provided/provides wrong schematics and we couldn't rely on his 'technical documentation' since wrong as usual, GPIO pin mappings for example were just 'copy&paste gone wrong' for which this vendor has become famous in the meantime)

 

End of Banana journey for now.

 

BTW: if you bought the M2 Ultra for SATA you most probably fooled yourself since Allwinner SATA is still horribly slow SATA :) Check review of M2 Berry (same as M2 Ultra just with less memory/features but as a compensation stupid powering problems added) and how other even more affordable boards perform (here, here, here).

Share this post


Link to post
Share on other sites

Thanks for Quick Reply, I should have research about this before buying the banana pi m2u :(. My Daily used Raspberry pi died on me few days before buying this. I used Raspberry pi as the my Home media server and without it it's difficult to live for me that's why I rush to buy a new one with better performance  and sata enable so I can directly plug my hard drives for banana pi with a sata port multiplier but I couldn't find single article  which sate how to setup a sata port multiplier in banana pi m2u. So I end up plugin only one hard disk to banana pi. Do you know any way to make a sata port multiplier work on banana pi m2u ? and can you recommend a good  linux distros  that I can use for banana pi m2u I only need to use CLI no GUI required.

Share this post


Link to post
Share on other sites
26 minutes ago, Isala Piyarisi said:

Do you know any way to make a sata port multiplier work on banana pi m2u ?

 

Most probably using the same super simple patch as for A20 legacy kernel (we wrote in linux-sunxi wiki what's necessary ages ago). You might ask in official Banana forum how to do this since not many people here are willing to waste their time with Bananas these days. Besides that using a PM behind such an ultra slow SATA port without the ability to use PMs that support FIS based switching is a bad idea anyway.

 

Wrt good Linux distros you have to differentiate: one thing is kernel stuff (grab one of their latest images since in the meantime the Banana folks don't stupidly refuse to accept community patches any more, so with their most recent images you get at least kernel 3.10.107 and the most severe stability problems of this platform fixed), the other is userland. If I would have to use such a Banana I would combine this kernel with a fresh Armbian rootfs. But the Banana manufacturer's CEO could finally convince me to stay away from their products forever :)

Share this post


Link to post
Share on other sites
11 minutes ago, tkaiser said:

You might ask in official Banana forum how to do this

 

BTW: I was just kidding since you would be the first person to receive technical support over there. Anyway: you need to manipulate the kernel in a way that 'AHCI_HFLAG_NO_PMP' is not set in: https://github.com/dan-and/BPI-M2U-bsp/blob/master/linux-sunxi/drivers/ata/ahci_sunxi.c#L85 (can be done 'the hard way' but then you loose the ability to attach disks without PM in between or using a more intelligent approach like Hans' patch did it for A20 legacy kernel few years ago).

 

BTW: cheap PM are always a good way to loose your data: http://forum.lemaker.org/forum.php?mod=viewthread&tid=9207&page=2#pid62287

Share this post


Link to post
Share on other sites
3 minutes ago, Isala Piyarisi said:

Well I tried asking them but nobody replied to me

 

Well, then reply to yourself in your thread over there and link to this thread. If their employee censoring the forum and having constantly deleted my posts is still active he'll delete the link if not at least others could get a clue how to solve the problem.

Share this post


Link to post
Share on other sites
17 hours ago, Isala Piyarisi said:

It looks like It's Good Idea to attach only one Hard Drive.

 

To the SATA port of course. Then you have on the M2 Ultra two more USB2 ports that can be also used to attach disks (on the Berry those Banana 'engineers' chose to not use one of the 2 USB host ports and connected an USB hub to the other USB host port so all USB receptacles have to share bandwidth). Anyway since a lot of those Banana users are keen on PM support I simply gave it a try following Dan's readme.

 

http://kaiser-edv.de/tmp/NumpU8/BPI-M2_Ultra_Berry_PM_kernel_3.10.107.tgz

 

root@armbian:/srv/btrfs/BPI-M2U-bsp# git diff
diff --git a/linux-sunxi/drivers/ata/ahci_sunxi.c b/linux-sunxi/drivers/ata/ahci_sunxi.c
index 58637dc..31c7205 100755
--- a/linux-sunxi/drivers/ata/ahci_sunxi.c
+++ b/linux-sunxi/drivers/ata/ahci_sunxi.c
@@ -82,7 +82,7 @@ static struct ata_port_info ahci_sunxi_port_info = {
        .udma_mask = ATA_UDMA6,
        .port_ops = &ahci_ops,
        .private_data = (void *)(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI
-               | AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ),
+               | AHCI_HFLAG_YES_NCQ),
 };
 
root@armbian:/srv/btrfs/BPI-M2U-bsp# file SD/BPI-BOOT/bananapi/bpi-m2u/linux/uImage
SD/BPI-BOOT/bananapi/bpi-m2u/linux/uImage: u-boot legacy uImage, Linux-3.10.107-BPI-M2U-Kernel, Linux/ARM, OS Kernel Image (Not compressed), 6832824 bytes, Mon Sep 18 10:21:59 2017, Load Address: 0x40008000, Entry Point: 0x40008000, Header CRC: 0x2A92F115, Data CRC: 0x32A05929
root@armbian:/srv/btrfs/BPI-M2U-bsp# tar cf - SD/BPI-BOOT/bananapi/bpi-m2u/linux/uImage SD/*.tgz | gzip -c >BPI-M2_Ultra_Berry_PM_kernel_3.10.107.tgz
root@armbian:/srv/btrfs/BPI-M2U-bsp# 

 

I can't check whether it works as expected and I can't inform Banana users in official Banana forum since the funny guy censoring there as 'sinovoip bpi team' constantly deletes my posts or even bans my account.

 

Performance with such a PM attached will be of course even worse than with single disk SATA operation since Allwinner SATA is magnitudes lower than SATA on the good boards we support too (again see hereherehere and maybe also here too)

Share this post


Link to post
Share on other sites

Success (as expected since it's really just removing AHCI_HFLAG_NO_PMP as Hans did it with A20 legacy kernel 3 years ago).

 

I asked a friend who for whatever reasons bought a BPi M2 Ultra to try the kernel with my 'patch' out. Et voilà: 2 disks behind the PM immediately usable:

root@bpi-iot-ros-ai:/home/pi# cat /proc/partitions 
major minor  #blocks  name

 179        0   62521344 mmcblk0
 179        1     262144 mmcblk0p1
 179        2    7269376 mmcblk0p2
   8        0  117220824 sda
   8       16  117220824 sdb
root@bpi-iot-ros-ai:/home/pi# dmesg | egrep -i "ahci|sata"
[    1.433322] sunxi-ahci sata: sata_regulator0 "vdd-sata-25"!
[    1.433393] sunxi-ahci sata: sata_regulator1 "vdd-sata-12"!
[    1.434427] sunxi-ahci sata: regulator "vdd-sata-25" voltage set: 2500000 to 2500000!
[    1.435368] sunxi-ahci sata: regulator "vdd-sata-12" voltage set: 1200000 to 1200000!
[    1.437558] sunxi-ahci sata: frequncy of module clk for AHCI: 100000000
[    1.437569] sunxi-ahci sata: frequncy of pll clk for AHCI: 100000000
[    1.500043] sunxi-ahci sata: SATA power enable do not exist!!
[    1.506478] sunxi-ahci sata: forcing PORTS_IMPL to 0x1
[    1.506539] sunxi-ahci sata: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[    1.506553] sunxi-ahci sata: flags: ncq sntf pm led clo only pmp pio slum part ccc 
[    1.508094] scsi0 : sunxi-ahci
[    1.508714] ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c181ff] port 0x100 irq 88
[    2.040064] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    2.671284] ata1.00: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    3.230766] ata1.01: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[    4.301166] ata1.02: SATA link down (SStatus 0 SControl 0)
[    5.370674] ata1.03: SATA link down (SStatus 0 SControl 0)
[    6.440684] ata1.04: SATA link down (SStatus 0 SControl 0)
root@bpi-iot-ros-ai:/home/pi# uname -a
Linux bpi-iot-ros-ai 3.10.107-BPI-M2U-Kernel #2 SMP Mon Sep 18 03:21:30 PDT 2017 armv7l GNU/Linux

Now he's happy but this will change as soon as he realizes how slow this setup will be -- all disks behind the PM have to share bandwidth and since no FIS based switching is supported also random IO performance will be crappy :)

Share this post


Link to post
Share on other sites

LOL! I asked my friend to try to create a RAID5 out of 3 HDDs connected to his port multiplier and then send me the output from /proc/mdstat while the initial sync is running. Since he has no 3rd HDD around he used a small 120 GB SSD as third drive which keeps the RAID size also small:

md0 : active raid5 sdc[2] sdb[1] sda[0]
      234178560 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
      [>....................]  resync =  3.9% (4654592/117089280) finish=131.9min speed=14200K/sec
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>

If I remember correctly when I played around myself with RAID5 today on an Armbian supported device I got +120 MB/s and not just 14MB/s. On the Banana above the RAID array is not even 240 GB in size but sync/rebuild time is still +2 hours. So if these were 3 x 4 TB HDDs both RAID creation or a rebuild after a failed disk would already took 6 whole days. Nothing has changed: Allwinner SATA + port multiplier --> worst performance possible.

Share this post


Link to post
Share on other sites

Edit: 'Benchmarking gone wrong' warning: by accident I missed iozone's -I flag below ('Use DIRECT IO if possible for all file operations. Tells the filesystem that all operations to the file are to bypass the buffer cache and go directly to disk') so all read numbers with 100MB test size are wrong since coming from DRAM and not disk)

 

Final update: I asked the guy with BPi M2 Ultra, JMB393 port multiplier and 'my' kernel (it's really just repeating what I did already 3 years ago with the original Banana Pi) to run also the 'usual benchmarks' (see this post for details):

                                                              random    random
              kB  reclen    write  rewrite    read    reread    read     write
          102400       4    19027    19675   221183   246677   238654     7974
          102400      16    18808    20857   259049   295393   278568    11913
          102400     512    18999    21123   261343   310472   312191    15584
          102400    1024    18682    21194   262045   294879   294856    19896
          102400   16384    19199    20180   260566   306555   309892    20345
         4096000       4    20412    21239    86094    85480     1508     1664
         4096000   16384    20325    21326    86195    83331    78942    20452

The last two runs were with 4GB filesize since BPi M2 Ultra has 2 GB of DRAM so to prevent kernel buffers tampering the results it's necessary to test with at least twice the DRAM size. As can be seen above all read results with just 100 MB filesize are BS since way too high. This is buffering/caching at the mdraid / block device layer due to missing '-I' iozone parameter. Realistic throughput values with a RAID5 consisting of 3 disks behind a PM connected to 'Allwinner SATA' is 20 MB/s write and 85 MB/s read. Random IO depends mostly on the used drives (so as soon as you don't test with SSDs only everything will slow down as hell) but the inability to use FIS based switching with port multipliers lowers numbers too.

 

So with R40 it's still a horribly bad idea to use SATA port multipliers and especially RAID since it's not only slow as hell but also highly unreliable (those cheap PM are excellent at eating data when overheating under constant load). If one wants to play RAID5 with such a Banana M2 Ultra the way better idea is to throw the PM into the bin and attach one disk to SATA and two to the USB host ports. Write performance will increase from 20 up to ~75 MB/s (if mainline kernel might be ready next year maybe 80 MB/s) and read performance will climb from 85 MB/s to 110 MB/s maybe. You'll get the same numbers with every cheap NanoPi or OrangePi that feature three real USB2 ports too of course :)

Share this post


Link to post
Share on other sites
On 9/18/2017 at 4:43 PM, tkaiser said:

Hey Sorry for late reply I just saw replies. I tried Downloading the kernel you shared  but I had no luck installing it :( only if you don't mind can you give me little more details how to install it ? extracting it didn't help and as I mentioned earlier I am not much of a linux guy :unsure:

Share this post


Link to post
Share on other sites
On 6.10.2017 at 5:51 PM, Isala Piyarisi said:

can you give me little more details how to install it ?

 

Unfortunately not since I gave up on those brain-dead Allwinner BSP procedures long ago (there's a reason almost no developer wants to deal with this mess where you have to overwrite a few sectors here and exchange a few files there. Also the last time I tried to follow SinoVoip's 'tutorial' how to do this the instructions were wrong as usual since these copy&paste monkeys simply don't care about correctness).

 

You might want to open a thread in their forum, tell everyone that PM support works with R40 just as with A20 years ago (it's confirmed, see above), post this link as a reference in the Banana forum and anyone who has knowledge/nerves over there should be able to help you exchanging the kernel to play with your Port Multiplier.

 

BTW: of course the SinoVoip guys already know that PM support works (they got a Github notification) but as usual instead of providing a tutorial or even prepare the PM capability in a modular way like community did for A20 years ago they prefer to don't give a sh*t.

 

Edit: Meanwhile in Banana land. Unbelievable :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0