Skip to content

Commit

Permalink
Fixed rsp_core.c related porting mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostlyDark committed Jan 27, 2024
1 parent 4dab3e2 commit d0e3dc8
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/device/rcp/rsp/rsp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma)
dramaddr+=skip;
}

sp->regs[SP_MEM_ADDR_REG] = memaddr & 0xfff;
sp->regs[SP_DRAM_ADDR_REG] = dramaddr & 0xffffff;
sp->regs[SP_RD_LEN_REG] = 0xff8;
sp->regs[SP_MEM_ADDR_REG] = memaddr & 0xfff;
sp->regs[SP_DRAM_ADDR_REG] = dramaddr & 0xffffff;
sp->regs[SP_RD_LEN_REG] = 0xff8;
}
else
{
Expand All @@ -82,9 +82,9 @@ static void do_sp_dma(struct rsp_core* sp, const struct sp_dma* dma)
dramaddr+=skip;
}

sp->regs[SP_MEM_ADDR_REG] = memaddr & 0xfff;
sp->regs[SP_DRAM_ADDR_REG] = dramaddr & 0xffffff;
sp->regs[SP_RD_LEN_REG] = 0xff8;
sp->regs[SP_MEM_ADDR_REG] = memaddr & 0xfff;
sp->regs[SP_DRAM_ADDR_REG] = dramaddr & 0xffffff;
sp->regs[SP_RD_LEN_REG] = 0xff8;
}

/* schedule end of dma event */
Expand Down Expand Up @@ -172,7 +172,7 @@ static void update_sp_status(struct rsp_core* sp, uint32_t w)

/* clear / set signal 0 */
if ((w & 0x600) == 0x200) sp->regs[SP_STATUS_REG] &= ~SP_STATUS_SIG0;
if ((w & 0x600) == 0x400)
if ((w & 0x600) == 0x400) sp->regs[SP_STATUS_REG] |= SP_STATUS_SIG0;

/* clear / set signal 1 */
if ((w & 0x1800) == 0x800) sp->regs[SP_STATUS_REG] &= ~SP_STATUS_SIG1;
Expand Down Expand Up @@ -276,7 +276,6 @@ void write_rsp_regs(void* opaque, uint32_t address, uint32_t value, uint32_t mas
{
case SP_STATUS_REG:
update_sp_status(sp, value & mask);
return;
case SP_DMA_FULL_REG:
case SP_DMA_BUSY_REG:
return;
Expand Down Expand Up @@ -319,7 +318,6 @@ void write_rsp_regs2(void* opaque, uint32_t address, uint32_t value, uint32_t ma
if (reg == SP_PC_REG)
mask &= 0xffc;


masked_write(&sp->regs2[reg], value, mask);
}

Expand Down

0 comments on commit d0e3dc8

Please sign in to comment.