In this case, the contents of boot-hack.c are identical on dm-spy-experiments-EOSM2.103 (de9f09df06e7) and EOSM2.103_wip (495f8c25235c):
hg diff -r 495f8c25235c -r de9f09df06e7 src/boot-hack.c
(no output)
In other words, it does not contain the dm-spy changes.
In my merge tool (Meld), if they are conflicts, I should first solve them, and then select Merge all. Sometimes I forget to select "Merge all" and run into similar errors - that's probably what happened on my side with 2214781fcb95. In this case I redo the merge and/or compare the merged changeset with both ancestors. For example, between dm-spy-experiments and dm-spy-experiments-EOSM2.103 I expect to see only the M2 changes, for example:
diff -r 63d4b3396a5f -r 501eb2ccd140 src/boot-hack.c
--- a/src/boot-hack.c
+++ b/src/boot-hack.c
@@ -660,31 +660,32 @@
uint32_t* addr_AllocMem_end = (void*)(CreateTaskMain_reloc_buf + ROM_ALLOCMEM_END + CreateTaskMain_offset);
uint32_t* addr_BL_AllocMem_init = (void*)(CreateTaskMain_reloc_buf + ROM_ALLOCMEM_INIT + CreateTaskMain_offset);
+ uint32_t* addr_B_CreateTaskMain = (void*)(init_task_reloc_buf + ROM_B_CREATETASK_MAIN + init_task_offset);
- #if defined(CONFIG_550D) || defined(CONFIG_60D) || defined(CONFIG_7D)
- // change end limit to 0xc60000 => reserve 640K for ML
+ #if defined(CONFIG_EOSM2)
+ /* R0: 0x44C000 (start address, easier to patch, change to 0x4E0000 => reserve 592K for ML) */
+ /* R1: 0xD3C000 [6D, 700D] / 0xC3C000 [100D] / 0xD6C000 [EOSM] / 0xC2A000 [EOSM2] (end address, unchanged) */
+ addr_AllocMem_end[1] = MOV_R0_0x4E0000_INSTR;
+ ml_reserved_mem = 0x4E0000 - RESTARTSTART;
+ #elif defined(CONFIG_550D) || defined(CONFIG_60D) || defined(CONFIG_7D)
+ // change end limit from 0xd00000 to 0xc60000 => reserve 640K for ML
*addr_AllocMem_end = MOV_R1_0xC60000_INSTR;
- ml_reserved_mem = 640 * 1024;
+ ml_reserved_mem = 0xD00000 - RESTARTSTART;
#else
- // change end limit to 0xc80000 => reserve 512K for ML
+ // change end limit from 0xd00000 to 0xc80000 => reserve 512K for ML
*addr_AllocMem_end = MOV_R1_0xC80000_INSTR;
- ml_reserved_mem = 512 * 1024;
+ ml_reserved_mem = 0xD00000 - RESTARTSTART;
#endif
// relocating CreateTaskMain does some nasty things, so, right after patching,
// we jump back to ROM version; at least, what's before patching seems to be relocated properly
*addr_BL_AllocMem_init = B_INSTR(addr_BL_AllocMem_init, ROM_ALLOCMEM_INIT);
- uint32_t* addr_B_CreateTaskMain = (void*)init_task_reloc_buf + ROM_B_CREATETASK_MAIN + init_task_offset;
+ // replace call to CreateMainTask (last sub in init_task)
*addr_B_CreateTaskMain = B_INSTR(addr_B_CreateTaskMain, new_CreateTaskMain);
-
- /* FIO_RemoveFile("B:/dump.hex");
- FILE* f = FIO_CreateFile("B:/dump.hex");
- FIO_WriteFile(f, UNCACHEABLE(new_CreateTaskMain), CreateTaskMain_len);
- FIO_CloseFile(f);
-
- NotifyBox(10000, "%x ", new_CreateTaskMain); */
+ /* before we execute code, make sure a) data caches are drained and b) instruction caches are clean */
+ sync_caches();
// Well... let's cross the fingers and call the relocated stuff
return new_init_task;
If you run this, you'll spot the mistake right away:
hg diff -r 63d4b3396a5f -r de9f09df06e7
I've also got differences in edmac-memcpy.c (where hg considered it was a conflict, but in Meld, I only had to select Merge all without changing anything) and in qemu-util.c (which should be deleted).
That said, I've ran 495f8c25235c+2214781fcb95 in QEMU and only seems to work with CONFIG_QEMU=y, but not without. Looking into it.
BTW - two tricks to speed up the compilation:
# only recompiles and installs autoexec.bin, without modules
cd platform/EOSM2.103; make installq ML_MODULES_DYNAMIC=
# requires a tiny change from latest unified (g3gg0 found out yesterday)
make -j4