lede/target/linux/meson/patches-6.1/903-add-dts-and-identify-emmc.patch
shiyu1314 597b88e925
meson: bump to 6.1 kernel, drop mesongx (#11570)
Make it into a direct brush package, making it convenient for software to brush into EMMC without the need for SD or USB drive

u-boot: https://github.com/shiyu1314/u-boot-onecloud/releases

SD firmware conversion to direct flash firmware: https://github.com/shiyu1314/openwrt-onecloud

Signed-off-by: Li Xueli <1052672227@qq.com>
2023-10-05 22:00:36 +08:00

59 lines
1.7 KiB
Diff

--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -402,6 +402,7 @@ dtb-$(CONFIG_MACH_MESON8) += \
meson8b-ec100.dtb \
meson8b-mxq.dtb \
meson8b-odroidc1.dtb \
+ meson8b-onecloud.dtb \
meson8m2-mxiii-plus.dtb
dtb-$(CONFIG_ARCH_MMP) += \
pxa168-aspenite.dtb \
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1396,12 +1396,13 @@ static int mmc_select_hs400es(struct mmc
* SEND_STATUS reliably at the initial frequency.
*/
mmc_set_timing(host, MMC_TIMING_MMC_HS);
- mmc_set_bus_speed(card);
err = mmc_switch_status(card, true);
if (err)
goto out_err;
+ mmc_set_clock(host, card->ext_csd.hs_max_dtr);
+
/* Switch card to DDR with strobe bit */
val = EXT_CSD_DDR_BUS_WIDTH_8 | EXT_CSD_BUS_WIDTH_STROBE;
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
@@ -1459,7 +1460,7 @@ out_err:
static int mmc_select_hs200(struct mmc_card *card)
{
struct mmc_host *host = card->host;
- unsigned int old_timing, old_signal_voltage, old_clock;
+ unsigned int old_timing, old_signal_voltage;
int err = -EINVAL;
u8 val;
@@ -1498,9 +1499,7 @@ static int mmc_select_hs200(struct mmc_c
* successfully switched over.
*/
old_timing = host->ios.timing;
- old_clock = host->ios.clock;
mmc_set_timing(host, MMC_TIMING_MMC_HS200);
- mmc_set_clock(card->host, card->ext_csd.hs_max_dtr);
/*
* For HS200, CRC errors are not a reliable way to know the
@@ -1513,10 +1512,8 @@ static int mmc_select_hs200(struct mmc_c
* mmc_select_timing() assumes timing has not changed if
* it is a switch error.
*/
- if (err == -EBADMSG) {
- mmc_set_clock(host, old_clock);
+ if (err == -EBADMSG)
mmc_set_timing(host, old_timing);
- }
}
err:
if (err) {