由于ADSP-BF533对TFT LCD的支持上不够稳定,我们开始转向BF533芯片。在BF533/BF532上工作不稳定的表现为图像会发生移位现象,而根据对PPI接口部分的中断错误来看,属于速率方面的不匹配而导致了under flow/over flow的问题。最简单的解决办法是降低PPI时钟频率,例如从25MHz降到20MHz图像变为比较稳定,然后如果运行网络吞吐量较大的程序依然会发生移位的现象。分析产生的原因主要是由于BF533的外接MAC+PHY芯片LAN91C111是通过EBIU连接的,而EBIU的数据总线和地址总线和SDRAM是共享的(frame buffer的内存位于SDRAM)。当运行网络程序时,会导致大家相互冲突。虽然在kernel部分我们设定为PPI具有较高优先级,然后这样的问题还是出现了,有点奇怪!
先说一下ADSP-BF537的硬件特性:
- Processor: ADSP-BF537BBCZ-5A, 500M
- RAM: 64MB SDRAM
- FLASH: 8MB
- Ethernet: 10M/100M, inc. PHY
- PPI: 1
- UART: 2
- CAN: 1
- I2C: 1
- SPI: 1
由于硬件上没有采用并行接口的Flash,减少了复杂的布线和节省了PCB的空间,但是带来坏处是无法通过常用的JTAG方式来烧录u-boot。相比BF533而言,BF537提供了丰富了启动模式(共8种方式),其中UART启动(BMOD = 111)是本模块唯一采用的方式。基本思路是通过UART来下载和运行u-boot,然后利用u-boot支持从UART来传送文件来传送可以通过SPI接口来启动的u-boot,并将此u-boot来烧录到M25P64里实现串行SPI Flash启动(BMOD = 011)。由于通过UART来启动的第一个环节用到了自动波特率设置,不同于常用的三线串口,还需要增加CTS和RTS信号线,硬件上这两根线分别连接到PG6和PG7上,Port G既可用于GPIO,也可复用为PPI接口。在linux下可以采用blackfin linux toolchain提供的bfin-uclinux-ldr来进行u-boot的下载和启动。
jian@linux:~/blackfin/uboot> bfin-uclinux-ldr -l /tftpboot/u-boot-bf537.ldr /dev/ttyS0 Loading LDR /tftpboot/u-boot-bf537-uart.ldr ... auto detected LDR as 'BF537' OK! Opening /dev/ttyS0 ... OK! Configuring terminal I/O ... OK! Trying to send autobaud ... OK! Trying to read autobaud ... OK! Checking autobaud ... OK! Autobaud result: 115200bps 49.766mhz (header:0xBF DLL:0x1B DLH:0x00 fin:0x00) Sending blocks of DXE 1 ... OK! You may want to run minicom or kermit now Quick tip: run 'ldr <ldr> <tty> && minicom'
下载完成后,启动kermit并运行version显示u-boot的版本,到这一步我们已经通过串口成功的启动了u-boot。
jian@linux:~/blackfin/uboot> kermit C-Kermit 8.0.211, 10 Apr 2004, for Linux Copyright (C) 1985, 2004, Trustees of Columbia University in the City of New York. Type ? or HELP for help. Linux Kermit> connect Connecting to /dev/ttyS0, speed 57600 Escape character: Ctrl-/ (ASCII 28, FS): enabled Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- version U-Boot 1.1.6 (ADI-2008R1) (Jun 5 2008 - 18:05:42) bfin>
下面我们首先需要回到u-boot目录下,重新定义启动模式为串行SPI Flash,重新make得到新的u-boot,这个文件是我们下面需要通过刚刚已经运行在板子上u-boot来下载到RAM并且固化到M25P64里。
#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
将新的u-boot.ldr更名为u-boot-bf537-spi.ldr,并copy到/tftpboot目录下。本想通过go命令才测试一下生成的u-boot文件是否可以正常启动,无论是uart还是spi启动模式编译的u-boot,结果都是以失败而告终。最后找出原因是由于只有针对并行flash的u-boot文件方可用go命令才做测试,ldr文件是不能通过go命令来测试的。
接着通过loadb准备接受文件
bfin> loadb ## Ready for binary (kermit) download to 0x01000000 at 57600 bps... (Back at linux.site) ----------------------------------------------------
ctrl+/,接着ctrl+c切换到host kermit shell环境,使用send来传送u-boot-bf537-spi.ldr文件。
Linux Kermit> send /tftpboot/u-boot-bf537-spi.ldr
传送完毕后再connect回到bfin console状态,可以看到134460 Bytes被传送到了0x01000000地址处。
Linux Kermit> connect Connecting to /dev/ttyS0, speed 57600 Escape character: Ctrl-/ (ASCII 28, FS): enabled Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- ## Total Size = 0x00020d3c = 134460 Bytes ## Start Addr = 0x01000000
最后使用eeprom名来来烧录u-boot到serial flash。
bfin> eeprom info SPI Device: m25p64 0x20 (ST) 0x20 0x17 Parameters: num sectors = 128, sector size = 65536, write size = 256 Flash Size: 64 mbit (8 mbyte) Status: 0x0 bfin> eeprom write 0x1000000 0 $(filesize) EEPROM @0x0 write: addr 01000000 off 0000 count 134460 ... ......done
重新将启动模式设定到011,重启,可以看到u-boot已经运行了。