mmcreg.h (188044) | mmcreg.h (234524) |
---|---|
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 188044 2009-02-03 04:28:45Z imp $ | 51 * $FreeBSD: head/sys/dev/mmc/mmcreg.h 234524 2012-04-21 01:51:16Z marius $ |
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. --- 74 unchanged lines hidden (view full) --- 134#define R1_CSD_OVERWRITE (1u << 16) /* erx, c */ 135#define R1_WP_ERASE_SKIP (1u << 15) /* erx, c */ 136#define R1_CARD_ECC_DISABLED (1u << 14) /* sx, a */ 137#define R1_ERASE_RESET (1u << 13) /* sr, c */ 138#define R1_CURRENT_STATE_MASK (0xfu << 9) /* sx, b */ 139#define R1_READY_FOR_DATA (1u << 8) /* sx, a */ 140#define R1_APP_CMD (1u << 5) /* sr, c */ 141#define R1_AKE_SEQ_ERROR (1u << 3) /* er, c */ | 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. --- 74 unchanged lines hidden (view full) --- 134#define R1_CSD_OVERWRITE (1u << 16) /* erx, c */ 135#define R1_WP_ERASE_SKIP (1u << 15) /* erx, c */ 136#define R1_CARD_ECC_DISABLED (1u << 14) /* sx, a */ 137#define R1_ERASE_RESET (1u << 13) /* sr, c */ 138#define R1_CURRENT_STATE_MASK (0xfu << 9) /* sx, b */ 139#define R1_READY_FOR_DATA (1u << 8) /* sx, a */ 140#define R1_APP_CMD (1u << 5) /* sr, c */ 141#define R1_AKE_SEQ_ERROR (1u << 3) /* er, c */ |
142#define R1_STATUS(x) (x & 0xFFFFE000 143#define R1_CURRENT_STATE(x) ((x) & R1_CURRENT_STATE_MASK) >> 9 | 142#define R1_STATUS(x) ((x) & 0xFFFFE000) 143#define R1_CURRENT_STATE(x) (((x) & R1_CURRENT_STATE_MASK) >> 9) |
144#define R1_STATE_IDLE 0 145#define R1_STATE_READY 1 146#define R1_STATE_IDENT 2 147#define R1_STATE_STBY 3 148#define R1_STATE_TRAN 4 149#define R1_STATE_DATA 5 150#define R1_STATE_RCV 6 151#define R1_STATE_PRG 7 --- 173 unchanged lines hidden (view full) --- 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 | 144#define R1_STATE_IDLE 0 145#define R1_STATE_READY 1 146#define R1_STATE_IDENT 2 147#define R1_STATE_STBY 3 148#define R1_STATE_TRAN 4 149#define R1_STATE_DATA 5 150#define R1_STATE_RCV 6 151#define R1_STATE_PRG 7 --- 173 unchanged lines hidden (view full) --- 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_CLR_CARD_DETECT 0 334#define SD_SET_CARD_DETECT 1 335 |
|
333#define SD_MAX_HS 50000000 334 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 --- 34 unchanged lines hidden (view full) --- 375 uint32_t psn; 376 uint16_t oid; 377 uint16_t mdt_year; 378 uint8_t mdt_month; 379 uint8_t prv; 380 uint8_t fwrev; 381}; 382 | 336#define SD_MAX_HS 50000000 337 338/* OCR bits */ 339 340/* 341 * in SD 2.0 spec, bits 8-14 are now marked reserved 342 * Low voltage in SD2.0 spec is bit 7, TBD voltage 343 * Low voltage in MC 3.31 spec is bit 7, 1.65-1.95V --- 34 unchanged lines hidden (view full) --- 378 uint32_t psn; 379 uint16_t oid; 380 uint16_t mdt_year; 381 uint8_t mdt_month; 382 uint8_t prv; 383 uint8_t fwrev; 384}; 385 |
383struct mmc_csd | 386struct mmc_csd |
384{ 385 uint8_t csd_structure; 386 uint8_t spec_vers; 387 uint16_t ccc; 388 uint16_t tacc; 389 uint32_t nsac; 390 uint32_t r2w_factor; 391 uint32_t tran_speed; --- 49 unchanged lines hidden --- | 387{ 388 uint8_t csd_structure; 389 uint8_t spec_vers; 390 uint16_t ccc; 391 uint16_t tacc; 392 uint32_t nsac; 393 uint32_t r2w_factor; 394 uint32_t tran_speed; --- 49 unchanged lines hidden --- |