From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] CFI driver
Date: Wed, 20 Oct 2004 16:21:37 -0500 [thread overview]
Message-ID: <1098307296.14086.84.camel@localhost.localdomain> (raw)
In-Reply-To: <1098304836.14086.74.camel@localhost.localdomain>
Yuli,
I add the following test code and modified flash_status_check. I have no
error for erasing. But I got "Time out" for programming after 13KB. This
algorithm complies AMD standard, doesn't it?
Regards,
York
#define AMD_STATUS_TIMEOUT 0x20
static int flash_time_out (flash_info_t * info, flash_sect_t sect)
{
int retval;
switch (info->vendor) {
case CFI_CMDSET_AMD_STANDARD:
case CFI_CMDSET_AMD_EXTENDED:
retval = flash_isset (info, sect, 0,
AMD_STATUS_TIMEOUT);
break;
default:
retval = 0;
}
debug ("flash_time_out: %d\n", retval);
return retval;
}
static int flash_status_check (flash_info_t * info, flash_sect_t sector,
ulong tout, char *prompt)
{
ulong start,now;
/* Wait for command completion */
start = get_timer (0);
while (flash_is_busy (info, sector)) {
if (flash_time_out(info,sector)) {
if (flash_is_busy (info, sector)) {
flash_write_cmd (info, sector, 0,
info->cmd_reset);
printf("Time out\n");
}
}
if ((now=get_timer (start)) > info->erase_blk_tout *
CFG_HZ) {
printf ("Flash %s timeout at address %lx data
%lx\n",
prompt, info->start[sector],
flash_read_long (info, sector, 0));
flash_write_cmd (info, sector, 0,
info->cmd_reset);
return ERR_TIMOUT;
}
}
return ERR_OK;
}
On Wed, 2004-10-20 at 15:40, York Sun wrote:
> Yuli,
>
> Thanks for reply.
>
> I am using a single chip. The problem doesn't appear EVERY programming.
> It happens after programming about 13KB.
>
> I did this test. In function "flash_status_check ( )", within the while
> loop, I insert codes to read DQ7-DQ0. I got DQ6 toggling and DQ5=1. That
> means "exceeded timing limit". Without a reset the program will hang in
> this loop. By polling the DQ7 instead of DQ6, it went smoothly.
>
> York
>
> On Wed, 2004-10-20 at 15:19, Yuli Barcohen wrote:
> > >>>>> York Sun writes:
> >
> > York> I am debugging flash driver for MPC8555CDS board. The driver
> > York> is drivers/cfi_flash.c. I have two boards. One is rev 1.0,
> > York> with AM29LV641D. The other is rev 1.1, with AM29LV641M.
> >
> > York> The problem is polling DQ6 after programming. The current
> > York> driver in U-boot 1.1.2 works well for AM29LV641M. As for
> > York> AM29LV641D, the programming hangs after writing about 13KB. I
> > York> track it down to "flash_is_busy()" function. When the problem
> > York> occurs, the DQ6 keeps toggling. If I change the algorithm to
> > York> polling DQ7, no problem occurs.
> >
> > I'm working now with a board (Adder87x) having exactly the same flash
> > (AM29LV641DL) and the driver works perfectly. I suspect that the problem
> > is not in the chip but in specific configuration.
> >
> > York> Shawn has a similar problem
> > York> http://lists.infradead.org/pipermail/linux-mtd/2004-March/009402.html.
> >
> > Your board uses several chips in parallel to get wider bus. The same was
> > on Shawn's board. In older versions of Linux CFI driver I found a bug in
> > the polling algorithm when more than one chip is used. I just replaced
> > the driver with a newer version and now it works OK. It sounds like
> > similar (same?) bug in the U-Boot's CFI driver.
> >
> > York> Maybe we should use DQ7 rather than DQ6.
> >
> > IMHO, no. Polling DQ6 is the standard for AMD-compatible flashes.
> >
> > ...
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
--
Best regards,
York Sun, Ph.D
Metrowerks
Freescale Semiconductor Inc.
Phone: (512) 996-5252
Email: yorksun at freescale.com
This email, and any associated attachments have been classified as:
[x] Freescale Semiconductor General Business
[ ] Freescale Semiconductor Internal Use Only
[ ] Freescale Semiconductor Confidential Proprietary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20041020/31efa762/attachment.htm
next prev parent reply other threads:[~2004-10-20 21:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-20 19:26 [U-Boot-Users] CFI driver York Sun
2004-10-20 19:59 ` Yuli Barcohen
2004-10-20 20:19 ` Yuli Barcohen
2004-10-20 20:40 ` York Sun
2004-10-20 21:21 ` York Sun [this message]
[not found] ` <16759.40840.186219.754326@astp0002.localdomain>
[not found] ` <1098369141.4502.18.camel@localhost.localdomain>
[not found] ` <16765.12175.401464.214322@astp0002.localdomain>
2004-10-27 19:55 ` York Sun
2004-10-27 20:37 ` Wolfgang Denk
[not found] <E1CKMIE-00085P-Dl@sc8-sf-list1.sourceforge.net>
2004-10-21 3:06 ` Sam Song
2004-10-21 3:08 ` Sam Song
-- strict thread matches above, loose matches on Subject: below --
2004-10-27 21:10 York Sun
2004-11-22 17:46 ` Jon Loeliger
2004-11-22 18:57 ` York Sun
2004-11-29 19:58 ` Jon Loeliger
2004-11-29 21:06 ` Wolfgang Denk
2005-04-03 20:47 Wolfgang Denk
2005-04-04 17:39 ` Jon Loeliger
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=1098307296.14086.84.camel@localhost.localdomain \
--to=yorksun@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox