From: Sascha Hauer <s.hauer@pengutronix.de>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 7/7] nor: Don't use the sector for the unlock sequence
Date: Thu, 22 Apr 2010 13:34:30 +0200 [thread overview]
Message-ID: <20100422113430.GN7882@pengutronix.de> (raw)
In-Reply-To: <1271665698-23163-8-git-send-email-w.sang@pengutronix.de>
On Mon, Apr 19, 2010 at 10:28:18AM +0200, Wolfram Sang wrote:
> Copy the behaviour from Linux which does:
>
> cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);
> ...
>
> (Notice the third parameter which is simply chip->start).
>
> Solves erase problems with SST flashes.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
>
> This should be tested on some other boards!
>
> drivers/nor/cfi_flash_amd.c | 16 ++++++++--------
> 1 files changed, 8 insertions(+), 8 deletions(-)
applied to next.
>
> diff --git a/drivers/nor/cfi_flash_amd.c b/drivers/nor/cfi_flash_amd.c
> index 4f0ab57..411d8e6 100644
> --- a/drivers/nor/cfi_flash_amd.c
> +++ b/drivers/nor/cfi_flash_amd.c
> @@ -2,10 +2,10 @@
> #include <stdio.h>
> #include "cfi_flash.h"
>
> -static void flash_unlock_seq (flash_info_t * info, flash_sect_t sect)
> +static void flash_unlock_seq (flash_info_t * info)
> {
> - flash_write_cmd (info, sect, AMD_ADDR_START, AMD_CMD_UNLOCK_START);
> - flash_write_cmd (info, sect, AMD_ADDR_ACK, AMD_CMD_UNLOCK_ACK);
> + flash_write_cmd (info, 0, AMD_ADDR_START, AMD_CMD_UNLOCK_START);
> + flash_write_cmd (info, 0, AMD_ADDR_ACK, AMD_CMD_UNLOCK_ACK);
> }
>
> /*
> @@ -21,7 +21,7 @@ static void amd_read_jedec_ids (flash_info_t * info)
> info->device_id2 = 0;
>
> flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
> - flash_unlock_seq(info, 0);
> + flash_unlock_seq(info);
> flash_write_cmd(info, 0, AMD_ADDR_START, FLASH_CMD_READ_ID);
> udelay(1000); /* some flash are slow to respond */
> info->manufacturer_id = flash_read_uchar (info,
> @@ -73,10 +73,10 @@ static int amd_flash_is_busy (flash_info_t * info, flash_sect_t sect)
>
> static int amd_flash_erase_one (flash_info_t * info, long sect)
> {
> - flash_unlock_seq (info, sect);
> + flash_unlock_seq(info);
> flash_write_cmd (info, sect, AMD_ADDR_ERASE_START,
> AMD_CMD_ERASE_START);
> - flash_unlock_seq (info, sect);
> + flash_unlock_seq(info);
> flash_write_cmd (info, sect, 0, AMD_CMD_ERASE_SECTOR);
>
> return flash_status_check(info, sect, info->erase_blk_tout, "erase");
> @@ -84,7 +84,7 @@ static int amd_flash_erase_one (flash_info_t * info, long sect)
>
> static void amd_flash_prepare_write(flash_info_t * info)
> {
> - flash_unlock_seq (info, 0);
> + flash_unlock_seq(info);
> flash_write_cmd (info, 0, AMD_ADDR_START, AMD_CMD_WRITE);
> }
>
> @@ -103,7 +103,7 @@ static int amd_flash_write_cfibuffer (flash_info_t * info, ulong dest, const uch
> dst.cp = (uchar *) dest;
> sector = find_sector (info, dest);
>
> - flash_unlock_seq(info,0);
> + flash_unlock_seq(info);
> flash_make_cmd (info, AMD_CMD_WRITE_TO_BUFFER, &cword);
> flash_write_word(info, cword, (void *)dest);
>
> --
> 1.7.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2010-04-22 11:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-19 8:28 Patch series derived from latest project Wolfram Sang
[not found] ` <1271665698-23163-7-git-send-email-w.sang@pengutronix.de>
2010-04-19 8:38 ` [PATCH 6/7] wip: fix possible error on overflow in is_timeout Uwe Kleine-König
[not found] ` <1271734752-8377-1-git-send-email-w.sang@pengutronix.de>
2010-04-22 11:32 ` [PATCH 6/7] clock: " Sascha Hauer
[not found] ` <1271665698-23163-3-git-send-email-w.sang@pengutronix.de>
2010-04-19 8:54 ` [PATCH 2/7] imx/gpio: make gpio_get_value actually work Uwe Kleine-König
2010-04-22 11:16 ` Sascha Hauer
[not found] ` <1272003760-15646-1-git-send-email-w.sang@pengutronix.de>
2010-04-23 7:49 ` Sascha Hauer
[not found] ` <1271665698-23163-2-git-send-email-w.sang@pengutronix.de>
2010-04-22 11:10 ` [PATCH 1/7] give nice output when generating barebox.bin and barebox.S Sascha Hauer
2010-04-23 6:19 ` Wolfram Sang
2010-04-23 8:17 ` Uwe Kleine-König
[not found] ` <1271665698-23163-4-git-send-email-w.sang@pengutronix.de>
2010-04-22 11:31 ` [PATCH 3/7] arm: update mach-types Sascha Hauer
[not found] ` <1271665698-23163-5-git-send-email-w.sang@pengutronix.de>
2010-04-22 11:31 ` [PATCH 4/7] cfi_flash: use flash_write_word instead of reimplementing it again Sascha Hauer
[not found] ` <1271665698-23163-6-git-send-email-w.sang@pengutronix.de>
2010-04-22 11:31 ` [PATCH 5/7] board/pcm038: document value written to ESDCFG0 Sascha Hauer
[not found] ` <1271665698-23163-8-git-send-email-w.sang@pengutronix.de>
2010-04-22 11:34 ` Sascha Hauer [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=20100422113430.GN7882@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=w.sang@pengutronix.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