Jump to content

BananaPi Pro: Enabling the SATA port and compiling the kernel from source.


Go to solution Solved by Igor,

Recommended Posts

Posted (edited)

I've got one of these boards. It is just Kernel development that has ceased as there are no maintainers?  (Had I had the skills, I would have happily maintained it. ;-( )

 

Also, to get the latest Kernel later on, is it as simple as obtaining the official sources and then compiling (or cross-compiling to ARM) and then install the Kernel?  On this one I'm a bit like a duck out of water and if anyone can point me along the right path, all help will be greatly appreciated.

Edited by Myron
The conversation has substantially changed to the title has been edited to reflect the content of this thread
  • Myron changed the title to With the BananaPi Pro now out of support, which bits are out of support & compiling the kernel from source?
Posted
  On 1/30/2022 at 12:44 PM, Myron said:

It is just Kernel development that has ceased as there are no maintainers?

Expand  

 

https://www.armbian.com/newsflash/armbian-needs-your-help/

HW vendor abandoned software support about 5-6 years ago (also almost identical one from competition). Quickly after they released new model. All those boards are in theory supported in mainline kernel, but also there someone needs to maintain parts we don't. Sadly, usually upstream is breaking and remain broken for months. Situation is worse without Armbian work ... If bug fixing require weeks of work, we will not start. We can't afford to pay that. Stopping with support means organisation to support activities stops.

 

  On 1/30/2022 at 12:44 PM, Myron said:

can point me along the right path

Expand  


Other skills https://forum.armbian.com/staffapplications/ are also important. A dosents of angels would probably be enough to cover for troubles around this board. But finding them is far from quick and simple. Nor organising activities  afterward to solve what needs to be solved ...
 

Its free licence software, but precious time we are loosing for dealing with troubles is far from free. Its scarce and expensive. If users wants to put all R&D and bugs on our expense, no problem, just waiting time is very very very very long. When we are counting in years its being translated to "no support". There are thousands of people and thousands of troubles with free licence software.

 

Don't worry too much since it probably won't be much worse. "Support" will remain on the same level as general Linux distros. Things works or they don't and you have nobody to complain to.

Posted

Thanks for the explanation.   Anyway....   I managed to successfully compile the Lunx Distro from source today by cloning the git and compiling using ./compile.sh within an Ubuntu in a Hyper-V VM and now have ....

 

-rwxr-xr-x 1 myron myron    126972 Jan 30 21:36 armbian-config_22.02.0-trunk_all.deb*
-rwxr-xr-x 1 myron myron   7931936 Jan 30 21:36 armbian-firmware_22.02.0-trunk_all.deb*
-rwxr-xr-x 1 myron myron 235132592 Jan 30 21:41 armbian-firmware-full_22.02.0-trunk_all.deb*
-rwxr-xr-x 1 myron myron   2263068 Jan 30 21:36 armbian-zsh_22.02.0-trunk_all.deb*
-rwxr-xr-x 1 myron myron    195260 Jan 30 21:36 linux-dtb-current-sunxi_22.02.0-trunk_armhf.deb*
-rwxr-xr-x 1 myron myron  11487292 Jan 30 21:36 linux-headers-current-sunxi_22.02.0-trunk_armhf.deb*
-rwxr-xr-x 1 myron myron  37177204 Jan 30 21:36 linux-image-current-sunxi_22.02.0-trunk_armhf.deb*
-rwxr-xr-x 1 myron myron   1109176 Jan 30 21:36 linux-libc-dev_22.02.0-trunk_armhf.deb*
-rwxr-xr-x 1 myron myron 166625328 Jan 30 19:30 linux-source-current-sunxi_22.02.0-trunk_all.deb*
-rwxr-xr-x 1 myron myron    259528 Jan 30 19:23 linux-u-boot-current-bananapipro_22.02.0-trunk_armhf.deb*

 

I will back-up the SD card, can you please advise me the safe way to upgrade Lunux on the BananaPi Pro from the files generated?

 

I am assuming I use dpkg and apply armbian-firmware-full_22.02.0-trunk_all.deb to install Ubuntu 22.02.0 and Linux Kernel 5.10.95?   What are the other debs for?
(I'm trying to learn how to do this for myself.)

  • Solution
Posted
dpkg -i linux-dtb-current-sunxi_22.02.0-trunk_armhf.deb
dpkg -i linux-image-current-sunxi_22.02.0-trunk_armhf.deb


This is mandatory, the rest optional.

Posted

@Igor Does this generally mean that I can still get the updates for this BananaPi Pro, except what I'll have to do is manually compile the sources and then manually install onto the board?  I'm assuming that the AllWinner A20 SoC itself is going to be supported for a very long time?  I'm not 100% sure how this will work.  I do know that, generally, how this board is now just community support, how I tinker with this means (I read it) "I'm on my own".

 

Compiling from sources was not painful. Thank-you for putting together the script that automated the compilation process. I would, at my level of Linux Knowledge, am clueless at what would need to be done if it all had to be manually compiled without a script.

Posted
  On 2/1/2022 at 11:25 AM, Myron said:

Does this generally mean that I can still get the updates for this BananaPi Pro, except what I'll have to do is manually compile the sources and then manually install onto the board?  I'm assuming that the AllWinner A20 SoC itself is going to be supported for a very long time?  I'm not 100% sure how this will work.  I do know that, generally, how this board is now just community support, how I tinker with this means (I read it) "I'm on my own".

Expand  

 

Yes, that is exactly what it means.  The removal from 'Supported' just means we are no longer hosting pre-compiled binaries on our infrastructure (and some other things).  You can still build them, just as before, as you figured out by now.

 

A20 has been around for a long time (Armbian first board was cubietruck in fact) and in Linux, generally speaking, longer = better (which is the reverse of the "new shiny" disease that a lot of (young?) people seem to have nowadays, but I digress).  With some exceptions for maintenance, of course, where newer kernel changes can break older things that used to work (that's called a regression btw).

 

  On 2/1/2022 at 11:25 AM, Myron said:

Compiling from sources was not painful. Thank-you for putting together the script that automated the compilation process. I would, at my level of Linux Knowledge, am clueless at what would need to be done if it all had to be manually compiled without a script.

Expand  

 

This is essentially the raison d'être for Armbian in the first place.

 

At this point, you have a choice.  You can take your new found knowledge and keep it to yourself.  Which is the way things were before Armbian.  And still are with some other projects and boards in other places.  With info scattered all around, and everyone doing their own thing, keeping the (hard won) knowledge to themselves.

 

Or, if you end up fixing something on your own anyway, in order to keep your board(s) running, you can contribute those changes back to Armbian, where they will benefit everyone -- the same way you have benefited.  Whether that be in the form of a PR, or even just forum participation.

 

Cheers!

 

Posted

That's what I would do. If I found something then I certainly would contribute back to Armbian. The more I learn and remember (and getting helped along the way) then I can return the favour and help others with what I've learned.  I think I'll try get involved more with the Forums as so far, at least for me, the Armbian Distro on the BananaPi Pro is rock-solid reliable.

 

I now brave applying the compiled 22.02.0 version to the BPi Pro and, yes, I've performed a sector-by-sector backup of the present stable installation.  (Wish me luck....)

 

ADDITION: YAY! Kernel 5.10.95-sunix installed and working.  :-)

Posted
| __ )|  _ \(_) |  _ \ _ __ ___  
|  _ \| |_) | | | |_) | '__/ _ \ 
| |_) |  __/| | |  __/| | | (_) |
|____/|_|   |_| |_|   |_|  \___/ 
                                 
Welcome to Armbian 22.05.0-trunk  with Linux 5.15.30-sunxi

No end-user support: built from trunk

System load:   7%           	Up time:       26 min	
Memory usage:  6% of 967M   	IP:	       192.168.1.251
CPU temp:      34°C           	Usage of /:    71% of 908M   	

 

building kernel and minimal image was succesful.

 

But SATA is missing. Solution is to enable the reg_ahci_5v regulator pin like this:

https://git.yoctoproject.org/linux-yocto-contrib/plain/arch/arm/boot/dts/sun7i-a20-itead-ibox.dts

 

Tested with a user overlay and armbian-add-overlay - SATA is back.

 

I'd like to integrate it into armbian:

- patch in patch/kernel/archive/sunxi-5.15/patches.armbian/arm-dts-sun7i-a20-bananapro-add-ahci-regulator.patch

- added to patch/kernel/archive/sunxi-5.15/series.armbian

 

But it get's not processed during kernel compiling? @Igor what I'm missing.

 

