TI中文支持网
TI专业的中文技术问题搜集分享网站

am335x mmc0启动遇到问题

嗨,大家好,上周开始做335x的开发,于是我从Ti官网下载ti-processor-sdk-linux-am335x-evm-05.03.00.07-Linux-x86-Install.bin进行安装,编译。uboot版本是2018的版本。待编译完毕后,我制作卡启动(mmc0),启动信息如下:

Boot SPL 2018.01-00569-g7b4e473-dirty (Aug 14 2019 – 00:57:33)
Trying to boot from MMC1
*** Warning – bad CRC, using default environment

U-Boot 2018.01-00569-g7b4e473-dirty (Aug 14 2019 – 00:57:33 +0800)

CPU : AM335X-GP rev 2.1
Model: TI AM335x EVM
DRAM: 256 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0
** Bad device mmc 0 **
Using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net: wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout

…………………………

wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
wait_for_user_access Timeout
cpsw, usb_ether
Hit any key to stop autoboot: 0=>

看提示是遇到了一个错误,mmc0有问题。我运行以下命令:

=>=> mmc dev 0=>=> mmc info=>=>=> mmc list
OMAP SD/MMC: 0
=>

得到的似乎都是空操作,并没有实际的硬件信息。不知道是哪里出现了问题。

uboot的引脚复用以及设备树信息如下:

mux.c (board\ti\am335x)

static struct module_pin_mux mmc0_pin_mux[] = {                         (SDK源码)
{OFFSET(mmc0_dat3), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT3 */
{OFFSET(mmc0_dat2), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT2 */
{OFFSET(mmc0_dat1), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT1 */
{OFFSET(mmc0_dat0), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_DAT0 */
{OFFSET(mmc0_clk), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CLK */
{OFFSET(mmc0_cmd), (MODE(0) | RXACTIVE | PULLUP_EN)}, /* MMC0_CMD */
{OFFSET(mcasp0_aclkr), (MODE(4) | RXACTIVE)}, /* MMC0_WP */
{OFFSET(spi0_cs1), (MODE(7) | RXACTIVE | PULLUP_EN)}, /* GPIO0_6 */
{-1},
};

void enable_board_pin_mux(void)          (SDK源码)
{
/* Do board-specific muxes. */
if (board_is_bone()) {
/* Beaglebone pinmux */
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);
#if defined(CONFIG_NAND)
configure_module_pin_mux(nand_pin_mux);
#elif defined(CONFIG_NOR)
configure_module_pin_mux(bone_norcape_pin_mux);
#else
configure_module_pin_mux(mmc1_pin_mux);
#endif
} else if (board_is_gp_evm()) {
/* General Purpose EVM */
unsigned short profile = detect_daughter_board_profile();
configure_module_pin_mux(rgmii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);
/* In profile #2 i2c1 and spi0 conflict. */
if (profile & ~PROFILE_2)
configure_module_pin_mux(i2c1_pin_mux);
/* Profiles 2 & 3 don't have NAND */
#ifdef CONFIG_NAND
if (profile & ~(PROFILE_2 | PROFILE_3))
configure_module_pin_mux(nand_pin_mux);
#endif
else if (profile == PROFILE_2) {
configure_module_pin_mux(mmc1_pin_mux);
configure_module_pin_mux(spi0_pin_mux);
}
} else if (board_is_idk()) {
/* Industrial Motor Control (IDK) */
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_no_cd_pin_mux);
} else if (board_is_evm_sk()) {
/* Starter Kit EVM */
configure_module_pin_mux(i2c1_pin_mux);
configure_module_pin_mux(gpio0_7_pin_mux);
configure_module_pin_mux(rgmii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux_sk_evm);
} else if (board_is_bone_lt()) {
/* Beaglebone LT pinmux */
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);
#if defined(CONFIG_NAND) && defined(CONFIG_EMMC_BOOT)
configure_module_pin_mux(nand_pin_mux);
#elif defined(CONFIG_NOR) && defined(CONFIG_EMMC_BOOT)
configure_module_pin_mux(bone_norcape_pin_mux);
#else
configure_module_pin_mux(mmc1_pin_mux);
#endif
}………………….

am335x-evm.dts (arch\arm\dts)

mmc1_pins: pinmux_mmc1_pins {
pinctrl-single,pins = <
0x160 (PIN_INPUT | MUX_MODE5) /* spi0_cs1.gpio0_6 */
>;
};

&mmc1 {
status = "okay";
vmmc-supply = <&vmmc_reg>;
bus-width = <4>;
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};

以上都是源码,我没有动过,但是不知道为什么会出现启动log里的错误打印,请大家给看下问题,谢谢!

另外,出于对技术的探索,这个uboot让我觉的很奇怪的一个问题是我找不到pin复用的位置,mux.c文件里我屏蔽掉mmc0_pin_mux[]数组,经过测试打印log跟之前是一样的,那是不是可以说mux.c里的复用其实是无效的???am335x-evm.dts设备树中的mmc0描述又只有一个cd引脚,所以我对此感到很困惑,请大神点播mmc0的引脚复用位置在哪里呢?谢谢!

user3779978:

我是来回答问题的,刚才把所有的cd引脚试了一下,终于试出来了(目前手上的板子我没有原理图,哭…….)。其中有一个是好的。mmc0可以正常操作了。
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=> mmc info
Device: OMAP SD/MMC
Manufacturer ID: 3
OEM: 5344
Name: SL08G
Bus Speed: 48000000
Mode : SD High Speed (50MHz)
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
=> mmc list
OMAP SD/MMC: 0 (SD)
=> fatls mmc 0110272MLO646972u-boot.img

2 file(s), 0 dir(s)

=>

但是帖子上最后问的问题不变,这个牵扯到后面二次开发了,望大神还是给解答下,谢谢哈!

Shine:

回复 user3779978:

试试把设备树里mmc0node去掉。

user3779978:

回复 Shine:

嗨,你好!

我做了测试,将uboot-2018中的mmc0设备树更改为如下:

&mmc1 { status = "disabled"; vmmc-supply = <&vmmc_reg>; bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; cd-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;};

得到了最开始的bug log,在uboot阶段(指SPL接下来的那一阶段)检测不到mmc0,打印如下:

-Boot SPL 2018.01-00570-g86571bd-dirty (Aug 16 2019 – 09:39:40)Trying to boot from MMC1*** Warning – bad CRC, using default environment

U-Boot 2018.01-00570-g86571bd-dirty (Aug 16 2019 – 09:39:40 +0800)

CPU : AM335X-GP rev 2.1Model: TI AM335x EVMDRAM: 256 MiBNAND: 0 MiBMMC: MMC Device 0 not found** Bad device mmc 0 **Using default environment

<ethaddr> not set. Validating first E-fuse MACNet: PHY reset timed outcpsw, usb_etherHit any key to stop autoboot: 0 =>

可以得出结论,关于uboot里的引脚复用,uboot的am335x-evm.dts设备树文件确实是起作用的。但是我在设备树里只看到了cd引脚的复用,并没有看到mmc0接口其它引脚的复用,请问你知道它的复用是在哪里设置的吗?还有SPL阶段的mmc0的引脚又是在哪设置的呢?

Shine:

回复 user3779978:

请看下面的帖子,mmc0应该是要在device tree里配置的。
e2e.ti.com/…/2457695

yongqing wang:

回复 user3779978:

以前编译过AM335X的系统吗?可以从编译Beaglebone 系统开始,并在这个板子试试熟悉一下套路,排除自己自己硬件的问题

赞(0)
未经允许不得转载:TI中文支持网 » am335x mmc0启动遇到问题
分享到: 更多 (0)