All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Update Apollo Lake FSP parameters
@ 2020-07-22  7:29 Bernhard Messerklinger
  2020-07-22  7:29 ` [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters Bernhard Messerklinger
  2020-07-22  7:29 ` [PATCH 2/2] arch: x86: apl: Update FSP parameters Bernhard Messerklinger
  0 siblings, 2 replies; 7+ messages in thread
From: Bernhard Messerklinger @ 2020-07-22  7:29 UTC (permalink / raw)
  To: u-boot

This patch set adds new paramters and functions to allow full
configuration of the latest FSP MR6 release.


Bernhard Messerklinger (2):
  x86: apl: fsp_bindings: Add support for u64 parameters
  arch: x86: apl: Update FSP parameters

 arch/x86/cpu/apollolake/fsp_bindings.c        | 51 +++++++++++++++++++
 .../asm/arch-apollolake/fsp/fsp_m_upd.h       |  5 +-
 .../asm/arch-apollolake/fsp/fsp_s_upd.h       |  9 +++-
 .../asm/arch-apollolake/fsp_bindings.h        |  1 +
 .../fsp/fsp2/apollolake/fsp-m.txt             |  3 ++
 .../fsp/fsp2/apollolake/fsp-s.txt             |  6 +++
 6 files changed, 73 insertions(+), 2 deletions(-)

-- 
2.27.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters
  2020-07-22  7:29 [PATCH 0/2] Update Apollo Lake FSP parameters Bernhard Messerklinger
