DiskOnChip

From ThinCan
Jump to: navigation, search

This page describes the M-Systems Disk-on-Chip Flash storage media and how to use it, as found in ThinCan DBE60

Contents

Overview

DiskOnChip is a single-chip solution on ISA bus that embeds:

  • NAND flash(es)
  • NAND flash controller
  • virtual IPL BIOS ROM, that exports beginning of NAND flash directly to ISA bus, just below 1MB address

The chip has its own partition table; partitioning is done using docfdisk or dformat utility.

Booting:

  • The system boots from IPL ROM at the top of the 1MB address space;
  • IPL ROM initializes CPU and SDRAM;
  • IPL ROM copies the rest of the BIOS from a partition in NAND to SDRAM and executes it;
  • BIOS initializes the rest of the system
  • BIOS loads Linux kernel via etherboot or from NAND and executes it;

Drivers

Use following kernel config:

# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_SMC is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
CONFIG_MTD_NAND_IDS=y
CONFIG_MTD_NAND_DISKONCHIP=y
# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE=y

There are 2 DoC drivers in Linux kernel. Use the one in NAND section, not the old self-contained driver. Do NOT enable INFTL.

Kernel patches

Install the following kernel patches: http://thincan.org/download/DBE60/DOC32/2010-11-29/

Linux mainline driver supports DiskOnChip Millennium Plus devices up to 16MB; the mainline driver is not well maintained (it does not pass all MTD tests but JFFS2 seems to work). The larger 32MB parts found on DBE60-1 are not supported in the mainline driver.

These patches add support to DiskOnChip Millennium Plus 32MB devices to Linux kernel and fix some bugs regarding the 16MB devices. The patches should apply cleanly to 2.6.34. The patches have been tested on DBE60 and DBE60-1 ThinCan's and they pass all MTD tests.

FIXME: submit these patches to the LKML for inclusion upstream.

Formatting DoC

Artec's IPL code must be installed to DoC to be able to boot from it (DoC is 2-in-1 chip for BIOS and system flash). Artec's DBE60 IPL code will perform minimal initialization on the DBE60 HW, after that it reads real BIOS from DoC and shadows it to SDRAM. After shadowing is complete, the BIOS is executed; the BIOS does not initialize the low-level system peripherals anymore. (The same BIOS image can not be used for booting from LPC dongle and DoC as for DoC the initialization is split between BIOS and IPL).

Unload DoC driver modules before using dformat! dformat accesses the chip directly using the chip's IO address; it must be run as root; it conflicts with DoC driver!

Use dformat to reset the DoC and install BIOS and IPL (this creates one partition for BIOS and second partition for data; ALL DATA ON CHIP IS LOST!):

dformat -win:c800 -ipl:iplfile.bin -bdkf0:biosfile.bin -bdkn0:CLRA -y

Later, the BIOS partition of the DoC will be separately visible as /dev/mtd1 and updating bios can be done using mtd utils without re-formatting the whole chip. Also, re-partitioning the system can be done using docfdisk only.

M-Systems' DoC tools can be downloaded from [1].

Partitioning DoC

MTD-utils comes with docfdisk utility. This can be used to re-partition DoC without re-formatting. Keep the first BIOS partition 16-block size; the rest can be partitioned as needed. Partitioning will take effect on the next MTD driver reload or re-boot.

Booting from DoC

TODO

Personal tools