public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Request for Help: How to save data to an SD/MMC card
@ 2011-12-13  5:16 Graeme Russ
  2011-12-13  8:14 ` Wolfgang Denk
  2011-12-13 23:26 ` Ilya Yanok
  0 siblings, 2 replies; 10+ messages in thread
From: Graeme Russ @ 2011-12-13  5:16 UTC (permalink / raw)
  To: u-boot

Hi All,

I have a need to dump memory contents to a filesystem on an SD/MMC
card so I can transfer it to my dev PC. I don't have a working network
driver, so TFTP is out

Now I notice that U-Boot has code to support writing to FAT
filesystems, but it does not appear to be plumbed in

Alternatively, I could patch up the recently posted ext4 code and give that a go

Is there any other existing mechanism to write a file to a filesystem
on an SD/MMC card in U-Boot?

Regards,

Graeme

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13  5:16 [U-Boot] Request for Help: How to save data to an SD/MMC card Graeme Russ
@ 2011-12-13  8:14 ` Wolfgang Denk
  2011-12-13 23:18   ` Graeme Russ
  2011-12-13 23:26 ` Ilya Yanok
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2011-12-13  8:14 UTC (permalink / raw)
  To: u-boot

Dear Graeme,

In message <CALButCKwVh571bhgV9NQ82HYiFVJ=uGMFvVTYa5NV5M=kWvtGw@mail.gmail.com> you wrote:
> 
> I have a need to dump memory contents to a filesystem on an SD/MMC
> card so I can transfer it to my dev PC. I don't have a working network
> driver, so TFTP is out

Add a network driver? :-)

> Now I notice that U-Boot has code to support writing to FAT
> filesystems, but it does not appear to be plumbed in

Correct. (V)FAT support is read-only, like for nearly all other file
systems.

> Alternatively, I could patch up the recently posted ext4 code and give that a go

That would be a good idea - the more people testing that code, the
better.

> Is there any other existing mechanism to write a file to a filesystem
> on an SD/MMC card in U-Boot?

Yaffs is the only other file system in U-Boot that has write support.

If I were you, I'd try to get the ext4 code running.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A memorandum is written not to inform the reader, but to protect  the
writer.                                               -- Dean Acheson

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13  8:14 ` Wolfgang Denk
@ 2011-12-13 23:18   ` Graeme Russ
  0 siblings, 0 replies; 10+ messages in thread
From: Graeme Russ @ 2011-12-13 23:18 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Tue, Dec 13, 2011 at 7:14 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Graeme,
>
> In message <CALButCKwVh571bhgV9NQ82HYiFVJ=uGMFvVTYa5NV5M=kWvtGw@mail.gmail.com> you wrote:
>>
>> I have a need to dump memory contents to a filesystem on an SD/MMC
>> card so I can transfer it to my dev PC. I don't have a working network
>> driver, so TFTP is out
>
> Add a network driver? :-)

I tried, but the technical documentation I have is somewhat less than
perfect :( - I'm still chasing that up

>> Now I notice that U-Boot has code to support writing to FAT
>> filesystems, but it does not appear to be plumbed in
>
> Correct. (V)FAT support is read-only, like for nearly all other file
> systems.
>
>> Alternatively, I could patch up the recently posted ext4 code and give that a go
>
> That would be a good idea - the more people testing that code, the
> better.
>
>> Is there any other existing mechanism to write a file to a filesystem
>> on an SD/MMC card in U-Boot?
>
> Yaffs is the only other file system in U-Boot that has write support.
>
> If I were you, I'd try to get the ext4 code running.

OK, I'll focus on the ext4 patches

If you like, I can take on responsibility of getting them into
mainline through the staging repo, but this is unlikely to happen
until well into the new year

Regards,

Graeme

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13  5:16 [U-Boot] Request for Help: How to save data to an SD/MMC card Graeme Russ
  2011-12-13  8:14 ` Wolfgang Denk
