From: Scott Wood <scottwood@freescale•com>
To: Jonathan Haws <Jonathan.Haws@sdl•usu.edu>
Cc: Bill Gatliff <bgat@billgatliff•com>,
"linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>
Subject: Re: Accessing flash directly from User Space
Date: Tue, 27 Oct 2009 17:42:37 -0500 [thread overview]
Message-ID: <4AE7775D.8080502@freescale.com> (raw)
In-Reply-To: <BB99A6BA28709744BF22A68E6D7EB51F0330D368AA@midas.usurf.usu.edu>
Jonathan Haws wrote:
>>> flash[0] = 0x1234;
>>> msync(flash, NOR_FLASH_SIZE, MS_SYNC | MS_INVALIDATE);
>>> printf("flash[0] = %#04x\n", flash[0]);
>>>
>>> That prints flash[0] = 0x7f45. I have verified that I am reading
>> the correct values. I can display the flash contents in U-Boot and
>> 7f45 is what is in the first 16 bits of flash.
>>> Why can I not write to flash? What am I doing wrong?
>> Flash does not work that way -- you must send it commands to erase a
>> block, and then further commands to program new data.
>
> I realize that. I have a driver written that does exactly that.
> However, I need to be able to write to certain registers to setup the
> erasure.
Will the device respond to 0x1234 being written at offset zero? You
generally have to poke these things pretty specifically in order to get
them to go into command mode.
> The driver works perfectly in VxWorks,
Including the 0x1234 thing?
>> It sounds like what you really want is the /dev/mtd or /dev/mtdblock
>> interface, not raw access to the flash chip.
>
> As mentioned in my initial post, I need to use my custom driver to maintain the interface to the application that uses the flash for data storage.
>
> I had thought about using MTD, but decided against it because with
> previous benchmarking that we did with MTD and our custom driver, we
> found that our custom driver was about 10x faster.
Ouch. Any idea where the slowdown is coming from?
-Scott
next prev parent reply other threads:[~2009-10-27 22:42 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-27 19:59 Accessing flash directly from User Space Jonathan Haws
2009-10-27 20:13 ` Bill Gatliff
2009-10-27 20:15 ` Jonathan Haws
2009-10-27 20:30 ` Bill Gatliff
2009-10-27 20:31 ` Jonathan Haws
2009-10-27 22:24 ` Jonathan Haws
2009-10-27 22:32 ` Scott Wood
2009-10-27 22:35 ` Jonathan Haws
2009-10-27 22:42 ` Scott Wood [this message]
2009-10-27 22:52 ` Jonathan Haws
2009-10-28 9:56 ` Kenneth Johansson
2009-10-28 14:45 ` Jonathan Haws
2009-10-29 21:36 ` Joerg Albert
2009-10-29 21:39 ` Jonathan Haws
2009-10-29 16:33 ` Scott Wood
2009-10-29 16:48 ` Jonathan Haws
[not found] ` <BB99A6BA28709744BF22A68E6D7EB51F0330D368AA@midas.usurf.usu.edu >
2009-10-27 22:42 ` Alessandro Rubini
2009-10-28 11:24 ` Josh Boyer
2009-10-28 14:38 ` Jonathan Haws
2009-10-28 17:44 ` Accessing flash directly from User Space [SOLVED] Jonathan Haws
2009-10-29 9:00 ` Joakim Tjernlund
2009-10-29 9:15 ` Joakim Tjernlund
2009-10-29 17:01 ` Jonathan Haws
2009-10-29 11:08 ` Kenneth Johansson
2009-10-29 17:02 ` Jonathan Haws
2009-10-29 23:30 ` Scott Wood
2009-10-30 14:50 ` Jonathan Haws
2009-10-30 14:56 ` Michael Buesch
2009-10-30 14:57 ` Jonathan Haws
[not found] ` <BB99A6BA28709744BF22A68E6D7EB51F0330E23124@midas.usurf.usu.edu >
2009-10-30 15:08 ` Alessandro Rubini
2009-10-30 15:24 ` Michael Buesch
2009-10-30 15:33 ` Jonathan Haws
2009-10-31 13:26 ` Joakim Tjernlund
2009-10-31 16:42 ` Michael Buesch
2009-10-31 20:14 ` Joakim Tjernlund
2009-10-31 20:35 ` Michael Buesch
2009-10-31 22:31 ` Joakim Tjernlund
2009-11-01 10:07 ` Segher Boessenkool
2009-10-30 15:48 ` Micha Nelissen
2009-10-30 16:46 ` Jonathan Haws
2009-10-30 17:49 ` Gabriel Paubert
2009-10-30 15:57 ` Scott Wood
[not found] ` <BB99A6BA28709744BF22A68E6D7EB51F0330D3688B@midas.usurf.usu.edu >
2009-10-27 22:32 ` Accessing flash directly from User Space Alessandro Rubini
2009-10-27 22:33 ` Jonathan Haws
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=4AE7775D.8080502@freescale.com \
--to=scottwood@freescale$(echo .)com \
--cc=Jonathan.Haws@sdl$(echo .)usu.edu \
--cc=bgat@billgatliff$(echo .)com \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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