[PATCH v3 05/25] md5: Remove md5 non-watchdog API

Michal Simek michal.simek at amd.com
Fri May 31 08:46:27 CEST 2024



On 5/28/24 16:09, Raymond Mao wrote:
> We don't need an API specially for non-watchdog since md5_wd supports
> it by enabling CONFIG_HW_WATCHDOG or CONFIG_WATCHDOG.
> Set 0x10000 as default chunk size for MD5.
> 
> Signed-off-by: Raymond Mao <raymond.mao at linaro.org>
> ---
> Changes in v3
> - Initial patch.
> 
>   board/friendlyarm/nanopi2/board.c |  3 ++-
>   board/intel/edison/edison.c       |  3 ++-
>   board/xilinx/zynq/bootimg.c       |  2 +-
>   include/u-boot/md5.h              |  7 +------
>   lib/md5.c                         | 15 ---------------
>   5 files changed, 6 insertions(+), 24 deletions(-)
> 
> diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
> index 393c5a447d6..f203499f544 100644
> --- a/board/friendlyarm/nanopi2/board.c
> +++ b/board/friendlyarm/nanopi2/board.c
> @@ -264,7 +264,8 @@ static void make_ether_addr(u8 *addr)
>   	hash[6] = readl(PHY_BASEADDR_ECID + 0x08);
>   	hash[7] = readl(PHY_BASEADDR_ECID + 0x0c);
>   
> -	md5((unsigned char *)&hash[4], 64, (unsigned char *)hash);
> +	md5_wd((unsigned char *)&hash[4], 64, (unsigned char *)hash,
> +	       MD5_DEF_CHUNK_SZ);
>   
>   	hash[0] ^= hash[2];
>   	hash[1] ^= hash[3];
> diff --git a/board/intel/edison/edison.c b/board/intel/edison/edison.c
> index 11e7f74e47c..1583d11c74d 100644
> --- a/board/intel/edison/edison.c
> +++ b/board/intel/edison/edison.c
> @@ -33,7 +33,8 @@ static void assign_serial(void)
>   	if (!mmc)
>   		return;
>   
> -	md5((unsigned char *)mmc->cid, sizeof(mmc->cid), ssn);
> +	md5_wd((unsigned char *)mmc->cid, sizeof(mmc->cid), ssn,
> +	       MD5_DEF_CHUNK_SZ);
>   
>   	snprintf(usb0addr, sizeof(usb0addr), "02:00:86:%02x:%02x:%02x",
>   		 ssn[13], ssn[14], ssn[15]);
> diff --git a/board/xilinx/zynq/bootimg.c b/board/xilinx/zynq/bootimg.c
> index 2f55078dd76..4b2245c0618 100644
> --- a/board/xilinx/zynq/bootimg.c
> +++ b/board/xilinx/zynq/bootimg.c
> @@ -136,7 +136,7 @@ int zynq_validate_partition(u32 start_addr, u32 len, u32 chksum_off)
>   
>   	memcpy(&checksum[0], (u32 *)chksum_off, MD5_CHECKSUM_SIZE);
>   
> -	md5_wd((u8 *)start_addr, len, &calchecksum[0], 0x10000);
> +	md5_wd((u8 *)start_addr, len, &calchecksum[0], MD5_DEF_CHUNK_SZ);
>   
>   	if (!memcmp(checksum, calchecksum, MD5_CHECKSUM_SIZE))
>   		return 0;

Reviewed-by: Michal Simek <michal.simek at amd.com> # zynq

M



More information about the U-Boot mailing list