~ruther/guix-kria

guix-kria/modules/zynqmp/packages/firmware.scm -rw-r--r-- 2.9 KiB
79fd3786 — Rutherther chore: Add script to build the final image 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
(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")))