Lines Matching +full:firmware +full:- +full:name
2 # SPDX-License-Identifier: GPL-2.0
3 # This validates that the kernel will load firmware out of its list of
4 # firmware locations on disk. Since the user helper does similar work,
7 set -e
14 RUN_XZ="xz -C crc32 --lzma2=dict=2MiB"
15 RUN_ZSTD="zstd -q"
26 echo 1 >/sys/class/firmware/timeout
34 if [ ! -e "$DIR"/trigger_async_request ]; then
44 # Request a firmware that doesn't exist, it should fail.
45 if echo -n "nope-$NAME" >"$DIR"/trigger_request 2> /dev/null; then
46 echo "$0: firmware shouldn't have loaded" >&2
49 if diff -q "$FW" /dev/test_firmware >/dev/null ; then
50 echo "$0: firmware was not expected to match" >&2
60 if ! echo -n "$NAME" >"$DIR"/trigger_request ; then
66 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
67 echo "$0: firmware was not loaded" >&2
74 if [ ! -e "$DIR"/trigger_async_request ]; then
75 echo "$0: firmware loading: async trigger not present, ignoring test" >&2
78 if ! echo -n "$NAME" >"$DIR"/trigger_async_request ; then
84 if ! diff -q "$FW" /dev/test_firmware >/dev/null ; then
85 echo "$0: firmware was not loaded (async)" >&2
93 if [ ! -e "$DIR"/trigger_request_platform ]; then
94 echo "$0: firmware loading: platform trigger not present, ignoring test" >&2
101 # Note we echo a non-existing name, since files on the file-system
102 # are preferred over firmware embedded inside the platform's firmware
103 # The test adds a fake entry with the requested name to the platform's
104 # fw list, so the name does not matter as long as it does not exist
105 if ! echo -n "nope-$NAME" >"$DIR"/trigger_request_platform ; then
110 # The test verifies itself that the loaded firmware contents matches
118 if [ ! -f $DIR/reset ]; then
128 # name: test-firmware.bin
142 echo -n $1 > $DIR/config_name
197 echo -n 1 > $DIR/trigger_batched_requests 2>/dev/null
202 echo -n 1 > $DIR/trigger_batched_requests_async 2> /dev/null
207 echo -n $1 > $DIR/config_read_fw_idx 2> /dev/null
218 fwfile="${fwfile}-orig"
223 # -Z required for now -- check for yourself, md5sum
226 if ! diff -q -Z "$fwfile" $DIR/read_firmware 2>/dev/null ; then
227 echo "request #$i: firmware was not loaded" >&2
242 fwfile="${fwfile}-orig"
256 echo "request #$i: partial firmware was not loaded" >&2
267 if diff -q -Z "$FW" $DIR/read_firmware 2>/dev/null ; then
276 echo -n "Batched request_firmware() nofile try #$1: "
278 config_set_name nope-test-firmware.bin
287 echo -n "Batched request_firmware_into_buf() nofile try #$1: "
289 config_set_name nope-test-firmware.bin
299 echo -n "Test request_partial_firmware_into_buf() off=$1 size=$2 nofile: "
301 config_set_name nope-test-firmware.bin
314 echo -n "Batched request_firmware_direct() nofile try #$1: "
316 config_set_name nope-test-firmware.bin
325 echo -n "Batched request_firmware_nowait(uevent=true) nofile try #$1: "
327 config_set_name nope-test-firmware.bin
339 name=$1
340 while [ ! -e "$DIR"/"$name"/loading ]; do
342 timeout=$(( $timeout - 1 ))
343 if [ "$timeout" -eq 0 ]; then
344 echo "firmware interface never appeared:" >&2
345 echo "$DIR/$name/loading" >&2
349 echo -1 >"$DIR"/"$name"/loading
354 echo -n "Batched request_firmware_nowait(uevent=false) nofile try #$1: "
369 echo -n "Batched request_firmware() $2 try #$1: "
379 echo -n "Batched request_firmware_into_buf() $2 try #$1: "
391 echo -n "Batched request_firmware_direct() $2 try #$1: "
401 echo -n "Batched request_firmware_nowait(uevent=true) $2 try #$1: "
410 echo -n "Batched request_firmware_nowait(uevent=false) $2 try #$1: "
415 if [ -n "$2" -a "$2" != "normal" ]; then
426 echo -n "Test request_partial_firmware_into_buf() off=$1 size=$2: "
466 # test-firmware driver
500 config_set_name $NAME
506 mv "$FW" "${FW}-orig"
507 mv "$FW_INTO_BUF" "${FW_INTO_BUF}-orig"
509 config_set_name $NAME
514 mv "${FW}-orig" "$FW"
515 mv "${FW_INTO_BUF}-orig" "$FW_INTO_BUF"
520 $RUN_XZ -k "$@"
530 $RUN_ZSTD -k "$@"
535 $RUN_ZSTD --rm "$@"