嗨,大家好,上周开始做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的引脚复用位置在哪里呢?谢谢!