1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
5 ***************************************************************************/
14 static int nonce_nand_command(struct nand_device *nand, uint8_t command)
18 static int nonce_nand_address(struct nand_device *nand, uint8_t address)
22 static int nonce_nand_read(struct nand_device *nand, void *data)
26 static int nonce_nand_write(struct nand_device *nand, uint16_t data)
30 static int nonce_nand_fast_block_write(struct nand_device *nand,
31 uint8_t *data, int size)
36 static int nonce_nand_reset(struct nand_device *nand)
38 return nonce_nand_command(nand, NAND_CMD_RESET);
41 NAND_DEVICE_COMMAND_HANDLER(nonce_nand_device_command)
46 static int nonce_nand_init(struct nand_device *nand)
51 struct nand_flash_controller nonce_nand_controller = {
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,