我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git

参考文章: 《u-boot-2011.09在ST2410上的移植-启用CS8900网卡功能

参考文档: s3c2440手册(下载地址) mini2440电路图(下载地址) SST39VF1601芯片手册(下载地址

前一篇博文:《mini2440移植uboot 2014.04(一)

(四)添加nor flash支持

我的mini2440使用的nor flash芯片型号是SST的39VF1601(16Mbits=2MByte)。该nor flash连接nGCS0。

SST39VF1601的数据手册下载地址在这里

先重启mini2440,进入官方的uboot(如果没有安装官方uboot, 可以按照《openocd+jlink为mini2440调试u-boot》将其先烧进去 )。

然后执行下面命令查看nor flash信息:

Bank # : SST: 1x SST39VF1601 (2MB)
Size: MB in Sectors
Sector Start Addresses:
(RO) (RO) (RO) (RO) (RO)
(RO)
000A0000 000B0000 000C0000 000D0000 000E0000
000F0000 001A0000 001B0000 001C0000 001D0000
001E0000 001F0000

确实使用了SST39VF1601这款芯片。

上一部分编译出来的uboot在执行时得到下面的输出:

U-Boot 2014.04-g35e1a7f-dirty (Jun   - ::)

U-Boot code: 33E80000 -> 33EF9FB4  BSS: -> 33F489D0
CPUID:
FCLK: MHz
HCLK: 101.250 MHz
PCLK: 50.625 MHz
monitor len: 000C89D0
ramsize:
TLB table from 33ff0000 to 33ff4000
Top of RAM usable for U-Boot at: 33ff0000
Reserving 802k for U-Boot at: 33f27000
Reserving 4160k for malloc() at: 33b17000
Reserving Bytes for Board Info at: 33b16fe0
Reserving Bytes for Global Data at: 33b16f40
New Stack Pointer is: 33b16f30
RAM Configuration:
Bank #: MiB
addr=33f27000,_start=33e80000
relocation Offset is: 000a7000
WARNING: Caches not enabled
monitor flash len: 000847BC
Now running in RAM - U-Boot at: 33f27000
Flash: fwc addr cmd f0 00f0 16bit x bit
fwc addr 0000aaaa cmd aa 00aa 16bit x bit
fwc addr cmd 16bit x bit
fwc addr 0000aaaa cmd 16bit x bit
fwc addr cmd f0 00f0 16bit x bit
JEDEC PROBE: ID f0 ea00
fwc addr cmd ff 00ff 16bit x bit
fwc addr cmd 16bit x bit
fwc addr cmd ff 00ff 16bit x bit
JEDEC PROBE: ID ea00
*** failed ***
### ERROR ### Please RESET the board ###

是在识别nor flash时出错的,仔细看代码后发现jedec_table没有该芯片的定义,将其定义加入到jedec_table的末尾处:

#ifdef CONFIG_SYS_FLASH_LEGACY_1Mx16
{
.mfr_id = 0xf0,
.dev_id = 0xea00,
.name = "SST39VF1601",
.uaddr = {
[0] = MTD_UADDR_0x5555_0x2AAA, /* x8 */
[1] = MTD_UADDR_0x5555_0x2AAA /* x16 */
},
.DevSize = SIZE_2MiB,
.CmdSet = P_ID_AMD_STD,
.NumEraseRegions= 2,
.regions = {
ERASEINFO(0x1000,256),
ERASEINFO(0x1000,256)
}
},
#endif

然后将include/configs/mini2440.h中修改:

#define CONFIG_SYS_FLASH_LEGACY_512Kx16
#define CONFIG_SYS_FLASH_LEGACY_1Mx16

重新编译,然后打开三个控制台,一个执行"sudo minicom",另一个执行"openocd -f interface/jlink.cfg -f board/mini2440.cfg",最后一个控制台执行下面内容:

telnet localhost
reset
init_2440
load_image /home/host/soft/mini2440/u-boot-2014.04/u-boot.bin 0x33e80000 bin
resume 0x33e80000

得到下面的输出信息:

U-Boot 2014.04-g35e1a7f-dirty (Jun   - ::)

U-Boot code: 33E80000 -> 33EF9FB4  BSS: -> 33F489D0
CPUID:
FCLK: MHz
HCLK: 101.250 MHz
PCLK: 50.625 MHz
monitor len: 000C89D0
ramsize:
TLB table from 33ff0000 to 33ff4000
Top of RAM usable for U-Boot at: 33ff0000
Reserving 802k for U-Boot at: 33f27000
Reserving 4160k for malloc() at: 33b17000
Reserving Bytes for Board Info at: 33b16fe0
Reserving Bytes for Global Data at: 33b16f40
New Stack Pointer is: 33b16f30
RAM Configuration:
Bank #: MiB
addr=33f27000,_start=33e80000
relocation Offset is: 000a7000
WARNING: Caches not enabled
monitor flash len: 000847BC
dram_bank_mmu_setup: bank:
Now running in RAM - U-Boot at: 33f27000
Flash: fwc addr cmd f0 00f0 16bit x bit
fwc addr 0000aaaa cmd aa 00aa 16bit x bit
fwc addr cmd 16bit x bit
fwc addr 0000aaaa cmd 16bit x bit
fwc addr cmd f0 00f0 16bit x bit
JEDEC PROBE: ID f0 ea00
fwc addr cmd ff 00ff 16bit x bit
fwc addr cmd 16bit x bit
fwc addr cmd ff 00ff 16bit x bit
JEDEC PROBE: ID ea00
*** failed ***
### ERROR ### Please RESET the board ### U-Boot 2014.04-g35e1a7f-dirty (Jun - ::) U-Boot code: 33E80000 -> 33EF9FB4 BSS: -> 33F489D0
CPUID:
FCLK: MHz
HCLK: 101.250 MHz
PCLK: 50.625 MHz
monitor len: 000C89D0
ramsize:
TLB table from 33ff0000 to 33ff4000
Top of RAM usable for U-Boot at: 33ff0000
Reserving 802k for U-Boot at: 33f27000
Reserving 4160k for malloc() at: 33b17000
Reserving Bytes for Board Info at: 33b16fe0
Reserving Bytes for Global Data at: 33b16f40
New Stack Pointer is: 33b16f30
RAM Configuration:
Bank #: MiB
addr=33f27000,_start=33e80000
relocation Offset is: 000a7000
WARNING: Caches not enabled
monitor flash len: 000847BC
Now running in RAM - U-Boot at: 33f27000
Flash: fwc addr cmd f0 00f0 16bit x bit
fwc addr 0000aaaa cmd aa 00aa 16bit x bit
fwc addr cmd 16bit x bit
fwc addr 0000aaaa cmd 16bit x bit
fwc addr cmd f0 00f0 16bit x bit
JEDEC PROBE: ID f0 ea00
fwc addr cmd ff 00ff 16bit x bit
fwc addr cmd 16bit x bit
fwc addr cmd ff 00ff 16bit x bit
JEDEC PROBE: ID ea00
*** failed ***
### ERROR ### Please RESET the board ### U-Boot 2014.04-g35e1a7f-dirty (Jun - ::) U-Boot code: 33E80000 -> 33EF9ECC BSS: -> 33F488D0
CPUID:
FCLK: MHz
HCLK: 101.250 MHz
PCLK: 50.625 MHz
monitor len: 000C88D0
ramsize:
TLB table from 33ff0000 to 33ff4000
Top of RAM usable for U-Boot at: 33ff0000
Reserving 802k for U-Boot at: 33f27000
Reserving 4160k for malloc() at: 33b17000
Reserving Bytes for Board Info at: 33b16fe0
Reserving Bytes for Global Data at: 33b16f40
New Stack Pointer is: 33b16f30
RAM Configuration:
Bank #: MiB
addr=33f27000,_start=33e80000
relocation Offset is: 000a7000
WARNING: Caches not enabled
monitor flash len: 000846BC
Now running in RAM - U-Boot at: 33f27000
Flash: fwc addr cmd f0 00f0 16bit x bit
fwc addr 0000aaaa cmd aa 00aa 16bit x bit
fwc addr cmd 16bit x bit
fwc addr 0000aaaa cmd 16bit x bit
fwc addr cmd f0 00f0 16bit x bit
JEDEC PROBE: ID f0 ea00
Found JEDEC Flash: SST39VF1601
unlock address index
unlock addresses are 0x5555/0x2aaa
erase_region_count = erase_region_size =
ERROR: too many flash sectors
erase_region_count = erase_region_size =
ERROR: too many flash sectors
flash_protect ON: from 0x00000000 to 0x000846BB
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
protect on
flash_protect ON: from 0x00070000 to 0x0007FFFF
protect on
MiB
NAND: board_nand_init()
end of nand_init
hwcontrol(): 0xff 0x83
hwcontrol(): 0xffffffff 0x81
dev_ready
hwcontrol(): 0x90 0x83
hwcontrol(): 0x00 0x85
hwcontrol(): 0xffffffff 0x81
dev_ready
hwcontrol(): 0x90 0x83
hwcontrol(): 0x00 0x85
hwcontrol(): 0xffffffff 0x81
dev_ready
hwcontrol(): 0xffffffff 0x80
MiB
*** Warning - bad CRC, using default environment Destroy Hash Table: 33f9c778 table =
Create Hash Table: N=
INSERT: table 33f9c778, filled / rv 33b17238 ==> name="bootdelay" value=""
INSERT: table 33f9c778, filled / rv 33b170f8 ==> name="baudrate" value=""
INSERT: table 33f9c778, filled / rv 33b170a8 ==> name="ipaddr" value="10.0.0.110"
INSERT: table 33f9c778, filled / rv 33b17260 ==> name="serverip" value="10.0.0.1"
INSERT: table 33f9c778, filled / rv 33b174f4 ==> name="netmask" value="255.255.255.0"
INSERT: free(data = 33b17008)
INSERT: done
In: serial
Out: serial
Err: serial
Initial value for argc=
Final value for argc=
Initial value for argc=
Final value for argc=
Initial value for argc=
Final value for argc=
Net: Initial value for argc=
Final value for argc=
CS8900-
### main_loop entered: bootdelay= ### main_loop: bootcmd="<UNDEFINED>"
SMDK2410 # flinfo
Bank # 1: SST39VF1601 flash (16 x 16)  Size: 2 MB in 19 Sectors
  AMD Legacy command set, Manufacturer ID: 0xF0, Device ID: 0xEA00
  Erase timeout: 30000 ms, write timeout: 100 ms   Sector Start Addresses:
  00000000   RO   00001000   RO   00002000   RO   00003000   RO   00004000   RO
  00005000   RO   00006000   RO   00007000   RO   00008000   RO   00009000   RO
  0000A000   RO   0000B000   RO   0000C000   RO   0000D000   RO   0000E000   RO
  0000F000   RO   00010000   RO   00011000   RO   00012000   RO

上面的修改方式是比较好的,改动相对来说比较小。

另外一种方法是将mini2440开发板中u-boot的board/tekkman/mini244/flash.c拷贝到当前uboot的board/friendlyarm/mini2440下,

然后在其下Makefile中添加flash.o,但是会有编译错误,提示函数reset_timer_masked未定义。这是因为二者的定时器的一些函数被删除了,

需要对代码做些调整才行。

另外一个方法是模仿m5253demo开发板(配置文件位于include/configs/M5253DEMO.h,开发板文件夹位于board/freescale/m5253demo下),

将其下的flash.c(所用的nor flash是sst的6401,跟当前的1601差别就在于容量和ID号有些不同)拷贝过来做修改,如果感兴趣,可以自己移植看看。

mini2440移植uboot 2014.04(二)的更多相关文章

  1. mini2440移植uboot 2014.04(五)

    代码上传到github上:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440 前几篇博文: <mini2440移植uboot 2014.04 ...

  2. mini2440移植uboot 2014.04(四)

    我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git 参考文章: <mini2440移植u ...

  3. mini2440移植uboot 2014.04(三)

    我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot-2014.04-mini2440.git 参考文档: s3c2440手册(下载地址) ...

  4. mini2440移植uboot 2014.04(七)

    上一篇博文:<mini2440移植uboot 2014.04(六)> 代码已经上传到github上: https://github.com/qiaoyuguo/u-boot-2014.04 ...

  5. mini2440移植uboot 2014.04(六)

    上一篇博文:<mini2440移植uboot 2014.04(五)> 代码已经上传到github上:https://github.com/qiaoyuguo/u-boot-2014.04- ...

  6. mini2440移植uboot 2014.04(一)

    最新版的uboot添加了很多新功能,我决定在最新版代码基础上重新移植一遍加深理解. 我修改的代码已经上传到github上,地址:https://github.com/qiaoyuguo/u-boot- ...

  7. mini2440移植uboot 2011.03(下)

    参考博文: <u-boot-2011.03在mini2440/micro2440上的移植> 移植(五)添加nand支持: host@debian:~/soft/mini2440/u-boo ...

  8. 移植u-boot.2012.04.01

    /*************************************************** *u-boot版本:u-boot2012.04.01 *gcc版本:arm-linux-gcc ...

  9. mini2440移植uboot 2011.03(上)

    参考博文: <u-boot-2011.03在mini2440/micro2440上的移植> 本来我想移植最新版的uboot,但是移植却不太成功,所以先模仿他人的例子重新执行一遍,对uboo ...

随机推荐

  1. 500 lines or less

    今天碰到一本书 <500 lines or less>突然就想在博客上记录一下自己的阅读经历了. 现在记录一下这本书的地址 http://aosabook.org/en/index.htm ...

  2. 一个队列类的实现(比delphi自带的速度快70倍)(线程安全版本)

    unit sfContnrs; interface {$DEFINE MULTI_THREAD_QUEUE} //线程安全版本,如果不需要线程安全,请注释掉此行代码 {$IFDEF MULTI_THR ...

  3. ASP.NET CORE RAZOR :将搜索添加到 Razor 页面应用

    https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/razor-pages/search 本文档中,将向索引页面添加搜索功能以实现按“流派”或 ...

  4. JS input 银行卡号格式转换

    replace(/\D/g,'').replace(/....(?!$)/g,'$& ')

  5. 一个可以模拟GET,POST,PUT,DELET请求的HTTP在线工具

    一个简陋的HTTP请求工具,UI比较丑陋.0.0,可以用于接口调试. 之前在调试公司的远程接口的时候用的是curl,后来也在网上找到几种Http请求模拟的客户端程序.当时后来发现google app ...

  6. Springboot Maven 多模块项目中 @Service跨模块引用失败的问题

    子模块中引用另一个子模块中的Service, @Autowired失败. 添加了模块之间的依赖没解决. 组以后在启动类上加上 @SpringBootApplication(scanBasePackag ...

  7. SpringBoot Idea 启动报错 Process finished with exit code 1

    问题描述:没有其他任何错误日志,只有Process finished with exit code 1 问题原因:Maven POM.xml问题造成 由于是properties是我直接从其他项目中拷贝 ...

  8. nandecc--am335x

    u-boot支持下列NAND ECC算法: 1.S/W ECC(Hamming code),软件ECC校验. 2.H/W ECC(Hamming code,BCH8). BCH Flash OOB L ...

  9. nginx大量TIME_WAIT的解决办法 netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

    vi /etc/sysctl.conf net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_reuse=1 #让TIME_WAIT状态可以重用,这样即使TIME_W ...

  10. 谷歌宣称web组件才是web开发的未来

    谷歌宣称web组件才是web开发的未来 虽然今年的谷歌I/O大会没有出现像去年谷歌眼镜发布时直播疯狂跳伞这样的活动,但是上周仍然有不少产品推出.谷歌宣布对谷歌地图.搜索.安卓,以及其他 很多产品做出更 ...