Skip to contentSkip to conversation

DOC2000 support for a custom PPC750 board

DISCUSSION Boris Bulkin 3 participants 6 messages Nov 5, 2001 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi!

Could anyone please advise something on the following issue?

I'm working on port of a firmware program to a PPC750-based board, and I need to support for booting Linux from a DOC2000 partition in the firmware. I'm thinking of using existing MTD stuff as a base for my efforts. Once the firmware is working, I'll need to support DOC in Linux too.

I'm new to the MTD project, so any information will be very appreciated. What is the current state of MTD support for DOC? Do MTD DOC drivers require any firmware from M-Sys, or does MTD provide its own DOC firmware? Then, I know that M-Systems suggests running its DOS-based tools for partitioning and formatting a DOC device. Are there any open-source replacements for them?

Of course, my firmware program will be open-source, too.

Many thanks in advance.
Boris

#1 lore raw
Quoted 2 lines · [email protected] said:

I'm new to the MTD project, so any information will be very
appreciated. What is the current state of MTD support for DOC?

It works, for the DiskOnChip 2000 and DiskOnChip Millennium. Not the Millennium Plus. It doesn't do sane wear-levelling though. That's left as an exercise for the reader. Pointers and CVS access will happily be given to anyone who looks serious about doing it.

Quoted 2 lines

Do MTD DOC drivers require any firmware from M-Sys, or does MTD provide its own DOC firmware?

The DiskOnChip requires no firmware. It is not an intelligent device. What's normally referred to as the DiskOnChip 'firmware' is the BIOS extension which installs a driver which hooks the PC INT 13h disk service interrupt and hence makes DOS and LILO work. I assume you don't want that :)

Quoted 3 lines

Then, I know that M-Systems suggests running its DOS-based tools for partitioning and formatting a DOC device. Are there any open-source replacements for them?

There is nftl_format.c which performs the basic function of creating an NFTL on the raw flash. NFTL is the translation layer used on the DiskOnChip devices to emulate a normal block device. It is preferred to use the DOS utilities because their response to finding bad blocks has been far better tested. But nftl_format should be OK.

--
dwmw2

#2 lore raw

David,

Thank you very much for the quick response. The information you've given is an exelent help for me to get started.

One more question: from the M-Sys documents I understand there can be two types of partitions on a DOC device, binary and NFTL. Binary is supposed to store an OS image, and NFTL be used as a filesystem. Are there any MTD tools for creating and reading/writing binary DOC partitions?
Sorry if it sonds silly. I'm not very familiar with DOC and MTD.

Thanks,
Boris

Quoted 29 lines · David Woodhouse
Quoted 2 lines · [email protected] said:

I'm new to the MTD project, so any information will be very
appreciated. What is the current state of MTD support for DOC?

It works, for the DiskOnChip 2000 and DiskOnChip Millennium. Not the Millennium Plus. It doesn't do sane wear-levelling though. That's left as an exercise for the reader. Pointers and CVS access will happily be given to anyone who looks serious about doing it.

Quoted 2 lines

Do MTD DOC drivers require any firmware from M-Sys, or does MTD provide its own DOC firmware?

The DiskOnChip requires no firmware. It is not an intelligent device. What's normally referred to as the DiskOnChip 'firmware' is the BIOS extension which installs a driver which hooks the PC INT 13h disk service interrupt and hence makes DOS and LILO work. I assume you don't want that :)

Quoted 3 lines

Then, I know that M-Systems suggests running its DOS-based tools for partitioning and formatting a DOC device. Are there any open-source replacements for them?

There is nftl_format.c which performs the basic function of creating an NFTL on the raw flash. NFTL is the translation layer used on the DiskOnChip devices to emulate a normal block device. It is preferred to use the DOS utilities because their response to finding bad blocks has been far better tested. But nftl_format should be OK.

--
dwmw2

#3 lore raw
Quoted 6 lines · [email protected] said:

One more question: from the M-Sys documents I understand there can be
two types of partitions on a DOC device, binary and NFTL. Binary is supposed to store an OS image, and NFTL be used as a filesystem. Are there any MTD tools for creating and reading/writing binary DOC partitions? Sorry if it sonds silly. I'm not very familiar with DOC and MTD.

By 'binary partitions' they presumably mean data stored directly on the flash chips. NFTL is a kind of pseudo-filesystem which is used to emulate a block device - you then put normal filesystems on top of that emulated block device.

Yes, we have programs which will write data to the raw flash. You just open /dev/mtd0, use the MEMERASE ioctl for the region you want to overwrite and then write to it. The doc_loadbios program was used for putting Grub in place of the normal firmware.

--
dwmw2

#4 lore raw
In reply to David Woodhouse
Quoted 6 lines

The DiskOnChip requires no firmware. It is not an intelligent device. What's normally referred to as the DiskOnChip 'firmware' is the BIOS extension which installs a driver which hooks the PC INT 13h disk service
interrupt and hence makes DOS and LILO work. I assume you don't want that :)

Can the firmware boot into LILO directly? Or it requires the patched lilo-mtd in the patches subdirectory?

I have been under the impression that you need lilo-mtd to boot the DiskOnChip. However, the lilo-mtd patch is dated March of 2000.

Thanks.
Bao

#5 lore raw
Quoted 5 lines · [email protected] said:

Can the firmware boot into LILO directly? Or it requires the patched
lilo-mtd in the patches subdirectory?

I have been under the impression that you need lilo-mtd to boot the DiskOnChip. However, the lilo-mtd patch is dated March of 2000.

I've never used the patched LILO, but I believe the only changes are that it recognises the 'root=/dev/nftla' device and sets the device number accordingly, and that it can deal with the fact that the M-Systems BIOS extension has eaten a huge chunk of sub-640K RAM. The latter may no longer be required with a newer LILO anyway, and the former can be worked around by using 'append="root=/dev/nftla"' instead of just 'root=', just as with other device names that LILO doesn't know about.

--
dwmw2