[PATCH 0/2] Add initial Pinebook Pro support

OpenSubmitted by Jan Nieuwenhuizen.
Details
6 participants
  • Brian Woodcox
  • Brian Woodcox
  • Danny Milosavljevic
  • Jan Nieuwenhuizen
  • Mike Rosset
  • Vagrant Cascadian
Owner
unassigned
Severity
normal
J
J
Jan Nieuwenhuizen wrote on 15 Feb 2020 19:49
(address . guix-patches@gnu.org)
87tv3rd6sz.fsf@gnu.org
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:

Similarly, Das U-Boot has a pinebook-pro development branch

Because of "guix pull failing on aarch64"


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

Toggle snippet (6 lines)
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

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


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

--
2.24.0
J
J
Jan Nieuwenhuizen wrote on 15 Feb 2020 19:52
[PATCH 1/2] gnu: Add linux-libre-pinebook-pro.
(address . 39617@debbugs.gnu.org)
20200215185209.28334-1-janneke@gnu.org
* gnu/packages/linux.scm (deblob-scripts-pinebook-pro): New function.
(linux-libre-pinebook-pro): Use it to declare new variable.
---
gnu/packages/linux.scm | 48 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (68 lines)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 829bb09447..527180b522 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -39,6 +39,7 @@
 ;;; Copyright © 2019 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -872,6 +873,53 @@ It has been modified to remove all non-free binary blobs.")
                      #:defconfig "omap2plus_defconfig"
                      #:extra-version "arm-omap2plus"))
 
+;; Distribute a patched version of deblob-5.5 to accomodate for
+;; the file rename
+;;    drivers/crypto/ccp/psp-dev.c -> drivers/crypto/ccp/sev-dev.c
+(define (deblob-scripts-pinebook-pro version)
+  (list (version-major+minor version)
+        (origin
+          (method url-fetch)
+          (uri (string-append "https://lilypond.org/janneke/pinebook-pro/"
+                              "deblob-pinebook-pro-"
+                              (version-major+minor version)))
+          (file-name (string-append "deblob-" (version-major+minor version)))
+          (sha256
+           (base32 "15xpmn93mibgh3zlmbzfxx6hfk6y7vrwqc46gx7r87hrwhg0q4hj")))
+        (origin
+          (method url-fetch)
+          (uri (string-append "https://linux-libre.fsfla.org"
+                              "/pub/linux-libre/releases/" version "-gnu/"
+                              "deblob-check"))
+          (sha256
+           (base32 "12v9n7qf67vilwi2bkzbn1sbamhaw60rk79v3y2lm8bprgpy958l")))))
+
+;; This is apparently the least patched kernel (people call it "mainline",
+;; although it's not upstream), at the moment (Fri Feb 14 2020).  The exact
+;; version, branching, patchset is as yet unclear to me; the repository comes
+;; without any tags or upstream branches.
+(define-public linux-libre-pinebook-pro
+  (let* ((version "5.5.0")
+         (source
+          (origin
+            (method git-fetch)
+            (uri (git-reference
+                  (url "https://gitlab.manjaro.org/tsys/linux-pinebook-pro.git")
+                  (commit "9564c96de3d1e7a19fbfed075333bf414fa1749f")))
+            (file-name (git-file-name "linux-libre-pinebook-pro" version))
+            (sha256
+             (base32
+              "0q4mrjvv7bpavd5r8k9njm0md0lymwcnjpd9nggb8vwffdgbchys"))))
+         (pristine-source (make-linux-libre-source
+                           "5.5.0-pinebook-pro" source
+                           (deblob-scripts-pinebook-pro version))))
+    (make-linux-libre*
+     version
+     pristine-source
+     '("aarch64-linux")
+     #:defconfig "pinebook_pro_defconfig"
+     #:extra-version "pinebook-pro")))
+
 
 ;;;
 ;;; Linux kernel modules.
-- 
2.24.0
J
J
Jan Nieuwenhuizen wrote on 15 Feb 2020 19:52
[PATCH 2/2] gnu: Add u-boot-pinebook-pro-rk3399.
(address . 39617@debbugs.gnu.org)
20200215185209.28334-2-janneke@gnu.org
* gnu/packages/bootloaders.scm (make-u-boot-package): Add named parameter #:u-boot.
(u-boot-pbp): New variable.
(u-boot-pinebook-pro-rk3399): Use them to create new variable.
* gnu/bootloader/u-boot.scm (install-pinebook-pro-rk3399-u-boot,
u-boot-pinebook-pro-rk3399-bootloader): New variable.
* gnu/system/examples/pinebook-pro.tmpl: New file.
---
Makefile.am | 1 +
gnu/bootloader/u-boot.scm | 11 ++++++
gnu/packages/bootloaders.scm | 45 ++++++++++++++++++++-
gnu/system/examples/pinebook-pro.tmpl | 57 +++++++++++++++++++++++++++
4 files changed, 112 insertions(+), 2 deletions(-)
create mode 100644 gnu/system/examples/pinebook-pro.tmpl

Toggle diff (194 lines)
diff --git a/Makefile.am b/Makefile.am
index 7474b7f375..69c35a0478 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -345,6 +345,7 @@ EXAMPLES =					\
   gnu/system/examples/desktop.tmpl		\
   gnu/system/examples/lightweight-desktop.tmpl	\
   gnu/system/examples/docker-image.tmpl		\
+  gnu/system/examples/pinebook-pro.tmpl		\
   gnu/system/examples/vm-image.tmpl
 
 GOBJECTS = $(MODULES:%.scm=%.go) guix/config.go $(dist_noinst_DATA:%.scm=%.go)
diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm
index 3e892c5475..e7683601da 100644
--- a/gnu/bootloader/u-boot.scm
+++ b/gnu/bootloader/u-boot.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 David Craven <david@craven.ch>
 ;;; Copyright © 2017, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -35,6 +36,7 @@
             u-boot-pine64-plus-bootloader
             u-boot-pine64-lts-bootloader
             u-boot-pinebook-bootloader
+            u-boot-pinebook-pro-rk3399-bootloader
             u-boot-puma-rk3399-bootloader
             u-boot-rock64-rk3328-bootloader
             u-boot-rockpro64-rk3399-bootloader
@@ -121,6 +123,8 @@
         (write-file-on-device u-boot (stat:size (stat u-boot))
                               device (* 16384 512)))))
 
+(define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-boot)
+
 
 
 ;;;
@@ -236,3 +240,10 @@
    (inherit u-boot-bootloader)
    (package u-boot-rockpro64-rk3399)
    (installer install-rockpro64-rk3399-u-boot)))