There is already a patches.armbian/arm-dts-sun7i-a20-bananapro-add-hdmi-connector-de.patch - would it better to patch this patch to have only one file per board?

 

 

Posted
  On 3/19/2022 at 4:48 PM, teknoid said:

 

But it get's not processed during kernel compiling? @Igor what I'm missing.

Expand  


Strange. Make a pull requests with a note that its not operational / WIP state.

 

P.S.
Thanks!

Posted

@teknoid Please do make a pull request. I was thinking of attaching a SATA drive, didn't know it would not have worked and device trees are an absolute and complete mystery to me.

Posted

Hi @Igor perfect, thanks.

 

Next step is to upgarde the WIFI firmware to 5.90.244:

[   13.975858] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43362/1 wl0: May 16 2018 23:42:49 version 5.90.244 FWID 01-0

I loaded it from kernel git here: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/brcm?id=d9430acf46774d75fa269a667b7b4598d60aa353

It magically diasppeared in the current kernel git repository, but I found it in a commit from 2018.

 

I will test it for the next few days and then upload to armbian firmware repo.

Posted

@teknoidI've for one of these BananaPi Pro boards, but I don't have the knowledge or expertise to be a maintainer.  Currently jittery about updating the kernel as the last upgrade from 5.15.27 to 5.15.28 resulted in the board failing to getting "Starting Kernel ..." and this is with verbosity=7 set.  Something's not right at the moment with the installed Linux so as I've type now I've got ./compile.sh compiling a U-Boot and kernel which will be version 5.15.30 when it's complete.

 

Issue I've got is that all the laptops I've got are Windows.  Unfortunately a necessity.  Got one laptop which I may be able to install native Linux on it and can then use it to diagnose a non-starting BananaPi Pro.

 

Will these patches and updates be available via the trunk builds?  I do not know how that works. That's the route I took to keep my Banana Pro up-to-date.

Posted

yes, these patches will go into official armbian images and will be available with next release 22.05 I think.

 

Thanks @Igor for reactivating the state to supported. Now the official downloads are back on armbian page: https://redirect.armbian.com/bananapipro/Bullseye_current

So I recommend you to first use the official image to get proper kernel and userland environment on your board. Later you can upgrade the kernel in usual way by "apt get update / upgrade" or aptitude.

If you want to debug a non starting board you need to connect the serial console via USB to UART and watch it e.g. via minicom. And yes a native Linux machine is highly recommended 😉

 

Posted

How would one get the proper kernel and userland environment on the board without starting from the beginning, or is that not possible? I think that would be a question for any Armbian user who's built from trunk and would wish to return to a supported build without undoing all the customisations?  The trunk user compiled Armbian build is already on 22.05.

Posted
  On 3/23/2022 at 9:42 AM, Myron said:

How would one get the proper kernel and userland environment on the board without starting from the beginning, or is that not possible?

Expand  

 

Unfortunately not supported.  I did not say not possible.  There are some threads around the forums with hints, but you will be on your own.

 

Better approach (IMO) is to learn / set up / maintain some better config management, which could be anything from a dotfiles repo to Ansible (or others) depending on your needs.  Then the idea is you just run a few things after a fresh install, and you are right back where you were.

Posted
  On 3/19/2022 at 4:48 PM, teknoid said:
| __ )|  _ \(_) |  _ \ _ __ ___  
|  _ \| |_) | | | |_) | '__/ _ \ 
| |_) |  __/| | |  __/| | | (_) |
|____/|_|   |_| |_|   |_|  \___/ 
                                 
Welcome to Armbian 22.05.0-trunk  with Linux 5.15.30-sunxi

No end-user support: built from trunk

System load:   7%           	Up time:       26 min	
Memory usage:  6% of 967M   	IP:	       192.168.1.251
CPU temp:      34°C           	Usage of /:    71% of 908M   	

 

building kernel and minimal image was succesful.

 

But SATA is missing. Solution is to enable the reg_ahci_5v regulator pin like this:

https://git.yoctoproject.org/linux-yocto-contrib/plain/arch/arm/boot/dts/sun7i-a20-itead-ibox.dts

 

Tested with a user overlay and armbian-add-overlay - SATA is back.

 

Expand  

 

