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 
16 /* NAND flash controller
17  */
32 
33 /* extern struct nand_flash_controller boundary_scan_nand_controller; */
34 
50 /* &boundary_scan_nand_controller, */
51  NULL
52 };
53 
55 {
56  for (unsigned i = 0; nand_flash_controllers[i]; i++) {
57  struct nand_flash_controller *controller = nand_flash_controllers[i];
58  if (strcmp(name, controller->name) == 0)
59  return controller;
60  }
61  return NULL;
62 }
64 {
65  for (unsigned i = 0; nand_flash_controllers[i]; i++) {
66  int retval = (*f)(nand_flash_controllers[i], x);
67  if (retval != ERROR_OK)
68  return retval;
69  }
70  return ERROR_OK;
71 }
const char * name
Definition: armv4_5.c:76
struct nand_flash_controller lpc32xx_nand_controller
Definition: lpc32xx.c:1797
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 at91sam9_nand_controller
Structure representing the AT91SAM9 NAND controller.
Definition: at91sam9.c:696
struct nand_flash_controller nonce_nand_controller
Definition: nonce.c:51
struct nand_flash_controller lpc3180_nand_controller
Definition: lpc3180.c:1335
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
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.
struct nand_flash_controller s3c6400_nand_controller
Definition: s3c6400.c:47
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.
struct nand_flash_controller s3c2443_nand_controller
Definition: s3c2443.c:50
#define ERROR_OK
Definition: log.h:155
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
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