Linux MIPS Architecture development
 help / color / mirror / Atom feed
* 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

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