On 3/26/21 8:37 PM, Klaus Heinrich Kiwi wrote:
> Complement the Aspeed HACE support with Scatter-Gather hash support for
> sha256 and sha512. Scatter-Gather is only supported on AST2600-series.

...

>  static uint64_t aspeed_hace_read(void *opaque, hwaddr addr, unsigned int 
> size)
>  {
> @@ -187,11 +303,6 @@ static void aspeed_hace_write(void *opaque, hwaddr addr, 
> uint64_t data,
>                            "%s: HMAC engine command mode %"PRIx64" not 
> implemented",
>                            __func__, (data & HASH_HMAC_MASK) >> 8);
>          }
> -        if (data & HASH_SG_EN) {
> -            qemu_log_mask(LOG_UNIMP,
> -                          "%s: Hash scatter gather mode not implemented",
> -                          __func__);
> -        }

Could we check the SoC type and emit an error if not ast2600 ? 

>          if (data & BIT(1)) {
>              qemu_log_mask(LOG_UNIMP,
>                            "%s: Cascaded mode not implemented",
> @@ -204,7 +315,10 @@ static void aspeed_hace_write(void *opaque, hwaddr addr, 
> uint64_t data,
>                          __func__, data & ahc->hash_mask);
>                  break;
>          }
> -        do_hash_operation(s, algo);
> +        if (data & HASH_SG_EN)
> +            do_hash_sg_operation(s, algo);
> +        else
> +            do_hash_operation(s, algo);

patchew should complain for the lack of { }.

Thanks,

C. 

>          if (data & HASH_IRQ_EN) {
>              qemu_irq_raise(s->irq);
> 


Reply via email to