* PMON - IdentifyFlashType
@ 2004-03-25 15:25 erras stefan
2004-03-25 15:25 ` erras stefan
2004-03-25 16:35 ` Richard Broberg
0 siblings, 2 replies; 3+ messages in thread
From: erras stefan @ 2004-03-25 15:25 UTC (permalink / raw)
To: linux-mips
Can anybody of you great guys can explain me the folling function which
I found in PMON:
BOOL IdentifyFlashType()
{
ULONG mId, dId;
WRITE_REGISTER_ULONG(FLASH_START, 0x90909090);
mId = READ_REGISTER_ULONG(FLASH_START);
WRITE_REGISTER_ULONG(FLASH_START, 0x90909090);
dId = READ_REGISTER_ULONG(FLASH_START+4);
if ((mId == 0x00890089) && (dId == 0x00180018))
{
FlashType = 1; // J3 flash
WRITE_REGISTER_ULONG(FLASH_START, 0x00ff00ff);
printf("J3 32MB flash found on this platform\r\n");
return TRUE;
}
else if ((mId == 0x00890089) && (dId == 0x00170017))
{
FlashType = 1; // J3 flash
WRITE_REGISTER_ULONG(FLASH_START, 0x00ff00ff);
printf("J3 16MB flash found on this platform\r\n");
return TRUE;
}
return FALSE;
}
I have to know what the WRITE_REGISTER_ULONG and READ_REGISTER_ULONG
functions do affect.
Why do they write 0x90909090 or 0x00ff00ff to FLASH_START?
Whats the meaning of mId and dId?
Thank you all in advance for your help!!!
Greetings
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* PMON - IdentifyFlashType
2004-03-25 15:25 PMON - IdentifyFlashType erras stefan
@ 2004-03-25 15:25 ` erras stefan
2004-03-25 16:35 ` Richard Broberg
1 sibling, 0 replies; 3+ messages in thread
From: erras stefan @ 2004-03-25 15:25 UTC (permalink / raw)
To: linux-mips
Can anybody of you great guys can explain me the folling function which
I found in PMON:
BOOL IdentifyFlashType()
{
ULONG mId, dId;
WRITE_REGISTER_ULONG(FLASH_START, 0x90909090);
mId = READ_REGISTER_ULONG(FLASH_START);
WRITE_REGISTER_ULONG(FLASH_START, 0x90909090);
dId = READ_REGISTER_ULONG(FLASH_START+4);
if ((mId == 0x00890089) && (dId == 0x00180018))
{
FlashType = 1; // J3 flash
WRITE_REGISTER_ULONG(FLASH_START, 0x00ff00ff);
printf("J3 32MB flash found on this platform\r\n");
return TRUE;
}
else if ((mId == 0x00890089) && (dId == 0x00170017))
{
FlashType = 1; // J3 flash
WRITE_REGISTER_ULONG(FLASH_START, 0x00ff00ff);
printf("J3 16MB flash found on this platform\r\n");
return TRUE;
}
return FALSE;
}
I have to know what the WRITE_REGISTER_ULONG and READ_REGISTER_ULONG
functions do affect.
Why do they write 0x90909090 or 0x00ff00ff to FLASH_START?
Whats the meaning of mId and dId?
Thank you all in advance for your help!!!
Greetings
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PMON - IdentifyFlashType
2004-03-25 15:25 PMON - IdentifyFlashType erras stefan
2004-03-25 15:25 ` erras stefan
@ 2004-03-25 16:35 ` Richard Broberg
1 sibling, 0 replies; 3+ messages in thread
From: Richard Broberg @ 2004-03-25 16:35 UTC (permalink / raw)
To: erras stefan; +Cc: linux-mips
>Can anybody of you great guys can explain me the folling function which
>I found in PMON:
>
>BOOL IdentifyFlashType()
>{
> ULONG mId, dId;
>
> WRITE_REGISTER_ULONG(FLASH_START, 0x90909090);
> mId = READ_REGISTER_ULONG(FLASH_START);
> WRITE_REGISTER_ULONG(FLASH_START, 0x90909090);
> dId = READ_REGISTER_ULONG(FLASH_START+4);
>
> if ((mId == 0x00890089) && (dId == 0x00180018))
> {
> FlashType = 1; // J3 flash
> WRITE_REGISTER_ULONG(FLASH_START, 0x00ff00ff);
> printf("J3 32MB flash found on this platform\r\n");
> return TRUE;
> }
> else if ((mId == 0x00890089) && (dId == 0x00170017))
> {
> FlashType = 1; // J3 flash
> WRITE_REGISTER_ULONG(FLASH_START, 0x00ff00ff);
> printf("J3 16MB flash found on this platform\r\n");
> return TRUE;
> }
> return FALSE;
>}
>
>I have to know what the WRITE_REGISTER_ULONG and READ_REGISTER_ULONG
>functions do affect.
>Why do they write 0x90909090 or 0x00ff00ff to FLASH_START?
>
>
The 90909090 is a command to the flash chip to describe itself.
(I believe the 2nd write of 90909090 is superfluous). Assumptions are
being made about the flash organization and that's why
you see constants 00890089. I believe 00900090 would have
identical effects to 90909090.
The 00FF00FF is a command to the flash chip to revert to
normal operation where reads return flash contents.
>Whats the meaning of mId and dId?
>
>
manufacturer id and device id.
89 being intel
Good luck
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-03-25 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-25 15:25 PMON - IdentifyFlashType erras stefan
2004-03-25 15:25 ` erras stefan
2004-03-25 16:35 ` Richard Broberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox