uclinux-2008R1-RC8(bf561)到VDSP5的移植(5):CONFIG_BANK_x

 
  
在加入head.s后有这么几个链接错误:
        'CONFIG_BANK_0' referenced from 'corea.dlb[head.doj]'
        'CONFIG_BANK_1' referenced from 'corea.dlb[head.doj]'
        'CONFIG_BANK_2' referenced from 'corea.dlb[head.doj]'
        'CONFIG_BANK_3' referenced from 'corea.dlb[head.doj]'
查一下CONFIG_BANK_x的定义,它们的作用是EBIU的配置,在asm/mach/bf561.h中是这样使用的:
#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
而在head.s中配置EBIU时使用了这两个值
       /* Code for initializing Async memory banks */
 
       p2.h = hi(EBIU_AMBCTL1);
       p2.l = lo(EBIU_AMBCTL1);
       r0.h = hi(AMBCTL1VAL);
       r0.l = lo(AMBCTL1VAL);
       [p2] = r0;
       ssync;
 
       p2.h = hi(EBIU_AMBCTL0);
       p2.l = lo(EBIU_AMBCTL0);
       r0.h = hi(AMBCTL0VAL);
       r0.l = lo(AMBCTL0VAL);
       [p2] = r0;
       ssync;
 
       p2.h = hi(EBIU_AMGCTL);
       p2.l = lo(EBIU_AMGCTL);
       r0 = AMGCTLVAL;
       w[p2] = r0;
       ssync;
显然,编译器找不到CONFIG_BANK_x的定义,想当然地以为它是一个整数,所以出错,解决此错误的方法是在config.h中加上这样的定义:
 
// EBIU_AMBCTL Control
#define CONFIG_BANK_0                        0x7BB0
#define CONFIG_BANK_1                          0x7BB0
#define CONFIG_BANK_2                          0x7BB0
#define CONFIG_BANK_3                          0xAAC3
#define CONFIG_C_AMBEN_ALL                     1
当然,根据需要,它们可以配置为其它的值。

你可能感兴趣的:(c,编译器)