@ 2011-12-13 23:26 ` Ilya Yanok
  2011-12-13 23:28   ` Graeme Russ
  1 sibling, 1 reply; 10+ messages in thread
From: Ilya Yanok @ 2011-12-13 23:26 UTC (permalink / raw)
  To: u-boot

Hi Graeme,

Graeme Russ <graeme.russ <at> gmail.com> writes:
> I have a need to dump memory contents to a filesystem on an SD/MMC

Do you really need a filesystem for this? You can easily dump memory to SD using
block write.

Regards, Ilya.

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13 23:26 ` Ilya Yanok
@ 2011-12-13 23:28   ` Graeme Russ
  2011-12-13 23:31     ` Ulf Samuelsson
  2011-12-13 23:34     ` Ilya Yanok
  0 siblings, 2 replies; 10+ messages in thread
From: Graeme Russ @ 2011-12-13 23:28 UTC (permalink / raw)
  To: u-boot

Hi Ilya,

On Wed, Dec 14, 2011 at 10:26 AM, Ilya Yanok <yanok@emcraft.com> wrote:
> Hi Graeme,
>
> Graeme Russ <graeme.russ <at> gmail.com> writes:
>> I have a need to dump memory contents to a filesystem on an SD/MMC
>
> Do you really need a filesystem for this? You can easily dump memory to SD using
> block write.

Well I want to copy the data back to my dev PC - If the SD/MMC card is
formatted with a filesystem, it is trivial to transfer the data back
and forth

Regards,

Graeme

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13 23:28   ` Graeme Russ
@ 2011-12-13 23:31     ` Ulf Samuelsson
  2011-12-13 23:34     ` Ilya Yanok
  1 sibling, 0 replies; 10+ messages in thread
From: Ulf Samuelsson @ 2011-12-13 23:31 UTC (permalink / raw)
  To: u-boot

On 2011-12-14 00:28, Graeme Russ wrote:
> Hi Ilya,
>
> On Wed, Dec 14, 2011 at 10:26 AM, Ilya Yanok<yanok@emcraft.com>  wrote:
>> Hi Graeme,
>>
>> Graeme Russ<graeme.russ<at>  gmail.com>  writes:
>>> I have a need to dump memory contents to a filesystem on an SD/MMC
>> Do you really need a filesystem for this? You can easily dump memory to SD using
>> block write.
> Well I want to copy the data back to my dev PC - If the SD/MMC card is
> formatted with a filesystem, it is trivial to transfer the data back
> and forth
>
> Regards,
>
> Graeme
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

dd i=<card> o=<file> ?



-- 
Best Regards
Ulf Samuelsson

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13 23:28   ` Graeme Russ
  2011-12-13 23:31     ` Ulf Samuelsson
@ 2011-12-13 23:34     ` Ilya Yanok
  2011-12-13 23:37       ` Graeme Russ
  1 sibling, 1 reply; 10+ messages in thread
From: Ilya Yanok @ 2011-12-13 23:34 UTC (permalink / raw)
  To: u-boot

Hi Graeme,

On 14.12.2011 03:28, Graeme Russ wrote:
>>> I have a need to dump memory contents to a filesystem on an SD/MMC
>>
>> Do you really need a filesystem for this? You can easily dump memory to SD using
>> block write.
> 
> Well I want to copy the data back to my dev PC - If the SD/MMC card is
> formatted with a filesystem, it is trivial to transfer the data back
> and forth

Well, it shouldn't be that hard to get the data written to specific
blocks on the dev PC using dd command.

Regards, Ilya.

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13 23:34     ` Ilya Yanok
@ 2011-12-13 23:37       ` Graeme Russ
  2011-12-13 23:46         ` Ilya Yanok
  0 siblings, 1 reply; 10+ messages in thread
From: Graeme Russ @ 2011-12-13 23:37 UTC (permalink / raw)
  To: u-boot

