Skip to contentSkip to conversation

Make it possible to use a builtin OF tree.

PATCH New Joakim Tjernlund 5 participants 8 messages Nov 25, 2007 – Nov 27, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

---
 common/cmd_bootm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/cmd_bootm.c +4 -1
index d816349..8405de7 100644
@@ -507,6 +507,9 @@ fixup_silent_linux ()
 #endif /* CONFIG_SILENT_CONSOLE */
 
 #ifdef CONFIG_PPC
+#ifndef DEFAULT_OF_TREE
+ #define DEFAULT_OF_TREE NULL
+#endif
 static void  __attribute__((noinline))
 do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 		int	argc, char *argv[],
@@ -527,7 +530,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 	void	(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
 	image_header_t *hdr = &header;
 #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-	char	*of_flat_tree = NULL;
+	char	*of_flat_tree = DEFAULT_OF_TREE;
 	ulong	of_data = 0;
 #endif
 
Signature · 1 line
1.5.3.6
#1 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

Quoted 20 lines · Joakim Tjernlund
---
 common/cmd_bootm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/cmd_bootm.c +3 -0
index d816349..8405de7 100644
@@ -507,6 +507,9 @@ fixup_silent_linux ()
 #endif /* CONFIG_SILENT_CONSOLE */
 
 #ifdef CONFIG_PPC
+#ifndef DEFAULT_OF_TREE
+ #define DEFAULT_OF_TREE NULL
+#endif
 static void  __attribute__((noinline))
 do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 		int	argc, char *argv[],

common/cmd_bootm.c do_bootm_linux (cmd_tbl_t *cmdtp, int flag, · line 535

Quoted 7 lines
common/cmd_bootm.c +1 -1
@@ -527,7 +530,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 	void	(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
 	image_header_t *hdr = &header;
 #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-	char	*of_flat_tree = NULL;
+	char	*of_flat_tree = DEFAULT_OF_TREE;
 	ulong	of_data = 0;
 #endif

The loss was most likely my error/misunderstanding way back at the start of LIBFDT. Your change seems reasonable, I'll add it to my list of patches to look into and add.

Thanks,
gvb

#2 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

Quoted 33 lines · Jerry Van Baren
Quoted 20 lines · Joakim Tjernlund
---
 common/cmd_bootm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/cmd_bootm.c +3 -0
index d816349..8405de7 100644
@@ -507,6 +507,9 @@ fixup_silent_linux ()
 #endif /* CONFIG_SILENT_CONSOLE */
 
 #ifdef CONFIG_PPC
+#ifndef DEFAULT_OF_TREE
+ #define DEFAULT_OF_TREE NULL
+#endif
 static void  __attribute__((noinline))
 do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 		int	argc, char *argv[],

common/cmd_bootm.c do_bootm_linux (cmd_tbl_t *cmdtp, int flag, · line 535

Quoted 7 lines
common/cmd_bootm.c +1 -1
@@ -527,7 +530,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 	void	(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
 	image_header_t *hdr = &header;
 #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-	char	*of_flat_tree = NULL;
+	char	*of_flat_tree = DEFAULT_OF_TREE;
 	ulong	of_data = 0;
 #endif

The loss was most likely my error/misunderstanding way back at the start of LIBFDT. Your change seems reasonable, I'll add it to my list of patches to look into and add.

Quoted 2 lines

Thanks,
gvb

Hi Joakim,

I looked for the definition of DEFAULT_OF_TREE and it doesn't exist in the current u-boot. I used the gitweb "pickaxe" to look for DEFAULT_OF_TREE and didn't find it that way either. Can you identify when we lost the definition?

The problem with your patch is that, if DEFAULT_OF_TREE isn't defined by somebody, the builds will break. Since it is undefined at the moment, that means *all* of the OF_FLAT_TREE and OF_LIBFDT builds would break. :-(

Thanks,
gvb

#3 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

Quoted 37 lines · gvb.uboot
Quoted 33 lines · Jerry Van Baren
Quoted 20 lines · Joakim Tjernlund
---
 common/cmd_bootm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/cmd_bootm.c +3 -0
index d816349..8405de7 100644
@@ -507,6 +507,9 @@ fixup_silent_linux ()
 #endif /* CONFIG_SILENT_CONSOLE */
 
 #ifdef CONFIG_PPC
+#ifndef DEFAULT_OF_TREE
+ #define DEFAULT_OF_TREE NULL
+#endif
 static void  __attribute__((noinline))
 do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 		int	argc, char *argv[],

common/cmd_bootm.c do_bootm_linux (cmd_tbl_t *cmdtp, int flag, · line 535

Quoted 7 lines
common/cmd_bootm.c +1 -1
@@ -527,7 +530,7 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
 	void	(*kernel)(bd_t *, ulong, ulong, ulong, ulong);
 	image_header_t *hdr = &header;
 #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
-	char	*of_flat_tree = NULL;
+	char	*of_flat_tree = DEFAULT_OF_TREE;
 	ulong	of_data = 0;
 #endif

The loss was most likely my error/misunderstanding way back at the start of LIBFDT. Your change seems reasonable, I'll add it to my list of patches to look into and add.

Quoted 2 lines

Thanks,
gvb

Quoted 6 lines

Hi Joakim,

I looked for the definition of DEFAULT_OF_TREE and it doesn't exist in the current u-boot. I used the gitweb "pickaxe" to look for DEFAULT_OF_TREE and didn't find it that way either. Can you identify when we lost the definition?

Not really, it was possible in u-boot 1.1.4 and now it is not.

Quoted 4 lines

The problem with your patch is that, if DEFAULT_OF_TREE isn't defined by somebody, the builds will break. Since it is undefined at the moment, that means *all* of the OF_FLAT_TREE and OF_LIBFDT builds would break. :-(

ehh, doesn't the
#ifndef DEFAULT_OF_TREE
#define DEFAULT_OF_TREE NULL
#endif
take care of that?

Jocke

#4 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

Quoted 10 lines
Quoted 10 lines
Quoted 7 lines

The loss was most likely my error/misunderstanding way back at the start
of LIBFDT. Your change seems reasonable, I'll add it to my list of patches to look into and add.

Thanks,
gvb

Hi Joakim,

Quoted 7 lines
Quoted 5 lines

I looked for the definition of DEFAULT_OF_TREE and it doesn't exist in
the current u-boot. I used the gitweb "pickaxe" to look for DEFAULT_OF_TREE and didn't find it that way either. Can you identify when we lost the definition?

Not really, it was possible in u-boot 1.1.4 and now it is not.

This was dropped because Wolfgang was exist embedding device tree's in the u-boot source tree.

- k

#5 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

Quoted 16 lines · Kumar Gala
Quoted 16 lines
Quoted 15 lines
Quoted 7 lines

The loss was most likely my error/misunderstanding way back at the start
of LIBFDT. Your change seems reasonable, I'll add it to my list of patches to look into and add.

Thanks,
gvb

Hi Joakim,

I looked for the definition of DEFAULT_OF_TREE and it doesn't exist in
the current u-boot. I used the gitweb "pickaxe" to look for DEFAULT_OF_TREE and didn't find it that way either. Can you identify when we lost the definition?

Quoted 4 lines
Quoted 1 line

Not really, it was possible in u-boot 1.1.4 and now it is not.

This was dropped because Wolfgang was exist embedding device tree's in the u-boot source tree.

hmm, I got a vague memory about that too. As I recall Wolfgang didn't motivate why that did make sense to me. Wolfgang, can you recap.?

Jocke

#6 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

In reply to Joakim Tjernlund
Quoted 11 lines · Joakim Tjernlund
---
 common/cmd_bootm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/cmd_bootm.c +0 -0
index d816349..8405de7 100644

common/cmd_bootm.c fixup_silent_linux () · line 512

Quoted 6 lines
common/cmd_bootm.c +3 -0
@@ -507,6 +507,9 @@ fixup_silent_linux ()
 #endif /* CONFIG_SILENT_CONSOLE */
 
 #ifdef CONFIG_PPC
+#ifndef DEFAULT_OF_TREE
+ #define DEFAULT_OF_TREE NULL
+#endif

Where is DEFAULT_OF_TREE intended to be defined? I don't want to get into defining it in any of the include/configs/*.h files since the goal is to move over to a Kconfig system and eliminate the per-board config files entirely.

It might be better to do this with two linker symbols around a .dtb section. If the two symbols are identical, then no dtb was provided. Otherwise, go ahead and use the section as the default dtb.

Cheers,
g.

Signature · 4 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195
#7 lore raw

PATCH 1/1 Make it possible to use a builtin OF tree.

Quoted 14 lines · Grant Likely
Quoted 13 lines · Joakim Tjernlund
---
 common/cmd_bootm.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
common/cmd_bootm.c +0 -0
index d816349..8405de7 100644
@@ -507,6 +507,9 @@ fixup_silent_linux ()
 #endif /* CONFIG_SILENT_CONSOLE */
 
Quoted 9 lines

common/cmd_bootm.c fixup_silent_linux () · line 512

Quoted 4 lines
common/cmd_bootm.c +3 -0
 #ifdef CONFIG_PPC
+#ifndef DEFAULT_OF_TREE
+ #define DEFAULT_OF_TREE NULL
+#endif

Where is DEFAULT_OF_TREE intended to be defined? I don't want to get into defining it in any of the include/configs/*.h files since the goal is to move over to a Kconfig system and eliminate the per-board config files entirely.

You define it to whatever you like in your board config file. Can be a char array or a function returning a char ptr, sorry :(

Quoted 4 lines

It might be better to do this with two linker symbols around a .dtb section. If the two symbols are identical, then no dtb was provided. Otherwise, go ahead and use the section as the default dtb.

I feel my current way is more flexible as it allows you build/modify the tree in a function.

Jocke