My dear @teknoid, I've been trying to decipher the topic of device trees and, honestly, I'm totally lost, so I beg a question. On the device tree listed in the spoiler, what do I need to do to get the SATA port up-and-running?
 

  Reveal hidden contents

 

Posted

@teknoid Confirming that the patch had worked on the latest build that the Armbian Framework puts together.  This is Armbian 22.05 trunk and Linux Kernel 5.15.32.

[    3.273532] kernel: ahci-sunxi 1c18000.sata: supply ahci not found, using dummy regulator
[    3.281429] kernel: ahci-sunxi 1c18000.sata: supply phy not found, using dummy regulator
[    3.344049] kernel: ahci-sunxi 1c18000.sata: controller can't do PMP, turning off CAP_PMP
[    3.351593] kernel: ahci-sunxi 1c18000.sata: forcing PORTS_IMPL to 0x1
[    3.357504] kernel: ahci-sunxi 1c18000.sata: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
[    3.366500] kernel: ahci-sunxi 1c18000.sata: flags: ncq sntf pm led clo only pio slum part ccc
[    3.376130] kernel: scsi host0: ahci-sunxi
[    3.380046] kernel: ata1: SATA max UDMA/133 mmio [mem 0x01c18000-0x01c18fff] port 0x100 irq 45

 

Thank-you. You're a star.

Where can I go to learn to figure out how the user overlay works?

I can see it's activated line 40 of gpiochip0 [1c20800.pinctrl] .which has changed from an input to an output.

 

I'm not sure how the dtb below relates to the result of line 40 being activated.

 

// enable SATA AHCI on bananapi pro
/dts-v1/;
/plugin/;

/ {
	compatible = "lemaker,bananapro", "allwinner,sun7i-a20";

	fragment@0 {
		target = <&reg_ahci_5v>;
		__overlay__ {
			status = "okay";
		};
	};
};

 

I'm trying to search for the information myself, but not having much luck.

 

EDIT 5/April/2002 12:17 UTC+1 - What I find curious is looking through the main device tree I spotted this . . . .

        ahci-5v {
                compatible = "regulator-fixed";
                regulator-name = "ahci-5v";
                regulator-min-microvolt = <0x4c4b40>;
                regulator-max-microvolt = <0x4c4b40>;
                regulator-boot-on;
                enable-active-high;
                gpio = <0x19 0x01 0x08 0x00>;
                status = "disabled";
                phandle = <0x24>;

Was the solution always to simply change the status from "disabled" to "okay" and that would have enabled the SATA port?  I know that upgrading the kernel and its device tree would undo the change so I'm assuming your solution of supplying a DT overlay makes the setting persist across kernel and DT upgrades?   (Did I make any sense with that lot?)

Posted

yes, mostly the nodes in the device tree are available but deactivated with status = "disabled";

And you simply can active them by saying status = "okay"; in an overlay. Furhermore you can override the standard values.

What you did in the past with module parameters you nowdays do it in the device tree.

 

check this: https://elinux.org/images/f/f9/Petazzoni-device-tree-dummies_0.pdf It helped me to get an overview what DTS is and how it interacts with the linux kernel drivers. Oh yes, its not easy to understand. It will take some time (at least for me it took years) but playing around is good for practise and step by step you will get familiar with it.

 

Next version 22.05 will have the regulators enabled by default so you do not need the overlay anymore.

 

 

 

  • Myron changed the title to BananaPi Pro: Enabling the SATA port and compiling the kernel from source.
Posted
  On 4/4/2022 at 3:36 PM, teknoid said:

http://tron.dyn.cc/sun7i-bananpro-ahci.dts

download my test user overlay, copy it to your system and activate it (as root) with:

armbian-add-overlay sun7i-bananpro-ahci.dts

this should work on any kernel below 5.17

after release of 22.05 you need to remove it from /boot/overlay-user/

 

Expand  

 

Great!!! I stuck on Kernel 5.4.88 for over two years. And now working sda sata ssd:

 

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 223,6G  0 disk 
└─sda1        8:1    0     1G  0 part /mnt
mmcblk0     179:0    0  28,9G  0 disk 
├─mmcblk0p1 179:1    0     8G  0 part /
└─mmcblk0p2 179:2    0  20,9G  0 part /platz
zram0       254:0    0 483,6M  0 disk [SWAP]
zram1       254:1    0    50M  0 disk /var/log

 

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines