[BUG] U-boot does not detect emmc card in odroid-c2 for newer U-boot as 2020.04
Otto Meier
gf435 at gmx.net
Thu Nov 26 11:51:56 CET 2020
Hi
Am 26.11.20 um 04:13 schrieb Jaehoon Chung:
> Hi,
>
> On 11/19/20 11:39 PM, Otto Meier wrote:
>> Hi,
>>
>> with these modifications i get:
>>
>> U-Boot 2021.01-rc2-00047-g9324c9a823-dirty (Nov 19 2020 - 15:33:00 +0100) odroid-c2
>>
>> Model: Hardkernel ODROID-C2
>> SoC: Amlogic Meson GXBB (S905) Revision 1f:c (0:1)
>> DRAM: 2 GiB
>> MMC: mmc at 72000: 0, mmc at 74000: 1
>> In: serial
>> Out: serial
>> Err: serial
>> Net: Could not get PHY for ethernet at c9410000: addr -1
>> No ethernet found.
>>
>> Hit any key to stop autoboot: 0
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2000
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = cdff0000
>> MESON EMMC status = 01ff2800
>> meson_dm_mmc_send_cmd[226]
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2800
>> meson_dm_mmc_send_cmd[226]
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2000
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = cdff0000
>> MESON EMMC status = 01ff2800
>> meson_dm_mmc_send_cmd[226]
>> Card did not respond to voltage select! : -110
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2000
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = cdff0000
>> MESON EMMC status = 01ff2800
>> meson_dm_mmc_send_cmd[226]
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2800
>> meson_dm_mmc_send_cmd[226]
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2000
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 00ff2000
>> MESON EMMC status = c5ff0000
>> MESON EMMC status = 01ff2800
>> meson_dm_mmc_send_cmd[226]
>> Card did not respond to voltage select! : -110
>> MMC Device 2 not found
>> no mmc device at slot 2
>> starting USB...
>>
>> Hope this shed more light on the issue.
>
> Sorry for late. Did you check more? or Is its status same?
> If my understanding is correct, it seems that it's working fine with SD-card, right?
> When i have checked its register value, resp timeout bit[11] is set. Adnd Bus_fsm is 1100.
> I don't know what mean bus_fsm(0x1100)..
> According to my understanding, resp_timeout value can be increased with cmd's argument.
> Current u-boot is set to 4s. but maximum timeout value is 32.768s.
>
> But i don't think that it's not affected with your target.. Because you mentioned that v2020.04 u-boot is working.
> So i'm checking what is different to u-boot v2020.04.
>
> Best Regards,
> Jaehoon Chung
>
>>
>> Best regards
>>
>> Am 19.11.20 um 12:50 schrieb Jaehoon Chung:
>>> Hi,
>
>
Yes i have tried different things: i have tried uboot-2020.07, 2020.10 all do not work. SO
it started with 2020.07. A diff between 2020.04 and 2020.07 in meson_gx_mmc.c gives
the following don´t know if it shows some point.
--- u-boot-2020.04/drivers/mmc/meson_gx_mmc.c 2020-11-21 20:42:01.768860866 +0100
+++ u-boot-2020.07/drivers/mmc/meson_gx_mmc.c 2020-07-06 21:22:53.000000000 +0200
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <clk.h>
#include <cpu_func.h>
#include <dm.h>
#include <fdtdec.h>
@@ -13,6 +14,7 @@
#include <asm/io.h>
#include <asm/gpio.h>
#include <asm/arch/sd_emmc.h>
+#include <linux/delay.h>
#include <linux/log2.h>
static inline void *get_regbase(const struct mmc *mmc)
@@ -198,7 +200,7 @@
status = meson_read(mmc, MESON_SD_EMMC_STATUS);
} while(!(status & STATUS_END_OF_CHAIN) && get_timer(start) < 10000);
- if (!(status & STATUS_END_OF_CHAIN))
+ if (!(status & STATUS_END_OF_CHAIN))
ret = -ETIMEDOUT;
else if (status & STATUS_RESP_TIMEOUT)
ret = -ETIMEDOUT;
@@ -241,12 +243,23 @@
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
struct mmc *mmc = &pdata->mmc;
struct mmc_config *cfg = &pdata->cfg;
+ struct clk_bulk clocks;
uint32_t val;
+ int ret;
+
#ifdef CONFIG_PWRSEQ
struct udevice *pwr_dev;
- int ret;
#endif
+ /* Enable the clocks feeding the MMC controller */
+ ret = clk_get_bulk(dev, &clocks);
+ if (ret)
+ return ret;
+
+ ret = clk_enable_bulk(&clocks);
+ if (ret)
+ return ret;
+
cfg->voltages = MMC_VDD_33_34 | MMC_VDD_32_33 |
MMC_VDD_31_32 | MMC_VDD_165_195;
cfg->host_caps = MMC_MODE_8BIT | MMC_MODE_4BIT |
---------------------------------
SD Card is working, i can boot to u-boot command line , insert
an SD card and get with u-Boot git:
U-Boot 2021.01-rc2-00136-gd361eafe82-dirty (Nov 24 2020 - 16:23:10 +0100) odroid-c2
Model: Hardkernel ODROID-C2
SoC: Amlogic Meson GXBB (S905) Revision 1f:c (0:1)
DRAM: 2 GiB
MMC: mmc at 72000: 0, mmc at 74000: 1
In: serial
Out: serial
Err: serial
Net: eth0: ethernet at c9410000
Hit any key to stop autoboot: 0
only with emmc i get :
=> mmc info
Card did not respond to voltage select!
=> mmc dev 1
Card did not respond to voltage select!
after inserting SD Card i get:
=> mmc info
Device: mmc at 72000
Manufacturer ID: 74
OEM: 4a60
Name: USDU1
Bus Speed: 50000000
Mode: SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 119.1 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
=> mmc dev 1
Card did not respond to voltage select!
=> mmc list
mmc at 72000: 0 (SD)
mmc at 74000: 1
=>
Any Idea where i can help further?
Best Regards
Otto
More information about the U-Boot
mailing list