mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] OF updates
@ 2013-05-30 10:44 Sascha Hauer
  2013-05-30 10:44 ` [PATCH 1/4] of: Also print disabled nodes Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sascha Hauer @ 2013-05-30 10:44 UTC (permalink / raw)
  To: barebox

This fixes some OF oddities we currently have.

Sascha

----------------------------------------------------------------
Sascha Hauer (4):
      of: Also print disabled nodes
      of: remove unused define
      bootm: make sure to print fixed oftree
      bootm: print Kernel commandline in verbose mode

 arch/arm/lib/bootm.c |  4 ++++
 commands/bootm.c     |  4 ----
 common/oftree.c      | 21 +++++++++++++++------
 drivers/of/base.c    |  3 ---
 include/of.h         |  1 +
 5 files changed, 20 insertions(+), 13 deletions(-)

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 1/4] of: Also print disabled nodes
  2013-05-30 10:44 [PATCH] OF updates Sascha Hauer
@ 2013-05-30 10:44 ` Sascha Hauer
  2013-05-30 10:44 ` [PATCH 2/4] of: remove unused define Sascha Hauer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2013-05-30 10:44 UTC (permalink / raw)
  To: barebox

It's confusing to set the status of a node to disabled and afterwards
it's invisible. Similarly it's confusing to be able to enable invisible
nodes.

Also print disabled nodes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/of/base.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8383549..9c04c78 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -663,9 +663,6 @@ void of_print_nodes(struct device_node *node, int indent)
 	if (!node)
 		return;
 
-	if (of_node_disabled(node))
-		return;
-
 	for (i = 0; i < indent; i++)
 		printf("\t");
 
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/4] of: remove unused define
  2013-05-30 10:44 [PATCH] OF updates Sascha Hauer
  2013-05-30 10:44 ` [PATCH 1/4] of: Also print disabled nodes Sascha Hauer
@ 2013-05-30 10:44 ` Sascha Hauer
  2013-05-30 10:44 ` [PATCH 3/4] bootm: make sure to print fixed oftree Sascha Hauer
  2013-05-30 10:44 ` [PATCH 4/4] bootm: print Kernel commandline in verbose mode Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2013-05-30 10:44 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/oftree.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/common/oftree.c b/common/oftree.c
index 776d301..19fed6b 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -161,12 +161,6 @@ int of_fix_tree(struct device_node *node)
 }
 
 /*
- * The size by which we increase the dtb to have space for additional
- * fixups. Ideally this would be done by libfdt automatically
- */
-#define OFTREE_SIZE_INCREASE 0x8000
-
-/*
  * Get the fixed fdt. This function uses the fdt input pointer
  * if provided or the barebox internal devicetree if not.
  * It increases the size of the tree and applies the registered
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 3/4] bootm: make sure to print fixed oftree
  2013-05-30 10:44 [PATCH] OF updates Sascha Hauer
  2013-05-30 10:44 ` [PATCH 1/4] of: Also print disabled nodes Sascha Hauer
  2013-05-30 10:44 ` [PATCH 2/4] of: remove unused define Sascha Hauer
@ 2013-05-30 10:44 ` Sascha Hauer
  2013-05-30 10:44 ` [PATCH 4/4] bootm: print Kernel commandline in verbose mode Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2013-05-30 10:44 UTC (permalink / raw)
  To: barebox

when doing bootm -v -v we dumped the original tree to the console.
Make sure to print the fixed tree instead so that the fixups can
be examined.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/lib/bootm.c | 2 ++
 commands/bootm.c     | 4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index e7a0625..133e04d 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -91,6 +91,8 @@ static int __do_bootm_linux(struct image_data *data, int swap)
 			of_add_reserve_entry(initrd_start, initrd_end);
 		data->oftree = of_get_fixed_tree(data->of_root_node);
 		fdt_add_reserve_map(data->oftree);
+		if (bootm_verbose(data) > 1)
+			of_print_nodes(data->of_root_node, 0);
 	}
 
 	if (bootm_verbose(data)) {
diff --git a/commands/bootm.c b/commands/bootm.c
index 5dd1703..3976eb4 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -398,10 +398,6 @@ static int do_bootm(int argc, char *argv[])
 		if (bootm_verbose(&data) && data.of_root_node)
 			printf("using internal devicetree\n");
 	}
-
-
-	if (bootm_verbose(&data) > 1 && data.of_root_node)
-		of_print_nodes(data.of_root_node, 0);
 #endif
 	if (data.os_address == UIMAGE_SOME_ADDRESS)
 		data.os_address = UIMAGE_INVALID_ADDRESS;
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 4/4] bootm: print Kernel commandline in verbose mode
  2013-05-30 10:44 [PATCH] OF updates Sascha Hauer
                   ` (2 preceding siblings ...)
  2013-05-30 10:44 ` [PATCH 3/4] bootm: make sure to print fixed oftree Sascha Hauer
@ 2013-05-30 10:44 ` Sascha Hauer
  3 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2013-05-30 10:44 UTC (permalink / raw)
  To: barebox

Without devicetree support we print the Kernel commandline in
verbose mode. Do the same with devicetree boot aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/lib/bootm.c |  2 ++
 common/oftree.c      | 15 +++++++++++++++
 include/of.h         |  1 +
 3 files changed, 18 insertions(+)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 133e04d..ee27e34 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -91,6 +91,8 @@ static int __do_bootm_linux(struct image_data *data, int swap)
 			of_add_reserve_entry(initrd_start, initrd_end);
 		data->oftree = of_get_fixed_tree(data->of_root_node);
 		fdt_add_reserve_map(data->oftree);
+		if (bootm_verbose(data))
+			of_print_cmdline(data->of_root_node);
 		if (bootm_verbose(data) > 1)
 			of_print_nodes(data->of_root_node, 0);
 	}
diff --git a/common/oftree.c b/common/oftree.c
index 19fed6b..475d418 100644
--- a/common/oftree.c
+++ b/common/oftree.c
@@ -98,6 +98,21 @@ void of_print_property(const void *data, int len)
 	}
 }
 
+void of_print_cmdline(struct device_node *root)
+{
+	struct device_node *node = of_find_node_by_path(root, "/chosen");
+	const char *cmdline;
+
+	if (!node) {
+		printf("commandline: no /chosen node\n");
+		return;
+	}
+
+	cmdline = of_get_property(node, "bootargs", NULL);
+
+	printf("commandline: %s\n", cmdline);
+}
+
 static int of_fixup_bootargs(struct device_node *root)
 {
 	struct device_node *node;
diff --git a/include/of.h b/include/of.h
index 4dcf37e..7bc3cf4 100644
--- a/include/of.h
+++ b/include/of.h
@@ -138,6 +138,7 @@ int of_get_named_gpio(struct device_node *np,
 
 struct device_node *of_find_node_by_phandle(phandle phandle);
 void of_print_property(const void *data, int len);
+void of_print_cmdline(struct device_node *root);
 
 int of_device_is_compatible(const struct device_node *device,
 		const char *compat);
-- 
1.8.2.rc2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2013-05-30 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-30 10:44 [PATCH] OF updates Sascha Hauer
2013-05-30 10:44 ` [PATCH 1/4] of: Also print disabled nodes Sascha Hauer
2013-05-30 10:44 ` [PATCH 2/4] of: remove unused define Sascha Hauer
2013-05-30 10:44 ` [PATCH 3/4] bootm: make sure to print fixed oftree Sascha Hauer
2013-05-30 10:44 ` [PATCH 4/4] bootm: print Kernel commandline in verbose mode Sascha Hauer

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