nand->controller_priv = mx3_nf_info;
- mx3_nf_info->target = get_target (CMD_ARGV[1]);
- if (mx3_nf_info->target == NULL)
- {
- LOG_ERROR ("target '%s' not defined", CMD_ARGV[1]);
- return ERROR_FAIL;
- }
if (CMD_ARGC < 3)
{
LOG_ERROR ("use \"nand device imx31 target noecc|hwecc\"");
mx3_nf_info->optype = MX3_NF_DATAOUT_PAGE;
mx3_nf_info->fin = MX3_NF_FIN_NONE;
mx3_nf_info->flags.target_little_endian =
- (mx3_nf_info->target->endianness == TARGET_LITTLE_ENDIAN);
+ (nand->target->endianness == TARGET_LITTLE_ENDIAN);
/*
* testing host endianess
*/
static int imx31_init (struct nand_device *nand)
{
struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
{
/*
static int imx31_read_data (struct nand_device *nand, void *data)
{
- struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
{
/*
* validate target state
static int imx31_command (struct nand_device *nand, uint8_t command)
{
struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
{
/*
* validate target state
static int imx31_address (struct nand_device *nand, uint8_t address)
{
- struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
{
/*
* validate target state
static int imx31_nand_ready (struct nand_device *nand, int tout)
{
uint16_t poll_complete_status;
- struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
{
/*
uint32_t oob_size)
{
struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
if (data_size % 2)
{
uint8_t * data, uint32_t data_size, uint8_t * oob,
uint32_t oob_size)
{
- struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
if (data_size % 2)
{
static int initialize_nf_controller (struct nand_device *nand)
{
struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
/*
* resets NAND flash controller in zero time ? I dont know.
*/
static int validate_target_state (struct nand_device *nand)
{
struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
if (target->state != TARGET_HALTED)
{
static int do_data_output (struct nand_device *nand)
{
struct mx3_nf_controller *mx3_nf_info = nand->controller_priv;
- struct target *target = mx3_nf_info->target;
+ struct target *target = nand->target;
switch (mx3_nf_info->fin)
{
case MX3_NF_FIN_DATAOUT: