Weijie Gao | 361e13f | 2018-11-15 10:07:53 +0800 | [diff] [blame] | 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 | |
| 10 | int 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 Wunderlich | f3af98e | 2019-01-15 18:49:06 +0100 | [diff] [blame] | 17 | |
| 18 | int 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 | |
| 32 | int mmc_get_env_dev(void) |
| 33 | { |
| 34 | return mmc_get_boot_dev(); |
| 35 | } |