Commit b7a6e2c9c396c35596f467f5187da937306ddeb8
Committed by
Jaehoon Chung
1 parent
173c06dfcc
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
mmc: remove hc_wp_grp_size from struct mmc if not needed
hc_wp_grp_size is needed only if hardware partitionning is used. On ARM removing it saves about 30 bytes of code space. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Showing 3 changed files with 6 additions and 0 deletions Side-by-side Diff
cmd/mmc.c
... | ... | @@ -54,8 +54,10 @@ |
54 | 54 | bool has_enh = (mmc->part_support & ENHNCD_SUPPORT) != 0; |
55 | 55 | bool usr_enh = has_enh && (mmc->part_attr & EXT_CSD_ENH_USR); |
56 | 56 | |
57 | +#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING) | |
57 | 58 | puts("HC WP Group Size: "); |
58 | 59 | print_size(((u64)mmc->hc_wp_grp_size) << 9, "\n"); |
60 | +#endif | |
59 | 61 | |
60 | 62 | puts("User Capacity: "); |
61 | 63 | print_size(mmc->capacity_user, usr_enh ? " ENH" : ""); |
drivers/mmc/mmc.c
... | ... | @@ -2098,9 +2098,11 @@ |
2098 | 2098 | * (erase_gmul + 1); |
2099 | 2099 | } |
2100 | 2100 | #endif |
2101 | +#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING) | |
2101 | 2102 | mmc->hc_wp_grp_size = 1024 |
2102 | 2103 | * ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] |
2103 | 2104 | * ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; |
2105 | +#endif | |
2104 | 2106 | |
2105 | 2107 | mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET]; |
2106 | 2108 |
include/mmc.h
... | ... | @@ -589,7 +589,9 @@ |
589 | 589 | uint write_bl_len; |
590 | 590 | uint erase_grp_size; /* in 512-byte sectors */ |
591 | 591 | #endif |
592 | +#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING) | |
592 | 593 | uint hc_wp_grp_size; /* in 512-byte sectors */ |
594 | +#endif | |
593 | 595 | #if CONFIG_IS_ENABLED(MMC_WRITE) |
594 | 596 | struct sd_ssr ssr; /* SD status register */ |
595 | 597 | #endif |