Debian Codegraph @

doc/man/device-config.rst

raw
1 .. _labgrid-device-config:
2
3 =======================
4 labgrid-device-config
5 =======================
6
7 labgrid test configuration files
8 ================================
9
10 SYNOPSIS
11 --------
12
13 ``*.yaml``
14
15 DESCRIPTION
16 -----------
17 To integrate a device into a labgrid test, labgrid needs to have a description
18 of the device and how to access it.
19
20 This manual page is divided into section, each describing one top-level yaml key.
21
22
23 TARGETS
24 -------
25 The ``targets:`` top key configures a ``target``, it's ``drivers`` and ``resources``.
26
27 The top level key is the name of the target, it needs both a ``resources`` and
28 ``drivers`` subkey. The order of instantiated ``resources`` and ``drivers`` is
29 important, since they are parsed as an ordered dictionary and may depend on a
30 previous driver.
31
32 For a list of available resources and drivers refer to
33 https://labgrid.readthedocs.io/en/latest/configuration.html.
34
35 OPTIONS
36 -------
37 The ``options:`` top key configures various options such as the coordinator_address.
38
39 OPTIONS KEYS
40 ~~~~~~~~~~~~
41
42 ``coordinator_address``
43 takes as parameter the coordinator ``HOST[:PORT]`` to connect to.
44 Defaults to ``127.0.0.1:20408``.
45
46 .. _labgrid-device-config-images:
47
48 IMAGES
49 ------
50 The ``images:`` top key provides paths to access preconfigured images to flash
51 onto the board. The image paths can be either relative to the YAML file or
52 absolute.
53
54 IMAGE KEYS
55 ~~~~~~~~~~
56
57 The subkeys consist of image names as keys and their paths as values. The
58 corresponding name can than be used with the appropriate tool found under TOOLS.
59
60 IMAGE EXAMPLE
61 ~~~~~~~~~~~~~~
62 Two configured images, one for the root filesystem, one for the bootloader:
63
64 ::
65
66 images:
67 root: "platform-v7a/images/root.img"
68 boot: "platform-v7a/images/barebox.img"
69
70 TOOLS
71 -----
72 The ``tools:`` top key provides paths to binaries such as fastboot.
73
74 TOOLS KEYS
75 ~~~~~~~~~~
76
77 ``dfu-util``
78 Path to the dfu-util binary, used by the DFUDriver.
79 See: https://dfu-util.sourceforge.net/
80
81 ``dpcmd``
82 Path to the dpcmd binary, used by the DediprogFlashDriver.
83 See: https://github.com/DediProgSW/SF100Linux
84
85 ``fastboot``
86 Path to the fastboot binary, used by the AndroidFastbootDriver.
87 See: https://developer.android.com/studio/releases/platform-tools
88
89 ``flashrom``
90 Path to the flashrom binary, used by the FlashromDriver.
91 See: https://www.flashrom.org/
92
93 ``imx_usb``
94 Path to the imx_usb binary, used by the BDIMXUSBDriver.
95 See: https://github.com/boundarydevices/imx_usb_loader
96
97 ``imx-usb-loader``
98 Path to the imx-usb-loader binary, used by the IMXUSBDriver.
99 See: https://git.pengutronix.de/cgit/barebox/tree/scripts/imx/imx-usb-loader.c
100
101 ``jtagconfig``
102 Path to the jtagconfig binary, used by the QuartusHPSDriver.
103 See: https://www.intel.com/content/www/us/en/docs/programmable/683689/current/jtagconfig.html
104
105 ``mxs-usb-loader``
106 Path to the mxs-usb-loader binary, used by the MXSUSBDriver.
107 See: https://git.pengutronix.de/cgit/barebox/tree/scripts/mxs-usb-loader.c?h=v2017.03.0
108
109 ``openocd``
110 Path to the openocd binary, used by the OpenOCDDriver.
111 See: https://openocd.org/
112
113 ``quartus_hps``
114 Path to the quartus_hps binary, used by the QuartusHPSDriver.
115 See: https://www.intel.com/content/www/us/en/docs/programmable/683039/22-3/hps-flash-programmer.html
116
117 ``rk-usb-loader``
118 Path to the rk-usb-loader binary, used by the RKUSBDriver.
119 See: https://git.pengutronix.de/cgit/barebox/tree/scripts/rk-usb-loader.c
120
121 ``rsync``
122 Path to the rsync binary, used by the SSHDriver.
123 See: https://github.com/rsyncproject/rsync
124
125 ``scp``
126 Path to the scp binary, used by the SSHDriver.
127 See: https://github.com/openssh/openssh-portable
128
129 ``sd-mux-ctrl``
130 Path to the sd-mux-ctrl binary, used by the USBSDWireDriver.
131 See: https://git.tizen.org/cgit/tools/testlab/sd-mux/
132
133 ``sispmctl``
134 Path to the sispmctl binary, used by the SiSPMPowerDriver.
135 See: https://sispmctl.sourceforge.net/
136
137 ``ssh``
138 Path to the ssh binary, used by the SSHDriver.
139 See: https://github.com/openssh/openssh-portable
140
141 ``sshfs``
142 Path to the sshfs binary, used by the SSHDriver.
143 See: https://github.com/libfuse/sshfs
144
145 ``uhubctl``
146 Path to the uhubctl binary, used by the USBPowerDriver.
147 See: https://github.com/mvp/uhubctl
148
149 ``usbmuxctl``
150 Path to the usbmuxctl tool, used by the LXAUSBMuxDriver.
151 https://github.com/linux-automation/usbmuxctl
152
153 ``usbsdmux``
154 Path to the usbsdmux tool, used by the USBSDMuxDriver.
155 See: https://github.com/linux-automation/usbsdmux
156
157 ``uuu-loader``
158 Path to the uuu-loader binary, used by the UUUDriver.
159 See: https://github.com/nxp-imx/mfgtools
160
161 ``ykushcmd``
162 Path to the ykushcmd binary, used by the YKUSHPowerDriver.
163 See: https://github.com/Yepkit/ykush
164
165 The QEMUDriver expects a custom key set via its ``qemu_bin`` argument.
166 See https://www.qemu.org/
167
168 TOOLS EXAMPLE
169 ~~~~~~~~~~~~~~
170 Configure the tool path for ``imx-usb-loader``:
171
172 ::
173
174 tools:
175 imx-usb-loader: "/opt/labgrid-helper/imx-usb-loader"
176
177 IMPORTS
178 -------
179 The ``imports`` key is a list of files or python modules which
180 are imported by the environment after loading the configuration.
181 Paths relative to the configuration file are also supported.
182 This is useful to load drivers and strategy which are contained in your
183 testsuite, since the import is done before instantiating the targets.
184
185 IMPORTS EXAMPLE
186 ~~~~~~~~~~~~~~~
187 Import a local ``myfunctions.py`` file:
188
189 ::
190
191 imports:
192 - myfunctions.py
193
194 EXAMPLES
195 --------
196 A sample configuration with one ``main`` target, accessible via SerialPort
197 ``/dev/ttyUSB0``, allowing usage of the ShellDriver:
198
199 ::
200
201 targets:
202 main:
203 resources:
204 RawSerialPort:
205 port: "/dev/ttyUSB0"
206 drivers:
207 SerialDriver: {}
208 ShellDriver:
209 prompt: 'root@[\w-]+:[^ ]+ '
210 login_prompt: ' login: '
211 username: 'root'
212
213 A sample configuration with ``RemotePlace``, using the tools configuration and
214 importing the local ``mystrategy.py`` file. The ``MyStrategy`` strategy is contained
215 in the loaded local python file:
216
217 ::
218
219 targets:
220 main:
221 resources:
222 RemotePlace:
223 name: test-place
224 drivers:
225 SerialDriver: {}
226 ShellDriver:
227 prompt: 'root@[\w-]+:[^ ]+ '
228 login_prompt: ' login: '
229 username: 'root'
230 IMXUSBDriver: {}
231 MyStrategy: {}
232 tools:
233 imx-usb-loader: "/opt/lg-tools/imx-usb-loader"
234 imports:
235 - mystrategy.py
236
237 SEE ALSO
238 --------
239
240 ``labgrid-client``\(1), ``labgrid-exporter``\(1)
241