Subject: Re: [PATCH 0/2] Add initial Pinebook Pro support

From: Jan Nieuwenhuizen <[email-masked]>
Date: Sun, 16 Feb 2020 20:04:54 +0100

Danny Milosavljevic writes:

Hi Danny,

>> A vanilla kernel does not work yet; apparently development to upstream
>> pinebook-pro patches lives here:
>> https://gitlab.manjaro.org/tsys/linux-pinebook-pro
>
> Yeah, but LKML has some of the patches there in review, for example:
>
> * http://lkml.iu.edu/hypermail/linux/kernel/2001.1/01899.html (already accepted)
> * https://patchwork.kernel.org/patch/11325531/ (pending changes)
> [...]
> * https://www.spinics.net/lists/kernel/msg3367972.html (pending changes)
>
> So all in all I think the Pinebook Pro will eventually work with the vanilla kernel.

Oh, great!  I was pretty lost about all this.  I finally got some
feedback on this; I'll update my post.  I was told "use mainline Manjaro
kernel here, take branch v5.5".  I did that but got confused a bit by
the lack of any tags.  I fetched tags from linus and got

    git describe => v5.5-5246-g9564c96de3d1

WTF?  Just today I looked at v5.5-rc7, an older manjaro branch and saw

    git describe => v5.5-rc7-75-g2335a564ec8f

Then, I found that the v5.5 branch has probably ~85 extra commits.  We
could try applying those patches onto a recent kernel, v5.5 or v5.6
(when it's released?).

>> Similarly, Das U-Boot has a pinebook-pro development branch
>> https://git.eno.space/pbp-uboot.git
>
> (Not so sure whether that one will be upstreamed)

Okay, I'm also not sure yet if this is required; but I'm glad it works
now and we can work from here.

>> sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,' /boot/extlinux/extlinux.conf
>
> It might make sense to find out why this is necessary.
>
> https://lists.denx.de/pipermail/u-boot/2014-January/171682.html describes that it
> should be possible to set up u-boot environment variables (in uEnv.txt) to make
> it find the correct FDT file anyway.  If none is set up, it automatically generates
> the file name to use using $soc and $board.  But that's for PXE booting
> (booting empty machine via network)--not sure where the normal case is in U-Boot,
> if any.  U-Boot sometimes has some weird blind spots like that.

Ah, possibly some softcoding mechanism like this (we use a patched
u-boot!) is going astray.  Hmm.

> Also, https://lists.denx.de/pipermail/u-boot/2016-May/254703.html kinda
> sounds like they dont support subdirs.  Wanna try adding "/rockchip" to the
> end of FDTDIR in extlinux.conf ?
> Also, what's the value of CONFIG_[DEFAULT_]DEVICE_TREE in your u-boot
> configuration?

I am pretty sure it is

    $ grep DEFAULT_FDT /gnu/store/zxb488q5l9c6j5pnazvp5s30z1p18gnm-u-boot-pinebook-pro-rk3399-2020.01-pinebook-pro-1.365495a/libexec/.config 
    CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"

So yeah, strange.

>> Because of the aarch64 guix pull problem, the separate repositories for
>> kernel and u-boot, the weird MMC numbering changes /dev/mmcblk0 <->
>> /dev/mmcblk1 and this ugly extlinux.conf fixup I am not sure where to
>> share this code, maybe wip-pinebook-pro @ savannah.  WDYT?
>
> I'm all for wip-pinebook-pro @ savannah, especially before losing a now-working
> version by hacking further on it.  Been there done that :)

Okay, pushed!

> If you want we can collaborate in the next days on finding the cause of
> the weird FDT problem.

Ah thank you...that would (have been???) so nice.  This morning, my
pinebook pro did not want to start and hasn't all day. :-( :-( :-(
Could running a wrong kernel brick the thing, I don't think so...but
I'm pretty lost.  I'll wait a couple of days to see if it comes to life
again.

>> For more details, see
>> 
>>     https://joyofsource.com/guix-system-on-the-pinebook-pro.html
>> 
>> I think it would be nice to have an updated this blog on guix.gnu.org when
>> these silly problems are resolved.
>
> Sure!
>
> As a general remark, make-u-boot-package was not public because
> I didn't want to commit to its interface yet.

> I think we don't need to export it even now.  (We can if we have to)

Ah; I needed that before when I had a separate pinebook-pro.scm; and may
have kept the export...  Sure, let's remove it if it's not needed.

Greetings,
janneke

-- 
Jan Nieuwenhuizen <[email-masked]> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com