public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] u-boot: How to read file from FAT filesystem on NorFlash MTD partition
@ 2009-12-01 14:25 Stefan Roese
  2009-12-02  2:55 ` Xianwei Zeng
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Roese @ 2009-12-01 14:25 UTC (permalink / raw)
  To: u-boot

Hi,

sorry for jumping in so late, but Wolfgang just broughtthis thread to my 
attention. So here are my ideas and comments to your approach/patch:

> >   * Which command can do this? (fatload seems can not because the
> > interface is not known)
> >   * From which verion u-boot supports this feature? Our u-boot is based
> > v2009.08. Do we
> >     need to update to latest one? (v2009.11-rc1)
> >
> > I check the document and didn't found the answer. So I have to write it
> > by myself.
>
> I created a patch which provide two functions:
>   fat_norflash_init()
>   fat_norflash_load()
>
> The user call these function in sequence to read file from FAT file system
> on Nor Flash.

It's possible to do it this way of course, but we really shouldn't go this 
way. The "right way" to implement FAT support on NOR FLASH would be to add a 
small block layer to the MTD devices. And MTD block device could then be used 
by the existing file system drivers (e.g. fatls etc).

We already can export the NOR FLASH as an MTD device, using the 
CONFIG_FLASH_CFI_MTD config option. It shouldn't be too hard to add a block 
layer over this MTD device, like done in the Linux kernel 
(drivers/mtd/mtdblock_ro.c).

This approach has multiple advantages:

- Multiple file systems will be usable (FAT, EXT2 etc.)
- Multiple MTD devices will be supported (NOR, NAND etc.)

It would be great if you could rework your patch according to my suggestions.

Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [U-Boot] u-boot: How to read file from FAT filesystem on NorFlash MTD partition
@ 2009-11-15 14:56 Xianwei Zeng
  2009-11-15 18:48 ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Xianwei Zeng @ 2009-11-15 14:56 UTC (permalink / raw)
  To: u-boot

Hello,

I hope I am not sending mail to the wrong mail list.

I am porting u-boot to our Xscale based board, with 32MB Nor Flash on
board. And in this board, it is required that, the u-boot should be able to
read some files from a FAT file system on one of the Nor Flash partitions.
The Nor Flash is managed as MTD device under Linux OS.

In current  u-boot implementation, I can use fatload to read files from
mmc or USB storage device, which is also FAT filesystem. And I can
also use fsload command to read files from JFFS2 filesytem on NorFlash
or NandFlash.

But I found I cann't uses these command to read files from a FAT filesystem
on NorFlash. I cann't format this partition to JFFS2 filesystem because it
is exported to Windows/Linux host via USB gadget after system boots up.

Can someone tell me the best way to solve this problem, or give me some
hints of which part of code I need to change?

I am creating a new command following fsload, using MTD devices in U-Boot,
and try to mount the FAT filesystem, but failed at reading the real file
data out,
although I can read the file name, the file size and the file start sector
number out.

-- 
Best Regards
Xianwei ZENG
----Linux Fans

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

end of thread, other threads:[~2009-12-02  2:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 14:25 [U-Boot] u-boot: How to read file from FAT filesystem on NorFlash MTD partition Stefan Roese
2009-12-02  2:55 ` Xianwei Zeng
  -- strict thread matches above, loose matches on Subject: below --
2009-11-15 14:56 Xianwei Zeng
2009-11-15 18:48 ` Wolfgang Denk
2009-11-16  1:29   ` Xianwei Zeng
2009-11-16  6:40     ` Wolfgang Denk
2009-11-16 12:46       ` Xianwei Zeng
2009-11-24  3:09         ` Xianwei Zeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox