* [PATCH v1 0/2] Add FPGA configuration when booting Linux
@ 2025-03-12 15:37 muhammad.hazim.izzat.zamri
0 siblings, 0 replies; 6+ messages in thread
From: muhammad.hazim.izzat.zamri @ 2025-03-12 15:37 UTC (permalink / raw)
To: u-boot
Cc: Michal Simek, Tom Rini, Marek, Simon, Tien Fong, Dinesh,
Boon Khai, Alif, Hazim, Tingting Meng
From: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
This patchset enable the capability to automatically perform
FPGA configuration when booting Linux FIT image via bootm command.
The FPGA configuration bitstream shall be packed within the
FIT image.
Second patch is to add additional flag to check whether an FPGA
driver is able to load a particular FPGA bitstream image.
Both patch have been tested and able to boot U-boot using
debugger and QSPI boot.
Muhammad Hazim Izzat Zamri (2):
drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA
drivers: fpga: Follow mainline to pass compatible flags to fpga_load
drivers/fpga/altera.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 0/2] Add FPGA configuration when booting Linux
@ 2025-03-12 16:04 muhammad.hazim.izzat.zamri
0 siblings, 0 replies; 6+ messages in thread
From: muhammad.hazim.izzat.zamri @ 2025-03-12 16:04 UTC (permalink / raw)
To: u-boot
Cc: Michal Simek, Tom Rini, Marek, Simon, Tien Fong, Dinesh,
Boon Khai, Alif, Hazim, Tingting Meng
From: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
This patchset enable the capability to automatically perform
FPGA configuration when booting Linux FIT image via bootm command.
The FPGA configuration bitstream shall be packed within the
FIT image.
Second patch is to add additional flag to check whether an FPGA
driver is able to load a particular FPGA bitstream image.
Both patch have been tested and able to boot U-boot using
debugger and QSPI boot.
Muhammad Hazim Izzat Zamri (2):
drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA
drivers: fpga: Follow mainline to pass compatible flags to fpga_load
drivers/fpga/altera.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 0/2] Add FPGA configuration when booting Linux
@ 2025-03-14 2:19 muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 1/2] drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA muhammad.hazim.izzat.zamri
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: muhammad.hazim.izzat.zamri @ 2025-03-14 2:19 UTC (permalink / raw)
To: u-boot
Cc: Michal Simek, Tom Rini, Marek, Simon, Tien Fong, Dinesh,
Boon Khai, Alif, Hazim, Tingting Meng
From: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
This patchset enable the capability to automatically perform
FPGA configuration when booting Linux FIT image via bootm command.
The FPGA configuration bitstream shall be packed within the
FIT image.
Second patch is to add additional flag to check whether an FPGA
driver is able to load a particular FPGA bitstream image.
Both patch have been tested and able to boot U-boot using
debugger and QSPI boot.
Muhammad Hazim Izzat Zamri (2):
drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA
drivers: fpga: Follow mainline to pass compatible flags to fpga_load
drivers/fpga/altera.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 1/2] drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA
2025-03-14 2:19 [PATCH v1 0/2] Add FPGA configuration when booting Linux muhammad.hazim.izzat.zamri
@ 2025-03-14 2:19 ` muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 2/2] drivers: fpga: Follow mainline to pass compatible flags to fpga_load muhammad.hazim.izzat.zamri
2025-04-08 6:50 ` [PATCH v1 0/2] Add FPGA configuration when booting Linux Michal Simek
2 siblings, 0 replies; 6+ messages in thread
From: muhammad.hazim.izzat.zamri @ 2025-03-14 2:19 UTC (permalink / raw)
To: u-boot
Cc: Michal Simek, Tom Rini, Marek, Simon, Tien Fong, Dinesh,
Boon Khai, Alif, Hazim, Tingting Meng
From: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
Enabling the capability to automatically perform FPGA configuration
when booting Linux FIT image via bootm command. The FPGA
configuration bitstream shall be packed within the FIT image.
The FPGA data (full or partial) is checked by the SDM hardware,
for Intel SDM Mailbox based devices. Hence always return full
bitstream.
Second function is to enable the HPS to FPGA bridges when FPGA load
is completed successfully. This is to ensure the FPGA is accessible
by the HPS.
Signed-off-by: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
---
drivers/fpga/altera.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index ae06f0123a0..136ccfc2de4 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -12,6 +12,10 @@
/*
* Altera FPGA support
*/
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX) || \
+ IS_ENABLED(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#include <asm/arch/misc.h>
+#endif
#include <errno.h>
#include <ACEX1K.h>
#include <log.h>
@@ -47,6 +51,42 @@ static const struct altera_fpga {
#endif
};
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX) || \
+ IS_ENABLED(CONFIG_TARGET_SOCFPGA_STRATIX10)
+int fpga_is_partial_data(int devnum, size_t img_len)
+{
+ /*
+ * The FPGA data (full or partial) is checked by
+ * the SDM hardware, for Intel SDM Mailbox based
+ * devices. Hence always return full bitstream.
+ *
+ * For Cyclone V and Arria 10 family, the bitstream
+ * type parameter is not handled by the driver.
+ */
+ return 0;
+}
+
+int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
+ bitstream_type bstype)
+{
+ int ret_val;
+
+ ret_val = fpga_load(devnum, (void *)fpgadata, size, bstype);
+
+ /*
+ * Enable the HPS to FPGA bridges when FPGA load is completed
+ * successfully. This is to ensure the FPGA is accessible
+ * by the HPS.
+ */
+ if (!ret_val) {
+ printf("Enable FPGA bridges\n");
+ do_bridge_reset(1, ~0);
+ }
+
+ return ret_val;
+}
+#endif
+
static int altera_validate(Altera_desc *desc, const char *fn)
{
if (!desc) {
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 2/2] drivers: fpga: Follow mainline to pass compatible flags to fpga_load
2025-03-14 2:19 [PATCH v1 0/2] Add FPGA configuration when booting Linux muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 1/2] drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA muhammad.hazim.izzat.zamri
@ 2025-03-14 2:19 ` muhammad.hazim.izzat.zamri
2025-04-08 6:50 ` [PATCH v1 0/2] Add FPGA configuration when booting Linux Michal Simek
2 siblings, 0 replies; 6+ messages in thread
From: muhammad.hazim.izzat.zamri @ 2025-03-14 2:19 UTC (permalink / raw)
To: u-boot
Cc: Michal Simek, Tom Rini, Marek, Simon, Tien Fong, Dinesh,
Boon Khai, Alif, Hazim, Tingting Meng
From: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
Introducing additional flag to check whether an FPGA driver is able to
load a particular FPGA bitstream image.
Generally, flag variable is used to enable or disable certain features,
specify additional parameters (such as error handling), or modify how
the function operates.
Hence, in this function flags is an integer that can be used to pass
configuration options to the fpga_load function. Here, it's
initialized to 0, meaning no special options are enabled, but it could
modify the flags to influence the function's behavior.
Signed-off-by: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
---
drivers/fpga/altera.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index 136ccfc2de4..64fda3a307c 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -70,8 +70,9 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
bitstream_type bstype)
{
int ret_val;
+ int flags = 0;
- ret_val = fpga_load(devnum, (void *)fpgadata, size, bstype);
+ ret_val = fpga_load(devnum, (void *)fpgadata, size, bstype, flags);
/*
* Enable the HPS to FPGA bridges when FPGA load is completed
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 0/2] Add FPGA configuration when booting Linux
2025-03-14 2:19 [PATCH v1 0/2] Add FPGA configuration when booting Linux muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 1/2] drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 2/2] drivers: fpga: Follow mainline to pass compatible flags to fpga_load muhammad.hazim.izzat.zamri
@ 2025-04-08 6:50 ` Michal Simek
2 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2025-04-08 6:50 UTC (permalink / raw)
To: muhammad.hazim.izzat.zamri, u-boot
Cc: Tom Rini, Marek, Simon, Tien Fong, Dinesh, Boon Khai, Alif,
Tingting Meng
On 3/14/25 03:19, muhammad.hazim.izzat.zamri@altera.com wrote:
> From: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
>
> This patchset enable the capability to automatically perform
> FPGA configuration when booting Linux FIT image via bootm command.
> The FPGA configuration bitstream shall be packed within the
> FIT image.
>
> Second patch is to add additional flag to check whether an FPGA
> driver is able to load a particular FPGA bitstream image.
>
> Both patch have been tested and able to boot U-boot using
> debugger and QSPI boot.
>
> Muhammad Hazim Izzat Zamri (2):
> drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA
> drivers: fpga: Follow mainline to pass compatible flags to fpga_load
>
> drivers/fpga/altera.c | 41 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> --
> 2.25.1
>
Applied.
M
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-04-08 6:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 2:19 [PATCH v1 0/2] Add FPGA configuration when booting Linux muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 1/2] drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA muhammad.hazim.izzat.zamri
2025-03-14 2:19 ` [PATCH v1 2/2] drivers: fpga: Follow mainline to pass compatible flags to fpga_load muhammad.hazim.izzat.zamri
2025-04-08 6:50 ` [PATCH v1 0/2] Add FPGA configuration when booting Linux Michal Simek
-- strict thread matches above, loose matches on Subject: below --
2025-03-12 16:04 muhammad.hazim.izzat.zamri
2025-03-12 15:37 muhammad.hazim.izzat.zamri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox