This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am3354 U-boot 移植 无法初始化

Other Parts Discussed in Thread: CDCE913

各位好,将修改后的U-boot通过SD卡烧入自制3354板后,串口显示如下信息,请问这如何解决

U-Boot SPL 2019.01-gc14892445a-dirty (Nov 13 2020 - 10:04:39 +0800)

Trying to boot from MMC1


U-Boot 2019.01-gc14892445a-dirty (Nov 13 2020 - 10:04:39 +0800)

CPU : AM335X-GP rev 2.1
Model: TI AM335x EVM
DRAM: 512 MiB
NAND: 1024 MiB
MMC: OMAP SD/MMC: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net: eth0: ethernet@4a100000
Warning: usb_ether MAC addresses don't match:
Address in ROM is de:ad:be:ef:00:01
Address in environment is 0c:b2:b7:9d:8f:c8
, eth1: usb_ether
Hit any key to stop autoboot: 0
WARNING: Could not determine device tree to use
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Unable to read file boot.scr **
** Unable to read file uEnv.txt **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** Invalid partition 2 **
** Invalid partition 2 **
MMC Device 1 not found
no mmc device at slot 1
MMC Device 1 not found
no mmc device at slot 1
SD/MMC found on device 1
## Error: "bootcmd_nand0" not defined
starting USB...
USB0: Port not available.
ethernet@4a100000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC de:ad:be:ef:00:01
HOST MAC de:ad:be:ef:00:00
RNDIS ready

  • 请问自制板是参考的哪块开发板?具体改动哪些部分?
    是从SD卡启动吗?
  • 参考am335x_evm,

    u-boot的具体改动根据以下文档

    ,是SD卡启动。

  • 你好,经过再次检查发现报错出自以下代码

    #if !defined(CONFIG_SPL_BUILD) /* try reading mac address from efuse */
    mac_lo = readl(&cdev->macid0l);
    mac_hi = readl(&cdev->macid0h);
    mac_addr[0] = mac_hi & 0xFF;
    mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
    mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
    mac_addr[4] = mac_lo & 0xFF;
    mac_addr[5] = (mac_lo & 0xFF00) >> 8;
    if (!env_get("ethaddr")) {
    printf("<ethaddr> not set. Validating first E-fuse MAC\n");
    if (is_valid_ethaddr(mac_addr))
    eth_env_set_enetaddr("ethaddr", mac_addr);
    }
    mac_lo = readl(&cdev->macid1l);
    mac_hi = readl(&cdev->macid1h);
    mac_addr[0] = mac_hi & 0xFF;
    mac_addr[1] = (mac_hi & 0xFF00) >> 8;
    mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
    mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
    mac_addr[4] = mac_lo & 0xFF;
    mac_addr[5] = (mac_lo & 0xFF00) >> 8;
    if (!env_get("eth1addr")) {
    if (is_valid_ethaddr(mac_addr))
    eth_env_set_enetaddr("eth1addr", mac_addr);
    }
    env_set("ice_mii", prueth_is_mii ? "mii" : "rmii");
    #endif

    我分析了一下可能与我屏蔽的这段代码有关,因为它与board_is相关所以我就将它们屏蔽了。

    #if defined(CONFIG_CLOCK_SYNTHESIZER) && (!defined(CONFIG_SPL_BUILD) || \ (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD)))
    // if (board_is_icev2()) {
    // int rv;
    // u32 reg;
    // bool eth0_is_mii = true;
    // bool eth1_is_mii = true;
    // REQUEST_AND_SET_GPIO(GPIO_PR1_MII_CTRL); /* Make J19 status available on GPIO1_26 */
    // REQUEST_AND_CLR_GPIO(GPIO_MUX_MII_CTRL);
    // REQUEST_AND_SET_GPIO(GPIO_FET_SWITCH_CTRL);
    /* * Both ports can be set as RMII-CPSW or MII-PRU-ETH using
    * jumpers near the port. Read the jumper value and set
    * the pinmux, external mux and PHY clock accordingly.
    * As jumper line is overridden by PHY RX_DV pin immediately
    * after bootstrap (power-up/reset), we need to sample
    * it during PHY reset using GPIO rising edge detection. */
    REQUEST_AND_SET_GPIO(GPIO_PHY_RESET); /* Enable rising edge IRQ on GPIO0_11 and GPIO 1_26 */
    // reg = readl(GPIO0_RISINGDETECT) | BIT(11);
    // writel(reg, GPIO0_RISINGDETECT);
    // reg = readl(GPIO1_RISINGDETECT) | BIT(26);
    // writel(reg, GPIO1_RISINGDETECT); /* Reset PHYs to capture the Jumper setting */
    // gpio_set_value(GPIO_PHY_RESET, 0);
    // udelay(2); /* PHY datasheet states 1uS min. */
    // gpio_set_value(GPIO_PHY_RESET, 1);
    // reg = readl(GPIO0_IRQSTATUSRAW) & BIT(11);
    // if (reg) {
    // writel(reg, GPIO0_IRQSTATUS1); /* clear irq */ /* RMII mode */
    // printf("ETH0, CPSW\n");
    // eth0_is_mii = false;/
    / } else { /* MII mode */
    // printf("ETH0, PRU\n");
    // cdce913_data.pdiv3 = 4; /* 25MHz PHY clk */
    // }
    // reg = readl(GPIO1_IRQSTATUSRAW) & BIT(26);
    // if (reg) {
    // writel(reg, GPIO1_IRQSTATUS1); /* clear irq */ /* RMII mode */
    // printf("ETH1, CPSW\n");
    // gpio_set_value(GPIO_MUX_MII_CTRL, 1);
    // eth1_is_mii = false;
    // } else { /* MII mode */
    // printf("ETH1, PRU\n");
    // cdce913_data.pdiv2 = 4; /* 25MHz PHY clk */
    // }
    // if (eth0_is_mii != eth1_is_mii) {
    // printf("Unsupported Ethernet port configuration\n");
    // printf("Both ports must be set as RMII or MII\n");
    // hang();
    // }
    // prueth_is_mii = eth0_is_mii; /* disable rising edge IRQs */
    // reg = readl(GPIO0_RISINGDETECT) & ~BIT(11);
    // writel(reg, GPIO0_RISINGDETECT);
    // reg = readl(GPIO1_RISINGDETECT) & ~BIT(26);
    // writel(reg, GPIO1_RISINGDETECT);
    // rv = setup_clock_synthesizer(&cdce913_data);
    // if (rv) {
    // printf("Clock synthesizer setup failed %d\n", rv);
    // return rv;
    // } /* reset PHYs */
    // gpio_set_value(GPIO_PHY_RESET, 0);
    // udelay(2); /* PHY datasheet states 1uS min. */
    // gpio_set_value(GPIO_PHY_RESET, 1);
    // }#endif

    rerturn 0;

    请问我该如何改动才能进行u-boot

  • 自制板与EVM相比,硬件上做了哪些改动?
  • DDR为MT41K256M16,flash为MT29F8G08ABACA,电源管理芯片为TPS65910,网络为KSZ9031RNX,去除了音频模块、wifi模块。

  • 从u-boot打印信息中,似乎检测内核dtb文件以及从rootfs分区访问内核镜像和dtb文件存在一些问题。
    请运行以下命令看一下:
    1/. check dtb file
    => run findfdt
    => printenv fdtfile
    2/. check kernel uImage, dtb file
    => mmc part
    => fstype mmc 0:2
    => ls mmc 0:2
    => ls mmc 0:2 boot
  • 你好,经过反复测试终于查出问题出在SD卡分区又问题,重新对SD卡分区后,u-boot输出信息有了新的变化,如下:

    CCCCCCCC
    U-Boot SPL 2019.01-gc14892445a-dirty (Nov 16 2020 - 17:20:03 +0800)
    Trying to boot from MMC1


    U-Boot 2019.01-gc14892445a-dirty (Nov 16 2020 - 17:20:03 +0800)

    CPU : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM: 512 MiB
    NAND: 1024 MiB
    MMC: OMAP SD/MMC: 0
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net: eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is de:ad:be:ef:00:01
    Address in environment is 0c:b2:b7:9d:8f:c8
    , eth1: usb_ether
    Hit any key to stop autoboot: 0
    WARNING: Could not determine device tree to use
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    4280832 bytes read in 367 ms (11.1 MiB/s)
    ** File not found /boot/undefined **

    Starting kernel ...

    CCCCCCCCCCCCCCCC
    U-Boot SPL 2019.01-gc14892445a-dirty (Nov 16 2020 - 17:20:03 +0800)
    Trying to boot from MMC1


    U-Boot 2019.01-gc14892445a-dirty (Nov 16 2020 - 17:20:03 +0800)

    CPU : AM335X-GP rev 2.1

    Model: TI AM335x EVM
    DRAM: 512 MiB
    NAND: 1024 MiB
    MMC: OMAP SD/MMC: 0
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    <ethaddr> not set. Validating first E-fuse MAC
    Net: eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is de:ad:be:ef:00:01
    Address in environment is 0c:b2:b7:9d:8f:c8
    , eth1: usb_ether
    Hit any key to stop autoboot: 0 
    WARNING: Could not determine device tree to use
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    4280832 bytes read in 367 ms (11.1 MiB/s)
    ** File not found /boot/undefined **

    Starting kernel ...

    starting kernel...不断重复,这是否表示u-boot已经启动,里面的问题是什么?

  • 你好,我使用好的sd卡上进行了测试,得到以下信息

    WARNING: Could not determine device tree to use
    => printenv fdtfile
    fdtfile=undefined
    => mmc part

    Partition Map for MMC device 0 -- Partition Type: DOS

    Part Start Sector Num Sectors UUID Type
    1 2048 143360 cc3ffb49-01 0c Boot
    2 145408 122210304 cc3ffb49-02 83
    => fstype mmc 0:2
    ext4
    => ls mmc 0:2
    <DIR> 4096 .
    <DIR> 4096 ..
    <DIR> 4096 lib
    <DIR> 4096 media
    <DIR> 4096 home
    <DIR> 4096 proc
    <DIR> 4096 dev
    <SYM> 19 linuxrc
    <DIR> 4096 tmp
    <DIR> 4096 www
    <DIR> 4096 boot
    <DIR> 4096 include
    <DIR> 4096 var
    <DIR> 4096 sys
    <DIR> 4096 sbin
    <DIR> 4096 mnt
    <DIR> 4096 bin
    <DIR> 4096 usr
    <DIR> 4096 srv
    <DIR> 4096 etc
    <DIR> 4096 run
    <DIR> 4096 opt
    => ls mmc 0:2 boot
    <DIR> 4096 .
    <DIR> 4096 ..
    37965 am335x-boneblack-prusuart.dtb
    37192 am335x-boneblack-pru-adc.dtb
    37566 am335x-icev2-prueth-pps.dtb
    54744 am335x-evm.dtb
    35001 am335x-bone.dtb
    35225 am335x-bonegreen.dtb
    37124 am335x-icev2.dtb
    34055 am335x-pocketbeagle.dtb
    36717 am335x-boneblack.dtb
    15894420 vmlinux-4.19.94-gbe5389fd85
    39511 am335x-icev2-pru-excl-uio.dtb
    40236 am335x-evmsk.dtb
    36352 am335x-boneblue.dtb
    37305 am335x-sancloud-bbe.dtb
    37166 am335x-icev2-prueth.dtb
    37092 am335x-boneblack-iot-cape.dtb
    <SYM> 26 zImage
    37934 am335x-boneblack-wireless.dtb
    36542 am335x-bonegreen-wireless.dtb
    4280832 zImage-4.19.94-gbe5389fd85
    =>

  • 像是内核找不到设备树文件,无法启动内核,参考以下帖子看一下。
    e2e.ti.com/.../416078
  • 你好,按照上面的方法能够启动内核了,
    sd卡烧入时信息如下
    U-Boot SPL 2019.01-gc14892445a-dirty (Nov 17 2020 - 16:03:53 +0800)
    Trying to boot from MMC1
    U-Boot 2019.01-gc14892445a-dirty (Nov 17 2020 - 16:03:53 +0800)
    CPU : AM335X-GP rev 2.1
    Model: TI AM335x EVM
    DRAM: 512 MiB
    NAND: 1024 MiB
    MMC: OMAP SD/MMC: 0
    Loading Environment from FAT... *** Warning - bad CRC, using default environment
    <ethaddr> not set. Validating first E-fuse MAC
    Net: eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in ROM is de:ad:be:ef:00:01
    Address in environment is 0c:b2:b7:9d:8f:c8
    , eth1: usb_ether
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    4280832 bytes read in 389 ms (10.5 MiB/s)
    54744 bytes read in 8 ms (6.5 MiB/s)
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8ffef000, end 8ffff5d7 ... OK

    Starting kernel ...

    接着后面就是内核的信息,但我拔下sd卡后系统就消失了.
    显示如下:
    [ 2245.875693] systemd-journald[73]: Failed to open system journal: Input/output error
    [ 2245.883525] EXT4-fs error (device mmcblk0p2): ext4_find_entry:1455: inode #3465217: comm systemd-journal: reading directory lblock 0
    [ 2245.896157] EXT4-fs error (device mmcblk0p2): ext4_find_entry:1455: inode #942081: comm systemd-timesyn: reading directory lblock 0
    是不是我的内容并没有烧入flash里面?
  • 你是从SD卡启动的,没有烧入flash。
  • 那请问该如何操作才能使得板子通过SD卡将程序与系统烧入Flash内,使得下次开机时不需要插SD卡。谢谢。

  • 可以直接烧写到flash,通过flash启动。
    software-dl.ti.com/.../Flash_Tools.html
  • 你好,除了直接焼写的方式,想通过SD卡将程序与系统烧入Flash的方法应该如何操作?是否有相关的信息?

  • 通过SD卡烧入flash的资料没有见到过,有一些关于通过SD卡烧写到EMMC的讨论,可以参考看一下。
    e2e.ti.com/.../3343949
  • 你好,系统经过检测发现网络并不能使用,无法与主机进行ping。

    与主机ping了之后并没有数据传输。

    目前我使用的网络芯片为Ksz9031,我应该修改U-boot那里才使得网口能够正常使用3225.KSZ9031RNXdatasheet.pdf