On Fri, Mar 14, 2025 at 04:10:24PM +0800, [email protected] wrote:

> From: Luke Wang <[email protected]>
> 
> Current mmc bootpart-resize cmd only support samsung emmc boot/rpmb
> partition resizing. Add sandisk and micron emmc boot/rpmb partition
> resizing support. The commands and parameters for resizing partitions
> are different for each manufacturer. Select the corresponding function
> according to cid.
> 
> Signed-off-by: Luke Wang <[email protected]>
> ---
[snip]
> +     /* Set EXT_CSD[175] ERASE_GROUP_DEF to 0x01 */
> +     err = mmc_switch(mmc, 0, 175, 0x01);
> +     if (err)
> +             goto error;
> +
> +     /* Set EXT_CSD[127:125] for boot partition size, [125] is low byte */
> +     err = mmc_switch(mmc, 0, 125, bootsize);

We should define EXT_CSD_BOOT_SIZE_MULT to 125.

> +     if (err)
> +             goto error;
> +
> +     err = mmc_switch(mmc, 0, 126, 0x00);
> +     if (err)
> +             goto error;
> +
> +     err = mmc_switch(mmc, 0, 127, 0x00);
> +     if (err)
> +             goto error;
> +
> +     /* Set EXT_CSD[155] PARTITION_SETTING_COMPLETE to 0x01 */
> +     err = mmc_switch(mmc, 0, 155, 0x01);


And if we don't have 126/127/155 defined today, we should use
reasonable names for them too. Any other command numbers I missed as
well please.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to