mbox

[bug#39617,0/2] Add initial Pinebook Pro support

Message ID 87tv3rd6sz.fsf@gnu.org
Headers show

Message

Janneke Nieuwenhuizen Feb. 15, 2020, 6:49 p.m. UTC
Hello ARM Gurus!

These patches add initial Pinebook Pro support.  There are several rough edges,
your help would be much appreciated!

A vanilla kernel does not work yet; apparently development to upstream
pinebook-pro patches lives here:
https://gitlab.manjaro.org/tsys/linux-pinebook-pro

Similarly, Das U-Boot has a pinebook-pro development branch
https://git.eno.space/pbp-uboot.git

Because of "guix pull failing on aarch64"

    https://issues.guix.gnu.org/issue/39352

these patches must be applied on top of

    c7dd15596ffd09ab40629c89e7014e51a4d7e95e

(or use branch wip-pinebook-pro from https://gitlab.com/janneke/guix.git)

To install Guix System on the microSD in a Pinebook Pro, do something
like

--8<---------------cut here---------------start------------->8---
sudo mount /dev/mmcblk0p1 /mnt
sudo -E ./pre-inst-env guix system init gnu/system/examples/pinebook-pro.tmpl /mnt
sudo -E ./pre-inst-env guix system init arm-baar.scm /mnt
sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,' /boot/extlinux/extlinux.conf
--8<---------------cut here---------------end--------------->8---

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?

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.

Greetings,
janneke


Jan Nieuwenhuizen (2):
  gnu: Add linux-libre-pinebook-pro.
  gnu: Add u-boot-pinebook-pro-rk3399.

 Makefile.am                           |  1 +
 gnu/bootloader/u-boot.scm             | 11 ++++++
 gnu/packages/bootloaders.scm          | 45 ++++++++++++++++++++-
 gnu/packages/linux.scm                | 48 ++++++++++++++++++++++
 gnu/system/examples/pinebook-pro.tmpl | 57 +++++++++++++++++++++++++++
 5 files changed, 160 insertions(+), 2 deletions(-)
 create mode 100644 gnu/system/examples/pinebook-pro.tmpl

Comments

Mike Rosset Feb. 15, 2020, 9:51 p.m. UTC | #1
Jan Nieuwenhuizen writes:

> Hello ARM Gurus!
>
> These patches add initial Pinebook Pro support.  There are several rough edges,
> your help would be much appreciated!


Hello Jan,

Thank you for working on this. I have not received my pinebook pro yet,
it should be here sometime this month. I will try to help with this once
it I have received it.


Mike
Danny Milosavljevic Feb. 16, 2020, 6:19 p.m. UTC | #2
Hi Janneke,

On Sat, 15 Feb 2020 19:49:48 +0100
Jan Nieuwenhuizen <janneke@gnu.org> wrote:

> 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.

> 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)

> 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.

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?

> --8<---------------cut here---------------end--------------->8---
> 
> 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 :)

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

> 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)
Danny Milosavljevic Feb. 16, 2020, 6:22 p.m. UTC | #3
Hmm, CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"

Should be fine then.
Danny Milosavljevic Feb. 16, 2020, 6:27 p.m. UTC | #4
Hi Janneke,

>[0]: A difficulty here is that the Pinebook Pro currently does not want to show
>a U-Boot prompt, command line or debug output. If you consider to buy one, you
>may want to also order a serial cable that might help debugging the boot
>sequence.

Could you file a bug report upstream?

It should be possible (and much less weird) for the vendor to just enable the
TFT display in u-boot and display stuff there.

(linux-sunxi, the dev group for another ARM SoC vendor, does it just fine in
mainline u-boot--so it is possible and can maybe be copied)
Danny Milosavljevic Feb. 18, 2020, 9:48 p.m. UTC | #5
Hi Janneke,

On Sun, 16 Feb 2020 19:27:41 +0100
Danny Milosavljevic <dannym@scratchpost.org> wrote:

> It should be possible (and much less weird) for the vendor to just enable the
> TFT display in u-boot and display stuff there.
> 
> (linux-sunxi, the dev group for another ARM SoC vendor, does it just fine in
> mainline u-boot--so it is possible and can maybe be copied)

I came across an example u-boot configuration for LCD screen:

https://github.com/Openvario/meta-openvario/blob/warrior/recipes-bsp/u-boot/files/openvario-57-lvds/openvario_defconfig

especially 

CONFIG_VIDEO_LCD_MODE="x:640,y:480,depth:18,pclk_khz:25000,hs:1,vs:1,le:157,ri:2,up:42,lo:2,sync:3,vmode:0"
CONFIG_VIDEO_LCD_PANEL_LVDS=y
CONFIG_VIDEO_LCD_BL_PWM="PB2"
CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW=n

We'd still need to get the timing parameters (CONFIG_VIDEO_LCD_MODE) for the Pinebook Pro (from the panel datasheet).
And that's if that thing is connected via LVDS in the first place.

But that's all moot if your Pinebook Pro is bricked for good.
Vagrant Cascadian Feb. 20, 2020, 4:12 a.m. UTC | #6
On 2020-02-16, Danny Milosavljevic wrote:
> On Sat, 15 Feb 2020 19:49:48 +0100
> Jan Nieuwenhuizen <janneke@gnu.org> wrote:
>> sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,' /boot/extlinux/extlinux.conf

I didn't do this manually and mine booted without it; is this
implemented in the patches directly?


> 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.

uEnv.txt is not necessarily widely supported; some arbitrary boards
implement it, but I wouldn't rely on it.


live well,
  vagrant
Janneke Nieuwenhuizen Feb. 20, 2020, 6:29 a.m. UTC | #7
Vagrant Cascadian writes:

> On 2020-02-16, Danny Milosavljevic wrote:
>> On Sat, 15 Feb 2020 19:49:48 +0100
>> Jan Nieuwenhuizen <janneke@gnu.org> wrote:
>>> sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,' /boot/extlinux/extlinux.conf
>
> I didn't do this manually and mine booted without it; is this
> implemented in the patches directly?

The need for this was a big puzzle to me -- I have no idea what happened
ovor at my side.  Could it be a firmware thing, you may have an earlier
badge?

I did build some packages on an intel box, possibly using qemu; as soon
as I have a working pinebook again I'll try to do a whole fresh install.

Thanks!
janneke
Brian Woodcox May 20, 2020, 6:29 a.m. UTC | #8
Regarding this issue:
sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,'
I only ran into this issue with a few newer Pinebook Pro’s
It turns out the stock Debian’s u-boot on the emmc is causing the boot process to look for rockchip-evb_rk3399.dtb.
For example if you install the Manjaro u-boot files to the emmc, this problem goes away.
That’s why only some of us encounter this problem and others do not.
Brian.
Brian Woodcox May 20, 2020, 6:29 a.m. UTC | #9
Regarding this issue:
sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,'
I only ran into this issue with a few newer Pinebook Pro’s
It turns out the stock Debian’s u-boot on the emmc is causing the boot process to look for rockchip-evb_rk3399.dtb.
For example if you install the Manjaro u-boot files to the emmc, this problem goes away.
That’s why only some of us encounter this problem and others do not.
Brian.
Brian Woodcox May 20, 2020, 4:06 p.m. UTC | #10
Yes, I have 4 in total.

I’m teaching 3 of my 4 children programming and guix.  Or at least that’s the plan.

I have loaded guix system on their SD cards, so that they can boot and also re-configure works. Yay!

We have Icecat installed on all the laptops.  Graphics acceleration with Xfce.

I’ve learned a lot about Guix myself in the past number of weeks.

So far a happy camper.

Brian.

> On May 20, 2020, at 1:15 AM, Jan Nieuwenhuizen <janneke@gnu.org> wrote:
> 
> Brian Woodcox writes:
> 
>> Regarding this issue:
> 
>> sudo sed 's,FDTDIR \([^ ]*\),FDT \1/rockchip/rk3399-pinebook-pro.dtb,'
>> I only ran into this issue with a few newer Pinebook Pro’s
>> It turns out the stock Debian’s u-boot on the emmc is causing the boot process to look for rockchip-evb_rk3399.dtb.
>> For example if you install the Manjaro u-boot files to the emmc, this problem goes away.
>> That’s why only some of us encounter this problem and others do not.
> 
> Ah, that's great!  You tried several?  I'm still hoping that pine64 will
> some day handle my zoho support ticket about my bricked pinebook pro :-(
> 
> Greetings,
> janneke
> 
> -- 
> Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
> Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com