FreeBSD Desktop for PineBook Pro

jsm

Member
Developer

Reaction score: 11
Messages: 23

apply https://github.com/gonzoua/freebsd-src/commit/1b9ed02b138e9418a280b6c95a7877798db504be.patch for sound
and

C++:
diff c1a3d7f20696ab5b72eee45863f3e04410d81fc8 /usr/src
blob - 595085862e13d9e1f9c260a63c8500f1bdbb9fb8
file + sys/arm64/rockchip/clk/rk3399_cru.c
--- sys/arm64/rockchip/clk/rk3399_cru.c
+++ sys/arm64/rockchip/clk/rk3399_cru.c
@@ -618,7 +618,6 @@ static struct rk_clk_pll_rate rk3399_pll_rates[] = {
     PLL_RATE( 864000000,  1,  72, 2, 1, 1),
     PLL_RATE( 840000000,  1,  70, 2, 1, 1),
     PLL_RATE( 816000000,  1,  68, 2, 1, 1),
-    PLL_RATE( 800000000,  1, 100, 3, 1, 1),
     PLL_RATE( 700000000,  6, 350, 2, 1, 1),
     PLL_RATE( 696000000,  1,  58, 2, 1, 1),
     PLL_RATE( 676000000,  3, 169, 2, 1, 1),

And you can compile the kernel. I used got to fetch src.git YMMV
FreeBSD pinebook-pro 13.0-ALPHA1 FreeBSD 13.0-ALPHA1 #3: Wed Jan 20 05:12:08 UTC 2021 admin@pinebook-pro:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-NODEBUG arm64
 

nrgmilk

New Member

Reaction score: 2
Messages: 13

Samuel Venable

Active Member

Reaction score: 97
Messages: 137

SleepWalker I am really sorry about how rude I initially came off in this topic but that aside....

This is really cool! If it wasn't for you, I'd never have (any) of the BSD's running on my PBP, let alone my favorite one; FreeBSD. Thank you so much for putting this all together, it means a lot! If I only had a job right now, I'd donate to you generously to keep things like this going.

I tried installing OpenBSD but their website layout is so confusing I spent collectively a good hour just trying to figure out where the freaking download link even is. Tried NetBSD only to discover it doesn't work on the eMMC and I can't use my SD card slot because it stopped working for some unknown reason. Now I have FreeBSD on it. Super happy.

Did anyone manage to fix the shutdown button causing a restart / shutdown and restart items greyed out in the menu? I tried the method to enable those options by updating the policies, which I know from experience works if you use SLiM as the display manager. However I'm not sure if that same method will work with whatever display manager this image uses, at least in my testing it didn't seem to work.

I have Desktop installed, haven't tried the minimal yet.
 

obsigna

Daemon

Reaction score: 843
Messages: 1,244

… and I can't use my SD card slot because it stopped working for some unknown reason. ...
Yesterday, I took an older BeagleBone Black out of the drawer, in order to install a newer FreeBSD version on it. Unfortunately, the SD card slot did not work anymore. When compared to inserting cards into another BBB, it turned out that the cards in the defective SD slot didn’t sit as firmly. Then with my thumb, I carefully pressed the backside metal sheet of the slot housing somewhat inside, and guess what, the SD slot started working again.
 

jsm

Member
Developer

Reaction score: 11
Messages: 23

SleepWalker I am really sorry about how rude I initially came off in this topic but that aside....

This is really cool! If it wasn't for you, I'd never have (any) of the BSD's running on my PBP, let alone my favorite one; FreeBSD. Thank you so much for putting this all together, it means a lot! If I only had a job right now, I'd donate to you generously to keep things like this going.

I tried installing OpenBSD but their website layout is so confusing I spent collectively a good hour just trying to figure out where the freaking download link even is. Tried NetBSD only to discover it doesn't work on the eMMC and I can't use my SD card slot because it stopped working for some unknown reason. Now I have FreeBSD on it. Super happy.

Did anyone manage to fix the shutdown button causing a restart / shutdown and restart items greyed out in the menu? I tried the method to enable those options by updating the policies, which I know from experience works if you use SLiM as the display manager. However I'm not sure if that same method will work with whatever display manager this image uses, at least in my testing it didn't seem to work.

I have Desktop installed, haven't tried the minimal yet.
If consolekit is involved you might want to check that your primary console is vidconsole
/boot/loader.conf comment out boot_serial="YES" and add console="vidconsole,comconsole"
 

Samuel Venable

Active Member

Reaction score: 97
Messages: 137

Thanks guys, I'll give those things a shot. In the meantime, I want to say I really like the default wallpaper

IMG_20210129_145223_797.jpg


jsm I tried what you mentioned and the buttons are no longer greyed out, but unfortunately, shutdown still doesn't work when I click the shutdown button, it goes to the console and at a certain point hangs indefinitely, forcing me to hold the power button to shutdown.
 
Last edited:

sos

New Member

Reaction score: 6
Messages: 6

Hi gang
Got in here a little late, but you can find updated rk80x driver that supports RTC and proper shutdown/poweroff, a cw2015 driver that allows access to battery charge level etc and an updated rk_gpio driver with interrupt support (needed for power button and lid switch support).
Still have other things in the works, but time is limited for now...
Let me know if things doesn't work out....
 

Mjölnir

Daemon

Reaction score: 1,495
Messages: 2,114

... starting to throw the small €-notes into my hardware-piggybank once a week.
 

jsm

Member
Developer

Reaction score: 11
Messages: 23

Hi gang
Got in here a little late, but you can find updated rk80x driver that supports RTC and proper shutdown/poweroff, a cw2015 driver that allows access to battery charge level etc and an updated rk_gpio driver with interrupt support (needed for power button and lid switch support).
Still have other things in the works, but time is limited for now...
Let me know if things doesn't work out....
For convenience (hopefully) I uploaded https://people.freebsd.org/~jsm/pinebookpro/3fca90af438ac4232d6b33ee4874297089997dd6-main.diff which contains the work of sos and the sound drivers by gonzo. It is to the latest main as of now. (And the enable display clock hack by me, also in some u-boot patches) U-boot does not have the cw2015 code so in order for the right dtb I did (with cw2015 working and with ACLK_VOP1 at the "right" freq for display)
/usr/src/sys/contrib/device-tree # gmake src/arm64/rockchip/rk3399-pinebook-pro.dtb and copied it to /boot/efi/dtb/rockchip/
Hope this is helpful now poweroff powers off and sysctl dev.cwfg show battery status. and sound and display works. also see https://reviews.freebsd.org/D28456

Thanks, and have fun..!
 

sos

New Member

Reaction score: 6
Messages: 6

Excellent :)
I have a rk_gpiokeys driver that allows power off by pressing the power button for at least 1 sec.
It also gets the lid state (open/close) but I cannot decide on calling the pwm driver somehow or if the regulator driver can just yank power accordingly.
Any preferred / standard way for this that I should be aware of ?
At any rate I'll get it finished up and posted with the other drivers...

Edit: looking at the schematic there is a lcd_enable gpio connection, works nice and easy... Just need to clean up the code...
 

sos

New Member

Reaction score: 6
Messages: 6

Uploaded rk_gpiokeys.c to the usual place:


That allows the system to shutdown and power off when the power button is pressed for more than a second (safeguard), it also makes the LCD backlight go off when the lid is closed, this should be looked into further when we have real sleep support.

Enjoy!
 

sos

New Member

Reaction score: 6
Messages: 6

Anybody played with getting the bootloader into the spi-flash ?
The simple solution to just copy in the bootloader like:

gpart create -s GPT /dev/flash/spi0
dd if=u-boot-rockpro64/idbloader.img of=/dev/flash/spi0 seek=64 conv=notrunc,sync
dd if=u-boot-rockpro64/u-boot.itb of=/dev/flash/spi0 seek=16384 conv=notrunc,sync

Does not do the trick at least...
Anyone have info on how the layout of the spi-flash should be for it to get picked up by the bootrom ?
 

sos

New Member

Reaction score: 6
Messages: 6

That recipe seems to be right on the nose. Both the pinebookpro and the rockpro64 boots nice and dandy from the spi using this.
Finally I'm now able to boot directly from the nvme drive with no emmc/sdcard, yay! :)
PS: we have support for the spi device so it is a matter of simply dd'ing the image in place no need for special tools.
 

sos

New Member

Reaction score: 6
Messages: 6

Update:
I've added support for generating the spi flash image to the pinebookpro u-boot and also upgraded to u-boot.2021.01
With that installed in the SPI flash we can now boot from eMMC, SDcard, USB and NVMe with screen and kbd/mouse enabled from the start so one can chose what to boot etc.
Same place as usual: Index of /~sos/PinebookPro/

Enjoy!
 

pkubaj

Aspiring Daemon

Reaction score: 102
Messages: 556

Update:
I've added support for generating the spi flash image to the pinebookpro u-boot and also upgraded to u-boot.2021.01
With that installed in the SPI flash we can now boot from eMMC, SDcard, USB and NVMe with screen and kbd/mouse enabled from the start so one can chose what to boot etc.
Same place as usual: Index of /~sos/PinebookPro/

Enjoy!
Why don't you send your changes to reviews.freebsd.org?
 

Pbowen

New Member


Messages: 1

I've been trying to get FreeBSD running on the Pinebook Pro and have met with zero luck. Went the route of using the Rockpro64 image and overwriting as per the README for the u-boot-pinebookpro pkg with no joy. But your images boot and work fine for me! Is there anywhere where you have documented what you did to get it to work?
 
Top