Read about our upcoming Code of Conduct on this issue

Commit 8b508a55 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU: 80D file I/O support from main firmware

(experimental, tested with "dumpf" in the serial console)

--HG--
branch : qemu
parent 4e1b65ea75df
......@@ -3571,7 +3571,7 @@ static void sdio_send_command(SDIOState *sd)
if (rlen < 0)
goto error;
if (sd->cmd_flags != 0x11 && sd->cmd_flags != 0x1) {
if (sd->cmd_flags != 0x11) {
#define RWORD(n) (((uint32_t)response[n] << 24) | (response[n + 1] << 16) \
| (response[n + 2] << 8) | response[n + 3])
if (rlen == 0)
......@@ -3695,7 +3695,7 @@ static void sdio_trigger_interrupt(EOSState *s)
SDIOState *sd = &s->sd;
/* after a successful operation, trigger interrupt if requested */
if ((sd->cmd_flags == 0x13 || sd->cmd_flags == 0x14 || sd->cmd_flags == 0x04)
if ((sd->cmd_flags == 0x13 || sd->cmd_flags == 0x14)
&& !(sd->status & SDIO_STATUS_DATA_AVAILABLE))
{
/* if the current command does a data transfer, don't trigger until complete */
......@@ -3781,7 +3781,7 @@ unsigned int eos_handle_sdio ( unsigned int parm, EOSState *s, unsigned int addr
}
else
{
if (value == 0x13) /* also 0x03? */
if (value == 0x13)
{
/* write transfer */
s->sd.pio_transferred_bytes = 0;
......@@ -3792,6 +3792,10 @@ unsigned int eos_handle_sdio ( unsigned int parm, EOSState *s, unsigned int addr
sdio_trigger_interrupt(s);
}
}
else
{
ret = 0x10;
}
break;
case 0x10:
......@@ -3817,10 +3821,9 @@ unsigned int eos_handle_sdio ( unsigned int parm, EOSState *s, unsigned int addr
MMIO_VAR(s->sd.irq_flags);
/* sometimes, a write command ends with this register
* other times, it ends with SDDMA register 0x78/0x38
* other times, it ends with SDDMA register 0x10 (mask 0x1F)
*/
if (s->sd.cmd_flags == 0x13 && s->sd.dma_enabled && value)
if (s->sd.cmd_flags == 0x13 && value)
{
sdio_write_data(s);
}
......@@ -3992,10 +3995,17 @@ unsigned int eos_handle_sddma ( unsigned int parm, EOSState *s, unsigned int add
}
break;
case 0x10:
msg = "Flags/Status";
msg = "Command/Status?";
if (type & MODE_WRITE)
{
s->sd.dma_enabled = value & 1;
/* DMA transfer? */
if (s->sd.cmd_flags == 0x13 && s->sd.dma_enabled)
{
sdio_write_data(s);
sdio_trigger_interrupt(s);
}
}
break;
case 0x14:
......@@ -4003,15 +4013,6 @@ unsigned int eos_handle_sddma ( unsigned int parm, EOSState *s, unsigned int add
ret = (s->sd.dma_enabled) ? 0x81 : 0;
break;
case 0x18:
msg = "Transfer start?";
/* DMA transfer? */
if (s->sd.cmd_flags == 0x13)
{
sdio_write_data(s);
sdio_trigger_interrupt(s);
}
break;
}
......
......@@ -11,7 +11,7 @@
* Even if it crashes, the SD card is initialized and the firmware can save files to the virtual card.
* Working (menu navigation, card format): 60D 500D 550D 600D 650D 700D 1100D 1200D.
* Working (menu navigation, card recognized): 450D 1000D.
* Assert at EstimatedSize, dumpf works: 5D3 6D 70D 100D EOSM2.
* Assert at EstimatedSize, dumpf works: 5D3 6D 70D 80D 100D EOSM2.
* Not working EOSM.
*
* With CF card support (use PROP_CARD1_EXISTS, 0x21 -> 0x20):
......
......@@ -17,6 +17,16 @@ if 1
# startupPrepareDevelop
set *(int*)0xFE0D52C2 = 0x4770
# EstimatedSize
b *0xFE19B06A
commands
silent
print_current_location
printf "EstimatedSize %d\n", $r0
set $r0 = 0x7D0
c
end
end
source patch-footer.gdb
cc6eae66d2b11d90957c807e0677846d calls-main.log
1b3c1ff8215dadcfcdbeec9cbc818c9f calls-main.idc
6f983c8f4d0ae0eb18dbce62ababebde calls-main-basic.log
db8764a8b1f681e540601fc53c1cf241 calls-main-basic.idc
ff24f7e5505371942ae56493a6e038c7 calls-main.log
c6e226ecd657b160dce3f5ccdf50954b calls-main.idc
0016e8e789a09f5f6831174f754881f6 calls-main-basic.log
9037671a5467d3a0cf646bf4efe1fa1f calls-main-basic.idc
109a46faff51b6f4e179a73200d3eaa3 calls-main.log
b4e8029b41195cf174ee8e06b43deefd calls-main.idc
6599a87a3daf8815d917e11492671893 calls-main-basic.log
3e10c34479eabbf9c26d2a22085b9b60 calls-main-basic.idc
126881802ae10d91c3b1f64c5c652f7b calls-main.log
c66f0eafea9dab3f8e7b65ee631e5140 calls-main.idc
1e6e6a5841187e5e5145b3c8f1e599b4 calls-main-basic.log
535e5953bea9379d3193c5685cf72bba calls-main-basic.idc
9db97d11e906dbf539397489e573160c calls-main.log
e7170dede1b9272e91d5cc892a01dbf8 calls-main.idc
555da536f64107cd54e26813026f8fa5 calls-main-basic.log
876a1350a638e72348467c6ea641d5b1 calls-main-basic.idc
902effff2926b1457d74cb4984d3e34b calls-main.log
395674f01065be874b552123a3756db1 calls-main.idc
0304b3a65680b58db8becda74911c886 calls-main-basic.log
3c46097203377fc4e97104cb7f2a3a18 calls-main-basic.idc
d1994162235ea6553e29ff766a7237dc calls-main.log
7808d4c9456f6d89279665a3d2a1923d calls-main.idc
587f17e427110d10aeaeb2f6dd05a014 calls-main-basic.log
ed7840e366ed5f259a159a84f118ed60 calls-main-basic.idc
0e4e11cd74d506a9ce0b3da3be3937fe calls-main.log
1dc0a2864ea6b57be121ad3f286dcf9b calls-main.idc
2e9df9be556f060cfafa3127c72eec83 calls-main-basic.log
d85830018488768dd1e33c6717778a77 calls-main-basic.idc
73a5d5f8f10b516392c9405aff99e43f calls-main.log
7ba398ed4a6ef321aa99b7e225c69bb8 calls-main.idc
afbb7a1e5836594112d474666a0f6348 calls-main-basic.log
4e5a1b40120bfdb84cd676bb48e0eb37 calls-main-basic.idc
b8c16fbc8836b39effeb9562c29de601 calls-main.log
7c5291f6f852dac04f2eeb9456934110 calls-main.idc
7e0e3ddb5355fe5168900ed0fdfafab3 calls-main-basic.log
b8cdbcac55763f74d7f85bd64fde34cb calls-main-basic.idc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment