AR# 69368

|

2017.1-2018.1 Zynq UltraScale+ MPSoC: How to slow down eMMC from HS200 to High Speed (HS) in FSBL, u-boot and Linux

描述

eMMC runs at HS200 (200MHz). This Answer Record shows how to run it at high-speed (HS) (slow it down to 50MHz).

This can be done in FSBL, u-boot, and Linux using the steps below.

This "slow-down" is recommended only if the voltage of the bank connected to the flash is 3.3V or for debug purposes.

解决方案

1) Slow down eMMC to High Speed in FSBL.

The FSBL is running at 200MHz. In order to slow it down to 50MHz, the following changes have to be made in the SDK.

The two source files that will need to be modified are xsdps.c and xsdps_options.c

In order to do this, you will need to make your repository local. This can be done by selecting Xilinx Tools --> Xilinx SDK --> Repositories and pointing it to your local repository changes.

In source file xsdps.c, where it checks for card supported speed, make the changes shown in bold below.

/* Check for card supported speed */
if ((ExtCsd[EXT_CSD_DEVICE_TYPE_BYTE] &
          (EXT_CSD_DEVICE_TYPE_SDR_1V8_HS200 |
          EXT_CSD_DEVICE_TYPE_SDR_1V2_HS200)) != 0U) {
        //InstancePtr->Mode = XSDPS_HS200_MODE; /*comment this line*/
        InstancePtr->Mode = XSDPS_HIGH_SPEED_MODE;

#if defined (ARMR5) || defined (__aarch64__)
       //InstancePtr->Config_TapDelay = XSdPs_sdr104_hs200_tapdelay; /*comment this line*/
       InstancePtr->Config_TapDelay = XSdPs_hsd_sdr25_tapdelay;

#endif
     Status = XSdPs_Change_BusSpeed(InstancePtr);
     if (Status != XST_SUCCESS) {
          Status = XST_FAILURE;
           goto RETURN_PATH;
     }
     Status = XSdPs_Get_Mmc_ExtCsd(InstancePtr, ExtCsd);
     if (Status != XST_SUCCESS) {
           Status = XST_FAILURE;
           goto RETURN_PATH;
     }
     /*comment these lines*/
     //if (ExtCsd[EXT_CSD_HS_TIMING_BYTE] != EXT_CSD_HS_TIMING_HS200) {
     //   Status = XST_FAILURE;
     //   goto RETURN_PATH;
     //   }

}
 
 

In xsdps_options.c, where the clock frequency change is being made to 200MHz, add the following bolded changes:

/*
 * Write to clear bit
 */
XSdPs_WriteReg16(InstancePtr->Config.BaseAddress,
     XSDPS_NORM_INTR_STS_OFFSET, XSDPS_INTR_TC_MASK);
 
/* Change the clock frequency to 200 MHz */
     //InstancePtr->BusSpeed = XSDPS_MMC_HS200_MAX_CLK; /*comment this line*/
     InstancePtr->BusSpeed = 50000000U;

 
     Status = XSdPs_Change_ClkFreq(InstancePtr, InstancePtr->BusSpeed);
     if (Status != XST_SUCCESS) {
          Status = XST_FAILURE;
          goto RETURN_PATH;
     }
     /*comment these lines*/
     //Status = XSdPs_Execute_Tuning(InstancePtr);
     //if (Status != XST_SUCCESS) {
     //   Status = XST_FAILURE;
     //   goto RETURN_PATH;
     //}

}


2) Slow down eMMC to High Speed in u-boot and Linux

  • Add the no-1-8-v attribute to the sdhc node in the device-tree by adding the changes below to the system-user.dtsi file as shown below.
$ vim project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
&sdhci0 {
  no-1-8-v;
};


3) In 2018.1 a u-boot patch is required for High Speed:

  • Copy the patch files attached for u-boot to <plnx-proj-root>/project-spec/meta-user/recipes-bsp/u-boot/files/ directory.
    Modify the u-boot-xlnx_%.bbappend to include the patch file.

附件

文件名 文件大小 File Type
0001-mmc-Added-support-to-switch-emmc-to-correct-frequenc.patch 1 KB PATCH
AR# 69368
日期 04/23/2018
状态 Active
Type 综合文章
器件
Tools
Boards & Kits
People Also Viewed