首页 > 学院 > 开发设计 > 正文

Linux驱动:TI达芬奇系列kernel中cup类型的判断,以cpu_is_ti81xx()为例

2019-11-06 07:55:25
字体:
来源:转载
供稿:网友

cpu_is_ti81xx()      为真

 

cpu.h (arch/arm/plat-omap/include/plat)

1、

# define cpu_is_ti81xx()              is_ti81xx()

# define cpu_is_ti814x()              is_ti814x()

 

2、

#define IS_TI_CLASS(class, id)                        /

static inline int is_ti##class(void)               /

{                                               /

       return(GET_OMAP_CLASS == (id)) ? 1 : 0;     /

}

 

3、IS_TI_CLASS(81xx, 0x81)

 

4、#define GET_OMAP_CLASS (omap_rev() & 0xff)

 

5、unsigned int omap_rev(void)

{

       returnomap_revision;

}

 

6、void __initti81xx_check_revision(void)

{。。。。。。

idcode =read_tap_reg(TI81XX_CONTROL_DEVICE_ID);

       partnum = (idcode>> 12) & 0xffff;     //见下图中PART NUMBER

       rev = (idcode >>28) & 0xf;

if (partnum ==0xb81e) {。。。。。。}

} else if((partnum == 0xb8f2)) {。。。。。。

switch (rev) {。。。。。。

              case 1:

                     omap_revision = TI8148_REV_ES1_0;

                     strcpy(cpu_rev,"1.0");

                     break;。。。。。。

 

7、#define TI81XX_CLASS        0x81000081

#define TI814X_CLASS              0x81400081

#define TI8148_REV_ES1_0       TI814X_CLASS

 

 


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表