On 02/01/2018 12:38 AM, Sagar Arun Kamble wrote:
On 1/19/2018 6:59 AM, Jackie Li wrote:
Hardware may have specific restrictions on GuC WOPCM size
It would be good if you can tell about Gen9/CNL restriction briefly here.
versus HuC firmware size. With static GuC WOPCM size,
there's no way to adjust the GuC WOPCM partition size based on
the actual HuC firmware size, so that GuC/HuC loading failure
would occur even if there was enough WOPCM space for both
GuC and HuC firmware.
This patch enables the dynamic calculation of the GuC WOPCM
aperture size used by GuC and HuC firmware.
we are also calculating for HuC?
Strictly speaking, we are calculating the GuC WOPCM offset based on
GuC & HuC firmware sizes. Will make it clearer. Thanks.
+ offset = huc_fw_size + WOPCM_RESERVED_SIZE;
+ if (offset >= WOPCM_DEFAULT_SIZE)
+ return -E2BIG;
+
+ /* Hardware requires GuC WOPCM offset needs to be 16K aligned. */
+ offset = ALIGN(offset, WOPCM_OFFSET_ALIGNMENT);
+ if ((offset + reserved) >= WOPCM_DEFAULT_SIZE)
+ return -E2BIG;
+
+ top = WOPCM_DEFAULT_SIZE - offset;
+ size = top - reserved;
+
+ /* GuC WOPCM size must be 4K aligned. */
+ size &= GUC_WOPCM_SIZE_MASK;
+
ALIGN(size, PAGE_SIZE)? Can avoid this new macro.
If you want to stay with GUC_WOPCM_SIZE_MASK, then that macro needs to
be in guc_wopcm.h
I'd like to go with GUC_WOPCM_SIZE_MASK here since there's no sign that
it should be related to
page size. *Align* seems not accurate here since I actually wanted to
trim the size to 4k boundary,
will update the comments. Thanks!
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx