mirror of
https://github.com/rvtr/TwlIPL.git
synced 2025-10-31 06:01:12 -04:00
検証用1st
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/branches/20071128_hardware_reset@280 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
parent
1ae8c30476
commit
2c2df79b50
@ -93,6 +93,12 @@ void
|
||||
TwlSpMain(void)
|
||||
{
|
||||
OSHeapHandle heapHandle;
|
||||
|
||||
{
|
||||
SCFG_SetJtagControl(TRUE,TRUE,FALSE);//JTAG Enable
|
||||
//*((u32 *)0x04000300) = 2;
|
||||
while(1){}
|
||||
}
|
||||
|
||||
// SYSMワークのクリア
|
||||
MI_CpuClear32( SYSMi_GetWork(), sizeof(SYSM_work) );
|
||||
@ -231,7 +237,7 @@ static void ReadResetParameter( void )
|
||||
}
|
||||
}
|
||||
// メインメモリのリセットパラメータをクリアしておく
|
||||
MI_CpuClear32( SYSMi_GetResetParamAddr(), 0x100 );
|
||||
// MI_CpuClear32( SYSMi_GetResetParamAddr(), 0x100 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -34,6 +34,17 @@ static TitleProperty s_titleList[ LAUNCHER_TITLE_LIST_NUM ];
|
||||
|
||||
// const data------------------------------------------------------------------
|
||||
|
||||
#include <nitro/code32.h>
|
||||
#include <twl/itcm_begin.h>
|
||||
static void ResetHardware( void )
|
||||
{
|
||||
// リセット命令発行
|
||||
PM_ForceToResetHardware();
|
||||
OS_Terminate();
|
||||
}
|
||||
#include <twl/itcm_end.h>
|
||||
#include <nitro/codereset.h>
|
||||
|
||||
// メイン
|
||||
void TwlMain( void )
|
||||
{
|
||||
@ -53,6 +64,19 @@ void TwlMain( void )
|
||||
OSTick start, end = 0;
|
||||
BOOL direct_boot = FALSE;
|
||||
|
||||
// デバグ用
|
||||
ResetParam debugresetparam;
|
||||
ResetParam debugresetparam2;
|
||||
MI_CpuCopy32 ( SYSMi_GetResetParamAddr(), &debugresetparam, sizeof(ResetParam) );
|
||||
|
||||
/*
|
||||
SYSMi_GetResetParamAddr()->body.v1.bootTitleID = 0x000100015445534d;
|
||||
MI_CpuCopyFast( SYSM_RESET_PARAM_MAGIC_CODE, (char *)&SYSMi_GetResetParamAddr()->header.magicCode, SYSM_RESET_PARAM_MAGIC_CODE_LEN);
|
||||
DC_FlushAll();
|
||||
DC_WaitWriteBufferEmpty( );
|
||||
MI_CpuCopy32 ( SYSMi_GetResetParamAddr(), &debugresetparam2, sizeof(ResetParam) );
|
||||
*/
|
||||
|
||||
// システムメニュー初期化----------
|
||||
SYSM_Init( Alloc, Free ); // OS_Initの前でコール。
|
||||
|
||||
@ -137,8 +161,21 @@ void TwlMain( void )
|
||||
if( pBootTitle ) {
|
||||
state = LOAD_START;
|
||||
}
|
||||
PrintfSJIS( 30, 122, TXT_COLOR_RED, "magicCode:%c%c%c%c", ((char *)(&debugresetparam.header.magicCode))[0],
|
||||
((char *)(&debugresetparam.header.magicCode))[1],
|
||||
((char *)(&debugresetparam.header.magicCode))[2],
|
||||
((char *)(&debugresetparam.header.magicCode))[3] );
|
||||
PrintfSJIS( 30, 134, TXT_COLOR_RED, "bootTitleID:0x%llx", debugresetparam.body.v1.bootTitleID );
|
||||
break;
|
||||
case LOAD_START:
|
||||
|
||||
SYSMi_GetResetParamAddr()->body.v1.bootTitleID = 0x000100015445534d;
|
||||
MI_CpuCopyFast( SYSM_RESET_PARAM_MAGIC_CODE, (char *)&SYSMi_GetResetParamAddr()->header.magicCode, SYSM_RESET_PARAM_MAGIC_CODE_LEN);
|
||||
DC_FlushAll();
|
||||
DC_WaitWriteBufferEmpty();
|
||||
// デバグ用 never return.
|
||||
ResetHardware();
|
||||
|
||||
SYSM_StartLoadTitle( pBootTitle );
|
||||
state = LOADING;
|
||||
|
||||
|
||||
@ -182,19 +182,27 @@ void MachineSettingInit( void )
|
||||
g_pNowProcess = MachineSettingMain;
|
||||
}
|
||||
|
||||
#include <nitro/code32.h>
|
||||
#include <twl/itcm_begin.h>
|
||||
static void ResetHardware( NAMTitleId id, BootFlags *flag)
|
||||
{
|
||||
/*
|
||||
// リセットパラメータの設定
|
||||
SYSMi_GetResetParamAddr()->body.v1.bootTitleID = id;
|
||||
SYSMi_GetResetParamAddr()->body.v1.bootTitleID = 0x1234567887654321;
|
||||
//SYSMi_GetResetParamAddr()->body.v1.flags = *flag;
|
||||
SYSMi_GetResetParamAddr()->body.v1.flags = (BootFlags){TRUE, 0, TRUE, FALSE, FALSE, FALSE, 0};
|
||||
MI_CpuCopyFast( SYSM_RESET_PARAM_MAGIC_CODE, (char *)&SYSMi_GetResetParamAddr()->header.magicCode, SYSM_RESET_PARAM_MAGIC_CODE_LEN);
|
||||
SYSMi_GetResetParamAddr()->header.bodyLength = sizeof(ResetParamBody);
|
||||
SYSMi_GetResetParamAddr()->header.crc16 = SVC_GetCRC16( 65535, &SYSMi_GetResetParamAddr()->body, SYSMi_GetResetParamAddr()->header.bodyLength );
|
||||
|
||||
DC_FlushAll();
|
||||
*/
|
||||
// リセット命令発行
|
||||
PM_ForceToResetHardware();
|
||||
OS_Terminate();
|
||||
}
|
||||
#include <twl/itcm_end.h>
|
||||
#include <nitro/codereset.h>
|
||||
|
||||
// メインメニュー
|
||||
int MachineSettingMain( void )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user