All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramesh K Khokhani <ramesh.khokhani@igate.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Flash Not Erased Problem with M29W128GL
Date: Wed, 16 Jan 2013 05:41:10 +0000	[thread overview]
Message-ID: <02BE3AF15ED7E746BB6EBFDD1431024707C392DF@IGTEBLRMB12.igatecorp.com> (raw)
In-Reply-To: <20130115233908.GA19600@sion.sysam>

Thank you so much Angelo,

I am not using board_flash_get_legacy in my board.

In then function flash_erase() there is one function for flash_write_cfiword() in that there is one check for if flash is erased or not. In that code there is one reading of byte and it returns 0x00. so that is problem. Following is the line here, in that flag gets 0 and this function returns ERR_NOT_ERASED.

	case FLASH_CFI_8BIT:
		flag = ((flash_read8(dstaddr) & cword.c) == cword.c);
		break;

static int flash_write_cfiword (flash_info_t * info, ulong dest,
				cfiword_t cword)
{
	void *dstaddr = (void *)dest;
	int flag;
	flash_sect_t sect = 0;
	char sect_found = 0;

	/* Check if Flash is (sufficiently) erased */
	switch (info->portwidth) {
	case FLASH_CFI_8BIT:
		flag = ((flash_read8(dstaddr) & cword.c) == cword.c);
		break;
	case FLASH_CFI_16BIT:
		flag = ((flash_read16(dstaddr) & cword.w) == cword.w);
		break;
	case FLASH_CFI_32BIT:
		flag = ((flash_read32(dstaddr) & cword.l) == cword.l);
		break;
	case FLASH_CFI_64BIT:
		flag = ((flash_read64(dstaddr) & cword.ll) == cword.ll);
		break;
	default:
		flag = 0;
		break;
	}
	if (!flag)
		return ERR_NOT_ERASED;

Thanks & Warm Regards,
Ramesh

-----Original Message-----
From: Angelo Dureghello [mailto:sysamfw at gmail.com] 
Sent: Wednesday, January 16, 2013 5:09 AM
To: u-boot at lists.denx.de
Cc: Ramesh K Khokhani
Subject: Re: [U-Boot] Flash Not Erased Problem with M29W128GL

Dear Ramesh,

this issue could be connected to a patch i recently posted to the 
list, where the erase command is now allowed to be customizable for 
CFI AMD compatible chips only.

Are you using board_flash_get_legacy in your board files ?

If yes, could you just add after line 1834 in cfi_flash.c

                        info->cmd_reset = AMD_CMD_RESET;
+                       info->cmd_erase_sector = AMD_CMD_ERASE_SECTOR;

And report back if erasing now works ?

Many Thanks,
Angelo Dureghello

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information contained and transmitted by this e-mail is confidential and proprietary to iGATE and its affiliates and is intended for use only by the recipient. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this e-mail is strictly prohibited and you are requested to delete this e-mail immediately and notify the originator or mailadmin at igate.com <mailto:mailadmin@igate.com>. iGATE does not enter into any agreement with any party by e-mail. Any views expressed by an individual do not necessarily reflect the view of iGATE. iGATE is not responsible for the consequences of any actions taken on the basis of information provided, through this email. The contents of an attachment to this e-mail may contain software viruses, which could damage your own computer system. While iGATE has taken every reasonable precaution to minimise this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should carry out your own virus checks before opening an attachment. To know more about iGATE please visit www.igate.com <http://www.igate.com>.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  reply	other threads:[~2013-01-16  5:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15 11:15 [U-Boot] Flash Not Erased Problem with M29W128GL Ramesh K Khokhani
2013-01-15 23:39 ` Angelo Dureghello
2013-01-16  5:41   ` Ramesh K Khokhani [this message]
2013-01-16 10:26     ` Angelo Dureghello
2013-01-18  8:30       ` Ramesh K Khokhani
2013-01-20 14:29         ` Angelo Dureghello
2013-01-21  3:15           ` Ramesh K Khokhani
2013-01-22 10:36           ` Ramesh K Khokhani
2013-01-23  8:15       ` Ramesh K Khokhani
2013-01-23 14:32         ` Angelo Dureghello

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=02BE3AF15ED7E746BB6EBFDD1431024707C392DF@IGTEBLRMB12.igatecorp.com \
    --to=ramesh.khokhani@igate.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.