Micron MT29F NAND driver
MT_uint8 Init_Driver ( void  )

This function initialize the driver and it must be called before any other function

Returns:
Return code
Return values:
NAND_DRIVER_STATUS_INITIALIZED
DRIVER_STATUS_NOT_INITIALIZED
Pseudo Code Steps
  1. Flash Reset
  2. Read ONFI signature
  3. Read the parameter page

Definition at line 84 of file nand_MT29F_lld.c.

References device_info, driver_status, DRIVER_STATUS_INITIALIZED, NAND_BAD_PARAMETER_PAGE, NAND_Read_ID_ONFI(), NAND_Read_Param_Page(), NAND_Reset(), ONFI_SIGNATURE_LENGHT, and PLATFORM_Init().

                           {
   flash_width onfi_signature[ONFI_SIGNATURE_LENGHT];

   /* check if the driver is previously initialized */
   if(DRIVER_STATUS_INITIALIZED == driver_status)
      return DRIVER_STATUS_INITIALIZED;

   /* initialize platform */
   PLATFORM_Init();

   /* reset at startup is mandatory */
   NAND_Reset();

   /* read if this device is ONFI complaint */
   NAND_Read_ID_ONFI(onfi_signature);

   /* verify ONFI signature in the first field of parameter page */
   if(strcmp((const char *)onfi_signature, "ONFI") &&
      (NAND_BAD_PARAMETER_PAGE != NAND_Read_Param_Page(&device_info)))
      driver_status = DRIVER_STATUS_INITIALIZED;

   return driver_status;
}