xref: /rk3399_rockchip-uboot/drivers/rkflash/typedef.h (revision e7b5bb3cc9527752c2c01acb4325fc0721fb75aa)
1 /*
2  * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:	GPL-2.0
5  */
6 
7 #ifndef	__TYPE_DEF_H
8 #define	__TYPE_DEF_H
9 
10 #include <asm/types.h>
11 
12 #ifndef NULL
13 #define NULL	0
14 #endif
15 
16 #define OK	0
17 #define ERROR	(-1)
18 
19 #define FTL_ERROR	ERROR
20 #define FTL_OK		OK
21 #define FTL_NO_FLASH	-2
22 #define FTL_NO_IDB	-3
23 #define FTL_UNSUPPORTED_FLASH	-4
24 
25 #define FALSE		0
26 #define TRUE		(!FALSE)
27 
28 #define INVALID_UINT8	((u8)0xFF)
29 #define INVALID_UINT16	((u16)0xFFFF)
30 #define INVALID_UINT32	((u32)0xFFFFFFFFL)
31 
32 #define PRINT_E	pr_info
33 #define PRINT_I	pr_info
34 
35 void *ftl_malloc(int n_size);
36 void *ftl_memset(void *s, int c, unsigned int n);
37 void *ftl_memcpy(void *pv_to,
38 		 const void *pv_from,
39 		 unsigned int size);
40 void ftl_free(void *p);
41 void rknand_print_hex(char *s, void *buf, int width, int len);
42 
43 #endif  /*__TYPEDEF_H */
44