All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matteo Fortini <matteo.fortini@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: barebox@lists.infradead.org, mike@steroidmicros.com
Subject: [RFC] MTD m25p80 3-byte addressing and boot problem
Date: Mon, 01 Sep 2014 11:43:54 +0200	[thread overview]
Message-ID: <54043FDA.4050707@gmail.com> (raw)

If a Linux/Barebox system is using an SPI flash of size >= 16 MB, the 
driver is switching to 3-byte addressing to be able to use linear access 
to the whole memory.

This leads to the impossibility to boot a board after a warm reset, 
because all bootloaders use the standard 2-byte addressing (if the board 
doesn't physically reset the flash or do something similar).

Some documentation in the following links:
http://www.at91.com/discussions/viewtopic.php/f,30/t,22849.html
https://community.freescale.com/docs/DOC-93632

The solution proposed on freescale forums is not final: it involves 
switching back to 2-byte addressing after every access, which still 
leaves a small window in which a warm reset would be fatal.

One solution would be to use the bank command in the flash, using each 
16MB bank linearly, and changing bank depending on the address. This 
would be messy for accesses which are crossing the boundary, but it is 
doable.

I'm asking here for comments before I start patching the code. Right now 
I resorted to stick to 2-byte addressing and leave half of my NOR (32MB) 
unused.

TIA,
M

             reply	other threads:[~2014-09-01  9:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  9:43 Matteo Fortini [this message]
2014-09-01 10:13 ` [RFC] MTD m25p80 3-byte addressing and boot problem Geert Uytterhoeven
2014-09-01 11:48 ` Mark Marshall

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=54043FDA.4050707@gmail.com \
    --to=matteo.fortini@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mike@steroidmicros.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 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.