Micron MT29F NAND driver
|
MT_uint8 Init_Driver | ( | void | ) |
This function initialize the driver and it must be called before any other function
NAND_DRIVER_STATUS_INITIALIZED | |
DRIVER_STATUS_NOT_INITIALIZED |
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; }