platform: clean up Acekard platforms and implement DMA#163
Conversation
|
The dma patch code you added looks very similar. Can we avoid duplication? |
|
Not really, because of the different parameters each platform needs:
We could programmatically patch those instructions I suppose, but I haven't tried it. |
I guess another option could be to create an .inc file with the code with some |
I went with a slightly different solution inspired by compactflash-common, and unified all patches under acekard-common. |
b9973f9 to
ec463ab
Compare
This only gets used in IoRpgCmdSdio which is actually a u8 argument.
Use this struct for any platform-specific data that may need injecting into patch codes.
…e shift The C0 command (read SD state) returns the "state" in different bits of the response: - lower halfbyte on AKRPG - upper halfbyte everywhere else This is defined in the PlatformSpecifics struct, so use that to patch the code on the fly instead of using a register to pass this through.
Most of the code is the same, except for the command sent to the card. Use the new PlatformSpecifics struct to change this on the fly.
Now that SdWaitForState no longer requires passing a platform-specific parameter, the patch code becomes exactly the same.
Most of the code is the same, except for the command sent to the card. Use the new PlatformSpecifics struct to change this on the fly.
- push r0-r1 to stack before the sdsc shift - use r1 for readSd SDSC shift now that it's free, freeing up a register - keep r4 as 0x040001a0 across routine
- use r4=0x040001A0 from previous subroutine - use mov/lsls instead of ldr pc, removing unnecessary pool usage - we can assume that when starting the transfer, the previous command used (SdWaitForState) set our MCCNT1 to 0xA7406004, since we need 0xA1406004 we can just strb the 0xA1 instead of loading entire u32 from pool
- Use r4=0x040001A0 from previous subroutine to reduce pool usage
cb34073 to
03317bb
Compare
Uh oh!
There was an error while loading. Please reload this page.