X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fnand.h;h=93cbe1e25db9eb2bf3e1a8c7ec7dececd971d7e4;hb=915f15ac5746739da0aa2ee2840c2d00dc65aaaa;hp=b6eb223fb6f3c34786e7f9af7415d14e41476656;hpb=499a950d41879020a186627874cf7aa856112ca5;p=oweals%2Fu-boot.git diff --git a/include/nand.h b/include/nand.h index b6eb223fb6..93cbe1e25d 100644 --- a/include/nand.h +++ b/include/nand.h @@ -1,9 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * (C) Copyright 2005 * 2N Telekomunikace, a.s. * Ladislav Michl - * - * SPDX-License-Identifier: GPL-2.0 */ #ifndef _NAND_H_ @@ -28,10 +27,11 @@ #endif extern void nand_init(void); +unsigned long nand_size(void); #include #include -#include +#include int nand_mtd_to_devnum(struct mtd_info *mtd); @@ -43,7 +43,6 @@ extern int board_nand_init(struct nand_chip *nand); #endif extern int nand_curr_device; -extern struct mtd_info *nand_info[]; static inline int nand_read(struct mtd_info *info, loff_t ofs, size_t *len, u_char *buf) @@ -131,8 +130,6 @@ void board_nand_select_device(struct nand_chip *nand, int chip); __attribute__((noreturn)) void nand_boot(void); -#endif - #ifdef CONFIG_ENV_OFFSET_OOB #define ENV_OOB_MARKER 0x30425645 /*"EVB0" in little-endian -- offset is stored as block number*/ @@ -145,3 +142,14 @@ int spl_nand_erase_one(int block, int page); /* platform specific init functions */ void sunxi_nand_init(void); + +/* + * get_nand_dev_by_index - Get the nand info based in index. + * + * @dev - index to the nand device. + * + * returns pointer to the nand device info structure or NULL on failure. + */ +struct mtd_info *get_nand_dev_by_index(int dev); + +#endif /* _NAND_H_ */