xref: /rk3399_rockchip-uboot/board/compulab/common/common.h (revision 7e8d7f2ac2035efa04382bbeede1b4fbe1c66987)
1 /*
2  * (C) Copyright 2014 CompuLab, Ltd. <www.compulab.co.il>
3  *
4  * Authors: Igor Grinberg <grinberg@compulab.co.il>
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #ifndef _CL_COMMON_
10 #define _CL_COMMON_
11 
12 #include <asm/errno.h>
13 
14 void cl_print_pcb_info(void);
15 
16 #ifdef CONFIG_CMD_USB
17 int cl_usb_hub_init(int gpio, const char *label);
18 void cl_usb_hub_deinit(int gpio);
19 #else /* !CONFIG_CMD_USB */
20 static inline int cl_usb_hub_init(int gpio, const char *label)
21 {
22 	return -ENOSYS;
23 }
24 static inline void cl_usb_hub_deinit(int gpio) {}
25 #endif /* CONFIG_CMD_USB */
26 
27 enum splash_storage {
28 	SPLASH_STORAGE_NAND,
29 	SPLASH_STORAGE_SF,
30 };
31 
32 struct splash_location {
33 	char *name;
34 	enum splash_storage storage;
35 	u32 offset;	/* offset from start of storage */
36 };
37 
38 #ifdef CONFIG_SPLASH_SCREEN
39 int cl_splash_screen_prepare(struct splash_location *locations, uint size);
40 #else /* !CONFIG_SPLASH_SCREEN */
41 static inline int cl_splash_screen_prepare(struct splash_location *locations,
42 					   uint size)
43 {
44 	return -ENOSYS;
45 }
46 #endif /* CONFIG_SPLASH_SCREEN */
47 
48 #ifdef CONFIG_SMC911X
49 int cl_omap3_smc911x_init(int id, int cs, u32 base_addr,
50 			  int (*reset)(int), int rst_gpio);
51 #else /* !CONFIG_SMC911X */
52 static inline int cl_omap3_smc911x_init(int id, int cs, u32 base_addr,
53 					int (*reset)(int), int rst_gpio)
54 {
55 	return -ENOSYS;
56 }
57 #endif /* CONFIG_SMC911X */
58 
59 #endif /* _CL_COMMON_ */
60