(define-module (zynqmp packages firmware) #:use-module (zynqmp packages microblaze) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix utils) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages tls) #:use-module (gnu packages bootloaders) #:use-module (gnu packages texinfo) #:use-module (gnu packages cross-base) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages firmware) #:export (arm-trusted-firmware-for-zynqmp xilinx-zynqmp-pmufw)) (define arm-trusted-firmware-for-zynqmp (let* ((base ((@@ (gnu packages firmware) make-arm-trusted-firmware) "zynqmp" #:make-flags '("ZYNQMP_CONSOLE=cadence1") #:triplet "aarch64-linux-gnu"))) (package (inherit base) (name "arm-trusted-firmware-for-zynqmp") (version "2.10_2024.2") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/Xilinx/arm-trusted-firmware") (commit "xlnx_rebase_v2.10_2024.2"))) (file-name (git-file-name name version)) (sha256 (base32 "0li43y96y696dgprsp3dvdv2n6kslcbmswfjp42cmyjwfrml7bvf"))))))) (define xilinx-embeddedsw-source (origin (method git-fetch) (uri (git-reference (url "https://github.com/Xilinx/embeddedsw") (commit "xilinx_v2024.2"))) (sha256 (base32 "0zlnbcpxp00pf09mz7n0958d558fy1q4a3ipljcm2k1qfkaihv4g")) )) (define xilinx-zynqmp-pmufw (package (name "xilinx-zynqmp-pmufw") (version "2024.2") (source xilinx-embeddedsw-source) (build-system gnu-build-system) (arguments (list #:target "microblazeel-xilinx-elf" #:make-flags #~(list "CFLAGS=-Os -flto -ffat-lto-objects -DK26_SOM" (string-append "COMPILER=" #$(cc-for-target "microblazeel-xilinx-elf")) (string-append "ARCHIVER=" #$(cc-for-target "microblazeel-xilinx-elf") "-ar") (string-append "CC=" #$(cc-for-target "microblazeel-xilinx-elf"))) #:phases #~(modify-phases %standard-phases (delete 'configure) (add-before 'build 'cd (lambda _ (chdir "lib/sw_apps/zynqmp_pmufw/src"))) (replace 'install (lambda _ (mkdir-p #$output) (copy-file "executable.elf" (string-append #$output "/pmufw.elf"))))))) (native-inputs (list microblazeel-xilinx-elf-toolchain bash)) (description "") (synopsis "") (license license:expat) (home-page "https://github.com/Xilinx/embeddedsw")))