Lines Matching refs:ext_csd

767 int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd)  in mmc_send_ext_csd()  argument
778 data.dest = (char *)ext_csd; in mmc_send_ext_csd()
935 u8 *ext_csd = mmc->ext_csd; in mmc_get_capabilities() local
947 if (!ext_csd) { in mmc_get_capabilities()
954 cardtype = ext_csd[EXT_CSD_CARD_TYPE]; in mmc_get_capabilities()
979 if (ext_csd[EXT_CSD_STROBE_SUPPORT] && in mmc_get_capabilities()
1054 ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN); in mmc_hwpart_config()
1113 err = mmc_send_ext_csd(mmc, ext_csd); in mmc_hwpart_config()
1118 (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT+2] << 16) + in mmc_hwpart_config()
1119 (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT+1] << 8) + in mmc_hwpart_config()
1120 ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT]; in mmc_hwpart_config()
1131 wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET]; in mmc_hwpart_config()
1147 if (wr_rel_set != ext_csd[EXT_CSD_WR_REL_SET] && in mmc_hwpart_config()
1148 !(ext_csd[EXT_CSD_WR_REL_PARAM] & EXT_CSD_HS_CTRL_REL)) { in mmc_hwpart_config()
1154 if (ext_csd[EXT_CSD_PARTITION_SETTING] & in mmc_hwpart_config()
1164 if (!(ext_csd[EXT_CSD_ERASE_GROUP_DEF] & 0x01)) { in mmc_hwpart_config()
1171 ext_csd[EXT_CSD_ERASE_GROUP_DEF] = 1; in mmc_hwpart_config()
1176 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] * 1024; in mmc_hwpart_config()
1217 if (wr_rel_set != ext_csd[EXT_CSD_WR_REL_SET]) { in mmc_hwpart_config()
1832 const u8 *ext_csd = mmc->ext_csd; in mmc_read_and_compare_ext_csd() local
1843 if (ext_csd[EXT_CSD_PARTITIONING_SUPPORT] in mmc_read_and_compare_ext_csd()
1845 ext_csd[EXT_CSD_HC_WP_GRP_SIZE] in mmc_read_and_compare_ext_csd()
1847 ext_csd[EXT_CSD_REV] in mmc_read_and_compare_ext_csd()
1849 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] in mmc_read_and_compare_ext_csd()
1851 memcmp(&ext_csd[EXT_CSD_SEC_CNT], in mmc_read_and_compare_ext_csd()
2089 if (!mmc->ext_csd) { in mmc_select_mode_and_width()
2224 u8 *ext_csd = ext_csd_bkup; in mmc_startup_v4() local
2229 if (!mmc->ext_csd) in mmc_startup_v4()
2232 err = mmc_send_ext_csd(mmc, ext_csd); in mmc_startup_v4()
2237 if (!mmc->ext_csd) in mmc_startup_v4()
2238 mmc->ext_csd = ext_csd; in mmc_startup_v4()
2240 ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN); in mmc_startup_v4()
2246 err = mmc_send_ext_csd(mmc, ext_csd); in mmc_startup_v4()
2251 if (!mmc->ext_csd) in mmc_startup_v4()
2252 mmc->ext_csd = malloc(MMC_MAX_BLOCK_LEN); in mmc_startup_v4()
2253 if (!mmc->ext_csd) in mmc_startup_v4()
2255 memcpy(mmc->ext_csd, ext_csd, MMC_MAX_BLOCK_LEN); in mmc_startup_v4()
2257 if (ext_csd[EXT_CSD_REV] >= ARRAY_SIZE(mmc_versions)) in mmc_startup_v4()
2260 mmc->version = mmc_versions[ext_csd[EXT_CSD_REV]]; in mmc_startup_v4()
2268 capacity = ext_csd[EXT_CSD_SEC_CNT] << 0 in mmc_startup_v4()
2269 | ext_csd[EXT_CSD_SEC_CNT + 1] << 8 in mmc_startup_v4()
2270 | ext_csd[EXT_CSD_SEC_CNT + 2] << 16 in mmc_startup_v4()
2271 | ext_csd[EXT_CSD_SEC_CNT + 3] << 24; in mmc_startup_v4()
2278 mmc->gen_cmd6_time = ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; in mmc_startup_v4()
2286 part_completed = !!(ext_csd[EXT_CSD_PARTITION_SETTING] & in mmc_startup_v4()
2289 mmc->part_switch_time = ext_csd[EXT_CSD_PART_SWITCH_TIME]; in mmc_startup_v4()
2295 mmc->part_support = ext_csd[EXT_CSD_PARTITIONING_SUPPORT]; in mmc_startup_v4()
2296 if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) || in mmc_startup_v4()
2297 ext_csd[EXT_CSD_BOOT_MULT]) in mmc_startup_v4()
2298 mmc->part_config = ext_csd[EXT_CSD_PART_CONF]; in mmc_startup_v4()
2300 (ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & ENHNCD_SUPPORT)) in mmc_startup_v4()
2301 mmc->part_attr = ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE]; in mmc_startup_v4()
2303 mmc->capacity_boot = ext_csd[EXT_CSD_BOOT_MULT] << 17; in mmc_startup_v4()
2305 mmc->capacity_rpmb = ext_csd[EXT_CSD_RPMB_MULT] << 17; in mmc_startup_v4()
2309 uint mult = (ext_csd[idx + 2] << 16) + in mmc_startup_v4()
2310 (ext_csd[idx + 1] << 8) + ext_csd[idx]; in mmc_startup_v4()
2317 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_startup_v4()
2318 mmc->capacity_gp[i] *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_startup_v4()
2325 (ext_csd[EXT_CSD_ENH_SIZE_MULT + 2] << 16) + in mmc_startup_v4()
2326 (ext_csd[EXT_CSD_ENH_SIZE_MULT + 1] << 8) + in mmc_startup_v4()
2327 ext_csd[EXT_CSD_ENH_SIZE_MULT]; in mmc_startup_v4()
2328 mmc->enh_user_size *= ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE]; in mmc_startup_v4()
2329 mmc->enh_user_size *= ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_startup_v4()
2332 (ext_csd[EXT_CSD_ENH_START_ADDR + 3] << 24) + in mmc_startup_v4()
2333 (ext_csd[EXT_CSD_ENH_START_ADDR + 2] << 16) + in mmc_startup_v4()
2334 (ext_csd[EXT_CSD_ENH_START_ADDR + 1] << 8) + in mmc_startup_v4()
2335 ext_csd[EXT_CSD_ENH_START_ADDR]; in mmc_startup_v4()
2348 if ((ext_csd[EXT_CSD_PARTITIONING_SUPPORT] & PART_SUPPORT) && in mmc_startup_v4()
2349 (ext_csd[EXT_CSD_PARTITIONS_ATTRIBUTE] & PART_ENH_ATTRIB)) in mmc_startup_v4()
2358 ext_csd[EXT_CSD_ERASE_GROUP_DEF] = 1; in mmc_startup_v4()
2361 if (ext_csd[EXT_CSD_ERASE_GROUP_DEF] & 0x01) { in mmc_startup_v4()
2365 ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] * 1024; in mmc_startup_v4()
2373 capacity = (ext_csd[EXT_CSD_SEC_CNT]) | in mmc_startup_v4()
2374 (ext_csd[EXT_CSD_SEC_CNT + 1] << 8) | in mmc_startup_v4()
2375 (ext_csd[EXT_CSD_SEC_CNT + 2] << 16) | in mmc_startup_v4()
2376 (ext_csd[EXT_CSD_SEC_CNT + 3] << 24); in mmc_startup_v4()
2394 * ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] in mmc_startup_v4()
2395 * ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; in mmc_startup_v4()
2398 mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET]; in mmc_startup_v4()
2402 if (mmc->ext_csd) { in mmc_startup_v4()
2404 free(mmc->ext_csd); in mmc_startup_v4()
2406 mmc->ext_csd = NULL; in mmc_startup_v4()
3073 ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN); in mmc_set_bkops_enable()
3075 err = mmc_send_ext_csd(mmc, ext_csd); in mmc_set_bkops_enable()
3081 if (!(ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1)) { in mmc_set_bkops_enable()
3086 if (ext_csd[EXT_CSD_BKOPS_EN] & 0x1) { in mmc_set_bkops_enable()