Deleted Added
sdiff udiff text old ( 183542 ) new ( 183704 )
full compact
1/*-
2 * Copyright (c) 2006 M. Warner Losh. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 34 unchanged lines hidden (view full) ---

43 * right of the SD Group, SD-3C LLC, the SD Card Association or any third
44 * parties, which may result from its use. No license is granted by
45 * implication, estoppel or otherwise under any patent or other rights of the
46 * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing
47 * herein shall be construed as an obligation by the SD Group, the SD-3C LLC
48 * or the SD Card Association to disclose or distribute any technical
49 * information, know-how or other confidential information to any third party.
50 *
51 * $FreeBSD: head/sys/dev/mmc/mmcreg.h 183542 2008-10-02 07:06:59Z imp $
52 */
53
54#ifndef DEV_MMC_MMCREG_H
55#define DEV_MMC_MMCREG_H
56
57/*
58 * This file contains the register definitions for the mmc and sd busses.
59 * They are taken from publicly available sources.

--- 21 unchanged lines hidden (view full) ---

81
82/* Possible response types defined in the standard: */
83#define MMC_RSP_NONE (0)
84#define MMC_RSP_R1 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE)
85#define MMC_RSP_R1B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE | MMC_RSP_BUSY)
86#define MMC_RSP_R2 (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC)
87#define MMC_RSP_R3 (MMC_RSP_PRESENT)
88#define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC)
89/* R7 -- new in sd 2.0 */
90#define MMC_RSP(x) ((x) & MMC_RSP_MASK)
91 uint32_t retries;
92 uint32_t error;
93#define MMC_ERR_NONE 0
94#define MMC_ERR_TIMEOUT 1
95#define MMC_ERR_BADCRC 2
96#define MMC_ERR_FIFO 3
97#define MMC_ERR_FAILED 4

--- 78 unchanged lines hidden (view full) ---

176/* Class 0 and 1: Basic commands & read stream commands */
177#define MMC_GO_IDLE_STATE 0
178#define MMC_SEND_OP_COND 1
179#define MMC_ALL_SEND_CID 2
180#define MMC_SET_RELATIVE_ADDR 3
181#define SD_SEND_RELATIVE_ADDR 3
182#define MMC_SET_DSR 4
183 /* reserved: 5 */
184#define MMC_SELECT_CARD 7
185#define MMC_DESELECT_CARD 7
186#define MMC_SEND_IF_COND 8
187#define MMC_SEND_CSD 9
188#define MMC_SEND_CID 10
189#define MMC_READ_DAT_UNTIL_STOP 11
190#define MMC_STOP_TRANSMISSION 12
191#define MMC_SEND_STATUS 13
192 /* reserved: 14 */
193#define MMC_GO_INACTIVE_STATE 15
194
195/* Class 2: Block oriented read commands */
196#define MMC_SET_BLOCKLEN 16
197#define MMC_READ_SINGLE_BLOCK 17
198#define MMC_READ_MULTIPLE_BLOCK 18
199 /* reserved: 19 */
200
201/* Class 3: Stream write commands */

--- 70 unchanged lines hidden (view full) ---

272#define ACMD_SET_BUS_WIDTH 6
273#define ACMD_SD_STATUS 13
274#define ACMD_SEND_NUM_WR_BLOCKS 22
275#define ACMD_SET_WR_BLK_ERASE_COUNT 23
276#define ACMD_SD_SEND_OP_COND 41
277#define ACMD_SET_CLR_CARD_DETECT 42
278#define ACMD_SEND_SCR 51
279
280/* OCR bits */
281
282/*
283 * in SD 2.0 spec, bits 8-14 are now marked reserved
284 * Low voltage in SD2.0 spec is bit 7, TBD voltage
285 * Low voltage in MC 3.31 spec is bit 7, 1.65-1.95V
286 * Specs prior to MMC 3.31 defined bits 0-7 as voltages down to 1.5V.
287 * 3.31 redefined them to be reserved and also said that cards had to

--- 35 unchanged lines hidden (view full) ---

323 uint8_t mdt_month;
324 uint8_t prv;
325 uint8_t fwrev;
326};
327
328struct mmc_csd
329{
330 uint8_t csd_structure;
331 uint16_t ccc;
332 uint16_t tacc;
333 uint32_t nsac;
334 uint32_t r2w_factor;
335 uint32_t tran_speed;
336 uint32_t read_bl_len;
337 uint32_t write_bl_len;
338 uint32_t vdd_r_curr_min;

--- 7 unchanged lines hidden (view full) ---

346 read_blk_misalign:1,
347 write_bl_partial:1,
348 write_blk_misalign:1,
349 dsr_imp:1,
350 erase_blk_en:1,
351 wp_grp_enable:1;
352};
353
354/*
355 * Older versions of the MMC standard had a variable sector size. However,
356 * I've been able to find no old MMC or SD cards that have a non 512
357 * byte sector size anywhere, so we assume that such cards are very rare
358 * and only note their existance in passing here...
359 */
360#define MMC_SECTOR_SIZE 512
361
362#endif /* DEV_MMCREG_H */