From a937fd1682625b1f87b555e2af9117fcb2999d7c Mon Sep 17 00:00:00 2001 From: Igor Grinberg Date: Mon, 3 Nov 2014 11:32:18 +0200 Subject: compulab: refactor board revision handling Move board revision handling code to a common location for further reuse. Signed-off-by: Igor Grinberg Reviewed-by: Tom Rini --- board/compulab/common/common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 board/compulab/common/common.h (limited to 'board/compulab/common/common.h') diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h new file mode 100644 index 00000000000..316ee4c6cd6 --- /dev/null +++ b/board/compulab/common/common.h @@ -0,0 +1,14 @@ +/* + * (C) Copyright 2014 CompuLab, Ltd. + * + * Authors: Igor Grinberg + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _CL_COMMON_ +#define _CL_COMMON_ + +void cl_print_pcb_info(void); + +#endif /* _CL_COMMON_ */ -- cgit v1.2.3 From 959bc1d5fa83eab057f12cb5ef79bd37ec98eb83 Mon Sep 17 00:00:00 2001 From: Igor Grinberg Date: Mon, 3 Nov 2014 11:32:19 +0200 Subject: omap3: cm-t35: move the USB hub reset code Extract the USB hub reset code to a common location where it can be reused by other compulab boards. Signed-off-by: Igor Grinberg Reviewed-by: Tom Rini --- board/compulab/common/common.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'board/compulab/common/common.h') diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index 316ee4c6cd6..ffe1ef8174f 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -9,6 +9,19 @@ #ifndef _CL_COMMON_ #define _CL_COMMON_ +#include + void cl_print_pcb_info(void); +#ifdef CONFIG_CMD_USB +int cl_usb_hub_init(int gpio, const char *label); +void cl_usb_hub_deinit(int gpio); +#else /* !CONFIG_CMD_USB */ +static inline int cl_usb_hub_init(int gpio, const char *label) +{ + return -ENOSYS; +} +static inline void cl_usb_hub_deinit(int gpio) {} +#endif /* CONFIG_CMD_USB */ + #endif /* _CL_COMMON_ */ -- cgit v1.2.3 From f4a40f05f504407a036e2beee88ce17930d5d45c Mon Sep 17 00:00:00 2001 From: Igor Grinberg Date: Mon, 3 Nov 2014 11:32:20 +0200 Subject: omap3: cm-t35: extract the splash code from board The splash screen loading code can be reused by other compulab boards. For now extract it to a common location for further reuse. This also switches the splash code dependency from CONFIG_LCD to CONFIG_SPLASH_SCREEN as it should normally be. In addition this patch fixes the accidental dependency of the get_board_mem_timings() function on CONFIG_LCD, by just moving the splash code and leaving the above function intact. Signed-off-by: Igor Grinberg Reviewed-by: Tom Rini --- board/compulab/common/common.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'board/compulab/common/common.h') diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index ffe1ef8174f..7a106d6a24e 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -24,4 +24,13 @@ static inline int cl_usb_hub_init(int gpio, const char *label) static inline void cl_usb_hub_deinit(int gpio) {} #endif /* CONFIG_CMD_USB */ +#ifdef CONFIG_SPLASH_SCREEN +int cl_splash_screen_prepare(int nand_offset); +#else /* !CONFIG_SPLASH_SCREEN */ +static inline int cl_splash_screen_prepare(int nand_offset) +{ + return -ENOSYS; +} +#endif /* CONFIG_SPLASH_SCREEN */ + #endif /* _CL_COMMON_ */ -- cgit v1.2.3 From 9886c3d7a803f639b975f63397cc24a3307fa7b6 Mon Sep 17 00:00:00 2001 From: Igor Grinberg Date: Mon, 3 Nov 2014 11:32:21 +0200 Subject: omap3: cm-t35: move the SMC911x code Extract the SMC911x initialization code to a common location where it can be reused by other compulab omap3 based boards. Signed-off-by: Igor Grinberg Reviewed-by: Tom Rini --- board/compulab/common/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'board/compulab/common/common.h') diff --git a/board/compulab/common/common.h b/board/compulab/common/common.h index 7a106d6a24e..68ffb111dc3 100644 --- a/board/compulab/common/common.h +++ b/board/compulab/common/common.h @@ -33,4 +33,15 @@ static inline int cl_splash_screen_prepare(int nand_offset) } #endif /* CONFIG_SPLASH_SCREEN */ +#ifdef CONFIG_SMC911X +int cl_omap3_smc911x_init(int id, int cs, u32 base_addr, + int (*reset)(int), int rst_gpio); +#else /* !CONFIG_SMC911X */ +static inline int cl_omap3_smc911x_init(int id, int cs, u32 base_addr, + int (*reset)(int), int rst_gpio) +{ + return -ENOSYS; +} +#endif /* CONFIG_SMC911X */ + #endif /* _CL_COMMON_ */ -- cgit v1.2.3