forked from len0rd/rockbox
s5l87xx: Add S5L8720 registers
This adds some confirmed and some to-be-confirmed (TBC) registers for Samsung S5L8720, which is used in iPod Nano 4G, iPod Touch 2G and the 920-0614-03 development/prototype board. All credit goes to Cástor Muñoz <cmvidal@gmail.com> Change-Id: I9fe5052fe9f05cd33f34de4e228cdb291944aa11
This commit is contained in:
parent
6231407df7
commit
88a1d90236
2 changed files with 274 additions and 74 deletions
|
@ -103,18 +103,18 @@ static void aes_decrypt(void* data, uint32_t size)
|
|||
static void calc_hash(uint32_t* data, uint32_t size, uint32_t* result)
|
||||
{
|
||||
uint32_t ptr, i;
|
||||
uint32_t ctrl = 2;
|
||||
uint32_t config = 2;
|
||||
|
||||
PWRCONEXT &= ~0x4;
|
||||
|
||||
for (ptr = 0; ptr < (size >> 2); ptr += 0x10)
|
||||
{
|
||||
for (i = 0; i < 0x10; i++) HASHDATAIN[i] = data[ptr + i];
|
||||
HASHCTRL = ctrl;
|
||||
ctrl = 0xA;
|
||||
while ((HASHCTRL & 1) != 0);
|
||||
for (i = 0; i < 0x10; i++) SHA1DATAIN[i] = data[ptr + i];
|
||||
SHA1CONFIG = ctrl;
|
||||
config = 0xA;
|
||||
while ((SHA1CONFIG & 1) != 0);
|
||||
}
|
||||
for (i = 0; i < 5; i ++) result[i] = HASHRESULT[i];
|
||||
for (i = 0; i < 5; i ++) result[i] = SHA1RESULT[i];
|
||||
|
||||
PWRCONEXT |= 0x4;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue