• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef __SUNXI_PANICPART_H
4 #define __SUNXI_PANICPART_H
5 
6 #include <linux/types.h>
7 
8 enum sunxi_flash {
9 	SUNXI_FLASH_ERROR = 0,
10 	SUNXI_FLASH_MMC,
11 	SUNXI_FLASH_NAND,
12 	SUNXI_FLASH_NOR,
13 };
14 
15 struct panic_part {
16 	enum sunxi_flash type;
17 	const char *bdev;
18 	size_t start_sect;
19 	size_t sects;
20 
21 	ssize_t (*panic_read)(struct panic_part *part, loff_t sec_off,
22 			size_t sec_cnt, char *buf);
23 	ssize_t (*panic_write)(struct panic_part *part, loff_t sec_off,
24 			size_t sec_cnt, const char *buf);
25 
26 	void *private;
27 };
28 
29 #if IS_ENABLED(CONFIG_SUNXI_PANICPART)
30 extern int sunxi_panicpart_init(struct panic_part *part);
31 extern int sunxi_parse_blkdev(char *bdev, int len);
32 #else
33 /*
34  *static int sunxi_panicpart_init(struct panic_part *part)
35  *{
36  *    return -1;
37  *}
38  *
39  *static int sunxi_parse_blkdev(char *bdev, int len)
40  *{
41  *    return -1;
42  *}
43  */
44 #endif
45 
46 #endif
47