SDブート用とメニューブート用のmainを分離

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@55 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
yutaka 2007-10-18 03:53:48 +00:00
parent bb5c6dea73
commit 6968da2b49
17 changed files with 643 additions and 63 deletions

View File

@ -23,7 +23,8 @@ include $(TWLFIRM_ROOT)/build/buildtools/commondefs
SUBDIRS = \
nandfirm-print \
nandfirm-loader \
sdmc-launcher \
menu-launcher \
#----------------------------------------------------------------------------

View File

@ -1,6 +1,6 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlFirm - tools - nandfirm-loader
# Project: TwlFirm - tools - menu-launcher
# File: Makefile
#
# Copyright 2007 Nintendo. All rights reserved.
@ -25,7 +25,7 @@ LINCLUDES = ../include
#----------------------------------------------------------------------------
TARGET_BIN = twl_nandfirm7_loader.tef
TARGET_BIN = menu_launcher7.tef
SRCS = main.c

View File

@ -0,0 +1,179 @@
/*---------------------------------------------------------------------------*
Project: TwlFirm - nandfirm - menu-launcher
File: main.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 <firm.h>
#include <twl/os/ARM7/debugLED.h>
#define FATFS_HEAP_SIZE (64*1024) // FATFS用ヒープ (サイズ調整必要)
#define BOOT_DEVICE FATFS_MEDIA_TYPE_NAND
#define PARTITION_NO 0 // 対象パーティション
#define DRIVE_LETTER 'A' // マウント先ドライブ名
#define DRIVE_NO (DRIVE_LETTER - 'A') // マウント先ドライブ番号
static u8 fatfsHeap[FATFS_HEAP_SIZE] __attribute__ ((aligned (32)));
static SDPortContextData nandContext; // 一時待避用 (次に渡すならSHAREDのどこかのアドレスにする)
#ifndef SDK_FINALROM
static u8 step = 0x80;
#endif
/*
Profile
*/
#ifndef SDK_FINALROM
#define PRFILE_MAX 128
u32 profile[PRFILE_MAX];
u32 pf_cnt = 0;
#endif
/***************************************************************
PreInit
FromBootの対応をまとめる
OS_Init前なので注意 (ARM9によるメインメモリ初期化で消されないように注意)
***************************************************************/
static void PreInit(void)
{
/*
FromBrom関連
*/
/* 鍵はどこへ? */
// NANDパラメータの待避
nandContext = OSi_GetFromBromAddr()->SDNandContext;
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
}
/***************************************************************
EraseAll
DSモードにして終わるのがよいか
***************************************************************/
static void EraseAll(void)
{
#ifdef SDK_FINALROM
// TODO
#endif
}
void TwlSpMain( void )
{
// OS_InitDebugLED and OS_SetDebugLED are able to call after OS_Init
#ifndef SDK_FINALROM
I2Ci_WriteRegister(I2C_SLAVE_DEBUG_LED, 0x03, 0x00);
I2Ci_WriteRegister(I2C_SLAVE_DEBUG_LED, 0x01, ++step);
#endif
PreInit();
#ifndef SDK_FINALROM
I2Ci_WriteRegister(I2C_SLAVE_DEBUG_LED, 0x01, ++step);
// 0: before PXI
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_InitFIRM();
#ifndef SDK_FINALROM
// 1: after PXI
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_SetDebugLED(++step);
PM_InitFIRM();
#ifndef SDK_FINALROM
// 2: after PM
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_SetDebugLED(++step);
/* FATFSライブラリ用にカレントヒープに設定 */
{
OSHeapHandle hh;
u8 *lo = (u8*)fatfsHeap;
u8 *hi = (u8*)fatfsHeap + FATFS_HEAP_SIZE;
lo = OS_InitAlloc(OS_ARENA_MAIN_SUBPRIV, lo, hi, 1);
hh = OS_CreateHeap(OS_ARENA_MAIN_SUBPRIV, lo + 32, hi - 32);
OS_SetCurrentHeap(OS_ARENA_MAIN_SUBPRIV, hh);
}
OS_SetDebugLED(++step);
if ( FATFS_InitFIRM( &nandContext ) )
{
#ifndef SDK_FINALROM
// 3: after FATFS
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_SetDebugLED(++step);
if ( FATFS_MountDriveFirm( DRIVE_NO, BOOT_DEVICE, PARTITION_NO ) )
{
BOOL result;
#ifndef SDK_FINALROM
// 4: after Mount
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_SetDebugLED(++step);
result = FATFS_OpenRecentMenu( DRIVE_NO );
if ( result )
{
#ifndef SDK_FINALROM
// 5: after Open
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_SetDebugLED(++step);
if ( FATFS_LoadHeader() && FATFS_LoadMenu() )
{
#ifndef SDK_FINALROM
// 127: before BootMenu
pf_cnt = PRFILE_MAX-1;
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_SetDebugLED(++step);
FATFS_BootMenu();
}
}
}
}
OS_SetDebugLED( (u8)(0xF0 | step));
EraseAll();
// failed
while (1)
{
PXI_NotifyID( FIRM_PXI_ID_NULL );
}
}

