From a529f04aec112362b7052511f36c418bec144608 Mon Sep 17 00:00:00 2001 From: nakasima Date: Tue, 2 Dec 2008 10:06:32 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=96=E3=83=BC=E3=83=88ROM=E3=81=AE?= =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=95=E3=82=8C=E3=82=8B=E7=8A=B6=E6=85=8B?= =?UTF-8?q?=E3=81=B8=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@62 b871894f-2f95-9b40-918c-086798483c85 --- .../build/bootrom/ctr_bootrom/ARM11/Makefile | 48 ++++++ .../build/bootrom/ctr_bootrom/ARM11/main.c | 22 +++ .../build/bootrom/ctr_bootrom/ARM9/Makefile | 50 +++++++ .../build/bootrom/ctr_bootrom/ARM9/main.c | 22 +++ .../build/bootrom/ctr_bootrom/Makefile | 35 +++++ .../build/bootrom/ctr_bootrom/rom/Makefile | 63 ++++++++ .../build/bootrom/ctr_bootrom/rom/crt0.c | 35 +++++ trunk/bootrom/build/buildtools/commondefs | 51 ++----- .../bootrom/build/libraries/init/ARM11/crt0.c | 6 - .../build/libraries/swi/common/swi_table.c | 141 +----------------- trunk/bootrom/include/brom.h | 2 +- .../include/brom/hw/ARM11/mmap_axi_wram.h | 2 +- .../bootrom/include/brom/hw/ARM11/mmap_brom.h | 5 +- .../bootrom/include/brom/hw/ARM9/mmap_brom.h | 1 + .../specfiles/ARM11-TEG.ldscript.template | 34 +---- .../brom/specfiles/ARM9-TEG.ldscript.template | 34 +---- trunk/build/buildtools/commondefs | 22 +-- .../build/buildtools/commondefs.add-ins.utest | 42 ------ ...s.add-ins.twl => modulerules.add-ins.firm} | 8 +- .../buildtools/modulerules.add-ins.utest | 68 --------- .../build/buildtools/modulerules.cctype.RVCT | 2 +- trunk/include/firm/hw/ARM11/mmap_firm.h | 4 +- 22 files changed, 316 insertions(+), 381 deletions(-) create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/main.c create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/main.c create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/Makefile create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile create mode 100644 trunk/bootrom/build/bootrom/ctr_bootrom/rom/crt0.c delete mode 100644 trunk/build/buildtools/commondefs.add-ins.utest rename trunk/build/buildtools/{modulerules.add-ins.twl => modulerules.add-ins.firm} (93%) delete mode 100644 trunk/build/buildtools/modulerules.add-ins.utest diff --git a/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile new file mode 100644 index 0000000..e0d8416 --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/Makefile @@ -0,0 +1,48 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - bootrom - ts +# 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_DEF_LINK_SCATLD = TRUE + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +TARGET_BIN = ctr_bootrom11.padbin + +SRCS = \ + main.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/ctr_bootrom/ARM11/main.c b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/main.c new file mode 100644 index 0000000..3ab6944 --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM11/main.c @@ -0,0 +1,22 @@ +/*---------------------------------------------------------------------------* + Project: TwlBrom - ctr_bootrom + File: main.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 + +void BromMain( void ) +{ +} + diff --git a/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile new file mode 100644 index 0000000..0be1414 --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/Makefile @@ -0,0 +1,50 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - bootrom - ts +# 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_DEF_LINK_SCATLD = TRUE + +BROM_PROC = ARM9 + +SUBDIRS = + + +#---------------------------------------------------------------------------- + +TARGET_BIN = ctr_bootrom9.padbin + +SRCS = \ + main.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/ctr_bootrom/ARM9/main.c b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/main.c new file mode 100644 index 0000000..b0f5c3d --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/ARM9/main.c @@ -0,0 +1,22 @@ +/*---------------------------------------------------------------------------* + Project: TwlBrom - ctr_bootrom + File: main.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 + +void BromSpMain( void ) +{ +} + diff --git a/trunk/bootrom/build/bootrom/ctr_bootrom/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/Makefile new file mode 100644 index 0000000..f2ca6a8 --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/Makefile @@ -0,0 +1,35 @@ +#! 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/ctr_bootrom/rom/Makefile b/trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile new file mode 100644 index 0000000..94ead54 --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/rom/Makefile @@ -0,0 +1,63 @@ +#! make -f +#---------------------------------------------------------------------------- +# Project: CtrBrom - bootrom - ts +# 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 + +#---------------------------------------------------------------------------- + +ifeq ($(EXO_PLATFORM),DSTEG) +TARGET_BIN = twl_bootrom_dsteg.exo +else +TARGET_BIN = twl_bootrom.exo +endif + +CRT0_O = + +SRCS = \ + crt0.c \ + +#SRCDIR = # using default +#LCFILE = # using default + +EXO_DEPENDS = \ + ../ARM11/bin/$(BROM_BUILDTYPE_ARM11)/ctr_bootrom11.padbin \ + ../ARM9/bin/$(BROM_BUILDTYPE_ARM9)/ctr_bootrom9.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/ctr_bootrom/rom/crt0.c b/trunk/bootrom/build/bootrom/ctr_bootrom/rom/crt0.c new file mode 100644 index 0000000..df91897 --- /dev/null +++ b/trunk/bootrom/build/bootrom/ctr_bootrom/rom/crt0.c @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------* + Project: TwlBrom - bootrom - init + File: crt0.c + + Copyright 2007 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: _start + + Description: Start up + + Arguments: None + + Returns: None. + *---------------------------------------------------------------------------*/ +asm void _start( void ) +{ + PRESERVE8 + + INCBIN ../ARM9/bin/BROM_BUILDTYPE_ARM11/twl_bootrom11.padbin + INCBIN ../ARM7/bin/BROM_BUILDTYPE_ARM9/twl_bootrom9.padbin +} diff --git a/trunk/bootrom/build/buildtools/commondefs b/trunk/bootrom/build/buildtools/commondefs index 60b3f87..e4a20ea 100644 --- a/trunk/bootrom/build/buildtools/commondefs +++ b/trunk/bootrom/build/buildtools/commondefs @@ -186,12 +186,12 @@ DEFAULT_BROM_LCFILE_SPEC := $(BROM_SPECDIR)/PROM.lsf endif # BROM_PROMGEN DEFAULT_BROM_ROM_SPEC := $(BROM_SPECDIR)/ROM-$(CTR_PLATFORM).rsf -BROM_LCF_MAPHDRS := $(BROM_INCDIR)/brom/hw/$(BROM_PROC)/mmap_global.h \ - $(BROM_INCDIR)/brom/hw/$(BROM_PROC)/mmap_brom.h \ +BROM_LCF_MAPHDRS := $(BROM_INCDIR)/brom/hw/$(BROM_PROC)/mmap_brom.h \ + $(BROM_CTRFIRM_INCDIR)/ctr/hw/$(BROM_PROC)/mmap_global.h \ $(BROM_CTRFIRM_INCDIR)/firm/hw/$(BROM_PROC)/mmap_firm.h \ - $(BROM_CTRFIRM_INCDIR)/firm/hw/$(BROM_PROC)/mmap_wram.h \ ifeq ($(BROM_PROC),ARM11) +BROM_LCF_MAPHDRS += $(BROM_INCDIR)/brom/hw/$(BROM_PROC)/mmap_axi_wram.h else # BROM_PROC == ARM9 BROM_LCF_MAPHDRS += $(BROM_INCDIR)/brom/hw/$(BROM_PROC)/mmap_tcm.h endif # BROM_PROC == ARM9 @@ -204,12 +204,13 @@ CTR_BUILDARCH ?= $(BROM_BUILDARCH) ### Compiler & Linker settings # replace NitroSDK -LCFILE_TEMPLATE ?= $(DEFAULT_BROM_LCFILE_TEMPLATE) -LCFILE_SPEC ?= $(DEFAULT_BROM_LCFILE_SPEC) -LCFILE_AUTOGEN ?= $(BINDIR)/$(notdir $(LCFILE_SPEC:.lsf=.autogen.ldscript)) -LCFILE ?= $(LCFILE_AUTOGEN) +LCFILE_TEMPLATE = $(DEFAULT_BROM_LCFILE_TEMPLATE) +LCFILE_TEMPLATE_RV = $(shell cygpath -m $(DEFAULT_BROM_LCFILE_TEMPLATE)) +LCFILE_SPEC = $(DEFAULT_BROM_LCFILE_SPEC) +LCFILE_AUTOGEN = $(BINDIR)/$(notdir $(LCFILE_SPEC:.lsf=.autogen.ldscript)) +LCFILE = $(LCFILE_AUTOGEN) -LDRES_FILE ?= # $(LDRES_AUTOGEN) +LDRES_FILE = # $(LDRES_AUTOGEN) LDEPENDS_LCF += $(BROM_BUILDTOOLSDIR)/commondefs $(BROM_LCF_MAPHDRS) LDEPENDS_RES += $(BROM_BUILDTOOLSDIR)/commondefs @@ -220,13 +221,13 @@ LDEPENDS_RES += $(BROM_BUILDTOOLSDIR)/commondefs ifeq ($(BROM_TARGET),BROM) ifndef BROM_PROMGEN ifeq ($(CODEGEN_PROC),ARM11) -CRT0_O ?= crt0.o crt0_secure.o +CRT0_O = crt0.o crt0_secure.o else # CODEGEN_PROC==ARM9 -CRT0_O ?= crt0.o crt0_secure_sp.o +CRT0_O = crt0.o crt0_secure_sp.o endif # CODEGEN_PROC==ARM9 endif # BROM_PROMGEN else # BROM_TARGET -CRT0_O ?= crt0_app.o +CRT0_O = crt0_app.o endif # BROM_TARGET ifdef BROM_DEF_LINK_SCATLD @@ -236,19 +237,7 @@ endif # BROM_DEF_LINK_SCATLD ifeq ($(CODEGEN_PROC),ARM11) BROM_LIBS_BASE ?= \ - libos \ - libmi \ - libpxi \ - libsyscall \ - libswi \ - libpad \ - libpm \ - libgcd \ - libnvram \ - libacsign \ - libromsd \ - libprint_hex \ - libvlink \ +# libos \ ifdef BROM_PROFILE_TYPE BROM_LIBS_BASE += libos.$(BROM_PROFILE_TYPE) @@ -257,19 +246,7 @@ endif else # ($(CODEGEN_PROC),ARM9) BROM_LIBS_BASE ?= \ - libos_sp \ - libmi_sp \ - libpxi_sp \ - libswi_sp \ - libsyscall_sp \ - libpad_sp \ - libpm_sp \ - libgcd_sp \ - libnvram_sp \ - libaes_sp \ - libacsign_sp \ - libromsd_sp \ - libvlink_sp \ +# libos_sp \ ifdef BROM_PROFILE_TYPE BROM_LIBS_BASE += libos_sp.$(BROM_PROFILE_TYPE) diff --git a/trunk/bootrom/build/libraries/init/ARM11/crt0.c b/trunk/bootrom/build/libraries/init/ARM11/crt0.c index 7d0eead..7ff2f72 100644 --- a/trunk/bootrom/build/libraries/init/ARM11/crt0.c +++ b/trunk/bootrom/build/libraries/init/ARM11/crt0.c @@ -48,12 +48,6 @@ fiq b STUPi_DbgHandler stupStartHandlerVeneer b STUPi_StartHandler DCD 0 - - INASM_EXTERN( |Image$$SVC_RW$$Base| ) - INASM_EXTERN( |Load$$SVC_RW$$Base| ) - - DCD |Image$$SVC_RW$$Base| - DCD |Load$$SVC_RW$$Base| } #include <../common/crt0_excpHandler.c> diff --git a/trunk/bootrom/build/libraries/swi/common/swi_table.c b/trunk/bootrom/build/libraries/swi/common/swi_table.c index 98e4244..085ca99 100644 --- a/trunk/bootrom/build/libraries/swi/common/swi_table.c +++ b/trunk/bootrom/build/libraries/swi/common/swi_table.c @@ -15,149 +15,10 @@ $Author$ *---------------------------------------------------------------------------*/ - // TWL -#ifndef BROMDEV_DISABLE_SECURE_SVC - INASM_EXTERN( ACSign_HeapInit ) - INASM_EXTERN( ACSign_DecryptoCore ) - INASM_EXTERN( ACSign_Decrypto ) - INASM_EXTERN( ACSign_DecryptoDER ) - INASM_EXTERN( ACSign_DigestUnit ) - INASM_EXTERN( ACSign_CompareUnit ) - INASM_EXTERN( ACSign_GetKey ) - INASM_EXTERN( SHA1_Init ) - INASM_EXTERN( SHA1_Update ) - INASM_EXTERN( SHA1_Final ) -#endif // BROMDEV_DISABLE_SECURE_SVC - INASM_EXTERN( SWI_UnCompLZ77Stream ) - INASM_EXTERN( SWIi_Terminate ) - - // DS compatible - INASM_EXTERN( SWI_WaitByLoop ) - INASM_EXTERN( SWI_WaitIntr ) - INASM_EXTERN( SWI_WaitVBlankIntr ) - INASM_EXTERN( SWI_Halt ) -#ifdef SDK_ARM7 - INASM_EXTERN( SWI_Sleep ) - INASM_EXTERN( SWI_ChangeSoundBias ) -#endif // SDK_ARM7 - INASM_EXTERN( SWI_DivS32 ) - INASM_EXTERN( SWI_SqrtU32 ) - INASM_EXTERN( SWI_GetCRC16 ) - INASM_EXTERN( SWI_CpuSet ) - INASM_EXTERN( SWI_CpuSetFast ) - INASM_EXTERN( SWI_UnPackBits32 ) - INASM_EXTERN( SWI_UnCompLZ77Byte ) - INASM_EXTERN( SWI_UnCompLZ77Short ) - INASM_EXTERN( SWI_UnCompHuffman ) - INASM_EXTERN( SWI_UnCompRLByte ) - INASM_EXTERN( SWI_UnCompRLShort ) - INASM_EXTERN( SWI_GetSinTable ) - INASM_EXTERN( SWI_GetPitchTable ) - INASM_EXTERN( SWI_GetVolumeTable ) -#ifdef SDK_ARM9 - INASM_EXTERN( SWI_UnDiffByte2Byte ) - INASM_EXTERN( SWI_UnDiffShort2Short ) - INASM_EXTERN( SWI_SetPauseReg ) -#else // SDK_ARM7 - INASM_EXTERN( SWI_GetFuncp4IPL2 ) - INASM_EXTERN( SWI_SetPauseHi ) -#endif // SDK_ARM7 - EXPORT SWI_Table EXPORT SWI_TableEnd SWI_Table - DCW SWIi_Terminate // 0 - DCW SWI_UnCompLZ77Stream // 1 - DCW SWI_UnCompLZ77Short+1 // 2 - DCW SWI_WaitByLoop // 3 - DCW SWI_WaitIntr // 4 - DCW SWI_WaitVBlankIntr // 5 - DCW SWI_Halt // 6 - DCW SWIi_Terminate // 7 - DCW SWIi_Terminate // 8 - DCW SWI_DivS32 // 9 - DCW SWIi_Terminate // 10 - DCW SWI_CpuSet+1 // 11 - DCW SWI_CpuSetFast // 12 - DCW SWI_SqrtU32 // 13 - DCW SWI_GetCRC16+1 // 14 - DCW SWIi_Terminate // 15 - DCW SWI_UnPackBits32 // 16 - DCW SWI_UnCompLZ77Byte // 17 - DCW SWI_UnCompLZ77Short+1 // 18 overlap semihosting ((0x123456>>16) & 0x3f == 0x12) - DCW SWI_UnCompHuffman+1 // 19 - DCW SWI_UnCompRLByte+1 // 20 - DCW SWI_UnCompRLShort+1 // 21 -#ifdef SDK_ARM9 - DCW SWI_UnDiffByte2Byte+1 // 22 - DCW SWIi_Terminate // 23 - DCW SWI_UnDiffShort2Short+1 // 24 - DCW SWI_UnCompLZ77Short+1 // 25 - DCW SWIi_Terminate // 26 - DCW SWIi_Terminate // 27 - DCW SWIi_Terminate // 28 - DCW SWIi_Terminate // 29 - DCW SWIi_Terminate // 30 - DCW SWI_SetPauseReg // 31 -#else // SDK_ARM7 - DCW SWIi_Terminate // 22 - DCW SWIi_Terminate // 23 - DCW SWIi_Terminate // 24 - DCW SWI_UnCompLZ77Short+1 // 25 - DCW SWI_GetSinTable+1 // 26 - DCW SWI_GetPitchTable+1 // 27 - DCW SWI_GetVolumeTable+1 // 28 - DCW SWI_GetFuncp4IPL2 // 29 - DCW SWIi_Terminate // 30 - DCW SWI_SetPauseHi // 31 -#endif // SDK_ARM7 - -#ifndef BROMDEV_DISABLE_SECURE_SVC - DCW ACSign_HeapInit+1 // 32 - DCW ACSign_DecryptoCore+1 // 33 - DCW ACSign_Decrypto+1 // 34 - DCW ACSign_DecryptoDER+1 // 35 - DCW SHA1_Init+1 // 36 - DCW SHA1_Update+1 // 37 - DCW SHA1_Final+1 // 38 - DCW ACSign_DigestUnit+1 // 39 - DCW ACSign_CompareUnit+1 // 40 - DCW ACSign_GetKey+1 // 41 -#else // BROMDEV_DISABLE_SECURE_SVC - DCW SWIi_Terminate // 32 - DCW SWIi_Terminate // 33 - DCW SWIi_Terminate // 34 - DCW SWIi_Terminate // 35 - DCW SWIi_Terminate // 36 - DCW SWIi_Terminate // 37 - DCW SWIi_Terminate // 38 - DCW SWIi_Terminate // 39 - DCW SWIi_Terminate // 40 - DCW SWIi_Terminate // 41 -#endif // BROMDEV_DISABLE_SECURE_SVC - DCW SWIi_Terminate // 42 - DCW SWIi_Terminate // 43 overlap semihosting (0xab & 0x3f == 0x2b) - DCW SWIi_Terminate // 44 - DCW SWIi_Terminate // 45 - DCW SWIi_Terminate // 46 - DCW SWIi_Terminate // 47 - DCW SWIi_Terminate // 48 - DCW SWIi_Terminate // 49 - DCW SWIi_Terminate // 50 - DCW SWIi_Terminate // 51 - DCW SWIi_Terminate // 52 - DCW SWIi_Terminate // 53 - DCW SWIi_Terminate // 54 - DCW SWIi_Terminate // 55 - DCW SWIi_Terminate // 56 - DCW SWIi_Terminate // 57 - DCW SWIi_Terminate // 58 - DCW SWIi_Terminate // 59 - DCW SWIi_Terminate // 60 - DCW SWIi_Terminate // 61 - DCW SWIi_Terminate // 62 - DCW SWIi_Terminate // 63 - + DCW 0 // 0 SWI_TableEnd diff --git a/trunk/bootrom/include/brom.h b/trunk/bootrom/include/brom.h index f991290..9d2027a 100644 --- a/trunk/bootrom/include/brom.h +++ b/trunk/bootrom/include/brom.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include //#include diff --git a/trunk/bootrom/include/brom/hw/ARM11/mmap_axi_wram.h b/trunk/bootrom/include/brom/hw/ARM11/mmap_axi_wram.h index ecf52b4..fd78ca1 100644 --- a/trunk/bootrom/include/brom/hw/ARM11/mmap_axi_wram.h +++ b/trunk/bootrom/include/brom/hw/ARM11/mmap_axi_wram.h @@ -24,7 +24,7 @@ extern "C" { //------------------------------------- HW_BROM_STACK #define HW_BROM_STACK (HW_BROM_STACK_END - HW_BROM_STACK_SIZE) -#define HW_BROM_STACK_END HW_BROM_MMU_TBL +#define HW_BROM_STACK_END HW_FIRM_FROM_BROM_BUF #define HW_BROM_STACK_SIZE 0x4000 // 16KB #define HW_BROM_SVC_STACK (HW_BROM_SVC_STACK_END - HW_BROM_SVC_STACK_SIZE) diff --git a/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h b/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h index de77d3e..bec56b2 100644 --- a/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h +++ b/trunk/bootrom/include/brom/hw/ARM11/mmap_brom.h @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -45,8 +46,8 @@ extern "C" { //------------------------------------- BROM_WRAM #define HW_BROM_WRAM (HW_BROM_WRAM_END - HW_BROM_WRAM_SIZE) -#define HW_BROM_WRAM_END HW_BROM_TO_FIRM_BUF -#define HW_BROM_WRAM_SIZE 0xB000 // 44KB +#define HW_BROM_WRAM_END HW_BROM_STACK +#define HW_BROM_WRAM_SIZE 0x8000 // 32KB #ifdef __cplusplus diff --git a/trunk/bootrom/include/brom/hw/ARM9/mmap_brom.h b/trunk/bootrom/include/brom/hw/ARM9/mmap_brom.h index 486ca0a..c682a4a 100644 --- a/trunk/bootrom/include/brom/hw/ARM9/mmap_brom.h +++ b/trunk/bootrom/include/brom/hw/ARM9/mmap_brom.h @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { diff --git a/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template b/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template index 820f721..d718580 100644 --- a/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template +++ b/trunk/bootrom/include/brom/specfiles/ARM11-TEG.ldscript.template @@ -51,7 +51,7 @@ LOAD_SECURE HW_BROM_SEC HW_BROM_SEC_SIZE { SEC_RO +0 { - *crt0_secure_sp.o (.emb_text, +FIRST) + *crt0_secure.o (.emb_text, +FIRST) #ifdef BROM_DEF_LINK_SCATLD @@ -68,39 +68,7 @@ LOAD_SECURE HW_BROM_SEC HW_BROM_SEC_SIZE #endif // BROM_DEF_LINK_SCATLD *main.o (+RO) - *libos*.brom*.a (:gdef:OSi_KeyBinPack) - *libpad*.brom*.a (:gdef:PAD_Read) - *libpad*.brom*.a (:gdef:PAD_DetectFold) - *libmi*.brom*.a (:gdef:MI_Init) - *libmi*.brom*.a (:gdef:MI_ReadStream) - *libmi*.brom*.a (:gdef:MIi_PreMappingWram) - *libmi*.brom*.a (:gdef:MIi_MappingWramForARM9) - *libmi*.brom*.a (:gdef:MIi_MappingWramForARM7) - *libmi*.brom*.a (i.MIi_AdjustWramMapParam) - *libmi*.brom*.a (:gdef:MIi_SetExDmaArbitration) - *libmi*.brom*.a (:gdef:MIi_SetExDmaYieldCycles) - *libmi*.brom*.a (:gdef:MIi_SetExDmaParams) - *libmi*.brom*.a (:gdef:MIi_ExDmaRecv) - *libmi*.brom*.a (:gdef:MIi_ExDmaRecvCore) - *libmi*.brom*.a (:gdef:MIi_ExDmaRecvAsyncCore) - *libmi*.brom*.a (:gdef:MIi_WaitExDma) - *libmi*.brom*.a (:gdef:MIi_StopExDma) - *libmi*.brom*.a (:gdef:MIi_StopExDmaAsync) - *libpxi*.brom*.a (:gdef:PXI_InitFifoBROM) - *libpxi*.brom*.a (:gdef:PXI_SendDataByFifo) - *libpxi*.brom*.a (:gdef:PXI_RecvDataByFifo) - *libpxi*.brom*.a (:gdef:PXI_SendStream) - *libpxi*.brom*.a (:gdef:PXI_RecvStream) - *libpxi*.brom*.a (:gdef:PXIi_InitReadStream) - *libpxi*.brom*.a (:gdef:PXIi_ReadByteStream) - *libpxi*.brom*.a (:gdef:PXIi_ReadWordStream) - *libpxi*.brom*.a (:gdef:PXIi_TerminateReadStream) *libos*.brom*.a (+RO) - *libnvram*.brom*.a (+RO) - *libromsd*.brom*.a (+RO) - *libgcd*.brom*.a (+RO) - *libpm*.brom*.a (+RO) - *libaes*.brom*.a (+RO) } RW HW_BROM_WRAM HW_BROM_WRAM_SIZE diff --git a/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template b/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template index cb5d4d0..a2fe515 100644 --- a/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template +++ b/trunk/bootrom/include/brom/specfiles/ARM9-TEG.ldscript.template @@ -79,7 +79,7 @@ LOAD_SECURE HW_BROM_SEC HW_BROM_SEC_SIZE { SEC_RO +0 { - *crt0_secure.o (.emb_text, +FIRST) + *crt0_secure_sp.o (.emb_text, +FIRST) #ifdef BROM_DEF_LINK_SCATLD @@ -96,39 +96,7 @@ LOAD_SECURE HW_BROM_SEC HW_BROM_SEC_SIZE #endif // BROM_DEF_LINK_SCATLD *main.o (+RO) - *libos*.brom*.a (:gdef:OSi_KeyBinPack) - *libpad*.brom*.a (:gdef:PAD_Read) - *libpad*.brom*.a (:gdef:PAD_DetectFold) - *libmi*.brom*.a (:gdef:MI_Init) - *libmi*.brom*.a (:gdef:MI_ReadStream) - *libmi*.brom*.a (:gdef:MIi_PreMappingWram) - *libmi*.brom*.a (:gdef:MIi_MappingWramForARM9) - *libmi*.brom*.a (:gdef:MIi_MappingWramForARM7) - *libmi*.brom*.a (i.MIi_AdjustWramMapParam) - *libmi*.brom*.a (:gdef:MIi_SetExDmaArbitration) - *libmi*.brom*.a (:gdef:MIi_SetExDmaYieldCycles) - *libmi*.brom*.a (:gdef:MIi_SetExDmaParams) - *libmi*.brom*.a (:gdef:MIi_ExDmaRecv) - *libmi*.brom*.a (:gdef:MIi_ExDmaRecvCore) - *libmi*.brom*.a (:gdef:MIi_ExDmaRecvAsyncCore) - *libmi*.brom*.a (:gdef:MIi_WaitExDma) - *libmi*.brom*.a (:gdef:MIi_StopExDma) - *libmi*.brom*.a (:gdef:MIi_StopExDmaAsync) - *libpxi*.brom*.a (:gdef:PXI_InitFifoBROM) - *libpxi*.brom*.a (:gdef:PXI_SendDataByFifo) - *libpxi*.brom*.a (:gdef:PXI_RecvDataByFifo) - *libpxi*.brom*.a (:gdef:PXI_SendStream) - *libpxi*.brom*.a (:gdef:PXI_RecvStream) - *libpxi*.brom*.a (:gdef:PXIi_InitReadStream) - *libpxi*.brom*.a (:gdef:PXIi_ReadByteStream) - *libpxi*.brom*.a (:gdef:PXIi_ReadWordStream) - *libpxi*.brom*.a (:gdef:PXIi_TerminateReadStream) *libos*.brom*.a (+RO) - *libnvram*.brom*.a (+RO) - *libromsd*.brom*.a (+RO) - *libgcd*.brom*.a (+RO) - *libpm*.brom*.a (+RO) - *libprint_hex*.brom*.a (+RO) } RW HW_BROM_WRAM HW_BROM_WRAM_SIZE diff --git a/trunk/build/buildtools/commondefs b/trunk/build/buildtools/commondefs index 5a292ca..beb02ce 100644 --- a/trunk/build/buildtools/commondefs +++ b/trunk/build/buildtools/commondefs @@ -422,11 +422,11 @@ DEFAULT_INCDIR := ./include DEFAULT_ETCDIR := ./etc LCF_SUFFIX_ := $(if $(CTR_DIGEST),-C) -CTR_SPECDIR := $(CTR_INCDIR)/ctr/specfiles -DEFAULT_LCFILE := $(CTR_SPECDIR)/$(CTR_LIBARCH).lcf -DEFAULT_LCFILE_TEMPLATE := $(CTR_SPECDIR)/$(CTR_LIBARCH)$(LCF_SUFFIX_).lcf.template -DEFAULT_LCFILE_SPEC := $(CTR_SPECDIR)/$(CTR_LIBARCH).lsf -DEFAULT_ROM_SPEC := $(CTR_SPECDIR)/ROM-$(CTR_PLATFORM).rsf +CTR_SPECDIR = $(CTR_INCDIR)/ctr/specfiles +DEFAULT_LCFILE = $(CTR_SPECDIR)/$(CTR_LIBARCH).lcf +DEFAULT_LCFILE_TEMPLATE = $(CTR_SPECDIR)/$(CTR_LIBARCH)$(LCF_SUFFIX_).lcf.template +DEFAULT_LCFILE_SPEC = $(CTR_SPECDIR)/$(CTR_LIBARCH).lsf +DEFAULT_ROM_SPEC = $(CTR_SPECDIR)/ROM-$(CTR_PLATFORM).rsf SRCDIR ?= $(DEFAULT_SRCDIR) INCDIR ?= $(DEFAULT_INCDIR) @@ -447,7 +447,7 @@ LCFILE_TEMPLATE ?= $(DEFAULT_LCFILE_TEMPLATE) LCFILE_SPEC ?= $(DEFAULT_LCFILE_SPEC) LCFILE_AUTOGEN ?= $(BINDIR)/$(notdir $(LCFILE_SPEC:.lsf=.autogen.lcf)) LCFILE ?= $(LCFILE_AUTOGEN) -DEFAULT_LDRES_TEMPLATE := $(CTR_SPECDIR)/$(basename $(notdir $(LD))).response.template +DEFAULT_LDRES_TEMPLATE = $(CTR_SPECDIR)/$(basename $(notdir $(LD))).response.template LDRES_TEMPLATE ?= $(DEFAULT_LDRES_TEMPLATE) LDRES_AUTOGEN ?= $(BINDIR)/$(notdir $(LCFILE_SPEC:.lsf=.autogen.response)) LDRES_FILE ?= $(LDRES_AUTOGEN) @@ -538,15 +538,15 @@ endif ### Global Library settings -DEFAULT_GINCLUDES := $(INCDIR) $(SRCDIR) \ +DEFAULT_GINCLUDES = $(INCDIR) $(SRCDIR) \ $(CTRSYSTEM_INCDIR) $(CTRWIRELESS_INCDIR) \ $(CTR_INCDIR) $(ISD_INCDIRS) -DEFAULT_GLIBRARY_DIRS := $(LIBDIR) $(dir $(LIBSYSCALL_)) \ +DEFAULT_GLIBRARY_DIRS = $(LIBDIR) $(dir $(LIBSYSCALL_)) \ $(CTRSYSTEM_LIBDIR) $(CTRWIRELESS_LIBDIR) \ $(CTR_LIBDIR) $(ISD_LIBDIRS) -DEFAULT_GLIBRARIES := $(CTRSYSTEM_LIBS) $(CTR_LIBS) $(STUBS_LIBS) $(ISD_LIBS) +DEFAULT_GLIBRARIES = $(CTRSYSTEM_LIBS) $(CTR_LIBS) $(STUBS_LIBS) $(ISD_LIBS) GINCLUDES ?= $(DEFAULT_GINCLUDES) GLIBRARY_DIRS ?= $(DEFAULT_GLIBRARY_DIRS) @@ -588,8 +588,8 @@ COMPSTATIC_FLAGS ?= DEFAULT_COMP_ARM9 ?= $(if $(findstring TEG,$(CTR_PLATFORM)),ferret,mongoose) DEFAULT_ADDRESS_DTCM ?= $(if $(findstring TEG,$(CTR_PLATFORM)),0x02380000,0x027e0000) DEFAULT_COMPSUFFIX ?= _LZ -DEFAULT_MAKEROM_ARM11 := $(CTR_COMPONENTSDIR)/printserver/$(CTR_BUILDTYPE_ARM9)/main.nef -DEFAULT_MAKEROM_ARM9 := $(CTR_COMPONENTSDIR)/$(DEFAULT_COMP_ARM9)/$(CTR_BUILDTYPE_ARM7)/$(DEFAULT_COMP_ARM9)_sub$(TS_VERSION).nef +DEFAULT_MAKEROM_ARM11 = $(CTR_COMPONENTSDIR)/printserver/$(CTR_BUILDTYPE_ARM9)/main.nef +DEFAULT_MAKEROM_ARM9 = $(CTR_COMPONENTSDIR)/$(DEFAULT_COMP_ARM9)/$(CTR_BUILDTYPE_ARM7)/$(DEFAULT_COMP_ARM9)_sub$(TS_VERSION).nef DEFAULT_MAKEROM_ROMROOT := ./files DEFAULT_MAKEROM_ROMFILES := diff --git a/trunk/build/buildtools/commondefs.add-ins.utest b/trunk/build/buildtools/commondefs.add-ins.utest deleted file mode 100644 index 34a8f1e..0000000 --- a/trunk/build/buildtools/commondefs.add-ins.utest +++ /dev/null @@ -1,42 +0,0 @@ -#! make -f -#---------------------------------------------------------------------------- -# Project: CtrFirm - UnitTest Tool -# File: commondefs.add-ins.utest -# -# Copyright 2008 Nintendo. All rights reserved. -# -# These coded insructions, 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$ -#---------------------------------------------------------------------------- - -# -# UNIT TEST on ARM11 -# -ifeq ($(CODEGEN_PROC),ARM11) - -ELIBRARIES += libutest$(CTR_LIBSUFFIX).a - -MAKE_UTEST_MAIN = $(CTR_TOOLSDIR)/bin/make_utest_main__ -UTEST_MAIN_SRC = $(OBJDIR)/utest_main__.c -UTEST_MAIN_BIN = utest_main__.srl - -ifdef UTEST_CHECKASSERT -MACRO_FLAGS += -DSDK_CHECKASSERT -endif - -# -# UNIT TEST on ARM9 -# -else # ($(CODEGEN_PROC),ARM9) -# Not support unit test on ARM9 - -endif - -#===== End of commondefs.add-ins.utest ===== diff --git a/trunk/build/buildtools/modulerules.add-ins.twl b/trunk/build/buildtools/modulerules.add-ins.firm similarity index 93% rename from trunk/build/buildtools/modulerules.add-ins.twl rename to trunk/build/buildtools/modulerules.add-ins.firm index 9bbeb22..38b2954 100644 --- a/trunk/build/buildtools/modulerules.add-ins.twl +++ b/trunk/build/buildtools/modulerules.add-ins.firm @@ -18,7 +18,7 @@ ifndef TWLSDK_MODULERULES_ #---------------------------------------------------------------------------- -.PHONY: twltop twllib twldbg link +.PHONY: firmtop firmlib firmdbg link link: @$(MAKE_SUBDIR) @@ -26,14 +26,14 @@ link: -rm $(BINDIR)/$(TARGET_BIN_BASENAME).axf $(BINDIR)/$(TARGET_BIN_BASENAME).nef @+$(REMAKE) -twltop: +firmtop: @$(MAKE) -C $(TWLSDK_ROOT) -twllib: +firmlib: @$(MAKE) -C $(TWLSDK_ROOT)/build/buildsetup @$(MAKE) -C $(TWLSDK_ROOT)/build/libraries -twldbg: +firmdbg: @$(TOUCH) $(TWL_LDEPENDS_DBG) @$(MAKE) -C $(TWLSDK_ROOT)/build/libraries/os @+$(REMAKE) diff --git a/trunk/build/buildtools/modulerules.add-ins.utest b/trunk/build/buildtools/modulerules.add-ins.utest deleted file mode 100644 index ba9a95b..0000000 --- a/trunk/build/buildtools/modulerules.add-ins.utest +++ /dev/null @@ -1,68 +0,0 @@ -#! make -f -#---------------------------------------------------------------------------- -# Project: CtrFirm - UnitTest Tool -# File: modulerules.add-ins.utest -# -# Copyright 2008 Nintendo. All rights reserved. -# -# These coded insructions, 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$ -#---------------------------------------------------------------------------- - -.PHONY: utest - -# -# UNIT TEST on ARM11 -# -ifeq ($(CODEGEN_PROC),ARM11) - -UTEST_MAKEOPTS = \ - SRCS="$(SRCS) $(UTEST_MAIN_SRC)" \ - LIBRARIES_UNLINK=$(TARGET_LIB) \ - TARGET_BIN=$(UTEST_MAIN_BIN) \ - TARGET_NEF= \ - TARGET_LIB= \ - TARGET_OBJ= \ - TARGET_SIGN_BIN= \ - UTEST_OBJS_TESTEE="$(OBJS)" \ - UTEST_CHECKASSERT=True \ - CTR_UTEST=True - -utest: - @$(MAKE_SUBDIR) - @$(ECHO_CURDIR) -ifneq ($(strip $(TARGET_LIB)),) -ifneq ($(strip $(NEWDIRS)),) - @$(MKDIRP) $(NEWDIRS) $(BINDIR) -endif - @$(REMAKE) -s $(UTEST_MAIN_SRC) $(UTEST_MAKEOPTS) - @if [ -e $(UTEST_MAIN_SRC) ]; \ - then \ - $(REMAKE) -s do-build $(UTEST_MAKEOPTS) && \ - $(REMAKE) -s run TARGET_BIN=$(UTEST_MAIN_BIN); \ - fi -endif - -$(UTEST_MAIN_SRC): $(UTEST_OBJS_TESTEE) - @$(MAKE_UTEST_MAIN) -c $(UTEST_MAIN_SRC) $(UTEST_OBJS_TESTEE) - - -# -# UNIT TEST on ARM9 -# -else # ($(CODEGEN_PROC),ARM9) - -utest: - @ # Not support unit test on ARM9 - -endif - - -#===== End of modulerules.add-ins.utest ===== diff --git a/trunk/build/buildtools/modulerules.cctype.RVCT b/trunk/build/buildtools/modulerules.cctype.RVCT index e17692a..df0e673 100644 --- a/trunk/build/buildtools/modulerules.cctype.RVCT +++ b/trunk/build/buildtools/modulerules.cctype.RVCT @@ -97,7 +97,7 @@ MAKELCF_OPTS = $(MAKELCF_FLAGS) $(MAKELCF_DEFS) $(LCFILE_AUTOGEN): $(LCFILE_TEMPLATE) $(MAKEFILE) $(LDEPENDS_LCF) - $(CC) $(CCFLAGS) $(INCLUDES) -E -o $(LCFILE_AUTOGEN) $(LCFILE_TEMPLATE) + $(CC) $(CCFLAGS) $(INCLUDES) -E -o $(LCFILE_AUTOGEN) $(LCFILE_TEMPLATE_RV) $(LDRES_AUTOGEN): $(LCFILE_SPEC) $(LDRES_TEMPLATE) $(MAKEFILE) $(LDEPENDS_RES) $(MAKELCF) $(MAKELCF_OPTS) $< $(LDRES_TEMPLATE) $@ diff --git a/trunk/include/firm/hw/ARM11/mmap_firm.h b/trunk/include/firm/hw/ARM11/mmap_firm.h index df62447..26cc0a6 100644 --- a/trunk/include/firm/hw/ARM11/mmap_firm.h +++ b/trunk/include/firm/hw/ARM11/mmap_firm.h @@ -28,8 +28,8 @@ extern "C" { //------------------------------------- HW_FIRM_FROM_BROM_BUF #define HW_FIRM_FROM_BROM_BUF (HW_FIRM_FROM_BROM_BUF_END - HW_FIRM_FROM_BROM_BUF_SIZE) -#define HW_FIRM_FROM_BROM_BUF_END (HW_ITCM_END - 0x1000) // END - 4KB -#define HW_FIRM_FROM_BROM_BUF_SIZE 0x3000 // 12KB +#define HW_FIRM_FROM_BROM_BUF_END (HW_AXI_WRAM_SHARED_END - 0x8000) // END - 32KB +#define HW_FIRM_FROM_BROM_BUF_SIZE 0x4000 // 16KB #ifdef __cplusplus } /* extern "C" */