/* Select the MMC clock frequency */ static int jz_mmc_set_clock(u32 rate) { int clkrt; jz_mmc_stop_clock(); __cpm_select_msc_clk(1); /* select clock source from CPM */ clkrt = jz_mmc_calc_clkrt(1, rate); REG_MSC_CLKRT = clkrt; return MMC_NO_ERROR; }
/* Select the MMC clock frequency */ static int jz_mmc_set_clock(u32 rate) { int clkrt; /* __cpm_select_msc_clk_high will select 48M clock for MMC/SD card * perhaps this will made some card with bad quality init fail,or * bad stabilization. */ if (rate > SD_CLOCK_FAST) { __cpm_select_msc_clk_high(MSC_ID,1); /* select clock source from CPM */ clkrt = jz_mmc_calc_clkrt(0, rate); } else { __cpm_select_msc_clk(MSC_ID,1); /* select clock source from CPM */ clkrt = jz_mmc_calc_clkrt(1, rate); } #ifndef CONFIG_FPGA REG_MSC_CLKRT(MSC_ID) = clkrt; #else REG_MSC_CLKRT(MSC_ID) = 7; #endif return MMC_NO_ERROR; }