Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Richard Broberg <ribrober@cisco.com>
To: erras stefan <stefan.erras@dallmeier-electronic.com>
Cc: linux-mips@linux-mips.org
Subject: Re: PMON - IdentifyFlashType
Date: Thu, 25 Mar 2004 08:35:18 -0800	[thread overview]
Message-ID: <40630A46.2000908@cisco.com> (raw)
In-Reply-To: <765921A8173EC145948ACBAA0480F67E2C76D6@server10.dallmeier.de>


>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

      parent reply	other threads:[~2004-03-25 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-25 15:25 PMON - IdentifyFlashType erras stefan
2004-03-25 15:25 ` erras stefan
2004-03-25 16:35 ` Richard Broberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40630A46.2000908@cisco.com \
    --to=ribrober@cisco.com \
    --cc=linux-mips@linux-mips.org \
    --cc=stefan.erras@dallmeier-electronic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox