I am analyzing the bootloader code of Android. My understanding is
that the int _main(void) function of nandwrite.c is the bootloader
running in flash mode. Is that right?
And I see the following arm11_clock_init() function which is called at
the beginning at the _main() function is very interesting. It looks
like it writes some magic numbers to some memory addresses from the
tbl. What is the function really do? Does it related with the ARM cpu?
Is there any docs about these magic number and memory addresses?
Please help. Thanks!
#define A11S_CLK_CNTL 0xC0100100
#define A11S_CLK_SEL 0xC0100104
#define C A11S_CLK_CNTL
#define S A11S_CLK_SEL
static unsigned tbl[] = {
#if EXPLORE
C, 0x640000, S, 2,
C, 0x640001, S, 3,
C, 0x640201, S, 2,
C, 0x640203, S, 3,
C, 0x640403, S, 2,
C, 0x640405, S, 3,
C, 0x640605, S, 2,
C, 0x640607, S, 3,
C, 0x640807, S, 2,
C, 0x640809, S, 3,
C, 0x640A09, S, 2,
C, 0x640A0B, S, 3,
C, 0x640C0B, S, 2,
C, 0x640C0D, S, 3,
C, 0x640E0D, S, 2,
C, 0x640E0F, S, 3,
#endif
C, 0x640000, S, 2,
C, 0x64001F, S, 3,
C, 0x64171F, S, 2,
C, 0x641715, S, 5,
C, 0x641315, S, 6,
C, 0x641312, S, 7,
C, 0x641112, S, 6,
0
};
void arm11_clock_init(void)
{
unsigned *x = tbl;
while(*x) {
unsigned *ptr = (unsigned*) *x++;
unsigned val = *x++;
*ptr = val;
}
}
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---