View File

@ -24,15 +24,12 @@ LINCLUDES = ../include
#----------------------------------------------------------------------------
TARGET_BIN = twl_nandfirm9_loader.tef
TARGET_BIN = menu_launcher9.tef
SRCS = main.c
CRT0_O = crt0_firm.o
MAKEROM_ARM7 = ../ARM7/bin/ARM7-TS/Release/twl_nandfirm7_loader.sbin
MAKEROM_ARM7_BASE = ../ARM7/bin/ARM7-TS/Release/twl_nandfirm7_loader
#LCFILE_TEMPLATE = $(FIRM_SPECDIR)/$(FIRM_PROC)-$(FIRM_PLATFORM)-PARTNER.lcf.template
#SRCDIR = # using default

View File

@ -0,0 +1,126 @@
/*---------------------------------------------------------------------------*
Project: TwlFirm - nandfirm - menu-launcher
File: main.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 <firm.h>
/* 鍵はどこへ? */
#define RSA_KEY_ADDR OSi_GetFromBromAddr()->rsa_pubkey[7]
#define RSA_HEAP_SIZE (4*1024) // RSA用ヒープサイズ (サイズ調整必要)
static u8 acHeap[RSA_HEAP_SIZE] __attribute__ ((aligned (32)));
static int acPool[3];
/*
Profile
*/
#ifndef SDK_FINALROM
#define PRFILE_MAX 128
u32 profile[PRFILE_MAX];
u32 pf_cnt = 0;
#endif
/***************************************************************
PreInit
FromBootの対応をまとめる
OS_Init前なので注意
***************************************************************/
static void PreInit(void)
{
/*
*/
// SHARED領域クリア (IS-TWL-DEBUGGERの更新待ち)
#ifdef SDK_FINALROM
MIi_CpuClearFast( 0, (void*)HW_MAIN_MEM_SHARED, HW_MAIN_MEM_SHARED_END-HW_MAIN_MEM_SHARED );
#endif
/*
FromBrom関連
*/
/* 鍵はどこへ? */
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
}
/***************************************************************
CheckHeader
32Bは固定値と思われ ()
***************************************************************/
static BOOL CheckHeader(void)
{
// TODO
return TRUE;
}
/***************************************************************
EraseAll
DSモードにして終わるのがよいか
***************************************************************/
static void EraseAll(void)
{
#ifdef SDK_FINALROM
// TODO
#endif
}
void TwlMain( void )
{
PreInit();
#ifndef SDK_FINALROM
// 0: before PXI
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
OS_InitFIRM();
#ifndef SDK_FINALROM
OS_InitTick();
// 1: after PXI
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
SVC_InitSignHeap( acPool, acHeap, sizeof(acHeap) );
// load menu
if ( MI_LoadHeader( acPool, RSA_KEY_ADDR ) && CheckHeader() && MI_LoadMenu() )
{
#ifndef SDK_FINALROM
// 127: before BootMenu
pf_cnt = PRFILE_MAX-1;
profile[pf_cnt++] = (u32)OS_TicksToMicroSeconds(OS_GetTick());
#endif
MI_BootMenu();
}
EraseAll();
// failed
while (1)
{
PXI_NotifyID( FIRM_PXI_ID_NULL );
}
}

