Skip to content

Commit a36e63b

Browse files
committed
Fix DMA rounding issue
1 parent 77aca10 commit a36e63b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

iop/cmdHandler.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ unsigned int
129129
pkoSendSifCmd(unsigned int cmd, void *src, unsigned int len)
130130
{
131131
unsigned int dmaId;
132+
unsigned int dmaLen;
132133

133134
rpc_data[0] = cmd;
134135

@@ -137,7 +138,12 @@ pkoSendSifCmd(unsigned int cmd, void *src, unsigned int len)
137138

138139
len = len > sizeof(rpc_data) ? sizeof(rpc_data) : len;
139140

140-
dmaId = pkoSetSifDma(PKO_DMA_DEST, rpc_data, len, 4);
141+
/* Round DMA size up to 16-byte boundary — real HW SIF DMA
142+
requires aligned transfer sizes. rpc_data is 1KB so the
143+
extra bytes are just trailing zeros. */
144+
dmaLen = (len + 15) & ~15;
145+
146+
dmaId = pkoSetSifDma(PKO_DMA_DEST, rpc_data, dmaLen, 4);
141147

142148
if (dmaId == 0) {
143149
printf("IOP: sifSendCmd %x failed\n", cmd);

0 commit comments

Comments
 (0)