Linux内核srio驱动,Zynq—Linux移植学习笔记(十四):RapidIO驱动开发

#define DRIVER_NAME "xiic-rio"

#define SRIO_ZYNQ_BASEADDR 0x40000000

#define SRIO_ZYNQ_NODE_BASEADDR 0x10100

#define SRIO_ZYNQ_MAX_HOPCOUNT 13

struct xiic_rio {

struct mutex lock;

u8 *data;

};

/* We need global varriable for maped address */

static void __iomem* _rio_base = NULL;

static inline void rio_setreg32(unsigned int addrBase,unsigned int addrOffset,unsigned int value)

{

iowrite32(value, addrBase + addrOffset);

}

static inline int rio_getreg32(unsigned int addrBase,unsigned int addrOffset)

{

unsigned int reg_addr;

reg_addr=addrBase+addrOffset;

return ioread32(reg_addr);

}

static ssize_t hlMaintWrite(unsigned int dstId,unsigned short hopcount, unsigned int offset, unsigned int writedata)

{

unsign

你可能感兴趣的:(Linux内核srio驱动)