Hi Ilya,

On Wed, Dec 14, 2011 at 10:34 AM, Ilya Yanok <yanok@emcraft.com> wrote:
> Hi Graeme,
>
> On 14.12.2011 03:28, Graeme Russ wrote:
>>>> I have a need to dump memory contents to a filesystem on an SD/MMC
>>>
>>> Do you really need a filesystem for this? You can easily dump memory to SD using
>>> block write.
>>
>> Well I want to copy the data back to my dev PC - If the SD/MMC card is
>> formatted with a filesystem, it is trivial to transfer the data back
>> and forth
>
> Well, it shouldn't be that hard to get the data written to specific
> blocks on the dev PC using dd command.

But what about bad blocks?

But I imagine this problem exists when using a file system not
designed with explicit bad-block handling - Do SD/MMC cards deal with
bad blocks internally? I'm not familiar with the low level details, I
just know that enabling MMC in U-Boot 'just works' on my board

Regards,

Graeme

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13 23:37       ` Graeme Russ
@ 2011-12-13 23:46         ` Ilya Yanok
  2011-12-13 23:52           ` Graeme Russ
  0 siblings, 1 reply; 10+ messages in thread
From: Ilya Yanok @ 2011-12-13 23:46 UTC (permalink / raw)
  To: u-boot

Hi Graeme,

On 14.12.2011 03:37, Graeme Russ wrote:
>> Well, it shouldn't be that hard to get the data written to specific
>> blocks on the dev PC using dd command.
> 
> But what about bad blocks?

You don't need to worry much about this. MMC/SD card are not a raw flash
devices they contain FTL that handles this internally. See
http://www.linux-mtd.infradead.org/doc/ubifs.html#L_raw_vs_ftl
for details.

That's why you can use generic filesystems on MMC/SD (neither FAT not
EXT2/3/4 is not designed for raw flash).

Regards, Ilya.

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

* [U-Boot] Request for Help: How to save data to an SD/MMC card
  2011-12-13 23:46         ` Ilya Yanok
@ 2011-12-13 23:52           ` Graeme Russ
  0 siblings, 0 replies; 10+ messages in thread
From: Graeme Russ @ 2011-12-13 23:52 UTC (permalink / raw)
  To: u-boot

Hi Ilya,

On Wed, Dec 14, 2011 at 10:46 AM, Ilya Yanok <yanok@emcraft.com> wrote:
> Hi Graeme,
>
> On 14.12.2011 03:37, Graeme Russ wrote:
>>> Well, it shouldn't be that hard to get the data written to specific
>>> blocks on the dev PC using dd command.
>>
>> But what about bad blocks?
>
> You don't need to worry much about this. MMC/SD card are not a raw flash
> devices they contain FTL that handles this internally. See
> http://www.linux-mtd.infradead.org/doc/ubifs.html#L_raw_vs_ftl
> for details.
>
> That's why you can use generic filesystems on MMC/SD (neither FAT not
> EXT2/3/4 is not designed for raw flash).

Thanks, that is good to know - I'll try this out when I get a chance

Nonetheless, I think it will be advantageous to have filesystem write
support in U-Boot anyway to allow seamless transfer of data between
development mchines, U-Boot and the target OS.

Regards,

Graeme

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

end of thread, other threads:[~2011-12-13 23:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13  5:16 [U-Boot] Request for Help: How to save data to an SD/MMC card Graeme Russ
2011-12-13  8:14 ` Wolfgang Denk
2011-12-13 23:18   ` Graeme Russ
2011-12-13 23:26 ` Ilya Yanok
2011-12-13 23:28   ` Graeme Russ
2011-12-13 23:31     ` Ulf Samuelsson
2011-12-13 23:34     ` Ilya Yanok
2011-12-13 23:37       ` Graeme Russ
2011-12-13 23:46         ` Ilya Yanok
2011-12-13 23:52           ` Graeme Russ

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