Micron MT29F NAND driver
|
MT_uint8 NAND_Set_Feature | ( | flash_width | feature_address, |
flash_width | subfeature | ||
) |
The SET FEATURES (EFh) command writes the subfeature parameters (P1–P4) to the specified feature address to enable or disable target-specific features. This command is accepted by the target only when all die (LUNs) on the target are idle.
[in] | flash_width | feature_address: address of the feature (use ADDDR_FEATURE_XXXX define) |
[out] | flash_width | subfeature: subfeature (use FEATURE_XXXX define) |
NAND_SUCCESS | |
NAND_TIMEOUT |
Definition at line 387 of file nand_MT29F_lld.c.
References __wait_for_ready(), CMD_SET_FEATURE, parameter_page_t::command, device_info, driver_status, DRIVER_STATUS_INITIALIZED, DRIVER_STATUS_NOT_INITIALIZED, NAND_SUCCESS, NAND_UNSUPPORTED, OPTIONAL_CMD_GET_FEATURES_AND_SET_FEATURES, PLATFORM_Close(), PLATFORM_Open(), PLATFORM_SendAddr(), PLATFORM_SendCmd(), PLATFORM_SendData(), PLATFORM_Wait(), TIME_ADL, and TIME_WB.
{ MT_uint8 ret; /* verify if driver is initialized */ if(DRIVER_STATUS_INITIALIZED != driver_status) return DRIVER_STATUS_NOT_INITIALIZED; /* check if this feature/command is supported */ if ((device_info.command & OPTIONAL_CMD_GET_FEATURES_AND_SET_FEATURES) == 0) return NAND_UNSUPPORTED; /* init board transfer */ PLATFORM_Open(); /* send command and/or address */ PLATFORM_SendCmd(CMD_SET_FEATURE); PLATFORM_SendAddr(feature_address); /* wait (see datasheet for details) */ PLATFORM_Wait(TIME_ADL); /* send sub-feature parameter */ PLATFORM_SendData(subfeature); /* p0 */ PLATFORM_SendData(0x00); /* p1 reserved */ PLATFORM_SendData(0x00); /* p2 reserved */ PLATFORM_SendData(0x00); /* p3 reserved */ PLATFORM_Wait(TIME_WB); ret = __wait_for_ready(); /* return if timeout */ if (NAND_SUCCESS != ret) return ret; /* close board transfer */ PLATFORM_Close(); return ret; }