View File

@ -1,6 +1,6 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlFirm - build
# Project: TwlFirm - nandfirm - menu-launcher
# File: Makefile
#
# Copyright 2007 Nintendo. All rights reserved.
@ -30,10 +30,10 @@ SUBDIRS = \
ARM9 \
wram_regs \
TARGET_FIRM_BIN = nandfirm_loader.nand nandfirm_loader.srl
TARGET_FIRM_BIN = menu_launcher.nand menu_launcher.srl
BINDIR = .
MAKEFIRM_ARM9 = ARM9/bin/ARM9-$(FIRM_PLATFORM)$(CODEGEN_ARCH)/$(FIRM_BUILD_DIR)/twl_nandfirm9_loader.tef
MAKEFIRM_ARM7 = ARM7/bin/ARM7-$(FIRM_PLATFORM)$(CODEGEN_ARCH)/$(FIRM_BUILD_DIR)/twl_nandfirm7_loader.tef
MAKEFIRM_ARM9 = ARM9/bin/ARM9-$(FIRM_PLATFORM)$(CODEGEN_ARCH)/$(FIRM_BUILD_DIR)/menu_launcher9.tef
MAKEFIRM_ARM7 = ARM7/bin/ARM7-$(FIRM_PLATFORM)$(CODEGEN_ARCH)/$(FIRM_BUILD_DIR)/menu_launcher7.tef
MAKEFIRM_RSA_PRVKEY = $(TWL_KEYSDIR)/rsa/private_nand.der
LDEPENDS_BIN += wram_regs/wram_regs.rbin

View File