@ 2020-07-22  7:29 ` Bernhard Messerklinger
  2020-07-26 14:54   ` Simon Glass
  2020-07-22  7:29 ` [PATCH 2/2] arch: x86: apl: Update FSP parameters Bernhard Messerklinger
  1 sibling, 1 reply; 7+ messages in thread
From: Bernhard Messerklinger @ 2020-07-22  7:29 UTC (permalink / raw)
  To: u-boot

Add FSP_UINT64 read support as preparation for FSP-M and FSP-S parameter
update.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
---

 arch/x86/cpu/apollolake/fsp_bindings.c        | 28 +++++++++++++++++++
 .../asm/arch-apollolake/fsp_bindings.h        |  1 +
 2 files changed, 29 insertions(+)

diff --git a/arch/x86/cpu/apollolake/fsp_bindings.c b/arch/x86/cpu/apollolake/fsp_bindings.c
index 9130af9ce0..130366b403 100644
--- a/arch/x86/cpu/apollolake/fsp_bindings.c
+++ b/arch/x86/cpu/apollolake/fsp_bindings.c
@@ -89,6 +89,28 @@ static void read_u32_prop(ofnode node, char *name, size_t count, u32 *dst)
 		ofnode_read_u32_array(node, name, dst, count);
 }
 
+/**
+ * read_u64_prop() - Read an u64 property from devicetree (scalar or array)
+ * @node:  Valid node reference to read property from
+ * @name:  Name of the property to read from
+ * @count: If the property is expected to be an array, this is the
+ *         number of expected elements
+ *         set to 0 if the property is expected to be a scalar
+ * @dst:   Pointer to destination of where to save the value(s) read
+ *         from devicetree
+ */
+static int read_u64_prop(ofnode node, char *name, size_t count, u64 *dst)
+{
+	if (count == 0) {
+		ofnode_read_u64(node, name, dst);
+	} else {
+		debug("ERROR: %s u64 arrays not supported!\n", __func__);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 /**
  * read_string_prop() - Read a string property from devicetree
  * @node:  Valid node reference to read property from
@@ -206,6 +228,12 @@ static int fsp_update_config_from_dtb(ofnode node, u8 *cfg,
 			read_u32_prop(node, fspb->propname, fspb->count,
 				      (u32 *)&cfg[fspb->offset]);
 		break;
+		case FSP_UINT64:
+			ret = read_u64_prop(node, fspb->propname, fspb->count,
+				      (u64 *)&cfg[fspb->offset]);
+			if (ret)
+				return ret;
+		break;
 		case FSP_STRING:
 			read_string_prop(node, fspb->propname, fspb->count,
 					 (char *)&cfg[fspb->offset]);
diff --git a/arch/x86/include/asm/arch-apollolake/fsp_bindings.h b/arch/x86/include/asm/arch-apollolake/fsp_bindings.h
index b4939519ce..a80e66bbfa 100644
--- a/arch/x86/include/asm/arch-apollolake/fsp_bindings.h
+++ b/arch/x86/include/asm/arch-apollolake/fsp_bindings.h
@@ -17,6 +17,7 @@ enum conf_type {
 	FSP_UINT8,
 	FSP_UINT16,
 	FSP_UINT32,
+	FSP_UINT64,
 	FSP_STRING,
 	FSP_LPDDR4_SWIZZLE,
 };
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] arch: x86: apl: Update FSP parameters
  2020-07-22  7:29 [PATCH 0/2] Update Apollo Lake FSP parameters Bernhard Messerklinger
  2020-07-22  7:29 ` [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters Bernhard Messerklinger
@ 2020-07-22  7:29 ` Bernhard Messerklinger
  2020-07-26 14:54   ` Simon Glass
  1 sibling, 1 reply; 7+ messages in thread
From: Bernhard Messerklinger @ 2020-07-22  7:29 UTC (permalink / raw)
  To: u-boot

Add missing parameters to support full configuration of the latest FSP
MR6 release.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
---

 arch/x86/cpu/apollolake/fsp_bindings.c        | 23 +++++++++++++++++++
 .../asm/arch-apollolake/fsp/fsp_m_upd.h       |  5 +++-
 .../asm/arch-apollolake/fsp/fsp_s_upd.h       |  9 +++++++-
 .../fsp/fsp2/apollolake/fsp-m.txt             |  3 +++
 .../fsp/fsp2/apollolake/fsp-s.txt             |  6 +++++
 5 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/arch/x86/cpu/apollolake/fsp_bindings.c b/arch/x86/cpu/apollolake/fsp_bindings.c
index 130366b403..bbf04b5009 100644
--- a/arch/x86/cpu/apollolake/fsp_bindings.c
+++ b/arch/x86/cpu/apollolake/fsp_bindings.c
@@ -633,6 +633,17 @@ const struct fsp_binding fsp_m_bindings[] = {
 	.offset = offsetof(struct fsp_m_config, variable_nvs_buffer_ptr),
 	.propname = "fspm,variable-nvs-buffer-ptr",
 	}, {
+	.type = FSP_UINT64,
+	.offset = offsetof(struct fsp_m_config, start_timer_ticker_of_pfet_assert),
+	.propname = "fspm,start-timer-ticker-of-pfet-assert",
+	}, {
+	.type = FSP_UINT8, .offset = offsetof(struct fsp_m_config, rt_en),
+	.propname = "fspm,rt-en",
+	}, {
+	.type = FSP_UINT8,
+	.offset = offsetof(struct fsp_m_config, skip_pcie_power_sequence),
+	.propname = "fspm,skip-pcie-power-sequence",
+	}, {
 	.propname = NULL
 	}
 };
@@ -1822,6 +1833,18 @@ const struct fsp_binding fsp_s_bindings[] = {
 	.count = ARRAY_SIZE_OF_MEMBER(struct fsp_s_config,
 				      port_usb20_hs_npre_drv_sel),
 	}, {
+	.type = FSP_UINT8,
+	.offset = offsetof(struct fsp_s_config, os_selection),
+	.propname = "fsps,os-selection",
+	}, {
+	.type = FSP_UINT8,
+	.offset = offsetof(struct fsp_s_config, dptf_enabled),
+	.propname = "fsps,dptf-enabled",
+	}, {
+	.type = FSP_UINT8,
+	.offset = offsetof(struct fsp_s_config, pwm_enabled),
+	.propname = "fsps,pwm-enabled",
+	}, {
 	.propname = NULL
 	}
 };
