public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] DiskOnChip, filesystems, and other booting options
@ 2003-04-25  8:13 Wolfgang Denk
  2003-04-29 21:23 ` Udi Finkelstein
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2003-04-25  8:13 UTC (permalink / raw)
  To: u-boot

Dear Udi,

in message <01qhav4dc6n97kctt8ob8f9qsjrva8v3sm@4ax.com> you wrote:
> 
> Yes, I know about these - what I meant was that the D.O.C support is
> still at
> the sector level, without any filesystem support.

Right.

IMHO all filesystem stuff for U-Boot should be split into a  separate
layer  (standalone  applications  acting  as  second  stage bootstrap
loaders).

> As far as I know (correct me if I'm wrong), NFTL does block-level
> remapping of
> bad blocks as well as wear levering by constantly changing the
> logical<>physical sector mapping on each write (so that if you write the
> same
> "logical" sector 1000 times it would spread over all the flash).

So they claim to do.

> If my understanding is accurate, how can I use the U-Boot raw sectors
> without
> disturbing the NFTL mapping that is handled by the Linux MTD package?

I think that the "binary partition" is not subject to this, i. e. you
can do direct I/O with the binary partition on the DoC.

> Besides, I've peeked into the D.O.C code in U-boot and it's full of NFTL
> references. In fact, as far as I can see, binary partitions are part of
> NFTL.

Yes.

> I've been looking at the files in fs/fdos/... and the CMD_FDC, CMD_FDOS
> code
> which calls them., and I see it contains complete code to read a FAT
> filesystem.

Something to be cleaned up and implemented in a more general way...


> I understand from the above that I don't need it, but just for the sake
> of
> understanding - couldn't I drop the NFTL+normal filesystem and use JFFS2
> over
> the raw D.O.C sectors, since JFFS2 does bad block mapping and wear
> levering
> (or does it??)

I don't know if it is possible to  extend  the  size  of  the  binary
partition to cover the whole device.

> OK, so where to I stand now?
> 1. My kernel correctly identifies the D.O.C but for some reason manages
> to
> mount it only partially. /dev/mtdchar0 is non functional, but /dev/nftla
> seems
> to work between reboots. I can correctly partition the D.O.C using fdisk,
>  and
> the format is kept when I leave fdisk and re-run it, btu once I reboot,
> all
> the partitioning done is lost.

That rings a bell to me. We fixed exactly such a problem once.

In the old version of the code some internal data structures  of  the
NFTL  driver, which are initialized only at boot-time, become invalid
after you run nftl_format.

See my message "DOC / NFTL problem, and fix" from Aug  28,  2002,  to
the MTD mailing list:
http://lists.infradead.org/pipermail/linux-mtd/2002-August/005853.html
I don't know if they  ever  accepted  the  patch,  and/or  if  it  is
included  with  your  version of the MTD tools. Just in case I attach
this patch again below.


> I think this part of my questions should be sent to the MTD list I guess.

Agreed.


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Do not underestimate the value of print statements for debugging.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mtd_nftl.patch
Type: application/x-patch
Size: 6104 bytes
Desc: mtd_nftl.patch
Url : http://lists.denx.de/pipermail/u-boot/attachments/20030425/ec2bdf1a/attachment.bin 

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [U-Boot-Users] DiskOnChip, filesystems, and other booting options
@ 2003-04-24 23:37 Udi Finkelstein
  2003-04-24 23:18 ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Udi Finkelstein @ 2003-04-24 23:37 UTC (permalink / raw)
  To: u-boot

Hello everyone,

I've finished porting U-boot 0.3.0 to my MPX823 board. It contains a 512KB
29LV040 that boots u-boot, an extra 8MB DiskOnChip Millenium, and an Ethernet
controller (it contains other hardware as well, but that's not relevant).

I can now successfully boot the board into Linux by tftp'ing the kernel, and
using root nfs (exported NFS is /opt/eldk/ppc_8xx - thanks Worlfgang!).

I compiled my own kernel based on the latest linuxppc_2_4 CVS branch.
I can successfully access my DiskOnchip under both u-boot and Linux.

I now want to boot my board from the on-board Flash.

In an ideal world, I would like the DiskOnChip to be:
1. Partition into one or more partitions
2. Boot the kernel from a file in one of the partitions (could be FAT)
3. mount root from separate partition, (if kernel is on FAT), or same
partition as the kernel (if possible).

I'm slightly confused as to the status of JFFS2, DOS partitioning, DOS
FAT/VFAT, and the DiskOnChip support. More specifically:

1. As far as I can tell, the only DiskOnChip support are the "doc read" and
"doc write" commands, therefore if I use these commands I must load the kernel
directly off the raw sectors - no filesystem support whatsoever. Am I correct?

2. Does the "doc read" and "doc write" use the NFTL layer, or do they access
the raw device sectors?

3. As far as I can tell, the FAT support is hardwired to the floppy controller
device, and the DOS partition support is wired to the IDE support. Am I right?
It seems to me it is quite trivial to construct a simple interface (a struct
containing the block device geometry, plus a pointer to sector read function),
and have both the partitioning and the DOS FAT code access this. This could
help support DOS filesystems on D.O.C, floppies and IDE devices.

4. What is the best way to achieve my requirements above? (booting a kernel
from a filesystem on the D.O.C). Can JFFS2 help me in any way?

5. Failing all the above, can I partition the device under Linux into 2
partitions, write down the sector range for the 1st partition, and use it to
read/write the kernel using the "doc read" and "doc write interface"?
I would then mount the 2nd partition after booting the kernel.

thanks,
Udi

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

end of thread, other threads:[~2003-04-30 10:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-25  8:13 [U-Boot-Users] DiskOnChip, filesystems, and other booting options Wolfgang Denk
2003-04-29 21:23 ` Udi Finkelstein
2003-04-29 21:06   ` Wolfgang Denk
2003-04-30 10:20     ` Udi Finkelstein
  -- strict thread matches above, loose matches on Subject: below --
2003-04-24 23:37 Udi Finkelstein
2003-04-24 23:18 ` Wolfgang Denk
2003-04-25  8:21   ` Udi Finkelstein

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