From 0c7e955d5558cc280c693c5f7c1c820848057cd1 Mon Sep 17 00:00:00 2001 From: yoshida_teruhisa Date: Wed, 12 Dec 2007 09:41:18 +0000 Subject: [PATCH] =?UTF-8?q?TwlSDK=203029=E5=AF=BE=E5=BF=9C=20=E3=80=80?= =?UTF-8?q?=E3=83=BB=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=82=BF=E3=81=AE=E5=87=A6=E7=90=86=E5=8F=8A=E3=81=B3?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=82=92=E4=B8=80=E9=83=A8SDK=E3=81=AEos?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=AB=E7=B5=84?= =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=82=93=E3=81=A0=E9=96=A2=E4=BF=82=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E3=80=80=E3=83=BB=E3=81=9D=E3=81=AE?= =?UTF-8?q?=E4=BB=963029=E5=AF=BE=E5=BF=9C=E3=81=AE=E3=81=9F=E3=82=81?= =?UTF-8?q?=E7=B4=B0=E3=80=85=E3=81=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@352 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/components/hyena.TWL/src/main.c | 39 +--------- build/libraries_sysmenu/Makefile | 2 +- .../reset_param/ARM9/Makefile | 49 ------------ .../reset_param/ARM9/src/reset_param.c | 77 ------------------- build/libraries_sysmenu/reset_param/Makefile | 30 -------- build/systemMenu_RED/Launcher/ARM9/Makefile | 1 - .../MachineSettings/ARM9/Makefile | 2 +- .../MachineSettings/ARM9/src/MachineSetting.c | 4 +- build/tests/RelocateChecker/ARM7/src/main.c | 2 +- .../crt/ARM7/src/crt0_rc.LTD.c | 2 +- .../sysmenu/sysmenu_lib/common/sysmenu_work.h | 2 +- 11 files changed, 10 insertions(+), 200 deletions(-) delete mode 100644 build/libraries_sysmenu/reset_param/ARM9/Makefile delete mode 100644 build/libraries_sysmenu/reset_param/ARM9/src/reset_param.c delete mode 100644 build/libraries_sysmenu/reset_param/Makefile diff --git a/build/components/hyena.TWL/src/main.c b/build/components/hyena.TWL/src/main.c index ff3ced94..dcadd9e3 100644 --- a/build/components/hyena.TWL/src/main.c +++ b/build/components/hyena.TWL/src/main.c @@ -253,45 +253,12 @@ static void ResetRTC( void ) } -static BOOL IsEnableJTAG( void ) -{ - // SCFGレジスタが無効になっていたら、SCFGレジスタの値は"0"になるので、WRAMに退避している値をチェックする。 - u8 value = ( reg_SCFG_EXT & REG_SCFG_EXT_CFG_MASK ) ? - (u8)( reg_SCFG_JTAG & REG_SCFG_JTAG_CPUJE_MASK ) : - (u8)( *(u8 *)HWi_WSYS09_ADDR & HWi_WSYS09_JTAG_CPUJE_MASK ); - return value ? TRUE : FALSE; -} - // Hot/Coldスタート判定およびリセットパラメータのリード -#define MCU_RESET_VALUE_BUF_ENABLE_MASK 0x80000000 -#define MCU_RESET_VALUE_OFS 0 -#define MCU_RESET_VALUE_LEN 1 void ReadResetParameter( void ) { - if( ( *(u32 *)HW_RESET_PARAMETER_BUF & MCU_RESET_VALUE_BUF_ENABLE_MASK ) == 0 ) { - (void)MCU_GetFreeRegisters( MCU_RESET_VALUE_OFS, (u8 *)HW_RESET_PARAMETER_BUF, MCU_RESET_VALUE_LEN ); - } - - // Hot/Coldスタート判定 - if( IsEnableJTAG() || // ISデバッガでのデバッグ動作時に常にホットスタート判定されるのを防ぐ - ( SYSMi_GetMCUFreeRegisterValue() == 0 ) ) { // "JTAG有効"か"マイコンフリーレジスタ値=0"ならColdスタート - u8 data = 1; - MCU_SetFreeRegisters( MCU_RESET_VALUE_OFS, &data, MCU_RESET_VALUE_LEN ); // マイコンフリーレジスタにホットスタートフラグをセット - SYSMi_GetWork()->isHotStart = FALSE; - }else { - SYSMi_GetWork()->isHotStart = TRUE; - // リセットパラメータ有効判定 - if( ( STD_StrNCmp( (const char *)&SYSMi_GetResetParamAddr()->header.magicCode, - SYSM_RESET_PARAM_MAGIC_CODE, - SYSM_RESET_PARAM_MAGIC_CODE_LEN ) == 0 ) && - ( SYSMi_GetResetParamAddr()->header.bodyLength > 0 ) && - ( SYSMi_GetResetParamAddr()->header.crc16 == SVC_GetCRC16( 65535, &SYSMi_GetResetParamAddr()->body, SYSMi_GetResetParamAddr()->header.bodyLength ) ) - ) { - // リセットパラメータが有効なら、ワークに退避 - MI_CpuCopy32 ( SYSMi_GetResetParamAddr(), &SYSMi_GetWork()->resetParam, sizeof(ResetParam) ); - SYSMi_GetWork()->isValidResetParam = TRUE; - } - } + BOOL hot; + SYSMi_GetWork()->isValidResetParam = OS_ReadResetParameter( (ResetParam *)&(SYSMi_GetWork()->resetParam), &hot ); + SYSMi_GetWork()->isHotStart = hot; // メインメモリのリセットパラメータをクリアしておく MI_CpuClear32( SYSMi_GetResetParamAddr(), 0x100 ); } diff --git a/build/libraries_sysmenu/Makefile b/build/libraries_sysmenu/Makefile index d005f516..ce8be973 100644 --- a/build/libraries_sysmenu/Makefile +++ b/build/libraries_sysmenu/Makefile @@ -22,7 +22,7 @@ include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs #---------------------------------------------------------------------------- -SUBDIRS = sysmenu settings mb_loader acsign boot hotsw reset_param +SUBDIRS = sysmenu settings mb_loader acsign boot hotsw #---------------------------------------------------------------------------- diff --git a/build/libraries_sysmenu/reset_param/ARM9/Makefile b/build/libraries_sysmenu/reset_param/ARM9/Makefile deleted file mode 100644 index 883cbf0e..00000000 --- a/build/libraries_sysmenu/reset_param/ARM9/Makefile +++ /dev/null @@ -1,49 +0,0 @@ -#! make -f -#---------------------------------------------------------------------------- -# Project: TwlIPL -# 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:: 2007-09-27#$ -# $Rev: 1203 $ -# $Author: yada $ -#---------------------------------------------------------------------------- - -SUBDIRS = - -#---------------------------------------------------------------------------- -TARGET_FIRM = SYSTEMMENU -TARGET_PLATFORM = TWL -TWL_ARCHGEN = LIMITED -TWL_PROC = ARM9 - -#---------------------------------------------------------------------------- - -SRCDIR = ./src - -SRCS = reset_param.c - -TARGET_LIB = libreset_param$(TWL_LIBSUFFIX).a - - -include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs - -INSTALL_TARGETS = $(TARGETS) -INSTALL_DIR = $(SYSMENU_INSTALL_LIBDIR) - -#---------------------------------------------------------------------------- - -do-build: $(TARGETS) - -include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules - - -#===== End of Makefile ===== - diff --git a/build/libraries_sysmenu/reset_param/ARM9/src/reset_param.c b/build/libraries_sysmenu/reset_param/ARM9/src/reset_param.c deleted file mode 100644 index 750dd4eb..00000000 --- a/build/libraries_sysmenu/reset_param/ARM9/src/reset_param.c +++ /dev/null @@ -1,77 +0,0 @@ -/*---------------------------------------------------------------------------* - Project: TwlIPL - File: reset_param.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:: 2007-11-26#$ - $Rev: 256 $ - $Author: yosiokat $ - *---------------------------------------------------------------------------*/ - -#include -#include - -// define data------------------------------------------------------- -#define RPi_RESET_PARAM_MAGIC_CODE "TRST" -#define RPi_RESET_PARAM_MAGIC_CODE_LEN 4 - -// リセットパラメータアドレスの取得(※ライブラリ向け) -#define RPi_GetResetParamAddr() ( (ResetParam *)0x02000100 ) - - -// extern data------------------------------------------------------- - -// function's prototype---------------------------------------------- -static void RPi_DoHardwareReset( void ); - -// global variables-------------------------------------------------- - -// static variables-------------------------------------------------- - -// const data-------------------------------------------------------- - -// 安全のため、この関数はitcmに配置 -#include -#include -static void RPi_DoHardwareReset( void ) -{ - // リセット命令発行 - PM_ForceToResetHardware(); - OS_Terminate(); -} - -#include -#include - -// ResetParamを指定してリセット -void RP_Reset( u8 type, NAMTitleId id, BootFlags *flag ) -{ - // メーカーコードとゲームコードをコピー - u32 *maker_code_dest_addr = (u32 *)((u32)(RPi_GetResetParamAddr()) + HW_PARAM_DELIVER_ARG_MAKERCODE_OFS); - u32 *game_code_dest_addr = (u32 *)((u32)(RPi_GetResetParamAddr()) + HW_PARAM_DELIVER_ARG_GAMECODE_OFS); - u16 *maker_code_src_addr = (u16 *)(HW_TWL_ROM_HEADER_BUF + 0x10); - u32 *game_code_src_addr = (u32 *)(HW_TWL_ROM_HEADER_BUF + 0xc); - *maker_code_dest_addr = (u32)*maker_code_src_addr; - *game_code_dest_addr = *game_code_src_addr; - - // リセットパラメータの設定 - RPi_GetResetParamAddr()->body.v1.bootTitleID = id; - RPi_GetResetParamAddr()->body.v1.flags = *flag; - MI_CpuCopyFast( RPi_RESET_PARAM_MAGIC_CODE, (char *)&RPi_GetResetParamAddr()->header.magicCode, RPi_RESET_PARAM_MAGIC_CODE_LEN); - RPi_GetResetParamAddr()->header.bodyLength = sizeof(ResetParamBody); - RPi_GetResetParamAddr()->header.crc16 = SVC_GetCRC16( 65535, &RPi_GetResetParamAddr()->body, RPi_GetResetParamAddr()->header.bodyLength ); - RPi_GetResetParamAddr()->header.type = type; - - - DC_FlushRange(RPi_GetResetParamAddr(), 0x100 ); - DC_WaitWriteBufferEmpty(); - - RPi_DoHardwareReset(); -} diff --git a/build/libraries_sysmenu/reset_param/Makefile b/build/libraries_sysmenu/reset_param/Makefile deleted file mode 100644 index c4ee65f7..00000000 --- a/build/libraries_sysmenu/reset_param/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -#! make -f -#---------------------------------------------------------------------------- -# Project: TwlIPL -# 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:: 2007-09-27#$ -# $Rev: 1203 $ -# $Author: yada $ -#---------------------------------------------------------------------------- - -TARGET_FIRM = SYSTEMMENU -SUBDIRS = ARM9 - -include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs - -#---------------------------------------------------------------------------- - -do-build: $(TARGETS) - -include $(TWL_IPL_RED_ROOT)/build/buildtools/modulerules - -#===== End of Makefile ===== diff --git a/build/systemMenu_RED/Launcher/ARM9/Makefile b/build/systemMenu_RED/Launcher/ARM9/Makefile index c9ed0602..0a563f99 100644 --- a/build/systemMenu_RED/Launcher/ARM9/Makefile +++ b/build/systemMenu_RED/Launcher/ARM9/Makefile @@ -21,7 +21,6 @@ SUBDIRS = \ ../../../libraries_sysmenu/settings \ ../../../libraries_sysmenu/boot \ ../../../libraries_sysmenu/hotsw \ - ../../../libraries_sysmenu/reset_param \ ../../../components/hyena.TWL #---------------------------------------------------------------------------- diff --git a/build/systemMenu_RED/MachineSettings/ARM9/Makefile b/build/systemMenu_RED/MachineSettings/ARM9/Makefile index e7e26a78..f0d4ed2e 100644 --- a/build/systemMenu_RED/MachineSettings/ARM9/Makefile +++ b/build/systemMenu_RED/MachineSettings/ARM9/Makefile @@ -47,7 +47,7 @@ LINCLUDES = $(MISC_DIR)/include MAKEROM_FLAGS += -DTITLEID_LO='$(TITLEID_LO)' -LLIBRARIES += libreset_param$(TWL_LIBSUFFIX).a +#LLIBRARIES += libreset_param$(TWL_LIBSUFFIX).a include $(TWL_IPL_RED_ROOT)/build/buildtools/commondefs diff --git a/build/systemMenu_RED/MachineSettings/ARM9/src/MachineSetting.c b/build/systemMenu_RED/MachineSettings/ARM9/src/MachineSetting.c index 1e60c7f4..3668bd29 100644 --- a/build/systemMenu_RED/MachineSettings/ARM9/src/MachineSetting.c +++ b/build/systemMenu_RED/MachineSettings/ARM9/src/MachineSetting.c @@ -218,7 +218,7 @@ int MachineSettingMain( void ) DrawMenu( s_csr, &s_settingParam ); if( pad.trg & PAD_BUTTON_START ) { - RP_Reset( 0, NULL, &tempflag ); + OS_SetResetParamAndResetHardware( 0, NULL, &tempflag ); } if( ( pad.trg & PAD_BUTTON_A ) || ( tp_select ) ) { // メニュー項目への分岐 @@ -250,7 +250,7 @@ int MachineSettingMain( void ) break; case 6: //pictochat起動テスト - RP_Reset( 0, 0x0001000154484350, &tempflag ); + OS_SetResetParamAndResetHardware( 0, 0x0001000150434854, &tempflag ); } } } diff --git a/build/tests/RelocateChecker/ARM7/src/main.c b/build/tests/RelocateChecker/ARM7/src/main.c index 3b2f5c3f..56266ef9 100644 --- a/build/tests/RelocateChecker/ARM7/src/main.c +++ b/build/tests/RelocateChecker/ARM7/src/main.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include "nvram_sp.h" diff --git a/build/tests/RelocateChecker/crt/ARM7/src/crt0_rc.LTD.c b/build/tests/RelocateChecker/crt/ARM7/src/crt0_rc.LTD.c index 7b0ed5a8..c2dd6201 100644 --- a/build/tests/RelocateChecker/crt/ARM7/src/crt0_rc.LTD.c +++ b/build/tests/RelocateChecker/crt/ARM7/src/crt0_rc.LTD.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "boot_sync.h" /*---------------------------------------------------------------------------*/ diff --git a/include/sysmenu/sysmenu_lib/common/sysmenu_work.h b/include/sysmenu/sysmenu_lib/common/sysmenu_work.h index 27918985..3e0317cc 100644 --- a/include/sysmenu/sysmenu_lib/common/sysmenu_work.h +++ b/include/sysmenu/sysmenu_lib/common/sysmenu_work.h @@ -22,7 +22,7 @@ #include #include -#include +//#include #ifdef __cplusplus extern "C" {