From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +AdhF9HzvWI8awAAbAwnHQ (envelope-from ) for ; Thu, 30 Jun 2022 21:04:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0EpQF9HzvWKEBgEA9RJhRA (envelope-from ) for ; Thu, 30 Jun 2022 21:04:49 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C36EF2EFE5 for ; Thu, 30 Jun 2022 21:04:48 +0200 (CEST) Received: from localhost ([::1]:52376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6zT5-0004vW-6c for larch@yhetil.org; Thu, 30 Jun 2022 15:04:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6zSf-0004vN-So for help-guix@gnu.org; Thu, 30 Jun 2022 15:04:21 -0400 Received: from cascadia.aikidev.net ([2600:3c01:e000:267:0:a171:de7:c]:34358) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6zSZ-0004MJ-36; Thu, 30 Jun 2022 15:04:21 -0400 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:7:77:0:20]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id 6FA081AC0F; Thu, 30 Jun 2022 12:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1656615849; bh=i0Q6pS4bUDi4hfe8LADE7LrmCjRxW22JNF7s/flYOEE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Ogi6F2z/74d6JxwKls8gThvBcGbj2wgyb/grLJO995r3cdL5pSswfr2rN5OTI5wWi Kj6BWFYjlj+KATDgMZnbfOtznSKojOJgOs7/8+79ca6y8NgVu3JwaFhT2KY8l+S0JL ELcmln8HGLkIiPi/e2TtLuYagogFEBJDuuEHOBgCh/4Esx5B8GHYo6jLM7jY60VLdu E7EhWY0D5rVZ7TnuwtHVaesmEYjmHhdf7a9E8+iYLOTJkb5vza5pwbQbQxgJoBPC9R 59KTjOSnqYpWvEER9Gk/V2t1LLoGRUhNsucDAitK2zk7B4q9gUnJbiXlZJbjojJ5my RpnWwrhn7rXeA== From: Vagrant Cascadian To: phodina , help-guix Cc: Mathieu Othacehe , "janneke@gnu.org" Subject: linux and u-boot for pinenote-rk3568 In-Reply-To: References: Date: Thu, 30 Jun 2022 12:04:03 -0700 Message-ID: <874k022ct8.fsf@contorta> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: none client-ip=2600:3c01:e000:267:0:a171:de7:c; envelope-from=vagrant@debian.org; helo=cascadia.aikidev.net X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1656615889; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YbLJd3rOStVONQK9nQCtK5tSEFkPRts+8sfRn6evvWU=; b=nJs99iEwR84svJURpTtDVLAB4mMHIhOM+KexNfOiyAQJwYKqSiCIJkNO23kE14YmcKrpww NKK4rnJasA8/4ofXI8KO2WMl5HbFtTdgPwOonLpeS33qCQQVcoK+PjxycOcfpaAh6IXVED RNSOEMWguLMKFd/crFC5TMKyBhqGAbf1mmtDNdT0H2lHkipTqWQ/gV342123+fYRGryFu5 gw3fN9q3bsUsNlAb6s+Fdr4wo9oeRol1vJCPDyIH0vfO9R1Bem1XWsPPwRWwwmJ/JVCKBw +MYXVE0NCRchK09vKGM9kOFMMoXRLw54dJGRh2wlAzED/JH++xJhyOCW1K/IKQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656615889; a=rsa-sha256; cv=none; b=giHHfyyVVYnVbml9gDfu+zP0s8+tZhuqH4z4/nzQ2kH6CJVfvRugLBV7QkShJhqVmy0vGR NcE4G6ewGZsfJl3qlanWs8Zh1Vv89+a9tZpXk2TWksll/wtrKReKNgVo6I19fneJfrecF7 7QZRFt0oCMzkqHGJuHfwbImpwOrFbTOyLcLfoQk2fbaZrGdwn3s6Mp+PAQBHm7Ua7lQYln byNXODzoGSjFO4L725r+1xN5wtFtlc7+V8j+oHrjw6IQZQCpFJZJv7XVgQ1kMtCKW3iBNR /5i/efZNGZVtlN9b8gFkWg4KFtGbJR6xApJLPs+92ri93K9CXB92ATQHVQepcw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b="Ogi6F2z/"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -10.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debian.org header.s=1.vagrant.user header.b="Ogi6F2z/"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C36EF2EFE5 X-Spam-Score: -10.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: zd7Z9sVOHd/n --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2022-06-30, phodina via wrote: > I'm attempting to build the Linux kernel and u-boot for ARM64 target - > eink tablet. I can infer what you're talking about from the later patches, but it would be good to mention what specific hardware you're talking about up front and/or in the subject. :) > Unfotutnately the patches are not yet in the upstream so I had to > tweak little bit in the gnu/packages/linux.scm and > gnu/bootloader/bootloaders.scm files. Had to do similar things early on to get the pinebook-pro support available in guix before it was fully upstream... wheee! A partial review with comments inline follows... > Subject: [PATCH 4/7] gnu: Provide private implementation with selection o= f the > u-boot package. > > * gnu/packages/bootloaders.scm: Provide private implementation of > make-u-boot-package and make-u-boot-sunxi64-package so that the public = API > does not change. The private allows to specify the u-boot package. This seems unecessarily complicated; you could just use a different source for the eventual u-boot-pinenote* packages rather than renaming existing functions and/or adding new ones... see what u-boot-nintendo-nes-classic-edition does, mentioned below... > From 44b1385e6dbcc79bafebddc7699ed302fcb5fe91 Mon Sep 17 00:00:00 2001 > From: Petr Hodina > Date: Thu, 30 Jun 2022 11:20:55 +0200 > Subject: [PATCH 6/7] gnu: Add install-pinenote-rk3568-u-boot and > u-boot-pinenote-rk3568-bootloader. > > * gnu/bootloader/u-boot.scm (install-pinenote-rk3568-u-boot, > u-boot-pinenote-rk3568-bootloader): New variables. The patch order is wrong, this is patch 6/7 followed by patch 5/7 ... sometimes the order doesn't matter, but this order was actually a bit confusing for me. Please submit patches in the appropriate order. :) > diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm > index 6cad33b741..4410cc497a 100644 > --- a/gnu/bootloader/u-boot.scm > +++ b/gnu/bootloader/u-boot.scm ... > @@ -127,6 +129,15 @@ (define install-rockpro64-rk3399-u-boot >=20=20 > (define install-pinebook-pro-rk3399-u-boot install-rockpro64-rk3399-u-bo= ot) >=20=20 > +;; TODO: Supply correct offsets > +(define install-pinenote-rk3568-u-boot > + #~(lambda (bootloader root-index image) > + (let ((idb (string-append bootloader "/libexec/idbloader.img")) > + (u-boot (string-append bootloader "/libexec/u-boot.itb"))) > + (write-file-on-device idb (stat:size (stat idb)) > + image (* 64 512)) > + (write-file-on-device u-boot (stat:size (stat u-boot)) > + image (* 16384 512))))) Does it really use different offsets than other rockchip platforms, or is that just a note to confirm if it does? > From 4d53d2bdb8526f72ed6cd3183ff2a2141990c900 Mon Sep 17 00:00:00 2001 > From: Petr Hodina > Date: Thu, 30 Jun 2022 11:19:33 +0200 > Subject: [PATCH 5/7] gnu: Add u-boot-pinenote-rk3568. > > * gnu/packages/bootloaders.scm (u-boot-pinenote-rk3568): New variable. > > diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm > index cab97852f1..9c266b7bed 100644 > --- a/gnu/packages/bootloaders.scm > +++ b/gnu/packages/bootloaders.scm > @@ -834,6 +834,9 @@ (define-public u-boot-pine64-plus > (define-public u-boot-pine64-lts > (make-u-boot-sunxi64-package "pine64-lts" "aarch64-linux-gnu")) >=20=20 > +(define-public u-boot-pinenote-rk3568 > + (make-u-boot-sunxi64-package-priv "pinenote" "aarch64-linux-gnu" u-boo= t-pinenote)) > + > (define-public u-boot-pinebook > (let ((base (make-u-boot-sunxi64-package "pinebook" "aarch64-linux-gnu= "))) > (package Definitely not u-boot-sunxi64-package. Probably more similar to the u-boot-pinebook-pro-rk3399 or u-boot-rock64-rk3328, which i think use the standard make-u-boot-package. For using an entirely different source repository for a specific package, see the u-boot-nintendo-nes-classic-edition and how that uses a different source, e.g. (define-public u-boot-nintendo-nes-classic-edition (let ((base (make-u-boot-package "Nintendo_NES_Classic_Edition" "arm-linux-gnueabihf"))) (package (inherit base) ;; Starting with 2019.01, FEL doesn't work anymore on A33. (version "2018.11") (source (origin ... > From a6499c4c384dd3c0e06968cc6987da0e47af6290 Mon Sep 17 00:00:00 2001 > From: Petr Hodina > Date: Thu, 30 Jun 2022 10:12:39 +0200 > Subject: [PATCH 1/7] gnu: Add linux-libre-arm64-pinenote. > > * gnu/packages/linux.scm (linux-libre-arm64-pinenote): New variable. > * gnu/local.mk: Add patches. > * linux-libre-arm64-pinenote-battery-level.patch: New file. > * linux-libre-arm64-pinenote-defconfig.patch: New file. > * linux-libre-arm64-pinenote-dtsi.patch: New file. > * linux-libre-arm64-pinenote-ebc-patches.patch: New file. > * linux-libre-arm64-pinenote-touchscreen-1.patch: New file. > * linux-libre-arm64-pinenote-touchscreen-2.patch: New file. > * linux-libre-arm64-rockchip-add-hdmi-sound.patch: New file. I'm going to make some comments on this patch, but I get plenty confused with patches in gnu/packages/linux.scm as it can be a little more complicated than your typical packaging, so any other reviewers really ought to jump in too! :) > diff --git a/gnu/local.mk b/gnu/local.mk > index 353b91cfd2..c19f1f418b 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -1444,6 +1444,13 @@ dist_patch_DATA =3D \ > %D%/packages/patches/linbox-fix-pkgconfig.patch \ > %D%/packages/patches/linphone-desktop-without-sdk.patch \ > %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \ > + %D%/packages/patches/linux-libre-arm64-pinenote-touchscreen-1.patch \ > + %D%/packages/patches/linux-libre-arm64-pinenote-touchscreen-2.patch \ > + %D%/packages/patches/linux-libre-arm64-pinenote-battery-level.patch \ > + %D%/packages/patches/linux-libre-arm64-rockchip-add-hdmi-sound.patch \ > + %D%/packages/patches/linux-libre-arm64-pinenote-defconfig.patch \ > + %D%/packages/patches/linux-libre-arm64-pinenote-dtsi.patch \ whitespace inconsistancy on the previous few lines... > diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm > index 8f7b4f4f5b..bae8ffb959 100644 > --- a/gnu/packages/linux.scm > +++ b/gnu/packages/linux.scm > @@ -349,6 +349,12 @@ (define (%upstream-linux-source version hash) > "linux-" version ".tar.xz")) > (sha256 hash))) >=20=20 > +(define (%pinenote-linux-source version hash) > + (origin > + (method url-fetch) > + (uri (string-append "https://github.com/phodina/linux-pinenote/tarba= ll/" version)) > + (sha256 hash))) > + I think tarballs from github are generally discouraged; although with the kernel that can be quite a large git checkout... but... > ;; The current "stable" kernels. That is, the most recently released maj= or > ;; versions that are still supported upstream. >=20=20 > @@ -367,6 +373,14 @@ (define-public linux-libre-5.17-pristine-source > (%upstream-linux-source version hash) > deblob-scripts-5.17))) >=20=20 > +(define-public linux-libre-arm64-pinenote-pristine-source > + (let ((version linux-libre-5.17-version) > + (commit "c91a48e028fe1f6a0e5748fd87c446aa7e31811b") > + (hash (base32 "1xwyvvps1r3zl1n9szlgrj8ylw5sgj6fr52fig9f2cc6ai331= bbn"))) > + (make-linux-libre-source version > + (%pinenote-linux-source commit hash) > + deblob-scripts-5.17))) > + Oh, wait, you do pull from git? Is the tarball used, or the git checkout? Seems like you shouldn't need both. > +(define-public linux-libre-arm64-pinenote-source > + (source-with-patches linux-libre-arm64-pinenote-pristine-source > + (list %boot-logo-patch > + %linux-libre-arm-export-__sync_icache_dcach= e-patch > + (search-patch > +"linux-libre-arm64-pinenote-touchscreen-1.patch") > + (search-patch > +"linux-libre-arm64-pinenote-touchscreen-2.patch") > + (search-patch > +"linux-libre-arm64-pinenote-battery-level.patch") > + (search-patch > +"linux-libre-arm64-rockchip-add-hdmi-sound.patch") > + (search-patch > +"linux-libre-arm64-pinenote-defconfig.patch") > + (search-patch > +"linux-libre-arm64-pinenote-dtsi.patch") > + (search-patch > +"linux-libre-arm64-pinenote-ebc-patches.patch")))) > + Maybe use: (search-patches "A.patch" "B.patch" ... "N.patch") Though you may have to append two lists together for that to work. As to how... ask someone who understands guile. :) Also wondering if there is a branch with all the patches you need already applied, since you're using a separate source origin already... > +(define-public linux-libre-arm64-pinenote > + (make-linux-libre* linux-libre-version > + linux-libre-gnu-revision > + linux-libre-arm64-pinenote-source > + '("aarch64-linux") > + #:defconfig "pinenote_defconfig" > + #:extra-options > + %default-extra-linux-options)) You might want to not assume to use the same versions as (linux-libre-version, linux-libre-gnu-revision), as they might change out from under you... those were recently updated to 5.18.x ... instead just pick the versions relevent to the upstream source. Hope that's helpful, good luck and thanks for working on adding support for this very interesting platform! live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYr3zpAAKCRDcUY/If5cW qk+/AQC35z2kx4sAmGB1pQBMFxadmlRFqC5oVA5h94dBXv77WwEAwlbmGzuwkXAo 7PPSr6FjDS/2KfbB5iMPmIGdKrcSvAY= =13Rk -----END PGP SIGNATURE----- --=-=-=--