ファームビルド追加。

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@244 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
nakasima 2009-01-30 11:14:54 +00:00
parent cc51c50afe
commit 6a5f4a9f39
24 changed files with 650 additions and 25 deletions

View File

@ -16,7 +16,7 @@
# $Author$ # $Author$
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
include $(CTRFIRM_ROOT)/build/buildtools/commondefs include $(CTRBROM_ROOT)/build/buildtools/commondefs
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@ -31,7 +31,7 @@ endif # RVCT30BIN
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
include $(CTRFIRM_ROOT)/build/buildtools/modulerules include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile ===== #===== End of Makefile =====

View File

@ -24,6 +24,7 @@ SUBDIRS = \
$(CTRFIRM_ROOT)/build/buildsetup \ $(CTRFIRM_ROOT)/build/buildsetup \
libraries \ libraries \
bootrom \ bootrom \
firmware_tests \
tests \ tests \
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View File

@ -45,7 +45,8 @@ EXO_PLATFORM ?= $(BROM_PLATFORM)
# BROM_PROC = [ARM11/ARM9] # BROM_PROC = [ARM11/ARM9]
# #
# BROM_PROMGEN = [TRUE/FALSE] # BROM_PROMGEN = [TRUE/FALSE]
# BROM_TARGET = [BROM/NORFIRM/NANDFIRM/GCDFIRM/APP] # BROM_TARGET = [BROM/FIRM/APP]
# BROM_MEDIA = [NAND/NOR/GCD/BROM]
# #
BROM_PLATFORM ?= MG20EMU BROM_PLATFORM ?= MG20EMU
@ -53,6 +54,7 @@ BROM_MEMSIZE ?= 128M
BROM_CODEGEN ?= THUMB BROM_CODEGEN ?= THUMB
BROM_PROC ?= ARM11 BROM_PROC ?= ARM11
BROM_TARGET ?= BROM BROM_TARGET ?= BROM
BROM_MEDIA ?= BROM
# replace TwlSDK # replace TwlSDK
CTR_PLATFORM = $(BROM_PLATFORM) CTR_PLATFORM = $(BROM_PLATFORM)
@ -141,8 +143,12 @@ CRT0_O ?= crt0.o crt0_excp.o crt0_secure_sp.o
endif # CODEGEN_PROC==ARM9 endif # CODEGEN_PROC==ARM9
endif # BROM_PROMGEN endif # BROM_PROMGEN
else # BROM_TARGET else # BROM_TARGET
ifeq ($(BROM_TARGET),FIRM)
CRT0_O ?= crt0_firm.o
else # BROM_TARGET_APP
CRT0_O ?= crt0_app.o CRT0_O ?= crt0_app.o
endif # BROM_TARGET endif # BROM_TARGET_APP
endif # BROM_TARGET_BROM
ifneq ($(BROM_PROMGEN),TRUE) ifneq ($(BROM_PROMGEN),TRUE)
ifdef BROM_DEF_LINK_SCATLD ifdef BROM_DEF_LINK_SCATLD
@ -153,7 +159,7 @@ endif # BROM_PROMGEN
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
### CTR-commondefs ### CTR-commondefs
# #
include $(CTRFIRM_ROOT)/build/buildtools/commondefs include $(CTRSDK_ROOT)/build/buildtools/commondefs
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# BROM-SDK path settings # BROM-SDK path settings
@ -332,8 +338,7 @@ BROM_INSTALL_ADDINS := $(BROM_INSTALL_ROOT)/add-ins
# Compiler flags # Compiler flags
# #
MACRO_FLAGS += -DBROM_TARGET_$(BROM_TARGET) \ MACRO_FLAGS += -DBROM_TARGET_$(BROM_TARGET) \
-DBROM_KEYSDIR='$(BROM_KEYSDIR)' \ -DBROM_MEDIA='$(DBROM_MEDIA)' \
-DMAKEFIRM_RSA_PUBKEY='$(MAKEFIRM_RSA_PUBKEY)' \
-DBROM_ROOT='$(BROM_ROOT)' \ -DBROM_ROOT='$(BROM_ROOT)' \

