• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision233662411d12109cdc8957de6e85fb30fe2d42b8 (tree)
l'heure2022-07-27 15:19:09
AuteurYing-Chun Liu (PaulLiu) <paul.liu@lina...>
CommiterJaehoon Chung

Message de Log

cmd: mmc: allow to write protect single boot partition

add arguments for mmc wp to assign which boot partition to protect.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>

Change Summary

Modification

--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -1048,6 +1048,7 @@ static int do_mmc_boot_wp(struct cmd_tbl *cmdtp, int flag,
10481048 {
10491049 int err;
10501050 struct mmc *mmc;
1051+ int part;
10511052
10521053 mmc = init_mmc_device(curr_device, false);
10531054 if (!mmc)
@@ -1056,7 +1057,14 @@ static int do_mmc_boot_wp(struct cmd_tbl *cmdtp, int flag,
10561057 printf("It is not an eMMC device\n");
10571058 return CMD_RET_FAILURE;
10581059 }
1059- err = mmc_boot_wp(mmc);
1060+
1061+ if (argc == 2) {
1062+ part = dectoul(argv[1], NULL);
1063+ err = mmc_boot_wp_single_partition(mmc, part);
1064+ } else {
1065+ err = mmc_boot_wp(mmc);
1066+ }
1067+
10601068 if (err)
10611069 return CMD_RET_FAILURE;
10621070 printf("boot areas protected\n");
@@ -1066,7 +1074,7 @@ static int do_mmc_boot_wp(struct cmd_tbl *cmdtp, int flag,
10661074 static struct cmd_tbl cmd_mmc[] = {
10671075 U_BOOT_CMD_MKENT(info, 1, 0, do_mmcinfo, "", ""),
10681076 U_BOOT_CMD_MKENT(read, 4, 1, do_mmc_read, "", ""),
1069- U_BOOT_CMD_MKENT(wp, 1, 0, do_mmc_boot_wp, "", ""),
1077+ U_BOOT_CMD_MKENT(wp, 2, 0, do_mmc_boot_wp, "", ""),
10701078 #if CONFIG_IS_ENABLED(MMC_WRITE)
10711079 U_BOOT_CMD_MKENT(write, 4, 0, do_mmc_write, "", ""),
10721080 U_BOOT_CMD_MKENT(erase, 3, 0, do_mmc_erase, "", ""),
@@ -1140,7 +1148,11 @@ U_BOOT_CMD(
11401148 " [MMC_LEGACY, MMC_HS, SD_HS, MMC_HS_52, MMC_DDR_52, UHS_SDR12, UHS_SDR25,\n"
11411149 " UHS_SDR50, UHS_DDR50, UHS_SDR104, MMC_HS_200, MMC_HS_400, MMC_HS_400_ES]\n"
11421150 "mmc list - lists available devices\n"
1143- "mmc wp - power on write protect boot partitions\n"
1151+ "mmc wp [PART] - power on write protect boot partitions\n"
1152+ " arguments:\n"
1153+ " PART - [0|1]\n"
1154+ " : 0 - first boot partition, 1 - second boot partition\n"
1155+ " if not assigned, write protect all boot partitions\n"
11441156 #if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
11451157 "mmc hwpartition <USER> <GP> <MODE> - does hardware partitioning\n"
11461158 " arguments (sizes in 512-byte blocks):\n"