linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Need help w/ SPI dataflash AT45DB011B on AT91RM9200 linux 2.6.20
@ 2008-01-29 15:50 Matt Gessner
       [not found] ` <85a5c2010801290750j624ffe3bt3d30f5fb7d5df020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Gessner @ 2008-01-29 15:50 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW

Hello,

I've got what seems to be a very odd problem.  There's a specific word
(offset 0x20000) in my dataflash that for some reason I can't change.

I wrote a simple program that does the following:
http://rafb.net/p/RU5LPy71.html
     a) open the dataflash via /dev/mtdblock/0, seek, read a 32-bit value, close
     b) open the dataflash via /dev/mtdblock/0, seek, write a 32-bit
value, close
     c) open the dataflash via /dev/mtdblock/0, seek, read a 32-bit value, close

The value in c) is the same value as from a), not that which was
written in b), which is horribly wrong.

If I try to change other words in the dataflash, it succeeds (I know
this because I've modified parts of other pages).

I've gone down into mtdblock, and it appears to be doing everything
correctly.  I added a little bit of debugging, to show that the data
from userspace is accurate:  http://rafb.net/p/KlocsG98.html

As you can see on lines 10 and 30, from different points in the
debugging, the data that the program is writing is being seen by the
kernel, yet the write isn't happening.

I've posted my modified modblock.c at http://rafb.net/p/RU5LPy71.html

The issue I'm facing is that 0x20000 is the start of the u-boot
environment (no, it's not page aligned with the erasesize, which is
why i'm having to go through this exercise, and I can't change the
structure because I don't have control over all parts of the system.
So I'm booting a modified copy of linux with a different partition
table to allow me to do all of this.) and when I try to write the CRC
back to the environment table, I can update the environment table but
the CRC won't change.

Thanks in advance,

Matt Gessner

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Need help w/ SPI dataflash AT45DB011B on AT91RM9200 linux 2.6.20
       [not found] ` <85a5c2010801290750j624ffe3bt3d30f5fb7d5df020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2008-01-29 19:29   ` David Brownell
  0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2008-01-29 19:29 UTC (permalink / raw)
  To: Matt Gessner
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW

On Tuesday 29 January 2008, Matt Gessner wrote:
> Hello,
> 
> I've got what seems to be a very odd problem.  There's a specific word
> (offset 0x20000) in my dataflash that for some reason I can't change.
> 
> I wrote a simple program that does the following:
> http://rafb.net/p/RU5LPy71.html
>      a) open the dataflash via /dev/mtdblock/0, seek, read a 32-bit value, close
>      b) open the dataflash via /dev/mtdblock/0, seek, write a 32-bit
> value, close
>      c) open the dataflash via /dev/mtdblock/0, seek, read a 32-bit value, close
> 
> The value in c) is the same value as from a), not that which was
> written in b), which is horribly wrong.

If that were a character device, I'd agree with you.

But it's a block device ... and you're not doing I/O in
units of one block. Sso I would not expect that to work.

- Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-29 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29 15:50 Need help w/ SPI dataflash AT45DB011B on AT91RM9200 linux 2.6.20 Matt Gessner
     [not found] ` <85a5c2010801290750j624ffe3bt3d30f5fb7d5df020-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-01-29 19:29   ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).