各位好,将修改后的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: 0WARNING: 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
Nancy Wang:
请问自制板是参考的哪块开发板?具体改动哪些部分?
是从SD卡启动吗?
user6238334:
回复 Nancy Wang:
参考am335x_evm,
u-boot的具体改动根据以下文档
,是SD卡启动。
user6238334:
回复 Nancy Wang:
你好,经过再次检查发现报错出自以下代码
#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
Nancy Wang:
回复 user6238334:
自制板与EVM相比,硬件上做了哪些改动?
user6238334:
回复 Nancy Wang:
DDR为MT41K256M16,flash为MT29F8G08ABACA,电源管理芯片为TPS65910,网络为KSZ9031RNX,去除了音频模块、wifi模块。
Nancy Wang:
回复 user6238334:
从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
user6238334:
回复 Nancy Wang:
你好,经过反复测试终于查出问题出在SD卡分区又问题,重新对SD卡分区后,u-boot输出信息有了新的变化,如下:
CCCCCCCCU-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.1Model: TI AM335x EVMDRAM: 512 MiBNAND: 1024 MiBMMC: OMAP SD/MMC: 0Loading Environment from FAT… *** Warning – bad CRC, using default environment
<ethaddr> not set. Validating first E-fuse MACNet: eth0: ethernet@4a100000Warning: usb_ether MAC addresses don't match:Address in ROM is de:ad:be:ef:00:01Address in environment is 0c:b2:b7:9d:8f:c8, eth1: usb_etherHit any key to stop autoboot: 0 WARNING: Could not determine device tree to useswitch to partitions #0, OKmmc0 is current deviceSD/MMC found on device 0** Unable to read file boot.scr **** Unable to read file uEnv.txt **switch to partitions #0, OKmmc0 is current deviceScanning mmc 0:1…switch to partitions #0, OKmmc0 is current deviceSD/MMC found on device 04280832 bytes read in 367 ms (11.1 MiB/s)** File not found /boot/undefined **
Starting kernel …
CCCCCCCCCCCCCCCCU-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 EVMDRAM: 512 MiBNAND: 1024 MiBMMC: OMAP SD/MMC: 0Loading Environment from FAT… *** Warning – bad CRC, using default environment
<ethaddr> not set. Validating first E-fuse MACNet: eth0: ethernet@4a100000Warning: usb_ether MAC addresses don't match:Address in ROM is de:ad:be:ef:00:01Address in environment is 0c:b2:b7:9d:8f:c8, eth1: usb_etherHit any key to stop autoboot: 0 WARNING: Could not determine device tree to useswitch to partitions #0, OKmmc0 is current deviceSD/MMC found on device 0** Unable to read file boot.scr **** Unable to read file uEnv.txt **switch to partitions #0, OKmmc0 is current deviceScanning mmc 0:1…switch to partitions #0, OKmmc0 is current deviceSD/MMC found on device 04280832 bytes read in 367 ms (11.1 MiB/s)** File not found /boot/undefined **
Starting kernel …
starting kernel…不断重复,这是否表示u-boot已经启动,里面的问题是什么?
user6238334:
回复 Nancy Wang:
你好,我使用好的sd卡上进行了测试,得到以下信息
WARNING: Could not determine device tree to use=> printenv fdtfilefdtfile=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:2ext4=> 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=>
user6238334:
回复 Nancy Wang:
你好,按照上面的方法能够启动内核了,
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 isde:ad:be:ef:00:01
Address in environment is0c: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 88000000Booting using the fdt blob at 0x88000000Loading Device Tree to 8ffef000, end 8ffff5d7 … OKStarting 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里面?