All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: direct access to Flash from userland
@ 2008-09-04 12:22 Fillod Stephane
  2008-09-05 15:50 ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Fillod Stephane @ 2008-09-04 12:22 UTC (permalink / raw)
  To: Dave Littell, linuxppc-embedded

Dave Littell wrote:
>I have a CFI Flash device which has some non-CFI commands I need to
>issue from userland.  I've tried mmap() of the mtdblock device, but
that
>only yielded a corrupted Flash as my non-CFI command sequences were
>simply written to Flash.  An attempted mmap() of the character mtd
>device fails the mmap() call.

You should mmap() the /dev/mem device at the physical base address
of your Flash chip. Don't forget to pass O_SYNC to open(), in order
to have a guarded/non cached mapping.

http://www.denx.de/twiki/bin/view/PPCEmbedded/DeviceDrivers#Section_Acce
ssingPeripheralsFromUserSpace

>Is there a way for a userland application to issue non-CFI commands
>directly to a Flash device?  (This is a 2.6.18-based kernel on a AMCC
>PPC440EPx platform.)

I don't know whether there's specific ioctl for such purpose.
Have you tried to read the mtd source? You may also hack the mtd
layer to add your command. Definitely a question for=20
http://www.linux-mtd.infradead.org/mail.html

Regards
--=20
Stephane

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

* Re: direct access to Flash from userland
  2008-09-04 12:22 direct access to Flash from userland Fillod Stephane
@ 2008-09-05 15:50 ` Arnd Bergmann
  2008-09-06  3:32   ` Dave Littell
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2008-09-05 15:50 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: Dave Littell

On Thursday 04 September 2008, Fillod Stephane wrote:
> >Is there a way for a userland application to issue non-CFI commands
> >directly to a Flash device? =A0(This is a 2.6.18-based kernel on a AMCC
> >PPC440EPx platform.)
>=20
> I don't know whether there's specific ioctl for such purpose.
> Have you tried to read the mtd source? You may also hack the mtd
> layer to add your command. Definitely a question for=20
> http://www.linux-mtd.infradead.org/mail.html
>=20

There is no ioctl command for sending arbitrary requests to the
flash, but it sounds like something that should be implemented
in the kernel, in mtdchar, depending on what the command does.

What are you actually trying to do with those commands?

	Arnd <><

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

* Re: direct access to Flash from userland
  2008-09-05 15:50 ` Arnd Bergmann
@ 2008-09-06  3:32   ` Dave Littell
  2008-09-08  6:00     ` Ankur Maheshwari
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Littell @ 2008-09-06  3:32 UTC (permalink / raw)
  To: linuxppc-embedded

Arnd Bergmann wrote:
> On Thursday 04 September 2008, Fillod Stephane wrote:
>>> Is there a way for a userland application to issue non-CFI commands
>>> directly to a Flash device?  (This is a 2.6.18-based kernel on a AMCC
>>> PPC440EPx platform.)
>> I don't know whether there's specific ioctl for such purpose.
>> Have you tried to read the mtd source? You may also hack the mtd
>> layer to add your command. Definitely a question for 
>> http://www.linux-mtd.infradead.org/mail.html
>>
> 
> There is no ioctl command for sending arbitrary requests to the
> flash, but it sounds like something that should be implemented
> in the kernel, in mtdchar, depending on what the command does.
> 
> What are you actually trying to do with those commands?
> 

Hi Arnd,

There are some sector protection options and a user-writable
one-time-programmable section that's larger than the presently
implemented 8-byte area that I need to support.


Thanks,
Dave

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

* Re: direct access to Flash from userland
  2008-09-06  3:32   ` Dave Littell
@ 2008-09-08  6:00     ` Ankur Maheshwari
  0 siblings, 0 replies; 5+ messages in thread
From: Ankur Maheshwari @ 2008-09-08  6:00 UTC (permalink / raw)
  To: Dave Littell; +Cc: linuxppc-embedded

Dave Littell wrote:
> Arnd Bergmann wrote:
>   
>> On Thursday 04 September 2008, Fillod Stephane wrote:
>>     
>>>> Is there a way for a userland application to issue non-CFI commands
>>>> directly to a Flash device?  (This is a 2.6.18-based kernel on a AMCC
>>>> PPC440EPx platform.)
>>>>         
>>> I don't know whether there's specific ioctl for such purpose.
>>> Have you tried to read the mtd source? You may also hack the mtd
>>> layer to add your command. Definitely a question for 
>>> http://www.linux-mtd.infradead.org/mail.html
>>>
>>>       
>> There is no ioctl command for sending arbitrary requests to the
>> flash, but it sounds like something that should be implemented
>> in the kernel, in mtdchar, depending on what the command does.
>>
>> What are you actually trying to do with those commands?
>>
>>     
>
> Hi Arnd,
>
> There are some sector protection options and a user-writable
> one-time-programmable section that's larger than the presently
> implemented 8-byte area that I need to support.
>
>
> Thanks,
> Dave
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>   
Hi Arnd,

You can consider "fw_env" utility (used for changing [read/write] U-boot 
environment variables from Linux) provided with u-boot source. You still 
need to enable mtd-char support.
Please check u-boot-source/tools/env directory for details.

thanks,
Ankur

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

* direct access to Flash from userland
@ 2008-09-03 23:35 Dave Littell
  0 siblings, 0 replies; 5+ messages in thread
From: Dave Littell @ 2008-09-03 23:35 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

I have a CFI Flash device which has some non-CFI commands I need to
issue from userland.  I've tried mmap() of the mtdblock device, but that
only yielded a corrupted Flash as my non-CFI command sequences were
simply written to Flash.  An attempted mmap() of the character mtd
device fails the mmap() call.

Is there a way for a userland application to issue non-CFI commands
directly to a Flash device?  (This is a 2.6.18-based kernel on a AMCC
PPC440EPx platform.)


Thanks,
Dave

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

end of thread, other threads:[~2008-09-08  6:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-04 12:22 direct access to Flash from userland Fillod Stephane
2008-09-05 15:50 ` Arnd Bergmann
2008-09-06  3:32   ` Dave Littell
2008-09-08  6:00     ` Ankur Maheshwari
  -- strict thread matches above, loose matches on Subject: below --
2008-09-03 23:35 Dave Littell

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.