* [bug#74849] [PATCH 1/6] gnu: arm-trusted-firmware-rk3399: Reformat.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
@ 2024-12-13 12:25 ` Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 2/6] gnu: arm-trusted-firmware: Reformat Herman Rimm via Guix-patches via
` (6 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-13 12:25 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (arm-trusted-firmware-rk3399)[name]: Remove.
[native-inputs]: Reformat.
Change-Id: Ib44246f0c3929fcf8c6f625df53e3a307fc87595
---
gnu/packages/firmware.scm | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 868be8488c..2750bab66d 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1175,12 +1175,9 @@ (define-public arm-trusted-firmware-rk3399
(let ((base (make-arm-trusted-firmware "rk3399")))
(package
(inherit base)
- (name "arm-trusted-firmware-rk3399")
- (native-inputs
- (modify-inputs (package-native-inputs base)
- (prepend
- (cross-gcc "arm-none-eabi")
- (cross-binutils "arm-none-eabi")))))))
+ (native-inputs (modify-inputs (package-native-inputs base)
+ (prepend (cross-gcc "arm-none-eabi")
+ (cross-binutils "arm-none-eabi")))))))
(define-public arm-trusted-firmware-imx8mq
(let ((base (make-arm-trusted-firmware "imx8mq")))
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 2/6] gnu: arm-trusted-firmware: Reformat.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 1/6] gnu: arm-trusted-firmware-rk3399: Reformat Herman Rimm via Guix-patches via
@ 2024-12-13 12:25 ` Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 3/6] import: utils: Move guix-name to (guix utils) Herman Rimm via Guix-patches via
` (5 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-13 12:25 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (arm-trusted-firmware)[source]: Use modules.
[synopsis]: Mention supported architectures.
[description]: Fix "ARMv7A" typo. Remove newline.
Change-Id: I52d1a02f27e1c8ebbe5b48ea9a69e4c008ff5b9c
---
gnu/packages/firmware.scm | 104 ++++++++++++++++++--------------------
1 file changed, 49 insertions(+), 55 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 2750bab66d..ff083a2c6f 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1099,68 +1099,62 @@ (define-public ovmf
(define* (make-arm-trusted-firmware platform
#:key (triplet "aarch64-linux-gnu"))
- (let ((native-build? (lambda ()
- ;; Note: %current-system is a *triplet*, unlike its
- ;; name would suggest.
- (or (not triplet) ;disable cross-compilation
- (string=? (%current-system)
- (gnu-triplet->nix-system triplet))))))
- (package
- (name (string-append "arm-trusted-firmware-" platform))
- (version "2.9")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- ;; There are only GitHub generated release snapshots.
- (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
- (commit (string-append "v" version))))
- (file-name (git-file-name "arm-trusted-firmware" version))
- (sha256
- (base32
- "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
- (snippet
- #~(begin
- (use-modules (guix build utils))
- ;; Remove binary blobs which do not contain source or proper
- ;; license.
+ (define (native-build?)
+ "Return #t if the host and target platforms differ."
+ (or (not triplet)
+ ;;%current-system is a *triplet*, unlike its name would suggest.
+ (string=? (%current-system) (gnu-triplet->nix-system triplet))))
+ (package
+ (name (string-append "arm-trusted-firmware-" platform))
+ (version "2.9")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url (string-append "https://git.trustedfirmware.org"
+ "/TF-A/trusted-firmware-a.git/"))
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "arm-trusted-firmware" version))
+ (sha256
+ (base32 "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+ (modules '((guix build utils)))
+ ;; Remove binary blobs: they don't reference a source or license.
+ (snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:target (and (not (native-build?)) triplet)
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure) ;no configure script
+ (replace 'install
+ (lambda _
(for-each (lambda (file)
- (delete-file file))
- (find-files "." "\\.bin$"))))))
- (build-system gnu-build-system)
- (arguments
- (list
- #:target (and (not (native-build?)) triplet)
- #:phases
- #~(modify-phases %standard-phases
- (delete 'configure) ;no configure script
- (replace 'install
- (lambda _
- (for-each (lambda (file)
- (install-file file #$output))
- (find-files "." "\\.(bin|elf)$")))))
- #:make-flags #~(list (string-append "PLAT=" #$platform)
- #$@(if (not (native-build?))
- (list (string-append "CROSS_COMPILE=" triplet "-"))
- '())
- "DEBUG=1")
- #:tests? #f)) ;no test suite
- (home-page "https://www.trustedfirmware.org/")
- (synopsis "Implementation of \"secure world software\"")
- (description
- "ARM Trusted Firmware provides a reference implementation of secure world
-software for ARMv7A and ARMv8-A, including a Secure Monitor executing at
-@dfn{Exception Level 3} (EL3). It implements various ARM interface standards,
-such as:
+ (install-file file #$output))
+ (find-files "." "\\.(bin|elf)$")))))
+ #:make-flags
+ #~(list (string-append "PLAT=" #$platform)
+ #$@(if (not (native-build?))
+ (list (string-append "CROSS_COMPILE=" triplet "-"))
+ '())
+ "DEBUG=1")
+ #:tests? #f)) ;no test suite
+ (home-page "https://www.trustedfirmware.org/")
+ (synopsis "Secure world software for ARMv7-A and ARMv8-A")
+ (description
+ "ARM Trusted Firmware provides a reference implementation of secure
+world software for ARMv7-A and ARMv8-A, including a Secure Monitor
+executing at @dfn{Exception Level 3} (EL3). It implements various ARM
+interface standards, such as:
@enumerate
@item The Power State Coordination Interface (PSCI)
@item Trusted Board Boot Requirements (TBBR, ARM DEN0006C-1)
@item SMC Calling Convention
@item System Control and Management Interface
@item Software Delegated Exception Interface (SDEI)
-@end enumerate\n")
- (license (list license:bsd-3
- license:bsd-2))))) ; libfdt
+@end enumerate")
+ (license (list license:bsd-3
+ license:bsd-2)))) ; libfdt
(define-public arm-trusted-firmware-sun50i-a64
(let ((base (make-arm-trusted-firmware "sun50i_a64")))
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 3/6] import: utils: Move guix-name to (guix utils).
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 1/6] gnu: arm-trusted-firmware-rk3399: Reformat Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 2/6] gnu: arm-trusted-firmware: Reformat Herman Rimm via Guix-patches via
@ 2024-12-13 12:25 ` Herman Rimm via Guix-patches via
2024-12-17 13:52 ` Ludovic Courtès
2024-12-13 12:25 ` [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name Herman Rimm via Guix-patches via
` (4 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-13 12:25 UTC (permalink / raw)
To: 74849
Cc: Andreas Enge, Andrew Tropin, Christopher Baines, Josselin Poiret,
Katherine Cox-Buday, Liliana Marie Prikler, Ludovic Courtès,
Mathieu Othacehe, Nicolas Goaziou, Simon Tournier,
Tobias Geerinckx-Rice
* guix/import/elpa.scm: Import (guix utils).
* guix/import/texlive.scm (guix-name): Remove.
* guix/import/utils.scm (guix-name): Move to ...
* guix/utils.scm (guix-name): ... here.
Change-Id: If56a452f64ed06c8bb06a96a283a5067cb54d602
---
guix/import/elpa.scm | 1 +
guix/import/texlive.scm | 10 +---------
guix/import/utils.scm | 10 ----------
guix/utils.scm | 9 +++++++++
4 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 46b6dc98a2..11559097b5 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -44,6 +44,7 @@ (define-module (guix import elpa)
#:use-module (guix git)
#:use-module (guix hash)
#:use-module (guix store)
+ #:use-module ((guix utils) #:select (guix-name))
#:use-module (guix base32)
#:use-module (guix upstream)
#:use-module (guix packages)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 6d04cc25ee..b2e99c40f2 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -35,6 +35,7 @@ (define-module (guix import texlive)
#:use-module (guix store)
#:use-module (guix svn-download)
#:use-module (guix upstream)
+ #:use-module ((guix utils) #:select (guix-name))
#:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module (ice-9 popen)
@@ -334,15 +335,6 @@ (define string->license
((lst ...) `(list ,@(map string->license lst)))
(x `(error unknown-license ,x))))
-(define (guix-name name)
- "Return a Guix package name for a given Texlive package NAME."
- (string-append "texlive-"
- (string-map (match-lambda
- (#\_ #\-)
- (#\. #\-)
- (chr (char-downcase chr)))
- name)))
-
(define* (filter-depends depends #:optional texlive-only)
"Filter upstream package names DEPENDS to include only their equivalent Guix
package names, without \"texlive-\" prefix. When TEXLIVE-ONLY is true, ignore
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index ccf18a7bf9..610fe9970e 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -82,8 +82,6 @@ (define-module (guix import utils)
read-lines
chunk-lines
- guix-name
-
recursive-import))
(define (factorize-uri uri version)
@@ -609,14 +607,6 @@ (define* (chunk-lines lines #:optional (pred string-null?))
(reverse res)
(loop (cdr after) res))))))
-(define (guix-name prefix name)
- "Return a Guix package name for a given package name."
- (string-append prefix (string-map (match-lambda
- (#\_ #\-)
- (#\. #\-)
- (chr (char-downcase chr)))
- name)))
-
(define (topological-sort nodes
node-dependencies
node-name)
diff --git a/guix/utils.scm b/guix/utils.scm
index 537d0490e0..dfa8f0f19b 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -91,6 +91,7 @@ (define-module (guix utils)
%current-system
%current-target-system
package-name->name+version
+ guix-name
target-linux?
target-hurd?
system-hurd?
@@ -706,6 +707,14 @@ (define* (package-name->name+version spec
(idx (values (substring spec 0 idx)
(substring spec (1+ idx))))))
+(define (guix-name prefix name)
+ "Return a Guix package name for a given package name."
+ (string-append prefix (string-map (match-lambda
+ (#\_ #\-)
+ (#\. #\-)
+ (chr (char-downcase chr)))
+ name)))
+
(define* (target-linux? #:optional (target (or (%current-target-system)
(%current-system))))
"Does the operating system of TARGET use the Linux kernel?"
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 3/6] import: utils: Move guix-name to (guix utils).
2024-12-13 12:25 ` [bug#74849] [PATCH 3/6] import: utils: Move guix-name to (guix utils) Herman Rimm via Guix-patches via
@ 2024-12-17 13:52 ` Ludovic Courtès
0 siblings, 0 replies; 24+ messages in thread
From: Ludovic Courtès @ 2024-12-17 13:52 UTC (permalink / raw)
To: Herman Rimm
Cc: Josselin Poiret, Tobias Geerinckx-Rice, Simon Tournier, 74849,
Katherine Cox-Buday, Liliana Marie Prikler, Andrew Tropin,
Andreas Enge, Mathieu Othacehe, Christopher Baines,
Nicolas Goaziou
Herman Rimm <herman@rimm.ee> skribis:
> * guix/import/elpa.scm: Import (guix utils).
> * guix/import/texlive.scm (guix-name): Remove.
> * guix/import/utils.scm (guix-name): Move to ...
> * guix/utils.scm (guix-name): ... here.
>
> Change-Id: If56a452f64ed06c8bb06a96a283a5067cb54d602
LGTM! I let Vagrant & co. validate the bootloader side of things.
> +(define (guix-name prefix name)
> + "Return a Guix package name for a given package name."
> + (string-append prefix (string-map (match-lambda
> + (#\_ #\-)
> + (#\. #\-)
> + (chr (char-downcase chr)))
> + name)))
If it’s “promoted” to (guix utils), perhaps we could also rename it to
‘downstream-package-name’, but that can come in a separate commit.
Ludo’.
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
` (2 preceding siblings ...)
2024-12-13 12:25 ` [bug#74849] [PATCH 3/6] import: utils: Move guix-name to (guix utils) Herman Rimm via Guix-patches via
@ 2024-12-13 12:25 ` Herman Rimm via Guix-patches via
2024-12-15 8:04 ` Vagrant Cascadian
2024-12-13 12:25 ` [bug#74849] [PATCH 5/6] gnu: make-arm-trusted-firmware: Update to 2.12 Herman Rimm via Guix-patches via
` (3 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-13 12:25 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Use guix-name.
(arm-trusted-firmware-sun50i-a64): Return base package directly.
Change-Id: I23f05ac5e8e897037cd8d8afc4e747b05e56e32d
---
gnu/packages/firmware.scm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index ff083a2c6f..438b347dfb 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1105,7 +1105,7 @@ (define* (make-arm-trusted-firmware platform
;;%current-system is a *triplet*, unlike its name would suggest.
(string=? (%current-system) (gnu-triplet->nix-system triplet))))
(package
- (name (string-append "arm-trusted-firmware-" platform))
+ (name (guix-name "arm-trusted-firmware-" platform))
(version "2.9")
(source
(origin
@@ -1157,10 +1157,7 @@ (define* (make-arm-trusted-firmware platform
license:bsd-2)))) ; libfdt
(define-public arm-trusted-firmware-sun50i-a64
- (let ((base (make-arm-trusted-firmware "sun50i_a64")))
- (package
- (inherit base)
- (name "arm-trusted-firmware-sun50i-a64"))))
+ (make-arm-trusted-firmware "sun50i_a64"))
(define-public arm-trusted-firmware-rk3328
(make-arm-trusted-firmware "rk3328"))
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name.
2024-12-13 12:25 ` [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name Herman Rimm via Guix-patches via
@ 2024-12-15 8:04 ` Vagrant Cascadian
2024-12-15 23:05 ` Herman Rimm via Guix-patches via
0 siblings, 1 reply; 24+ messages in thread
From: Vagrant Cascadian @ 2024-12-15 8:04 UTC (permalink / raw)
To: Herman Rimm, 74849; +Cc: vagrant, Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 4729 bytes --]
On 2024-12-13, Herman Rimm wrote:
> * gnu/packages/firmware.scm (make-arm-trusted-firmware): Use guix-name.
> (arm-trusted-firmware-sun50i-a64): Return base package directly.
With this patch applied, I get:
error: guix-name: unbound variable
hint: Did you forget a `use-modules' form?
error: googletest: unbound variable
hint: Did you forget a `use-modules' form?
error: bzip2: unbound variable
hint: Did you forget a `use-modules' form?
error: xorg-server: unbound variable
hint: Did you forget a `use-modules' form?
error: libusb: unbound variable
hint: Did you forget a `use-modules' form?
error: zstd: unbound variable
hint: Did you forget a `use-modules' form?
error: gash: unbound variable
hint: Did you forget a `use-modules' form?
error: cross-gcc-toolchain: unbound variable
hint: Did you forget `(use-modules (gnu packages cross-base))'?
error: gnu-make: unbound variable
hint: Did you forget a `use-modules' form?
error: tar: unbound variable
hint: Did you forget a `use-modules' form?
error: cross-binutils: unbound variable
hint: Did you forget `(use-modules (gnu packages cross-base))'?
error: webrtc-audio-processing: unbound variable
hint: Did you forget a `use-modules' form?
Throw to key `unbound-variable' with args `("resolve-interface" "no binding `~A' in module ~A" (shared-mime-info (gnu packages freedeskt
op)) #f)'.
Backtrace:
In guix/status.scm:
839:4 19 (call-with-status-report _ _)
In ice-9/boot-9.scm:
1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
689:37 17 (thunk)
1330:8 16 (call-with-build-handler #<procedure ffff8ce3ea20 at g…> …)
In guix/scripts/build.scm:
646:2 15 (_)
695:42 14 (loop _ _ ())
In gnu/packages.scm: 511:2 13 (%find-package "arm-trusted-firmware-sun50i-a64" "arm-…" …)
391:6 12 (find-best-packages-by-name _ _)
321:56 11 (_ "arm-trusted-firmware-sun50i-a64" _)
In unknown file:
10 (force #<promise #<procedure ffff8db69440 at gnu/packag…>)
In gnu/packages.scm:
243:33 9 (fold-packages #<procedure ffff8c487750 at gnu/package…> …)
In guix/discovery.scm:
158:11 8 (all-modules _ #:warn _)
In srfi/srfi-1.scm:
460:18 7 (fold #<procedure ffff8ceb0500 at guix/discovery.scm:1…> …)
In guix/discovery.scm:
148:19 6 (_ _ ())
115:5 5 (scheme-modules _ _ #:warn _)
In srfi/srfi-1.scm:
691:23 4 (filter-map #<procedure ffff8ceb03a0 at guix/discove…> . #)
In guix/discovery.scm:
123:24 3 (_ . _)
In guix/ui.scm:
363:2 2 (report-unbound-variable-error _ #:frame _)
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern" (unbound-variable "resolve-interface" "no binding `~A' in module ~A" (shared-mime-info (gnu packages freedesktop)) #f))'.
>
> Change-Id: I23f05ac5e8e897037cd8d8afc4e747b05e56e32d
> ---
> gnu/packages/firmware.scm | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
> index ff083a2c6f..438b347dfb 100644
> --- a/gnu/packages/firmware.scm
> +++ b/gnu/packages/firmware.scm
> @@ -1105,7 +1105,7 @@ (define* (make-arm-trusted-firmware platform
> ;;%current-system is a *triplet*, unlike its name would suggest.
> (string=? (%current-system) (gnu-triplet->nix-system triplet))))
> (package
> - (name (string-append "arm-trusted-firmware-" platform))
> + (name (guix-name "arm-trusted-firmware-" platform))
> (version "2.9")
> (source
> (origin
> @@ -1157,10 +1157,7 @@ (define* (make-arm-trusted-firmware platform
> license:bsd-2)))) ; libfdt
>
> (define-public arm-trusted-firmware-sun50i-a64
> - (let ((base (make-arm-trusted-firmware "sun50i_a64")))
> - (package
> - (inherit base)
> - (name "arm-trusted-firmware-sun50i-a64"))))
> + (make-arm-trusted-firmware "sun50i_a64"))
>
> (define-public arm-trusted-firmware-rk3328
> (make-arm-trusted-firmware "rk3328"))
> --
> 2.45.2
I presume there is some module from which to import guix-name?
Without the patch applied, it gets further...
live well,
vagrant
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name.
2024-12-15 8:04 ` Vagrant Cascadian
@ 2024-12-15 23:05 ` Herman Rimm via Guix-patches via
2024-12-19 19:50 ` [bug#74849] fixed guix-name missing, but still fails on aarch64 Vagrant Cascadian
0 siblings, 1 reply; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-15 23:05 UTC (permalink / raw)
To: Vagrant Cascadian, 74849; +Cc: Efraim Flashner
On Sun, Dec 15, 2024 at 12:04:06AM -0800, Vagrant Cascadian wrote:
> On 2024-12-13, Herman Rimm wrote:
> > * gnu/packages/firmware.scm (make-arm-trusted-firmware): Use guix-name.
> > (arm-trusted-firmware-sun50i-a64): Return base package directly.
>
> With this patch applied, I get:
Is [PATCH 3/6] also applied? What command do you use?
Applying this patch series to 65892d9f20aa7a8649797507bb1ec867285083fb,
creating a branch and setting up a channel for it, running this command
on a x86_64 system succeeds:
guix time-machine -C channels.scm -- build arm-trusted-firmware-rk3399
> I presume there is some module from which to import guix-name?
(gnu packages firmware) imports (guix utils), [PATCH 3/6] moves
guix-name to (guix utils).
Cheers,
Herman
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] fixed guix-name missing, but still fails on aarch64
2024-12-15 23:05 ` Herman Rimm via Guix-patches via
@ 2024-12-19 19:50 ` Vagrant Cascadian
0 siblings, 0 replies; 24+ messages in thread
From: Vagrant Cascadian @ 2024-12-19 19:50 UTC (permalink / raw)
To: Herman Rimm, 74849; +Cc: Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]
On 2024-12-16, Herman Rimm wrote:
> On Sun, Dec 15, 2024 at 12:04:06AM -0800, Vagrant Cascadian wrote:
>> On 2024-12-13, Herman Rimm wrote:
>> > * gnu/packages/firmware.scm (make-arm-trusted-firmware): Use guix-name.
>> > (arm-trusted-firmware-sun50i-a64): Return base package directly.
>>
>> With this patch applied, I get:
>
> Is [PATCH 3/6] also applied? What command do you use?
Apparently not, because I did not receive the patch! I had noticed it
was missing, but misread your 0/6 comment about it...
Presumably etc/teams.scm did not include me in CC because it did not
match any of the file patterns I am on a team for... so I had to go
fishing in the bug tracker to get the full patch series. Kind of kills
most of the benefit of getting CCed on a patch series, in my opinion,
but that is outside the scope of this issue... :)
With 3/6 applied, it gets further... but still fails building on
aarch64-linux...
> Applying this patch series to 65892d9f20aa7a8649797507bb1ec867285083fb,
> creating a branch and setting up a channel for it, running this command
> on a x86_64 system succeeds:
>
> guix time-machine -C channels.scm -- build arm-trusted-firmware-rk3399
On aarch64-linux, with patches applied on top of
07b4b1d055c36c6c61d39273c26974771dbfe805, it still fails with errors
like this:
/gnu/store/d7q6yazfa1bxf4x7p9n3b99hn97q6bvw-bash-minimal-5.1.16/bin/sh: line 1: aarch64-none-elf-gcc: command not found
make: *** [lib/libfdt/libfdt.mk:23: /tmp/guix-build-arm-trusted-firmware-sun50i-a64-2.12.drv-0/source/build/sun50i_a64/debug/libfdt/fdt_strerror.o] Error 127
Maybe it builds correctly on x86_64, but given that most targets are
aarch64 targets, it ought to be able to build natively too.
As mentioned earlier, I would guess this is either a bug in upstream, or
in the way guix is passing a cross-toolchain of some kind...
live well,
vagrant
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 5/6] gnu: make-arm-trusted-firmware: Update to 2.12.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
` (3 preceding siblings ...)
2024-12-13 12:25 ` [bug#74849] [PATCH 4/6] gnu: make-arm-trusted-firmware: Use guix-name Herman Rimm via Guix-patches via
@ 2024-12-13 12:25 ` Herman Rimm via Guix-patches via
2024-12-13 12:25 ` [bug#74849] [PATCH 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build Herman Rimm via Guix-patches via
` (2 subsequent siblings)
7 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-13 12:25 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Update to 2.12.
[arguments]: Select correct objcopy and objdump variants.
[native-inputs]: Add python to avoid warnings.
Change-Id: Iccff10b16090913fe5c99491d8335f8ede09038c
---
gnu/packages/firmware.scm | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 438b347dfb..2e170fcc1d 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1106,7 +1106,7 @@ (define* (make-arm-trusted-firmware platform
(string=? (%current-system) (gnu-triplet->nix-system triplet))))
(package
(name (guix-name "arm-trusted-firmware-" platform))
- (version "2.9")
+ (version "2.12")
(source
(origin
(method git-fetch)
@@ -1116,7 +1116,7 @@ (define* (make-arm-trusted-firmware platform
(commit (string-append "v" version))))
(file-name (git-file-name "arm-trusted-firmware" version))
(sha256
- (base32 "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+ (base32 "18rzhygvq0afcylirq9yis3kaa1nli14k2jrm64ih85gz4nhl99w"))
(modules '((guix build utils)))
;; Remove binary blobs: they don't reference a source or license.
(snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
@@ -1126,7 +1126,14 @@ (define* (make-arm-trusted-firmware platform
#:target (and (not (native-build?)) triplet)
#:phases
#~(modify-phases %standard-phases
- (delete 'configure) ;no configure script
+ (replace 'configure ;no configure script
+ ;; Fix ATF commit ffb7742125def3e0acca4c7e4d3215af5ce25a31
+ (lambda _
+ (substitute* "plat/rockchip/rk3399/drivers/m0/Makefile"
+ (("-oc") "-oc-default"))
+ (substitute* "make_helpers/build_macros.mk"
+ (("-oc") "-oc-default")
+ (("-od") "-od-default"))))
(replace 'install
(lambda _
(for-each (lambda (file)
@@ -1139,6 +1146,7 @@ (define* (make-arm-trusted-firmware platform
'())
"DEBUG=1")
#:tests? #f)) ;no test suite
+ (native-inputs (list python))
(home-page "https://www.trustedfirmware.org/")
(synopsis "Secure world software for ARMv7-A and ARMv8-A")
(description
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
` (4 preceding siblings ...)
2024-12-13 12:25 ` [bug#74849] [PATCH 5/6] gnu: make-arm-trusted-firmware: Update to 2.12 Herman Rimm via Guix-patches via
@ 2024-12-13 12:25 ` Herman Rimm via Guix-patches via
2024-12-15 8:36 ` [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Vagrant Cascadian
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
7 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-13 12:25 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/local.mk (dist_patch_DATA): Register patches.
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Add make-flags
argument. [source]: Use patches.
(arm-trusted-firmware-imx8mq): Refactor.
* gnu/packages/patches/8mq-enable-imx_hab_handler.patch: Add file.
* gnu/packages/patches/8mq-move-stack-to-ocram_s.patch: Add file.
Change-Id: I8a72c1ceb5e00e113ae91a7c2f5b733d981185d6
---
gnu/local.mk | 2 +
gnu/packages/firmware.scm | 35 ++------
.../patches/8mq-enable-imx_hab_handler.patch | 36 ++++++++
.../patches/8mq-move-stack-to-ocram_s.patch | 88 +++++++++++++++++++
4 files changed, 134 insertions(+), 27 deletions(-)
create mode 100644 gnu/packages/patches/8mq-enable-imx_hab_handler.patch
create mode 100644 gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 39b142af5a..9b3a557dc4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -931,6 +931,8 @@ MODULES_NOT_COMPILED += \
patchdir = $(guilemoduledir)/%D%/packages/patches
dist_patch_DATA = \
+ %D%/packages/patches/8mq-enable-imx_hab_handler.patch \
+ %D%/packages/patches/8mq-move-stack-to-ocram_s.patch \
%D%/packages/patches/abcl-fix-build-xml.patch \
%D%/packages/patches/ableton-link-system-libraries-debian.patch \
%D%/packages/patches/abiword-explictly-cast-bools.patch \
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 2e170fcc1d..df7ad30590 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1097,8 +1097,9 @@ (define-public ovmf-riscv64
(define-public ovmf
(deprecated-package "ovmf" ovmf-x86-64))
-(define* (make-arm-trusted-firmware platform
- #:key (triplet "aarch64-linux-gnu"))
+(define* (make-arm-trusted-firmware platform #:key
+ (triplet "aarch64-linux-gnu")
+ (make-flags '("DEBUG=1")))
(define (native-build?)
"Return #t if the host and target platforms differ."
(or (not triplet)
@@ -1117,6 +1118,8 @@ (define* (make-arm-trusted-firmware platform
(file-name (git-file-name "arm-trusted-firmware" version))
(sha256
(base32 "18rzhygvq0afcylirq9yis3kaa1nli14k2jrm64ih85gz4nhl99w"))
+ (patches (search-patches "8mq-enable-imx_hab_handler.patch"
+ "8mq-move-stack-to-ocram_s.patch"))
(modules '((guix build utils)))
;; Remove binary blobs: they don't reference a source or license.
(snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
@@ -1144,7 +1147,7 @@ (define* (make-arm-trusted-firmware platform
#$@(if (not (native-build?))
(list (string-append "CROSS_COMPILE=" triplet "-"))
'())
- "DEBUG=1")
+ #$@make-flags)
#:tests? #f)) ;no test suite
(native-inputs (list python))
(home-page "https://www.trustedfirmware.org/")
@@ -1179,30 +1182,8 @@ (define-public arm-trusted-firmware-rk3399
(cross-binutils "arm-none-eabi")))))))
(define-public arm-trusted-firmware-imx8mq
- (let ((base (make-arm-trusted-firmware "imx8mq")))
- (package
- (inherit base)
- ;; Newer versions do not build and are essentially not supported
- ;; upstream.
- ;; XXX: explore using NXP maintained branch
- ;; https://github.com/nxp-imx/imx-atf
- (version "2.8")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- ;; There are only GitHub generated release snapshots.
- (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
- (commit (string-append "v" version))))
- (file-name (git-file-name "arm-trusted-firmware" version))
- (sha256
- (base32
- "0grq3fgxi9xhcljnhwlxjvdghyz15gaq50raw41xy4lm8rkmnzp3"))))
- (arguments
- (substitute-keyword-arguments (package-arguments base)
- ((#:make-flags flags ''())
- ;; Adding debug symbols causes the size to exceed limits.
- #~(delete "DEBUG=1" #$flags)))))))
+ ;; Remove debug symbols because of limited OCRAM.
+ (make-arm-trusted-firmware "imx8mq" #:make-flags '()))
(define make-crust-firmware
(mlambda (platform)
diff --git a/gnu/packages/patches/8mq-enable-imx_hab_handler.patch b/gnu/packages/patches/8mq-enable-imx_hab_handler.patch
new file mode 100644
index 0000000000..0ead773e4e
--- /dev/null
+++ b/gnu/packages/patches/8mq-enable-imx_hab_handler.patch
@@ -0,0 +1,36 @@
+From: Herman Rimm <herman@rimm.ee>
+Date: Sun, 8 Dec 2024 01:13:59 +0100
+Subject: [PATCH] fix(imx8m): 8mq: enable imx_hab_handler
+
+This completes af799814e2639a03b3453744f06a73e77cb66e86.
+
+Signed-off-by: Herman Rimm <herman@rimm.ee>
+---
+To submit to review.trustedfirmware.org, sign in with a GitHub account.
+
+diff --git a/plat/imx/common/include/imx_sip_svc.h b/plat/imx/common/include/imx_sip_svc.h
+index 404a82959..1948bc2eb 100644
+--- a/plat/imx/common/include/imx_sip_svc.h
++++ b/plat/imx/common/include/imx_sip_svc.h
+@@ -88,7 +88,8 @@ int imx_src_handler(uint32_t smc_fid, u_register_t x1,
+ u_register_t x2, u_register_t x3, void *handle);
+ #endif
+
+-#if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp)
++#if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp) || \
++ defined(PLAT_imx8mq)
+ int imx_hab_handler(uint32_t smc_fid, u_register_t x1,
+ u_register_t x2, u_register_t x3, u_register_t x4);
+ #endif
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index 73179dd0c..b1b954f1d 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -30,6 +30,7 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \
+ plat/imx/imx8m/imx8mq/imx8mq_psci.c \
+ plat/imx/imx8m/gpc_common.c \
+ plat/imx/imx8m/imx_aipstz.c \
++ plat/imx/imx8m/imx_hab.c \
+ plat/imx/imx8m/imx8m_caam.c \
+ plat/imx/imx8m/imx8m_ccm.c \
+ plat/imx/imx8m/imx8m_psci_common.c \
diff --git a/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch b/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
new file mode 100644
index 0000000000..1174881181
--- /dev/null
+++ b/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
@@ -0,0 +1,88 @@
+From: Jacky Bai <ping.bai@nxp.com>
+Date: Tue, 7 Jan 2020 15:48:36 +0800
+Subject: [PATCH] plat: imx8mq: move the stack & xlat table into ocram_s
+
+Move the stack & xlat table into ocram_s due to the
+ocram is not enough.
+
+Signed-off-by: Jacky Bai <ping.bai@nxp.com>
+Change-Id: I40a8e6c91f707598a38e420ff9f4be0c0a5dbf6c
+---
+Commit ae90cc5773abf5656e0e49f2ce746aa54f712b7b of:
+https://github.com/nxp-imx/imx-atf.git
+
+diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S
+index 867dedb99..8be52bc7c 100644
+--- a/bl31/bl31.ld.S
++++ b/bl31/bl31.ld.S
+@@ -25,6 +25,10 @@ MEMORY {
+ #else /* SEPARATE_RWDATA_REGION */
+ #define RAM_RW RAM
+ #endif /* SEPARATE_RWDATA_REGION */
++
++#if XLAT_TABLE_IN_OCRAM_S
++ RAM_S (rwx): ORIGIN = 0x180000, LENGTH = 0x8000
++#endif
+ }
+
+ #ifdef PLAT_EXTRA_LD_SCRIPT
+@@ -198,9 +202,13 @@ SECTIONS {
+ __NOBITS_START__ = .;
+ #endif /* SEPARATE_NOBITS_REGION */
+
++#if !STACK_IN_OCRAM_S
+ STACK_SECTION >NOBITS
++#endif
+ BSS_SECTION >NOBITS
++#if !XLAT_TABLE_IN_OCRAM_S
+ XLAT_TABLE_SECTION >NOBITS
++#endif
+
+ #if USE_COHERENT_MEM
+ /*
+@@ -253,4 +261,15 @@ SECTIONS {
+ /DISCARD/ : {
+ *(.dynsym .dynstr .hash .gnu.hash)
+ }
++
++#if XLAT_TABLE_IN_OCRAM_S
++ . = 0x180000;
++ XLAT_TABLE_SECTION >RAM_S
++
++#if STACK_IN_OCRAM_S
++ STACK_SECTION >RAM_S
++#endif
++
++ASSERT(. <= OCRAM_S_LIMIT, "OCRAM_S limit has been exceeded.")
++#endif
+ }
+diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+index 70c2def7d..ddff0925c 100644
+--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+@@ -48,6 +48,7 @@ static uint8_t mmio_read_8_ldrb(uintptr_t address)
+ static const mmap_region_t imx_mmap[] = {
+ MAP_REGION_FLAT(GPV_BASE, GPV_SIZE, MT_DEVICE | MT_RW), /* GPV map */
+ MAP_REGION_FLAT(IMX_ROM_BASE, IMX_ROM_SIZE, MT_MEMORY | MT_RO), /* ROM map */
++ MAP_REGION_FLAT(OCRAM_S_BASE, OCRAM_S_SIZE, MT_MEMORY | MT_RW), /* ROM map */
+ MAP_REGION_FLAT(IMX_AIPS_BASE, IMX_AIPS_SIZE, MT_DEVICE | MT_RW), /* AIPS map */
+ MAP_REGION_FLAT(IMX_GIC_BASE, IMX_GIC_SIZE, MT_DEVICE | MT_RW), /* GIC map */
+ MAP_REGION_FLAT(IMX_DDRPHY_BASE, IMX_DDR_IPS_SIZE, MT_DEVICE | MT_RW), /* DDRMIX map */
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index 73179dd0c..20a73d691 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -45,7 +45,12 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \
+ ${XLAT_TABLES_LIB_SRCS} \
+ ${IMX_GIC_SOURCES}
+
+-ENABLE_PIE := 1
++XLAT_TABLE_IN_OCRAM_S := 1
++STACK_IN_OCRAM_S := 1
++
++$(eval $(call add_define,XLAT_TABLE_IN_OCRAM_S))
++$(eval $(call add_define,STACK_IN_OCRAM_S))
++
+ USE_COHERENT_MEM := 1
+ RESET_TO_BL31 := 1
+ A53_DISABLE_NON_TEMPORAL_HINT := 0
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
` (5 preceding siblings ...)
2024-12-13 12:25 ` [bug#74849] [PATCH 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build Herman Rimm via Guix-patches via
@ 2024-12-15 8:36 ` Vagrant Cascadian
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
7 siblings, 0 replies; 24+ messages in thread
From: Vagrant Cascadian @ 2024-12-15 8:36 UTC (permalink / raw)
To: Herman Rimm, 74849; +Cc: Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 2568 bytes --]
On 2024-12-13, Herman Rimm wrote:
> I assume the change to GCC 14 caused arm-trusted-firmware-imx8mq to
> fail. The last patch makes it build again, with a commit (patch) from
> https://github.com/nxp-imx/imx-atf.git.
>
> I think we should verify that boards using arm-trusted-firmware-imx8mq
> would still boot, but there aren't any U-Boot packages that use it.
It is debateable weather arm-trusted-firmware-imx8mq will be useable;
the corresponding u-boot builds depend on binary blobs for DDR
training. It might be reasonable to remove the imx8mq
arm-trusted-firmware variant entirely.
With this patch series applied (and with the guix-name patch reverted),
I have been unable to build arm-trusted-firmware for rk3328, rk3399,
imx8mq, or sun50i-a64. They all fail with similar errors:
starting phase `build'
MD /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/libfdt
MD /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/lib
MD /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/libc
Building rk3328
MD /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/bl31
MD /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/bl31/bl31
CC lib/libfdt/fdt.c
CC lib/libfdt/fdt_addresses.c
make: aarch64-none-elf-gcc: No such file or directory
make: *** [lib/libfdt/libfdt.mk:23: /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/libfdt/fdt.o] Error 127
make: *** Waiting for unfinished jobs....
make: aarch64-none-elf-gcc: No such file or directory
make: *** [lib/libfdt/libfdt.mk:23: /tmp/guix-build-arm-trusted-firmware-rk3328-2.12.drv-0/source/build/rk3328/debug/libfdt/fdt_addresses.o] Error 127
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "6" "PLAT=rk3328" "DEBUG=1") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 1.3 seconds
command "make" "-j" "6" "PLAT=rk3328" "DEBUG=1" failed with status 2
build process 8 exited with status 256
builder for `/gnu/store/yx31pv6xahz3q74h9dirnyrf31446cpl-arm-trusted-firmware-rk3328-2.12.drv' failed with exit code 1
build of /gnu/store/yx31pv6xahz3q74h9dirnyrf31446cpl-arm-trusted-firmware-rk3328-2.12.drv failed
I am guessing something broke native building, and people have only been
testing cross-building? Though they still build correctly on the older
arm-trusted-firmware on master.
live well,
vagrant
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 0/6] Update ARM Trusted Firmware.
2024-12-13 12:23 [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Herman Rimm via Guix-patches via
` (6 preceding siblings ...)
2024-12-15 8:36 ` [bug#74849] [PATCH 0/6] Update ARM Trusted Firmware Vagrant Cascadian
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 1/6] gnu: arm-trusted-firmware-rk3399: Reformat Herman Rimm via Guix-patches via
` (6 more replies)
7 siblings, 7 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
Hello,
This revision configures the ARM Trusted Firmware differently when doing
a native build, which should fix the 'aarch64-none-elf-gcc' errors.
I will give the guix-name procedure a more appropriate name in another
patch (series).
Cheers,
Herman
Herman Rimm (6):
gnu: arm-trusted-firmware-rk3399: Reformat.
gnu: arm-trusted-firmware: Reformat.
import: utils: Move guix-name to (guix utils).
gnu: make-arm-trusted-firmware: Use guix-name.
gnu: make-arm-trusted-firmware: Update to 2.12.
gnu: arm-trusted-firmware-imx8mq: Fix build.
gnu/local.mk | 2 +
gnu/packages/firmware.scm | 160 ++++++++----------
.../patches/8mq-enable-imx_hab_handler.patch | 36 ++++
.../patches/8mq-move-stack-to-ocram_s.patch | 88 ++++++++++
guix/import/elpa.scm | 1 +
guix/import/texlive.scm | 10 +-
guix/import/utils.scm | 10 --
guix/utils.scm | 9 +
8 files changed, 206 insertions(+), 110 deletions(-)
create mode 100644 gnu/packages/patches/8mq-enable-imx_hab_handler.patch
create mode 100644 gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
base-commit: 07b4b1d055c36c6c61d39273c26974771dbfe805
--
2.45.2
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 1/6] gnu: arm-trusted-firmware-rk3399: Reformat.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 2/6] gnu: arm-trusted-firmware: Reformat Herman Rimm via Guix-patches via
` (5 subsequent siblings)
6 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (arm-trusted-firmware-rk3399)[name]: Remove.
[native-inputs]: Reformat.
Change-Id: Ib44246f0c3929fcf8c6f625df53e3a307fc87595
---
gnu/packages/firmware.scm | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 15734b8f9a..8b1873be38 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1177,12 +1177,9 @@ (define-public arm-trusted-firmware-rk3399
(let ((base (make-arm-trusted-firmware "rk3399")))
(package
(inherit base)
- (name "arm-trusted-firmware-rk3399")
- (native-inputs
- (modify-inputs (package-native-inputs base)
- (prepend
- (cross-gcc "arm-none-eabi")
- (cross-binutils "arm-none-eabi")))))))
+ (native-inputs (modify-inputs (package-native-inputs base)
+ (prepend (cross-gcc "arm-none-eabi")
+ (cross-binutils "arm-none-eabi")))))))
(define-public arm-trusted-firmware-imx8mq
(let ((base (make-arm-trusted-firmware "imx8mq")))
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 2/6] gnu: arm-trusted-firmware: Reformat.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 1/6] gnu: arm-trusted-firmware-rk3399: Reformat Herman Rimm via Guix-patches via
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
2024-12-19 23:34 ` Vagrant Cascadian
2024-12-19 22:10 ` [bug#74849] [PATCH v2 3/6] import: utils: Move guix-name to (guix utils) Herman Rimm via Guix-patches via
` (4 subsequent siblings)
6 siblings, 1 reply; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (arm-trusted-firmware)[source]: Use modules.
[synopsis]: Mention supported architectures.
[description]: Fix "ARMv7A" typo. Remove newline.
Change-Id: I52d1a02f27e1c8ebbe5b48ea9a69e4c008ff5b9c
---
gnu/packages/firmware.scm | 104 ++++++++++++++++++--------------------
1 file changed, 49 insertions(+), 55 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 8b1873be38..758a10d7d2 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1101,68 +1101,62 @@ (define-public ovmf
(define* (make-arm-trusted-firmware platform
#:key (triplet "aarch64-linux-gnu"))
- (let ((native-build? (lambda ()
- ;; Note: %current-system is a *triplet*, unlike its
- ;; name would suggest.
- (or (not triplet) ;disable cross-compilation
- (string=? (%current-system)
- (gnu-triplet->nix-system triplet))))))
- (package
- (name (string-append "arm-trusted-firmware-" platform))
- (version "2.9")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- ;; There are only GitHub generated release snapshots.
- (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
- (commit (string-append "v" version))))
- (file-name (git-file-name "arm-trusted-firmware" version))
- (sha256
- (base32
- "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
- (snippet
- #~(begin
- (use-modules (guix build utils))
- ;; Remove binary blobs which do not contain source or proper
- ;; license.
+ (define (native-build?)
+ "Return #t if the host and target platforms differ."
+ (or (not triplet)
+ ;;%current-system is a *triplet*, unlike its name would suggest.
+ (string=? (%current-system) (gnu-triplet->nix-system triplet))))
+ (package
+ (name (string-append "arm-trusted-firmware-" platform))
+ (version "2.9")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url (string-append "https://git.trustedfirmware.org"
+ "/TF-A/trusted-firmware-a.git/"))
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "arm-trusted-firmware" version))
+ (sha256
+ (base32 "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+ (modules '((guix build utils)))
+ ;; Remove binary blobs: they don't reference a source or license.
+ (snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:target (and (not (native-build?)) triplet)
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure) ;no configure script
+ (replace 'install
+ (lambda _
(for-each (lambda (file)
- (delete-file file))
- (find-files "." "\\.bin$"))))))
- (build-system gnu-build-system)
- (arguments
- (list
- #:target (and (not (native-build?)) triplet)
- #:phases
- #~(modify-phases %standard-phases
- (delete 'configure) ;no configure script
- (replace 'install
- (lambda _
- (for-each (lambda (file)
- (install-file file #$output))
- (find-files "." "\\.(bin|elf)$")))))
- #:make-flags #~(list (string-append "PLAT=" #$platform)
- #$@(if (not (native-build?))
- (list (string-append "CROSS_COMPILE=" triplet "-"))
- '())
- "DEBUG=1")
- #:tests? #f)) ;no test suite
- (home-page "https://www.trustedfirmware.org/")
- (synopsis "Implementation of \"secure world software\"")
- (description
- "ARM Trusted Firmware provides a reference implementation of secure world
-software for ARMv7A and ARMv8-A, including a Secure Monitor executing at
-@dfn{Exception Level 3} (EL3). It implements various ARM interface standards,
-such as:
+ (install-file file #$output))
+ (find-files "." "\\.(bin|elf)$")))))
+ #:make-flags
+ #~(list (string-append "PLAT=" #$platform)
+ #$@(if (not (native-build?))
+ (list (string-append "CROSS_COMPILE=" triplet "-"))
+ '())
+ "DEBUG=1")
+ #:tests? #f)) ;no test suite
+ (home-page "https://www.trustedfirmware.org/")
+ (synopsis "Secure world software for ARMv7-A and ARMv8-A")
+ (description
+ "ARM Trusted Firmware provides a reference implementation of secure
+world software for ARMv7-A and ARMv8-A, including a Secure Monitor
+executing at @dfn{Exception Level 3} (EL3). It implements various ARM
+interface standards, such as:
@enumerate
@item The Power State Coordination Interface (PSCI)
@item Trusted Board Boot Requirements (TBBR, ARM DEN0006C-1)
@item SMC Calling Convention
@item System Control and Management Interface
@item Software Delegated Exception Interface (SDEI)
-@end enumerate\n")
- (license (list license:bsd-3
- license:bsd-2))))) ; libfdt
+@end enumerate")
+ (license (list license:bsd-3
+ license:bsd-2)))) ; libfdt
(define-public arm-trusted-firmware-sun50i-a64
(let ((base (make-arm-trusted-firmware "sun50i_a64")))
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 2/6] gnu: arm-trusted-firmware: Reformat.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 2/6] gnu: arm-trusted-firmware: Reformat Herman Rimm via Guix-patches via
@ 2024-12-19 23:34 ` Vagrant Cascadian
2024-12-20 20:11 ` Herman Rimm via Guix-patches via
0 siblings, 1 reply; 24+ messages in thread
From: Vagrant Cascadian @ 2024-12-19 23:34 UTC (permalink / raw)
To: Herman Rimm, 74849; +Cc: Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 6477 bytes --]
On 2024-12-19, Herman Rimm wrote:
> * gnu/packages/firmware.scm (arm-trusted-firmware)[source]: Use modules.
What is this referring to? What modules that were not used before?
> [synopsis]: Mention supported architectures.
> [description]: Fix "ARMv7A" typo. Remove newline.
These are good, thanks!
What I do not see mentioned is that it reworks how "native-build?" is
used a bit. Could that be split in a separate patch?
live well,
vagrant
> Change-Id: I52d1a02f27e1c8ebbe5b48ea9a69e4c008ff5b9c
> ---
> gnu/packages/firmware.scm | 104 ++++++++++++++++++--------------------
> 1 file changed, 49 insertions(+), 55 deletions(-)
>
> diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
> index 8b1873be38..758a10d7d2 100644
> --- a/gnu/packages/firmware.scm
> +++ b/gnu/packages/firmware.scm
> @@ -1101,68 +1101,62 @@ (define-public ovmf
>
> (define* (make-arm-trusted-firmware platform
> #:key (triplet "aarch64-linux-gnu"))
> - (let ((native-build? (lambda ()
> - ;; Note: %current-system is a *triplet*, unlike its
> - ;; name would suggest.
> - (or (not triplet) ;disable cross-compilation
> - (string=? (%current-system)
> - (gnu-triplet->nix-system triplet))))))
> - (package
> - (name (string-append "arm-trusted-firmware-" platform))
> - (version "2.9")
> - (source
> - (origin
> - (method git-fetch)
> - (uri (git-reference
> - ;; There are only GitHub generated release snapshots.
> - (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
> - (commit (string-append "v" version))))
> - (file-name (git-file-name "arm-trusted-firmware" version))
> - (sha256
> - (base32
> - "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
> - (snippet
> - #~(begin
> - (use-modules (guix build utils))
> - ;; Remove binary blobs which do not contain source or proper
> - ;; license.
> + (define (native-build?)
> + "Return #t if the host and target platforms differ."
> + (or (not triplet)
> + ;;%current-system is a *triplet*, unlike its name would suggest.
> + (string=? (%current-system) (gnu-triplet->nix-system triplet))))
> + (package
> + (name (string-append "arm-trusted-firmware-" platform))
> + (version "2.9")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url (string-append "https://git.trustedfirmware.org"
> + "/TF-A/trusted-firmware-a.git/"))
> + (commit (string-append "v" version))))
> + (file-name (git-file-name "arm-trusted-firmware" version))
> + (sha256
> + (base32 "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
> + (modules '((guix build utils)))
> + ;; Remove binary blobs: they don't reference a source or license.
> + (snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
> + (build-system gnu-build-system)
> + (arguments
> + (list
> + #:target (and (not (native-build?)) triplet)
> + #:phases
> + #~(modify-phases %standard-phases
> + (delete 'configure) ;no configure script
> + (replace 'install
> + (lambda _
> (for-each (lambda (file)
> - (delete-file file))
> - (find-files "." "\\.bin$"))))))
> - (build-system gnu-build-system)
> - (arguments
> - (list
> - #:target (and (not (native-build?)) triplet)
> - #:phases
> - #~(modify-phases %standard-phases
> - (delete 'configure) ;no configure script
> - (replace 'install
> - (lambda _
> - (for-each (lambda (file)
> - (install-file file #$output))
> - (find-files "." "\\.(bin|elf)$")))))
> - #:make-flags #~(list (string-append "PLAT=" #$platform)
> - #$@(if (not (native-build?))
> - (list (string-append "CROSS_COMPILE=" triplet "-"))
> - '())
> - "DEBUG=1")
> - #:tests? #f)) ;no test suite
> - (home-page "https://www.trustedfirmware.org/")
> - (synopsis "Implementation of \"secure world software\"")
> - (description
> - "ARM Trusted Firmware provides a reference implementation of secure world
> -software for ARMv7A and ARMv8-A, including a Secure Monitor executing at
> -@dfn{Exception Level 3} (EL3). It implements various ARM interface standards,
> -such as:
> + (install-file file #$output))
> + (find-files "." "\\.(bin|elf)$")))))
> + #:make-flags
> + #~(list (string-append "PLAT=" #$platform)
> + #$@(if (not (native-build?))
> + (list (string-append "CROSS_COMPILE=" triplet "-"))
> + '())
> + "DEBUG=1")
> + #:tests? #f)) ;no test suite
> + (home-page "https://www.trustedfirmware.org/")
> + (synopsis "Secure world software for ARMv7-A and ARMv8-A")
> + (description
> + "ARM Trusted Firmware provides a reference implementation of secure
> +world software for ARMv7-A and ARMv8-A, including a Secure Monitor
> +executing at @dfn{Exception Level 3} (EL3). It implements various ARM
> +interface standards, such as:
> @enumerate
> @item The Power State Coordination Interface (PSCI)
> @item Trusted Board Boot Requirements (TBBR, ARM DEN0006C-1)
> @item SMC Calling Convention
> @item System Control and Management Interface
> @item Software Delegated Exception Interface (SDEI)
> -@end enumerate\n")
> - (license (list license:bsd-3
> - license:bsd-2))))) ; libfdt
> +@end enumerate")
> + (license (list license:bsd-3
> + license:bsd-2)))) ; libfdt
>
> (define-public arm-trusted-firmware-sun50i-a64
> (let ((base (make-arm-trusted-firmware "sun50i_a64")))
> --
> 2.45.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 2/6] gnu: arm-trusted-firmware: Reformat.
2024-12-19 23:34 ` Vagrant Cascadian
@ 2024-12-20 20:11 ` Herman Rimm via Guix-patches via
0 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-20 20:11 UTC (permalink / raw)
To: Vagrant Cascadian; +Cc: 74849
Hi,
On Thu, Dec 19, 2024 at 03:34:23PM -0800, Vagrant Cascadian wrote:
> What is this referring to? What modules that were not used before?
It is referring to the modules field of the origin record.
> What I do not see mentioned is that it reworks how "native-build?" is
> used a bit. Could that be split in a separate patch?
I'll submit whitespace changes separately in future patch series.
Regarding the (i.MX 8MQ) ATF patches, I seem to need a GitHub account to
submit them upstream, per [1]. I don't agree to the registration terms.
Cheers,
Herman
[1]: https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.html
^ permalink raw reply [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 3/6] import: utils: Move guix-name to (guix utils).
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 1/6] gnu: arm-trusted-firmware-rk3399: Reformat Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 2/6] gnu: arm-trusted-firmware: Reformat Herman Rimm via Guix-patches via
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
[not found] ` <87cyhmmrot.fsf@nicolasgoaziou.fr>
2024-12-19 22:10 ` [bug#74849] [PATCH v2 4/6] gnu: make-arm-trusted-firmware: Use guix-name Herman Rimm via Guix-patches via
` (3 subsequent siblings)
6 siblings, 1 reply; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849
Cc: Andreas Enge, Andrew Tropin, Christopher Baines, Efraim Flashner,
Josselin Poiret, Katherine Cox-Buday, Liliana Marie Prikler,
Ludovic Courtès, Mathieu Othacehe, Nicolas Goaziou,
Simon Tournier, Tobias Geerinckx-Rice, Vagrant Cascadian
* guix/import/elpa.scm: Import (guix utils).
* guix/import/texlive.scm (guix-name): Remove.
* guix/import/utils.scm (guix-name): Move to ...
* guix/utils.scm (guix-name): ... here.
Change-Id: If56a452f64ed06c8bb06a96a283a5067cb54d602
---
guix/import/elpa.scm | 1 +
guix/import/texlive.scm | 10 +---------
guix/import/utils.scm | 10 ----------
guix/utils.scm | 9 +++++++++
4 files changed, 11 insertions(+), 19 deletions(-)
diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 46b6dc98a2..11559097b5 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -44,6 +44,7 @@ (define-module (guix import elpa)
#:use-module (guix git)
#:use-module (guix hash)
#:use-module (guix store)
+ #:use-module ((guix utils) #:select (guix-name))
#:use-module (guix base32)
#:use-module (guix upstream)
#:use-module (guix packages)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 6d04cc25ee..b2e99c40f2 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -35,6 +35,7 @@ (define-module (guix import texlive)
#:use-module (guix store)
#:use-module (guix svn-download)
#:use-module (guix upstream)
+ #:use-module ((guix utils) #:select (guix-name))
#:use-module (ice-9 ftw)
#:use-module (ice-9 match)
#:use-module (ice-9 popen)
@@ -334,15 +335,6 @@ (define string->license
((lst ...) `(list ,@(map string->license lst)))
(x `(error unknown-license ,x))))
-(define (guix-name name)
- "Return a Guix package name for a given Texlive package NAME."
- (string-append "texlive-"
- (string-map (match-lambda
- (#\_ #\-)
- (#\. #\-)
- (chr (char-downcase chr)))
- name)))
-
(define* (filter-depends depends #:optional texlive-only)
"Filter upstream package names DEPENDS to include only their equivalent Guix
package names, without \"texlive-\" prefix. When TEXLIVE-ONLY is true, ignore
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index e45c8dfb20..058d2bc094 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -82,8 +82,6 @@ (define-module (guix import utils)
read-lines
chunk-lines
- guix-name
-
recursive-import))
(define (factorize-uri uri version)
@@ -612,14 +610,6 @@ (define* (chunk-lines lines #:optional (pred string-null?))
(reverse res)
(loop (cdr after) res))))))
-(define (guix-name prefix name)
- "Return a Guix package name for a given package name."
- (string-append prefix (string-map (match-lambda
- (#\_ #\-)
- (#\. #\-)
- (chr (char-downcase chr)))
- name)))
-
(define (topological-sort nodes
node-dependencies
node-name)
diff --git a/guix/utils.scm b/guix/utils.scm
index 537d0490e0..dfa8f0f19b 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -91,6 +91,7 @@ (define-module (guix utils)
%current-system
%current-target-system
package-name->name+version
+ guix-name
target-linux?
target-hurd?
system-hurd?
@@ -706,6 +707,14 @@ (define* (package-name->name+version spec
(idx (values (substring spec 0 idx)
(substring spec (1+ idx))))))
+(define (guix-name prefix name)
+ "Return a Guix package name for a given package name."
+ (string-append prefix (string-map (match-lambda
+ (#\_ #\-)
+ (#\. #\-)
+ (chr (char-downcase chr)))
+ name)))
+
(define* (target-linux? #:optional (target (or (%current-target-system)
(%current-system))))
"Does the operating system of TARGET use the Linux kernel?"
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 4/6] gnu: make-arm-trusted-firmware: Use guix-name.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
` (2 preceding siblings ...)
2024-12-19 22:10 ` [bug#74849] [PATCH v2 3/6] import: utils: Move guix-name to (guix utils) Herman Rimm via Guix-patches via
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 5/6] gnu: make-arm-trusted-firmware: Update to 2.12 Herman Rimm via Guix-patches via
` (2 subsequent siblings)
6 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Use guix-name.
(arm-trusted-firmware-sun50i-a64): Return base package directly.
Change-Id: I23f05ac5e8e897037cd8d8afc4e747b05e56e32d
---
gnu/packages/firmware.scm | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 758a10d7d2..3e76681c66 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1107,7 +1107,7 @@ (define* (make-arm-trusted-firmware platform
;;%current-system is a *triplet*, unlike its name would suggest.
(string=? (%current-system) (gnu-triplet->nix-system triplet))))
(package
- (name (string-append "arm-trusted-firmware-" platform))
+ (name (guix-name "arm-trusted-firmware-" platform))
(version "2.9")
(source
(origin
@@ -1159,10 +1159,7 @@ (define* (make-arm-trusted-firmware platform
license:bsd-2)))) ; libfdt
(define-public arm-trusted-firmware-sun50i-a64
- (let ((base (make-arm-trusted-firmware "sun50i_a64")))
- (package
- (inherit base)
- (name "arm-trusted-firmware-sun50i-a64"))))
+ (make-arm-trusted-firmware "sun50i_a64"))
(define-public arm-trusted-firmware-rk3328
(make-arm-trusted-firmware "rk3328"))
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 5/6] gnu: make-arm-trusted-firmware: Update to 2.12.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
` (3 preceding siblings ...)
2024-12-19 22:10 ` [bug#74849] [PATCH v2 4/6] gnu: make-arm-trusted-firmware: Use guix-name Herman Rimm via Guix-patches via
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
2024-12-19 22:10 ` [bug#74849] [PATCH v2 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build Herman Rimm via Guix-patches via
2024-12-19 23:18 ` [bug#74849] [PATCH v2 0/6] Update ARM Trusted Firmware Vagrant Cascadian
6 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Update to 2.12.
[arguments]: Select correct objcopy and objdump variants.
[native-inputs]: Add python to avoid warnings.
Change-Id: Iccff10b16090913fe5c99491d8335f8ede09038c
---
gnu/packages/firmware.scm | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 3e76681c66..81ebd5efd8 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1108,7 +1108,7 @@ (define* (make-arm-trusted-firmware platform
(string=? (%current-system) (gnu-triplet->nix-system triplet))))
(package
(name (guix-name "arm-trusted-firmware-" platform))
- (version "2.9")
+ (version "2.12")
(source
(origin
(method git-fetch)
@@ -1118,7 +1118,7 @@ (define* (make-arm-trusted-firmware platform
(commit (string-append "v" version))))
(file-name (git-file-name "arm-trusted-firmware" version))
(sha256
- (base32 "16fjbn1zck0d8b554h8lk1svqqn0zlawvrlkjxry9l71s9h4vd0p"))
+ (base32 "18rzhygvq0afcylirq9yis3kaa1nli14k2jrm64ih85gz4nhl99w"))
(modules '((guix build utils)))
;; Remove binary blobs: they don't reference a source or license.
(snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
@@ -1128,7 +1128,15 @@ (define* (make-arm-trusted-firmware platform
#:target (and (not (native-build?)) triplet)
#:phases
#~(modify-phases %standard-phases
- (delete 'configure) ;no configure script
+ (replace 'configure ;no configure script
+ ;; Fix ATF commit ffb7742125def3e0acca4c7e4d3215af5ce25a31
+ (lambda _
+ (unless #$(native-build?)
+ (substitute* "plat/rockchip/rk3399/drivers/m0/Makefile"
+ (("-oc") "-oc-default"))
+ (substitute* "make_helpers/build_macros.mk"
+ (("-oc") "-oc-default")
+ (("-od") "-od-default")))))
(replace 'install
(lambda _
(for-each (lambda (file)
@@ -1138,9 +1146,10 @@ (define* (make-arm-trusted-firmware platform
#~(list (string-append "PLAT=" #$platform)
#$@(if (not (native-build?))
(list (string-append "CROSS_COMPILE=" triplet "-"))
- '())
+ '("CC=gcc"))
"DEBUG=1")
#:tests? #f)) ;no test suite
+ (native-inputs (list python))
(home-page "https://www.trustedfirmware.org/")
(synopsis "Secure world software for ARMv7-A and ARMv8-A")
(description
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
` (4 preceding siblings ...)
2024-12-19 22:10 ` [bug#74849] [PATCH v2 5/6] gnu: make-arm-trusted-firmware: Update to 2.12 Herman Rimm via Guix-patches via
@ 2024-12-19 22:10 ` Herman Rimm via Guix-patches via
2024-12-19 23:18 ` [bug#74849] [PATCH v2 0/6] Update ARM Trusted Firmware Vagrant Cascadian
6 siblings, 0 replies; 24+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-12-19 22:10 UTC (permalink / raw)
To: 74849; +Cc: Efraim Flashner, Vagrant Cascadian
* gnu/local.mk (dist_patch_DATA): Register patches.
* gnu/packages/firmware.scm (make-arm-trusted-firmware): Add make-flags
argument. [source]: Use patches.
(arm-trusted-firmware-imx8mq): Refactor.
* gnu/packages/patches/8mq-enable-imx_hab_handler.patch: Add file.
* gnu/packages/patches/8mq-move-stack-to-ocram_s.patch: Add file.
Change-Id: I8a72c1ceb5e00e113ae91a7c2f5b733d981185d6
---
gnu/local.mk | 2 +
gnu/packages/firmware.scm | 35 ++------
.../patches/8mq-enable-imx_hab_handler.patch | 36 ++++++++
.../patches/8mq-move-stack-to-ocram_s.patch | 88 +++++++++++++++++++
4 files changed, 134 insertions(+), 27 deletions(-)
create mode 100644 gnu/packages/patches/8mq-enable-imx_hab_handler.patch
create mode 100644 gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index fbe9dfbb0e..8155a5ae34 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -934,6 +934,8 @@ MODULES_NOT_COMPILED += \
patchdir = $(guilemoduledir)/%D%/packages/patches
dist_patch_DATA = \
+ %D%/packages/patches/8mq-enable-imx_hab_handler.patch \
+ %D%/packages/patches/8mq-move-stack-to-ocram_s.patch \
%D%/packages/patches/abcl-fix-build-xml.patch \
%D%/packages/patches/ableton-link-system-libraries-debian.patch \
%D%/packages/patches/abiword-explictly-cast-bools.patch \
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 81ebd5efd8..6f6a406c8b 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1099,8 +1099,9 @@ (define-public ovmf-riscv64
(define-public ovmf
(deprecated-package "ovmf" ovmf-x86-64))
-(define* (make-arm-trusted-firmware platform
- #:key (triplet "aarch64-linux-gnu"))
+(define* (make-arm-trusted-firmware platform #:key
+ (triplet "aarch64-linux-gnu")
+ (make-flags '("DEBUG=1")))
(define (native-build?)
"Return #t if the host and target platforms differ."
(or (not triplet)
@@ -1119,6 +1120,8 @@ (define* (make-arm-trusted-firmware platform
(file-name (git-file-name "arm-trusted-firmware" version))
(sha256
(base32 "18rzhygvq0afcylirq9yis3kaa1nli14k2jrm64ih85gz4nhl99w"))
+ (patches (search-patches "8mq-enable-imx_hab_handler.patch"
+ "8mq-move-stack-to-ocram_s.patch"))
(modules '((guix build utils)))
;; Remove binary blobs: they don't reference a source or license.
(snippet #~(for-each delete-file (find-files "." "\\.bin$")))))
@@ -1147,7 +1150,7 @@ (define* (make-arm-trusted-firmware platform
#$@(if (not (native-build?))
(list (string-append "CROSS_COMPILE=" triplet "-"))
'("CC=gcc"))
- "DEBUG=1")
+ #$@make-flags)
#:tests? #f)) ;no test suite
(native-inputs (list python))
(home-page "https://www.trustedfirmware.org/")
@@ -1182,30 +1185,8 @@ (define-public arm-trusted-firmware-rk3399
(cross-binutils "arm-none-eabi")))))))
(define-public arm-trusted-firmware-imx8mq
- (let ((base (make-arm-trusted-firmware "imx8mq")))
- (package
- (inherit base)
- ;; Newer versions do not build and are essentially not supported
- ;; upstream.
- ;; XXX: explore using NXP maintained branch
- ;; https://github.com/nxp-imx/imx-atf
- (version "2.8")
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- ;; There are only GitHub generated release snapshots.
- (url "https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/")
- (commit (string-append "v" version))))
- (file-name (git-file-name "arm-trusted-firmware" version))
- (sha256
- (base32
- "0grq3fgxi9xhcljnhwlxjvdghyz15gaq50raw41xy4lm8rkmnzp3"))))
- (arguments
- (substitute-keyword-arguments (package-arguments base)
- ((#:make-flags flags ''())
- ;; Adding debug symbols causes the size to exceed limits.
- #~(delete "DEBUG=1" #$flags)))))))
+ ;; Remove debug symbols because of limited OCRAM.
+ (make-arm-trusted-firmware "imx8mq" #:make-flags '()))
(define make-crust-firmware
(mlambda (platform)
diff --git a/gnu/packages/patches/8mq-enable-imx_hab_handler.patch b/gnu/packages/patches/8mq-enable-imx_hab_handler.patch
new file mode 100644
index 0000000000..0ead773e4e
--- /dev/null
+++ b/gnu/packages/patches/8mq-enable-imx_hab_handler.patch
@@ -0,0 +1,36 @@
+From: Herman Rimm <herman@rimm.ee>
+Date: Sun, 8 Dec 2024 01:13:59 +0100
+Subject: [PATCH] fix(imx8m): 8mq: enable imx_hab_handler
+
+This completes af799814e2639a03b3453744f06a73e77cb66e86.
+
+Signed-off-by: Herman Rimm <herman@rimm.ee>
+---
+To submit to review.trustedfirmware.org, sign in with a GitHub account.
+
+diff --git a/plat/imx/common/include/imx_sip_svc.h b/plat/imx/common/include/imx_sip_svc.h
+index 404a82959..1948bc2eb 100644
+--- a/plat/imx/common/include/imx_sip_svc.h
++++ b/plat/imx/common/include/imx_sip_svc.h
+@@ -88,7 +88,8 @@ int imx_src_handler(uint32_t smc_fid, u_register_t x1,
+ u_register_t x2, u_register_t x3, void *handle);
+ #endif
+
+-#if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp)
++#if defined(PLAT_imx8mm) || defined(PLAT_imx8mn) || defined(PLAT_imx8mp) || \
++ defined(PLAT_imx8mq)
+ int imx_hab_handler(uint32_t smc_fid, u_register_t x1,
+ u_register_t x2, u_register_t x3, u_register_t x4);
+ #endif
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index 73179dd0c..b1b954f1d 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -30,6 +30,7 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \
+ plat/imx/imx8m/imx8mq/imx8mq_psci.c \
+ plat/imx/imx8m/gpc_common.c \
+ plat/imx/imx8m/imx_aipstz.c \
++ plat/imx/imx8m/imx_hab.c \
+ plat/imx/imx8m/imx8m_caam.c \
+ plat/imx/imx8m/imx8m_ccm.c \
+ plat/imx/imx8m/imx8m_psci_common.c \
diff --git a/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch b/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
new file mode 100644
index 0000000000..1174881181
--- /dev/null
+++ b/gnu/packages/patches/8mq-move-stack-to-ocram_s.patch
@@ -0,0 +1,88 @@
+From: Jacky Bai <ping.bai@nxp.com>
+Date: Tue, 7 Jan 2020 15:48:36 +0800
+Subject: [PATCH] plat: imx8mq: move the stack & xlat table into ocram_s
+
+Move the stack & xlat table into ocram_s due to the
+ocram is not enough.
+
+Signed-off-by: Jacky Bai <ping.bai@nxp.com>
+Change-Id: I40a8e6c91f707598a38e420ff9f4be0c0a5dbf6c
+---
+Commit ae90cc5773abf5656e0e49f2ce746aa54f712b7b of:
+https://github.com/nxp-imx/imx-atf.git
+
+diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S
+index 867dedb99..8be52bc7c 100644
+--- a/bl31/bl31.ld.S
++++ b/bl31/bl31.ld.S
+@@ -25,6 +25,10 @@ MEMORY {
+ #else /* SEPARATE_RWDATA_REGION */
+ #define RAM_RW RAM
+ #endif /* SEPARATE_RWDATA_REGION */
++
++#if XLAT_TABLE_IN_OCRAM_S
++ RAM_S (rwx): ORIGIN = 0x180000, LENGTH = 0x8000
++#endif
+ }
+
+ #ifdef PLAT_EXTRA_LD_SCRIPT
+@@ -198,9 +202,13 @@ SECTIONS {
+ __NOBITS_START__ = .;
+ #endif /* SEPARATE_NOBITS_REGION */
+
++#if !STACK_IN_OCRAM_S
+ STACK_SECTION >NOBITS
++#endif
+ BSS_SECTION >NOBITS
++#if !XLAT_TABLE_IN_OCRAM_S
+ XLAT_TABLE_SECTION >NOBITS
++#endif
+
+ #if USE_COHERENT_MEM
+ /*
+@@ -253,4 +261,15 @@ SECTIONS {
+ /DISCARD/ : {
+ *(.dynsym .dynstr .hash .gnu.hash)
+ }
++
++#if XLAT_TABLE_IN_OCRAM_S
++ . = 0x180000;
++ XLAT_TABLE_SECTION >RAM_S
++
++#if STACK_IN_OCRAM_S
++ STACK_SECTION >RAM_S
++#endif
++
++ASSERT(. <= OCRAM_S_LIMIT, "OCRAM_S limit has been exceeded.")
++#endif
+ }
+diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+index 70c2def7d..ddff0925c 100644
+--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+@@ -48,6 +48,7 @@ static uint8_t mmio_read_8_ldrb(uintptr_t address)
+ static const mmap_region_t imx_mmap[] = {
+ MAP_REGION_FLAT(GPV_BASE, GPV_SIZE, MT_DEVICE | MT_RW), /* GPV map */
+ MAP_REGION_FLAT(IMX_ROM_BASE, IMX_ROM_SIZE, MT_MEMORY | MT_RO), /* ROM map */
++ MAP_REGION_FLAT(OCRAM_S_BASE, OCRAM_S_SIZE, MT_MEMORY | MT_RW), /* ROM map */
+ MAP_REGION_FLAT(IMX_AIPS_BASE, IMX_AIPS_SIZE, MT_DEVICE | MT_RW), /* AIPS map */
+ MAP_REGION_FLAT(IMX_GIC_BASE, IMX_GIC_SIZE, MT_DEVICE | MT_RW), /* GIC map */
+ MAP_REGION_FLAT(IMX_DDRPHY_BASE, IMX_DDR_IPS_SIZE, MT_DEVICE | MT_RW), /* DDRMIX map */
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index 73179dd0c..20a73d691 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -45,7 +45,12 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \
+ ${XLAT_TABLES_LIB_SRCS} \
+ ${IMX_GIC_SOURCES}
+
+-ENABLE_PIE := 1
++XLAT_TABLE_IN_OCRAM_S := 1
++STACK_IN_OCRAM_S := 1
++
++$(eval $(call add_define,XLAT_TABLE_IN_OCRAM_S))
++$(eval $(call add_define,STACK_IN_OCRAM_S))
++
+ USE_COHERENT_MEM := 1
+ RESET_TO_BL31 := 1
+ A53_DISABLE_NON_TEMPORAL_HINT := 0
--
2.45.2
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [bug#74849] [PATCH v2 0/6] Update ARM Trusted Firmware.
2024-12-19 22:10 ` [bug#74849] [PATCH v2 " Herman Rimm via Guix-patches via
` (5 preceding siblings ...)
2024-12-19 22:10 ` [bug#74849] [PATCH v2 6/6] gnu: arm-trusted-firmware-imx8mq: Fix build Herman Rimm via Guix-patches via
@ 2024-12-19 23:18 ` Vagrant Cascadian
2024-12-20 0:22 ` bug#74849: " Vagrant Cascadian
6 siblings, 1 reply; 24+ messages in thread
From: Vagrant Cascadian @ 2024-12-19 23:18 UTC (permalink / raw)
To: Herman Rimm, 74849; +Cc: Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
On 2024-12-19, Herman Rimm wrote:
> This revision configures the ARM Trusted Firmware differently when doing
> a native build, which should fix the 'aarch64-none-elf-gcc' errors.
That does appear to work, nice!
I had another working patch that added to native inputs:
(cross-gcc "aarch64-none-elf")
(cross-binutils "aarch64-none-elf")
And passed CROSS_COMPILE=aarch64-none-elf- ...
But those extra inputs are silly and your fix is much nicer!
> I will give the guix-name procedure a more appropriate name in another
> patch (series).
Could the guix-name stuff just be submitted as it's own patch series?
It seems more-or-less unrelated to this patch series, only resulting in
a few small line changes...
live well,
vagrant
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#74849: [PATCH v2 0/6] Update ARM Trusted Firmware.
2024-12-19 23:18 ` [bug#74849] [PATCH v2 0/6] Update ARM Trusted Firmware Vagrant Cascadian
@ 2024-12-20 0:22 ` Vagrant Cascadian
0 siblings, 0 replies; 24+ messages in thread
From: Vagrant Cascadian @ 2024-12-20 0:22 UTC (permalink / raw)
To: Herman Rimm, 74849-done; +Cc: Efraim Flashner
[-- Attachment #1: Type: text/plain, Size: 2300 bytes --]
On 2024-12-19, Vagrant Cascadian wrote:
> On 2024-12-19, Herman Rimm wrote:
>> This revision configures the ARM Trusted Firmware differently when doing
>> a native build, which should fix the 'aarch64-none-elf-gcc' errors.
>
> That does appear to work, nice!
...
>> I will give the guix-name procedure a more appropriate name in another
>> patch (series).
>
> Could the guix-name stuff just be submitted as it's own patch series?
> It seems more-or-less unrelated to this patch series, only resulting in
> a few small line changes...
I reverted the guix-name stuff and pushed as:
91f50366e5bc54951851e99f5600f9abb628b6ec (origin/master) gnu: arm-trusted-firmware-imx8mq: Fix build.
29ff4a6ca836c0ee8fe052eda3ad9a5d2bb8d2af gnu: make-arm-trusted-firmware: Update to 2.12.
c514002bd79eb49653857bddc14bd342f848cbcf gnu: arm-trusted-firmware: Reformat.
442c218c181734251ab671b29ef6bece998f6f04 gnu: arm-trusted-firmware-rk3399: Reformat.
I pushed, though there are somethings included that should go upstream....
These two patches do not appear to be in upstream:
* gnu/packages/patches/8mq-enable-imx_hab_handler.patch: Add file.
* gnu/packages/patches/8mq-move-stack-to-ocram_s.patch: Add file.
This phase should probably be reported and fixed upstream as well:
- (delete 'configure) ;no configure script
+ (replace 'configure ;no configure script
+ ;; Fix ATF commit ffb7742125def3e0acca4c7e4d3215af5ce25a31
+ (lambda _
+ (unless #$(native-build?)
+ (substitute* "plat/rockchip/rk3399/drivers/m0/Makefile"
+ (("-oc") "-oc-default"))
+ (substitute* "make_helpers/build_macros.mk"
+ (("-oc") "-oc-default")
+ (("-od") "-od-default")))))
I do not see any fixes in upstream about this. Works fine without this
for native building but not for cross-building.
And now I catch myself after having pushed it, I meant to switch that
back to deleting the configure phase and renaming it some other phase!
It is not really configure functionality, probably should have been with
(add-after 'unpack ... or something like that ... or just a full patch,
to make it possible to submit upstream.
Thanks for your contribution!
live well,
vagrant
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread