OpenOCD
flash/nand/driver.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2005 by Dominic Rath <Dominic.Rath@gmx.de> *
5  * Copyright (C) 2007,2008 Øyvind Harboe <oyvind.harboe@zylin.com> *
6  * Copyright (C) 2008 by Spencer Oliver <spen@spen-soft.co.uk> *
7  * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
8  ***************************************************************************/
9 
10 #ifdef HAVE_CONFIG_H
11 #include <config.h>
12 #endif
13 #include "core.h"
14 #include "driver.h"
15 
31  NULL
32 };
33 
35 {
36  for (unsigned int i = 0; nand_flash_controllers[i]; i++) {
37  struct nand_flash_controller *controller = nand_flash_controllers[i];
38  if (strcmp(name, controller->name) == 0)
39  return controller;
40  }
41  return NULL;
42 }
44 {
45  for (unsigned int i = 0; nand_flash_controllers[i]; i++) {
46  int retval = (*f)(nand_flash_controllers[i], x);
47  if (retval != ERROR_OK)
48  return retval;
49  }
50  return ERROR_OK;
51 }
const char * name
Definition: armv4_5.c:76
struct nand_flash_controller at91sam9_nand_controller
Structure representing the AT91SAM9 NAND controller.
Definition: at91sam9.c:695
struct nand_flash_controller davinci_nand_controller
Definition: davinci.c:765
int nand_driver_walk(nand_driver_walker_t f, void *x)
Walk the list of drivers, encapsulating the data structure type.
static struct nand_flash_controller * nand_flash_controllers[]
struct nand_flash_controller * nand_driver_find_by_name(const char *name)
Find a NAND flash controller by name.
#define ERROR_OK
Definition: log.h:164
struct nand_flash_controller lpc32xx_nand_controller
Definition: lpc32xx.c:1794
struct nand_flash_controller s3c2412_nand_controller
Definition: s3c2412.c:50
struct nand_flash_controller orion_nand_controller
Definition: orion.c:139
struct nand_flash_controller nuc910_nand_controller
Definition: nuc910.c:204
struct nand_flash_controller nonce_nand_controller
Definition: nonce.c:51
struct nand_flash_controller lpc3180_nand_controller
Definition: lpc3180.c:1334
struct nand_flash_controller s3c2410_nand_controller
Definition: s3c2410.c:93
struct nand_flash_controller s3c2440_nand_controller
Definition: s3c2440.c:141
struct nand_flash_controller mxc_nand_flash_controller
Definition: mxc.c:936
struct nand_flash_controller imx31_nand_flash_controller
Definition: mx3.c:694
int(* nand_driver_walker_t)(struct nand_flash_controller *c, void *)
Signature for callback functions passed to nand_driver_walk.
Definition: nand/driver.h:81
struct nand_flash_controller s3c6400_nand_controller
Definition: s3c6400.c:47
struct nand_flash_controller s3c2443_nand_controller
Definition: s3c2443.c:50
Upper level NOR flash interfaces.
Interface for NAND flash controllers.
Definition: nand/driver.h:23
const char * name
Driver name that is used to select it from configuration files.
Definition: nand/driver.h:25
#define NULL
Definition: usb.h:16