mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-19 12:51:23 +02:00
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
50 lines
929 B
C
50 lines
929 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2016 Freescale Semiconductor, Inc.
|
|
* Copyright 2018 NXP
|
|
*
|
|
*/
|
|
#include <common.h>
|
|
#include <linux/errno.h>
|
|
#include <asm/io.h>
|
|
#include <env.h>
|
|
#include <command.h>
|
|
#include <stdbool.h>
|
|
#include <mmc.h>
|
|
|
|
static int check_mmc_autodetect(void)
|
|
{
|
|
char *autodetect_str = env_get("mmcautodetect");
|
|
|
|
if ((autodetect_str) && (strcmp(autodetect_str, "yes") == 0))
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
|
|
/* This should be defined for each board */
|
|
__weak int mmc_map_to_kernel_blk(int dev_no)
|
|
{
|
|
return dev_no;
|
|
}
|
|
|
|
void board_late_mmc_env_init(void)
|
|
{
|
|
char cmd[32];
|
|
char mmcblk[32];
|
|
u32 dev_no = mmc_get_env_dev();
|
|
|
|
if (!check_mmc_autodetect())
|
|
return;
|
|
|
|
env_set_ulong("mmcdev", dev_no);
|
|
|
|
/* Set mmcblk env */
|
|
sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
|
|
mmc_map_to_kernel_blk(dev_no));
|
|
env_set("mmcroot", mmcblk);
|
|
|
|
sprintf(cmd, "mmc dev %d", dev_no);
|
|
run_command(cmd, 0);
|
|
}
|