All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] Rename Stratix10 FPGA driver and support Agilex
@ 2020-08-07  3:50 Chee Hong Ang
  2020-08-07  3:50 ` [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox Chee Hong Ang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chee Hong Ang @ 2020-08-07  3:50 UTC (permalink / raw)
  To: u-boot

- Rename Stratix10 FPGA driver to 'Intel FPGA SDM Mailbox'.
- Add watchdog reset when configuring the FPGA.
- Enable 'Intel FPGA SDM Mailbox' for Agilex.

Chee Hong Ang (3):
  fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox
  fpga: intel_sdm_mb: Add watchdog reset
  arm: socfpga: agilex: Enable FPGA Full Reconfiguration support

 arch/arm/mach-socfpga/Kconfig                |  3 ++-
 arch/arm/mach-socfpga/misc_s10.c             |  2 +-
 drivers/fpga/Kconfig                         | 14 +++++++-------
 drivers/fpga/Makefile                        |  2 +-
 drivers/fpga/altera.c                        |  7 ++++---
 drivers/fpga/{stratix10.c => intel_sdm_mb.c} |  5 ++++-
 include/altera.h                             |  9 +++++----
 7 files changed, 24 insertions(+), 18 deletions(-)
 rename drivers/fpga/{stratix10.c => intel_sdm_mb.c} (97%)

-- 
2.13.0

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

* [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox
  2020-08-07  3:50 [PATCH v1 0/3] Rename Stratix10 FPGA driver and support Agilex Chee Hong Ang
@ 2020-08-07  3:50 ` Chee Hong Ang
  2020-08-11  2:08   ` Tan, Ley Foon
  2020-08-07  3:50 ` [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset Chee Hong Ang
  2020-08-07  3:50 ` [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support Chee Hong Ang
  2 siblings, 1 reply; 7+ messages in thread
From: Chee Hong Ang @ 2020-08-07  3:50 UTC (permalink / raw)
  To: u-boot

Rename Stratix10 FPGA driver to Intel FPGA SDM Mailbox driver
because it is using generic SDM (Secure Device Manager) Mailbox
interface shared by other platform (e.g. Agilex) as well.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
---
 arch/arm/mach-socfpga/Kconfig                |  2 +-
 arch/arm/mach-socfpga/misc_s10.c             |  2 +-
 drivers/fpga/Kconfig                         | 12 ++++++------
 drivers/fpga/Makefile                        |  2 +-
 drivers/fpga/altera.c                        |  7 ++++---
 drivers/fpga/{stratix10.c => intel_sdm_mb.c} |  2 +-
 include/altera.h                             |  9 +++++----
 7 files changed, 19 insertions(+), 17 deletions(-)
 rename drivers/fpga/{stratix10.c => intel_sdm_mb.c} (98%)

diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index a3699e82a1..32549913cc 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -79,7 +79,7 @@ config TARGET_SOCFPGA_STRATIX10
 	select ARMV8_MULTIENTRY
 	select ARMV8_SET_SMPEN
 	select ARMV8_SPIN_TABLE
-	select FPGA_STRATIX10
+	select FPGA_INTEL_SDM_MAILBOX
 
 choice
 	prompt "Altera SOCFPGA board select"
diff --git a/arch/arm/mach-socfpga/misc_s10.c b/arch/arm/mach-socfpga/misc_s10.c
index 670bfa1a31..1d658f5c60 100644
--- a/arch/arm/mach-socfpga/misc_s10.c
+++ b/arch/arm/mach-socfpga/misc_s10.c
@@ -31,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
 static Altera_desc altera_fpga[] = {
 	{
 		/* Family */
-		Intel_FPGA_Stratix10,
+		Intel_FPGA_SDM_Mailbox,
 		/* Interface type */
 		secure_device_manager_mailbox,
 		/* No limitation as additional data will be ignored */
diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
index fe398a1d49..dd0b39a8d1 100644
--- a/drivers/fpga/Kconfig
+++ b/drivers/fpga/Kconfig
@@ -31,16 +31,16 @@ config FPGA_CYCLON2
 	  Enable FPGA driver for loading bitstream in BIT and BIN format
 	  on Altera Cyclone II device.
 
-config FPGA_STRATIX10
-	bool "Enable Altera FPGA driver for Stratix 10"
+config FPGA_INTEL_SDM_MAILBOX
+	bool "Enable Intel FPGA Full Reconfiguration SDM Mailbox driver"
 	depends on TARGET_SOCFPGA_STRATIX10
 	select FPGA_ALTERA
 	help
-	  Say Y here to enable the Altera Stratix 10 FPGA specific driver
+	  Say Y here to enable the Intel FPGA Full Reconfig SDM Mailbox driver
 
-	  This provides common functionality for Altera Stratix 10 devices.
-	  Enable FPGA driver for writing bitstream into Altera Stratix10
-	  device.
+	  This provides common functionality for Intel FPGA devices.
+	  Enable FPGA driver for writing full bitstream into Intel FPGA
+	  devices through SDM (Secure Device Manager) Mailbox.
 
 config FPGA_XILINX
 	bool "Enable Xilinx FPGA drivers"
diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile
index 04e6480f20..83243fb107 100644
--- a/drivers/fpga/Makefile
+++ b/drivers/fpga/Makefile
@@ -16,9 +16,9 @@ ifdef CONFIG_FPGA_ALTERA
 obj-y += altera.o
 obj-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
 obj-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
+obj-$(CONFIG_FPGA_INTEL_SDM_MAILBOX) += intel_sdm_mb.o
 obj-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
 obj-$(CONFIG_FPGA_STRATIX_V) += stratixv.o
-obj-$(CONFIG_FPGA_STRATIX10) += stratix10.o
 obj-$(CONFIG_FPGA_SOCFPGA) += socfpga.o
 obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += socfpga_gen5.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += socfpga_arria10.o
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index bb27b3778f..10c0475d25 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -40,12 +40,13 @@ static const struct altera_fpga {
 #if defined(CONFIG_FPGA_STRATIX_V)
 	{ Altera_StratixV, "StratixV", stratixv_load, NULL, NULL },
 #endif
-#if defined(CONFIG_FPGA_STRATIX10)
-	{ Intel_FPGA_Stratix10, "Stratix10", stratix10_load, NULL, NULL },
-#endif
 #if defined(CONFIG_FPGA_SOCFPGA)
 	{ Altera_SoCFPGA, "SoC FPGA", socfpga_load, NULL, NULL },
 #endif
+#if defined(CONFIG_FPGA_INTEL_SDM_MAILBOX)
+	{ Intel_FPGA_SDM_Mailbox, "Intel SDM Mailbox", intel_sdm_mb_load, NULL,
+	  NULL },
+#endif
 };
 
 static int altera_validate(Altera_desc *desc, const char *fn)
diff --git a/drivers/fpga/stratix10.c b/drivers/fpga/intel_sdm_mb.c
similarity index 98%
rename from drivers/fpga/stratix10.c
rename to drivers/fpga/intel_sdm_mb.c
index da8fa315e3..3508231191 100644
--- a/drivers/fpga/stratix10.c
+++ b/drivers/fpga/intel_sdm_mb.c
@@ -247,7 +247,7 @@ static int send_reconfig_data(const void *rbf_data, size_t rbf_size,
  * This is the interface used by FPGA driver.
  * Return 0 for success, non-zero for error.
  */
-int stratix10_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size)
+int intel_sdm_mb_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size)
 {
 	int ret;
 	u32 resp_len = 2;
diff --git a/include/altera.h b/include/altera.h
index 22d55cfd73..946413c66e 100644
--- a/include/altera.h
+++ b/include/altera.h
@@ -56,10 +56,10 @@ enum altera_family {
 	Altera_StratixII,
 	/* StratixV Family */
 	Altera_StratixV,
-	/* Stratix10 Family */
-	Intel_FPGA_Stratix10,
 	/* SoCFPGA Family */
 	Altera_SoCFPGA,
+	/* Intel FPGA Family with SDM (Secure Device Manager) Mailbox */
+	Intel_FPGA_SDM_Mailbox,
 
 	/* Add new models here */
 
@@ -120,8 +120,9 @@ int socfpga_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
 int stratixv_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
 #endif
 
-#ifdef CONFIG_FPGA_STRATIX10
-int stratix10_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
+#ifdef CONFIG_FPGA_INTEL_SDM_MAILBOX
+int intel_sdm_mb_load(Altera_desc *desc, const void *rbf_data,
+		      size_t rbf_size);
 #endif
 
 #endif /* _ALTERA_H_ */
-- 
2.13.0

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

* [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset
  2020-08-07  3:50 [PATCH v1 0/3] Rename Stratix10 FPGA driver and support Agilex Chee Hong Ang
  2020-08-07  3:50 ` [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox Chee Hong Ang
@ 2020-08-07  3:50 ` Chee Hong Ang
  2020-08-11  2:09   ` Tan, Ley Foon
  2020-08-07  3:50 ` [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support Chee Hong Ang
  2 siblings, 1 reply; 7+ messages in thread
From: Chee Hong Ang @ 2020-08-07  3:50 UTC (permalink / raw)
  To: u-boot

Ensure watchdog reset is not triggered if the fpga
reconfiguration is taking too long.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
---
 drivers/fpga/intel_sdm_mb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/fpga/intel_sdm_mb.c b/drivers/fpga/intel_sdm_mb.c
index 3508231191..9a1dc2c0c8 100644
--- a/drivers/fpga/intel_sdm_mb.c
+++ b/drivers/fpga/intel_sdm_mb.c
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <altera.h>
 #include <log.h>
+#include <watchdog.h>
 #include <asm/arch/mailbox_s10.h>
 #include <linux/delay.h>
 
@@ -113,6 +114,7 @@ static int reconfig_status_polling_resp(void)
 
 		puts(".");
 		udelay(RECONFIG_STATUS_INTERVAL_DELAY_US);
+		WATCHDOG_RESET();
 	}
 
 	return -ETIMEDOUT;
@@ -238,6 +240,7 @@ static int send_reconfig_data(const void *rbf_data, size_t rbf_size,
 			if (resp_err && !xfer_count)
 				return resp_err;
 		}
+		WATCHDOG_RESET();
 	}
 
 	return 0;
-- 
2.13.0

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

* [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support
  2020-08-07  3:50 [PATCH v1 0/3] Rename Stratix10 FPGA driver and support Agilex Chee Hong Ang
  2020-08-07  3:50 ` [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox Chee Hong Ang
  2020-08-07  3:50 ` [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset Chee Hong Ang
@ 2020-08-07  3:50 ` Chee Hong Ang
  2020-08-11  2:06   ` Tan, Ley Foon
  2 siblings, 1 reply; 7+ messages in thread
From: Chee Hong Ang @ 2020-08-07  3:50 UTC (permalink / raw)
  To: u-boot

Enable FPGA full reconfiguration support with Intel FPGA SDM
Mailbox driver for Agilex.

Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
---
 arch/arm/mach-socfpga/Kconfig | 1 +
 drivers/fpga/Kconfig          | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
index 32549913cc..26f2cf8e47 100644
--- a/arch/arm/mach-socfpga/Kconfig
+++ b/arch/arm/mach-socfpga/Kconfig
@@ -35,6 +35,7 @@ config TARGET_SOCFPGA_AGILEX
 	select ARMV8_SET_SMPEN
 	select ARMV8_SPIN_TABLE
 	select CLK
+	select FPGA_INTEL_SDM_MAILBOX
 	select NCORE_CACHE
 	select SPL_CLK if SPL
 
diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
index dd0b39a8d1..425b52a926 100644
--- a/drivers/fpga/Kconfig
+++ b/drivers/fpga/Kconfig
@@ -33,7 +33,7 @@ config FPGA_CYCLON2
 
 config FPGA_INTEL_SDM_MAILBOX
 	bool "Enable Intel FPGA Full Reconfiguration SDM Mailbox driver"
-	depends on TARGET_SOCFPGA_STRATIX10
+	depends on TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	select FPGA_ALTERA
 	help
 	  Say Y here to enable the Intel FPGA Full Reconfig SDM Mailbox driver
-- 
2.13.0

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

* [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support
  2020-08-07  3:50 ` [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support Chee Hong Ang
@ 2020-08-11  2:06   ` Tan, Ley Foon
  0 siblings, 0 replies; 7+ messages in thread
From: Tan, Ley Foon @ 2020-08-11  2:06 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Ang, Chee Hong <chee.hong.ang@intel.com>
> Sent: Friday, August 7, 2020 11:50 AM
> To: u-boot at lists.denx.de
> Cc: Marek Vasut <marex@denx.de>; Simon Goldschmidt
> <simon.k.r.goldschmidt@gmail.com>; Tom Rini <trini@konsulko.com>; See,
> Chin Liang <chin.liang.see@intel.com>; Tan, Ley Foon
> <ley.foon.tan@intel.com>; Ang, Chee Hong <chee.hong.ang@intel.com>;
> Chee, Tien Fong <tien.fong.chee@intel.com>; Lim, Elly Siew Chin
> <elly.siew.chin.lim@intel.com>
> Subject: [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full
> Reconfiguration support
> 
> Enable FPGA full reconfiguration support with Intel FPGA SDM Mailbox driver
> for Agilex.
> 
> Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
> ---
>  arch/arm/mach-socfpga/Kconfig | 1 +
>  drivers/fpga/Kconfig          | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-
> socfpga/Kconfig index 32549913cc..26f2cf8e47 100644
> --- a/arch/arm/mach-socfpga/Kconfig
> +++ b/arch/arm/mach-socfpga/Kconfig
> @@ -35,6 +35,7 @@ config TARGET_SOCFPGA_AGILEX
>  	select ARMV8_SET_SMPEN
>  	select ARMV8_SPIN_TABLE
>  	select CLK
> +	select FPGA_INTEL_SDM_MAILBOX
>  	select NCORE_CACHE
>  	select SPL_CLK if SPL
> 
> diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index
> dd0b39a8d1..425b52a926 100644
> --- a/drivers/fpga/Kconfig
> +++ b/drivers/fpga/Kconfig
> @@ -33,7 +33,7 @@ config FPGA_CYCLON2
> 
>  config FPGA_INTEL_SDM_MAILBOX
>  	bool "Enable Intel FPGA Full Reconfiguration SDM Mailbox driver"
> -	depends on TARGET_SOCFPGA_STRATIX10
> +	depends on TARGET_SOCFPGA_STRATIX10 ||
> TARGET_SOCFPGA_AGILEX
>  	select FPGA_ALTERA
>  	help
>  	  Say Y here to enable the Intel FPGA Full Reconfig SDM Mailbox
> driver
> --

Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

Regards
Ley Foon

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

* [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox
  2020-08-07  3:50 ` [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox Chee Hong Ang
@ 2020-08-11  2:08   ` Tan, Ley Foon
  0 siblings, 0 replies; 7+ messages in thread
From: Tan, Ley Foon @ 2020-08-11  2:08 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Ang, Chee Hong <chee.hong.ang@intel.com>
> Sent: Friday, August 7, 2020 11:50 AM
> To: u-boot at lists.denx.de
> Cc: Marek Vasut <marex@denx.de>; Simon Goldschmidt
> <simon.k.r.goldschmidt@gmail.com>; Tom Rini <trini@konsulko.com>; See,
> Chin Liang <chin.liang.see@intel.com>; Tan, Ley Foon
> <ley.foon.tan@intel.com>; Ang, Chee Hong <chee.hong.ang@intel.com>;
> Chee, Tien Fong <tien.fong.chee@intel.com>; Lim, Elly Siew Chin
> <elly.siew.chin.lim@intel.com>
> Subject: [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA
> SDM Mailbox
> 
> Rename Stratix10 FPGA driver to Intel FPGA SDM Mailbox driver because it is
> using generic SDM (Secure Device Manager) Mailbox interface shared by
> other platform (e.g. Agilex) as well.
> 
> Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
> ---


Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

Regards
Ley Foon

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

* [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset
  2020-08-07  3:50 ` [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset Chee Hong Ang
@ 2020-08-11  2:09   ` Tan, Ley Foon
  0 siblings, 0 replies; 7+ messages in thread
From: Tan, Ley Foon @ 2020-08-11  2:09 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Ang, Chee Hong <chee.hong.ang@intel.com>
> Sent: Friday, August 7, 2020 11:50 AM
> To: u-boot at lists.denx.de
> Cc: Marek Vasut <marex@denx.de>; Simon Goldschmidt
> <simon.k.r.goldschmidt@gmail.com>; Tom Rini <trini@konsulko.com>; See,
> Chin Liang <chin.liang.see@intel.com>; Tan, Ley Foon
> <ley.foon.tan@intel.com>; Ang, Chee Hong <chee.hong.ang@intel.com>;
> Chee, Tien Fong <tien.fong.chee@intel.com>; Lim, Elly Siew Chin
> <elly.siew.chin.lim@intel.com>
> Subject: [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset
> 
> Ensure watchdog reset is not triggered if the fpga reconfiguration is taking
> too long.
> 
> Signed-off-by: Chee Hong Ang <chee.hong.ang@intel.com>
> ---
>  drivers/fpga/intel_sdm_mb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 



Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

Regards
Ley Foon

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07  3:50 [PATCH v1 0/3] Rename Stratix10 FPGA driver and support Agilex Chee Hong Ang
2020-08-07  3:50 ` [PATCH v1 1/3] fpga: altera: Rename Stratix10 FPGA to Intel FPGA SDM Mailbox Chee Hong Ang
2020-08-11  2:08   ` Tan, Ley Foon
2020-08-07  3:50 ` [PATCH v1 2/3] fpga: intel_sdm_mb: Add watchdog reset Chee Hong Ang
2020-08-11  2:09   ` Tan, Ley Foon
2020-08-07  3:50 ` [PATCH v1 3/3] arm: socfpga: agilex: Enable FPGA Full Reconfiguration support Chee Hong Ang
2020-08-11  2:06   ` Tan, Ley Foon

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.