]>
Commit | Line | Data |
---|---|---|
361e13f1 WG |
1 | // SPDX-License-Identifier: GPL-2.0 |
2 | /* | |
3 | * Copyright (C) 2018 MediaTek Inc. | |
4 | */ | |
5 | ||
d678a59d | 6 | #include <common.h> |
e3cc511e | 7 | #include <mmc.h> |
401d1c4f | 8 | #include <asm/global_data.h> |
361e13f1 WG |
9 | |
10 | DECLARE_GLOBAL_DATA_PTR; | |
11 | ||
12 | int board_init(void) | |
13 | { | |
14 | /* address of boot parameters */ | |
aa6e94de | 15 | gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100; |
361e13f1 WG |
16 | |
17 | return 0; | |
18 | } | |
f3af98ec | 19 | |
e3cc511e | 20 | #ifdef CONFIG_MMC |
f3af98ec FW |
21 | int mmc_get_boot_dev(void) |
22 | { | |
23 | int g_mmc_devid = -1; | |
24 | char *uflag = (char *)0x81DFFFF0; | |
e3cc511e DW |
25 | |
26 | if (!find_mmc_device(1)) | |
27 | return 0; | |
28 | ||
f3af98ec FW |
29 | if (strncmp(uflag,"eMMC",4)==0) { |
30 | g_mmc_devid = 0; | |
31 | printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid); | |
32 | } else { | |
33 | g_mmc_devid = 1; | |
34 | printf("Boot From SD(id:%d)\n\n", g_mmc_devid); | |
35 | } | |
36 | return g_mmc_devid; | |
37 | } | |
38 | ||
39 | int mmc_get_env_dev(void) | |
40 | { | |
41 | return mmc_get_boot_dev(); | |
42 | } | |
e3cc511e | 43 | #endif |