+
+(define u-boot-pinebook-pro-rk3399-bootloader
+  ;; SD and eMMC use the same format
+  (bootloader
+   (inherit u-boot-bootloader)
+   (package u-boot-pinebook-pro-rk3399)
+   (installer install-pinebook-pro-rk3399-u-boot)))
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index c072ff8c8e..a3ce4a943f 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2019 nee <nee@cock.li>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -68,7 +69,8 @@
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
-  #:use-module (ice-9 regex))
+  #:use-module (ice-9 regex)
+  #:export (make-u-boot-package))
 
 (define unifont
   ;; GNU Unifont, <http://gnu.org/s/unifont>.
@@ -529,7 +531,7 @@ def test_ctrl_c"))
 also initializes the boards (RAM etc).  This package provides its
 board-independent tools.")))
 
-(define-public (make-u-boot-package board triplet)
+(define* (make-u-boot-package board triplet #:key (u-boot u-boot))
   "Returns a u-boot package for BOARD cross-compiled for TRIPLET."
   (let ((same-arch? (lambda ()
                       (string=? (%current-system)
@@ -809,6 +811,45 @@ to Novena upstream, does not load u-boot.img from the first partition.")
        `(("firmware" ,arm-trusted-firmware-rk3399)
          ,@(package-native-inputs base))))))
 
+(define u-boot-pbp
+  (let ((commit "365495a329c8e92ca4c134562d091df71b75845e"))
+    (package
+      (inherit u-boot)
+      (name "u-boot")
+      (version (git-version (package-version u-boot) "pinebook-pro-1" commit))
+      (source (origin
+                ;; XXX: Snapshots are available but changes timestamps every download.
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://git.eno.space/pbp-uboot.git")
+                      (commit commit)))
+                (file-name (string-append name "-" version "-checkout"))
+                (sha256
+                 (base32
+                  "092dxcvsk40fclks0lrg2caigzjhw9axjg936w5fs6aj7c0qxzjy")))))))
+
+(define-public u-boot-pinebook-pro-rk3399
+  (let ((base (make-u-boot-package "pinebook_pro-rk3399" "aarch64-linux-gnu"
+                                   #:u-boot u-boot-pbp)))
+    (package
+      (inherit base)
+      (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:phases phases)
+           `(modify-phases ,phases
+              (add-after 'unpack 'set-environment
+                (lambda* (#:key inputs #:allow-other-keys)
+                  (setenv "CPATH" (string-join (cdr (string-split (getenv "CPATH") #\:)) ":"))
+                  (setenv "BL31" (string-append (assoc-ref inputs "firmware")
+                                                "/bl31.elf"))
+                  #t))
+              ;; Phases do not succeed on the bl31 ELF.
+              (delete 'strip)
+              (delete 'validate-runpath)))))
+      (native-inputs
+       `(("firmware" ,arm-trusted-firmware-rk3399)
+         ,@(package-native-inputs base))))))
+
 (define-public vboot-utils
   (package
     (name "vboot-utils")
diff --git a/gnu/system/examples/pinebook-pro.tmpl b/gnu/system/examples/pinebook-pro.tmpl
new file mode 100644
index 0000000000..ca27728b15
--- /dev/null
+++ b/gnu/system/examples/pinebook-pro.tmpl
@@ -0,0 +1,57 @@
+;; This is an operating system configuration template
+;; for a "bare bones" pinebook pro
+
+;; The default image's kernel 4.4.190 has
+;;    microSD: /dev/mmcblk0
+;;    eMMC: /dev/mmcblk1
+;;
+;; Note that after booting the Guix System with linux-libre
+;; 5.5-pinebook-pro this changes to
+;;    microSD: /dev/mmcblk1
+;;    eMMC: /dev/mmcblk2
+
+;; Assuming https://gitlab.com/janneke/guix.git wip-pinebook-pro
+;; has been built in .
+;; cp gnu/system/examples/pinebook-pro.tmpl arm-baar.scm
+;; sudo -E ./pre-inst-env guix system init arm-baar.scm /mnt --fallback
+
+(use-modules (gnu) (gnu bootloader u-boot))
+(use-service-modules avahi networking ssh)
+(use-package-modules admin bootloaders certs linux ssh)
+
+(operating-system
+  (host-name "armzalig")
+  (timezone "Europe/Amsterdam")
+  (locale "en_US.utf8")
+
+  ;; Assuming not using a typewriter that needs qwerty slowdown
+  (keyboard-layout (keyboard-layout "us" "dvorak"
+                                    #:options '("ctrl:nocaps" "compose:menu")))
+
+  ;; Assuming /dev/mmcblk0 is the microSD...
+  (bootloader (bootloader-configuration
+               (target "/dev/mmcblk0")
+               (bootloader u-boot-pinebook-pro-rk3399-bootloader)))
+  ;; ...and /dev/mmcblk0p1 is the root file system
+  (file-systems (cons* (file-system (device "/dev/mmcblk1p1")
+                                    (mount-point "/")
+                                    (type "ext4"))
+                       %base-file-systems))
+
+  (kernel linux-libre-pinebook-pro)
+  (kernel-arguments '("ethaddr=${ethaddr}" "eth1addr=${eth1addr}" "serial=${serial#}"
+                      "video=HDMI-A-1:1920x1080@60" "video=eDP-1:1920x1080@60"
+                      "vga=current"))
+  (initrd-modules '())
+
+  (users (cons* (user-account (name "guix")
+                              (group "users")
+                              (supplementary-groups '("wheel")))
+                %base-user-accounts))
+  (name-service-switch %mdns-host-lookup-nss)
+  (packages (cons* nss-certs openssh wpa-supplicant-minimal %base-packages))
+  (services (cons* (service dhcp-client-service-type)
+                   (service openssh-service-type
+                            (openssh-configuration
+                             (port-number 2222)))
+                   %base-services)))
-- 
2.24.0
M
M
Mike Rosset wrote on 15 Feb 2020 22:51
Re: [bug#39617] [PATCH 0/2] Add initial Pinebook Pro support
(address . guix-patches@gnu.org)
87sgjbwmbn.fsf@gmail.com
Jan Nieuwenhuizen writes:

Toggle quote (6 lines)
> 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
D
D
Danny Milosavljevic wrote on 16 Feb 2020 19:19
Re: [PATCH 0/2] Add initial Pinebook Pro support
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200216191911.26df0ad7@scratchpost.org
Hi Janneke,

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

Toggle quote (4 lines)
> 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:

[...]

So all in all I think the Pinebook Pro will eventually work with the vanilla kernel.

Toggle quote (3 lines)
> 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)

Toggle quote (2 lines)
> 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.

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.

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?

Toggle quote (7 lines)
> --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.

Toggle quote (7 lines)
> 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)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl5Jh58ACgkQ5xo1VCww
uqVHFAf/fXCZvnK320Ii+c4ls0COnNYmaVMkEBHd/UEF2pG1Off3UuKRpzldWr90
UgJxsyqV51ERnfS1tlz7hkoA6y0/x6jqBJMTur0NYc9YnrQxRfHW86uA1/uNyps0
0wAr6z45me4TAlvQY+4dM22wc3cQ8fqH+ge/jhFM6c93t4t1196DV9SSYagA49X4
4quhSEZPmxv0Sy52VqmAWoYO+qGxBCoqN6Cj7DeDeKAzqhOLyBaiB6lNukshqYV0
jRpkNwY3TbhM5STnPEdU1QkseiBp2DEQGrl5uz3nuWgQDdP3slE1HD/uZUmMMuXY
1b6u7Hekrh+AleR2Rtygyd11YJhomA==
=QEab
-----END PGP SIGNATURE-----


D
D
Danny Milosavljevic wrote on 16 Feb 2020 19:21
Fw: [PATCH 0/2] Add initial Pinebook Pro support
(address . 39617@debbugs.gnu.org)
20200216192141.2c4530c8@scratchpost.org
Hi Janneke,

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

Toggle quote (4 lines)
> 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:

[...]

So all in all I think the Pinebook Pro will eventually work with the vanilla kernel.

Toggle quote (3 lines)
> 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)

Toggle quote (2 lines)
> 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.

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.

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?

Toggle quote (7 lines)
> --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.

Toggle quote (7 lines)
> 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)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl5JiDUACgkQ5xo1VCww
uqXRoQgAnENsTuQA6G0CWZQfcE1JFdsed+k6iPMZ4B8jzO2gCv5knprm2a1JQAFl
JdOzMkg57j6BU45DwOWAfb4U0hIJHY7CgbZIOpuykWcvNPN2gPrSvdEW31yfvw/N
MQRsuQKBa0XLmklsdC7kt6TftNUKsrk+URgHPaZ7GJtk5FS5oiVXq/Ctn0LDs+rm
c17NEVI++LLB42NTEwwqmbxtPI2zSTykKgRo/zcUMWioT36iG10lxTNSvR+RQiP5
NrzqCAl+k91JvqIq6oxLKmyXleoroHXL21c73ql5xlndrj5aL+B1GjyHFS8aRqSS
FKGzX47vghMqLPxqtljVilh+1Y9Kew==
=ik3r
-----END PGP SIGNATURE-----


D
D
Danny Milosavljevic wrote on 16 Feb 2020 19:22
Re: [bug#39617] [PATCH 0/2] Add initial Pinebook Pro support
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200216192217.5427f6d2@scratchpost.org
Hmm, CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb"

Should be fine then.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl5JiFkACgkQ5xo1VCww
uqUXowf/donKMwd2H8rRyvmWu1JAnhD63SSK7RCfTsgrYpVcY/bYvce0dCBuzGr9
W/+MwR4/x51pzFIdlfUhOMdbqmn6ehR+vo4Vg89M0Vcr0uOASRzTT/e3rMhvplem
Dm19Mlx919h6PAy6LJWI8e9G9ZuMEsa7eYhMHInZIn64QyMNVyt7zTjEhMfIiOo1
iQ5I0mvBcPXF9iACNpEppTy/WcaEX35BE02Y/bLa04tsK2g2y8UIHOBZEljYH7Mu
FHqp0rdxzKqCYemnT0ntdJkjcTStVQXDaBJIquNwSaoqfFr5UCve/yBKq2JLQIDG
5tGfEI21cBp364SWcByF102SNwLB+g==
=NndR
-----END PGP SIGNATURE-----


D
D
Danny Milosavljevic wrote on 16 Feb 2020 19:27
Re: [PATCH 0/2] Add initial Pinebook Pro support
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200216192741.16e7a4ae@scratchpost.org
Hi Janneke,

Toggle quote (5 lines)
>[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)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl5JiZ0ACgkQ5xo1VCww
uqXi4AgAop+1yfb0K6fuhd9cqtIW1P54JCQh3KP8yHr6sVzkKlMuA+0gkm0/Eykp
3aHRflHi+rTlPlNxf4nEtY1MJkJTva1xbR1q8i/3BHs52hR89eWzqZMd6cNxpXFj
HKqf06RzoTssNyMvfc5dSeaUD50RadgLeGtvr3eta4VsDVjyBp7wvz435R6jmWXS
H1sClVCf+KLOsIfpC9YcRdTr1f3IlMMaIjn7cUeap2mfBPcesN6VHVyGf2m0krhs
8uFjwQGTMRw5fNUBBoqSAwRdsSU7Glt5/q8WyyaE1tkKwZiXbAWybrmmGrjSEdM5
282VC/Vnu89NTGULfbw+HNPIFq+Pjg==
=vGrA
-----END PGP SIGNATURE-----


J
J
Jan Nieuwenhuizen wrote on 16 Feb 2020 20:04
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87mu9i4all.fsf@gnu.org
Danny Milosavljevic writes:

Hi Danny,

Toggle quote (13 lines)
>> 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?).

Toggle quote (5 lines)
>> 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.

Toggle quote (11 lines)
>> 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.

Toggle quote (6 lines)
> 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.

Toggle quote (8 lines)
>> 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!

Toggle quote (3 lines)
> 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.

Toggle quote (14 lines)
>> 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 <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
D
D
Danny Milosavljevic wrote on 18 Feb 2020 22:48
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200218224836.49555de6@scratchpost.org
Hi Janneke,

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

Toggle quote (6 lines)
> 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:


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.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl5MW7QACgkQ5xo1VCww
uqVn/ggAm0/9hZPPBpbdgPLWWfGpuOK2wPUcxzzf90qWLbrMJ3B+C66YuI5uLEln
LDB+ghg9kI0c44PeqACUNVuCdmZgba46sE8xo2cr24wquxqs9VDVMbjeasC8dtNg
sNmzi5pWJ186zG7pKtznhwaG0EsCZd8W9aB8uc8WLzWPcHwlKgwqbkoQmB1i5YvI
F/ER0h8s00hqTKNOocTWYGbV8859c8sNoVfeS/iLmTcZ47yxXFfRqOwH2LOmtTRG
3bih3ZUuX6as7adunBU4zx6TmkmhY8I+h9RVfyQcq2cVjOzDLycX+OFcOQawjODp
yxy9IccEqTgeVSJy2UvhnIH2mXRQdQ==
=jlUn
-----END PGP SIGNATURE-----


V
V
Vagrant Cascadian wrote on 20 Feb 2020 05:04
Re: [bug#39617] [PATCH 1/2] gnu: Add linux-libre-pinebook-pro.
87wo8hewfh.fsf@yucca
Successfully booted! Thanks for your work on this! This is the first
time I've ever booted a new machine with Guix rather than Debian
proper. :)

Also the very first time I bootstrapped a Guix system from the guix
packages built for Debian! Need to just go ahead and upload those soon.

relatively minor issue below:

On 2020-02-15, Jan Nieuwenhuizen wrote:
Toggle quote (4 lines)
> +;; Distribute a patched version of deblob-5.5 to accomodate for
> +;; the file rename
> +;; drivers/crypto/ccp/psp-dev.c -> drivers/crypto/ccp/sev-dev.c
> +(define (deblob-scripts-pinebook-pro version)
...
Toggle quote (6 lines)
> + (origin
> + (method url-fetch)
> + (uri (string-append "https://linux-libre.fsfla.org"
> + "/pub/linux-libre/releases/" version "-gnu/"
> + "deblob-check"))

I had to change version to download deblob-check to "5.5.1" as
apparently the 5.5.0 version was removed from (or never present on)
linux-libre.fsfla.org.


live well,
vagrant
V
V
Vagrant Cascadian wrote on 20 Feb 2020 05:12
Re: [PATCH 0/2] Add initial Pinebook Pro support
(address . 39617@debbugs.gnu.org)
87tv3lew27.fsf@yucca
On 2020-02-16, Danny Milosavljevic wrote:
Toggle quote (4 lines)
> 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?


Toggle quote (6 lines)
> 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
J
J
Jan Nieuwenhuizen wrote on 20 Feb 2020 07:26
Re: [bug#39617] [PATCH 1/2] gnu: Add linux-libre-pinebook-pro.
(name . Vagrant Cascadian)(address . vagrant@debian.org)
87tv3lbwqv.fsf@gnu.org
Vagrant Cascadian writes:

Toggle quote (4 lines)
> Successfully booted! Thanks for your work on this! This is the first
> time I've ever booted a new machine with Guix rather than Debian
> proper. :)

\o/

Toggle quote (21 lines)
> Also the very first time I bootstrapped a Guix system from the guix
> packages built for Debian! Need to just go ahead and upload those soon.
>
> relatively minor issue below:
>
> On 2020-02-15, Jan Nieuwenhuizen wrote:
>> +;; Distribute a patched version of deblob-5.5 to accomodate for
>> +;; the file rename
>> +;; drivers/crypto/ccp/psp-dev.c -> drivers/crypto/ccp/sev-dev.c
>> +(define (deblob-scripts-pinebook-pro version)
> ...
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append "https://linux-libre.fsfla.org"
>> + "/pub/linux-libre/releases/" version "-gnu/"
>> + "deblob-check"))
>
> I had to change version to download deblob-check to "5.5.1" as
> apparently the 5.5.0 version was removed from (or never present on)
> linux-libre.fsfla.org.

Hmm; could be anything -- I'm hoping that we can move to a released
tarball + patches some time soon anyway; this one of th ugly bits.

Please feel free to push a fix!

Greetings
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
J
J
Jan Nieuwenhuizen wrote on 20 Feb 2020 07:29
Re: [PATCH 0/2] Add initial Pinebook Pro support
(name . Vagrant Cascadian)(address . vagrant@debian.org)
87pne9bwlg.fsf@gnu.org
Vagrant Cascadian writes:

Toggle quote (8 lines)
> 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

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
V
V
Vagrant Cascadian wrote on 28 Feb 2020 02:03
(address . 39617@debbugs.gnu.org)
875zfr1q1l.fsf@yucca
On 2020-02-16, Danny Milosavljevic wrote:
Toggle quote (16 lines)
> 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.

Updated patches were sent today (by the same person working on the
manjaro kernel, I think):



Toggle quote (5 lines)
>> 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)

I think the upstreaming for pinebook pro is delayed on the device tree
landing in upstream linux... Peter Robinson sent a patch series that
kind of worked for me, though I didn't yet have a working kernel at the
time to test:


Combining that with the newer device-tree patches submitted to linux
might be fruitful!


I haven't done any recent tests, largely due to the issue with "guix
pull" being broken on aarch64... might only have limited ability to test
things the next week or so, or might just get a wild hair and go for it.


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXlhm5gAKCRDcUY/If5cW
qozRAPwK7FHkoPBoAZFb/Cz7G4I07Y0MzNZEMwujgunSraR9vgD+ISkIEdY4bnm7
8r1X1muOScETNTO9viTFuA63x0ZCTQI=
=uf0+
-----END PGP SIGNATURE-----

B
B
Brian Woodcox wrote on 20 May 2020 08:29
[bug#39617] [PATCH 0/2] Add initial Pinebook Pro support
(address . guix-patches@gnu.org)(address . janneke@gnu.org)
71EBF8FA-DEEF-47A8-A1CB-5856B631A31E@InSkyData.com
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.
Attachment: file
B
B
Brian Woodcox wrote on 20 May 2020 08:29
(address . guix-patches@gnu.org)(address . janneke@gnu.org)
C9EA79AE-FF43-4EF0-8AFB-658AC8A71060@InSkyData.com
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.
Attachment: file
J
J
Jan Nieuwenhuizen wrote on 20 May 2020 09:15
(name . Brian Woodcox)(address . bw@InSkyData.com)(address . guix-patches@gnu.org)
87blmj9iwa.fsf@gnu.org
Brian Woodcox writes:

Toggle quote (8 lines)
> 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
B
B
Brian Woodcox wrote on 20 May 2020 18:06
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)(address . guix-patches@gnu.org)
FB43E1FD-3605-4A8F-BB03-0D9D4E2FC079@inskydata.com
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.

Toggle quote (21 lines)
> 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
?