View File

@ -28,7 +28,7 @@ endif
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
### CTR-modulerules ### CTR-modulerules
# #
include $(CTRFIRM_ROOT)/build/buildtools/modulerules include $(CTRSDK_ROOT)/build/buildtools/modulerules
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View File

@ -0,0 +1,31 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - firmware_tests
# File: Makefile
#
# Copyright 2009 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 = \
thread \
#----------------------------------------------------------------------------
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,52 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - firmware - thread
# File: Makefile
#
# Copyright 2009 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_TARGET = FIRM
BROM_MEDIA = NAND
SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = thread11.dasm
SRCS = \
main.c \
#LCFILE = # using default
include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR += $(BROM_ROOT)/build/tests/thread/ARM11
INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,54 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - firmware - thread
# File: Makefile
#
# Copyright 2009 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_TARGET = FIRM
BROM_MEDIA = NAND
BROM_PROC = ARM9
SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = thread9.dasm
SRCS = \
main.c \
#LCFILE = # using default
include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR = $(BROM_ROOT)/build/tests/thread/ARM9
INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,33 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - build
# File: Makefile
#
# Copyright 2009 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 \
#----------------------------------------------------------------------------
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -29,8 +29,8 @@ BROM_PROC = ARM11
SRCDIR = ../common . SRCDIR = ../common .
SRCS = crt0.c crt0_secure.c crt0_scat.c crt0_excp.c crt0_app.c SRCS = crt0.c crt0_secure.c crt0_scat.c crt0_excp.c crt0_firm.c crt0_app.c
TARGET_OBJ = crt0.o crt0_secure.o crt0_scat.o crt0_excp.o crt0_app.o TARGET_OBJ = crt0.o crt0_secure.o crt0_scat.o crt0_excp.o crt0_firm.o crt0_app.o
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View File

@ -0,0 +1,85 @@
/*---------------------------------------------------------------------------*
Project: CtrBrom - library - init
File: crt0_firm.c
Copyright 2009 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 <brom/code32.h>
#include <brom/os.h>
//#include <brom/mi.h>
#undef BROM_TARGET_BROM
#define BROM_TARGET_FIRM
void _start(void);
/*---------------------------------------------------------------------------*
Name: _start
Description: Start up
Arguments: None
Returns: None.
*---------------------------------------------------------------------------*/
asm void _start( void )
{
PRESERVE8
INASM_EXTERN( BromMain )
INASM_EXTERN( main )
//---- initialize stack pointer
// SVC mode
mov r0, #HW_PSR_SVC_MODE | HW_PSR_IRQ_DISABLE | HW_PSR_FIQ_DISABLE
msr cpsr_fsxc, r0
ldr sp, =HW_FIRM_SVC_STACK_END
// IRQ mode
mov r0, #HW_PSR_IRQ_MODE | HW_PSR_IRQ_DISABLE | HW_PSR_FIQ_DISABLE
msr cpsr_fsxc, r0
ldr r0, =HW_FIRM_IRQ_STACK_END
mov sp, r0
// System mode
mov r0, #HW_PSR_SYS_MODE | HW_PSR_IRQ_DISABLE | HW_PSR_FIQ_DISABLE
msr cpsr_fsxc, r0
ldr r0, =HW_FIRM_SYS_STACK_END
mov sp, r0
//---- disable cp15
bl stupDisableCP15
//---- initialize MMU
ldr r0, =HW_FIRM_MMU_T1
ldr r1, =HW_FIRM_MMU_T2
bl stupInitMMU
//---- enable cp15
bl stupEnableCP15
//---- lnitialize sections
bl stupInitSections
//---- start (to 16bit code)
ldr r1, =BromMain
adr lr, terminate
bx r1
terminate
b terminate
}
#include <./crt0_mmu.c>
#include <./crt0_misc.c>

View File

