From 9c96cb77f003ce39d10d9ee5998e4f90a9b89002 Mon Sep 17 00:00:00 2001 From: nakasima Date: Wed, 3 Dec 2008 00:40:27 +0000 Subject: [PATCH] =?UTF-8?q?main=E3=81=AA=E3=81=97=E3=83=96=E3=83=BC?= =?UTF-8?q?=E3=83=88ROM=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@67 b871894f-2f95-9b40-918c-086798483c85 --- trunk/bootrom/build/bootrom/Makefile | 1 + .../build/bootrom/ctr_bootrom/ARM11/Makefile | 2 +- .../build/bootrom/ctr_bootrom/ARM9/Makefile | 2 +- .../build/bootrom/ctr_bootrom/rom/Makefile | 2 +- .../build/bootrom/jtag-only/ARM11/Makefile | 52 ++++++++++++++++ .../build/bootrom/jtag-only/ARM11/crt0.c | 40 +++++++++++++ .../bootrom/jtag-only/ARM11/crt0_secure.c | 35 +++++++++++ .../build/bootrom/jtag-only/ARM9/Makefile | 51 ++++++++++++++++ .../build/bootrom/jtag-only/ARM9/crt0.c | 46 +++++++++++++++ .../bootrom/jtag-only/ARM9/crt0_secure_sp.c | 35 +++++++++++ .../bootrom/build/bootrom/jtag-only/Makefile | 34 +++++++++++ .../build/bootrom/jtag-only/rom/Makefile | 59 +++++++++++++++++++ .../build/bootrom/jtag-only/rom/crt0.c | 41 +++++++++++++ trunk/bootrom/build/buildtools/commondefs | 37 ++++++------ 14 files changed, 417 insertions(+), 20 deletions(-) create mode 100644 trunk/bootrom/build/bootrom/jtag-only/ARM11/Makefile create mode 100644 trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0.c create mode 100644 trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0_secure.c create mode 100644 trunk/bootrom/build/bootrom/jtag-only/ARM9/Makefile create mode 100644 trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0.c create mode 100644 trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0_secure_sp.c create mode 100644 trunk/bootrom/build/bootrom/jtag-only/Makefile create mode 100644 trunk/bootrom/build/bootrom/jtag-only/rom/Makefile create mode 100644 trunk/bootrom/build/bootrom/jtag-only/rom/crt0.c diff --git a/trunk/bootrom/build/bootrom/Makefile b/trunk/bootrom/build/bootrom/Makefile index 1a91504..c051fb4 100644 --- a/trunk/bootrom/build/bootrom/Makefile +++ b/trunk/bootrom/build/bootrom/Makefile @@ -22,6 +22,7 @@ include $(CTRBROM_ROOT)/build/buildtools/commondefs SUBDIRS = \ ctr_bootrom \ + jtag-only \ #---------------------------------------------------------------------------- diff --git a/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile index e0d8416..cefb653 100644 --- a/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile @@ -1,6 +1,6 @@ #! make -f #---------------------------------------------------------------------------- -# Project: CtrBrom - bootrom - ts +# Project: CtrBrom - bootrom - ctr_bootrom # File: Makefile # # Copyright 2008 Nintendo. All rights reserved. diff --git a/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile index 0be1414..8608e3d 100644 --- a/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile @@ -1,6 +1,6 @@ #! make -f #---------------------------------------------------------------------------- -# Project: CtrBrom - bootrom - ts +# Project: CtrBrom - bootrom - ctr_bootrom # File: Makefile # # Copyright 2008 Nintendo. All rights reserved. diff --git a/trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile index 7546cba..c005ad1 100644 --- a/trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile @@ -1,6 +1,6 @@ #! make -f #---------------------------------------------------------------------------- -# Project: CtrBrom - bootrom - ts +# Project: CtrBrom - bootrom - ctr_bootrom # File: Makefile # # Copyright 2008 Nintendo. All rights reserved. diff --git a/trunk/bootrom/build/bootrom/jtag-only/ARM11/Makefile b/trunk/bootrom/build/bootrom/jtag-only/ARM11/Makefile new file mode 100644 index 0000000..45711c7 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/ARM11/Makefile @@ -0,0 +1,52 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - bootrom - jtag-only +# File: Makefile +# +# 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$ +#---------------------------------------------------------------------------- + +BROM_CUSTOM_CTR0 = TRUE + +SUBDIRS = + +LINCLUDES = ../include + +#---------------------------------------------------------------------------- + +TARGET_BIN = brom11_jtag_only.padbin + +CRT0_O = + +SRCS = \ + crt0.c \ + crt0_secure.c \ + +#SRCDIR = # using default +#LCFILE = # using default + + +include $(CTRBROM_ROOT)/build/buildtools/commondefs + +INSTALL_DIR = .. +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + + +include $(CTRBROM_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0.c b/trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0.c new file mode 100644 index 0000000..9719b79 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0.c @@ -0,0 +1,40 @@ +/*---------------------------------------------------------------------------* + Project: CtrBrom - library - init + File: crt0.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 + +int main( void ); + +/*---------------------------------------------------------------------------* + Name: _start + + Description: Start up + + Arguments: None + + Returns: None. + *---------------------------------------------------------------------------*/ +asm void _start( void ) +{ + PRESERVE8 + + CODE32 // for _start reference + +LSYM(10) + b BSYM(10) +} + diff --git a/trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0_secure.c b/trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0_secure.c new file mode 100644 index 0000000..6b8712e --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/ARM11/crt0_secure.c @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------* + Project: CtrBrom - library - init + File: crt0_secure.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 + + +/*---------------------------------------------------------------------------* + Name: STUPi_StartHandler + + Description: start handler + + Arguments: None + + Returns: None. + *---------------------------------------------------------------------------*/ +asm void STUPi_StartHandler( void ) +{ + PRESERVE8 + + bx lr +} diff --git a/trunk/bootrom/build/bootrom/jtag-only/ARM9/Makefile b/trunk/bootrom/build/bootrom/jtag-only/ARM9/Makefile new file mode 100644 index 0000000..2635214 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/ARM9/Makefile @@ -0,0 +1,51 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - bootrom - jtag-only +# File: Makefile +# +# 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$ +#---------------------------------------------------------------------------- + +BROM_PROC = ARM9 + +SUBDIRS = + +LINCLUDES = ../include + +#---------------------------------------------------------------------------- + +TARGET_BIN = brom9_jtag_only.padbin + +CRT0_O = + +SRCS = \ + crt0.c \ + crt0_secure_sp.c \ + +#SRCDIR = # using default +#LCFILE = # using default + +include $(CTRBROM_ROOT)/build/buildtools/commondefs + +INSTALL_DIR = .. +INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + + +include $(CTRBROM_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0.c b/trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0.c new file mode 100644 index 0000000..47d24de --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0.c @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------* + Project: CtrBrom - library - init + File: crt0.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 + + +int main( void ); + +/*---------------------------------------------------------------------------* + Name: _start + + Description: Start up + + Arguments: None + + Returns: None. + *---------------------------------------------------------------------------*/ +asm void _start( void ) +{ + PRESERVE8 + + CODE32 // for _start reference + + // enable JTAG + ldr r3, =REG_JTAG_ADDR + ldr r0, =REG_SCFG_JTAG_A11JE_MASK | REG_SCFG_JTAG_A9JE_MASK | REG_SCFG_JTAG_DSPJE_MASK + str r0, [r3] + +LSYM(10) + b BSYM(10) +} + diff --git a/trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0_secure_sp.c b/trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0_secure_sp.c new file mode 100644 index 0000000..99ab0d4 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/ARM9/crt0_secure_sp.c @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------* + Project: CtrBrom - library - init + File: crt0_secure_sp.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 + + +/*---------------------------------------------------------------------------* + Name: STUPi_StartHandler + + Description: start handler + + Arguments: None + + Returns: None. + *---------------------------------------------------------------------------*/ +asm void STUPi_StartHandler( void ) +{ + PRESERVE8 + + bx lr +} diff --git a/trunk/bootrom/build/bootrom/jtag-only/Makefile b/trunk/bootrom/build/bootrom/jtag-only/Makefile new file mode 100644 index 0000000..75a0861 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/Makefile @@ -0,0 +1,34 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - build +# File: Makefile +# +# 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 $(CTRBROM_ROOT)/build/buildtools/commondefs + + +#---------------------------------------------------------------------------- + +SUBDIRS = \ + ARM11 \ + ARM9 \ + rom \ + +#---------------------------------------------------------------------------- + +include $(CTRBROM_ROOT)/build/buildtools/modulerules + + +#===== End of Makefile ===== diff --git a/trunk/bootrom/build/bootrom/jtag-only/rom/Makefile b/trunk/bootrom/build/bootrom/jtag-only/rom/Makefile new file mode 100644 index 0000000..b3210f6 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/rom/Makefile @@ -0,0 +1,59 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - bootrom - jtag-only +# File: Makefile +# +# 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$ +#---------------------------------------------------------------------------- + +BROM_PROMGEN = TRUE + +SUBDIRS = + +LINCLUDES = ../include + +#---------------------------------------------------------------------------- + +TARGET_BIN = jtag_only.exo + +CRT0_O = + +SRCS = \ + crt0.c \ + +#SRCDIR = # using default +#LCFILE = # using default + +EXO_DEPENDS = \ + ../ARM11/bin/$(BROM_BUILDTYPE_ARM11)/brom11_jtag_only.padbin \ + ../ARM9/bin/$(BROM_BUILDTYPE_ARM9)/brom9_jtag_only.padbin \ + + +include $(CTRBROM_ROOT)/build/buildtools/commondefs + +INSTALL_TARGETS = $(TARGETS) +INSTALL_DIR = $(BROM_INSTALL_PROMDIR) + +#---------------------------------------------------------------------------- + +do-build: $(TARGETS) + + +include $(CTRBROM_ROOT)/build/buildtools/modulerules + + +crt0.c : $(EXO_DEPENDS) + touch crt0.c + + +#===== End of Makefile ===== diff --git a/trunk/bootrom/build/bootrom/jtag-only/rom/crt0.c b/trunk/bootrom/build/bootrom/jtag-only/rom/crt0.c new file mode 100644 index 0000000..7cfb522 --- /dev/null +++ b/trunk/bootrom/build/bootrom/jtag-only/rom/crt0.c @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------* + Project: CtrBrom - bootrom - init + File: crt0.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 +#include + +/*---------------------------------------------------------------------------* + Name: _start + + Description: Start up + + Arguments: None + + Returns: None. + *---------------------------------------------------------------------------*/ +asm void _start( void ) +{ + PRESERVE8 + + EXPORT CTR_BROM_ARM11 + EXPORT CTR_BROM_ARM9 + +CTR_BROM_ARM11 + INCBIN ../ARM11/bin/BROM_BUILDTYPE_ARM11/brom11_jtag_only.padbin +CTR_BROM_ARM9 + INCBIN ../ARM9/bin/BROM_BUILDTYPE_ARM9/brom9_jtag_only.padbin +} diff --git a/trunk/bootrom/build/buildtools/commondefs b/trunk/bootrom/build/buildtools/commondefs index e4a20ea..2d02abe 100644 --- a/trunk/bootrom/build/buildtools/commondefs +++ b/trunk/bootrom/build/buildtools/commondefs @@ -132,6 +132,25 @@ BROM_DEBUGGER ?= KMC CTR_DEBUGGER ?= $(BROM_DEBUGGER) +#---------------------------------------------------------------------------- +### SDK Library settings + +ifeq ($(BROM_TARGET),BROM) +ifndef BROM_PROMGEN +ifeq ($(CODEGEN_PROC),ARM11) +CRT0_O ?= crt0.o crt0_secure.o +else # CODEGEN_PROC==ARM9 +CRT0_O ?= crt0.o crt0_secure_sp.o +endif # CODEGEN_PROC==ARM9 +endif # BROM_PROMGEN +else # BROM_TARGET +CRT0_O ?= crt0_app.o +endif # BROM_TARGET + +ifdef BROM_DEF_LINK_SCATLD +CRT0_O += crt0_scat.o +endif # BROM_DEF_LINK_SCATLD + #---------------------------------------------------------------------------- ### CTR-commondefs # @@ -148,7 +167,7 @@ BROM_INCDIR := $(BROM_ROOT)/include BROM_TOOLSDIR := $(BROM_ROOT)/tools BROM_KEYSDIR := $(BROM_ROOT)/build/keys BROM_COMPONENTSDIR := $(BROM_ROOT)/components -BROM_ADDINS ?= $(BROM_ROOT)/add-ins +BROM_ADDINS ?= $(BROM_ROOT)/add-ins BROM_CTRSDK_ROOT ?= $(call eupath,$(CTRBROM_ROOT)) BROM_CTRFIRM_ROOT ?= $(call eupath,$(CTRFIRM_ROOT)) @@ -218,22 +237,6 @@ LDEPENDS_RES += $(BROM_BUILDTOOLSDIR)/commondefs ### SDK Library settings -ifeq ($(BROM_TARGET),BROM) -ifndef BROM_PROMGEN -ifeq ($(CODEGEN_PROC),ARM11) -CRT0_O = crt0.o crt0_secure.o -else # CODEGEN_PROC==ARM9 -CRT0_O = crt0.o crt0_secure_sp.o -endif # CODEGEN_PROC==ARM9 -endif # BROM_PROMGEN -else # BROM_TARGET -CRT0_O = crt0_app.o -endif # BROM_TARGET - -ifdef BROM_DEF_LINK_SCATLD -CRT0_O += crt0_scat.o -endif # BROM_DEF_LINK_SCATLD - ifeq ($(CODEGEN_PROC),ARM11) BROM_LIBS_BASE ?= \