Lines Matching +full:num +full:- +full:transfer +full:- +full:bits

3 # SPDX-License-Identifier: Apache-2.0
19 log = logging.getLogger("cavs-fw")
23 HUGEPAGE_FILE = "/dev/hugepages/cavs-fw-dma.tmp."
28 # Window 1 is the IPC "inbox" (host-writable memory, just 384 bytes currently)
30 # Window 3 is winstream-formatted log output
43 # pylint: disable=duplicate-code
45 # ADSPCS bits
106 self.regs.LVI = self.n_bufs - 1
143 # bdl is 2 (64bits, 16 bytes) per entry, we have two
214 p = runx(f"grep -iEl 'PCI_CLASS=40(10|38)0' /sys/bus/pci/devices/*/uevent")
234 runx(f"rmmod -f {mod}")
313 # 128-byte (minimum size and alignment) buffer after the main one, and put
314 # the 4-entry BDL list into the final 128 bytes of the page.
315 buf0_len = HUGEPAGESZ - 2 * 128
330 os.system("mount | grep -q hugetlbfs ||"
331 + " (mkdir -p /dev/hugepages; "
332 + " mount -t hugetlbfs hugetlbfs /dev/hugepages)")
350 # page frame number occupies the bottom bits of the entry.
357 paddr = (struct.unpack("Q", pent)[0] & ((1 << 55) - 1)) * PAGESZ
361 # Maps a PCI BAR and returns the in-process address
427 log.info(f"Configuring HDA stream {hda_ostream_id} to transfer firmware image")
433 sd.CTL = 1 << 20 # Set stream ID to anything non-zero
437 sd.LVI = num_bufs - 1
441 # that puts a transfer boundary into the stream beyond which the
501 fw_bytes += b'\x00' * (512 * 1024 - len(fw_bytes))
552 log.info(f"Configuring HDA stream {hda_ostream_id} to transfer firmware image")
558 sd.CTL |= (1 << 20) # Set stream ID to anything non-zero
562 sd.LVI = num_bufs - 1
566 # that puts a transfer boundary into the stream beyond which the
618 return dsp.ROM_STATUS & ((1 << 28) - 1) == 5 # "FW_ENTERED"
631 attempts -= 1
682 last_seq = seq if args.no_history else (seq - ((end - start) % wlen))
685 behind = seq - last_seq
686 if behind > ((end - start) % wlen):
688 copy = (end - behind) % wlen
689 suffix = min(behind, wlen - copy)
692 result += win_read(base, 16, behind - suffix)
697 return (seq, result.decode("utf-8", "replace"))
701 return idx - wlen
705 return idx_mod(wlen, a + (wlen - b))
721 lenmsg = wlen - 1
724 avail = (wlen - 1) - idx_sub(wlen, end, start)
726 hdr.START = idx_mod(wlen, start + (lenmsg - avail))
729 drop = lenmsg0 - lenmsg
730 msg = msg[drop : lenmsg - drop]
731 suffix = min(lenmsg, wlen - end)
735 for c in range(0, lenmsg - suffix):
744 def debug_slot_offset(num): argument
745 return debug_offset() + DEBUG_SLOT_SIZE * (1 + num)
763 attempts -= 1
774 os.write(shell_client_port, output.encode("utf-8"))
806 # Super-simple command language, driven by the test code on the DSP
823 ext_data = t - ipc_timestamp
879 read_lens[0] = hda_str.buf_len*2 - pos
880 read_lens[1] = buf_len - read_lens[0]
886 hda_msg0 = buf_data0.decode("utf-8", "replace")
891 hda_msg1 = buf_data1.decode("utf-8", "replace")
964 sys.stdout.write("--\n")
987 ap.add_argument("-q", "--quiet", action="store_true",
989 ap.add_argument("-v", "--verbose", action="store_true",
991 ap.add_argument("-l", "--log-only", action="store_true",
993 ap.add_argument("-p", "--shell-pty", action="store_true",
995 ap.add_argument("-n", "--no-history", action="store_true",