修改涉及到寄存器,中断定义等
寄存器修改的地方
修改地方:
1,所有IIC的寄存器由S3C2410X.H定义的的GPECON改成2440.H定义rGPECON
2,
v_pIICPregs = (volatile S3C2410X_IICBUS_REG *)VirtualAlloc(0, sizeof(S3C2410X_IICBUS_REG), MEM_RESERVE, PAGE_NOACCESS);
修改为:
v_pIICPregs = (volatile IICreg *)VirtualAlloc(0, sizeof(IICreg), MEM_RESERVE, PAGE_NOACCESS);
这里也要做如下修改:
if (!VirtualCopy((PVOID)v_pIICPregs, (PVOID)(IIC_BASE >> 8), sizeof(IICreg), PAGE_PHYSICAL | PAGE_READWRITE | PAGE_NOCACHE))
因为2440.H中IIC寄存器定义是这样的:
#define IIC_BASE 0xB1400000 // 54000000
#define IICFIF_PHYS 0x54000000 // physical address of IIC
typedef struct {
unsigned int rIICCON;
unsigned int rIICSTAT;
unsigned int rIICADD;
unsigned int rIICDS;
unsigned int rIICLC;
}IICreg;
3,中断定义的修改:
/* I2C 的物理中断号及逻辑中断号 */
//根据自己的中断平台修改 ZHOUYI EIDIT 09-7-30
//UINT32 g_I2CIrq = IRQ_IIC;
//UINT32 g_I2CSysIntr = SYSINTR_UNDEFINED;
UINT32 g_I2CIrq = INTSRC_IIC;
UINT32 g_I2CSysIntr = SYSINTR_IIC;
4,加入#include <oalintr.h>//zhouyi add 09-7-30