Skip to content
Open

2000D #141

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions platform/1100D.105/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/** The 1100D port is pretty stable, so I think we can enable properties safely. **/
#define CONFIG_PROP_REQUEST_CHANGE

#define CONFIG_HELLO_WORLD

/**
* State object hooks are pieces of code that run in Canon tasks (state objects). See state-object.c .
* They might slow down Canon code, so here you can disable all of them (useful for debugging or early ports)
Expand Down
12 changes: 12 additions & 0 deletions platform/1100D.105/internals.h.cust
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#define CONFIG_EARLY_PORT
#define CONFIG_HELLO_WORLD


#define CONFIG_NEW_TASK_STRUCTS
#define CONFIG_TASK_STRUCT_V2
#define CONFIG_TASK_ATTR_STRUCT_V2

#define CONFIG_DIGIC_IV

#define CONFIG_ALLOCATE_MEMORY_POOL
#define FEATURE_FLASH_TWEAKS
4 changes: 4 additions & 0 deletions platform/2000D.110-my/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Makefile for 2000D / T7 / 1500D

MODEL=2000D
include ../Makefile.platform
12 changes: 12 additions & 0 deletions platform/2000D.110-my/Makefile.platform.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 2000D 1.1.0

CANON_NAME_FIR = CCF26110.FIR
FIRMWARE_ID = 0x80000432

# 32MB ROM, like 1300D
ROMBASEADDR = 0xFE0C0000
PLATFORM_ARCH = armv5te
# Load ML at the end of the AllocateMemory pool
# Default 0x2D0000 - 0xD00000, patched to 0x2D0000 - 0xC80000 (512K for us).
RESTARTSTART = 0xC80000
ML_BOOT_OBJ = boot-d45-ch.o
7 changes: 7 additions & 0 deletions platform/2000D.110-my/Makefile.setup.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Makefile for 2000D

TOP_DIR=../..
ML_AF_PATTERNS_OBJ = n

# 2000D_101.sym is to long
ML_MODULES_SYM_NAME=t7_$(FW_VERSION).sym
23 changes: 23 additions & 0 deletions platform/2000D.110-my/consts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 2000D 1.1.0 consts
*/

#define CARD_LED_ADDRESS 0xC0220134 // http://magiclantern.wikia.com/wiki/Led_addresses
#define LEDON 0x46
#define LEDOFF 0x44

#define HIJACK_CACHE_HACK

#define HIJACK_CACHE_HACK_BSS_END_ADDR 0xfe0c1b74
#define HIJACK_CACHE_HACK_BSS_END_INSTR 0xE3A01732 // should be the correct INSTRUCTION MOV R1, 0xc80000
#define HIJACK_CACHE_HACK_INITTASK_ADDR 0xfe0c3b34

#define HIJACK_INSTR_BL_CSTART 0xFE0C0638
#define HIJACK_INSTR_BSS_END 0xfe0c3b24
#define HIJACK_FIXBR_BZERO32 0xfe0c3a6c
#define HIJACK_FIXBR_CREATE_ITASK 0xfe0c3b0c
#define HIJACK_INSTR_MY_ITASK 0xfe0c3b34

#define HIJACK_TASK_ADDR 0x31170
#define DISPLAY_STATEOBJ (*(struct state_object **)0x318B8)
#define DISPLAY_IS_ON (DISPLAY_STATEOBJ->current_state != 0)
8 changes: 8 additions & 0 deletions platform/2000D.110-my/features.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// for early porting
#undef CONFIG_CRASH_LOG
#undef CONFIG_PROP_REQUEST_CHANGE
#undef CONFIG_AUTOBACKUP_ROM

#define CONFIG_TASK_ATTR_STRUCT_V2
#define CONFIG_TASK_STRUCT_V2
#define CONFIG_ALLOCATE_MEMORY_POOL
3 changes: 3 additions & 0 deletions platform/2000D.110-my/gui.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ifndef _cameraspecific_gui_h_
#define _cameraspecific_gui_h_
#endif
6 changes: 6 additions & 0 deletions platform/2000D.110-my/internals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Camera internals for 2000D 1.1.0
*/
#define CONFIG_DIGIC_IV

#define CONFIG_HELLO_WORLD
44 changes: 44 additions & 0 deletions platform/2000D.110-my/stubs.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/** \file
* Entry points into the firmware image.
*
* These are the functions that we can call from our tasks
* in the Canon 1.1.0 firmware for the 2000D
*
*/
/*
* Copyright (C) 2021 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
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/

#include <stub.h>

// kitor: functions in early ram regions seem to match 1:1 1300D.110

/** Startup **/
NSTUB( ROMBASEADDR, firmware_entry ) // 0xFE0C0000
NSTUB(0xfe0c3a38, cstart) //
NSTUB( 0x29898, bzero32) // called by cstart() rom
NSTUB( 0x5254, create_init_task) // must be called from ram
NSTUB(0xFE129718, init_task) // passed as arg to create_init_task, look for dmSetup

NSTUB( 0x3780, msleep)
NSTUB( 0x55820, bmp_vram_info)
NSTUB( 0x38FC, task_create)

NSTUB(0xfe11f3c8, DryosDebugMsg)
NSTUB(0xfe2bbbc8, vsnprintf) // from DryosDebugMsg
4 changes: 4 additions & 0 deletions platform/2000D.110/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Makefile for 2000D

MODEL=2000D
include ../Makefile.platform
13 changes: 13 additions & 0 deletions platform/2000D.110/Makefile.platform.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 2000D 1.1.0

CANON_NAME_FIR = CCF26110.FIR
FIRMWARE_ID = 0x80000432

# 32MB ROM, like 1300D
ROMBASEADDR = 0xFE0C0000
PLATFORM_ARCH = armv5te
# Load ML at the end of the AllocateMemory pool
# Default 0x2D0000 - 0xD00000, patched to 0x2D0000 - 0xC80000 (512K for us).
RESTARTSTART = 0xC80000
ML_BOOT_OBJ = boot-d45-ch.o
#ML_SRC_EXTRA_OBJS += function_overrides.o
7 changes: 7 additions & 0 deletions platform/2000D.110/Makefile.setup.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Makefile for 2000D

TOP_DIR=../..
ML_AF_PATTERNS_OBJ = n

# 2000D_101.sym is to long
ML_MODULES_SYM_NAME=t7_$(FW_VERSION).sym
17 changes: 17 additions & 0 deletions platform/2000D.110/cfn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <dryos.h>
#include <property.h>
#include <cfn-generic.h>

// look on camera menu or review sites to get custom function numbers

int get_htp() { return GetCFnData(0, 5); }
void set_htp(int value) { SetCFnData(0, 5, value); }

// No MLU on the 1300D :(
int get_mlu() { return 0; }
void set_mlu(int value) { return; }

int cfn_get_af_button_assignment() { return GetCFnData(0, 7); }
void cfn_set_af_button(int value) { SetCFnData(0, 7, value); }

GENERIC_GET_ALO
Loading