From ff8605db0f54d7886d498d21e3845e625b24dfec Mon Sep 17 00:00:00 2001 From: Vaikundanathan S Date: Wed, 12 Dec 2018 12:09:34 +0530 Subject: [PATCH] gpu: nvgpu: Update FLL table header sizer New field is added in VBIOS table for Guranteed frequency. Update nvgpu bios parsing code to support new header size Bug 2461826 Change-Id: I930a2419953062ffe226d2821756bb3e983ab475 Signed-off-by: Vaikundanathan S Reviewed-on: https://git-master.nvidia.com/r/1971072 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/clk/clk_fll.c | 12 ++++++++---- drivers/gpu/nvgpu/include/nvgpu/bios.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/clk/clk_fll.c b/drivers/gpu/nvgpu/clk/clk_fll.c index 8231348a9..3ab98917f 100644 --- a/drivers/gpu/nvgpu/clk/clk_fll.c +++ b/drivers/gpu/nvgpu/clk/clk_fll.c @@ -257,16 +257,20 @@ static int devinit_get_fll_device_table(struct gk20a *g, nvgpu_memcpy((u8 *)&fll_desc_table_header_sz, fll_table_ptr, sizeof(struct fll_descriptor_header)); - if (fll_desc_table_header_sz.size >= FLL_DESCRIPTOR_HEADER_10_SIZE_6) { - desctablesize = FLL_DESCRIPTOR_HEADER_10_SIZE_6; + if (fll_desc_table_header_sz.size >= FLL_DESCRIPTOR_HEADER_10_SIZE_7) { + desctablesize = FLL_DESCRIPTOR_HEADER_10_SIZE_7; } else { - desctablesize = FLL_DESCRIPTOR_HEADER_10_SIZE_4; + if (fll_desc_table_header_sz.size == FLL_DESCRIPTOR_HEADER_10_SIZE_6) { + desctablesize = FLL_DESCRIPTOR_HEADER_10_SIZE_6; + } else { + desctablesize = FLL_DESCRIPTOR_HEADER_10_SIZE_4; + } } nvgpu_memcpy((u8 *)&fll_desc_table_header, fll_table_ptr, desctablesize); - if (desctablesize == FLL_DESCRIPTOR_HEADER_10_SIZE_6) { + if (desctablesize >= FLL_DESCRIPTOR_HEADER_10_SIZE_6) { pfllobjs->max_min_freq_mhz = fll_desc_table_header.max_min_freq_mhz; } else { diff --git a/drivers/gpu/nvgpu/include/nvgpu/bios.h b/drivers/gpu/nvgpu/include/nvgpu/bios.h index af80ae5a9..4b29ce99d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/bios.h +++ b/drivers/gpu/nvgpu/include/nvgpu/bios.h @@ -90,6 +90,7 @@ struct fll_descriptor_header { #define FLL_DESCRIPTOR_HEADER_10_SIZE_4 4U #define FLL_DESCRIPTOR_HEADER_10_SIZE_6 6U +#define FLL_DESCRIPTOR_HEADER_10_SIZE_7 7U struct fll_descriptor_header_10 { u8 version;