Read about our upcoming Code of Conduct on this issue

Commit 66f538f6 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

QEMU: moved 7D2 patches to GDB scripts;

initial GDB script for 7D2 slave

--HG--
branch : qemu
parent 74a881d3c001
......@@ -1329,31 +1329,6 @@ static EOSState *eos_init_cpu(struct eos_model_desc * model)
return s;
}
static void patch_7D2(EOSState *s)
{
int is_7d2m = (eos_get_mem_w(s, 0xFE106062) == 0x0F31EE19);
if (is_7d2m)
{
uint32_t nop = 0x8000F3AF;
uint32_t ret = 0x00004770;
uint32_t one = 1;
fprintf(stderr, "Patching 0x%X (enabling TIO on 7D2M)\n", 0xFEC4DCBC);
MEM_WRITE_ROM(0xFEC4DCBC, (uint8_t*) &one, 4);
MEM_WRITE_ROM(0xFE0A3024, (uint8_t*) &nop, 4);
fprintf(stderr, "Patching 0x%X (idk, it fails)\n", 0xFE0A3024);
MEM_WRITE_ROM(0xFE102B5A, (uint8_t*) &ret, 4);
fprintf(stderr, "Patching 0x%X (PROPAD_CreateFROMPropertyHandle)\n", 0xFE102B5A);
}
else
{
fprintf(stderr, "This ROM doesn't look like a 7D2M\n");
}
}
static void patch_EOSM3(EOSState *s)
{
fprintf(stderr, "Patching 0xFCC637A8 (enabling TIO)\n");
......@@ -1504,13 +1479,6 @@ static void eos_init_common(MachineState *machine)
uint32_t flag = 0;
MEM_WRITE_ROM(s->model->bootflags_addr + 0x24, (uint8_t*) &flag, 4);
}
if ((strcmp(s->model->name, "7D2M") == 0) ||
(strcmp(s->model->name, "7D2S") == 0))
{
/* 7D2 experiments */
patch_7D2(s);
}
if (strcmp(s->model->name, "EOSM3") == 0)
{
......
......@@ -380,6 +380,7 @@ struct eos_model_desc eos_model_list[] = {
{
.name = "7D2S",
.digic_version = 6,
.current_task_addr = 0x44EC,
.card_led_address = 0xD20B0C34, /* not sure */
.ram_manufacturer_id = 0x18000103, /* 80D bootloader */
},
......
......@@ -2,9 +2,10 @@
# ./run_canon_fw.sh 7D2M -d debugmsg -s -S & arm-none-eabi-gdb -x 7D2M/debugmsg.gdb
source -v debug-logging.gdb
source -v 7D2M/patches.gdb
# To get debugging symbols from Magic Lantern, uncomment this:
#symbol-file ../magic-lantern/platform/7D2M.104/magiclantern
#symbol-file ../magic-lantern/platform/7D2.104/magiclantern
macro define CURRENT_TASK 0x28568
macro define CURRENT_ISR (*(int*)0x28544 ? (*(int*)0x28548) : 0)
......
# ./run_canon_fw.sh EOSM -s -S & arm-none-eabi-gdb -x EOSM/patches.gdb
# Only patches required for emulation
source patch-header.gdb
# enable TIO (required to print DryOS version)
set *(int*)0xFEC4DCBC = 1
# PROPAD_CreateFROMPropertyHandle
set *(int*)0xFE102B5A = 0x4770
source patch-footer.gdb
# ./run_canon_fw.sh 7D2S -d debugmsg
# ./run_canon_fw.sh 7D2S -d debugmsg -s -S & arm-none-eabi-gdb -x 7D2S/debugmsg.gdb
source -v debug-logging.gdb
macro define CURRENT_TASK 0x44EC
macro define CURRENT_ISR (*(int*)0x44C8 ? (*(int*)0x44CC) : 0)
# GDB hook is very slow; -d debugmsg is much faster
# ./run_canon_fw.sh will use this address, don't delete it
# b *0x236
# DebugMsg_log
b *0x1AB0
task_create_log
b *0x16D8
register_interrupt_log
cont
......@@ -118,7 +118,7 @@ define print_current_location
printf "["
if CURRENT_ISR > 0
KRED
printf " INT-%02Xh:%08x ", CURRENT_ISR, $r14-4
printf " INT-%02Xh:%08x ", CURRENT_ISR, $r14-4
else
if $_thread == 1
KCYN
......
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