Home | History | Annotate | Download | only in hw
      1 /* Copyright (C) 2007-2008 The Android Open Source Project
      2 **
      3 ** This software is licensed under the terms of the GNU General Public
      4 ** License version 2, as published by the Free Software Foundation, and
      5 ** may be copied, distributed, and modified under those terms.
      6 **
      7 ** This program is distributed in the hope that it will be useful,
      8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
      9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10 ** GNU General Public License for more details.
     11 */
     12 #ifndef NAND_DEVICE_REG_H
     13 #define NAND_DEVICE_REG_H
     14 
     15 enum nand_cmd {
     16 	NAND_CMD_GET_DEV_NAME,  // Write device name for NAND_DEV to NAND_DATA (vaddr)
     17 	NAND_CMD_READ,
     18 	NAND_CMD_WRITE,
     19 	NAND_CMD_ERASE,
     20 	NAND_CMD_BLOCK_BAD_GET, // NAND_RESULT is 1 if block is bad, 0 if it is not
     21 	NAND_CMD_BLOCK_BAD_SET
     22 };
     23 
     24 enum nand_dev_flags {
     25 	NAND_DEV_FLAG_READ_ONLY = 0x00000001
     26 };
     27 
     28 #define NAND_VERSION_CURRENT (1)
     29 
     30 enum nand_reg {
     31 	// Global
     32 	NAND_VERSION        = 0x000,
     33 	NAND_NUM_DEV        = 0x004,
     34 	NAND_DEV            = 0x008,
     35 
     36 	// Dev info
     37 	NAND_DEV_FLAGS      = 0x010,
     38 	NAND_DEV_NAME_LEN   = 0x014,
     39 	NAND_DEV_PAGE_SIZE  = 0x018,
     40 	NAND_DEV_EXTRA_SIZE = 0x01c,
     41 	NAND_DEV_ERASE_SIZE = 0x020,
     42 	NAND_DEV_SIZE_LOW   = 0x028,
     43 	NAND_DEV_SIZE_HIGH  = 0x02c,
     44 
     45 	// Command
     46 	NAND_RESULT         = 0x040,
     47 	NAND_COMMAND        = 0x044,
     48 	NAND_DATA           = 0x048,
     49 	NAND_TRANSFER_SIZE  = 0x04c,
     50 	NAND_ADDR_LOW       = 0x050,
     51 	NAND_ADDR_HIGH      = 0x054,
     52 };
     53 
     54 #endif
     55