mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
arm: mach-k3: am642: Use mmc start and stop callbacks
To avoid any glitches on MMC clock line, make use of pm per and post callbacks when loading sysfw. Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
This commit is contained in:
parent
d2edabfa8d
commit
f4686c3d5b
|
@ -19,6 +19,7 @@
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <dm/uclass-internal.h>
|
#include <dm/uclass-internal.h>
|
||||||
#include <dm/pinctrl.h>
|
#include <dm/pinctrl.h>
|
||||||
|
#include <mmc.h>
|
||||||
|
|
||||||
#if defined(CONFIG_SPL_BUILD)
|
#if defined(CONFIG_SPL_BUILD)
|
||||||
|
|
||||||
|
@ -51,6 +52,36 @@ static void store_boot_info_from_rom(void)
|
||||||
sizeof(struct rom_extended_boot_data));
|
sizeof(struct rom_extended_boot_data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_K3_LOAD_SYSFW) && CONFIG_IS_ENABLED(DM_MMC)
|
||||||
|
void k3_mmc_stop_clock(void)
|
||||||
|
{
|
||||||
|
if (spl_boot_device() == BOOT_DEVICE_MMC1) {
|
||||||
|
struct mmc *mmc = find_mmc_device(0);
|
||||||
|
|
||||||
|
if (!mmc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mmc->saved_clock = mmc->clock;
|
||||||
|
mmc_set_clock(mmc, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void k3_mmc_restart_clock(void)
|
||||||
|
{
|
||||||
|
if (spl_boot_device() == BOOT_DEVICE_MMC1) {
|
||||||
|
struct mmc *mmc = find_mmc_device(0);
|
||||||
|
|
||||||
|
if (!mmc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mmc_set_clock(mmc, mmc->saved_clock, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void k3_mmc_stop_clock(void) {}
|
||||||
|
void k3_mmc_restart_clock(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
void board_init_f(ulong dummy)
|
void board_init_f(ulong dummy)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_K3_LOAD_SYSFW)
|
#if defined(CONFIG_K3_LOAD_SYSFW)
|
||||||
|
@ -94,7 +125,8 @@ void board_init_f(ulong dummy)
|
||||||
* system firmware and if so, will only perform needed config
|
* system firmware and if so, will only perform needed config
|
||||||
* and not attempt to load firmware again.
|
* and not attempt to load firmware again.
|
||||||
*/
|
*/
|
||||||
k3_sysfw_loader(is_rom_loaded_sysfw(&bootdata), NULL, NULL);
|
k3_sysfw_loader(is_rom_loaded_sysfw(&bootdata), k3_mmc_stop_clock,
|
||||||
|
k3_mmc_restart_clock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Output System Firmware version info */
|
/* Output System Firmware version info */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user