@ -387,7 +387,11 @@ void stupInitMMUTable( u32* t1Base, u32* t2Base )
HW_MMU6_T2_LP_RGT_L1C_WB_WA, HW_MMU6_T2_LP_RGT_L1C_WB_WA,
HW_MMU6_T2_GLOBAL, HW_MMU6_T2_GLOBAL,
HW_MMU6_T2_SHARED, HW_MMU6_T2_SHARED,
#ifdef BROM_TARGET_FIRM
FALSE);
#else // BROM_TARGET_BROM || BROM_TARGET_APP
HW_MMU6_T2_LP_XN); HW_MMU6_T2_LP_XN);
#endif // BROM_TARGET_BROM || BROM_TARGET_APP
paddr += HW_MMU6_T2_LP_ALIAS_SIZE; paddr += HW_MMU6_T2_LP_ALIAS_SIZE;
} }
while ( paddr < HW_BROM_MMU_TBL ) while ( paddr < HW_BROM_MMU_TBL )
@ -398,7 +402,11 @@ void stupInitMMUTable( u32* t1Base, u32* t2Base )
HW_MMU6_T2_SP_RGT_L1C_WB_WA, HW_MMU6_T2_SP_RGT_L1C_WB_WA,
HW_MMU6_T2_GLOBAL, HW_MMU6_T2_GLOBAL,
HW_MMU6_T2_SHARED, HW_MMU6_T2_SHARED,
#ifdef BROM_TARGET_FIRM
FALSE);
#else // BROM_TARGET_BROM || BROM_TARGET_APP
HW_MMU6_T2_SP_XN); HW_MMU6_T2_SP_XN);
#endif // BROM_TARGET_BROM || BROM_TARGET_APP
paddr += HW_MMU6_T2_SP_SIZE; paddr += HW_MMU6_T2_SP_SIZE;
} }
// HW_BROM_MMU_TBL // HW_BROM_MMU_TBL

View File

@ -29,8 +29,8 @@ BROM_PROC = ARM9
SRCDIR = ../common . SRCDIR = ../common .
SRCS = crt0.c crt0_secure_sp.c crt0_scat.c crt0_excp.c crt0_app.c SRCS = crt0.c crt0_secure_sp.c crt0_scat.c crt0_excp.c crt0_firm.c crt0_app.c
TARGET_OBJ = crt0.o crt0_secure_sp.o crt0_scat.o crt0_excp.o crt0_app.o TARGET_OBJ = crt0.o crt0_secure_sp.o crt0_scat.o crt0_excp.o crt0_firm.o crt0_app.o
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*
Project: CtrBrom - library - init
File: crt0_firm.c
Copyright 2009 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 <brom/code32.h>
#include <brom/os.h>
#undef BROM_TARGET_BROM
#define BROM_TARGET_FIRM
#define STUPi_HW_DTCM |Image$$DTCM$$Base|
void _start(void);
/*---------------------------------------------------------------------------*
Name: _start
Description: Start up
Arguments: None
Returns: None.
*---------------------------------------------------------------------------*/
asm void _start( void )
{
PRESERVE8
INASM_EXTERN( STUPi_HW_DTCM )
INASM_EXTERN( BromSpMain )
INASM_EXTERN( main )
//---- initialize stack pointer
// SVC mode
mov r0, #HW_PSR_SVC_MODE | HW_PSR_IRQ_DISABLE | HW_PSR_FIQ_DISABLE
msr cpsr_fsxc, r0
ldr sp, =HW_FIRM_SVC_STACK_END
// IRQ mode
mov r0, #HW_PSR_IRQ_MODE | HW_PSR_IRQ_DISABLE | HW_PSR_FIQ_DISABLE
msr cpsr_fsxc, r0
ldr r0, =HW_FIRM_IRQ_STACK_END
mov sp, r0
// System mode
mov r0, #HW_PSR_SYS_MODE | HW_PSR_IRQ_DISABLE | HW_PSR_FIQ_DISABLE
msr cpsr_fsxc, r0
ldr r0, =HW_FIRM_SYS_STACK_END
mov sp, r0
//---- initialize cp15
bl i_stupInitCP15
//---- clear wram
// DTCM (16KB)
mov r0, #0
ldr r1, =STUPi_HW_DTCM
mov r2, #HW_DTCM_SIZE
bl i_stupCpuClear32
// 64B
mov r0, #0
ldr r1, =HW_PRV_WRAM_SYSRV
ldr r2, =HW_EXCP_VENEER_BUF
sub r2, r2, r1
bl i_stupCpuClear32
ldr r1, =HW_EXCP_VENEER_BUF_END
ldr r2, =HW_PRV_WRAM_SYSRV_END
sub r2, r2, r1
bl i_stupCpuClear32
//---- lnitialize sections
bl stupInitSections
//---- start (to 16bit code)
ldr r1, =BromSpMain
adr lr, terminate
bx r1
terminate
b terminate
}
#include <./crt0_pu.c>
#include <./crt0_misc_sp.c>

