public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] u-boot: How to read file from FAT filesystem on NorFlash MTD partition
Date: Tue, 1 Dec 2009 15:25:33 +0100	[thread overview]
Message-ID: <200912011525.33059.sr@denx.de> (raw)

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

             reply	other threads:[~2009-12-01 14:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01 14:25 Stefan Roese [this message]
2009-12-02  2:55 ` [U-Boot] u-boot: How to read file from FAT filesystem on NorFlash MTD partition 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

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=200912011525.33059.sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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