Lines Matching +full:bit +full:- +full:banging

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
101 log.info("Setting buffer list, length, and stream id and traffic priority bit")
106 self.regs.LVI = self.n_bufs - 1
179 # set enter reset bit
182 # clear enter reset bit to exit reset
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)")
357 paddr = (struct.unpack("Q", pent)[0] & ((1 << 55) - 1)) * PAGESZ
361 # Maps a PCI BAR and returns the in-process address
392 def mask(bit): argument
394 return 0b1 << bit
433 sd.CTL = 1 << 20 # Set stream ID to anything non-zero
437 sd.LVI = num_bufs - 1
443 # full" bit on the other side that only works with this enabled.
460 # sleep seems to be needed; if we're banging on the memory window
472 ipcval = ( (1 << 31) # BUSY bit
501 fw_bytes += b'\x00' * (512 * 1024 - len(fw_bytes))
522 dsp.HFDSSCS &= ~(1 << 16) # clear SPA bit
524 # wait for CPA bit clear
530 dsp.HFDSSCS |= (1 << 16) # set SPA bit
531 time.sleep(0.002) # needed as the CPA bit may be unstable
532 # wait for CPA bit
538 dsp.HFPWRCTL |= 0x1 # set SPA bit
539 time.sleep(0.002) # needed as the CPA bit may be unstable
540 # wait for CPA bit
558 sd.CTL |= (1 << 20) # Set stream ID to anything non-zero
562 sd.LVI = num_bufs - 1
568 # full" bit on the other side that only works with this enabled.
578 ipcval = ( (1 << 31) # BUSY bit
594 log.info("Waiting for IPC busy bit clear")
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):
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")
938 …#TODO this bit me, remove the globals, write a little FirmwareLoader class or something to contain.
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",