I.MX6 uSDHC SD card register

/****************************************************************************
 *                  I.MX6 uSDHC SD card register
 * 声明:
 *     本文主要是记录SD card注册的相关流程及遇到的一些问题。
 *
 *                                       2015-12-20 深圳 南山平山村 曾剑锋
 ***************************************************************************/


                    \\\\\\\\\\\\\-*- 目录 -*-/////////////
                    |  一、参考文章:    
                    |  二、引脚配置:    
                    |  三、板级文件配置:    
                    |  四、开启SDHCI驱动:    
                    |  五、解决ExExplorer无法删除文件    
                    -------------------------------------


一、参考文章:
    Android 4.4.2 SD卡权限修复器1.2中文版
        http://www.sonyue.com/bbs/forum.php?mod=viewthread&tid=93351

二、引脚配置:
    cat arch/arm/mach-mx6/board-mx6dl_sabresd.h
        ......
        static iomux_v3_cfg_t mx6dl_sabresd_pads[] = {
            ......
            /* USDHC3 */ 
            MX6DL_PAD_SD3_CLK__USDHC3_CLK_50MHZ, 
            MX6DL_PAD_SD3_CMD__USDHC3_CMD_50MHZ, 
            MX6DL_PAD_SD3_DAT0__USDHC3_DAT0_50MHZ,
            MX6DL_PAD_SD3_DAT1__USDHC3_DAT1_50MHZ,
            MX6DL_PAD_SD3_DAT2__USDHC3_DAT2_50MHZ,
            MX6DL_PAD_SD3_DAT3__USDHC3_DAT3_50MHZ,
        
            /* SD3_CD */
            MX6DL_PAD_KEY_COL2__GPIO_4_10,
            /* SD3_WP  未使用*/
            MX6DL_PAD_SD3_RST__GPIO_7_8,
            ......
        }
        .....

三、板级文件配置:
    cat arch/arm/mach-mx6/board-mx6q_sabresd.c
        ......
        #define SABRESD_SD3_CD      IMX_GPIO_NR(4, 10)
        ......
        static const struct esdhc_platform_data mx6q_sabresd_sd3_data __initconst = {
            .cd_gpio = SABRESD_SD3_CD,
            //没有接,所以不用,另一个原因是我们使用的是TF卡,没有写保护的问题
            //.wp_gpio = SABRESD_SD3_WP, 
            .keep_power_at_suspend = 1,
            .support_8bit = 1,
            .delay_line = 0,
            .cd_type = ESDHC_CD_CONTROLLER,
            .runtime_pm = 1,
        };
        ......
        /**
         * Board specific initialization.
         */
        static void __init mx6_sabresd_board_init(void)
        {
            ......
            //当前我们的SD卡挂载在这个上面
            imx6q_add_sdhci_usdhc_imx(2, &mx6q_sabresd_sd3_data);
            ......
        }
        .....

四、开启SDHCI驱动:
    打开下列红线框出的驱动:
    ────────────────────────────────────────────────────────────────────────────── 
    ┌───────────────────────── MMC/SD/SDIO card support ─────────────────────────┐
    │  Arrow keys navigate the menu.   selects submenus --->.             │  
    │  Highlighted letters are hotkeys.  Pressing  includes,  excludes,    │  
    │   modularizes features.  Press  to exit,  for Help,     │  
    │  for Search.  Legend: [*] built-in  [ ] excluded   module  < > module   │  
    │ ┌────^(-)────────────────────────────────────────────────────────────────┐ │  
    │ │    [*]     Deferr MMC layer resume until I/O is requested              │ │  
    │ │    < >   SDIO UART/GPS class support                                   │ │  
    │ │    <*>   MMC host test driver                                          │ │  
    │ │          *** MMC/SD/SDIO Host Controller Drivers ***                   │ │  
    │ │    < >   ARM AMBA Multimedia Card Interface support                    │ │  
    │ │    <*>   Secure Digital Host Controller Interface support              │ │  
    │ │    < >   SDHCI support on PCI bus                                      │ │  
    │ │    <*>   SDHCI support on the platform specific bus                    │ │  
    │ │    [*]     SDHCI platform support for the Freescale eSDHC i.MX controll│ │  
    │ │    < >   TI Flash Media MMC/SD Interface support  (EXPERIMENTAL)       │ │  
    │ │    < >   ENE CB710 MMC/SD Interface support                            │ │  
    │ │    < >   VIA SD/MMC Card Reader Driver                                 │ │  
    │ └────v(+)────────────────────────────────────────────────────────────────┘ │  
    ├────────────────────────────────────────────────────────────────────────────┤  
    │