diff --git a/arch/x86/include/asm/arch-apollolake/fsp/fsp_m_upd.h b/arch/x86/include/asm/arch-apollolake/fsp/fsp_m_upd.h
index 5275b75f3b..78c338e9ff 100644
--- a/arch/x86/include/asm/arch-apollolake/fsp/fsp_m_upd.h
+++ b/arch/x86/include/asm/arch-apollolake/fsp/fsp_m_upd.h
@@ -122,7 +122,10 @@ struct __packed fsp_m_config {
 
 	/* 0x150 */
 	void	*variable_nvs_buffer_ptr;
-	u8	reserved_fspm_upd[12];
+	u64	start_timer_ticker_of_pfet_assert;
+	u8	rt_en;
+	u8	skip_pcie_power_sequence;
+	u8	reserved_fspm_upd[2];
 };
 
 /** FSP-M UPD Configuration */
diff --git a/arch/x86/include/asm/arch-apollolake/fsp/fsp_s_upd.h b/arch/x86/include/asm/arch-apollolake/fsp/fsp_s_upd.h
index 451a7a254a..be80f5db09 100644
--- a/arch/x86/include/asm/arch-apollolake/fsp/fsp_s_upd.h
+++ b/arch/x86/include/asm/arch-apollolake/fsp/fsp_s_upd.h
@@ -351,7 +351,10 @@ struct __packed fsp_s_config {
 	u8	port_usb20_hs_npre_drv_sel[8];
 
 	/* 0x370 */
-	u8	reserved_fsps_upd[16];
+	u8	os_selection;
+	u8	dptf_enabled;
+	u8	pwm_enabled;
+	u8	reserved_fsps_upd[13];
 };
 
 /** struct fsps_upd - FSP-S Configuration */
@@ -563,4 +566,8 @@ struct __packed fsps_upd {
 #define PCIE_RP_SELECTABLE_DEEMPHASIS_6_DB 0
 #define PCIE_RP_SELECTABLE_DEEMPHASIS_3_5_DB 1
 
+#define OS_SELECTION_WINDOWS 0
+#define OS_SELECTION_ANDROID 1
+#define OS_SELECTION_LINUX 3
+
 #endif
diff --git a/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt b/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt
index 5311938f43..666400e085 100644
--- a/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt
+++ b/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-m.txt
@@ -240,6 +240,9 @@ Optional properties:
 - fspm,enable-reset-system: Enable Reset System
 - fspm,enable-s3-heci2: Enable HECI2 in S3 resume path
 - fspm,variable-nvs-buffer-ptr:
+- fspm,start-timer-ticker-of-pfet-assert: PCIE SLOT Power Enable Assert Time - PFET
+- fspm,rt-en: Real Time Enabling
+- fspm,skip-pcie-power-sequence: Skip Pcie Power Sequence
 
 Example:
 
diff --git a/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt b/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt
index 973d253ada..731a310cf8 100644
--- a/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt
+++ b/doc/device-tree-bindings/fsp/fsp2/apollolake/fsp-s.txt
@@ -463,6 +463,12 @@ Optional properties:
 - fsps,port-usb20-i-usb-tx-emphasis-en: PerPort HS Transmitter Emphasis
 - fsps,port-usb20-per-port-rxi-set: PerPort HS Receiver Bias
 - fsps,port-usb20-hs-npre-drv-sel: Delay/skew's strength control for HS driver
+- fsps,os-selection: OS Selection
+  0: Windows
+  1: Android
+  3: Linux
+- fsps,dptf-enabled: DPTF
+- fsps,pwm-enabled: PWM Enabled
 
 Example:
 
-- 
2.27.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters
  2020-07-22  7:29 ` [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters Bernhard Messerklinger
@ 2020-07-26 14:54   ` Simon Glass
  2020-08-03  2:43     ` Bin Meng
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2020-07-26 14:54 UTC (permalink / raw)
  To: u-boot

On Wed, 22 Jul 2020 at 01:29, Bernhard Messerklinger
<bernhard.messerklinger@br-automation.com> wrote:
>
> Add FSP_UINT64 read support as preparation for FSP-M and FSP-S parameter
> update.
>
> Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
> ---
>
>  arch/x86/cpu/apollolake/fsp_bindings.c        | 28 +++++++++++++++++++
>  .../asm/arch-apollolake/fsp_bindings.h        |  1 +
>  2 files changed, 29 insertions(+)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] arch: x86: apl: Update FSP parameters
  2020-07-22  7:29 ` [PATCH 2/2] arch: x86: apl: Update FSP parameters Bernhard Messerklinger
@ 2020-07-26 14:54   ` Simon Glass
  2020-08-03  2:43     ` Bin Meng
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2020-07-26 14:54 UTC (permalink / raw)
  To: u-boot

On Wed, 22 Jul 2020 at 01:29, Bernhard Messerklinger
<bernhard.messerklinger@br-automation.com> wrote:
>
> Add missing parameters to support full configuration of the latest FSP
> MR6 release.
>
> Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
> ---
>
>  arch/x86/cpu/apollolake/fsp_bindings.c        | 23 +++++++++++++++++++
>  .../asm/arch-apollolake/fsp/fsp_m_upd.h       |  5 +++-
>  .../asm/arch-apollolake/fsp/fsp_s_upd.h       |  9 +++++++-
>  .../fsp/fsp2/apollolake/fsp-m.txt             |  3 +++
>  .../fsp/fsp2/apollolake/fsp-s.txt             |  6 +++++
>  5 files changed, 44 insertions(+), 2 deletions(-)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters
  2020-07-26 14:54   ` Simon Glass
@ 2020-08-03  2:43     ` Bin Meng
  0 siblings, 0 replies; 7+ messages in thread
From: Bin Meng @ 2020-08-03  2:43 UTC (permalink / raw)
  To: u-boot

On Sun, Jul 26, 2020 at 10:54 PM Simon Glass <sjg@chromium.org> wrote:
>
> On Wed, 22 Jul 2020 at 01:29, Bernhard Messerklinger
> <bernhard.messerklinger@br-automation.com> wrote:
> >
> > Add FSP_UINT64 read support as preparation for FSP-M and FSP-S parameter
> > update.
> >
> > Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
> > ---
> >
> >  arch/x86/cpu/apollolake/fsp_bindings.c        | 28 +++++++++++++++++++
> >  .../asm/arch-apollolake/fsp_bindings.h        |  1 +
> >  2 files changed, 29 insertions(+)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] arch: x86: apl: Update FSP parameters
  2020-07-26 14:54   ` Simon Glass
@ 2020-08-03  2:43     ` Bin Meng
  0 siblings, 0 replies; 7+ messages in thread
