1 // SPDX-License-Identifier: GPL-2.0 2 /* 3 * Copyright (C) 2018 MediaTek Inc. 4 */ 5 6 #include <common.h> 7 8 DECLARE_GLOBAL_DATA_PTR; 9 board_init(void)10int board_init(void) 11 { 12 /* address of boot parameters */ 13 gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; 14 15 return 0; 16 } 17 mmc_get_boot_dev(void)18int mmc_get_boot_dev(void) 19 { 20 int g_mmc_devid = -1; 21 char *uflag = (char *)0x81DFFFF0; 22 if (strncmp(uflag,"eMMC",4)==0) { 23 g_mmc_devid = 0; 24 printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid); 25 } else { 26 g_mmc_devid = 1; 27 printf("Boot From SD(id:%d)\n\n", g_mmc_devid); 28 } 29 return g_mmc_devid; 30 } 31 mmc_get_env_dev(void)32int mmc_get_env_dev(void) 33 { 34 return mmc_get_boot_dev(); 35 } 36