On Fri, Nov 06, 2015 at 03:03:57PM +0100, Ard Biesheuvel wrote:
> Add a function to ArmLib that provides access to the Cache Writeback
> Granularity (CWG) field in CTR_EL0. This information is required when
> performing non-coherent DMA.

Nit: s/Granularity/Granule/ 

Likewise for the patch body.

[...]

> +UINTN
> +EFIAPI
> +ArmCacheWritebackGranularity (
> +  VOID
> +  )
> +{
> +  UINTN   CWG;
> +
> +  CWG = (ArmCacheInfo () >> 24) & 0xf; // CTR_EL0.CWG
> +
> +  if (CWG == 0) {
> +    return SIZE_512KB;
> +  }

This should be SIZE_2KB, no?

The ARM ARM says the architectural maximum is 512 /words/ (i.e. 2KB).

With those changes:

Reviewed-by: Mark Rutland <[email protected]>

Thanks,
Mark.

> +
> +  return 4 << CWG;
> +}
> -- 
> 1.9.1
> 
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to