From unknown Sun Jun 22 00:12:55 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31599] [PATCH] system: Add u-boot-puma-rk3399. Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 May 2018 22:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 31599@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15272874103524 (code B ref -1); Fri, 25 May 2018 22:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 May 2018 22:30:10 +0000 Received: from localhost ([127.0.0.1]:48819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMLDt-0000um-Vh for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMLDr-0000tf-MJ for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMLDl-0005q6-06 for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fMLDk-0005pt-RO for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMLDi-0002U7-OW for guix-patches@gnu.org; Fri, 25 May 2018 18:30:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMLDd-0005ig-OD for guix-patches@gnu.org; Fri, 25 May 2018 18:29:58 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:54709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMLDd-0005i4-D7 for guix-patches@gnu.org; Fri, 25 May 2018 18:29:53 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 392CD1B411 for ; Fri, 25 May 2018 15:29:52 -0700 (PDT) From: Vagrant Cascadian Date: Fri, 25 May 2018 15:29:40 -0700 Message-ID: <878t87s71n.fsf@aikidev.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable The attached patch enables u-boot for puma-rk3399. It enables a build of the vendor's arm-trusted-firmware/rk3399-cortex-m0, and the installation offsets to install the u-boot to microSD. Tested running on a puma-rk3399-haikou board running GuixSD! There is one glitch, which is that the fdtfile variable in u-boot (rockchip/rk3399-puma-ddr1600.dtb) does not match the device-tree present in linux-libre (rockchip/rk3399-puma-haikou.dtb), so the fdtfile u-boot variable needs to manually be set at boot to match linux-libre. This is likely to be fixed in future u-boot versions. Vagrant Cascadian (1): system: Add u-boot-puma-rk3399. gnu/bootloader/u-boot.scm | 16 +++++++++++ gnu/packages/bootloaders.scm | 36 ++++++++++++++++++++++++- gnu/packages/firmware.scm | 64 ++++++++++++++++++++++++++++++++++++++++= ++++ gnu/system/install.scm | 6 +++++ 4 files changed, 121 insertions(+), 1 deletion(-) =2D-=20 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-system-Add-u-boot-puma-rk3399.patch Content-Transfer-Encoding: quoted-printable From=201e070fe4c33c774992cb712bd78745b91ccef307 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 25 May 2018 13:04:17 -0700 Subject: [PATCH 1/1] system: Add u-boot-puma-rk3399. * gnu/packages/bootloaders.scm (u-boot-puma-rk3399): New variable. (make-u-boot-package)[arguments]: Add '.rksd' files to the files installed during custom 'install phase. * gnu/bootloader/u-boot.scm (u-boot-puma-rk3399-bootloader): New exported variable. * gnu/system/install.scm (rk3399-puma-installation-os): New exported variable. * gnu/packages/firmware.scm (arm-trusted-firmware-puma-rk3399): New variabl= e. (rk3399-cortex-m0): New variable. =2D-- gnu/bootloader/u-boot.scm | 16 +++++++++++ gnu/packages/bootloaders.scm | 36 ++++++++++++++++++++++++- gnu/packages/firmware.scm | 64 ++++++++++++++++++++++++++++++++++++++++= ++++ gnu/system/install.scm | 6 +++++ 4 files changed, 121 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index ea0f67b3c..52b38dd1a 100644 =2D-- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -37,6 +37,7 @@ u-boot-nintendo-nes-classic-edition-bootloader u-boot-novena-bootloader u-boot-pine64-plus-bootloader + u-boot-puma-rk3399-bootloader u-boot-wandboard-bootloader)) =20 (define install-u-boot @@ -84,6 +85,15 @@ (write-file-on-device u-boot (stat:size (stat u-boot)) device (* 69 1024))))) =20 +(define install-puma-rk3399-u-boot + #~(lambda (bootloader device mount-point) + (let ((spl (string-append bootloader "/libexec/u-boot-spl.rksd")) + (u-boot (string-append bootloader "/libexec/u-boot.itb"))) + (write-file-on-device spl (stat:size (stat spl)) + device (* 64 512)) + (write-file-on-device u-boot (stat:size (stat u-boot)) + device (* 512 512))))) + =20 ;;; @@ -162,3 +172,9 @@ (bootloader (inherit u-boot-allwinner64-bootloader) (package u-boot-pine64-plus))) + +(define u-boot-puma-rk3399-bootloader + (bootloader + (inherit u-boot-bootloader) + (package u-boot-puma-rk3399) + (installer install-puma-rk3399-u-boot))) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 333f30e72..3c76b8b3d 100644 =2D-- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -450,7 +450,7 @@ board-independent tools."))) (let* ((out (assoc-ref outputs "out")) (libexec (string-append out "/libexec")) (uboot-files (append =2D (find-files "." ".*\\.(bin|efi|img|s= pl|itb|dtb)$") + (find-files "." ".*\\.(bin|efi|img|spl= |itb|dtb|rksd)$") (find-files "." "^(MLO|SPL)$")))) (mkdir-p libexec) (install-file ".config" libexec) @@ -521,6 +521,40 @@ board-independent tools."))) (define-public u-boot-cubieboard (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf")) =20 +(define-public u-boot-puma-rk3399 + (let ((base (make-u-boot-package "puma-rk3399" "aarch64-linux-gnu"))) + (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) + ;; Need to copy the firmware into u-boot build + ;; directory. + (copy-file (string-append (assoc-ref inputs "firmware") + "/bl31.bin") "bl31-rk3399.bin") + (copy-file (string-append (assoc-ref inputs "firmware-m0") + "/rk3399m0.bin") "rk3399m0.bin"= ))) + (add-after 'build 'builditb + (lambda* (#:key make-flags #:allow-other-keys) + ;; The u-boot.itb is not built by default + (zero? (apply system* "make" `(,@make-flags ,"u-boot.itb"= ))))) + (add-after 'builditb 'buildrksd + (lambda* (#:key inputs #:allow-other-keys) + ;; Build rockchip SD card images. + (zero? (apply system* + (string-append + (assoc-ref inputs "u-boot-tools") "/bin/mk= image") + `(,"-T" ,"rksd" ,"-n" ,"rk3399" ,"-d" +,"spl/u-boot-spl.bin" ,"u-boot-spl.rksd"))))))))) + (native-inputs + `(("firmware" ,arm-trusted-firmware-puma-rk3399) + ("firmware-m0" ,rk3399-cortex-m0) + ("u-boot-tools" ,u-boot-tools) + ,@(package-native-inputs base)))))) + (define-public vboot-utils (package (name "vboot-utils") diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 9e91ceca4..7bc12de38 100644 =2D-- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -404,3 +404,67 @@ such as: (sha256 (base32 "0r4xnlq7v9khjfcg6gqp7nmrmnw4z1r8bipwdr07png1dcbb8214"))))))) + +(define-public arm-trusted-firmware-puma-rk3399 + (let ((base (make-arm-trusted-firmware "rk3399")) + ;; Vendor's arm trusted firmware branch hasn't been upstreamed yet. + (commit "d71e6d83612df896774ec4c03d49500312d2c324") + (revision "1")) + (package + (inherit base) + (name "arm-trusted-firmware-puma-rk3399") + (version (string-append "1.3-" revision "." (string-take commit 7))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.theobroma-systems.com/arm-trusted-firmw= are.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0vqhwqqh8h9qlkpybg2v94911091c1418bc4pnzq5fd7zf0fjkf8"))))))) + +(define-public rk3399-cortex-m0 + (package + (name "rk3399-cortex-m0") + (version "1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.theobroma-systems.com/rk3399-cortex-m0.git") + (commit (string-append "v" version)))) + (file-name (git-file-name "rk3399-cortex-m0" version)) + (sha256 + (base32 + "02wz1vkf4j3zc8rx289z76xhrf71jhb2p05lvmygky393a9gjh9w")))) + (home-page "https://git.theobroma-systems.com/rk3399-cortex-m0.git/abo= ut/") + (synopsis "PMU Cortex M0 firmware for RK3399 Q7 (Puma)") + (description + "Cortex-M0 firmware used with the RK3399 to implement +power-management functionality and helpers (e.g. DRAM frequency +switching support).\n") + (license license:bsd-3) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (mzerofiles (find-files "." "rk3399m0.(elf|bin)$"))) + (for-each + (lambda (file) + (install-file file out)) + mzerofiles)) + #t)) + (add-before 'build 'setenv + (lambda* (#:key inputs #:allow-other-keys) + (setenv "CROSS_COMPILE" "arm-none-eabi-") + #t))))) + (native-inputs `( + ("cross-gcc" ,(cross-gcc "arm-none-eabi" #:xgcc gcc-7)) + ("cross-binutils" ,(cross-binutils "arm-none-eabi")))))) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 3efff915a..51f9e55ed 100644 =2D-- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -53,6 +53,7 @@ nintendo-nes-classic-edition-installation-os novena-installation-os pine64-plus-installation-os + rk3399-puma-installation-os wandboard-installation-os)) =20 ;;; Commentary: @@ -453,6 +454,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-T= ARGET." "/dev/mmcblk0" ; SD card storage "ttyS0")) =20 +(define rk3399-puma-installation-os + (embedded-installation-os u-boot-puma-rk3399-bootloader + "/dev/mmcblk0" ; SD card storage + "ttyS0")) + (define wandboard-installation-os (embedded-installation-os u-boot-wandboard-bootloader "/dev/mmcblk0" ; SD card storage =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlsIjlQACgkQt4uC1IFL kbZsuxAAqgPUJBPOv+6PzZ+bege+yndhTc2aEJbL1NXbkRaVMOLe2RDmp/LvnPuH 2S5zwKh0QwKLI3nyRZv2/x3nooIKbGEqiFC+xKNxZSP/hRcFQu8VyviRr8nnIU0e qtMboGJlWfpW9mNet51stzjV4FINMF39gEkZVOAp0EcTTXArDS9PQo+Kltr+2XAc droiQU8fUkgj8IsYRLlRZjJMZYv1UsVqVLzhxt77t+1Wuag87bsN+F33C4a/cTwN MAb5Zqjv6+x9WFlutGCa6z8Z0U5rt5NTFONWLCkLvSnGEdFrY9/GGhSg+MhyiM/B vfM9mXvNxvb+F4PDHiW8MR8Q1VLmjwC1vVkRDdIM2ZPab5+8DZo3/+ZTMqZKczus os3VJxFTwnVDPA2OCje2Vp9AT8Ig3WOa4VKZV0ZPBdWNu/AXsnG+jH7ZM9ktqHP8 NJOeBdVFv32E6skFk44ZFdHVhfAeQPgW7BAg6EQW68KiP1ju4d8FIlO3th6RWxPm uzAExDW1Y3XHNJFxQR9IkLjvEdvVAeks9iPRiCdJBztQn4bF8Abhn1WySf/w7q1J X/aZuuSUV04WEFJujfmmLl+MVxyShVGZIftto85pb1y/zpyuMX0ZfF8csoPkm07U kFN8dpPHYJjaAVX00kQR5h4ThAyi9tnXTvd+6AblCruWcLokJyY= =kSMQ -----END PGP SIGNATURE----- --==-=-=-- From unknown Sun Jun 22 00:12:55 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31599] [PATCH] system: Add u-boot-puma-rk3399. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 May 2018 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Vagrant Cascadian Cc: 31599@debbugs.gnu.org Received: via spool by 31599-submit@debbugs.gnu.org id=B31599.152731921117283 (code B ref 31599); Sat, 26 May 2018 07:21:02 +0000 Received: (at 31599) by debbugs.gnu.org; 26 May 2018 07:20:11 +0000 Received: from localhost ([127.0.0.1]:48971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMTUo-0004Ug-PH for submit@debbugs.gnu.org; Sat, 26 May 2018 03:20:10 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:43746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMTUm-0004UX-Ee for 31599@debbugs.gnu.org; Sat, 26 May 2018 03:20:08 -0400 Received: from localhost (84-113-15-225.cable.dynamic.surfer.at [84.113.15.225]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 17C5C336128F; Sat, 26 May 2018 09:20:07 +0200 (CEST) Date: Sat, 26 May 2018 09:19:53 +0200 From: Danny Milosavljevic Message-ID: <20180526091953.2e81f92f@scratchpost.org> In-Reply-To: <878t87s71n.fsf@aikidev.net> References: <878t87s71n.fsf@aikidev.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/f=TOQ7O3rByht3p5=yTajO/"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/f=TOQ7O3rByht3p5=yTajO/ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi, On Fri, 25 May 2018 15:29:40 -0700 Vagrant Cascadian wrote: > Tested running on a puma-rk3399-haikou board running GuixSD! Cool! > [fdtfile u-boot variable needs to manually be set at boot] >This is likely to be fixed in future u-boot versions. Does upstream know about it? >+ ;; The u-boot.itb is not built by default ??? How can that be? Isn't it required for booting? I checked the source code - apparently they use mkimage to build the itb from the its. So now we are using two "different" mkimage tools. OK I guess - but weird. All they'd have to do is add=20 ALL-y +=3D u-boot.itb to the Makefile. Does upstream know about it? >+ (zero? (apply system* "make" `(,@make-flags ,"u-boot.itb= "))))) Please use "invoke". It's shorthand for (zero? (system* ...)) but it also raises an exception on error. That's easier to maintain (when people add a second invocation they don't have to add "(and ...)"). So here it would be (apply invoke "make" `(,@make-flags ,"u-boot.itb")))) . >(add-after 'unpack 'set-environment >+ (lambda* (#:key inputs #:allow-other-keys) >+ ;; Need to copy the firmware into u-boot build >+ ;; directory. >+ (copy-file (string-append (assoc-ref inputs "firmware") >+ "/bl31.bin") "bl31-rk3399.bin") >+ (copy-file (string-append (assoc-ref inputs "firmware-m0= ") >+ "/rk3399m0.bin") "rk3399m0.bin= "))) Please end this phase with "#t". >+ (version (string-append "1.3-" revision "." (string-take commit 7))) Please use (git-version "1.3" revision commit) instead of=20 (string-append "1.3-" revision "." (string-take commit 7)) > [...] Sometimes the indentation you used is slightly off, like this: `((foo) (bar)) It should be `((foo) (bar)) --Sig_/f=TOQ7O3rByht3p5=yTajO/ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlsJCpkACgkQ5xo1VCww uqXxHwgAkA5gR/OXX9rgKadfnG5E7dv8+jZzXjVyC6iS3iByC/NCbv5u1vCe0u08 tNs4UAecQ2TdIewokzBJPlq38ExpN4wzGQx3coxJWKBsJrGvwwVXTqI3oIK+g9pv sQwjm/2ejQlbRJY283FUAdOlabBizDxhqAJpxPd3t7OnzN7x/YG7GWe4b4vH/A8p wawkKjDDhVhlhfjwz4/iGJ47cBbP4FEgKH05WyyB5gW9inbFh7Wc+zNsjKZS8kw1 6Ew75LdUaI58bNiRu+pBWqMh4RLEYxqd0DEz+IRPMkMfQIWOTK0H72adlvBbMH1h r2VQKIXSQJnbyX9Wt8Q6BqFjFixKGw== =0giQ -----END PGP SIGNATURE----- --Sig_/f=TOQ7O3rByht3p5=yTajO/-- From unknown Sun Jun 22 00:12:55 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31599] [PATCH] system: Add u-boot-puma-rk3399. Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 May 2018 16:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 31599@debbugs.gnu.org Received: via spool by 31599-submit@debbugs.gnu.org id=B31599.152735318419793 (code B ref 31599); Sat, 26 May 2018 16:47:01 +0000 Received: (at 31599) by debbugs.gnu.org; 26 May 2018 16:46:24 +0000 Received: from localhost ([127.0.0.1]:49846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMcKl-00059B-Rm for submit@debbugs.gnu.org; Sat, 26 May 2018 12:46:24 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:59698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMcKk-00058y-6p for 31599@debbugs.gnu.org; Sat, 26 May 2018 12:46:22 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 143D61B411; Sat, 26 May 2018 09:46:16 -0700 (PDT) From: Vagrant Cascadian In-Reply-To: <20180526091953.2e81f92f@scratchpost.org> References: <878t87s71n.fsf@aikidev.net> <20180526091953.2e81f92f@scratchpost.org> Date: Sat, 26 May 2018 09:46:04 -0700 Message-ID: <87603as6ur.fsf@aikidev.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2018-05-26, Danny Milosavljevic wrote: > On Fri, 25 May 2018 15:29:40 -0700 > Vagrant Cascadian wrote: >> [fdtfile u-boot variable needs to manually be set at boot] >>This is likely to be fixed in future u-boot versions. > > Does upstream know about it? A couple hours after I submitted this a patch was submitted upstream that fixes the issue: https://patchwork.ozlabs.org/patch/920785/ >>+ ;; The u-boot.itb is not built by default > > ??? How can that be? Isn't it required for booting? There may be other implementations of boot firmware that consume the various parts of u-boot and don't use u-boot.itb. The Debian u-boot package, for example, does not yet have arm-trusted-frimware or the cortex-m0 firmware available, so it needs to build without it and let the user build the other components and manually construct the u-boot.itb. > I checked the source code - apparently they use mkimage > to build the itb from the its. So now we are using two > "different" mkimage tools. OK I guess - but weird. An earlier patch I did added the tools directory to PATH and used the in-tree mkimage, but I opted for using the mkimage from u-boot-tools when I submitted. Wasn't sure which was better. > All they'd have to do is add=20 > > ALL-y +=3D u-boot.itb > > to the Makefile. Does upstream know about it? I'll bring the issue upstream; it may need to be added conditionally, as not all u-boot targets support generating a u-boot.itb. >>+ (zero? (apply system* "make" `(,@make-flags ,"u-boot.it= b"))))) > > Please use "invoke". It's shorthand for (zero? (system* ...)) but it also > raises an exception on error. > That's easier to maintain (when people add a second invocation they > don't have to add "(and ...)"). > > So here it would be (apply invoke "make" `(,@make-flags ,"u-boot.itb"))))= . Ok. >>(add-after 'unpack 'set-environment >>+ (lambda* (#:key inputs #:allow-other-keys) >>+ ;; Need to copy the firmware into u-boot build >>+ ;; directory. >>+ (copy-file (string-append (assoc-ref inputs "firmware") >>+ "/bl31.bin") "bl31-rk3399.bin= ") >>+ (copy-file (string-append (assoc-ref inputs "firmware-m= 0") >>+ "/rk3399m0.bin") "rk3399m0.bi= n"))) > > Please end this phase with "#t". Please forgive my ignorance, but I'm not sure where it belongs or even why... just a rank beginner with this. :) >>+ (version (string-append "1.3-" revision "." (string-take commit 7)= )) > > Please use (git-version "1.3" revision commit) instead of=20 > > (string-append "1.3-" revision "." (string-take commit 7)) Will do. > Sometimes the indentation you used is slightly off, like this: > > `((foo) > (bar)) > > It should be > > `((foo) > (bar)) Will try to sort those out... Thanks for the review! live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlsJj0wACgkQt4uC1IFL kbbheQ//TB/pae0t9Jb5A0mUqMPk+jHXly2Foi1ryhPfDbrNvZKf3Ya3QbJv/05I RFYgpt2dlcgB1a+lKsjHqx6z/ed6MsvY6UkuaGJDOucurtrih1arodYeqTgP99la /3mcuL/DHtu3GOHS5J8EgxCT3pqodknwwEUS9HitLVo4/IRaSHTF1174Tcq4l8DR O9vYa+i2/S/pJJHvn3vMQw5YBi73056DtisiqpVVYg8In1TWJSmtUjJjFQKaKtNy q4s4Kzx+BFi3DuegpGgtJHZ4nRpIrNZMGh6wyGOTgl8zxZUr+wrglAYr/CrCDlMD +WvgHTtGlrBu2Zt1ObWApDXuwooj3qF/z5f5R4WCTx+g6sMhLYM57Mgjkbo0X/ai 0v4XvS+HA80zDDsigPh/tA0c2etiDxA3dwA9uJp7EDJf1Bq+tFuPEtSC6Qi9RMbb AcHd/nV8DrPjDTLxZjL36xe9bRp+yD/gH+S9gfY6OJ5w2riVTxO3kS6FPzEA08JS Ngwd12KymZqrkDdgqye9OfP+avnubVw0L04ixUVsDBeForFJewIL086F7NlLRg0c J7xjAMMB9cmLFEUGYnvDamg4gvAm2oYZAZisW8nj6ufZfz+i9kt+d9SaqqS77EHK nhqPiI4eA+PSFCodAENnqj8PpzDySxgFbPWpFP6OGUiL8SFgRWs= =dt2V -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Jun 22 00:12:55 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31599] [PATCH] system: Add u-boot-puma-rk3399. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 May 2018 17:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Vagrant Cascadian Cc: 31599@debbugs.gnu.org Received: via spool by 31599-submit@debbugs.gnu.org id=B31599.152735473930014 (code B ref 31599); Sat, 26 May 2018 17:13:02 +0000 Received: (at 31599) by debbugs.gnu.org; 26 May 2018 17:12:19 +0000 Received: from localhost ([127.0.0.1]:49866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMcjr-0007o2-1W for submit@debbugs.gnu.org; Sat, 26 May 2018 13:12:19 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:56594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMcjo-0007np-96 for 31599@debbugs.gnu.org; Sat, 26 May 2018 13:12:16 -0400 Received: from localhost (84-113-15-225.cable.dynamic.surfer.at [84.113.15.225]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 0F04133613E9; Sat, 26 May 2018 19:12:15 +0200 (CEST) Date: Sat, 26 May 2018 19:12:02 +0200 From: Danny Milosavljevic Message-ID: <20180526191202.268bd0e6@scratchpost.org> In-Reply-To: <87603as6ur.fsf@aikidev.net> References: <878t87s71n.fsf@aikidev.net> <20180526091953.2e81f92f@scratchpost.org> <87603as6ur.fsf@aikidev.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/AK4FTBaoaoXzT+VyEijM39F"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/AK4FTBaoaoXzT+VyEijM39F Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable > A couple hours after I submitted this a patch was submitted upstream > that fixes the issue: >=20 > https://patchwork.ozlabs.org/patch/920785/ Good. > >>+ ;; The u-boot.itb is not built by default =20 > > > > ??? How can that be? Isn't it required for booting? =20 >=20 > There may be other implementations of boot firmware that consume the > various parts of u-boot and don't use u-boot.itb. >=20 > The Debian u-boot package, for example, does not yet have > arm-trusted-frimware or the cortex-m0 firmware available, so it needs to > build without it and let the user build the other components and > manually construct the u-boot.itb. I see. OK, I'm fine with building u-boot.itb manually for now. I just ask= ed because when we aren't careful we get into whack-a-mole quickly. (There's a huge amount of ARM boards and we shouldn't do the u-boot maintai= ner's job for them. It's more work *and* eventually we'd diverge from each other) > An earlier patch I did added the tools directory to PATH and used the > in-tree mkimage, but I opted for using the mkimage from u-boot-tools > when I submitted. Wasn't sure which was better. Right now, they are the same because u-boot-tools derives from u-boot in Gu= ix. That said, for the sake of modularization I'd use the package-local mkimage if there is one. One reason is that there are weird u-boot forks for some boards (mainline u-boot doesn't work for them). These might have local quirks in mkimage and it's better to track these quirks when building that u-boot. (As long as we know the above in the back of our heads as a potential source of problems it doesn't matter much which mkimage we use in practice) u-boot-tools is meant for the end user. I didn't intend it to be used by the u-boots themselves (not that it's bad--but it's redundant right now). > >>(add-after 'unpack 'set-environment > >>+ (lambda* (#:key inputs #:allow-other-keys) > >>+ ;; Need to copy the firmware into u-boot build > >>+ ;; directory. > >>+ (copy-file (string-append (assoc-ref inputs "firmware= ") > >>+ "/bl31.bin") "bl31-rk3399.b= in") > >>+ (copy-file (string-append (assoc-ref inputs "firmware= -m0") > >>+ "/rk3399m0.bin") "rk3399m0.= bin"))) =20 > > > > Please end this phase with "#t". =20 > Please forgive my ignorance, but I'm not sure where it belongs or even > why... just a rank beginner with this. :) Earlier guile didn't support exceptions--so phases have to return a boolean (whether the phase succeeded or not). In a lambda, the return value is the value of the last expression. There's an effort in core-updates to get it all up-to-speed so that these all actually return a boolean--and long term we'd get rid of this requireme= nt. Some procedures are written especially for phases ("invoke" is, for example) and do what you'd expect (return #t if OK, otherwise raise exception). Other procedures you have to be careful what they actually return. In this case, copy-file's documentation[1] states "The return value is unspecified" (that implies that error handling is via exceptions). The unspecified return value is clearly not good. [1] https://www.gnu.org/software/guile/manual/html_node/File-System.html --Sig_/AK4FTBaoaoXzT+VyEijM39F Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlsJlWIACgkQ5xo1VCww uqXrowf+LXuD/AGR8m+i1Yf2eMkoYrHc1+40BFy3tNW3xbldodw/O+LJ4TPc0FUl QaTLczZeRSCBui6/LROtfRtUvw4mwlR1XabKNBNbvtYP5oSEKCF3n8xnlgOa7yRS fI9EoxOl6QHKrvDVyBtHvhgx93t1sXHORzQj/WAXr70wPWvLWnC4PfDdjtwyab2I Ujad6W81osSi/g1VjSoYJ7AVwe6I4+eqclqkDcBwRgyhWy9bnMuZHK0arcJZI0FI kQ3ZWW2oWLmWjilWcZbGOB6xoei8/9HMJ9AdjXfyCtidmrC/dzZBo1VpURo3v6Th hDkXu310LJsWpfjhChKQym7l4KBAhA== =cLfg -----END PGP SIGNATURE----- --Sig_/AK4FTBaoaoXzT+VyEijM39F-- From unknown Sun Jun 22 00:12:55 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31599] [PATCH v2] system: Add u-boot-puma-rk3399. Resent-From: Vagrant Cascadian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 29 May 2018 04:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 31599@debbugs.gnu.org Received: via spool by 31599-submit@debbugs.gnu.org id=B31599.15275670361721 (code B ref 31599); Tue, 29 May 2018 04:11:01 +0000 Received: (at 31599) by debbugs.gnu.org; 29 May 2018 04:10:36 +0000 Received: from localhost ([127.0.0.1]:52966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNVxz-0000Rf-W6 for submit@debbugs.gnu.org; Tue, 29 May 2018 00:10:36 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:60304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNVxx-0000RR-SF for 31599@debbugs.gnu.org; Tue, 29 May 2018 00:10:34 -0400 Received: from localhost (75-164-188-47.ptld.qwest.net [75.164.188.47]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id CD5031B411; Mon, 28 May 2018 21:10:27 -0700 (PDT) From: Vagrant Cascadian In-Reply-To: <20180526191202.268bd0e6@scratchpost.org> References: <878t87s71n.fsf@aikidev.net> <20180526091953.2e81f92f@scratchpost.org> <87603as6ur.fsf@aikidev.net> <20180526191202.268bd0e6@scratchpost.org> Date: Mon, 28 May 2018 21:10:15 -0700 Message-ID: <87sh6bqezc.fsf@aikidev.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Thanks for the review! I think the attached patch addresses the issues raised: * Fix several indentation and numerous whitespace issues. * u-boot-puma-rk3399: Drop use of u-boot-tools as an input, calling ./tools/mkimage directly. * arm-trusted-firmware-puma-rk3399: Use git-version to set version. * u-boot-puma-rk3399: Complete block using #t * u-boot-puma-rk3399: Use "apply invoke" to make system calls. live well, vagrant --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-system-Add-u-boot-puma-rk3399.patch Content-Transfer-Encoding: quoted-printable From=2023bcb1e653f771aae3781ce665728283c3076b76 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Mon, 28 May 2018 18:28:13 -0700 Subject: [PATCH 1/1] system: Add u-boot-puma-rk3399. * gnu/packages/bootloaders.scm (u-boot-puma-rk3399): New variable. (make-u-boot-package)[arguments]: Add '.rksd' files to the files installed during custom 'install phase. * gnu/bootloader/u-boot.scm (u-boot-puma-rk3399-bootloader): New exported variable. * gnu/system/install.scm (rk3399-puma-installation-os): New exported variable. * gnu/packages/firmware.scm (arm-trusted-firmware-puma-rk3399): New variabl= e. (rk3399-cortex-m0): New variable. =2D-- gnu/bootloader/u-boot.scm | 16 +++++++++++ gnu/packages/bootloaders.scm | 33 ++++++++++++++++++++++- gnu/packages/firmware.scm | 63 ++++++++++++++++++++++++++++++++++++++++= ++++ gnu/system/install.scm | 6 +++++ 4 files changed, 117 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index ea0f67b3c..52b38dd1a 100644 =2D-- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -37,6 +37,7 @@ u-boot-nintendo-nes-classic-edition-bootloader u-boot-novena-bootloader u-boot-pine64-plus-bootloader + u-boot-puma-rk3399-bootloader u-boot-wandboard-bootloader)) =20 (define install-u-boot @@ -84,6 +85,15 @@ (write-file-on-device u-boot (stat:size (stat u-boot)) device (* 69 1024))))) =20 +(define install-puma-rk3399-u-boot + #~(lambda (bootloader device mount-point) + (let ((spl (string-append bootloader "/libexec/u-boot-spl.rksd")) + (u-boot (string-append bootloader "/libexec/u-boot.itb"))) + (write-file-on-device spl (stat:size (stat spl)) + device (* 64 512)) + (write-file-on-device u-boot (stat:size (stat u-boot)) + device (* 512 512))))) + =20 ;;; @@ -162,3 +172,9 @@ (bootloader (inherit u-boot-allwinner64-bootloader) (package u-boot-pine64-plus))) + +(define u-boot-puma-rk3399-bootloader + (bootloader + (inherit u-boot-bootloader) + (package u-boot-puma-rk3399) + (installer install-puma-rk3399-u-boot))) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 2dd530125..6ff26d0dc 100644 =2D-- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -489,7 +489,7 @@ board-independent tools."))) (let* ((out (assoc-ref outputs "out")) (libexec (string-append out "/libexec")) (uboot-files (append =2D (find-files "." ".*\\.(bin|efi|img|s= pl|itb|dtb)$") + (find-files "." ".*\\.(bin|efi|img|spl= |itb|dtb|rksd)$") (find-files "." "^(MLO|SPL)$")))) (mkdir-p libexec) (install-file ".config" libexec) @@ -560,6 +560,37 @@ board-independent tools."))) (define-public u-boot-cubieboard (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf")) =20 +(define-public u-boot-puma-rk3399 + (let ((base (make-u-boot-package "puma-rk3399" "aarch64-linux-gnu"))) + (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) + ;; Need to copy the firmware into u-boot build + ;; directory. + (copy-file (string-append (assoc-ref inputs "firmware") + "/bl31.bin") "bl31-rk3399.bin") + (copy-file (string-append (assoc-ref inputs "firmware-m0") + "/rk3399m0.bin") "rk3399m0.bin") + #t)) + (add-after 'build 'builditb + (lambda* (#:key make-flags #:allow-other-keys) + ;; The u-boot.itb is not built by default + (apply invoke "make" `(,@make-flags ,"u-boot.itb")))) + (add-after 'builditb 'buildrksd + (lambda* (#:key inputs #:allow-other-keys) + ;; Build rockchip SD card images. + (apply invoke "./tools/mkimage" + `(,"-T" ,"rksd" ,"-n" ,"rk3399" ,"-d" ,"spl= /u-boot-spl.bin" ,"u-boot-spl.rksd")))))))) + (native-inputs + `(("firmware" ,arm-trusted-firmware-puma-rk3399) + ("firmware-m0" ,rk3399-cortex-m0) + ,@(package-native-inputs base)))))) + (define-public vboot-utils (package (name "vboot-utils") diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 9e91ceca4..986e1d621 100644 =2D-- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -404,3 +404,66 @@ such as: (sha256 (base32 "0r4xnlq7v9khjfcg6gqp7nmrmnw4z1r8bipwdr07png1dcbb8214"))))))) + +(define-public arm-trusted-firmware-puma-rk3399 + (let ((base (make-arm-trusted-firmware "rk3399")) + ;; Vendor's arm trusted firmware branch hasn't been upstreamed yet. + (commit "d71e6d83612df896774ec4c03d49500312d2c324") + (revision "1")) + (package + (inherit base) + (name "arm-trusted-firmware-puma-rk3399") + (version (git-version "1.3" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.theobroma-systems.com/arm-trusted-firmw= are.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0vqhwqqh8h9qlkpybg2v94911091c1418bc4pnzq5fd7zf0fjkf8"))))))) + +(define-public rk3399-cortex-m0 + (package + (name "rk3399-cortex-m0") + (version "1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.theobroma-systems.com/rk3399-cortex-m0.git") + (commit (string-append "v" version)))) + (file-name (git-file-name "rk3399-cortex-m0" version)) + (sha256 + (base32 + "02wz1vkf4j3zc8rx289z76xhrf71jhb2p05lvmygky393a9gjh9w")))) + (home-page "https://git.theobroma-systems.com/rk3399-cortex-m0.git/abo= ut/") + (synopsis "PMU Cortex M0 firmware for RK3399 Q7 (Puma)") + (description + "Cortex-M0 firmware used with the RK3399 to implement +power-management functionality and helpers (e.g. DRAM frequency +switching support).\n") + (license license:bsd-3) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (mzerofiles (find-files "." "rk3399m0.(elf|bin)$"))) + (for-each + (lambda (file) + (install-file file out)) + mzerofiles)) + #t)) + (add-before 'build 'setenv + (lambda* (#:key inputs #:allow-other-keys) + (setenv "CROSS_COMPILE" "arm-none-eabi-") + #t))))) + (native-inputs `(("cross-gcc" ,(cross-gcc "arm-none-eabi" #:xgcc gcc-7= )) + ("cross-binutils" ,(cross-binutils "arm-none-eabi")))= ))) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index acc9f15e0..35f4ba9c2 100644 =2D-- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -53,6 +53,7 @@ nintendo-nes-classic-edition-installation-os novena-installation-os pine64-plus-installation-os + rk3399-puma-installation-os wandboard-installation-os)) =20 ;;; Commentary: @@ -451,6 +452,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-T= ARGET." "/dev/mmcblk0" ; SD card storage "ttyS0")) =20 +(define rk3399-puma-installation-os + (embedded-installation-os u-boot-puma-rk3399-bootloader + "/dev/mmcblk0" ; SD card storage + "ttyS0")) + (define wandboard-installation-os (embedded-installation-os u-boot-wandboard-bootloader "/dev/mmcblk0" ; SD card storage =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlsM0qgACgkQt4uC1IFL kbYTLxAAmoogCagNWrry/8HNf9/4u91B5ZF9pUPPo9HqtuM2rmfquBKdhdUPxhGf GqW+NWXORDKQf8NwogWlxr/yh1zvTt4ARyasaS+z86rft12huxjXA4O6tnPnx5UQ ux83vjul3npYqC5qouGmG4CTxVuIE5ZHsqJ1tygw5wZeB3xyEqJ26edz6xAH8CZb WjeiNH6sdCRUwp3AeESSzTAtS+NrJI1MGU5rVNzry/JzCNNNkIj0Xlfg0wRu61eV AUfgJwpxO5kNzKtmsxid+lkB75GQfZn20OKCW8gZlpkU1Dckj5hijizojnU38R9W 5TxI9L/3k5grOQQCeJj22/ubEsHUlUtQcOCxEWZJ0tUYbhj3iO8GvQ4ZAYC5MeWd FjFVP8ayQoPMtjtb+A2zKyryamMmH0zKet8POt9nxey3o5Lc3St5M8BnSEM2imql 4T8caJ9+iODs7flJ8Ya+QIjfEMGhI7YiCcZF0R6C/C8sQ1GSs4/7uudlb8zn8hl/ vEFQ98MMgBZGyIbW6iD1EwNjGfthztGFaAC7k/JsfgOSlrDJf+103FKnna2x5tL0 IlnKiYJiNijIEel8p7fMdkudvTZ1/phyHyloPU+8ENVEkTrEavkWX7+FF6NmnEz4 LQt1mNbIlbHrldx19X8Su9zgBNoTDT0TcrN0PBjZ+3xonEXjx/U= =taOD -----END PGP SIGNATURE----- --==-=-=-- From unknown Sun Jun 22 00:12:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Vagrant Cascadian Subject: bug#31599: closed (Re: [bug#31599] [PATCH v2] system: Add u-boot-puma-rk3399.) Message-ID: References: <20180529105140.5abe89f0@scratchpost.org> <878t87s71n.fsf@aikidev.net> X-Gnu-PR-Message: they-closed 31599 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 31599@debbugs.gnu.org Date: Tue, 29 May 2018 08:52:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1527583922-3256-1" This is a multi-part message in MIME format... ------------=_1527583922-3256-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #31599: [PATCH] system: Add u-boot-puma-rk3399. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 31599@debbugs.gnu.org. --=20 31599: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D31599 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1527583922-3256-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 31599-done) by debbugs.gnu.org; 29 May 2018 08:51:44 +0000 Received: from localhost ([127.0.0.1]:53121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNaM4-0000pi-IF for submit@debbugs.gnu.org; Tue, 29 May 2018 04:51:44 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:41842) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fNaM2-0000pa-Rp for 31599-done@debbugs.gnu.org; Tue, 29 May 2018 04:51:43 -0400 Received: from localhost (84-113-15-225.cable.dynamic.surfer.at [84.113.15.225]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 6A08B3360108; Tue, 29 May 2018 10:51:41 +0200 (CEST) Date: Tue, 29 May 2018 10:51:40 +0200 From: Danny Milosavljevic To: Vagrant Cascadian Subject: Re: [bug#31599] [PATCH v2] system: Add u-boot-puma-rk3399. Message-ID: <20180529105140.5abe89f0@scratchpost.org> In-Reply-To: <87sh6bqezc.fsf@aikidev.net> References: <878t87s71n.fsf@aikidev.net> <20180526091953.2e81f92f@scratchpost.org> <87603as6ur.fsf@aikidev.net> <20180526191202.268bd0e6@scratchpost.org> <87sh6bqezc.fsf@aikidev.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/o9U6ImqPyC.OJJO4+Fac=s_"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 31599-done Cc: 31599-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/o9U6ImqPyC.OJJO4+Fac=s_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 28 May 2018 21:10:15 -0700 Vagrant Cascadian wrote: > + (apply invoke "./tools/mkimage" > + `(,"-T" ,"rksd" ,"-n" ,"rk3399" ,"-d" ,"s= pl/u-boot-spl.bin" ,"u-boot-spl.rksd") Heh, this is neutral. So=20 (invoke "./tools/mkimage" "-T" "rksd" "-n" "rk3399" "-d" "spl/u-boot-spl.= bin" "u-boot-spl.rksd") works fine. So I've changed it to that. I've pushed it to guix master. Let's see what our aarch64 machines say about the cross-compilation (probab= ly doesn't work yet - but meh). --Sig_/o9U6ImqPyC.OJJO4+Fac=s_ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlsNFJwACgkQ5xo1VCww uqWE1wf+INhL7Ga/MDVuCrLvIL5IwRSGYJaCs9ysIvoc40HB3yejeUMTGJwJOPUz OqJCoA72t1+D06OiDn9cafijvwdTiVdJMH/PoTKgA6g3PilbmwS1iF/xwrRwwc4X +/LoosC26VzdYRxkms9xcXbE6QG3J5LiudDXG/CxNbrTFf8MuYZEuNoD4znfV8X0 chpGlIMEsqKeb1C5hWr3zZO/DNTJgjVEjZhG05SdtLr9BTVBfmN3gFrLHWUsGzgg AKnRQSoUSwMceLLMOP5gPIgUB1Pwk2gDqAY1lRe1zOx8OcrPSSBeJSII8ufoVKf5 fWiB12frHLvtujYSTmtZJFYl+G/EBA== =yFD6 -----END PGP SIGNATURE----- --Sig_/o9U6ImqPyC.OJJO4+Fac=s_-- ------------=_1527583922-3256-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 May 2018 22:30:10 +0000 Received: from localhost ([127.0.0.1]:48819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMLDt-0000um-Vh for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMLDr-0000tf-MJ for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMLDl-0005q6-06 for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37733) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fMLDk-0005pt-RO for submit@debbugs.gnu.org; Fri, 25 May 2018 18:30:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMLDi-0002U7-OW for guix-patches@gnu.org; Fri, 25 May 2018 18:30:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMLDd-0005ig-OD for guix-patches@gnu.org; Fri, 25 May 2018 18:29:58 -0400 Received: from cascadia.aikidev.net ([173.255.214.101]:54709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMLDd-0005i4-D7 for guix-patches@gnu.org; Fri, 25 May 2018 18:29:53 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 392CD1B411 for ; Fri, 25 May 2018 15:29:52 -0700 (PDT) From: Vagrant Cascadian To: guix-patches@gnu.org Subject: [PATCH] system: Add u-boot-puma-rk3399. Date: Fri, 25 May 2018 15:29:40 -0700 Message-ID: <878t87s71n.fsf@aikidev.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable The attached patch enables u-boot for puma-rk3399. It enables a build of the vendor's arm-trusted-firmware/rk3399-cortex-m0, and the installation offsets to install the u-boot to microSD. Tested running on a puma-rk3399-haikou board running GuixSD! There is one glitch, which is that the fdtfile variable in u-boot (rockchip/rk3399-puma-ddr1600.dtb) does not match the device-tree present in linux-libre (rockchip/rk3399-puma-haikou.dtb), so the fdtfile u-boot variable needs to manually be set at boot to match linux-libre. This is likely to be fixed in future u-boot versions. Vagrant Cascadian (1): system: Add u-boot-puma-rk3399. gnu/bootloader/u-boot.scm | 16 +++++++++++ gnu/packages/bootloaders.scm | 36 ++++++++++++++++++++++++- gnu/packages/firmware.scm | 64 ++++++++++++++++++++++++++++++++++++++++= ++++ gnu/system/install.scm | 6 +++++ 4 files changed, 121 insertions(+), 1 deletion(-) =2D-=20 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-system-Add-u-boot-puma-rk3399.patch Content-Transfer-Encoding: quoted-printable From=201e070fe4c33c774992cb712bd78745b91ccef307 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Fri, 25 May 2018 13:04:17 -0700 Subject: [PATCH 1/1] system: Add u-boot-puma-rk3399. * gnu/packages/bootloaders.scm (u-boot-puma-rk3399): New variable. (make-u-boot-package)[arguments]: Add '.rksd' files to the files installed during custom 'install phase. * gnu/bootloader/u-boot.scm (u-boot-puma-rk3399-bootloader): New exported variable. * gnu/system/install.scm (rk3399-puma-installation-os): New exported variable. * gnu/packages/firmware.scm (arm-trusted-firmware-puma-rk3399): New variabl= e. (rk3399-cortex-m0): New variable. =2D-- gnu/bootloader/u-boot.scm | 16 +++++++++++ gnu/packages/bootloaders.scm | 36 ++++++++++++++++++++++++- gnu/packages/firmware.scm | 64 ++++++++++++++++++++++++++++++++++++++++= ++++ gnu/system/install.scm | 6 +++++ 4 files changed, 121 insertions(+), 1 deletion(-) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index ea0f67b3c..52b38dd1a 100644 =2D-- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -37,6 +37,7 @@ u-boot-nintendo-nes-classic-edition-bootloader u-boot-novena-bootloader u-boot-pine64-plus-bootloader + u-boot-puma-rk3399-bootloader u-boot-wandboard-bootloader)) =20 (define install-u-boot @@ -84,6 +85,15 @@ (write-file-on-device u-boot (stat:size (stat u-boot)) device (* 69 1024))))) =20 +(define install-puma-rk3399-u-boot + #~(lambda (bootloader device mount-point) + (let ((spl (string-append bootloader "/libexec/u-boot-spl.rksd")) + (u-boot (string-append bootloader "/libexec/u-boot.itb"))) + (write-file-on-device spl (stat:size (stat spl)) + device (* 64 512)) + (write-file-on-device u-boot (stat:size (stat u-boot)) + device (* 512 512))))) + =20 ;;; @@ -162,3 +172,9 @@ (bootloader (inherit u-boot-allwinner64-bootloader) (package u-boot-pine64-plus))) + +(define u-boot-puma-rk3399-bootloader + (bootloader + (inherit u-boot-bootloader) + (package u-boot-puma-rk3399) + (installer install-puma-rk3399-u-boot))) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 333f30e72..3c76b8b3d 100644 =2D-- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -450,7 +450,7 @@ board-independent tools."))) (let* ((out (assoc-ref outputs "out")) (libexec (string-append out "/libexec")) (uboot-files (append =2D (find-files "." ".*\\.(bin|efi|img|s= pl|itb|dtb)$") + (find-files "." ".*\\.(bin|efi|img|spl= |itb|dtb|rksd)$") (find-files "." "^(MLO|SPL)$")))) (mkdir-p libexec) (install-file ".config" libexec) @@ -521,6 +521,40 @@ board-independent tools."))) (define-public u-boot-cubieboard (make-u-boot-package "Cubieboard" "arm-linux-gnueabihf")) =20 +(define-public u-boot-puma-rk3399 + (let ((base (make-u-boot-package "puma-rk3399" "aarch64-linux-gnu"))) + (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) + ;; Need to copy the firmware into u-boot build + ;; directory. + (copy-file (string-append (assoc-ref inputs "firmware") + "/bl31.bin") "bl31-rk3399.bin") + (copy-file (string-append (assoc-ref inputs "firmware-m0") + "/rk3399m0.bin") "rk3399m0.bin"= ))) + (add-after 'build 'builditb + (lambda* (#:key make-flags #:allow-other-keys) + ;; The u-boot.itb is not built by default + (zero? (apply system* "make" `(,@make-flags ,"u-boot.itb"= ))))) + (add-after 'builditb 'buildrksd + (lambda* (#:key inputs #:allow-other-keys) + ;; Build rockchip SD card images. + (zero? (apply system* + (string-append + (assoc-ref inputs "u-boot-tools") "/bin/mk= image") + `(,"-T" ,"rksd" ,"-n" ,"rk3399" ,"-d" +,"spl/u-boot-spl.bin" ,"u-boot-spl.rksd"))))))))) + (native-inputs + `(("firmware" ,arm-trusted-firmware-puma-rk3399) + ("firmware-m0" ,rk3399-cortex-m0) + ("u-boot-tools" ,u-boot-tools) + ,@(package-native-inputs base)))))) + (define-public vboot-utils (package (name "vboot-utils") diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 9e91ceca4..7bc12de38 100644 =2D-- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -404,3 +404,67 @@ such as: (sha256 (base32 "0r4xnlq7v9khjfcg6gqp7nmrmnw4z1r8bipwdr07png1dcbb8214"))))))) + +(define-public arm-trusted-firmware-puma-rk3399 + (let ((base (make-arm-trusted-firmware "rk3399")) + ;; Vendor's arm trusted firmware branch hasn't been upstreamed yet. + (commit "d71e6d83612df896774ec4c03d49500312d2c324") + (revision "1")) + (package + (inherit base) + (name "arm-trusted-firmware-puma-rk3399") + (version (string-append "1.3-" revision "." (string-take commit 7))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.theobroma-systems.com/arm-trusted-firmw= are.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0vqhwqqh8h9qlkpybg2v94911091c1418bc4pnzq5fd7zf0fjkf8"))))))) + +(define-public rk3399-cortex-m0 + (package + (name "rk3399-cortex-m0") + (version "1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.theobroma-systems.com/rk3399-cortex-m0.git") + (commit (string-append "v" version)))) + (file-name (git-file-name "rk3399-cortex-m0" version)) + (sha256 + (base32 + "02wz1vkf4j3zc8rx289z76xhrf71jhb2p05lvmygky393a9gjh9w")))) + (home-page "https://git.theobroma-systems.com/rk3399-cortex-m0.git/abo= ut/") + (synopsis "PMU Cortex M0 firmware for RK3399 Q7 (Puma)") + (description + "Cortex-M0 firmware used with the RK3399 to implement +power-management functionality and helpers (e.g. DRAM frequency +switching support).\n") + (license license:bsd-3) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (mzerofiles (find-files "." "rk3399m0.(elf|bin)$"))) + (for-each + (lambda (file) + (install-file file out)) + mzerofiles)) + #t)) + (add-before 'build 'setenv + (lambda* (#:key inputs #:allow-other-keys) + (setenv "CROSS_COMPILE" "arm-none-eabi-") + #t))))) + (native-inputs `( + ("cross-gcc" ,(cross-gcc "arm-none-eabi" #:xgcc gcc-7)) + ("cross-binutils" ,(cross-binutils "arm-none-eabi")))))) diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 3efff915a..51f9e55ed 100644 =2D-- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -53,6 +53,7 @@ nintendo-nes-classic-edition-installation-os novena-installation-os pine64-plus-installation-os + rk3399-puma-installation-os wandboard-installation-os)) =20 ;;; Commentary: @@ -453,6 +454,11 @@ The bootloader BOOTLOADER is installed to BOOTLOADER-T= ARGET." "/dev/mmcblk0" ; SD card storage "ttyS0")) =20 +(define rk3399-puma-installation-os + (embedded-installation-os u-boot-puma-rk3399-bootloader + "/dev/mmcblk0" ; SD card storage + "ttyS0")) + (define wandboard-installation-os (embedded-installation-os u-boot-wandboard-bootloader "/dev/mmcblk0" ; SD card storage =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEcDardHbDotegGFCHt4uC1IFLkbYFAlsIjlQACgkQt4uC1IFL kbZsuxAAqgPUJBPOv+6PzZ+bege+yndhTc2aEJbL1NXbkRaVMOLe2RDmp/LvnPuH 2S5zwKh0QwKLI3nyRZv2/x3nooIKbGEqiFC+xKNxZSP/hRcFQu8VyviRr8nnIU0e qtMboGJlWfpW9mNet51stzjV4FINMF39gEkZVOAp0EcTTXArDS9PQo+Kltr+2XAc droiQU8fUkgj8IsYRLlRZjJMZYv1UsVqVLzhxt77t+1Wuag87bsN+F33C4a/cTwN MAb5Zqjv6+x9WFlutGCa6z8Z0U5rt5NTFONWLCkLvSnGEdFrY9/GGhSg+MhyiM/B vfM9mXvNxvb+F4PDHiW8MR8Q1VLmjwC1vVkRDdIM2ZPab5+8DZo3/+ZTMqZKczus os3VJxFTwnVDPA2OCje2Vp9AT8Ig3WOa4VKZV0ZPBdWNu/AXsnG+jH7ZM9ktqHP8 NJOeBdVFv32E6skFk44ZFdHVhfAeQPgW7BAg6EQW68KiP1ju4d8FIlO3th6RWxPm uzAExDW1Y3XHNJFxQR9IkLjvEdvVAeks9iPRiCdJBztQn4bF8Abhn1WySf/w7q1J X/aZuuSUV04WEFJujfmmLl+MVxyShVGZIftto85pb1y/zpyuMX0ZfF8csoPkm07U kFN8dpPHYJjaAVX00kQR5h4ThAyi9tnXTvd+6AblCruWcLokJyY= =kSMQ -----END PGP SIGNATURE----- --==-=-=-- ------------=_1527583922-3256-1-- From unknown Sun Jun 22 00:12:55 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#31599] [PATCH v2] system: Add u-boot-puma-rk3399. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Jun 2018 12:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31599 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Vagrant Cascadian Cc: 31599-done@debbugs.gnu.org Received: via spool by 31599-done@debbugs.gnu.org id=D31599.152923776220636 (code D ref 31599); Sun, 17 Jun 2018 12:17:01 +0000 Received: (at 31599-done) by debbugs.gnu.org; 17 Jun 2018 12:16:02 +0000 Received: from localhost ([127.0.0.1]:52643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUWb9-0005MM-9R for submit@debbugs.gnu.org; Sun, 17 Jun 2018 08:16:02 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:39222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUWb7-0005MD-NJ for 31599-done@debbugs.gnu.org; Sun, 17 Jun 2018 08:15:58 -0400 Received: from localhost (178.113.182.79.wireless.dyn.drei.com [178.113.182.79]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 29CFD3361689; Sun, 17 Jun 2018 14:15:56 +0200 (CEST) Date: Sun, 17 Jun 2018 14:15:39 +0200 From: Danny Milosavljevic Message-ID: <20180617141539.1016a9cd@scratchpost.org> In-Reply-To: <20180529105140.5abe89f0@scratchpost.org> References: <878t87s71n.fsf@aikidev.net> <20180526091953.2e81f92f@scratchpost.org> <87603as6ur.fsf@aikidev.net> <20180526191202.268bd0e6@scratchpost.org> <87sh6bqezc.fsf@aikidev.net> <20180529105140.5abe89f0@scratchpost.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/9eZfkoPA.b07dkAPFawwIrz"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/9eZfkoPA.b07dkAPFawwIrz Content-Type: multipart/mixed; boundary="MP_/u0PywtY7AHiIhwHzliKmI5=" --MP_/u0PywtY7AHiIhwHzliKmI5= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Vagrant, could you send a patch adding puma-rk3399 to buildroot? I'm thinking of using buildroot for the u-boot installation in GuixSD instead of our DIY installers (in the long term). Puma-rk3399 is one of the few u-boots that isn't in buildroot yet. I've attached an example patch adding Bananapi M2 Ultra. In order to build this example: $ git clone git://git.buildroot.net/buildroot $ cd buildroot $ patch -p1 < .../0001-Added-support-for-Sinovoip-BananaPi-M2-Ultra-board.p= atch $ make bananapi_m2_ultra_defconfig $ make # takes extremely long and takes lots of space I'm planning to copy genimage.cfg from buildroot - not everything. That would enable us to have a generic install-u-boot. Buildroot: https://buildroot.org/ Git web: https://git.busybox.net/buildroot/ Git: git clone git://git.buildroot.net/buildroot Git: git clone https://git.buildroot.net/buildroot Patches: http://lists.buildroot.org/mailman/listinfo/buildroot --MP_/u0PywtY7AHiIhwHzliKmI5= Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-Added-support-for-Sinovoip-BananaPi-M2-Ultra-board.patch =46rom 95be66f410ea89a72c77695dacce938edf97e9d0 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Sat, 16 Jun 2018 23:47:35 +0200 Subject: [PATCH 1/1] Added support for Sinovoip BananaPi M2 Ultra board. Tags: patch Signed-off-by: Danny Milosavljevic --- board/sinovoip/m2-ultra/boot.cmd | 7 +++++++ board/sinovoip/m2-ultra/genimage.cfg | 33 +++++++++++++++++++++++++++++++++ configs/bananapi_m2_ultra_defconfig | 27 +++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 board/sinovoip/m2-ultra/boot.cmd create mode 100644 board/sinovoip/m2-ultra/genimage.cfg create mode 100644 configs/bananapi_m2_ultra_defconfig diff --git a/board/sinovoip/m2-ultra/boot.cmd b/board/sinovoip/m2-ultra/boo= t.cmd new file mode 100644 index 0000000000..9c24eabff6 --- /dev/null +++ b/board/sinovoip/m2-ultra/boot.cmd @@ -0,0 +1,7 @@ +setenv bootargs console=3DttyS0,115200 earlyprintk root=3D/dev/mmcblk0p2 r= ootwait + +mmc dev 0 +fatload mmc 0 $kernel_addr_r zImage +fatload mmc 0 $fdt_addr_r sun8i-r40-bananapi-m2-ultra.dtb + +bootz $kernel_addr_r - $fdt_addr_r diff --git a/board/sinovoip/m2-ultra/genimage.cfg b/board/sinovoip/m2-ultra= /genimage.cfg new file mode 100644 index 0000000000..675253af23 --- /dev/null +++ b/board/sinovoip/m2-ultra/genimage.cfg @@ -0,0 +1,33 @@ +image boot.vfat { + vfat { + files =3D { + "zImage", + "sun8i-r40-bananapi-m2-ultra.dtb", + "boot.scr" + } + } + size =3D 64M +} + +image sdcard.img { + hdimage { + } + + partition u-boot { + in-partition-table =3D "no" + image =3D "u-boot-sunxi-with-spl.bin" + offset =3D 8192 + size =3D 1040384 # 1MB - 8192 + } + + partition boot { + partition-type =3D 0xC + bootable =3D "true" + image =3D "boot.vfat" + } + + partition rootfs { + partition-type =3D 0x83 + image =3D "rootfs.ext4" + } +} diff --git a/configs/bananapi_m2_ultra_defconfig b/configs/bananapi_m2_ultr= a_defconfig new file mode 100644 index 0000000000..a86d5923c6 --- /dev/null +++ b/configs/bananapi_m2_ultra_defconfig @@ -0,0 +1,27 @@ +BR2_arm=3Dy +BR2_cortex_a7=3Dy +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_13=3Dy +BR2_TARGET_GENERIC_ISSUE=3D"Welcome to Bananapi M2 Ultra" +BR2_ROOTFS_POST_IMAGE_SCRIPT=3D"support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS=3D"-c board/sinovoip/m2-ultra/genimage.cfg" +BR2_LINUX_KERNEL=3Dy +BR2_LINUX_KERNEL_CUSTOM_VERSION=3Dn +BR2_LINUX_KERNEL_DEFCONFIG=3D"sunxi" +BR2_LINUX_KERNEL_DTS_SUPPORT=3Dy +BR2_LINUX_KERNEL_INTREE_DTS_NAME=3D"sun8i-r40-bananapi-m2-ultra" +BR2_TARGET_ROOTFS_EXT2=3Dy +BR2_TARGET_ROOTFS_EXT2_4=3Dy +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_UBOOT=3Dy +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=3Dy +BR2_TARGET_UBOOT_CUSTOM_VERSION=3Dn +BR2_TARGET_UBOOT_BOARD_DEFCONFIG=3D"Bananapi_M2_Ultra" +BR2_TARGET_UBOOT_NEEDS_DTC=3Dy +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=3Dy +BR2_TARGET_UBOOT_FORMAT_CUSTOM=3Dy +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME=3D"u-boot-sunxi-with-spl.bin" +BR2_TARGET_UBOOT_BOOT_SCRIPT=3Dy +BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE=3D"board/sinovoip/m2-ultra/boot.cmd" +BR2_PACKAGE_HOST_DOSFSTOOLS=3Dy +BR2_PACKAGE_HOST_GENIMAGE=3Dy +BR2_PACKAGE_HOST_MTOOLS=3Dy --MP_/u0PywtY7AHiIhwHzliKmI5=-- --Sig_/9eZfkoPA.b07dkAPFawwIrz Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlsmUOsACgkQ5xo1VCww uqV6AAf/WXhWDGjYCKpWVjv456zUTYJYsA49spc1rwky6w6B+DFZLrhbuWdVvqdO n6/zKmkJeeo23XlXn4o4pi55cpNDO994PfKeXOUTaNL7xpOFoBdytGNaX6J/Klhj FCr2T7QYJyS/AMpR7YiYa/SqXrjcgjESDu9sEdvJr+tk+1VryfAJs6C986RWejcE cv+eQGFcDnuaddlK3d0WdrxcnytXxLyJmZif2QFi4n6bieeLBMWwGPWGhrF6LqSG 0mXqqJngD4iP5l6+TcMw/fKAIYC2vc3spEgBc4zVfsh5rswDk/w4Ad4MdipOAb1W 1t2Qvp1c0p+cwXxl+XpT5eEj4LzJYA== =c6kI -----END PGP SIGNATURE----- --Sig_/9eZfkoPA.b07dkAPFawwIrz--