All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
@ 2016-07-15  7:35 Michal Simek
  2016-07-17 14:12 ` Simon Glass
  2016-07-25  2:07 ` Simon Glass
  0 siblings, 2 replies; 7+ messages in thread
From: Michal Simek @ 2016-07-15  7:35 UTC (permalink / raw)
  To: u-boot

Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
U-Boot shouldn't update memory setup in DTB file.
One example of usage of this option is to boot OS with different memory
setup than U-Boot use.

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

Changes in v2:
- Change logic to be possitive - sjg

 Kconfig                  | 9 +++++++++
 arch/arm/lib/bootm-fdt.c | 2 ++
 arch/arm/lib/bootm.c     | 2 ++
 arch/mips/lib/bootm.c    | 2 ++
 common/image-fdt.c       | 7 ++-----
 5 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/Kconfig b/Kconfig
index 3ceff250321e..114b3a21d34b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -319,6 +319,15 @@ config SYS_CLK_FREQ
 	help
 	  TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture
 
+config ARCH_FIXUP_FDT
+	bool "Enable arch_fixup_fdt() call"
+	depends on ARM || MIPS
+	default y
+	help
+	  Enable FDT memory map syncup before OS boot. This feature can be
+	  used for booting OS with different memory setup where the part of
+	  the memory location should be used for different purpose.
+
 endmenu		# Boot images
 
 source "common/Kconfig"
diff --git a/arch/arm/lib/bootm-fdt.c b/arch/arm/lib/bootm-fdt.c
index 76b75d8e4643..3f42faf04125 100644
--- a/arch/arm/lib/bootm-fdt.c
+++ b/arch/arm/lib/bootm-fdt.c
@@ -24,6 +24,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_ARCH_FIXUP_FDT
 int arch_fixup_fdt(void *blob)
 {
 	bd_t *bd = gd->bd;
@@ -53,3 +54,4 @@ int arch_fixup_fdt(void *blob)
 
 	return 0;
 }
+#endif
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 0838d89907b9..82354ddfebd8 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -399,8 +399,10 @@ void boot_prep_vxworks(bootm_headers_t *images)
 	if (images->ft_addr) {
 		off = fdt_path_offset(images->ft_addr, "/memory");
 		if (off < 0) {
+#ifdef CONFIG_ARCH_FIXUP_FDT
 			if (arch_fixup_fdt(images->ft_addr))
 				puts("## WARNING: fixup memory failed!\n");
+#endif
 		}
 	}
 #endif
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index aa0475a4954e..f8fbabc14487 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -253,6 +253,7 @@ static int boot_reloc_fdt(bootm_headers_t *images)
 #endif
 }
 
+#ifndef CONFIG_ARCH_FIXUP_FDT
 int arch_fixup_fdt(void *blob)
 {
 #if CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && CONFIG_IS_ENABLED(OF_LIBFDT)
@@ -264,6 +265,7 @@ int arch_fixup_fdt(void *blob)
 	return 0;
 #endif
 }
+#endif
 
 static int boot_setup_fdt(bootm_headers_t *images)
 {
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 6cac7dbb7f8b..d6ee225d409e 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -458,11 +458,6 @@ __weak int ft_verify_fdt(void *fdt)
 	return 1;
 }
 
-__weak int arch_fixup_fdt(void *blob)
-{
-	return 0;
-}
-
 int image_setup_libfdt(bootm_headers_t *images, void *blob,
 		       int of_size, struct lmb *lmb)
 {
@@ -479,10 +474,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
 		printf("ERROR: /chosen node create failed\n");
 		goto err;
 	}
+#ifdef CONFIG_ARCH_FIXUP_FDT
 	if (arch_fixup_fdt(blob) < 0) {
 		printf("ERROR: arch-specific fdt fixup failed\n");
 		goto err;
 	}
+#endif
 	if (IMAGE_OF_BOARD_SETUP) {
 		fdt_ret = ft_board_setup(blob, gd->bd);
 		if (fdt_ret) {
-- 
1.9.1

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

* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
  2016-07-15  7:35 [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option Michal Simek
@ 2016-07-17 14:12 ` Simon Glass
  2016-07-25  2:07 ` Simon Glass
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Glass @ 2016-07-17 14:12 UTC (permalink / raw)
  To: u-boot

On 15 July 2016 at 01:35, Michal Simek <michal.simek@xilinx.com> wrote:
> Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
> U-Boot shouldn't update memory setup in DTB file.
> One example of usage of this option is to boot OS with different memory
> setup than U-Boot use.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v2:
> - Change logic to be possitive - sjg
>
>  Kconfig                  | 9 +++++++++
>  arch/arm/lib/bootm-fdt.c | 2 ++
>  arch/arm/lib/bootm.c     | 2 ++
>  arch/mips/lib/bootm.c    | 2 ++
>  common/image-fdt.c       | 7 ++-----
>  5 files changed, 17 insertions(+), 5 deletions(-)

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

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

* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
  2016-07-15  7:35 [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option Michal Simek
  2016-07-17 14:12 ` Simon Glass
@ 2016-07-25  2:07 ` Simon Glass
  2016-07-28  2:24   ` Simon Glass
  1 sibling, 1 reply; 7+ messages in thread
From: Simon Glass @ 2016-07-25  2:07 UTC (permalink / raw)
  To: u-boot

On 15 July 2016 at 01:35, Michal Simek <michal.simek@xilinx.com> wrote:
> Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
> U-Boot shouldn't update memory setup in DTB file.
> One example of usage of this option is to boot OS with different memory
> setup than U-Boot use.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v2:
> - Change logic to be possitive - sjg
>
>  Kconfig                  | 9 +++++++++
>  arch/arm/lib/bootm-fdt.c | 2 ++
>  arch/arm/lib/bootm.c     | 2 ++
>  arch/mips/lib/bootm.c    | 2 ++
>  common/image-fdt.c       | 7 ++-----
>  5 files changed, 17 insertions(+), 5 deletions(-)

Applied to u-boot-dm, thanks!

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

* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
  2016-07-25  2:07 ` Simon Glass
@ 2016-07-28  2:24   ` Simon Glass
  2016-07-28  7:08     ` Michal Simek
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2016-07-28  2:24 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On 24 July 2016 at 20:07, Simon Glass <sjg@chromium.org> wrote:
> On 15 July 2016 at 01:35, Michal Simek <michal.simek@xilinx.com> wrote:
>> Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
>> U-Boot shouldn't update memory setup in DTB file.
>> One example of usage of this option is to boot OS with different memory
>> setup than U-Boot use.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Changes in v2:
>> - Change logic to be possitive - sjg
>>
>>  Kconfig                  | 9 +++++++++
>>  arch/arm/lib/bootm-fdt.c | 2 ++
>>  arch/arm/lib/bootm.c     | 2 ++
>>  arch/mips/lib/bootm.c    | 2 ++
>>  common/image-fdt.c       | 7 ++-----
>>  5 files changed, 17 insertions(+), 5 deletions(-)
>
> Applied to u-boot-dm, thanks!

Unfortunately this breaks pic32mzdask, a MIPS board. I did not notice
this earlier for some reason...perhaps it snuck in after my rebase.
Can you please take a look?

Regards,
Simon

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

* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
  2016-07-28  2:24   ` Simon Glass
@ 2016-07-28  7:08     ` Michal Simek
  2016-08-01  1:03       ` Simon Glass
  0 siblings, 1 reply; 7+ messages in thread
From: Michal Simek @ 2016-07-28  7:08 UTC (permalink / raw)
  To: u-boot

On 28.7.2016 04:24, Simon Glass wrote:
> Hi Michal,
> 
> On 24 July 2016 at 20:07, Simon Glass <sjg@chromium.org> wrote:
>> On 15 July 2016 at 01:35, Michal Simek <michal.simek@xilinx.com> wrote:
>>> Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
>>> U-Boot shouldn't update memory setup in DTB file.
>>> One example of usage of this option is to boot OS with different memory
>>> setup than U-Boot use.
>>>
>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>> ---
>>>
>>> Changes in v2:
>>> - Change logic to be possitive - sjg
>>>
>>>  Kconfig                  | 9 +++++++++
>>>  arch/arm/lib/bootm-fdt.c | 2 ++
>>>  arch/arm/lib/bootm.c     | 2 ++
>>>  arch/mips/lib/bootm.c    | 2 ++
>>>  common/image-fdt.c       | 7 ++-----
>>>  5 files changed, 17 insertions(+), 5 deletions(-)
>>
>> Applied to u-boot-dm, thanks!
> 
> Unfortunately this breaks pic32mzdask, a MIPS board. I did not notice
> this earlier for some reason...perhaps it snuck in after my rebase.
> Can you please take a look?

Have sent v3. In v2 I didn't change that macro to follow positive
configuration. It should be good now.

BTW: Would it be possible to extend buildman to also report problems
with defconfig? I see that more and more defconfigs. I personally run
this loop time to time but will be good if this is the part of buildman.


for i in `ls configs/xilinx_zynqmp_*`; do NAME=`basename $i`; echo
$NAME; make $NAME; make savedefconfig; cp defconfig $i; done
for i in `ls configs/zynq_*`; do NAME=`basename $i`; echo $NAME; make
$NAME; make savedefconfig; cp defconfig $i; done
for i in `ls configs/microblaze*`; do NAME=`basename $i`; echo $NAME;
make $NAME; make savedefconfig; cp defconfig $i; done

Thanks,
Michal

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

* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
  2016-07-28  7:08     ` Michal Simek
@ 2016-08-01  1:03       ` Simon Glass
  2016-08-01  6:31         ` Michal Simek
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2016-08-01  1:03 UTC (permalink / raw)
  To: u-boot

Hi Michal,

On 28 July 2016 at 01:08, Michal Simek <michal.simek@xilinx.com> wrote:
> On 28.7.2016 04:24, Simon Glass wrote:
>> Hi Michal,
>>
>> On 24 July 2016 at 20:07, Simon Glass <sjg@chromium.org> wrote:
>>> On 15 July 2016 at 01:35, Michal Simek <michal.simek@xilinx.com> wrote:
>>>> Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
>>>> U-Boot shouldn't update memory setup in DTB file.
>>>> One example of usage of this option is to boot OS with different memory
>>>> setup than U-Boot use.
>>>>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> ---
>>>>
>>>> Changes in v2:
>>>> - Change logic to be possitive - sjg
>>>>
>>>>  Kconfig                  | 9 +++++++++
>>>>  arch/arm/lib/bootm-fdt.c | 2 ++
>>>>  arch/arm/lib/bootm.c     | 2 ++
>>>>  arch/mips/lib/bootm.c    | 2 ++
>>>>  common/image-fdt.c       | 7 ++-----
>>>>  5 files changed, 17 insertions(+), 5 deletions(-)
>>>
>>> Applied to u-boot-dm, thanks!
>>
>> Unfortunately this breaks pic32mzdask, a MIPS board. I did not notice
>> this earlier for some reason...perhaps it snuck in after my rebase.
>> Can you please take a look?
>
> Have sent v3. In v2 I didn't change that macro to follow positive
> configuration. It should be good now.
>
> BTW: Would it be possible to extend buildman to also report problems
> with defconfig? I see that more and more defconfigs. I personally run
> this loop time to time but will be good if this is the part of buildman.
>
>
> for i in `ls configs/xilinx_zynqmp_*`; do NAME=`basename $i`; echo
> $NAME; make $NAME; make savedefconfig; cp defconfig $i; done
> for i in `ls configs/zynq_*`; do NAME=`basename $i`; echo $NAME; make
> $NAME; make savedefconfig; cp defconfig $i; done
> for i in `ls configs/microblaze*`; do NAME=`basename $i`; echo $NAME;
> make $NAME; make savedefconfig; cp defconfig $i; done

Do you mean that the ordering or defaults are wrong? I have an alias
to fix that, but yes it would be good if buildman could support it.
How's your Python?

Regards,
Simon

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

* [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option
  2016-08-01  1:03       ` Simon Glass
@ 2016-08-01  6:31         ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2016-08-01  6:31 UTC (permalink / raw)
  To: u-boot

On 1.8.2016 03:03, Simon Glass wrote:
> Hi Michal,
> 
> On 28 July 2016 at 01:08, Michal Simek <michal.simek@xilinx.com> wrote:
>> On 28.7.2016 04:24, Simon Glass wrote:
>>> Hi Michal,
>>>
>>> On 24 July 2016 at 20:07, Simon Glass <sjg@chromium.org> wrote:
>>>> On 15 July 2016 at 01:35, Michal Simek <michal.simek@xilinx.com> wrote:
>>>>> Add new Kconfig option to disable arch_fixup_fdt() calls for cases where
>>>>> U-Boot shouldn't update memory setup in DTB file.
>>>>> One example of usage of this option is to boot OS with different memory
>>>>> setup than U-Boot use.
>>>>>
>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>> ---
>>>>>
>>>>> Changes in v2:
>>>>> - Change logic to be possitive - sjg
>>>>>
>>>>>  Kconfig                  | 9 +++++++++
>>>>>  arch/arm/lib/bootm-fdt.c | 2 ++
>>>>>  arch/arm/lib/bootm.c     | 2 ++
>>>>>  arch/mips/lib/bootm.c    | 2 ++
>>>>>  common/image-fdt.c       | 7 ++-----
>>>>>  5 files changed, 17 insertions(+), 5 deletions(-)
>>>>
>>>> Applied to u-boot-dm, thanks!
>>>
>>> Unfortunately this breaks pic32mzdask, a MIPS board. I did not notice
>>> this earlier for some reason...perhaps it snuck in after my rebase.
>>> Can you please take a look?
>>
>> Have sent v3. In v2 I didn't change that macro to follow positive
>> configuration. It should be good now.
>>
>> BTW: Would it be possible to extend buildman to also report problems
>> with defconfig? I see that more and more defconfigs. I personally run
>> this loop time to time but will be good if this is the part of buildman.
>>
>>
>> for i in `ls configs/xilinx_zynqmp_*`; do NAME=`basename $i`; echo
>> $NAME; make $NAME; make savedefconfig; cp defconfig $i; done
>> for i in `ls configs/zynq_*`; do NAME=`basename $i`; echo $NAME; make
>> $NAME; make savedefconfig; cp defconfig $i; done
>> for i in `ls configs/microblaze*`; do NAME=`basename $i`; echo $NAME;
>> make $NAME; make savedefconfig; cp defconfig $i; done
> 
> Do you mean that the ordering or defaults are wrong? I have an alias
> to fix that, but yes it would be good if buildman could support it.

Ordering and when config options go to Kconfig then some options are
becoming default.

> How's your Python?

I do write some pytest stuff but definitely not any close to any expert
level.

Thanks,
Michal

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

end of thread, other threads:[~2016-08-01  6:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  7:35 [U-Boot] [PATCH v2] libfdt: Introduce new ARCH_FIXUP_FDT option Michal Simek
2016-07-17 14:12 ` Simon Glass
2016-07-25  2:07 ` Simon Glass
2016-07-28  2:24   ` Simon Glass
2016-07-28  7:08     ` Michal Simek
2016-08-01  1:03       ` Simon Glass
2016-08-01  6:31         ` 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.