<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
快乐虾
http://blog.csdn.net/lights_joy/
lights@hb165.com
本文适用于
ADI bf561 DSP
uclinux-2008r1.5-rc3
Visual DSP++ 5.0(update 5)
欢迎转载,但请保留作者信息
在编译head.s时有一警告:
[Warning pp0038] "..\linux-2.6.x\include\asm/mach/mem_init.h":31 macro 'CONFIG_MEM_MT48LC<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75' not currently defined - 0 assumed
其指向的代码为mem_init.h中的如下代码:
#if (CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75 || CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="64" unitname="m">64M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="4" unitname="a">4A</chmetcnv>2FB_7E || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="8" unitname="m">8M</chmetcnv>32B2B5_7)
#if (CONFIG_SCLK_HZ > 119402985)
#define SDRAM_tRP TRP_2
#define SDRAM_tRP_num 2
#define SDRAM_tRAS TRAS_7
#define SDRAM_tRAS_num 7
#define SDRAM_tRCD TRCD_2
#define SDRAM_tWR TWR_2
#endif
…………….
#endif
在代码中搜索CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75有如下结果:
F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\.config(152):CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75=y
F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\arch\blackfin\configs\BF561-EZKIT_defconfig(144):CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75=y
F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\asm\mach\mem_init.h(31):#if (CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75 || CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="64" unitname="m">64M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="4" unitname="a">4A</chmetcnv>2FB_7E || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="8" unitname="m">8M</chmetcnv>32B2B5_7)
F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\asm\mach\mem_init.h(106):#if (CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75)
F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\config\auto.conf(231):CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75=y
F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\linux\autoconf.h(232):#define CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75 1
也即是说,在默认配置下这个开关是打开的,但是它的影响只局限在mem_init.h中。从mem_init.h中还可以发现,
#if (CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75 || CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="64" unitname="m">64M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="4" unitname="a">4A</chmetcnv>2FB_7E || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="8" unitname="m">8M</chmetcnv>32B2B5_7)
上面出现的4个宏分别为SDRAM定义了不同的参数,因此可以根据需要将这4个宏中的一个定义为1,比如定义CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75后就可以得到一组SDRAM的参数:
#if (CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75)
/*SDRAM INFORMATION: */
#define SDRAM_Tref 64 /* Refresh period in milliseconds */
#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
#define SDRAM_CL CL_3
#endif
同样,其它的几个宏可以得到另外一组参数。
嗯,我们和ezkit取一样的值,在config.h中定义:
#define CONFIG_MEM_MT48LC<chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="m">16M</chmetcnv><chmetcnv w:st="on" tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="16" unitname="a">16A</chmetcnv>2TG_75 1 // 参见include/asm/mach/mem_init.h
参考资料
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(1):前言(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(2):代码注释(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(3):vdsp项目创建(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(4):目录差异(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(5):'bf561.h'的问题(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)
uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(6):CONFIG_BFIN_KERNEL_CLOCK(<chsdate w:st="on" year="2009" month="1" day="12" islunardate="False" isrocdate="False">2009-1-12</chsdate>)