首页 > 技术文章 > AM437xx trouble shoot

zjbfvfv 2022-01-03 19:02 原文

new:

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/919158/am4377-linux-boot-error-first-descriptor-is-not-a-primary-desc-on-0-1

 

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/601257/am4378-issues-booting-from-mmc0-interface/2219620?tisearch=e2e-sitesearch&keymatch=MMC0_CLK#2219620

//////////////////////////////

 

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/786189/am4378-u-boot-unable-to-read-mmc/2908863?tisearch=e2e-sitesearch&keymatch=MMC0_CLK#2908863

 

board/ti/common/board_detect.c

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/833334/am4376-linux-fails-to-boot-on-custom-board/3103835?tisearch=e2e-sitesearch&keymatch=MMC0_CLK#3103835

Please, add #define DEBUG  line in the very beginning of the <Processor SDK>/board-support/u-boot-<version>/include/configs/am43xx_evm.h file

manual.

https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_03_00_106/AM437X/linux/Foundational_Components_U-Boot.html#sd-emmc-or-usb-storage

 

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/773416/am5718-problem-booting-from-sd-card-on-mmc1

from YJ

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/829201/tmdsevm437x-how-to-enable-emmc-in-u-boot/3069934?tisearch=e2e-sitesearch&keymatch=omap_hsmmc_send_cmd%2525252525253A%25252525252520timedout%25252525252520waiting%25252525252520on%25252525252520cmd%25252525252520inhibit%25252525252520to%25252525252520clear#3069934

Flash tool & Pin Mux Tool

https://www.ti.com/tool/FLASHTOOL

https://www.ti.com/tool/PINMUXTOOL

MMC:

exactly same : https://e2e.ti.com/support/processors-group/processors/f/processors-forum/561835/linux-processor-sdk-am437x-am437x-u-boot-problem-when-booting-from-emmc

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/502342/u-boot-can-not-load-uboot-env-from-emmc-on-am5728-evm

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/761761/linux-am3354-bad-device-mmc-0?tisearch=e2e-sitesearch&keymatch=Bad%2520device%2520mmc%25200#

-----------------------------

https://www.kernel.org/doc/Documentation/devicetree/bindings/mmc/

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/817803/linux-dra756-dra756-custom-board-card-did-not-respond-to-voltage-select-mmc-no-card-present

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/560946/am335x-emmc-boot

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/518100/am437x-gp-evm-sysboot-settings-for-nand

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/761761/linux-am3354-bad-device-mmc-0?tisearch=e2e-sitesearch&keymatch=Bad%2520device%2520mmc%25200#

tftp

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1044029/processor-sdk-am64x-load-image-device-tree-from-u-boot-prompt/3890657?tisearch=e2e-sitesearch&keymatch=PROCESSOR-SDK-AM437X%25252520u-boot#3890657

U-boot manual.

https://software-dl.ti.com/processor-sdk-linux/esd/docs/06_01_00_08/linux/Foundational_Components_U-Boot.html

U-Boot SPL 2017.01-g7be313d (Aug 11 2020 - 20:04:29)
Trying to boot from MMC1
SPL: Please implement spl_start_uboot() for your board
SPL: Direct Linux boot not active!
reading u-boot.img
reading u-boot.img


U-Boot 2017.01 (Jan 03 2022 - 16:21:14 +0800)

CPU : AM437X-GP rev 1.2
DRAM: 512 MiB
Can't find PMIC:TPS65218_PMIC
NAND: 512 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - bad CRC, using default environment

Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit <SPACE> key to stop autoboot in 1s
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
** Bad device mmc 0 **
There is no valid bmp file at the given address
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
SD/MMC found on device 0
bad MBR sector signature 0x11aa
** Invalid partition 1 **
bad MBR sector signature 0x51aa
** Invalid partition 1 **
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
omap_hsmmc_send_cmd: timedout waiting on cmd inhibit to clear
SD/MMC found on device 0
** No partition table - mmc 0 **
Booting from nand ...

Device 0: nand0, sector size 256 KiB
Page size 4096 b
OOB size 224 b
Erase size 262144 b
subpagesize 1024 b
options 0x4000000c
bbt options 0x 0

NAND read: device 0 offset 0x200000, size 0x80000
524288 bytes read: OK

NAND read: device 0 offset 0x280000, size 0x400000
4194304 bytes read: OK
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found

USB device 0: unknown device

-----------------------

I think I might have solved the problem for the custom board I'm working on. I made changes to the pinmux for the eMMC in mux.c, I also added updated the u-boot device tree pinmux for the eMMC pins.

In /board/ti/am335x/mux.c, I added a new struct for the eMMC connections (which are the same as the Beaglebone black connections)

static struct module_pin_mux emmc_mmc1_pin_mux[] = {
{OFFSET(gpmc_ad7), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT7 */
{OFFSET(gpmc_ad6), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT6 */
{OFFSET(gpmc_ad5), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT5 */
{OFFSET(gpmc_ad4), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT4 */
{OFFSET(gpmc_ad3), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT3 */
{OFFSET(gpmc_ad2), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT2 */
{OFFSET(gpmc_ad1), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT1 */
{OFFSET(gpmc_ad0), (MODE(1) | RXACTIVE | PULLUP_EN)}, /* MMC1_DAT0 */
{OFFSET(gpmc_csn1), (MODE(2) | RXACTIVE | PULLUP_EN)}, /* MMC1_CLK */
{OFFSET(gpmc_csn2), (MODE(2) | RXACTIVE | PULLUP_EN)}, /* MMC1_CMD */
{OFFSET(gpmc_a4), (MODE(7) | RXACTIVE | PULLDOWN_EN)}, /* gpio1_20 */
{-1},
};

I added a line in enable_board_pin_mux(void) to use the the mux for my board

} else if (board_is_my_custom_board()) {
configure_module_pin_mux(emmc_mmc1_pin_mux);
} else if ...

I also changed the pin mux in my equivalent to am335x-bone-common.dtsi

emmc_pins: pinmux_emmc_pins {
pinctrl-single,pins = <
0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */
0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */
0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */
0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */
0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */
0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */
0x10 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4 */
0x14 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5 */
0x18 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6 */
0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7 */
0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE7 ) /* gpmc_a4.gpio1_20 */
>;

I am using u-boot 2017.01 from the TI SDK. The board has a micron 4GB eMMC and the AM3358BZCZ as well as the TPS65910A31 . I'm not sure why the beaglebone black wouldn't have this issue too.

 ==============================
# env default -f -a
# saveenv
 
u-boot# setenv ipaddr 10.100.1.10 (you can also get the IP from dhcp server by dhcp command) (its for target IP)
u-boot# setenv serverip 10.100.1.15 (its your PC IP)
u-boot# tftpboot 0x82000000 zImage
 
/////////////////////////
http://www.staroceans.org/e-book/AM335x_U-Boot_User%27s_Guide.html

This section gives an overview of the SD support in U-Boot

Read and execute uImage from SD card

Please note that the following commands are being executed from the 2nd stage. List files on a FAT32 formatted SD card

U-Boot# mmc rescan
U-Boot# fatls mmc 0

Booting kernel image from the SD card

U-Boot# mmc rescan
U-Boot# fatload mmc 0 0x82000000 uImage
U-Boot# bootm 0x82000000


Read and execute u-boot from SD card

U-Boot# mmc rescan
U-Boot# fatload mmc 0 0x82000000 u-boot.bin
U-Boot# go 0x82000000

推荐阅读