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.
最近在调试 AM335x boot from SPI FLASH.
用的是最新的 SDK 和 PSP.
Uboot 可以正常启动。但是 Kernel 却不行。
看到 WiKi 上有说 SPI boot additionally requires endian conversion before flashing the image
该如何进行 endian conversion 呢?
如果是这个endian conversion的问题,你的UBOOT为啥能启动正常呢?UBOOT和kernel不都是存在SPI FLASH里面的吗?如楼上所说,你贴下启动log,看看会不会是其他什么原因
For easy generation of the different images, different target names have been provided in the Makefile. The different target names take care of building the appropriate image (with or without the header and with or without endian conversion).
TI的SDK文档就值提供这么一个命令:make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- uImage,请问一下对于从SPI FLASH加载的kernel image,应该用什么target name。
我大部分还是参考这里:http://www.deyisupport.com/question_answer/w/faq/476.booting-from-spi-flash-based-on-gp-evm.aspx
你现在做到哪一步了,可以把你问题贴出来,讨论一下。
Booting from spi ...
SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
SPI RXS timed out, status=0x00000007
SF: 3547136 bytes @ 0xe0000 Read: ERROR
Bad Linux ARM zImage magic!
** File not found /boot/zImage **
## Error: "nandboot" not defined
U-Boot# mmc rescan
U-Boot# sf probe 0
SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
U-Boot# sf erase 0 +80000
SF: 524288 bytes @ 0x0 Erased: OK
U-Boot# fatload mmc 0 ${loadaddr} MLO
reading MLO
76548 bytes read in 8 ms (9.1 MiB/s)
U-Boot# sf write ${loadaddr} 0 ${filesize}
SF: 76548 bytes @ 0x0 Written: OK
U-Boot# fatload mmc 0 ${loadaddr} u-boot.img
reading u-boot.img
341928 bytes read in 23 ms (14.2 MiB/s)
U-Boot# sf write ${loadaddr} 0x20000 ${filesize}
SF: 341928 bytes @ 0x20000 Written: OK
U-Boot# sf erase 80000 +${spiimgsize}
SF: 3604480 bytes @ 0x80000 Erased: OK
U-Boot# fatload mmc 0 ${loadaddr} rtems-app.img
reading rtems-app.img
60295 bytes read in 9 ms (6.4 MiB/s)
U-Boot# sf write ${loadaddr} ${spisrcaddr} ${filesize}
SF: 60295 bytes @ 0xe0000 Written: OK
U-Boot# run spiboot
Booting from spi ...
SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
SPI RXS timed out, status=0x00000007
SF: 3547136 bytes @ 0xe0000 Read: ERROR
Bad Linux ARM zImage magic!
U-Boot#
Hi Lee 上面上我今天Mount一个W25Q64 ,按你提供的链接上的命令操作后,从SPI Boot的信息。
U-Boot# mmc rescan
U-Boot# sf probe 0
SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
U-Boot# sf erase 0 +80000
SF: 524288 bytes @ 0x0 Erased: OK
U-Boot# fatload mmc 0 ${loadaddr} MLO
reading MLO
76548 bytes read in 8 ms (9.1 MiB/s)
U-Boot# sf write ${loadaddr} 0 ${filesize}
SF: 76548 bytes @ 0x0 Written: OK
U-Boot# fatload mmc 0 ${loadaddr} u-boot.img
reading u-boot.img
341928 bytes read in 23 ms (14.2 MiB/s)
U-Boot# sf write ${loadaddr} 0x20000 ${filesize}
SF: 341928 bytes @ 0x20000 Written: OK
U-Boot# sf erase 80000 +${spiimgsize}
SF: 3604480 bytes @ 0x80000 Erased: OK
U-Boot# fatload mmc 0 ${loadaddr} rtems-app.img
reading rtems-app.img
60295 bytes read in 9 ms (6.4 MiB/s)
U-Boot# sf write ${loadaddr} ${spisrcaddr} ${filesize}
SF: 60295 bytes @ 0xe0000 Written: OK
U-Boot# run spiboot
Booting from spi ...
SF: Detected W25Q64CV with page size 256 Bytes, erase size 4 KiB, total 8 MiB
SPI RXS timed out, status=0x00000007
SF: 3547136 bytes @ 0xe0000 Read: ERROR
Bad Linux ARM zImage magic!
U-Boot#
完成这些指令后,我再重新上电BeagleBone Black 调试串口没有任何输出了。
从SPI DataFlash boot RTEMS4.11成功。具体操作如下:
U-Boot # mmc rescan
U-Boot # sf probe 0
U-Boot # sf erase 0 +80000
U-Boot # fatload mmc 0 ${loadaddr} MLO.byteswap
U-Boot # sf write ${loadaddr} 0 ${filesize}
U-Boot # fatload mmc 0 ${loadaddr} u-boot.img
U-Boot # sf write ${loadaddr} 0x20000 ${filesize}
U-Boot # sf erase 80000 +${spiimgsize}
U-Boot # fatload mmc 0 ${loadaddr} uImage
U-Boot # sf write ${loadaddr} ${spisrcaddr} ${filesize}5. Eject the SD-card, and hold on S2 button, and then will print message from debug port,U-Boot SPL 2013.01.01-g43a81af-dirty (Feb 10 2015 - 09:15:03)hhiimusb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)musb-hdrc: MHDRC RTL version 2.0musb-hdrc: setup fifo_mode 4musb-hdrc: 28/31 max ep, 16384/16384 memoryUSB Peripheral mode controller at 47401000 using PIO, IRQ 0musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)musb-hdrc: MHDRC RTL version 2.0musb-hdrc: setup fifo_mode 4musb-hdrc: 28/31 max ep, 16384/16384 memoryUSB Host mode controller at 47401800 using PIO, IRQ 0SF: Detected W25Q64 with page size 4 KiB, total 8 MiBCCCCC.DDDDD.EEEEE.FFFFF.Entry Point is:0x80800000.JJJJJ.U-Boot 2013.01.01-g43a81af-dirty (Feb 10 2015 - 09:15:03)I2C: readyDRAM: 512 MiBWARNING: Caches not enabledNAND: No NAND device found!!!0 MiBMMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1SF: Detected W25Q64 with page size 4 KiB, total 8 MiB*** Warning - bad CRC, using default environmentmusb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)musb-hdrc: MHDRC RTL version 2.0musb-hdrc: setup fifo_mode 4musb-hdrc: 28/31 max ep, 16384/16384 memoryUSB Peripheral mode controller at 47401000 using PIO, IRQ 0musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)musb-hdrc: MHDRC RTL version 2.0musb-hdrc: setup fifo_mode 4musb-hdrc: 28/31 max ep, 16384/16384 memoryUSB Host mode controller at 47401800 using PIO, IRQ 0Net: <ethaddr> not set. Validating first E-fuse MACcpsw, usb_etherHit any key to stop autoboot: 0Booting from spi ...SF: Detected W25Q64 with page size 4 KiB, total 8 MiB## Booting kernel from Legacy Image at 80200000 ...Image Name: RTEMSImage Type: ARM RTEMS Kernel Image (gzip compressed)Data Size: 60211 Bytes = 58.8 KiBLoad Address: 80000000Entry Point: 80000000Verifying Checksum ... OKUncompressing Kernel Image ... OK## Transferring control to RTEMS (at address 80000000) ...RTEMS Beagleboard: am335x-based*** BEGIN OF TEST HELLO WORLD ***Hello RTEMSHello Hans.Huang*** END OF TEST HELLO WORLD ***Start GPIO LED Blink taskLED On#### Hello RTEMS4.11 ####LED Off#### Hello RTEMS4.11 ####LED On#### Hello RTEMS4.11 ####LED Off
补充一点,请注意红色一行:
void enable_board_pin_mux(struct am335x_baseboard_id *header)
{
/* Do board-specific muxes. */
if (!strncmp(header->name, "A335BONE", HDR_NAME_LEN)) {
/* Beaglebone pinmux */
configure_module_pin_mux(i2c1_pin_mux);
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);
#ifndef CONFIG_NOR
configure_module_pin_mux(mmc1_pin_mux);
#endif
#if defined(CONFIG_NOR) && !defined(CONFIG_NOR_BOOT)
configure_module_pin_mux(bone_norcape_pin_mux);
#endif
} else if (!strncmp(header->config, "SKU#01", 6)) {
/* 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 */
if (profile & ~(PROFILE_2 | PROFILE_3))
configure_module_pin_mux(nand_pin_mux);
else if (profile == PROFILE_2) {
configure_module_pin_mux(mmc1_pin_mux);
configure_module_pin_mux(spi0_pin_mux);
}
} else if (!strncmp(header->config, "SKU#02", 6)) {
/*
* Industrial Motor Control (IDK)
* note: IDK console is on UART3 by default.
* So u-boot mus be build with CONFIG_SERIAL4 and
* CONFIG_CONS_INDEX=4
*/
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_no_cd_pin_mux);
} else if (!strncmp(header->name, "A335X_SK", HDR_NAME_LEN)) {
/* 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 (!strncmp(header->name, "A335BNLT", HDR_NAME_LEN)) {
/* Beaglebone LT pinmux */
configure_module_pin_mux(i2c1_pin_mux);
configure_module_pin_mux(mii1_pin_mux);
configure_module_pin_mux(mmc0_pin_mux);
configure_module_pin_mux(mmc1_pin_mux);
configure_module_pin_mux(spi0_pin_mux);
} else {
puts("Unknown board, cannot configure pinmux.");
hang();
}
}