View File

@ -73,11 +73,11 @@ asm void stupInitStaticSections( void )
INASM_EXTERN( |Image$$SEC_RO$$Limit| ) INASM_EXTERN( |Image$$SEC_RO$$Limit| )
ldr r0, =|Image$$SEC_RO$$Limit| ldr r0, =|Image$$SEC_RO$$Limit|
#else // BROM_TARGET_NORFIRM || BROM_TARGET_APP #else // BROM_TARGET_FIRM || BROM_TARGET_APP
INASM_EXTERN( |Image$$RO$$Limit| ) INASM_EXTERN( |Image$$RO$$Limit| )
ldr r0, =|Image$$RO$$Limit| ldr r0, =|Image$$RO$$Limit|
#endif // BROM_TARGET_NORFIRM || BROM_TARGET_APP #endif // BROM_TARGET_FIRM || BROM_TARGET_APP
INASM_EXTERN( |Image$$RW$$Base| ) INASM_EXTERN( |Image$$RW$$Base| )
INASM_EXTERN( |Image$$ZI$$ZI$$Base| ) INASM_EXTERN( |Image$$ZI$$ZI$$Base| )

View File

@ -27,21 +27,31 @@
extern "C" { extern "C" {
#endif #endif
//#define BROM_TARGET_PHASE1
//------------------------------------- BROM //------------------------------------- BROM
#define HW_BROM_IMG HW_BIOS_IMG #define HW_BROM_IMG HW_BIOS_IMG
#define HW_BROM HW_BIOS #define HW_BROM HW_BIOS
#define HW_BROM_END (HW_BROM + HW_BROM_SIZE) #define HW_BROM_END (HW_BROM + HW_BROM_SIZE)
#ifdef BROM_TARGET_PHASE1
#define HW_BROM_SIZE 0x8000 // 32KB
#else // BROM_TARGET_PHASE1
#define HW_BROM_SIZE 0x10000 // 64KB #define HW_BROM_SIZE 0x10000 // 64KB
#endif // BROM_TARGET_PHASE1
#define HW_BROM_NML HW_BROM #define HW_BROM_NML HW_BROM
#define HW_BROM_NML_END (HW_BROM_NML + HW_BROM_NML_SIZE) #define HW_BROM_NML_END (HW_BROM_NML + HW_BROM_NML_SIZE)
#ifdef BROM_TARGET_PHASE1
#define HW_BROM_NML_SIZE 0x4000 // 16KB
#else // BROM_TARGET_PHASE1
#define HW_BROM_NML_SIZE 0x8000 // 32KB #define HW_BROM_NML_SIZE 0x8000 // 32KB
#endif // BROM_TARGET_PHASE1
#define HW_BROM_NML_ABT HW_BROM_NML #define HW_BROM_NML_ABT HW_BROM_NML
#define HW_BROM_NML_ABT_END (HW_BROM_NML_ABT + HW_BROM_NML_ABT_SIZE) #define HW_BROM_NML_ABT_END (HW_BROM_NML_ABT + HW_BROM_NML_ABT_SIZE)
#define HW_BROM_NML_ABT_SIZE 0x1000 // 4KB #define HW_BROM_NML_ABT_SIZE 0x1000 // 4KB
#define HW_BROM_SEC HW_BROM_NML_END #define HW_BROM_SEC HW_BROM_NML_END
#define HW_BROM_SEC_END (HW_BROM_SEC + HW_BROM_SEC_SIZE) #define HW_BROM_SEC_END (HW_BROM_SEC + HW_BROM_SEC_SIZE)
#define HW_BROM_SEC_SIZE 0x8000 // 32KB #define HW_BROM_SEC_SIZE HW_BROM_NML_SIZE
//------------------------------------- BROM_WRAM //------------------------------------- BROM_WRAM
#define HW_BROM_WRAM (HW_BROM_WRAM_END - HW_BROM_WRAM_SIZE) #define HW_BROM_WRAM (HW_BROM_WRAM_END - HW_BROM_WRAM_SIZE)

View File

@ -49,5 +49,5 @@ extern "C" {
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif
/* BROM_HW_ARM9_MMAP_BROM_H_ */ /* BROM_HW_ARM9_MMAP_TCM_H_ */
#endif #endif

View File

@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Project: TwlBrom - specfiles Project: TwlBrom - specfiles
File: ARM11-TEG-APP.ldscript.template File: ARM11-APP.ldscript.template
Copyright 2008 Nintendo. All rights reserved. Copyright 2008-2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo proprietary information of Nintendo of America Inc. and/or Nintendo

View File

@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------*
Project: TwlBrom - specfiles
File: ARM11-FIRM.ldscript.template
Copyright 2009 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:: 2008-12-01#$
$Rev: 53 $
$Author: nakasima $
*---------------------------------------------------------------------------*/
//
// Scatter Loading Description File Templete
//
#define SDK_ASM
#include <brom/hw/ARM11/mmap_brom.h>
LOAD_STATIC HW_FIRM HW_FIRM_SIZE
{
STUP_ENTRY +0
{
*crt0_firm.*o (.emb_text, +FIRST)
#ifdef BROM_DEF_LINK_SCATLD
*crt0scat.*o (.emb_text)
__main.o (+RO)
* (Region$$Table)
* (ZISection$$$Table)
#endif // BROM_DEF_LINK_SCATLD
}
RO +0
{
* (+RO)
}
RW +0
{
* (+RW)
}
ZI +0
{
* (+ZI)
}
BUF_OVER_BARRIER HW_FIRM_END EMPTY 0
{
}
}

View File

@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Project: TwlBrom - specfiles Project: TwlBrom - specfiles
File: ARM9-TEG-APP.ldscript.template File: ARM9-APP.ldscript.template
Copyright 2008 Nintendo. All rights reserved. Copyright 2008-2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo proprietary information of Nintendo of America Inc. and/or Nintendo

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*
Project: TwlBrom - specfiles
File: ARM9-FIRM.ldscript.template
Copyright 2009 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:: 2008-12-01#$
$Rev: 53 $
$Author: nakasima $
*---------------------------------------------------------------------------*/
//
// Scatter Loading Description File Templete
//
#define SDK_ASM
#include <brom/memorymap.h>
LOAD_STATIC HW_FIRM HW_FIRM_SIZE
{
STUP_ENTRY +0
{
*crt0_firm.*o (.emb_text, +FIRST)
#ifdef BROM_DEF_LINK_SCATLD
*crt0scat.*o (.emb_text)
__main.o (+RO)
* (Region$$Table)
* (ZISection$$$Table)
#endif // BROM_DEF_LINK_SCATLD
}
RO +0
{
* (+RO)
}
RW +0
{
* (+RW)
}
ZI +0
{
* (+ZI)
}
BUF_OVER_BARRIER HW_FIRM_END EMPTY 0
{
}
#ifndef BROM_DEF_LINK_SCATLD
DTCM HW_DTCM EMPTY 0
{
}
#else // BROM_DEF_LINK_SCATLD
ITCM (HW_ITCM + 0x100) (HW_ITCM_SIZE - 0x100)
{
* (.itcm)
* (.itcm.bss)
}
DTCM HW_DTCM HW_DTCM_SIZE
{
* (.dtcm)
* (.dtcm.bss)
}
#endif // BROM_DEF_LINK_SCATLD
}

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*
Project: CtrBrom - HW - include
File: mmap_axi_wram.h
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$
*---------------------------------------------------------------------------*/
#ifndef FIRM_HW_ARM11_AXI_WRAM_H_
#define FIRM_HW_ARM11_AXI_WRAM_H_
#include <ctr/hw/arm11/mmap_axi_wram.h>
#ifdef __cplusplus
extern "C" {
#endif
//------------------------------------- HW_FIRM_STACK
#define HW_FIRM_STACK (HW_FIRM_STACK_END - HW_FIRM_STACK_SIZE)
#define HW_FIRM_STACK_END HW_FIRM_MMU_TBL
#define HW_FIRM_STACK_SIZE 0x4000 // 16KB
#define HW_FIRM_SVC_STACK (HW_FIRM_SVC_STACK_END - HW_FIRM_SVC_STACK_SIZE)
#define HW_FIRM_SVC_STACK_END HW_FIRM_STACK_END
#define HW_FIRM_SVC_STACK_SIZE 0x100 // 256B
#define HW_FIRM_IRQ_STACK (HW_FIRM_IRQ_STACK_END - HW_FIRM_IRQ_STACK_SIZE)
#define HW_FIRM_IRQ_STACK_END HW_FIRM_SVC_STACK
#define HW_FIRM_IRQ_STACK_SIZE (0x1000 - HW_FIRM_SVC_STACK_SIZE) // 4KB - 256B
#define HW_FIRM_SYS_STACK (HW_FIRM_SYS_STACK_END - HW_FIRM_SYS_STACK_SIZE)
#define HW_FIRM_SYS_STACK_END HW_FIRM_IRQ_STACK
#define HW_FIRM_SYS_STACK_SIZE (HW_FIRM_STACK_SIZE - HW_FIRM_IRQ_STACK_SIZE - HW_FIRM_SVC_STACK_SIZE) // 12KB
//------------------------------------- HW_FIRM_MMU_TBL
#define HW_FIRM_MMU_TBL (HW_FIRM_MMU_TBL_END - HW_FIRM_MMU_TBL_SIZE)
#define HW_FIRM_MMU_TBL_END HW_FIRM_FROM_BROM_BUF // (16+8)KB
#define HW_FIRM_MMU_TBL_SIZE (HW_FIRM_MMU_T1_SIZE + HW_FIRM_MMU_T2_SIZE) // 24KB
#define HW_FIRM_MMU_T1 HW_FIRM_MMU_TBL
#define HW_FIRM_MMU_T2 HW_FIRM_MMU_T1_END
#define HW_FIRM_MMU_T1_END (HW_FIRM_MMU_T1 + HW_FIRM_MMU_T1_SIZE)
#define HW_FIRM_MMU_T2_END (HW_FIRM_MMU_T2 + HW_FIRM_MMU_T2_SIZE)
#define HW_FIRM_MMU_T1_SIZE 0x4000 // 16KB
#define HW_FIRM_MMU_T2_SIZE 0x2000 // 8KB
#ifdef __cplusplus
} /* extern "C" */
#endif
/* FIRM_HW_ARM11_AXI_WRAM_H_ */
#endif

View File

@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Project: CtrFirm - HW - include Project: CtrFirm - HW - include
File: mmap_firm.h File: mmap_axi_wram.h
Copyright 2008 Nintendo. All rights reserved. Copyright 2008-2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo proprietary information of Nintendo of America Inc. and/or Nintendo
@ -17,14 +17,16 @@
#ifndef FIRM_HW_ARM11_MMAP_FIRM_H_ #ifndef FIRM_HW_ARM11_MMAP_FIRM_H_
#define FIRM_HW_ARM11_MMAP_FIRM_H_ #define FIRM_HW_ARM11_MMAP_FIRM_H_
#include <firm/hw/ARM11/mmap_axi_wram.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//------------------------------------- FIRM //------------------------------------- FIRM
#define HW_FIRM HW_AXI_WRAM #define HW_FIRM HW_AXI_WRAM
#define HW_FIRM_END (HW_FIRM + HW_FIRM_SIZE) #define HW_FIRM_END HW_FIRM_STACK
#define HW_FIRM_SIZE 0x80000 // 512KB #define HW_FIRM_SIZE (HW_FIRM_END - HW_FIRM) // 512KB - 48KB
//------------------------------------- HW_FIRM_FROM_BROM_BUF //------------------------------------- HW_FIRM_FROM_BROM_BUF
#define HW_FIRM_FROM_BROM_BUF (HW_FIRM_FROM_BROM_BUF_END - HW_FIRM_FROM_BROM_BUF_SIZE) // 24KB #define HW_FIRM_FROM_BROM_BUF (HW_FIRM_FROM_BROM_BUF_END - HW_FIRM_FROM_BROM_BUF_SIZE) // 24KB

View File

@ -2,7 +2,7 @@
Project: CtrFirm - HW - include Project: CtrFirm - HW - include
File: mmap_firm.h File: mmap_firm.h
Copyright 2008 Nintendo. All rights reserved. Copyright 2008-2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo proprietary information of Nintendo of America Inc. and/or Nintendo
@ -17,6 +17,8 @@
#ifndef FIRM_HW_ARM9_MMAP_FIRM_H_ #ifndef FIRM_HW_ARM9_MMAP_FIRM_H_
#define FIRM_HW_ARM9_MMAP_FIRM_H_ #define FIRM_HW_ARM9_MMAP_FIRM_H_
#include <firm/hw/ARM9/mmap_tcm.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -0,0 +1,47 @@
/*---------------------------------------------------------------------------*
Project: CtrBrom - HW - include
File: mmap_tcm.h
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$
*---------------------------------------------------------------------------*/
#ifndef FIRM_HW_ARM9_MMAP_TCM_H_
#define FIRM_HW_ARM9_MMAP_TCM_H_
#ifdef __cplusplus
extern "C" {
#endif
//------------------------------------- HW_FIRM_STACK
#define HW_FIRM_STACK (HW_FIRM_STACK_END - HW_FIRM_STACK_SIZE)
#define HW_FIRM_STACK_END HW_DTCM_END
#define HW_FIRM_STACK_SIZE 0x1000 // 4KB
#define HW_FIRM_SVC_STACK (HW_FIRM_SVC_STACK_END - HW_FIRM_SVC_STACK_SIZE)
#define HW_FIRM_SVC_STACK_END HW_FIRM_STACK_END
#define HW_FIRM_SVC_STACK_SIZE 0x100 // 256B
#define HW_FIRM_IRQ_STACK (HW_FIRM_IRQ_STACK_END - HW_FIRM_IRQ_STACK_SIZE)
#define HW_FIRM_IRQ_STACK_END HW_FIRM_SVC_STACK
#define HW_FIRM_IRQ_STACK_SIZE 0x400 // 1KB
#define HW_FIRM_SYS_STACK (HW_FIRM_SYS_STACK_END - HW_FIRM_SYS_STACK_SIZE)
#define HW_FIRM_SYS_STACK_END HW_FIRM_IRQ_STACK
#define HW_FIRM_SYS_STACK_SIZE (HW_FIRM_STACK_SIZE - HW_FIRM_IRQ_STACK_SIZE - HW_FIRM_SVC_STACK_SIZE) // 2.75KB
#ifdef __cplusplus
} /* extern "C" */
#endif
/* FIRM_HW_ARM9_MMAP_TCM_H_ */
#endif