关于CIS需要清楚的:
1、CIS是什么
CIS-Card Information Structure的缩写,CIS的作用:
The CIS includes information on power, function, manufacturer and other things the host
needs to determine if the I/O function(s) is appropriate to power-up.
2、CIS的呈现
CIS位于CIA区域,地址寻址范围0x001000~0x017FFF。CIS有两类:
(1)Common CIS,记录整张card的通用信息,比如厂商、VID等信息。
(2)Function CIS,每一个Function的特有信息。
一个CIS元素的组织结构:
它由结构体sdio_func_tuple表征:
/*
* SDIO function CIS tuple (unknown to the core)
*/
struct sdio_func_tuple {
struct sdio_func_tuple *next;
unsigned char code;
unsigned char size;
unsigned char data[0];
};
这里总结下Function:Function代表card的一个具体功能,每一个card具有多个Function,Function的标号为0~7,特别地,0号针对的是CIA(可以简单理解就是用来访问CIA区域的)。在软件层面,Function由struct sdio_func表示,它作为一个device注册到系统中。
3、CIS的访问
需要两个条件:命令CMD52;CIS地址。
对于Common CIS,其地址保存在CCCR的0x09~0x0B地址处的寄存器中,3个寄存器值组成一个24位的地址。