Date: Sat, 31 Mar 2012 22:47:21 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 208896 for review Message-ID: <201203312247.q2VMlLqk038851@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@208896?ac=10 Change 208896 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/03/31 22:46:58 Add definitions for Altera SD Card IP Core register and buffer offsets, as well as a few common SD Card commands that we'll need in the driver. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard.h#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard.h#2 (text+ko) ==== @@ -96,6 +96,21 @@ struct bio *bp); /* + * I/O register/buffer offsets, from Table 4.1.1 in the Altera University + * Program SD Card IP Core specification. + */ +#define ALTERA_SDCARD_OFF_RXTX_BUFFER 0 /* 512-byte I/O buffer */ +#define ALTERA_SDCARD_OFF_CID 512 /* 16-byte Card ID number */ +#define ALTERA_SDCARD_OFF_CSD 528 /* 16-byte Card Specific Data */ +#define ALTERA_SDCARD_OFF_OCR 544 /* Operating Conditions Reg */ +#define ALTERA_SDCARD_OFF_SR 548 /* SD Card Status Register */ +#define ALTERA_SDCARD_OFF_RCA 552 /* Relative Card Address Reg */ +#define ALTERA_SDCARD_OFF_CMD_ARG 556 /* Command Argument Register */ +#define ALTERA_SDCARD_OFF_CMD 560 /* Command Register */ +#define ALTERA_SDCARD_OFF_ASR 564 /* Auxiliary Status Register */ +#define ALTERA_SDCARD_OFF_RR1 568 /* Response R1 */ + +/* * The Altera IP Core provides a 16-bit "Additional Status Register" (ASR) * beyond those described in the SD Card specification that captures IP Core * transaction state, such as whether the last command is in progress, the @@ -112,7 +127,16 @@ * Although SD Cards may have various sector sizes, the Altera IP Core * requires that I/O be done in 512-byte chunks. */ -#define ALTERA_SDCARD_SECTORSIZE 512 +#define ALTERA_SDCARD_SECTORSIZE 512 + +/* + * SD Card commands used in this driver. + */ +#define ALTERA_SDCARD_CMD_SEND_RCA 0x03 /* Retrieve card RCA. */ +#define ALTERA_SDCARD_CMD_SEND_CSD 0x09 /* Retrieve CSD register. */ +#define ALTERA_SDCARD_CMD_SEND_CID 0x0A /* Retrieve CID register. */ +#define ALTERA_SDCARD_CMD_READ_BLOCK 0x11 /* Read block from disk. */ +#define ALTERA_SDCARD_CMD_WRITE_BLOCK 0x18 /* Write block to disk. */ /* * Functions exposed by the device driver core to newbus(9) bus attachment
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203312247.q2VMlLqk038851>