1 /* SPDX-License-Identifier: GPL-2.0 */ 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 2 /* 3 * Copyright © 2000-2010 David Woodhouse <dw 3 * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> 4 * Steven J. Hill <sjhi 4 * Steven J. Hill <sjhill@realitydiluted.com> 5 * Thomas Gleixner <tgl 5 * Thomas Gleixner <tglx@linutronix.de> 6 * 6 * 7 * Contains all platform NAND related definiti 7 * Contains all platform NAND related definitions. 8 */ 8 */ 9 9 10 #ifndef __LINUX_MTD_PLATNAND_H 10 #ifndef __LINUX_MTD_PLATNAND_H 11 #define __LINUX_MTD_PLATNAND_H 11 #define __LINUX_MTD_PLATNAND_H 12 12 13 #include <linux/mtd/partitions.h> 13 #include <linux/mtd/partitions.h> 14 #include <linux/mtd/rawnand.h> 14 #include <linux/mtd/rawnand.h> 15 #include <linux/platform_device.h> 15 #include <linux/platform_device.h> 16 16 17 /** 17 /** 18 * struct platform_nand_chip - chip level devi 18 * struct platform_nand_chip - chip level device structure 19 * @nr_chips: max. number of chips to scan for 19 * @nr_chips: max. number of chips to scan for 20 * @chip_offset: chip number offset 20 * @chip_offset: chip number offset 21 * @nr_partitions: number of partitions pointe 21 * @nr_partitions: number of partitions pointed to by partitions (or zero) 22 * @partitions: mtd partition list 22 * @partitions: mtd partition list 23 * @chip_delay: R/B delay value in us 23 * @chip_delay: R/B delay value in us 24 * @options: Option flags, e.g. 16bit buswidth 24 * @options: Option flags, e.g. 16bit buswidth 25 * @bbt_options: BBT option flags, e.g. NAND_B 25 * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH 26 * @part_probe_types: NULL-terminated array of 26 * @part_probe_types: NULL-terminated array of probe types 27 */ 27 */ 28 struct platform_nand_chip { 28 struct platform_nand_chip { 29 int nr_chips; 29 int nr_chips; 30 int chip_offset; 30 int chip_offset; 31 int nr_partitions; 31 int nr_partitions; 32 struct mtd_partition *partitions; 32 struct mtd_partition *partitions; 33 int chip_delay; 33 int chip_delay; 34 unsigned int options; 34 unsigned int options; 35 unsigned int bbt_options; 35 unsigned int bbt_options; 36 const char **part_probe_types; 36 const char **part_probe_types; 37 }; 37 }; 38 38 39 /** 39 /** 40 * struct platform_nand_ctrl - controller leve 40 * struct platform_nand_ctrl - controller level device structure 41 * @probe: platform specific function to probe 41 * @probe: platform specific function to probe/setup hardware 42 * @remove: platform specific function to remo 42 * @remove: platform specific function to remove/teardown hardware 43 * @dev_ready: platform specific function to r 43 * @dev_ready: platform specific function to read ready/busy pin 44 * @select_chip: platform specific chip select 44 * @select_chip: platform specific chip select function 45 * @cmd_ctrl: platform specific function for c 45 * @cmd_ctrl: platform specific function for controlling 46 * ALE/CLE/nCE. Also used to write 46 * ALE/CLE/nCE. Also used to write command and address 47 * @write_buf: platform specific function for 47 * @write_buf: platform specific function for write buffer 48 * @read_buf: platform specific function for r 48 * @read_buf: platform specific function for read buffer 49 * @priv: private data to transport driver spe 49 * @priv: private data to transport driver specific settings 50 * 50 * 51 * All fields are optional and depend on the h 51 * All fields are optional and depend on the hardware driver requirements 52 */ 52 */ 53 struct platform_nand_ctrl { 53 struct platform_nand_ctrl { 54 int (*probe)(struct platform_device *p 54 int (*probe)(struct platform_device *pdev); 55 void (*remove)(struct platform_device 55 void (*remove)(struct platform_device *pdev); 56 int (*dev_ready)(struct nand_chip *chi 56 int (*dev_ready)(struct nand_chip *chip); 57 void (*select_chip)(struct nand_chip * 57 void (*select_chip)(struct nand_chip *chip, int cs); 58 void (*cmd_ctrl)(struct nand_chip *chi 58 void (*cmd_ctrl)(struct nand_chip *chip, int dat, unsigned int ctrl); 59 void (*write_buf)(struct nand_chip *ch 59 void (*write_buf)(struct nand_chip *chip, const uint8_t *buf, int len); 60 void (*read_buf)(struct nand_chip *chi 60 void (*read_buf)(struct nand_chip *chip, uint8_t *buf, int len); 61 void *priv; 61 void *priv; 62 }; 62 }; 63 63 64 /** 64 /** 65 * struct platform_nand_data - container struc 65 * struct platform_nand_data - container structure for platform-specific data 66 * @chip: chip level chip structure 66 * @chip: chip level chip structure 67 * @ctrl: controller level device structure 67 * @ctrl: controller level device structure 68 */ 68 */ 69 struct platform_nand_data { 69 struct platform_nand_data { 70 struct platform_nand_chip chip; 70 struct platform_nand_chip chip; 71 struct platform_nand_ctrl ctrl; 71 struct platform_nand_ctrl ctrl; 72 }; 72 }; 73 73 74 #endif /* __LINUX_MTD_PLATNAND_H */ 74 #endif /* __LINUX_MTD_PLATNAND_H */ 75 75
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.