Commit c41b62d9 authored by Chris Miller's avatar Chris Miller
Browse files

5D4: updated the codebase to 1.1.2

3bf2df7, 73990b1, 24dbfdb, c0f8a82, 3e04262 from https://bitbucket.org/chris_miller/ml-fork/branch/5d4-112

--HG--
branch : digic6-dumper
parent 8f0606ad8816
......@@ -4,16 +4,17 @@
source -v debug-logging.gdb
# To get debugging symbols from Magic Lantern, uncomment one of these:
#symbol-file ../magic-lantern/platform/5D4.104/magiclantern
#symbol-file ../magic-lantern/platform/5D4.104/autoexec
#symbol-file ../magic-lantern/platform/5D4.104/stubs.o
#symbol-file ../magic-lantern/platform/5D4.112/magiclantern
#symbol-file ../magic-lantern/platform/5D4.112/autoexec
#symbol-file ../magic-lantern/platform/5D4.112/stubs.o
macro define CURRENT_TASK 0x45A4
macro define CURRENT_ISR (MEM(0x4580) ? MEM(0x4584) : 0)
macro define NULL_STR 0xFFE97155
# GDB hook is very slow; -d debugmsg is much faster
# ./run_canon_fw.sh will use this address, don't delete it
# b *0xFE426B8C
# b *0xC14
# DebugMsg_log
b *0x6D8
......@@ -22,4 +23,13 @@ task_create_log
b *0x38
register_interrupt_log
b *0xFE48CE74
register_func_log
b *0x80001FC0
create_semaphore8_log
b *0x2122
CreateStateObject_log
cont
# 5D Mark IV 1.0.4
# 5D Mark IV 1.1.2
MODEL=5D4
include ../Makefile.platform
# 5D Mark IV 1.0.4
# 5D Mark IV 1.1.2
CANON_NAME_FIR = 5D400104.FIR
CANON_NAME_FIR = 5D400112.FIR
UPDATE_NAME_FIR = DUMP_5D4.FIR
ROMBASEADDR = 0xFE0A0000
......
/*
* 5D Mark IV 1.0.4 consts
* 5D Mark IV 1.1.2 consts
*/
#define CARD_LED_ADDRESS 0xD20B0224
......
/**
* Camera internals for 5D Mark IV 1.0.4
* Camera internals for 5D Mark IV 1.1.2
*/
/** This camera has a DIGIC VI chip */
......
......@@ -2,11 +2,11 @@
* Entry points into the firmware image.
*
* These are the functions that we can call from our tasks
* in the Canon 1.0.4 firmware for the 5D Mark IV.
* in the Canon 1.1.2 firmware for the 5D Mark IV.
*
*/
/*
* Copyright (C) 2017 Magic Lantern Team
* Copyright (C) 2019 Magic Lantern Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -32,36 +32,36 @@
/** Startup **/
NSTUB( ROMBASEADDR, firmware_entry )
NSTUB(0xFE0DD4F5, cstart) /* calls bzero32 and create_init_task(..., init_task, ...) */
NSTUB(0xFE426B84, bzero32) /* zeros out a data structure */
NSTUB(0xFE42662C, create_init_task) /* low-level DryOS initialization */
NSTUB(0xFE428CD0, bzero32) /* zeros out a data structure */
NSTUB(0xFE428778, create_init_task) /* low-level DryOS initialization */
NSTUB(0xFE0DD70D, init_task) /* USER_MEM size checking, dmSetup, termDriverInit, stdlibSetup etc */
/** File I/O **/
NSTUB(0xFE48AD9B, FIO_CloseFile)
NSTUB(0xFE48BF81, FIO_FindClose)
NSTUB(0xFE48BECB, FIO_FindNextEx)
NSTUB(0xFE48AB13, FIO_ReadFile)
NSTUB(0xFE48ABAD, FIO_SeekSkipFile)
NSTUB(0xFE48AC8F, FIO_WriteFile)
NSTUB(0xFE48B735, _FIO_CreateDirectory)
NSTUB(0xFE48A9D3, _FIO_CreateFile)
NSTUB(0xFE48BDF5, _FIO_FindFirstEx)
NSTUB(0xFE48AF21, _FIO_GetFileSize)
NSTUB(0xFE48A929, _FIO_OpenFile)
NSTUB(0xFE48AA83, _FIO_RemoveFile)
NSTUB(0xFE48B4C9, _FIO_RenameFile)
NSTUB(0xFE48D4B3, FIO_CloseFile)
NSTUB(0xFE48E699, FIO_FindClose)
NSTUB(0xFE48E5E3, FIO_FindNextEx)
NSTUB(0xFE48D22B, FIO_ReadFile)
NSTUB(0xFE48D2C5, FIO_SeekSkipFile)
NSTUB(0xFE48D3A7, FIO_WriteFile)
NSTUB(0xFE48DE4D, _FIO_CreateDirectory)
NSTUB(0xFE48D0EB, _FIO_CreateFile)
NSTUB(0xFE48E50D, _FIO_FindFirstEx)
NSTUB(0xFE48D639, _FIO_GetFileSize)
NSTUB(0xFE48D041, _FIO_OpenFile)
NSTUB(0xFE48D19B, _FIO_RemoveFile)
NSTUB(0xFE48DBE1, _FIO_RenameFile)
/** GUI **/
//NSTUB(0x????????, gui_main_struct)
//NSTUB(0x????????, gui_task_list)
NSTUB(0xFE1710B3, GUI_Control)
NSTUB(0xFE49FAFF, SetGUIRequestMode)
NSTUB(0xFE48C60D, gui_init_end) /* EndGuiInit */
NSTUB(0xFE170F0D, gui_main_task)
NSTUB(0xFE171897, GUI_Control)
NSTUB(0xFE4A2287, SetGUIRequestMode)
NSTUB(0xFE48ED25, gui_init_end) /* EndGuiInit */
NSTUB(0xFE1716F1, gui_main_task)
/** ASIF **/
//NSTUB(0x????????, PowerAudioOutput)
NSTUB(0xFE42BB01, SetAudioVolumeOut) // JC Best guess
NSTUB(0xFE42DD19, SetAudioVolumeOut) // JC Best guess
//NSTUB(0x????????, SetNextASIFADCBuffer)
//NSTUB(0x????????, SetNextASIFDACBuffer)
//NSTUB(0x????????, SetSamplingRate)
......@@ -78,20 +78,21 @@ NSTUB(0xFE42BB01, SetAudioVolumeOut) // JC Best guess
// NSTUB(0x????????, dma_memcpy)
/** Debug messages **/
// ROM: 0xFE428CD8
NSTUB(0xC15, DryosDebugMsg) /* prefer the RAM version, to override it easily */
/** Dialog API **/
NSTUB(0xFE4BA9A0, dialog_redraw) /* not checked */
NSTUB(0xFE4BA5D8, dialog_set_property_str) /* not checked */
NSTUB(0xFE4BD128, dialog_redraw) /* not checked */
NSTUB(0xFE4BCD60, dialog_set_property_str) /* not checked */
/** Dialog handlers **/
//NSTUB(0x????????, ErrCardForLVApp_handler)
NSTUB(0xFE5902D3, ErrForCamera_handler) // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c)
NSTUB(0xFE3F92B3, LiveViewApp_handler) // Thumb function, but LSB not set in Canon code, why?
NSTUB(0xFE6E2FA1, LiveViewLevelApp_handler) // fixme: some other app may be at top level in LiveView
NSTUB(0xFE4729CD, PlayMain_handler) // this should be active when reviewing a still image
NSTUB(0xFE2995D1, PlayMovieGuideApp_handler) // this should be active when playing a video
NSTUB(0xFE6DC209, ShootOlcApp_handler) // this should be active in photo mode, outside LiveView
NSTUB(0xFE5941E7, ErrForCamera_handler) // ERR70, ERR80 etc (DlgErrForCamera.c, AJ_DIALOG.HANDLER_DlgErrForCamera.c)
NSTUB(0xFE3FB2F1, LiveViewApp_handler) // Thumb function, but LSB not set in Canon code, why?
NSTUB(0xFE6E7895, LiveViewLevelApp_handler) // fixme: some other app may be at top level in LiveView
NSTUB(0xFE4750E5, PlayMain_handler) // this should be active when reviewing a still image
NSTUB(0xFE29A7A1, PlayMovieGuideApp_handler) // this should be active when playing a video
NSTUB(0xFE6E0AFD, ShootOlcApp_handler) // this should be active in photo mode, outside LiveView
/** EDMAC **/
//NSTUB(0x????????, ConnectReadEDmac)
......@@ -106,42 +107,42 @@ NSTUB(0xFE6DC209, ShootOlcApp_handler) // this should be ac
//NSTUB(0x????????, UnregisterEDmacPopCBR)
/** Electronic Level **/
NSTUB(0xFE4A7F59, GUI_SetRollingPitchingLevelStatus) // JC-C RequestRollingPitching - no side effects :)
NSTUB(0xFE4AA6E1, GUI_SetRollingPitchingLevelStatus) // JC-C RequestRollingPitching - no side effects :)
/** Engio **/
//NSTUB(0x????????, _EngDrvOut) // AJ_EngDrvOut_1xVar_to_ShadowStruct
NSTUB(0xFE4DD624, _engio_write) /* no mirror?! */
NSTUB(0xFE4DFDF8, _engio_write) /* no mirror?! */
//NSTUB(0x????????, shamem_read) // AJ_0x_engio_struct_n_R0_manipulation_to_get_ptr
/** Eventprocs (call by name) **/
NSTUB(0xFE48A7D7, call)
NSTUB(0xFE48CEEF, call)
/** ExMem **/
//NSTUB(0x????????, AddMemoryChunk)
NSTUB(0xFE53A461, AllocateContinuousMemoryResource) // m_pfContAllocMemoryCBR
NSTUB(0xFE53A433, AllocateMemoryResource) // m_pfAllocMemoryCBR
NSTUB(0xFE49A837, CreateMemoryChunk)
NSTUB(0xFE49B2FF, CreateMemorySuite)
NSTUB(0xFE49B019, DeleteMemorySuite) // or FEA8E248?
NSTUB(0xFE53A507, FreeMemoryResource) // m_pfFreeMemoryCBR
NSTUB(0xFEA8E0B9, GetFirstChunkFromSuite) // or FE49AE88?
NSTUB(0xFE49AC89, GetMemoryAddressOfMemoryChunk)
NSTUB(0xFE49B705, GetNextMemoryChunk)
NSTUB(0xFE47CFA3, SRM_AllocateMemoryResourceFor1stJob)
NSTUB(0xFE47F893, SRM_FreeMemoryResourceFor1stJob)
NSTUB(0xFE53DFED, AllocateContinuousMemoryResource) // m_pfContAllocMemoryCBR
NSTUB(0xFE53DFBF, AllocateMemoryResource) // m_pfAllocMemoryCBR
NSTUB(0xFE49CFBF, CreateMemoryChunk)
NSTUB(0xFE49DA87, CreateMemorySuite)
NSTUB(0xFE49D7A1, DeleteMemorySuite) // or FEA8E248?
NSTUB(0xFE53E093, FreeMemoryResource) // m_pfFreeMemoryCBR
NSTUB(0xFEA944A9, GetFirstChunkFromSuite) // or FE49AE88?
NSTUB(0xFE49D411, GetMemoryAddressOfMemoryChunk)
NSTUB(0xFE49DE8D, GetNextMemoryChunk)
NSTUB(0xFE47F6BB, SRM_AllocateMemoryResourceFor1stJob)
NSTUB(0xFE481FAB, SRM_FreeMemoryResourceFor1stJob)
/** GUI timers **/
NSTUB(0xFE55F219, CancelDateTimer) // Look for "CancelDateTimer" or "StopDateTimer" (7D)
NSTUB(0xFE49F327, CancelTimer)
NSTUB(0xFE3275EF, SetHPTimerAfterNow)
NSTUB(0xFE32763F, SetHPTimerNextTick)
NSTUB(0xFE49F2B1, SetTimerAfter)
NSTUB(0xFE562FD5, CancelDateTimer) // Look for "CancelDateTimer" or "StopDateTimer" (7D)
NSTUB(0xFE4A1AAF, CancelTimer)
NSTUB(0xFE328A63, SetHPTimerAfterNow)
NSTUB(0xFE328AB3, SetHPTimerNextTick)
NSTUB(0xFE4A1A39, SetTimerAfter)
/** Interrupts **/
NSTUB( 0x4560, pre_isr_hook)
NSTUB( 0x4564, post_isr_hook)
NSTUB( 0x1F790, isr_table_handler)
NSTUB( 0x1F794, isr_table_param)
NSTUB( 0x1F968, isr_table_handler)
NSTUB( 0x1F96C, isr_table_param)
/** Making the card bootable **/
//NSTUB(0x????????, sd_device)
......@@ -152,10 +153,10 @@ NSTUB(0x80004AAB, _AllocateMemory)
NSTUB(0x80004C45, _FreeMemory)
NSTUB(0x80004955, GetMemoryInformation)
NSTUB(0x80004929, GetSizeOfMaxRegion)
NSTUB(0xFE426AB5, _alloc_dma_memory)
NSTUB(0xFE426AED, _free_dma_memory)
NSTUB(0xFE342681, _malloc)
NSTUB(0xFE3426B7, _free)
NSTUB(0xFE428C01, _alloc_dma_memory)
NSTUB(0xFE428C39, _free_dma_memory)
NSTUB(0xFE343D61, _malloc)
NSTUB(0xFE343D97, _free)
/** Message queues **/
NSTUB( 0x1E2B, msg_queue_count) /* used in "[TASK ERROR] GetNumOfEvent" */
......@@ -167,10 +168,10 @@ NSTUB( 0x1CA1, msg_queue_receive) /* ReceiveMessageQueue */
//NSTUB(0x????????, ptp_register_handler)
/** Properties **/
NSTUB(0xFE49C89B, _prop_cleanup) /* called at the end of property handlers */
NSTUB(0xFE42AA9F, _prop_request_change) /* pRequestChange */
NSTUB(0xFE49C80B, prop_deliver) /* pDeliverProperty */
NSTUB(0xFE49C2B3, prop_register_slave) /* pRegisterSlave */
NSTUB(0xFE49F023, _prop_cleanup) /* called at the end of property handlers */
NSTUB(0xFE42CCB7, _prop_request_change) /* pRequestChange */
NSTUB(0xFE49EF93, prop_deliver) /* pDeliverProperty */
NSTUB(0xFE49EA3B, prop_register_slave) /* pRegisterSlave */
/** Recursive locks **/
//NSTUB(0x????????, AcquireRecursiveLock) // AJ_KernelDry_KerRLock.c
......@@ -178,9 +179,9 @@ NSTUB(0xFE49C2B3, prop_register_slave) /* pRegisterSlave */
//NSTUB(0x????????, ReleaseRecursiveLock) // AJ_KernelDry_KerRLock.c_p2
/** ResLock **/
NSTUB(0xFE9F11F9, CreateResLockEntry)
NSTUB(0xFE9F13DB, LockEngineResources)
NSTUB(0xFE2ED5A9, UnLockEngineResources)
NSTUB(0xFE9F6865, CreateResLockEntry)
NSTUB(0xFE9F6A47, LockEngineResources)
NSTUB(0xFE2EE86D, UnLockEngineResources)
/** Semaphores **/
NSTUB( 0x1D1, create_named_semaphore) /* CreateBinarySemaphore */
......@@ -202,23 +203,23 @@ NSTUB( 0x6D9, task_create)
//NSTUB(0x????????, task_trampoline)
/** Misc **/
NSTUB(0xFE4C205D, FSUunMountDevice)
NSTUB(0xFE35DB17, LoadCalendarFromRTC)
NSTUB(0xFE959E11, vsnprintf)
NSTUB(0xFE4C47E5, FSUunMountDevice)
NSTUB(0xFE35F217, LoadCalendarFromRTC)
NSTUB(0xFE95F425, vsnprintf)
/** Logging experiments */
NSTUB(0xFE1296EF, dump_file)
NSTUB(0xFE129BEF, dump_file)
/** MPU communication **/
NSTUB(0xFE290297, mpu_send) // "dwSize < TXBD_DATA_SIZE"
NSTUB(0xFE3254CB, mpu_recv) // passed as last argument by InitializeIntercom and eventually stored into mpu_recv_cbr
NSTUB( 0x7A4C, mpu_recv_cbr) // mpu_recv is called indirectly through this function pointer
NSTUB( 0x32D0C, mpu_send_ring_buffer) // ring buffer used in mpu_send
NSTUB( 0x7A30, mpu_send_ring_buffer_tail) // ring buffer index incremented in mpu_send
NSTUB( 0x32BCC, mpu_recv_ring_buffer) // ring buffer used in SIO3_ISR, subroutine that processes two chars at a time
NSTUB( 0x7A28, mpu_recv_ring_buffer_tail) // ring buffer index incremented in the above subroutine
NSTUB(0xFE291317, mpu_send) // "dwSize < TXBD_DATA_SIZE"
NSTUB(0xFE32693F, mpu_recv) // passed as last argument by InitializeIntercom and eventually stored into mpu_recv_cbr
NSTUB( 0x7A64, mpu_recv_cbr) // mpu_recv is called indirectly through this function pointer
NSTUB( 0x32EEC, mpu_send_ring_buffer) // ring buffer used in mpu_send
NSTUB( 0x7A48, mpu_send_ring_buffer_tail) // ring buffer index incremented in mpu_send
NSTUB( 0x32DAC, mpu_recv_ring_buffer) // ring buffer used in SIO3_ISR, subroutine that processes two chars at a time
NSTUB( 0x7A40, mpu_recv_ring_buffer_tail) // ring buffer index incremented in the above subroutine
/** Memory info **/
NSTUB(0xFE29EDAD, malloc_info) // Thumb
NSTUB(0xFE29EE45, sysmem_info) // Thumb
NSTUB(0xFE2DF101, smemShowFix) // Thumb
NSTUB(0xFE29FF7D, malloc_info) // Thumb
NSTUB(0xFE2A0015, sysmem_info) // Thumb
NSTUB(0xFE2E02D1, smemShowFix) // Thumb
......@@ -2,7 +2,7 @@ PLATFORM_MAP = \
5D3.113 \
5D3.123 \
5D2.212 \
5D4.104 \
5D4.112 \
5DS.111 \
5DSR.112 \
6D.116 \
......
......@@ -27,7 +27,7 @@
#define SIG_200D_101 0xf72c729a // from E0040000
#define SIG_M50_101 0x80bd9b4b // from E0040000
#define SIG_R_110 0x64132108 // from E0040000
#define SIG_5D4_104 0x71adcc14 // from FE0A0000
#define SIG_5D4_112 0xf3316d96 // from FE0A0000
#define SIG_5DS_111 0x6f867e6a // from FE0A0000
#define SIG_5DSR_112 0xc60c4679 // from FE0A0000
#define SIG_7D2_104 0x9c68409c // from FE0A0000
......
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