All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup()
@ 2021-01-11 13:01 Michal Simek
  2021-01-11 13:01 ` [PATCH 2/2] xilinx: common: Do not touch CONFIG_XILINX_OF_BOARD_DTB_ADDR in SPL Michal Simek
  2021-01-20  7:49 ` [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup() Michal Simek
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2021-01-11 13:01 UTC (permalink / raw)
  To: u-boot

Remove ifdef logic which is handled by preprocessor and move it link time
optimization to get full compile code coverage.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/common/board.c | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index cdc06a39ce58..9f651db734c7 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -324,25 +324,29 @@ void *board_fdt_blob_setup(void)
 {
 	void *fdt_blob;
 
-#if !defined(CONFIG_VERSAL_NO_DDR) && !defined(CONFIG_ZYNQMP_NO_DDR)
-	fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;
+	if (!IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
+	    !IS_ENABLED(CONFIG_VERSAL_NO_DDR)) {
+		fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;
 
-	if (fdt_magic(fdt_blob) == FDT_MAGIC)
-		return fdt_blob;
+		if (fdt_magic(fdt_blob) == FDT_MAGIC)
+			return fdt_blob;
 
-	debug("DTB is not passed via %p\n", fdt_blob);
-#endif
+		debug("DTB is not passed via %p\n", fdt_blob);
+	}
 
-#ifdef CONFIG_SPL_BUILD
-	/* FDT is at end of BSS unless it is in a different memory region */
-	if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
-		fdt_blob = (ulong *)&_image_binary_end;
-	else
-		fdt_blob = (ulong *)&__bss_end;
-#else
-	/* FDT is at end of image */
-	fdt_blob = (ulong *)&_end;
-#endif
+	if (IS_ENABLED(CONFIG_SPL_BUILD)) {
+		/*
+		 * FDT is at end of BSS unless it is in a different memory
+		 * region
+		 */
+		if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
+			fdt_blob = (ulong *)&_image_binary_end;
+		else
+			fdt_blob = (ulong *)&__bss_end;
+	} else {
+		/* FDT is at end of image */
+		fdt_blob = (ulong *)&_end;
+	}
 
 	if (fdt_magic(fdt_blob) == FDT_MAGIC)
 		return fdt_blob;
-- 
2.30.0

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

* [PATCH 2/2] xilinx: common: Do not touch CONFIG_XILINX_OF_BOARD_DTB_ADDR in SPL
  2021-01-11 13:01 [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup() Michal Simek
@ 2021-01-11 13:01 ` Michal Simek
  2021-01-20  7:49   ` Michal Simek
  2021-01-20  7:49 ` [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup() Michal Simek
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Simek @ 2021-01-11 13:01 UTC (permalink / raw)
  To: u-boot

This hook is used in full U-Boot that's why there is no reason to touch
this location from SPL. The hook was introduced for QEMU usage but none is
really running SPL on QEMU that's why it shouldn't break any usecase.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/common/board.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 9f651db734c7..df19aeadd0b2 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -324,7 +324,8 @@ void *board_fdt_blob_setup(void)
 {
 	void *fdt_blob;
 
-	if (!IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
+	if (!IS_ENABLED(CONFIG_SPL_BUILD) &&
+	    !IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
 	    !IS_ENABLED(CONFIG_VERSAL_NO_DDR)) {
 		fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;
 
-- 
2.30.0

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

* [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup()
  2021-01-11 13:01 [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup() Michal Simek
  2021-01-11 13:01 ` [PATCH 2/2] xilinx: common: Do not touch CONFIG_XILINX_OF_BOARD_DTB_ADDR in SPL Michal Simek
@ 2021-01-20  7:49 ` Michal Simek
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Simek @ 2021-01-20  7:49 UTC (permalink / raw)
  To: u-boot

po 11. 1. 2021 v 14:01 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Remove ifdef logic which is handled by preprocessor and move it link time
> optimization to get full compile code coverage.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  board/xilinx/common/board.c | 36 ++++++++++++++++++++----------------
>  1 file changed, 20 insertions(+), 16 deletions(-)
>
> diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
> index cdc06a39ce58..9f651db734c7 100644
> --- a/board/xilinx/common/board.c
> +++ b/board/xilinx/common/board.c
> @@ -324,25 +324,29 @@ void *board_fdt_blob_setup(void)
>  {
>         void *fdt_blob;
>
> -#if !defined(CONFIG_VERSAL_NO_DDR) && !defined(CONFIG_ZYNQMP_NO_DDR)
> -       fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;
> +       if (!IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
> +           !IS_ENABLED(CONFIG_VERSAL_NO_DDR)) {
> +               fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;
>
> -       if (fdt_magic(fdt_blob) == FDT_MAGIC)
> -               return fdt_blob;
> +               if (fdt_magic(fdt_blob) == FDT_MAGIC)
> +                       return fdt_blob;
>
> -       debug("DTB is not passed via %p\n", fdt_blob);
> -#endif
> +               debug("DTB is not passed via %p\n", fdt_blob);
> +       }
>
> -#ifdef CONFIG_SPL_BUILD
> -       /* FDT is at end of BSS unless it is in a different memory region */
> -       if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
> -               fdt_blob = (ulong *)&_image_binary_end;
> -       else
> -               fdt_blob = (ulong *)&__bss_end;
> -#else
> -       /* FDT is at end of image */
> -       fdt_blob = (ulong *)&_end;
> -#endif
> +       if (IS_ENABLED(CONFIG_SPL_BUILD)) {
> +               /*
> +                * FDT is at end of BSS unless it is in a different memory
> +                * region
> +                */
> +               if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
> +                       fdt_blob = (ulong *)&_image_binary_end;
> +               else
> +                       fdt_blob = (ulong *)&__bss_end;
> +       } else {
> +               /* FDT is at end of image */
> +               fdt_blob = (ulong *)&_end;
> +       }
>
>         if (fdt_magic(fdt_blob) == FDT_MAGIC)
>                 return fdt_blob;
> --
> 2.30.0
>

Applied.
M


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

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

* [PATCH 2/2] xilinx: common: Do not touch CONFIG_XILINX_OF_BOARD_DTB_ADDR in SPL
  2021-01-11 13:01 ` [PATCH 2/2] xilinx: common: Do not touch CONFIG_XILINX_OF_BOARD_DTB_ADDR in SPL Michal Simek
@ 2021-01-20  7:49   ` Michal Simek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2021-01-20  7:49 UTC (permalink / raw)
  To: u-boot

po 11. 1. 2021 v 14:01 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> This hook is used in full U-Boot that's why there is no reason to touch
> this location from SPL. The hook was introduced for QEMU usage but none is
> really running SPL on QEMU that's why it shouldn't break any usecase.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  board/xilinx/common/board.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
> index 9f651db734c7..df19aeadd0b2 100644
> --- a/board/xilinx/common/board.c
> +++ b/board/xilinx/common/board.c
> @@ -324,7 +324,8 @@ void *board_fdt_blob_setup(void)
>  {
>         void *fdt_blob;
>
> -       if (!IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
> +       if (!IS_ENABLED(CONFIG_SPL_BUILD) &&
> +           !IS_ENABLED(CONFIG_VERSAL_NO_DDR) &&
>             !IS_ENABLED(CONFIG_VERSAL_NO_DDR)) {
>                 fdt_blob = (void *)CONFIG_XILINX_OF_BOARD_DTB_ADDR;
>
> --
> 2.30.0
>

Applied.
M


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

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

end of thread, other threads:[~2021-01-20  7:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 13:01 [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup() Michal Simek
2021-01-11 13:01 ` [PATCH 2/2] xilinx: common: Do not touch CONFIG_XILINX_OF_BOARD_DTB_ADDR in SPL Michal Simek
2021-01-20  7:49   ` Michal Simek
2021-01-20  7:49 ` [PATCH 1/2] xilinx: common: Change macro handling in board_fdt_blob_setup() Michal Simek

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.