4 // ==========================================================================
6 // Module Name: mxcmci_mmc.h
8 // General Description: Limited Bootloader eSDHC Driver.
11 // ==========================================================================
12 //####ECOSGPLCOPYRIGHTBEGIN####
13 // -------------------------------------------
14 // This file is part of eCos, the Embedded Configurable Operating System.
15 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
17 // eCos is free software; you can redistribute it and/or modify it under
18 // the terms of the GNU General Public License as published by the Free
19 // Software Foundation; either version 2 or (at your option) any later version.
21 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
22 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
23 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 // You should have received a copy of the GNU General Public License along
27 // with eCos; if not, write to the Free Software Foundation, Inc.,
28 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
30 // As a special exception, if other files instantiate templates or use macros
31 // or inline functions from this file, or you compile this file and link it
32 // with other works to produce a work based on this file, this file does not
33 // by itself cause the resulting work to be covered by the GNU General Public
34 // License. However the source code for this file must still be made available
35 // in accordance with section (3) of the GNU General Public License.
37 // This exception does not invalidate any other reasons why a work based on
38 // this file might be covered by the GNU General Public License.
40 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
41 // at http://sources.redhat.com/ecos/ecos-license/
42 // -------------------------------------------
43 //####ECOSGPLCOPYRIGHTEND####
44 //==========================================================================
45 //#####DESCRIPTIONBEGIN####
47 // Author(s): Lewis Liu <weizhi.liu@freescale.com>
48 // Contributors: Lewis Liu <weizhi.liu@freescale.com>
49 // Date: 2008-05-13 Initial version
54 //####DESCRIPTIONEND####
55 //====================================================================================================
58 #define MMC_OCR_VALUE 0x40FF8000
59 #define MMC_OCR_VALUE_BAK 0x80FFC000
60 #define MMC_OCR_HC_RES 0xC0FF8000
61 #define MMC_OCR_LC_RES 0x80FF8000
62 #define MMC_OCR_VALUE_MASK 0x00FF8000
65 #define CARD_BUSY_BIT 0x80000000
66 #define CURR_STATE_SHIFT 9
67 #define MMC_SPEC_VER 0x003C0000
68 #define MMC_SPEC_VER_SHIFT 18
69 #define MMC_R1_SWITCH_ERROR_MASK 0x80
70 #define SWITCH_ERROR_SHIFT 7
71 #define BUS_SIZE_SHIFT 2
72 #define BUS_WIDTH 0x3b700000
75 extern cyg_uint32 mmc_init(cyg_uint32);
76 extern cyg_uint32 mmc_data_read (cyg_uint32 *,cyg_uint32 ,cyg_uint32);
77 extern cyg_uint32 mmc_data_write (cyg_uint32 *src_ptr,cyg_uint32 length,cyg_uint32 offset);
78 extern cyg_uint32 mmc_data_erase (cyg_uint32 offset, cyg_uint32 size);
79 extern cyg_uint32 mmc_voltage_validation (void);
80 extern cyg_uint32 mmc_get_spec_ver (void);
81 extern cyg_uint32 sd_voltage_validation (void);
82 extern cyg_uint32 sd_init(cyg_uint32);
83 extern cyg_uint32 card_flash_query(void* data);
93 #endif /* _MXCMCI_MMC_H_ */