db908686d9aa41e6595552cb306e5819d352e102
[fw/openocd] / src / flash / nand / nonce.c
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
51 struct nand_flash_controller nonce_nand_controller = {
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 };