blob: 4ec276497634c1d206b00b65c8d9172e7aeea91d [file] [log] [blame]
Weijie Gao361e13f2018-11-15 10:07:53 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2018 MediaTek Inc.
4 */
5
6#include <common.h>
7
8DECLARE_GLOBAL_DATA_PTR;
9
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}
Frank Wunderlichf3af98e2019-01-15 18:49:06 +010017
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
32int mmc_get_env_dev(void)
33{
34 return mmc_get_boot_dev();
35}