From: Michael Schwingen <rincewind@discworld.dascon.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] PATCH: support JEDEC flash roms in CFI-flash framework
Date: Tue, 13 Nov 2007 19:59:12 +0100 [thread overview]
Message-ID: <20071113185911.GA21337@discworld.dascon.de> (raw)
In-Reply-To: <4739C21C.1090107@semihalf.com>
On Tue, Nov 13, 2007 at 04:26:20PM +0100, Bartlomiej Sieka wrote:
>
> Your patch fixes an issue with AMD_ADDR_* definitions for CFI flashes,
> along with its primary intent (JEDEC support in CFI framework). I think
> it would be better to submit the fix to AMD_ADDR_* as a separate patch.
Um - no. I removed that when changing to the unlock_addr* variables in the
flash_info_t struct, for just that reason - I wanted the patch to be applied
soon, and I have no way to test the change on a large number of boards.
Unless I made some error in the conversion, the CFI code should behave
exactly the same with and without my patch. Only the Jedec code uses
different unlock_addr values.
> It's more logical this way, also, it might get committed sooner, as it
> likely fixes a problem with an existing board. I am willing to test such
> a patch on one of the troublesome boards.
Actually, there are two points where I think the current code is wrong, and
which I did not change, because those are probably best handled in separate
patches:
- unlock_addr values when running on 8-bit CFI flashs (interface == 0)
- the AMD erase code, where the unlock sequence is written to the sector
base address instead of the chip base address.
I am not sure what the policy is regarding changes that might break
existing boards? Are those patches applied if enough people are sure they
should be safe?
> Perhaps it would be better to follow what is being done in the Linux
> driver, adjusted to U-Boot context. I.e., something along the lines of
> (untested):
>
> info->unlock_addr1 = 0x555;
> info->unlock_adde2 = 0x2aa;
>
> /* Modify the unlock address if we are in compatibility mode */
> if ( /* x16 in x8 mode */
> ((info->chipwidth == FLASH_CFI_BY8) &&
> (info->interface == 2)) ||
> /* x32 in x16 mode */
> ((info->chipwidth == FLASH_CFI_BY16) &&
> (info->interface == 4)))
> {
> info->unlock_addr1 = 0xaaa;
> info->unlock_addr2 = 0x555;
> }
Agreed. I had this in an earlier version of my patch, where I needed to
modify the AMD_ADDR_* macros, but removed it later in order to make minimal
changes to the existing CFI behaviour. I think this should be added on top
of my patch, unless everyone on this list agrees that it should go in
immediately.
> > @@ -52,6 +52,9 @@ typedef struct {
> > ushort ext_addr; /* extended query table address */
> > ushort cfi_version; /* cfi version */
> > ushort cfi_offset; /* offset for cfi query */
> > + ulong unlock_addr1; /* unlock address 1 for AMD flash roms */
> > + ulong unlock_addr2; /* unlock address 2 for AMD flash roms */
>
> Linux driver uses addr_unlock1 and addr_unlock2 for this purpose, maybe
> it's a good idea to keep the variable names in sync with Linux?
Not sure - the CFI code does not look very similar to the Linux code, so I
see no big benefit in doing so, but as it is just a name, I can live with
both variants.
cu
Michael
--
Some people have no respect of age unless it is bottled.
next prev parent reply other threads:[~2007-11-13 18:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-12 20:23 [U-Boot-Users] PATCH: support JEDEC flash roms in CFI-flash framework Michael Schwingen
2007-11-13 14:45 ` Stefan Roese
2007-11-13 19:13 ` Michael Schwingen
2007-11-13 15:26 ` Bartlomiej Sieka
2007-11-13 18:59 ` Michael Schwingen [this message]
2007-11-13 20:56 ` Stefan Roese
2007-11-24 17:45 ` [U-Boot-Users] PATCH (resend): " Michael Schwingen
2007-11-26 18:57 ` Michael Schwingen
2007-12-05 15:58 ` Bartlomiej Sieka
2007-12-05 22:25 ` Michael Schwingen
2007-12-05 22:40 ` Bartlomiej Sieka
2007-12-07 8:42 ` Stefan Roese
2007-12-07 22:35 ` [U-Boot-Users] PATCH (resend): support JEDEC flash roms in?CFI-flash framework Michael Schwingen
2007-12-08 7:31 ` Stefan Roese
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=20071113185911.GA21337@discworld.dascon.de \
--to=rincewind@discworld.dascon.de \
--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.