diff --git a/build/libraries/init/ARM7/Makefile b/build/libraries/init/ARM7/Makefile index 2db293a0..9be2e1f7 100644 --- a/build/libraries/init/ARM7/Makefile +++ b/build/libraries/init/ARM7/Makefile @@ -12,8 +12,8 @@ # in whole or in part, without the prior written consent of Nintendo. # # $Date:: $ -# $Rev:$ -# $Author:$ +# $Rev$ +# $Author$ #---------------------------------------------------------------------------- SUBDIRS = @@ -29,9 +29,12 @@ TWL_NO_STD_PCHDR = True # Avoid to build THUMB version object override TWL_CODEGEN = ARM -SRCS = crt0_firm.c +SRCDIR = . ../common +SRCS = crt0_firm.c \ + crt0_jtag.c \ -TARGET_OBJ = crt0_firm.o +TARGET_OBJ = crt0_firm.o \ + crt0_jtag.o \ MACRO_FLAGS += -DSDK_NOINIT diff --git a/build/libraries/init/ARM9/Makefile b/build/libraries/init/ARM9/Makefile index 7b3753e9..0160e317 100644 --- a/build/libraries/init/ARM9/Makefile +++ b/build/libraries/init/ARM9/Makefile @@ -12,8 +12,8 @@ # in whole or in part, without the prior written consent of Nintendo. # # $Date:: $ -# $Rev:$ -# $Author:$ +# $Rev$ +# $Author$ #---------------------------------------------------------------------------- SUBDIRS = @@ -26,9 +26,12 @@ TWL_NO_STD_PCHDR = True # Avoid to build THUMB version object override TWL_CODEGEN = ARM -SRCS = crt0_firm.c +SRCDIR = . ../common +SRCS = crt0_firm.c \ + crt0_jtag.c \ -TARGET_OBJ = crt0_firm.o +TARGET_OBJ = crt0_firm.o \ + crt0_jtag.o \ MACRO_FLAGS += -DSDK_NOINIT diff --git a/build/libraries/init/common/crt0_jtag.c b/build/libraries/init/common/crt0_jtag.c new file mode 100644 index 00000000..b65eec15 --- /dev/null +++ b/build/libraries/init/common/crt0_jtag.c @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------* + Project: TwlIPL - libraries - init + File: crt0_jtag.c + + Copyright 2008 Nintendo. All rights reserved. + + These coded instructions, statements, and computer programs contain + proprietary information of Nintendo of America Inc. and/or Nintendo + Company Ltd., and are protected by Federal copyright law. They may + not be disclosed to third parties or copied or duplicated in any form, + in whole or in part, without the prior written consent of Nintendo. + + $Date:: #$ + $Rev: $ + $Author: $ + *---------------------------------------------------------------------------*/ +#include + +#include + +void _start(void); + +void* const _start_ModuleParams[]; +void* const _start_LtdModuleParams[]; + +/*---------------------------------------------------------------------------* + Name: _start + Description: 起動ベクタ。 + Arguments: なし。 + Returns: なし。 + *---------------------------------------------------------------------------*/ +void _start( void ); + +asm void _start( void ) +{ +#ifdef SDK_ARM7 + ldr r3, =REG_JTAG_ADDR + ldr r0, =REG_SCFG_JTAG_DSPJE_MASK | REG_SCFG_JTAG_CPUJE_MASK | REG_SCFG_JTAG_ARM7SEL_MASK + strh r0, [r3] +#endif + +@10: + b @10 + + // link for compstatic.TWL + ldr r0, =_start_ModuleParams + ldr r0, =_start_LtdModuleParams +} + +#include diff --git a/build/norfirm/firm-dev/ARM7/Makefile b/build/norfirm/firm-dev/ARM7/Makefile index 97c1de2a..45677a3c 100644 --- a/build/norfirm/firm-dev/ARM7/Makefile +++ b/build/norfirm/firm-dev/ARM7/Makefile @@ -12,10 +12,12 @@ # in whole or in part, without the prior written consent of Nintendo. # # $Date:: $ -# $Rev:$ -# $Author:$ +# $Rev$ +# $Author$ #---------------------------------------------------------------------------- +FIRM_ONLY_JTAG = TRUE + TWL_PROC = ARM7 SUBDIRS = @@ -26,11 +28,14 @@ LINCLUDES = ../include TARGET_BIN = firm_dev7.tef -CRT0_O = crt0_firm.o - SRCS = \ main.c \ +CRT0_O = crt0_firm.o +ifdef FIRM_ONLY_JTAG +CRT0_O += crt0_jtag.o +endif + #SRCDIR = # using default #LCFILE = # using default diff --git a/build/norfirm/firm-dev/ARM9/Makefile b/build/norfirm/firm-dev/ARM9/Makefile index 6b2904e5..57ee070b 100644 --- a/build/norfirm/firm-dev/ARM9/Makefile +++ b/build/norfirm/firm-dev/ARM9/Makefile @@ -12,10 +12,12 @@ # in whole or in part, without the prior written consent of Nintendo. # # $Date:: $ -# $Rev:$ -# $Author:$ +# $Rev$ +# $Author$ #---------------------------------------------------------------------------- +FIRM_ONLY_JTAG = TRUE + SUBDIRS = LINCLUDES = ../include @@ -27,6 +29,9 @@ TARGET_BIN = firm_dev9.srl SRCS = main.c CRT0_O = crt0_firm.o +ifdef FIRM_ONLY_JTAG +CRT0_O += crt0_jtag.o +endif MAKEROM_ARM7 = ../ARM7/bin/$(TWL_BUILDTYPE_ARM7)/firm_dev7.tef MAKEROM_ARM7_BASE = $(basename $(MAKEROM_ARM7))