From: Bin Meng @ 2020-08-03  2:43 UTC (permalink / raw)
  To: u-boot

On Sun, Jul 26, 2020 at 10:54 PM Simon Glass <sjg@chromium.org> wrote:
>
> On Wed, 22 Jul 2020 at 01:29, Bernhard Messerklinger
> <bernhard.messerklinger@br-automation.com> wrote:
> >
> > Add missing parameters to support full configuration of the latest FSP
> > MR6 release.
> >
> > Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
> > ---
> >
> >  arch/x86/cpu/apollolake/fsp_bindings.c        | 23 +++++++++++++++++++
> >  .../asm/arch-apollolake/fsp/fsp_m_upd.h       |  5 +++-
> >  .../asm/arch-apollolake/fsp/fsp_s_upd.h       |  9 +++++++-
> >  .../fsp/fsp2/apollolake/fsp-m.txt             |  3 +++
> >  .../fsp/fsp2/apollolake/fsp-s.txt             |  6 +++++
> >  5 files changed, 44 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass <sjg@chromium.org>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-03  2:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22  7:29 [PATCH 0/2] Update Apollo Lake FSP parameters Bernhard Messerklinger
2020-07-22  7:29 ` [PATCH 1/2] x86: apl: fsp_bindings: Add support for u64 parameters Bernhard Messerklinger
2020-07-26 14:54   ` Simon Glass
2020-08-03  2:43     ` Bin Meng
2020-07-22  7:29 ` [PATCH 2/2] arch: x86: apl: Update FSP parameters Bernhard Messerklinger
2020-07-26 14:54   ` Simon Glass
2020-08-03  2:43     ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.