From 61265162f7f5e19d1bf2b3dcfb602e828fdc0935 Mon Sep 17 00:00:00 2001 From: yutaka Date: Tue, 11 Dec 2007 08:39:51 +0000 Subject: [PATCH] =?UTF-8?q?=E9=8D=B5=E8=A8=AD=E5=AE=9A=E5=91=A8=E3=82=8A?= =?UTF-8?q?=E3=82=92=E5=88=86=E5=89=B2=E6=95=B4=E7=90=86?= 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@342 b08762b0-b915-fc4b-9d8c-17b2551a87ff --- build/libraries/aes/ARM7/aes_init.c | 41 ++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/build/libraries/aes/ARM7/aes_init.c b/build/libraries/aes/ARM7/aes_init.c index de77a545..b0ac0218 100644 --- a/build/libraries/aes/ARM7/aes_init.c +++ b/build/libraries/aes/ARM7/aes_init.c @@ -34,11 +34,44 @@ void AESi_InitKeysForApp( u8 game_code[4] ) { AESi_WaitKey(); - reg_AES_AES_ID_B2 = AES_IDS_ID0_C(game_code); - reg_AES_AES_ID_B3 = AES_IDS_ID0_D(game_code); + reg_AES_AES_ID_A2 = AES_IDS_ID0_C(game_code); + reg_AES_AES_ID_A3 = AES_IDS_ID0_D(game_code); + reg_AES_AES_ID_B0 = AES_IDS_ID1_A(game_code); + reg_AES_AES_ID_B1 = AES_IDS_ID1_B(game_code); +} - reg_AES_AES_ID_C0 = AES_IDS_ID1_A(game_code); - reg_AES_AES_ID_C1 = AES_IDS_ID1_B(game_code); +/*---------------------------------------------------------------------------* + Name: AESi_InitKeysForHard + + Description: set IDs depending on the system hardware. + you SHOULD NOT use this for standard applications. + + Arguments: fuse camouflaged fuse id + + Returns: None + *---------------------------------------------------------------------------*/ +void AESi_InitKeysForHard( u8 fuse[8] ) +{ + AESi_WaitKey(); + + reg_AES_AES_ID_B2 = *(u32*)&fuse[4]; + reg_AES_AES_ID_B3 = *(u32*)&fuse[0]; + reg_AES_AES_ID_D0 = *(u32*)&fuse[0]; + reg_AES_AES_ID_D3 = *(u32*)&fuse[4]; +} + +/*---------------------------------------------------------------------------* + Name: AESi_ResetAesKey + + Description: set SEED/KEYs filler data without seed[3] + + Arguments: None + + Returns: None + *---------------------------------------------------------------------------*/ +void AESi_ResetAesKey( void ) +{ + AESi_WaitKey(); // set dummy without seed[3] reg_AES_AES_SEED_A0 = 1;