PMON - IdentifyFlashType

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux