From: Chanho Park Date: Wed, 18 Apr 2018 11:05:49 +0000 (+0900) Subject: board: nexell: artik711s: choose sdcard/clipper1 by bootmode X-Git-Tag: submit/tizen/20190213.074817~98 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f766878e390d7ee1a361c792071330592fd33c7;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik7.git board: nexell: artik711s: choose sdcard/clipper1 by bootmode The sdcard of artik711s raptor board is muxed with the ccir1 camera. It can be switched by jumper select but there is no way to control the jumper by S/W. Thus, we decided to switch them according to boot mode. When a board is turned on eMMC boot mode, - sdcard: disable - clipper1: enable otherwise, - sdcard: enable - clipper1: disable Change-Id: I0ef9674b8865d943394a27a8aba5c80fe30994ed Signed-off-by: Chanho Park --- diff --git a/board/nexell/s5p6818/artik711s_raptor/board.c b/board/nexell/s5p6818/artik711s_raptor/board.c index ac253d729e..8fb54f83a6 100644 --- a/board/nexell/s5p6818/artik711s_raptor/board.c +++ b/board/nexell/s5p6818/artik711s_raptor/board.c @@ -119,6 +119,48 @@ int mmc_get_env_dev(void) return -1; } +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +int ft_board_setup(void *blob, bd_t *bd) +{ + int rc; + int boot_dev = mmc_get_env_dev(); + const char *okay = "okay"; + const char *disabled = "disabled"; + char *sdcard_status, *clipper1_status; + + if (boot_dev == 0) { + /* eMMC boot, let's disable sdcard and enable clipper1 */ + sdcard_status = disabled; + clipper1_status = okay; + } else if (boot_dev == 1) { + /* SDCard boot, let's enable sdcard and disable clipper1 */ + sdcard_status = okay; + clipper1_status = disabled; + } else { + return 0; + } + + rc = fdt_find_and_setprop(blob, "/soc/dw_mmc@c0062000", "status", + sdcard_status, strlen(sdcard_status) + 1, 1); + if (rc) { + printf("Unable to update property status of sdcard,err=%s\n", + fdt_strerror(rc)); + return rc; + } + + rc = fdt_find_and_setprop(blob, "/soc/clipper1@c0064000", "status", + clipper1_status, strlen(clipper1_status) + 1, + 1); + if (rc) { + printf("Unable to update property status of clipper1,err=%s\n", + fdt_strerror(rc)); + return rc; + } + + return 0; +} +#endif + int board_init(void) { #ifdef CONFIG_REVISION_TAG