public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2] riscv: ae350: Check firmware_fdt_addr header
@ 2022-10-20  5:56 Rick Chen
  0 siblings, 0 replies; only message in thread
From: Rick Chen @ 2022-10-20  5:56 UTC (permalink / raw)
  To: ycliang, rickchen36, rick; +Cc: u-boot

Check firmware_fdt_addr header to see if it
is a valid fdt blob.

Signed-off-by: Rick Chen <rick@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
---
 board/AndesTech/ax25-ae350/ax25-ae350.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c
index 36f0dd4b0f..08d0c6b264 100644
--- a/board/AndesTech/ax25-ae350/ax25-ae350.c
+++ b/board/AndesTech/ax25-ae350/ax25-ae350.c
@@ -60,7 +60,7 @@ void *board_fdt_blob_setup(int *err)
 	*err = 0;
 
 	if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
-		if (gd->arch.firmware_fdt_addr)
+		if (fdt_magic((void *)gd->arch.firmware_fdt_addr) == FDT_MAGIC)
 			return (void *)(ulong)gd->arch.firmware_fdt_addr;
 	}
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-20  5:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20  5:56 [PATCH v2] riscv: ae350: Check firmware_fdt_addr header Rick Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox