Jump to content

Banana Pi with Modular PMP Support


Recommended Posts

PMP is not enabled by default in any image and there is no modular solution yet. I was not working anything in this field yet.

 

You need to hack and recompile kernel - a quick summary for those who don't know how:

nano drivers/ata/sw_ahci_platform.c

Change from:

.private_data = (void*)(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI
             | AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ),
};

to:

.private_data = (void*)(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI
             | AHCI_HFLAG_YES_NCQ),
};

Recompile kernel.

 

 

Do any of your images have dvb header support like Raspbian?

There is a lot of stuff in both kernels and I keep adding. What exactly do you miss? 

Link to comment
Share on other sites

Thanks Igor, my understanding from tkaiser on the lemaker forums was this added modular support when using your build scripts

 

lib/config/linux-sunxi-next.config

Change CONFIG_AHCI_SUNXI=y to

CONFIG_AHCI_SUNXI=m

 

After build is complete, when booting for first time

nano /etc/modprobe.d/ahci-sunxi.conf

Add this line, save and reboot, to deactivate just remove the line below too

options ahci-sunxi enable_pmp=1

Link to comment
Share on other sites

For the headers I need this is an example output of success on Minibian (uses Raspbian kernel AFAIK)

[89543.478524] usb 1-1.4: Product: PCTV 292e
[89543.483508] usb 1-1.4: Manufacturer: PCTV
[89543.487647] usb 1-1.4: SerialNumber: 0011443350
[89543.514239] media: Linux media interface: v0.10
[89543.536748] Linux video capture interface: v2.00
[89543.557306] em28xx: New device PCTV PCTV 292e @ 480 Mbps (2013:025f, interface 0, class 0)
[89543.565942] em28xx: DVB interface 0 found: isoc
[89543.570852] em28xx: chip ID is em28178
[89545.571235] em28178 #0: EEPROM ID = 26 00 01 00, EEPROM hash = 0x4b0ffc04
[89545.578244] em28178 #0: EEPROM info:
[89545.581911] em28178 #0:      microcode start address = 0x0004, boot configuration = 0x01
[89545.598224] em28178 #0:      AC97 audio (5 sample rates)
[89545.603364] em28178 #0:      500mA max power
[89545.607392] em28178 #0:      Table at offset 0x27, strings=0x146a, 0x1888, 0x0a7e
[89545.614932] em28178 #0: Identified as PCTV tripleStick (292e) (card=94)
[89545.621718] em28178 #0: dvb set to isoc mode.
[89545.626537] usbcore: registered new interface driver em28xx
[89545.652057] em28178 #0: Binding DVB extension
[89545.676980] i2c i2c-1: Added multiplexed i2c bus 2
[89545.683496] si2168 1-0064: Silicon Labs Si2168 successfully attached
[89545.701833] si2157 2-0060: Silicon Labs Si2157/Si2158 successfully attached
[89545.710717] DVB: registering new adapter (em28178 #0)
[89545.717955] usb 1-1.4: DVB: registering adapter 0 frontend 0 (Silicon Labs Si2168)...
[89545.730716] em28178 #0: DVB extension successfully initialized
[89545.738686] em28xx: Registered (Em28xx dvb Extension) extension
[89545.760909] em28178 #0: Registering input extension
[89545.802667] Registered IR keymap rc-pinnacle-pctv-hd
[89545.809794] input: em28xx IR (em28178 #0) as /devices/platform/bcm2708_usb/usb1/1-1/1-1.4/rc/rc0/input0
[89545.823224] rc0: em28xx IR (em28178 #0) as /devices/platform/bcm2708_usb/usb1/1-1/1-1.4/rc/rc0
[89545.835855] em28178 #0: Input extension successfully initalized
[89545.843783] em28xx: Registered (Em28xx Input Extension) extension

On your Banana Pi 3.4.107 image I get no such output in dmesg only 

 usb 2-1: new high-speed USB device number 3 using sw-ehci

I even install the firmware manually like I did for the Raspberry Pi and it didn't help.

Trying to install firmware-linux-nonfree I get a broken pipe error despite being able to install tvheadend

 Unpacking firmware-linux-nonfree (from .../firmware-linux-nonfree_0.36+wheezy.1_all.deb) ...dpkg: error processing /var/cache/apt/archives/firmware-linux-nonfree_0.36+wheezy.1_all.deb (--unpack):
 trying to overwrite '/lib/firmware/mts_gsm.fw', which is also in package linux-firmware-image-3.4.107-bananapi 2.8
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/firmware-linux-nonfree_0.36+wheezy.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Link to comment
Share on other sites

That is the one I use, very cheap and guaranteed to work. You need at least mainline 3.19.3 kernel I think. You may be able to find it cheaper on AliExpress but they don't take PayPal.

Link to comment
Share on other sites

 

For the headers I need this is an example output of success on Minibian (uses Raspbian kernel AFAIK)

 

Dump it's kernel configuration if possible.

Link to comment
Share on other sites

I think this is the relevant section

 

# Multimedia core support
#
CONFIG_MEDIA_CAMERA_SUPPORT=y
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
CONFIG_MEDIA_RADIO_SUPPORT=y
# CONFIG_MEDIA_SDR_SUPPORT is not set
CONFIG_MEDIA_RC_SUPPORT=y
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_DEV=m
# CONFIG_VIDEO_V4L2_SUBDEV_API is not set
CONFIG_VIDEO_V4L2=m
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_TUNER=m
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEOBUF_DVB=m
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
CONFIG_VIDEOBUF2_VMALLOC=m
CONFIG_DVB_CORE=m
CONFIG_DVB_NET=y
CONFIG_TTPCI_EEPROM=m
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
#
# Analog TV USB devices
#
CONFIG_VIDEO_PVRUSB2=m
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_VIDEO_PVRUSB2_DVB=y
# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_TLG2300=m
CONFIG_VIDEO_USBVISION=m
CONFIG_VIDEO_STK1160_COMMON=m
CONFIG_VIDEO_STK1160_AC97=y
CONFIG_VIDEO_STK1160=m
CONFIG_VIDEO_GO7007=m
CONFIG_VIDEO_GO7007_USB=m
CONFIG_VIDEO_GO7007_LOADER=m
CONFIG_VIDEO_GO7007_USB_S2250_BOARD=m
#
# Analog/digital TV USB devices
#
CONFIG_VIDEO_AU0828=m
CONFIG_VIDEO_AU0828_V4L2=y
CONFIG_VIDEO_AU0828_RC=y
CONFIG_VIDEO_CX231XX=m
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=m
CONFIG_VIDEO_CX231XX_DVB=m
CONFIG_VIDEO_TM6000=m
CONFIG_VIDEO_TM6000_ALSA=m
CONFIG_VIDEO_TM6000_DVB=m


#
# Digital TV USB devices
#
CONFIG_DVB_USB=m
# CONFIG_DVB_USB_DEBUG is not set
CONFIG_DVB_USB_A800=m
CONFIG_DVB_USB_DIBUSB_MB=m
CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
CONFIG_DVB_USB_DIBUSB_MC=m
CONFIG_DVB_USB_DIB0700=m
CONFIG_DVB_USB_UMT_010=m
CONFIG_DVB_USB_CXUSB=m
CONFIG_DVB_USB_M920X=m
CONFIG_DVB_USB_DIGITV=m
CONFIG_DVB_USB_VP7045=m
CONFIG_DVB_USB_VP702X=m
CONFIG_DVB_USB_GP8PSK=m
CONFIG_DVB_USB_NOVA_T_USB2=m
CONFIG_DVB_USB_TTUSB2=m
CONFIG_DVB_USB_DTT200U=m
CONFIG_DVB_USB_OPERA1=m
CONFIG_DVB_USB_AF9005=m
CONFIG_DVB_USB_AF9005_REMOTE=m
CONFIG_DVB_USB_PCTV452E=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_CINERGY_T2=m
CONFIG_DVB_USB_DTV5100=m
CONFIG_DVB_USB_FRIIO=m
CONFIG_DVB_USB_AZ6027=m
CONFIG_DVB_USB_TECHNISAT_USB2=m
CONFIG_DVB_USB_V2=m
CONFIG_DVB_USB_AF9015=m
CONFIG_DVB_USB_AF9035=m
CONFIG_DVB_USB_ANYSEE=m
CONFIG_DVB_USB_AU6610=m
CONFIG_DVB_USB_AZ6007=m
CONFIG_DVB_USB_CE6230=m
CONFIG_DVB_USB_EC168=m
CONFIG_DVB_USB_GL861=m
CONFIG_DVB_USB_LME2510=m
CONFIG_DVB_USB_MXL111SF=m
CONFIG_DVB_USB_RTL28XXU=m
CONFIG_DVB_USB_DVBSKY=m
CONFIG_SMS_USB_DRV=m
CONFIG_DVB_B2C2_FLEXCOP_USB=m
# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set
CONFIG_DVB_AS102=m
 

 

Link to comment
Share on other sites

I just wanted to confirm using your Banana Pi build script, I changed kernel to 3.19.7 and branch to next, modular PMP was enabled by default.

 

It was as simple as adding options ahci-sunxi enable_pmp=1 to /etc/modprobe.d/ahci-sunxi.conf

 

root@bananapi:~# blkid
/dev/mmcblk0p1: UUID="a73fb24c-de15-4a1f-a4fe-b6436f8d98f3" TYPE="ext4"
/dev/sda1: LABEL="SP PHD U3" UUID="190D-153C" TYPE="vfat"
/dev/sdb1: LABEL="SP PHD U3" UUID="1917-2940" TYPE="vfat"
/dev/sdc1: LABEL="SP PHD U3" UUID="19E3-1C09" TYPE="vfat"
/dev/sdd1: LABEL="SP PHD U3" UUID="1911-0E2F" TYPE="vfat"
 

Will release an image later with some media server tools installed :)

The next step will be to have dvb support added

Link to comment
Share on other sites

Nice. I'll take a look later on .. .but if you succeed in compilation just push up to Github the working compilation.

 

BTW: you can now switch to kernel 4.0.4, patches are fixed, kernel boots fine.

KERNELTAG="v4.0.4" # kernel TAG - valid only for mainline
Link to comment
Share on other sites

OK great, not sure what the differences are between all the kernels, only was told that modular PMP support was in 3.19 mainline. Maybe kernel 4 has both PMP modular support and ability to configure DVB stuff?

Link to comment
Share on other sites

Trying to build v4.0.4 as kernel tag with mainline for wheezy and it keeps just making another 3.19.7. I deleted the lib dir and that didn't help either, I'm sure I'm just overlooking something simple. Any help?

Link to comment
Share on other sites

Hello!

Is there a way to activate sata pmp out of the box with Igor Images ?

With Kernel 3.19.x and 4.0.4 i only add the option ahci-sunxi enable_pmp=1 to /etc/modprobe.d/ahci-sunxi.conf.

But for Kernel 4.1.4 i have to use the build script before and change
CONFIG_AHCI_SUNXI=y to
CONFIG_AHCI_SUNXI=m in lib/config/linux-sunxi-next.config
to get use pmp.


I have a Fantec QB-35US3-6G.

Thanks for Advice

Link to comment
Share on other sites

Hi, I have a Banana Pi with Legacy Jessie Server installed, and I need support for SATA port multiplier.

 

How do I recompile the kernel as described in this topic.

 

More exactly, how do I get the kernel sourced used, with all its patches.

 

root@bananapi:~# uname -a
Linux bananapi 3.4.112-sun7i #18 SMP PREEMPT Tue Jul 5 16:21:22 CEST 2016 armv7l GNU/Linux

root@bananapi:/usr/src/linux-4.6.1# apt-get source linux=3.4.112
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Can not find version '3.4.112' of package 'linux'
E: Unable to find a source package for linux
Link to comment
Share on other sites

Thank you. It's our playground ;)

 

I did notice that the write speed is only 33MB/s, but read speed is +100MB/s.

 

A20 does not provide dedicated NAS like performance, but it's better than (any) Raspberry Pi or similar.

 

That's more or less all you can get out of this chip.
 

Check this for some insights:

http://linux-sunxi.org/Sunxi_devices_as_NAS

Link to comment
Share on other sites

I could not get linear and stripe RAID to work. So I added these to the kernel:

CONFIG_MD_LINEAR=m

CONFIG_MD_RAID0=m

 

My files can be downloaded here

 

post-1596-0-59969500-1467966763_thumb.jpg

 

RAID0 read performance is around 78MB/s, and 102MB/s when using the HD enclosure's internal RAID0, which don't need the modified kernel. I prefer to use software RAID, because then I can move my HDs around as I please. Since I will not benefit running RAID0, I think I will use LVM to merge the disks, which will perform better in a multi user load.

Link to comment
Share on other sites

Just as a note for others stumbling accross this thread. Most use cases for port multipliers and especially any PMP enabled RAID mode combined with A20's SATA implementation is just crap.

Combining cheapest and most unreliable hardware to improve reliability is a joke. Adding SPoFs (single points if failure) to improve reliability is a joke. None of the redundant RAID modes increases data safety, it's all about availability (business continuity). Trying to achieve this with 'cheapest hardware possible' is not possible.

 

Think about backup or intelligent sync instead (using a second disk as backup target or even better a remote setup somewhere else where data is mirrored to). In case you want to combine SBCs with redundant RAID modes think about downclocking both CPU and memory, never ever rely on mdraid/ext4 but choose mainline kernel and btrfs instead (btrfs allows end-to-end data integrity and is able to check for and repair data corruption)

Link to comment
Share on other sites

  • Igor unlocked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines