Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on the Orange Pi 5
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Gladdle
Guru
Guru


Joined: 27 Jul 2008
Posts: 313
Location: Cleebronn, Germany

PostPosted: Mon Nov 27, 2023 8:47 pm    Post subject: Gentoo on the Orange Pi 5 Reply with quote

I didn't get a Raspberry Pi 5, so i take a different Product with a better Core and more RAM: The Orange Pi.
I can Download the "Orange Pi 5 OS (Arch)" or an debian image, but i preffer Linux Gentoo. To install that i have a few Options, but i think that one is the best:
https://wiki.gentoo.org/wiki/Raspberry_PI_Install_Guide - It's an installation routine for the Raspberry Pi Series, but i'll think it's possible for the Orange Pi, too.
But there are a few questions:
- Point 4.3.1 is for the RasPi Firmare, can i use the kernel from the orange Pi devs, because of the kernel patches? Seems like it's also on github:
https://github.com/orangepi-xunlong/u-boot-orangepi
- Do i need the arm64 stage3 for the Orange Pi 5 (Rockchip RK3588S 8-core 64-bit processor) or the ARMv$X and what should i use for the make.conf COMMON_FLAGS / CFLAGS?
- Shall i use the Orange Pi 5 Overlay found on reddit:
https://www.reddit.com/r/Gentoo/comments/16au8ng/overlay_for_orange_pi_5/

Am i wrong with that? Is there a better solution?
If i had created a Gentoo for the Orange Pi can i make a Image for everyone who want to use Gentoo on that system?

I am sorry for the stupid questions, but i am an electrican, not an "real" computer guy, but maybe someone can help me and we can share all the informations.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Mon Nov 27, 2023 10:39 pm    Post subject: Reply with quote

Gladdle,

I think Orange Pi5 is very different from Raspberry Pi4B so most of those Raspberry Pi installation guide is wrong for your board.

Orange Pi5 use Rockchip SoC, so its boot sequence is different from Raspberry Pi. I think Rockchip SoC default use its idbloader, but can switch to use u-boot, anyway the /boot content will be very different from Raspberry Pi.

You should use Orange Pi supplied kernel for your board first to get a working system. eventually you can build you own kernel once you are comfortable with boot sequence.

You can use arm64 stage 3 from Gentoo as basis to begin. It is targeted for general ARM64 so it will work for OPI5.

You can try this for CFLAGS
Code:
COMMON_FLAGS="-O2 -pipe -march=armv8.2-a+crypto+fp16+rcpc+dotprod -mtune=cortex-a76.cortex-a55"


disclaimer, I don't have Orange Pi5, I have NanoPi R6C which also is rk3588s based SoC. I only use gentoo container on the R6C, so I don't know above CFLAGS will work for you or not, I only use the container to help me compile other stuff. The Compiler suite in the container is compiled use above CFLAGS.

One thing important when working with SoC development board, best to have UART serial connect to help debug booting issue. I use USB to TTL Adaptor SH-u09c5
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Tue Nov 28, 2023 12:07 pm    Post subject: Reply with quote

Gladdle,

The Raspberry PI Install Guide should work for any install where the Gentoo stage3 can be put on top of the vendor kernel.
It gives Pi specific set up for boot though. I don't know what an Orange Pi5 uses.
Provided that no target code needs to be compiled, the same approach should work.
e.g. building u-boot would need some outside help.

Not all aarch64 CPUs also support the aarch32 instruction set. Its optional.
As your CPU is 64 bit, you may as well do a 64 bit install with the 64bit stage3.

You derive the COMMON_FLAGS / CFLAGS as the guide explains.
The tools that do the derivation will be built with the generic COMMON_FLAGS after your Orange Pi5 boots but you will probably only use them once, so it won't matter.

-- edit --

The only stupid question is the one you never ask.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gladdle
Guru
Guru


Joined: 27 Jul 2008
Posts: 313
Location: Cleebronn, Germany

PostPosted: Tue Nov 28, 2023 6:45 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Gladdle,

The Raspberry PI Install Guide should work for any install where the Gentoo stage3 can be put on top of the vendor kernel.


Thanks for the hint but you was a little late. I have used the Orange Pi 5 image and deleted the second partition and make a new one using gentoo stage 3 - the gentoo system boot and works very good!


pingtoo wrote:
You can try this for CFLAGS
Code:
COMMON_FLAGS="-O2 -pipe -march=armv8.2-a+crypto+fp16+rcpc+dotprod -mtune=cortex-a76.cortex-a55"


disclaimer, I don't have Orange Pi5, I have NanoPi R6C which also is rk3588s based SoC. I only use gentoo container on the R6C, so I don't know above CFLAGS will work for you or not, I only use the container to help me compile other stuff. The Compiler suite in the container is compiled use above CFLAGS.


There is a tool called cpuid2cpuflags - it has the following output:
Code:
CPU_FLAGS_ARM: edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2

So may i ask what is the best CFLAGS, because i didn't get it, i am sorry.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Tue Nov 28, 2023 6:56 pm    Post subject: Reply with quote

Gladdle wrote:
There is a tool called cpuid2cpuflags - it has the following output:
Code:
CPU_FLAGS_ARM: edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2

So may i ask what is the best CFLAGS, because i didn't get it, i am sorry.

I don't understand you too :D

What is that you are looking for? The CPU_FLAGS_ARM is a hint for ebuild to turn on/off package's configuration (assume the package developer done some kind of optimisation base on type of CPU)


Last edited by pingtoo on Tue Nov 28, 2023 8:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54250
Location: 56N 3W

PostPosted: Tue Nov 28, 2023 8:28 pm    Post subject: Reply with quote

Gladdle,

Set
Code:
CPU_FLAGS_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2"
in make.conf.

There is another tool for CFLAGS.
Code:
emerge resolve-march-native
arm64 needs version 3.0.0 or newer.
That's testing at the moment.

You don't set -march on arm. Its -mcpu and -mtune. Set both. I've updated the wiki page.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Ferociouspineapple
n00b
n00b


Joined: 09 Feb 2023
Posts: 7

PostPosted: Wed Nov 29, 2023 8:42 pm    Post subject: Reply with quote

Gladdle wrote:

Thanks for the hint but you was a little late. I have used the Orange Pi 5 image and deleted the second partition and make a new one using gentoo stage 3 - the gentoo system boot and works very good!


I'm due to be compiling a gentoo for an Orange Pi 5 some time soon and I'm wondering if you needed to put any proprietary blobs in the /boot/ partition of your gentoo in order for gentoo to boot? Also did you compile a kernel for gentoo or use the pre-compiled one from Orange Pi?

I hope to stay away from pre-compiled binaries as much as possible although I don't know to what extent this is possible on the OPi5. I've found the configs for uboot and the kernel which it uses.

edit: rk3588 chips require two closed-source binaries for boot ("bl31" and "tpl/ddr")...not freedom respecting. rk3399 seems to be reputed for its blobless boot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum