Re: 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?


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


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

  Powered by Linux