OpenOCD
flash/nand/driver.c
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Dominic Rath <Dominic.Rath@gmx.de> *
3  * Copyright (C) 2007,2008 √ėyvind Harboe <oyvind.harboe@zylin.com> *
4  * Copyright (C) 2008 by Spencer Oliver <spen@spen-soft.co.uk> *
5  * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  ***************************************************************************/
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 #include "core.h"
25 #include "driver.h"
26 
27 /* NAND flash controller
28  */
43 
44 /* extern struct nand_flash_controller boundary_scan_nand_controller; */
45 
61 /* &boundary_scan_nand_controller, */
62  NULL
63 };
64 
66 {
67  for (unsigned i = 0; nand_flash_controllers[i]; i++) {
68  struct nand_flash_controller *controller = nand_flash_controllers[i];
69  if (strcmp(name, controller->name) == 0)
70  return controller;
71  }
72  return NULL;
73 }
75 {
76  for (unsigned i = 0; nand_flash_controllers[i]; i++) {
77  int retval = (*f)(nand_flash_controllers[i], x);
78  if (ERROR_OK != retval)
79  return retval;
80  }
81  return ERROR_OK;
82 }
struct nand_flash_controller at91sam9_nand_controller
Structure representing the AT91SAM9 NAND controller.
Definition: at91sam9.c:707
Interface for NAND flash controllers.
const char * name
Definition: armv4_5.c:78
struct nand_flash_controller s3c2440_nand_controller
Definition: s3c2440.c:152
struct nand_flash_controller s3c2443_nand_controller
Definition: s3c2443.c:61
const char * name
Driver name that is used to select it from configuration files.
struct nand_flash_controller s3c2410_nand_controller
Definition: s3c2410.c:104
struct nand_flash_controller nonce_nand_controller
Definition: nonce.c:62
struct nand_flash_controller lpc3180_nand_controller
Definition: lpc3180.c:1346
static struct nand_flash_controller * nand_flash_controllers[]
struct nand_flash_controller s3c2412_nand_controller
Definition: s3c2412.c:61
struct nand_flash_controller imx31_nand_flash_controller
Definition: mx3.c:707
struct nand_flash_controller s3c6400_nand_controller
Definition: s3c6400.c:58
struct nand_flash_controller orion_nand_controller
Definition: orion.c:150
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 mxc_nand_flash_controller
Definition: mxc.c:947
struct nand_flash_controller lpc32xx_nand_controller
Definition: lpc32xx.c:1808
#define ERROR_OK
Definition: log.h:144
int(* nand_driver_walker_t)(struct nand_flash_controller *c, void *)
Signature for callback functions passed to nand_driver_walk.
struct nand_flash_controller nuc910_nand_controller
Definition: nuc910.c:215
struct nand_flash_controller davinci_nand_controller
Definition: davinci.c:778
#define NULL
Definition: usb.h:27
struct nand_flash_controller * nand_driver_find_by_name(const char *name)
Find a NAND flash controller by name.