text: Chapter 57. Samsung K9 family NAND chips
  Table of Contents
  57.1. Overview
  The
  CYGPKG_DEVS_NAND_SAMSUNG_K9 driver package currently
  provides support for the Samsung K9F1G08, K9F2G08 and K9F1208 series of NAND flash chips, and
  is intended to be expanded to provide support for more of the K9 family.
  Most users will not need to interact with this package; it should be included as a hardware dependency on all appropriate targets. This package provides only an inline code fragment which is intended to be instantiated by the target platform HAL and provided with appropriate board-specific low-level functions allowing it to access the hardware.
  57.2. Using this driver in a board port
  This driver's top-level chip support is currently provided as two files:
  cyg/devs/nand/k9_generic.h
  Prototypes the low-level chip access functions required by the chip driver and declares a private struct for use by the driver.
  cyg/devs/nand/k9_generic.inl
  Implements high-level chip functions and exposes them via the
  CYG_NAND_FUNSmacro. This file is not intended to be compiled on its own, but to be included by the source file in a platform HAL which implements the low-level functions.
  A platform HAL would typically make use of this driver in a single source file with the following steps:
  - Declare a local private struct with contents as appropriate,
  #include <cyg/devs/nand/k9_generic.h>
  - implement the required low-level functions,
  #include <cyg/devs/nand/k9_generic.inl>
  - declare a list of the supported
  k9_subtypewhich may appear on the board, terminated by
  K9_SUBTYPE_SENTINEL
  - declare a static instance of the
  k9_privstruct containing pointers to that list and to an instance of the local-private struct
  finally, instantiate the chip with the
  CYG_NAND_DEVICEmacro, selecting the ECC and OOB semantics to use.
  For more details about the infrastructure provided by the NAND layer and the semantics it expects of the chip driver, refer to Chapter 52, eCos NAND Flash Library. An example driver instantiation can be found in the NAND driver for the EA LPC2468 platform.
  57.2.1. Memory usage
  As discussed in Section 54.2, “High-level (chip) functions”, the chip
  initialisation function must set up the
  bbt.data
  pointer in the cyg_nand_device struct. This driver does so
  by including a large byte array in the k9_priv
  struct whose size is controlled by CDL depending on the enabled
  chip support.
  That struct is intended to be allocated as a static struct in the
  data or BSS segment (one per chip), which avoids adding a dependency
  on
  malloc.
  57.2.2. Low-level functions required from the platform HAL
  These functions are prototyped in
  k9_generic.h.
  They have no return value ("void"), except for
  read_data_1 which returns the byte it has read..
  k9_devlock(device),
  k.)
  k.
  k9_plf_partition_setup(device)
  Board-level partition initialisation hook. This should set up the
  partitionarray.