Lines Matching +full:x +full:- +full:rp

1 // SPDX-License-Identifier: GPL-2.0-or-later
10 * acknowledged. Full credit goes to them - any problems within this code
24 * @rp: pointer to current risc program position
25 * @sglist: pointer to "scatter-gather list" of buffer pointers
27 * @sync_line: 0 -> no sync, 1 -> odd sync, 2 -> even sync
33 static __le32 *tw68_risc_field(__le32 *rp, struct scatterlist *sglist, in tw68_risc_field() argument
42 *(rp++) = cpu_to_le32(RISC_JUMP); in tw68_risc_field()
43 *(rp++) = 0; in tw68_risc_field()
48 *(rp++) = cpu_to_le32(RISC_SYNCO); in tw68_risc_field()
50 *(rp++) = cpu_to_le32(RISC_SYNCE); in tw68_risc_field()
51 *(rp++) = 0; in tw68_risc_field()
58 offset -= sg_dma_len(sg); in tw68_risc_field()
61 if (bpl <= sg_dma_len(sg) - offset) { in tw68_risc_field()
63 *(rp++) = cpu_to_le32(RISC_LINESTART | in tw68_risc_field()
65 *(rp++) = cpu_to_le32(sg_dma_address(sg) + offset); in tw68_risc_field()
72 * given by the scatter-gather list. in tw68_risc_field()
76 done = (sg_dma_len(sg) - offset); in tw68_risc_field()
77 *(rp++) = cpu_to_le32(RISC_LINESTART | in tw68_risc_field()
80 *(rp++) = cpu_to_le32(sg_dma_address(sg) + offset); in tw68_risc_field()
81 todo -= done; in tw68_risc_field()
85 *(rp++) = cpu_to_le32(RISC_INLINE | in tw68_risc_field()
88 *(rp++) = cpu_to_le32(sg_dma_address(sg)); in tw68_risc_field()
89 todo -= sg_dma_len(sg); in tw68_risc_field()
94 /* final chunk - offset 0, count 'todo' */ in tw68_risc_field()
95 *(rp++) = cpu_to_le32(RISC_INLINE | in tw68_risc_field()
98 *(rp++) = cpu_to_le32(sg_dma_address(sg)); in tw68_risc_field()
105 return rp; in tw68_risc_field()
111 * This routine is called by tw68-video. It allocates
119 * @sglist: scatter-gather list entry
138 __le32 *rp; in tw68_risc_buffer() local
153 buf->size = instructions * 8; in tw68_risc_buffer()
154 buf->cpu = dma_alloc_coherent(&pci->dev, buf->size, &buf->dma, in tw68_risc_buffer()
156 if (buf->cpu == NULL) in tw68_risc_buffer()
157 return -ENOMEM; in tw68_risc_buffer()
160 rp = buf->cpu; in tw68_risc_buffer()
162 rp = tw68_risc_field(rp, sglist, top_offset, 1, in tw68_risc_buffer()
165 rp = tw68_risc_field(rp, sglist, bottom_offset, 2, in tw68_risc_buffer()
169 buf->jmp = rp; in tw68_risc_buffer()
170 buf->cpu[1] = cpu_to_le32(buf->dma + 8); in tw68_risc_buffer()
172 BUG_ON((buf->jmp - buf->cpu + 2) * sizeof(buf->cpu[0]) > buf->size); in tw68_risc_buffer()
177 /* ------------------------------------------------------------------ */
199 pr_debug("0x%08x [ INVALID ]\n", risc);
202 pr_debug("0x%08x %-9s IRQ=%d",
207 pr_debug(" Start=0x%03x Count=%03u",
210 pr_debug(" StartAddr=0x%08x", addr);
218 pr_debug("%s: risc_program_dump: risc=%p, buf->cpu=0x%p, buf->jmp=0x%p\n",
219 core->name, buf, buf->cpu, buf->jmp);
220 for (addr = buf->cpu; addr <= buf->jmp; addr += 2)