diff mbox series

[U-Boot,v2,25/38] x86: fsp: Add access to variable MRC data

Message ID 20190925141147.191166-26-sjg@chromium.org
State Accepted
Commit 46dd41fa5a8f08af903c7f0cfde9abfc16d7efe3
Delegated to: Bin Meng
Headers show
Series x86: Various modifications to prepare for FSP2 | expand

Commit Message

Simon Glass Sept. 25, 2019, 2:11 p.m. UTC
With FSP2 the non-volatile storage used by the FSP to init memory can be
split into a fixed piece (determined at compile time) and a variable piece
(determined at run time). Add support for reading the latter.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/x86/include/asm/fsp/fsp_hob.h     |  4 ++++
 arch/x86/include/asm/fsp/fsp_support.h | 12 ++++++++++++
 arch/x86/lib/fsp/fsp_support.c         |  7 +++++++
 3 files changed, 23 insertions(+)

Comments

Bin Meng Oct. 2, 2019, 2:07 p.m. UTC | #1
On Wed, Sep 25, 2019 at 10:13 PM Simon Glass <sjg@chromium.org> wrote:
>
> With FSP2 the non-volatile storage used by the FSP to init memory can be
> split into a fixed piece (determined at compile time) and a variable piece
> (determined at run time). Add support for reading the latter.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2: None
>
>  arch/x86/include/asm/fsp/fsp_hob.h     |  4 ++++
>  arch/x86/include/asm/fsp/fsp_support.h | 12 ++++++++++++
>  arch/x86/lib/fsp/fsp_support.c         |  7 +++++++
>  3 files changed, 23 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Bin Meng Oct. 3, 2019, 8:44 a.m. UTC | #2
On Wed, Oct 2, 2019 at 10:07 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Sep 25, 2019 at 10:13 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > With FSP2 the non-volatile storage used by the FSP to init memory can be
> > split into a fixed piece (determined at compile time) and a variable piece
> > (determined at run time). Add support for reading the latter.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> > Changes in v2: None
> >
> >  arch/x86/include/asm/fsp/fsp_hob.h     |  4 ++++
> >  arch/x86/include/asm/fsp/fsp_support.h | 12 ++++++++++++
> >  arch/x86/lib/fsp/fsp_support.c         |  7 +++++++
> >  3 files changed, 23 insertions(+)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86/next, thanks!
diff mbox series

Patch

diff --git a/arch/x86/include/asm/fsp/fsp_hob.h b/arch/x86/include/asm/fsp/fsp_hob.h
index 3bb79c4b67a..d248520e972 100644
--- a/arch/x86/include/asm/fsp/fsp_hob.h
+++ b/arch/x86/include/asm/fsp/fsp_hob.h
@@ -69,6 +69,10 @@  struct __packed hob_graphics_info {
 	EFI_GUID(0x721acf02, 0x4d77, 0x4c2a, \
 		0xb3, 0xdc, 0x27, 0x0b, 0x7b, 0xa9, 0xe4, 0xb0)
 
+#define FSP_VARIABLE_NV_DATA_HOB_GUID \
+	EFI_GUID(0xa034147d, 0x690c, 0x4154, \
+		0x8d, 0xe6, 0xc0, 0x44, 0x64, 0x1d, 0xe9, 0x42)
+
 #define FSP_BOOTLOADER_TEMP_MEM_HOB_GUID \
 	EFI_GUID(0xbbcff46c, 0xc8d3, 0x4113, \
 		0x89, 0x85, 0xb9, 0xd4, 0xf3, 0xb3, 0xf6, 0x4e)
diff --git a/arch/x86/include/asm/fsp/fsp_support.h b/arch/x86/include/asm/fsp/fsp_support.h
index 6320fe0906c..4f93cb2a136 100644
--- a/arch/x86/include/asm/fsp/fsp_support.h
+++ b/arch/x86/include/asm/fsp/fsp_support.h
@@ -106,6 +106,18 @@  u32 fsp_get_tseg_reserved_mem(const void *hob_list, u32 *len);
  */
 void *fsp_get_nvs_data(const void *hob_list, u32 *len);
 
+/**
+ * fsp_get_var_nvs_data() - get FSP variable Non-volatile Storage HOB buffer
+ *
+ * @hob_list:      A HOB list pointer.
+ * @len:           A pointer to the NVS data buffer length.
+ *                 If the HOB is located, the length will be updated.
+ *
+ * @return NULL:   Failed to find the NVS HOB.
+ * @return others: FSP NVS data buffer pointer.
+ */
+void *fsp_get_var_nvs_data(const void *hob_list, u32 *len);
+
 /**
  * fsp_get_graphics_info() - retrieves graphics information.
  *
diff --git a/arch/x86/lib/fsp/fsp_support.c b/arch/x86/lib/fsp/fsp_support.c
index 014de35e563..983888fd743 100644
--- a/arch/x86/lib/fsp/fsp_support.c
+++ b/arch/x86/lib/fsp/fsp_support.c
@@ -161,6 +161,13 @@  void *fsp_get_nvs_data(const void *hob_list, u32 *len)
 	return hob_get_guid_hob_data(hob_list, len, &guid);
 }
 
+void *fsp_get_var_nvs_data(const void *hob_list, u32 *len)
+{
+	const efi_guid_t guid = FSP_VARIABLE_NV_DATA_HOB_GUID;
+
+	return hob_get_guid_hob_data(hob_list, len, &guid);
+}
+
 void *fsp_get_bootloader_tmp_mem(const void *hob_list, u32 *len)
 {
 	const efi_guid_t guid = FSP_BOOTLOADER_TEMP_MEM_HOB_GUID;