diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm index 471d17bcc2..1834b2b3c3 100644 --- a/gnu/packages/flashing-tools.scm +++ b/gnu/packages/flashing-tools.scm @@ -447,6 +447,87 @@ referred to as the \"Odin 3 protocol\".") dump Intel Firmware Descriptor data of an image file.") (license license:gpl2))) +(define-public bincfg + (package + (name "bincfg") + (version "25.09") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://review.coreboot.org/coreboot") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1a1n64dwr5fzdnaj45bjci85ap5yra5gwz4x056zn6481xwvbsmv")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no test suite + #:make-flags + #~(list + (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ; no configure script + (add-after 'unpack 'chdir + (lambda _ + (chdir "util/bincfg"))) + (add-after 'build 'build-binaries + (lambda* (#:key make-flags #:allow-other-keys) + (for-each + (lambda (target result) + (apply invoke "make" (string-append "gen-" target) make-flags) + (rename-file result + (string-append target ".bin"))) + (list + ;; generate GbE for X200 + "gbe-ich9m" + ;; generate GbE for X220/x230 + "gbe-82579LM" + ;; generate IFD for X200 + "ifd-x200") + (list + "flashregion_3_gbe.bin" + "flashregion_3_gbe.bin" + "flashregion_0_fd.bin")))) + ;; The Makefile has no install target. + (replace 'install + (lambda _ + (let ((bin (string-append #$output "/bin")) + (lib (string-append #$output "/lib/bincfg")) + (data (string-append #$output "/share/bincfg"))) + ;; Install the program + (install-file "bincfg" bin) + ;; And its data + (for-each + (lambda (path) + (install-file path data)) + (append (find-files "." ".*\\.set") + (find-files "." ".*\\.spec"))) + ;; And the files generated with the data + (for-each + (lambda (path) + (install-file path lib)) + (find-files "." ".*\\.bin")))))))) + (native-inputs (list bison flex)) + (home-page "https://coreboot.org") + (synopsis "Encoder/decoder for binary formats described in text files") + (description " +The bincfg program comes with specifications files for the following binary +formats: +@itemize +@item Various DDR3 and DDR4 SPD +@item Configuration data for the Intel 82579LM Gigabit Ethernet PHY +@item Configuration data for the Intel Gigabit Ethernet controller present in + the Intel ICH9-M chipset. +@item Intel Firmware Descriptor data for the Lenovo ThinkPad X200 +@item Configuration data for the ITE IT8718F SuperIO +@end itemize +It also comes with example files generated by bincfg.") + (license license:gpl3+))) + (define-public intelmetool (package (name "intelmetool")