Skip to contentSkip to conversation

flash writing with Linux

DISCUSSION Matthias Fuchs 3 participants 5 messages Mar 16, 2001 – Mar 19, 2001

lore
Share & tools
lore
#0 lore raw

Hi,

does anybody know if a flash writing tool for Linux is available ? I want to update a flash image from a running Linux. The Linux is running from a ramdisk, so the flash can be erased and rewritten.

I think what I need are two thing: A device driver for accessing the flash and a command line tool for erasing and writing to the flash.

Matthias
--
-------------------------------------------------
\ Matthias Fuchs \
\ esd electronic system design Gmbh \
\ Vahrenwalder Straße 205 \

   \ D-30165 Hannover                               \
    \ email: [email protected]      \
     \ phone: +49-511-37298-0                         \
      \ fax:   +49-511-37298-68                        \
       --------------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 2 lines · In message <[email protected]> you wrote:

does anybody know if a flash writing tool for Linux is available ?

Which architecture, what type of flash?

Quoted 2 lines

I want to update a flash image from a running Linux. The Linux is running from a ramdisk, so the flash can be erased and rewritten.

Yepp, that's what we do all the time.

Quoted 2 lines

I think what I need are two thing: A device driver for accessing the flash and a command line tool for erasing and writing to the flash.

Please check the Patch "patch.drivers" (against PPC 2.4.3-pre3 tree) in ftp://ftp.denx.de/pub/LinuxPPC/usr/src/patches/ or have a look at our source snapshot at ftp://ftp.denx.de/pub/LinuxPPC/usr/src/linux-2.4.3-pre3-2001-03-11.tar.bz2

It includes a character device driver for CFI (AMD chips) and JEDEC (Intel chips) compliant flash types. So far, this has been tested on big-endian systems (PowerPC only), but I would be interested in receiving feedback for other architectures as well.

Of course there are also user utilities to erase the flash. For writing no special tool is needed - just copy to the device (in fact, if your write block size is a multiple of the erase block size of the chips the driver performs an auto-erase, so you don't need the flash_erase command either).

Hope this helps - feel free to ask if there are any question or problems.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] If in any problem you find yourself doing an immense amount of work, the answer can be obtained by simple inspection.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
In reply to Matthias Fuchs
Quoted 10 lines

Hi,

does anybody know if a flash writing tool for Linux is available ? I want to update a flash image from a running Linux. The Linux is running from a ramdisk, so the flash can be erased and rewritten.

I think what I need are two thing: A device driver for accessing the flash and a command line tool for erasing and writing to the flash.

Perhaps you can take a look at mtd and use that to manage your flash. With mtd you can partition your flash to different devices and erase them selectively.

Once you have your flash partitioned you can simply cat a file to /dev/mtd# to copy new content to the flash.

/Subodh Nijsure

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw

Hi Subodh,

Quoted 4 lines · Subodh Nijsure

Perhaps you can take a look at mtd and use that to manage your flash. With mtd you can partition your flash to different devices and erase them selectively.

What is mtd ? Never heard of before !

Quoted 3 lines

Once you have your flash partitioned you can simply cat a file to /dev/mtd# to copy new content to the flash.

That sounds nice and seems to be same like the stuff Wolfgang offered in his 2.4.3-preX patch.

Matthias

--
-------------------------------------------------
\ Matthias Fuchs \
\ esd electronic system design Gmbh \
\ Vahrenwalder Straße 205 \

   \ D-30165 Hannover                               \
    \ email: [email protected]      \
     \ phone: +49-511-37298-0                         \
      \ fax:   +49-511-37298-68                        \
       --------------------------------------------------

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 5 lines · In message <[email protected]> Matthias Fuchs wrote:
Quoted 4 lines

Perhaps you can take a look at mtd and use that to manage your flash. With mtd you can partition your flash to different devices and erase them selectively.

What is mtd ? Never heard of before !

Memory Technology Devices.

Quoted 4 lines
Quoted 2 lines

Once you have your flash partitioned you can simply cat a file to /dev/mtd# to copy new content to the flash.

That sounds nice and seems to be same like the stuff Wolfgang offered in his 2.4.3-preX patch.

Yes, there is a significant overlap in functionality.

I intend to drop support for our driver once MTD is working.

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] "Oh dear, I think you'll find reality's on the blink again."
- Marvin The Paranoid Android

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/