Deleted Added
full compact
mmcreg.h (184033) mmcreg.h (188044)
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 *
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 184033 2008-10-18 16:17:04Z mav $
51 * $FreeBSD: head/sys/dev/mmc/mmcreg.h 188044 2009-02-03 04:28:45Z 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.

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

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
98#define MMC_ERR_INVALID 5
99#define MMC_ERR_NO_MEMORY 6
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.

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

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
98#define MMC_ERR_INVALID 5
99#define MMC_ERR_NO_MEMORY 6
100#define MMC_ERR_MAX 6
100 struct mmc_data *data; /* Data segment with cmd */
101 struct mmc_request *mrq; /* backpointer to request */
102};
103
104/*
105 * R1 responses
106 *
107 * Types (per SD 2.0 standard)

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

282#define ACMD_SET_WR_BLK_ERASE_COUNT 23
283#define ACMD_SD_SEND_OP_COND 41
284#define ACMD_SET_CLR_CARD_DETECT 42
285#define ACMD_SEND_SCR 51
286
287/*
288 * EXT_CSD fields
289 */
101 struct mmc_data *data; /* Data segment with cmd */
102 struct mmc_request *mrq; /* backpointer to request */
103};
104
105/*
106 * R1 responses
107 *
108 * Types (per SD 2.0 standard)

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

283#define ACMD_SET_WR_BLK_ERASE_COUNT 23
284#define ACMD_SD_SEND_OP_COND 41
285#define ACMD_SET_CLR_CARD_DETECT 42
286#define ACMD_SEND_SCR 51
287
288/*
289 * EXT_CSD fields
290 */
290
291#define EXT_CSD_ERASE_GRP_DEF 175 /* R/W */
292#define EXT_CSD_BUS_WIDTH 183 /* R/W */
293#define EXT_CSD_HS_TIMING 185 /* R/W */
294#define EXT_CSD_CARD_TYPE 196 /* RO */
295#define EXT_CSD_REV 192 /* RO */
296#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
297#define EXT_CSD_ERASE_TO_MULT 223 /* RO */
298#define EXT_CSD_ERASE_GRP_SIZE 224 /* RO */
299
300/*
301 * EXT_CSD field definitions
302 */
291#define EXT_CSD_ERASE_GRP_DEF 175 /* R/W */
292#define EXT_CSD_BUS_WIDTH 183 /* R/W */
293#define EXT_CSD_HS_TIMING 185 /* R/W */
294#define EXT_CSD_CARD_TYPE 196 /* RO */
295#define EXT_CSD_REV 192 /* RO */
296#define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */
297#define EXT_CSD_ERASE_TO_MULT 223 /* RO */
298#define EXT_CSD_ERASE_GRP_SIZE 224 /* RO */
299
300/*
301 * EXT_CSD field definitions
302 */
303
304#define EXT_CSD_CMD_SET_NORMAL 1
305#define EXT_CSD_CMD_SET_SECURE 2
306#define EXT_CSD_CMD_SET_CPSECURE 4
307
308#define EXT_CSD_CARD_TYPE_26 1
309#define EXT_CSD_CARD_TYPE_52 2
310
311#define EXT_CSD_BUS_WIDTH_1 0
312#define EXT_CSD_BUS_WIDTH_4 1
313#define EXT_CSD_BUS_WIDTH_8 2
314
303#define EXT_CSD_CMD_SET_NORMAL 1
304#define EXT_CSD_CMD_SET_SECURE 2
305#define EXT_CSD_CMD_SET_CPSECURE 4
306
307#define EXT_CSD_CARD_TYPE_26 1
308#define EXT_CSD_CARD_TYPE_52 2
309
310#define EXT_CSD_BUS_WIDTH_1 0
311#define EXT_CSD_BUS_WIDTH_4 1
312#define EXT_CSD_BUS_WIDTH_8 2
313
314#define MMC_TYPE_26_MAX_HS 26000000
315#define MMC_TYPE_52_MAX_HS 52000000
316
315/*
316 * SD bus widths
317 */
318#define SD_BUS_WIDTH_1 0
319#define SD_BUS_WIDTH_4 2
320
317/*
318 * SD bus widths
319 */
320#define SD_BUS_WIDTH_1 0
321#define SD_BUS_WIDTH_4 2
322
323/*
324 * SD Switch
325 */
326#define SD_SWITCH_MODE_CHECK 0
327#define SD_SWITCH_MODE_SET 1
328#define SD_SWITCH_GROUP1 0
329#define SD_SWITCH_NORMAL_MODE 0
330#define SD_SWITCH_HS_MODE 1
331#define SD_SWITCH_NOCHANGE 0xF
332
333#define SD_MAX_HS 50000000
334
321/* OCR bits */
322
323/*
324 * in SD 2.0 spec, bits 8-14 are now marked reserved
325 * Low voltage in SD2.0 spec is bit 7, TBD voltage
326 * Low voltage in MC 3.31 spec is bit 7, 1.65-1.95V
327 * Specs prior to MMC 3.31 defined bits 0-7 as voltages down to 1.5V.
328 * 3.31 redefined them to be reserved and also said that cards had to

--- 98 unchanged lines hidden ---
335/* OCR bits */
336
337/*
338 * in SD 2.0 spec, bits 8-14 are now marked reserved
339 * Low voltage in SD2.0 spec is bit 7, TBD voltage
340 * Low voltage in MC 3.31 spec is bit 7, 1.65-1.95V
341 * Specs prior to MMC 3.31 defined bits 0-7 as voltages down to 1.5V.
342 * 3.31 redefined them to be reserved and also said that cards had to

--- 98 unchanged lines hidden ---