OpenOCD
nonce.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
5  ***************************************************************************/
6 
7 #ifdef HAVE_CONFIG_H
8 #include "config.h"
9 #endif
10 
11 #include "imp.h"
12 #include "hello.h"
13 
14 static int nonce_nand_command(struct nand_device *nand, uint8_t command)
15 {
16  return ERROR_OK;
17 }
18 static int nonce_nand_address(struct nand_device *nand, uint8_t address)
19 {
20  return ERROR_OK;
21 }
22 static int nonce_nand_read(struct nand_device *nand, void *data)
23 {
24  return ERROR_OK;
25 }
26 static int nonce_nand_write(struct nand_device *nand, uint16_t data)
27 {
28  return ERROR_OK;
29 }
30 static int nonce_nand_fast_block_write(struct nand_device *nand,
31  uint8_t *data, int size)
32 {
33  return ERROR_OK;
34 }
35 
36 static int nonce_nand_reset(struct nand_device *nand)
37 {
38  return nonce_nand_command(nand, NAND_CMD_RESET);
39 }
40 
41 NAND_DEVICE_COMMAND_HANDLER(nonce_nand_device_command)
42 {
43  return ERROR_OK;
44 }
45 
46 static int nonce_nand_init(struct nand_device *nand)
47 {
48  return ERROR_OK;
49 }
50 
52  .name = "nonce",
53  .commands = hello_command_handlers,
54  .nand_device_command = &nonce_nand_device_command,
55  .init = &nonce_nand_init,
56  .reset = &nonce_nand_reset,
57  .command = &nonce_nand_command,
58  .address = &nonce_nand_address,
59  .read_data = &nonce_nand_read,
60  .write_data = &nonce_nand_write,
61  .write_block_data = &nonce_nand_fast_block_write,
62 };
const struct command_registration hello_command_handlers[]
Export the registration for the hello command group, so it can be embedded in example drivers.
Definition: hello.c:86
#define ERROR_OK
Definition: log.h:164
@ NAND_CMD_RESET
Definition: nand/core.h:152
static int nonce_nand_fast_block_write(struct nand_device *nand, uint8_t *data, int size)
Definition: nonce.c:30
static int nonce_nand_address(struct nand_device *nand, uint8_t address)
Definition: nonce.c:18
static int nonce_nand_reset(struct nand_device *nand)
Definition: nonce.c:36
static int nonce_nand_write(struct nand_device *nand, uint16_t data)
Definition: nonce.c:26
struct nand_flash_controller nonce_nand_controller
Definition: nonce.c:51
static int nonce_nand_read(struct nand_device *nand, void *data)
Definition: nonce.c:22
static int nonce_nand_init(struct nand_device *nand)
Definition: nonce.c:46
NAND_DEVICE_COMMAND_HANDLER(nonce_nand_device_command)
Definition: nonce.c:41
static int nonce_nand_command(struct nand_device *nand, uint8_t command)
Definition: nonce.c:14
size_t size
Size of the control block search area.
Definition: rtt/rtt.c:30
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