FLASH(3)                    (MPC8xx)                     FLASH(3)

     NAME
          flash - flash memory

     SYNOPSYS
          bind -a '#F' /dev

          /dev/flash
          /dev/flashctl
          /dev/flashstat

     DESCRIPTION
          The flash memory device serves a one-level directory, giving
          access to three files.  The data file flash provides read
          and write access to the bytes on the system's 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 values, using the physical device's reprogramming algo-
          rithm.  An erased flash byte is logically 16rFF (regardless
          of the conventions of the physical flash device).  A write
          can change a bit with value 1 to a 0, but cannot change a 0
          bit to 1; that can only be done by erasing one or more flash
          segments.

          The control file flashctl receives commands to erase a sin-
          gle flash segment (erase unit) or the whole flash memory.
          There are two forms of erase command:

          erase all
               Erase the whole flash, setting all bytes to 16rFF,
               except those that are hardware write-protected.

          erase offset
               Erase the segment that begins at the given offset, set-
               ting all bytes to 16rFF, except those that are hardware
               write-protected.  The offset is a number of bytes, but
               must be a multiple of the segment (erase unit) size.
               The syntax of the number is that of strtoul; the
               default base is 10.

          The status file flashstat is a read-only file.  A read
          returns a single line containing five hexadecimal numbers
          (separated by white space) revealing the memory's character-
          istics: the manufacturer ID, the flash device ID, its width
          in bytes, the size in bytes of an erase unit, and the size
          in bytes of the memory.

     SOURCE
          /os/mpc/devflash.c

     Page 1                       Plan 9            (printed 11/18/24)

     FLASH(3)                    (MPC8xx)                     FLASH(3)

          /os/mpc/flashamd.c
          /os/mpc/flashpaq.c
          /os/pc/devflash.c
          /os/pc/flashzpc.c

     SEE ALSO
          ftl(3)

     DIAGNOSTICS
          A write will return an error if an attempt is made to change
          a 0 bit to 1, or 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.

     Page 2                       Plan 9            (printed 11/18/24)