1 #ifndef _MXCMCI_CORE_H_
2 #define _MXCMCI_CORE_H_
4 /*=================================================================================
6 Module Name: mxcmci_core.h
8 General Description: Limited Bootloader eSDHC Driver.
10 ===================================================================================
11 Copyright: 2004,2005,2006,2007,2008 FREESCALE, INC.
12 All Rights Reserved. This file contains copyrighted material.
13 Use of this file is restricted by the provisions of a
14 Freescale Software License Agreement, which has either
15 accompanied the delivery of this software in shrink wrap
16 form or been expressly executed between the parties.
21 Author (core ID) Date Number Description of Changes
22 ------------------------- ------------ ---------- --------------------------
23 Lewis Liu 18-June-2008
26 Portability: Portable to other compilers or platforms.
28 ====================================================================================================*/
30 #include "mxcmci_mmc.h"
31 #include "mxcmci_host.h"
40 #define TWO_K_SIZE 2048
41 #define MMCSD_READY_TIMEOUT 3000 /* ~(3s / (2 * 48 * 10us)) */
42 #define ESDHC_ACMD41_TIMEOUT 48000 /* 1.5 sec =1500 msec delay for ACMD41 cmd */
45 #define CURR_CARD_STATE(r) ((cyg_uint32) ((r) & 0x1E00) >> 9)
47 /*Defines of CSD data*/
48 #define CSD_STRUCT_MSK 0x00C00000
49 #define CSD_STRUCT_SHIFT 22
50 #define MMC_CSD_SPEC_VERS_MASK 0x003C0000
51 #define MMC_CSD_SPEC_VERS_SHIFT 18
53 extern cyg_uint32 Card_rca;
54 extern cyg_uint32 address_mode;
55 extern cyg_uint32 MMC_Spec_vers;
56 extern card_specific_data csd; /* Global variable for Card Specific Data */
57 extern cyg_uint32 Card_capacity_size; /* Capacity size (C_SIZE) for card*/
58 extern cyg_uint32 CCC; /* Card Command Class */
61 /* Defines the id for each command */
98 /* Defines for the states of the card*/
112 /* Defines for card types */
133 /* CARD Flash Configuration Parameters Structure */
135 cyg_uint32 length; /* Length of Card data to read */
136 } CARD_FLASH_CFG_PARMS_T;
138 /*==================================================================================================
140 ==================================================================================================*/
142 /*==================================================================================================
144 ==================================================================================================*/
145 extern cyg_uint32 mxcmci_init (cyg_uint32 bus_width, cyg_uint32 base_address);
146 extern cyg_uint32 mxcmci_data_read (cyg_uint32* dest_ptr,cyg_uint32 len,cyg_uint32 offset);
147 extern cyg_uint32 mxcmci_software_reset (void);
148 extern cyg_uint32 mxcmci_get_cid (void);
149 extern cyg_uint32 mxcmci_trans_prepare(void);
150 extern void mxcmci_cmd_config (command_t *cmd_config,cyg_uint32 index,cyg_uint32 argument,xfer_type_t transfer,response_format_t format,
151 data_present_select data,crc_check_enable crc,cmdindex_check_enable cmdindex);
154 #endif //_MXCMCI_CORE_H_