gnu: u-boot: Update to 2020.04.
[jackhill/guix/guix.git] / gnu / packages / hardware.scm
CommitLineData
aadd1d24 1;;; GNU Guix --- Functional package management for GNU
21724ed9 2;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
aadd1d24
TGR
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages hardware)
22a98cda 20 #:use-module (gnu packages autotools)
aadd1d24 21 #:use-module (gnu packages compression)
5eff4380 22 #:use-module (gnu packages gcc)
aadd1d24
TGR
23 #:use-module (gnu packages glib)
24 #:use-module (gnu packages libusb)
25 #:use-module (gnu packages linux)
0ba0ab81 26 #:use-module (gnu packages ncurses)
aadd1d24
TGR
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages xdisorg)
29 #:use-module (gnu packages xorg)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix download)
0ba0ab81 32 #:use-module (guix git-download)
aadd1d24
TGR
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages))
35
36;; This is a module for packages related to physical hardware that don't (yet)
37;; have a more specific home like gps.scm, security-token.scm, &c.
38
39(define-public ddcutil
40 (package
41 (name "ddcutil")
21724ed9 42 (version "0.9.8")
aadd1d24
TGR
43 (source
44 (origin
45 (method url-fetch)
46 (uri (string-append "https://www.ddcutil.com/tarballs/"
ec756fa5 47 "ddcutil-" version ".tar.gz"))
aadd1d24 48 (sha256
21724ed9 49 (base32 "13ccxbqgyz4ah9jwbcylnfkgl8j3ida8xd00xkcq4xnfyyv5mg6v"))))
aadd1d24
TGR
50 (build-system gnu-build-system)
51 (native-inputs
52 `(("pkg-config" ,pkg-config)))
53 (inputs
54 `(("eudev" ,eudev)
55 ("glib" ,glib)
56 ("libdrm" ,libdrm) ; enhanced diagnostics
57 ("libusb" ,libusb) ; support USB monitors
58 ("libx11" ,libx11) ; enhanced diagnostics
59 ("libxrandr" ,libxrandr)
60 ("zlib" ,zlib)))
61 (home-page "https://www.ddcutil.com/")
62 (synopsis "Control external monitor settings")
63 (description
64 "ddcutil can query and modify most external monitors' settings, such as
65brightness, colour levels, and input sources. Generally speaking, any setting
66that can be changed by pressing buttons on the monitor can be modified by
67ddcutil.
68
69ddcutil communicates directly with monitors implementing the Monitor Control
70Command Set (@dfn{MCCS}). It usually does so through the the Display Data
71Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
72communicate over USB as per the USB Monitor Control Class Specification.
73
74One particular use case is in colour profile management. Monitor calibration
75is relative to the monitor colour settings currently in effect, e.g. red gain.
76ddcutil allows colour-related settings to be saved at the time a monitor is
77calibrated, and restored when the calibration is applied.")
78 (license (list license:bsd-3 ; FindDDCUtil.cmake
79 license:gpl2+)))) ; everything else
6e8c75b8 80
5eff4380
TGR
81;; Distinct from memtest86, which is obsolete.
82(define-public memtest86+
83 (package
84 (name "memtest86+")
85 ;; Update the description when/if UEFI support is released.
86 (version "5.01")
87 (source
88 (origin
89 (method url-fetch)
90 (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
91 version ".tar.gz"))
92 (sha256
93 (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
94 (build-system gnu-build-system)
95 (arguments
96 `(#:system "i686-linux" ; the result runs outside of any OS
97 #:tests? #f ; no way to test this
98 #:phases
99 (modify-phases %standard-phases
100 (delete 'configure) ; no configure script
101 (replace 'build
102 ;; The default 'make all' does wonderful things, like scp(1) a file to
103 ;; 192.168.0.12. Build the bootable images and nothing more.
104 (lambda _
105 (invoke "make"
106 "memtest" ; ELF executable
107 "memtest.bin"))) ; DOS/MBR boot sector
108 (replace 'install
109 (lambda* (#:key outputs #:allow-other-keys)
110 (let* ((out (assoc-ref outputs "out"))
111 (lib (string-append out "/lib/memtest86+"))
112 (doc (string-append out "/share/doc/memtest86+-" ,version)))
113 (for-each
114 (lambda (file)
115 (install-file file lib))
116 (list "memtest"
117 "memtest.bin"))
118 (for-each
119 (lambda (file)
120 (install-file file doc))
121 (list "FAQ"
fb541251
TGR
122 "README"))
123 #t))))))
5eff4380
TGR
124 (native-inputs
125 ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
126 `(("gcc" ,gcc-4.9)))
127 (supported-systems (list "i686-linux" "x86_64-linux"))
128 (home-page "https://www.memtest.org/")
129 (synopsis "Thorough real-mode memory tester")
130 (description
131 "Memtest86+ is a thorough, stand-alone memory test for x86 systems. It
132repeatedly writes different patterns to all memory locations, reads them back
133again, and verifies whether the result is the same as what was written. This
134can help debug even intermittent and non-deterministic errors.
135
136It runs independently of any operating system, at computer boot-up, so that it
137can scan as much of your RAM as possible for hardware defects.
138
139Memtest86+ cannot currently be used on computers booted with UEFI.")
140 (license license:gpl2)))
141
fb541251
TGR
142(define-public memtester
143 (package
144 (name "memtester")
145 (version "4.3.0")
146 (source
147 (origin
148 (method url-fetch)
149 ;; Even the latest release is available under 'old-versions/'.
150 (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
151 "memtester-" version ".tar.gz"))
152 (sha256
153 (base32 "127xymmyzb9r6dxqrwd69v7gf8csv8kv7fjvagbglf3wfgyy5pzr"))))
154 (build-system gnu-build-system)
155 (arguments
156 `(#:make-flags
157 (list "CC=gcc")
158 #:phases
159 (modify-phases %standard-phases
160 (replace 'configure
161 ;; This is a home-brewed configuration system where the cc/ld command
162 ;; lines are stored in one-line files.
163 (lambda* (#:key outputs #:allow-other-keys)
164 (let* ((out (assoc-ref outputs "out")))
165 (substitute* (list "conf-cc" "conf-ld")
166 (("^cc") "gcc"))
167 (substitute* "Makefile"
168 (("(INSTALLPATH.*=).*" _ assignment)
169 (string-append assignment out)))
170 #t)))
171 (replace 'check
172 ;; There is no test suite. Test some RAM for a single iteration.
173 (lambda _
174 (invoke "./memtester" "64K" "1"))))))
175 (home-page "http://pyropus.ca/software/memtester/")
176 (synopsis "User-space memory subsystem tester")
177 (description
178 "Memtester stress-tests the memory subsystem of your operating system and
179computer. It repeatedly writes different patterns to all memory locations,
180reads them back again, and verifies whether the result is the same as what was
181written. This can help debug even intermittent and non-deterministic errors.
182
183Memtester runs entirely in user space. This means that you don't need to reboot
184to test your memory, but also that it's not possible to test all of the RAM
185installed in the system.
186
187It can also be told to test memory starting at a particular physical address.")
188 (license license:gpl2)))
189
6e8c75b8
TGR
190(define-public msr-tools
191 (package
192 (name "msr-tools")
193 (version "1.3")
194 (source
195 (origin
196 (method url-fetch)
197 (uri (string-append "https://01.org/sites/default/files/downloads/"
198 name "/" name "-" version ".zip"))
199 (sha256
200 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
201 (build-system gnu-build-system)
202 (arguments
203 `(#:make-flags
204 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
205 #:phases
206 (modify-phases %standard-phases
207 (delete 'configure) ; no configure script
208 (add-before 'install 'create-output-directory
209 (lambda* (#:key outputs #:allow-other-keys)
210 ;; 'make install' assumes that sbindir exists.
211 (let* ((out (assoc-ref outputs "out"))
212 (sbin (string-append out "/sbin")))
213 (mkdir-p sbin)
214 #t))))
215 #:tests? #f)) ; no test suite
216 (native-inputs
217 `(("unzip" ,unzip)))
218 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
219 (supported-systems (list "i686-linux" "x86_64-linux"))
220 (home-page "https://01.org/msr-tools/")
221 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
222 (description
223 "The MSR Tools project provides console utilities to directly access the
224Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
225
226@itemize
227@item @command{cpuid}: show identification and feature information of any CPU
228@item @command{rdmsr}: read MSRs from any CPU or all CPUs
229@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
230@end itemize
231
232These tools can be used to query and modify certain low-level CPU parameters,
233such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
234
235MSR addresses differ (greatly) between processors, and any such modification can
236be dangerous and may void your CPU or system board's warranty.")
237 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+
0ba0ab81
TGR
238
239(define-public wavemon
240 (package
241 (name "wavemon")
5976d0b0 242 (version "0.9.1")
0ba0ab81
TGR
243 (source
244 (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url "https://github.com/uoaerg/wavemon.git")
248 (commit (string-append "v" version))))
249 (file-name (git-file-name name version))
250 (sha256
5976d0b0 251 (base32 "109ycwnjjqc2vpnd8b86njfifczlxglnyv4rh2qmbn2i5nw2wryg"))))
0ba0ab81
TGR
252 (build-system gnu-build-system)
253 (arguments
254 `(#:make-flags
255 (list "CC=gcc"
256 ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's
257 ;; standard --docdir since it's only used as such.
258 (string-append "datadir=" (assoc-ref %outputs "out")
259 "/share/doc/" ,name "-" ,version))
260 #:tests? #f)) ; no tests
261 (native-inputs
262 `(("pkg-config" ,pkg-config)))
263 (inputs
264 `(("libcap" ,libcap)
265 ("libnl" ,libnl)
266 ("ncurses" ,ncurses)))
267 (home-page "https://github.com/uoaerg/wavemon")
268 (synopsis "Wireless network device monitor")
269 (description
270 "Wavemon is a wireless device monitor with an interactive ncurses terminal
271interface. It can display and plot signal and noise levels in real time. It
272also reports packet statistics, device configuration, network parameters, and
273access points and other wireless clients of your wireless network hardware.
274
275Wavemon should work (with varying levels of detail and features) with any device
276supported by the Linux kernel.")
277 ;; Source file headers still say GPL2+, but the authorial intent
278 ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
279 (license license:gpl3+)))
22a98cda
JN
280
281(define-public rkdeveloptool
282 (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
283 (revision "0"))
284 (package
285 (name "rkdeveloptool")
286 (version (git-version "1.3" revision commit))
287 (source
288 (origin
289 (method git-fetch)
290 (uri (git-reference
291 (url "https://github.com/rockchip-linux/rkdeveloptool.git")
292 (commit commit)))
293 (file-name (git-file-name name version))
294 (sha256
295 (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
296 (build-system gnu-build-system)
297 (native-inputs
298 `(("autoconf" ,autoconf)
299 ("automake" ,automake)
300 ("pkg-config" ,pkg-config)))
301 (inputs
302 `(("libusb" ,libusb)))
303 (home-page "https://github.com/rockchip-linux/rkdeveloptool")
304 (synopsis "Read from and write to RockChicp devices over USB")
305 (description
306 "Rkdeveloptool can read from and write to RockChip devices over USB, such
307as the Pinebook Pro.")
308 (license license:gpl2+))))