From mboxrd@z Thu Jan 1 00:00:00 1970 From: Faiz Abbas Date: Wed, 29 Jan 2020 19:33:04 +0530 Subject: [PATCH v2 08/10] arm: K3: sysfw-loader: Add a config_pm_pre_callback() In-Reply-To: References: <20200124115252.15712-1-faiz_abbas@ti.com> <20200124115252.15712-9-faiz_abbas@ti.com> Message-ID: <1bfbe332-f6e9-c5a9-8efc-935c094e1299@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 29/01/20 5:00 am, Jaehoon Chung wrote: > On 1/24/20 8:52 PM, Faiz Abbas wrote: >> System firmware does not guarantee that clocks going out of the device >> will be stable during power management configuration. There are some >> DCRC errors when SPL tries to get the next stage during eMMC boot after >> sysfw pm configuration. >> >> Therefore add a config_pm_pre_callback() to switch off the eMMC clock >> before power management and restart it after it is done. >> >> Signed-off-by: Faiz Abbas >> Signed-off-by: Lokesh Vutla >> --- >> >> +#if defined(CONFIG_K3_LOAD_SYSFW) >> +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); > > Use MMC_CLK_DISABLE instead of true. Ok. > >> + } >> +} >> + >> +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); > > ditto. Ok. Thanks, Faiz