FLASH-1100(3)               (SA1100)                FLASH-1100(3)

     NAME
          flash1100 - flash memory (StrongARM)

     SYNOPSYS
          bind -a '#W' /dev

          /dev/flashnall
          /dev/flashnctl
          /dev/flashnpartition
          /dev/flashnstat

     DESCRIPTION
          The StrongARM SA1100 kernel currently has a different flash
          memory driver than some of the other ports; see BUGS below.

          The flash memory device serves a one-level directory, giving
          access to four files for each physical flash device, start-
          ing at n=0:

          flashnall
               This file represents the entire flash memory.

          flashnpartition
               This file represents the space allocated in flash for
               the flash partition table.

          flashnstat
               This file can be read for information about the flash
               memory and the corresponding partition table (if any);
               see below for details.

          flashnctl
               This writable file accepts a single message sync, which
               flushes all buffered writes to flash.

          The first line read from the status file describes the flash
          chips:

               man-id dev-id width sector-size total-size man-name
               dev-name

          where man-id and dev-id are the values (in hex) of the
          chip's manufacturer and device IDs; width is the width in
          bytes across the bus; sector-size is the total flash sector
          size (erase unit size) in bytes, allowing for the bus width;
          total-size is the total flash size in bytes; and man-name
          and dev-name are character strings identifying the flash
          type.  Following lines give flash protection status in the
          following form:

     Page 1                       Plan 9             (printed 3/28/24)

     FLASH-1100(3)               (SA1100)                FLASH-1100(3)

               start-end:prot

          where each line tells the start and end addresses of a
          region, and a bit mask telling its protection status.
          Finally, there is one line for each partition, including the
          standard partitions all and partition, of the form:

               start length checksum name

          giving the starting address, length and checksum (all in
          hex), and partition name.

          Each partition file provides read and write access to the
          bytes in the corresponding region of flash memory.  Bytes
          can be read and written on any byte boundary: the interface
          hides any alignment restrictions.  A read returns the value
          of the bytes at the current file offset.  A write reprograms
          the flash at the current file offset to the given byte val-
          ues, using the physical device's reprogramming algorithm.
          The driver uses an internal buffer in system memory to hide
          any erasing of flash sectors that might be required to
          reprogram the given region; it also buffers the data written
          so that a section is erased and reprogrammed only when
          either a subsequent write moves out of the buffer or an
          internal timer causes the data to be flushed to flash.

     SOURCE
          /os/sa1100/devflash.c

     SEE ALSO
          sboot(10.8)

     DIAGNOSTICS
          A write will return an error if the flash memory fails to be
          programmed correctly.

     BUGS
          The flash cannot be written if the kernel is executing
          directly from flash, because the physical flash cannot be
          read during programming.

          The buffering of writes is intended to allow the flash to be
          accessed in the same way as a disc, but it has disadvan-
          tages: it creates a window during which data will be lost or
          corrupted if power is lost or the operation is interrupted
          in some other way; erase is more frequent; and it fails to
          spread the erase load evenly across the device.

     Page 2                       Plan 9             (printed 3/28/24)