@ -0,0 +1,51 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlFirm - nandfirm - sdmc-launcher
# File: Makefile
#
# 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:$
#----------------------------------------------------------------------------
FIRM_PROC = ARM7
FIRM_TARGET = FIRM
SUBDIRS =
LINCLUDES = ../include
#----------------------------------------------------------------------------
TARGET_BIN = sdmc_launcher7.tef
SRCS = main.c
CRT0_O = crt0_firm.o
#LCFILE_TEMPLATE = $(FIRM_SPECDIR)/$(FIRM_PROC)-$(FIRM_PLATFORM)-PARTNER.lcf.template
#SRCDIR = # using default
#LCFILE = # using default
include $(TWLFIRM_ROOT)/build/buildtools/commondefs
LLIBRARIES = libaes_sp$(TWL_LIBSUFFIX).a
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLFIRM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,5 +1,5 @@
/*---------------------------------------------------------------------------*
Project: TwlFirm - nandfirm - nandrfirm-loader
Project: TwlFirm - nandfirm - sdmc-launcher
File: main.c
Copyright 2007 Nintendo. All rights reserved.
@ -17,11 +17,8 @@
#include <firm.h>
#include <twl/os/ARM7/debugLED.h>
//#define BOOT_SECURE_SRL // 本番SRLをブートするときにだけ定義する
#define FATFS_HEAP_SIZE (64*1024) // FATFS用ヒープ (サイズ調整必要)
#ifndef BOOT_SECURE_SRL
#define BOOT_DEVICE FATFS_MEDIA_TYPE_SD
#define PARTITION_NO 0 // 0固定
#define MENU_FILE (char*)L"A:\\menu.srl" // 対象ファイル(DRIVE_LETTERと合わせること)
@ -29,10 +26,6 @@
#define MENU_FILE_B (char*)L"A:\\menu_b.srl" // 対象ファイル(DRIVE_LETTERと合わせること)
#define MENU_FILE_L (char*)L"A:\\menu_l.srl" // 対象ファイル(DRIVE_LETTERと合わせること)
#define MENU_FILE_R (char*)L"A:\\menu_r.srl" // 対象ファイル(DRIVE_LETTERと合わせること)
#else
#define BOOT_DEVICE FATFS_MEDIA_TYPE_NAND
#define PARTITION_NO 0 // 対象パーティション
#endif
#define DRIVE_LETTER 'A' // マウント先ドライブ名
#define DRIVE_NO (DRIVE_LETTER - 'A') // マウント先ドライブ番号
@ -67,9 +60,6 @@ static void PreInit(void)
FromBrom関連
*/
#ifdef BOOT_SECURE_SRL
/* 鍵はどこへ? */
#endif
// NANDパラメータの待避
nandContext = OSi_GetFromBromAddr()->SDNandContext;
@ -125,27 +115,6 @@ void TwlSpMain( void )
OS_SetDebugLED(++step);
#if 0
OS_TPrintf("OS_GetMainArenaHi() = 0x%08X\n", OS_GetMainArenaHi());
OS_TPrintf("OS_GetMainArenaLo() = 0x%08X\n", OS_GetMainArenaLo());
OS_TPrintf("OS_GetSubPrivArenaHi() = 0x%08X\n", OS_GetSubPrivArenaHi());
OS_TPrintf("OS_GetSubPrivArenaLo() = 0x%08X\n", OS_GetSubPrivArenaLo());
OS_TPrintf("OS_GetMainExArenaHi() = 0x%08X\n", OS_GetMainExArenaHi());
OS_TPrintf("OS_GetMainExArenaLo() = 0x%08X\n", OS_GetMainExArenaLo());
OS_TPrintf("OS_GetITCMArenaHi() = 0x%08X\n", OS_GetITCMArenaHi());
OS_TPrintf("OS_GetITCMArenaLo() = 0x%08X\n", OS_GetITCMArenaLo());
OS_TPrintf("OS_GetDTCMArenaHi() = 0x%08X\n", OS_GetDTCMArenaHi());
OS_TPrintf("OS_GetDTCMArenaLo() = 0x%08X\n", OS_GetDTCMArenaLo());
OS_TPrintf("OS_GetSharedArenaHi() = 0x%08X\n", OS_GetSharedArenaHi());
OS_TPrintf("OS_GetSharedArenaLo() = 0x%08X\n", OS_GetSharedArenaLo());
OS_TPrintf("OS_GetWramMainArenaHi() = 0x%08X\n", OS_GetWramMainArenaHi());
OS_TPrintf("OS_GetWramMainArenaLo() = 0x%08X\n", OS_GetWramMainArenaLo());
OS_TPrintf("OS_GetWramSubArenaHi() = 0x%08X\n", OS_GetWramSubArenaHi());
OS_TPrintf("OS_GetWramSubArenaLo() = 0x%08X\n", OS_GetWramSubArenaLo());
OS_TPrintf("OS_GetWramSubPrivArenaHi() = 0x%08X\n", OS_GetWramSubPrivArenaHi());
OS_TPrintf("OS_GetWramSubPrivArenaLo() = 0x%08X\n", OS_GetWramSubPrivArenaLo());
#endif
/* FATFSライブラリ用にカレントヒープに設定 */
{
OSHeapHandle hh;
@ -175,9 +144,6 @@ void TwlSpMain( void )
#endif
OS_SetDebugLED(++step);
#ifdef BOOT_SECURE_SRL
result = FATFS_OpenRecentMenu( DRIVE_NO );
#else
switch ( PAD_Read() & PAD_KEYPORT_MASK )
{
case 0:
@ -200,7 +166,7 @@ void TwlSpMain( void )
OS_Terminate();
break;
}
#endif
if ( result )
{
#ifndef SDK_FINALROM

View File

@ -0,0 +1,50 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlFirm - nandfirm - sdmc-launcher
# File: Makefile
#
# 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:$
#----------------------------------------------------------------------------
FIRM_TARGET = FIRM
SUBDIRS =
LINCLUDES = ../include
#----------------------------------------------------------------------------
TARGET_BIN = sdmc_launcher9.tef
SRCS = main.c
CRT0_O = crt0_firm.o
#LCFILE_TEMPLATE = $(FIRM_SPECDIR)/$(FIRM_PROC)-$(FIRM_PLATFORM)-PARTNER.lcf.template
#SRCDIR = # using default
#LCFILE = # using default
include $(TWLFIRM_ROOT)/build/buildtools/commondefs
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLFIRM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,5 +1,5 @@
/*---------------------------------------------------------------------------*
Project: TwlFirm - nandfirm - nandrfirm-loader
Project: TwlFirm - nandfirm - sdmc-launcher
File: main.c
Copyright 2007 Nintendo. All rights reserved.
@ -16,9 +16,6 @@
*---------------------------------------------------------------------------*/
#include <firm.h>
//#define BOOT_SECURE_SRL // 本番SRLをブートするときにだけ定義する
#ifndef BOOT_SECURE_SRL
#define RSA_KEY_ADDR rsa_key
static const u8 rsa_key[128] =
{
@ -32,10 +29,6 @@ static const u8 rsa_key[128] =
0xe0, 0x6d, 0x21, 0x00, 0xcd, 0x42, 0xd8, 0x84, 0x85, 0xe3, 0xb2, 0x02, 0x1a, 0xa5, 0x89, 0x02,
0xa1, 0x96, 0xc6, 0xf7, 0x61, 0x68, 0x66, 0xe6, 0x65, 0x12, 0xb7, 0xf1, 0x49
};
#else
/* 鍵はどこへ? */
#define RSA_KEY_ADDR OSi_GetFromBromAddr()->rsa_pubkey[7]
#endif
#define RSA_HEAP_SIZE (4*1024) // RSA用ヒープサイズ (サイズ調整必要)
@ -65,17 +58,15 @@ static void PreInit(void)
// SHARED領域クリア (IS-TWL-DEBUGGERの更新待ち)
#ifdef SDK_FINALROM
MIi_CpuClearFast( 0, (void*)HW_MAIN_MEM_SHARED, HW_MAIN_MEM_SHARED_END-HW_MAIN_MEM_SHARED );
//MIi_CpuClearFast( 0, (void*)HW_MAIN_MEM_SHARED, HW_MAIN_MEM_SHARED_END-HW_MAIN_MEM_SHARED );
#endif
// SHARED領域クリア (ここだけでOK?)
MIi_CpuClearFast( 0, (void*)HW_PXI_SIGNAL_PARAM_ARM9, HW_MAIN_MEM_SHARED_END-HW_PXI_SIGNAL_PARAM_ARM9);
/*
FromBrom関連
*/
#ifdef BOOT_SECURE_SRL
/* 鍵はどこへ? */
#endif
MIi_CpuClearFast( 0, (void*)OSi_GetFromBromAddr(), sizeof(OSFromBromBuf) );
}
@ -87,9 +78,6 @@ static void PreInit(void)
***************************************************************/
static BOOL CheckHeader(void)
{
#ifdef BOOT_SECURE_SRL
// TODO
#endif
return TRUE;
}

View File

@ -0,0 +1,59 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlFirm - nandfirm - sdmc-launcher
# File: Makefile
#
# 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:$
#----------------------------------------------------------------------------
FIRM_TARGET = FIRM
# if you have no valid key, comment out next line
TWL_KEYSDIR = $(FIRM_ROOT)/../twl_firmware/bootrom/build/keys
#----------------------------------------------------------------------------
SUBDIRS = \
ARM7 \
ARM9 \
wram_regs \
TARGET_FIRM_BIN = sdmc_launcher.nand sdmc_launcher.srl
BINDIR = .
MAKEFIRM_ARM9 = ARM9/bin/ARM9-$(FIRM_PLATFORM)$(CODEGEN_ARCH)/$(FIRM_BUILD_DIR)/sdmc_launcher9.tef
MAKEFIRM_ARM7 = ARM7/bin/ARM7-$(FIRM_PLATFORM)$(CODEGEN_ARCH)/$(FIRM_BUILD_DIR)/sdmc_launcher7.tef
MAKEFIRM_RSA_PRVKEY = $(TWL_KEYSDIR)/rsa/private_nand.der
LDEPENDS_BIN += wram_regs/wram_regs.rbin
MAKEROM_ARM7_BASE = $(basename $(MAKEFIRM_ARM7))
MAKEROM_FLAGS += -F
NITRO_MAKEROM = TRUE
MAKEFIRM_FLAGS += -p
FIRM_SPEC = nandfirm.nandsf
LDIRT_CLEAN += $(TARGETS) \
$(basename $(firstword $(TARGETS))).tlf \
rsa_public.sbin \
include $(TWLFIRM_ROOT)/build/buildtools/commondefs
#----------------------------------------------------------------------------
do-build: $(TARGET_BIN)
include $(TWLFIRM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,24 @@
#NANDSF --- Nandfirm Spec File
VERSION : GENERATE
RSA_KEY : $(MAKEFIRM_RSA_PRVKEY)
OUT_KEY : rsa_public.sbin
WRAM_RBIN: ./wram_regs/wram_regs.rbin
MIRROR_OFS: 0x80000
DECOMP_PROC : ARM9 # ARM9 or ARM7
ARM9_COMP : FALSE # TRUE or FALSE, should be before ARM9_SBIN
ARM9_SBIN : $(MAKEFIRM_ARM9).FLX.TWL.sbin
ARM9_ELF : $(MAKEFIRM_ARM9).tef
ARM7_COMP : FALSE # TRUE or FALSE, should be before ARM7_SBIN
ARM7_SBIN : $(MAKEFIRM_ARM7).FLX.TWL.sbin
ARM7_ELF : $(MAKEFIRM_ARM7).tef
ARM9_X2 : TRUE # TRUE or FALSE
NCD_ROMOFS : 0x07fe00

View File

@ -0,0 +1,48 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlFirm - tools - norfirm-print
# File: Makefile
#
# 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:$
#----------------------------------------------------------------------------
SUBDIRS =
LINCLUDES = ../include
#----------------------------------------------------------------------------
TARGET_BIN = wram_regs.rbin
SRCS = \
wram_regs.c \
#SRCDIR = # using default
#LCFILE = # using default
include $(TWLFIRM_ROOT)/build/buildtools/commondefs
INSTALL_DIR = .
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN)
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLFIRM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,91 @@
/*---------------------------------------------------------------------------*
Project: TwlFirm - tools - nandfirm
File: wram_regs.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 <twl/mi.h>
#include <firm/format/wram_regs.h>
MIHeader_WramRegs wram_regs_init =
{
// ARM9
{
REG_MI_MBK_A0_FIELD( 1, MI_WRAM_A_OFFSET_0KB , MI_WRAM_ARM9 ),
REG_MI_MBK_A1_FIELD( 1, MI_WRAM_A_OFFSET_64KB , MI_WRAM_ARM9 ),
REG_MI_MBK_A2_FIELD( 1, MI_WRAM_A_OFFSET_128KB, MI_WRAM_ARM9 ),
REG_MI_MBK_A3_FIELD( 1, MI_WRAM_A_OFFSET_192KB, MI_WRAM_ARM9 ),
},
{
REG_MI_MBK_B0_FIELD( 1, MI_WRAM_BC_OFFSET_0KB , MI_WRAM_ARM7 ),
REG_MI_MBK_B1_FIELD( 1, MI_WRAM_BC_OFFSET_32KB , MI_WRAM_ARM7 ),
REG_MI_MBK_B2_FIELD( 1, MI_WRAM_BC_OFFSET_64KB , MI_WRAM_ARM7 ),
REG_MI_MBK_B3_FIELD( 1, MI_WRAM_BC_OFFSET_96KB , MI_WRAM_ARM7 ),
REG_MI_MBK_B4_FIELD( 1, MI_WRAM_BC_OFFSET_128KB, MI_WRAM_ARM7 ),
REG_MI_MBK_B5_FIELD( 1, MI_WRAM_BC_OFFSET_160KB, MI_WRAM_ARM7 ),
REG_MI_MBK_B6_FIELD( 1, MI_WRAM_BC_OFFSET_192KB, MI_WRAM_ARM7 ),
REG_MI_MBK_B7_FIELD( 1, MI_WRAM_BC_OFFSET_224KB, MI_WRAM_ARM7 ),
},
{
REG_MI_MBK_C0_FIELD( 1, MI_WRAM_BC_OFFSET_0KB , MI_WRAM_ARM7 ),
REG_MI_MBK_C1_FIELD( 1, MI_WRAM_BC_OFFSET_32KB , MI_WRAM_ARM7 ),
REG_MI_MBK_C2_FIELD( 1, MI_WRAM_BC_OFFSET_64KB , MI_WRAM_ARM7 ),
REG_MI_MBK_C3_FIELD( 1, MI_WRAM_BC_OFFSET_96KB , MI_WRAM_ARM7 ),
REG_MI_MBK_C4_FIELD( 1, MI_WRAM_BC_OFFSET_128KB, MI_WRAM_ARM7 ),
REG_MI_MBK_C5_FIELD( 1, MI_WRAM_BC_OFFSET_160KB, MI_WRAM_ARM7 ),
REG_MI_MBK_C6_FIELD( 1, MI_WRAM_BC_OFFSET_192KB, MI_WRAM_ARM7 ),
REG_MI_MBK_C7_FIELD( 1, MI_WRAM_BC_OFFSET_224KB, MI_WRAM_ARM7 ),
},
REG_MI_MBK6_FIELD( REG_WRAM_MAP_CONV_ADDR( 6, A, EADDR, HW_WRAM_AREA_HALF + 0x00040000 ),
MI_WRAM_IMAGE_256KB,
REG_WRAM_MAP_CONV_ADDR( 6, A, SADDR, HW_WRAM_AREA_HALF )
),
REG_MI_MBK7_FIELD( REG_WRAM_MAP_CONV_ADDR( 7, B, EADDR, HW_WRAM_AREA_HALF + 0x00080000 ),
MI_WRAM_IMAGE_256KB,
REG_WRAM_MAP_CONV_ADDR( 7, B, SADDR, HW_WRAM_AREA_HALF + 0x00040000 )
),
REG_MI_MBK8_FIELD( REG_WRAM_MAP_CONV_ADDR( 8, C, EADDR, MI_WRAM_MAP_NULL ),
MI_WRAM_IMAGE_256KB,
REG_WRAM_MAP_CONV_ADDR( 8, C, SADDR, MI_WRAM_MAP_NULL )
),
// ARM7
REG_MI_MBK6_FIELD( REG_WRAM_MAP_CONV_ADDR( 6, A, EADDR, MI_WRAM_MAP_NULL ),
MI_WRAM_IMAGE_256KB,
REG_WRAM_MAP_CONV_ADDR( 6, A, SADDR, MI_WRAM_MAP_NULL )
),
REG_MI_MBK7_FIELD( REG_WRAM_MAP_CONV_ADDR( 7, B, EADDR, HW_WRAM_AREA_HALF + 0x00080000 ),
MI_WRAM_IMAGE_256KB,
REG_WRAM_MAP_CONV_ADDR( 7, B, SADDR, HW_WRAM_AREA_HALF + 0x00040000 )
),
REG_MI_MBK8_FIELD( REG_WRAM_MAP_CONV_ADDR( 8, C, EADDR, HW_WRAM_AREA_HALF + 0x00040000 ),
MI_WRAM_IMAGE_256KB,
REG_WRAM_MAP_CONV_ADDR( 8, C, SADDR, HW_WRAM_AREA_HALF )
),
// WRAM Lock
{
0,
0,
0,
},
// WRAM-0/1
3,
// VRAM-C
7,
// VRAM-D
7,
};