Micron MT29F NAND driver
|
MT_uint8 NAND_OTP_Mode_Enter | ( | void | ) |
This function is used to set the device in OTP mode. When the device is in this mode, please use only the dedicated OTP functions set:
[in] | none |
Definition at line 1470 of file nand_MT29F_lld.c.
References ADDR_FEATURE_ARRAY_OPMODE, driver_status, DRIVER_STATUS_INITIALIZED, DRIVER_STATUS_NOT_INITIALIZED, FEATURE_ARRAY_NORMAL, FEATURE_ARRAY_OTP_OPERATION, FEATURE_ARRAY_OTP_PROTECTION, NAND_GENERIC_FAIL, NAND_Get_Feature(), NAND_Set_Feature(), and NAND_SUCCESS.
{ MT_uint8 ret; flash_width subfeature; /* check if driver is in a valid state */ if(DRIVER_STATUS_INITIALIZED != driver_status) return DRIVER_STATUS_NOT_INITIALIZED; /* check if device is NOT in OTP status */ ret = NAND_Get_Feature(ADDR_FEATURE_ARRAY_OPMODE, &subfeature); if((FEATURE_ARRAY_NORMAL != subfeature) && (FEATURE_ARRAY_OTP_PROTECTION != subfeature)) return NAND_GENERIC_FAIL; /* set OTP status */ ret = NAND_Set_Feature(ADDR_FEATURE_ARRAY_OPMODE, FEATURE_ARRAY_OTP_OPERATION); /* return with error if a fail occurs */ if(NAND_SUCCESS != ret) return ret; /* check if device is in OTP status */ ret = NAND_Get_Feature(ADDR_FEATURE_ARRAY_OPMODE, &subfeature); /* return with error if a fail occurs */ if(NAND_SUCCESS != ret) return ret; if(FEATURE_ARRAY_OTP_OPERATION != subfeature) return NAND_GENERIC_FAIL; return NAND_SUCCESS; }