Skip to contentSkip to conversation

led: update LED boot/activity to new property implementation

PATCH In review Christian Marangi 3 participants 22 messages Nov 10, 2024 – Dec 6, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover led: update LED boot/activity to new property implementation

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

This was triggered by adding a new phandle in the test.dts to introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test to correctly finish. Also moving the uboot node down after the first phandle (in test.dts the gpio one) also made the CI test to correctly finish.

A little bit of searching and debugging made me realize the parse phandle OPs didn't support other.dts at all and they were still referencing phandle index from test.dts. (more info in the related commit)

In short the test was broken all along and was working by pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for LED boot/activity.

Posting in a single series as changes are trivial and just to speedup review process. (and also because the second part depends on the first)

All CI tested with azure pipeline.

Changes v2:
- Fix handling of flat tree for phandle
- Fix test and other.dts changes

Christian Marangi (8):
dm: core: implement oftree variant of parse_phandle OPs
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
dm: core: implement ofnode/tree_parse_phandle() helper
test: dm: Expand dm_test_ofnode_phandle(_ot) with new
ofnode/tree_parse_phandle
dm: core: implement phandle ofnode_options helper
test: dm: Add test for ofnode options phandle helper
led: update LED boot/activity to new property implementation
test: dm: Update test for LED activity and boot

 arch/sandbox/dts/other.dts |  31 ++++++++-
 arch/sandbox/dts/test.dts  |  16 +++--
 drivers/core/of_access.c   |  61 ++++++++++++-----
 drivers/core/ofnode.c      | 124 ++++++++++++++++++++++++++++++++-
 drivers/led/led-uclass.c   |  30 +++++---
 include/dm/of_access.h     |  86 +++++++++++++++++++++++
 include/dm/ofnode.h        | 107 +++++++++++++++++++++++++++++
 test/dm/led.c              |  18 +++--
 test/dm/ofnode.c           | 136 ++++++++++++++++++++++++++++++++-----
 9 files changed, 551 insertions(+), 58 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/8 dm: core: implement oftree variant of parse_phandle OPs

Implement oftree variant of parse_phandle OPs.

There is currently a very hidden and laten BUG with parse_phandle OPs that doesn't permit the support of multiple DTS in a system. One usage example if sandbox with the usage of other.dts

The BUG is only present on live scenario where of_... OPs are used and it's not present when fdt... OPs are used.

This is caused by an assumption made in __of_parse_phandle_with_args, with the of_find_node_by_phandle call that pass the first arg as NULL.

This makes of_find_node_by_phandle use the default root node of the system and doesn't permit the usage of alternative tree. This is correct for normal system and also for the linux kernel where it's assumed a single device tree.

It's problematic if other device tree needs to be used.

To fix this, introduce __of_root_parse_phandle_with_args to define a root device tree for of_find_node_by_phandle.

Introduce all the variant OPs for this and in ofnode, the oftree OPs following how it's done for other OPs with similar task.

For FDT scenario, ofnode_from_fdtdec_phandle_args is reworked to accept a new variable, node and noffset_to_ofnode is used instead of offset_to_ofnode. This is required to support multiple FDB blob to calculate the correct of_offset of the ofnode.

---
 drivers/core/of_access.c | 61 ++++++++++++++++++++--------
 drivers/core/ofnode.c    | 51 ++++++++++++++++++++++--
 include/dm/of_access.h   | 86 ++++++++++++++++++++++++++++++++++++++++
 include/dm/ofnode.h      | 66 ++++++++++++++++++++++++++++++
 4 files changed, 244 insertions(+), 20 deletions(-)
drivers/core/of_access.c +44 -17
index 77acd766262..b11e36202c1 100644
@@ -666,11 +666,12 @@ int of_property_read_string_helper(const struct device_node *np,
 	return i <= 0 ? -ENODATA : i;
 }
 
-static int __of_parse_phandle_with_args(const struct device_node *np,
-					const char *list_name,
-					const char *cells_name,
-					int cell_count, int index,
-					struct of_phandle_args *out_args)
+static int __of_root_parse_phandle_with_args(struct device_node *root,
+					     const struct device_node *np,
+					     const char *list_name,
+					     const char *cells_name,
+					     int cell_count, int index,
+					     struct of_phandle_args *out_args)
 {
 	const __be32 *list, *list_end;
 	int rc = 0, cur_index = 0;
@@ -706,7 +707,7 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
 			 * below.
 			 */
 			if (cells_name || cur_index == index) {
-				node = of_find_node_by_phandle(NULL, phandle);
+				node = of_find_node_by_phandle(root, phandle);
 				if (!node) {
 					dm_warn("%s: could not find phandle\n",
 						np->full_name);
@@ -783,39 +784,65 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
 	return rc;
 }
 
-struct device_node *of_parse_phandle(const struct device_node *np,
-				     const char *phandle_name, int index)
+struct device_node *of_root_parse_phandle(struct device_node *root,
+					  const struct device_node *np,
+					  const char *phandle_name, int index)
 {
 	struct of_phandle_args args;
 
 	if (index < 0)
 		return NULL;
 
-	if (__of_parse_phandle_with_args(np, phandle_name, NULL, 0, index,
-					 &args))
+	if (__of_root_parse_phandle_with_args(root, np, phandle_name, NULL, 0,
+					      index, &args))
 		return NULL;
 
 	return args.np;
 }
 
+int of_root_parse_phandle_with_args(struct device_node *root,
+				    const struct device_node *np,
+				    const char *list_name, const char *cells_name,
+				    int cell_count, int index,
+				    struct of_phandle_args *out_args)
+{
+	if (index < 0)
+		return -EINVAL;
+
+	return __of_root_parse_phandle_with_args(root, np, list_name, cells_name,
+						 cell_count, index, out_args);
+}
+
+int of_root_count_phandle_with_args(struct device_node *root,
+				    const struct device_node *np,
+				    const char *list_name, const char *cells_name,
+				    int cell_count)
+{
+	return __of_root_parse_phandle_with_args(root, np, list_name, cells_name,
+						 cell_count, -1, NULL);
+}
+
+struct device_node *of_parse_phandle(const struct device_node *np,
+				     const char *phandle_name, int index)
+{
+	return of_root_parse_phandle(NULL, np, phandle_name, index);
+}
+
 int of_parse_phandle_with_args(const struct device_node *np,
 			       const char *list_name, const char *cells_name,
 			       int cell_count, int index,
 			       struct of_phandle_args *out_args)
 {
-	if (index < 0)
-		return -EINVAL;
-
-	return __of_parse_phandle_with_args(np, list_name, cells_name,
-					    cell_count, index, out_args);
+	return of_root_parse_phandle_with_args(NULL, np, list_name, cells_name,
+					       cell_count, index, out_args);
 }
 
 int of_count_phandle_with_args(const struct device_node *np,
 			       const char *list_name, const char *cells_name,
 			       int cell_count)
 {
-	return __of_parse_phandle_with_args(np, list_name, cells_name,
-					    cell_count, -1, NULL);
+	return of_root_count_phandle_with_args(NULL, np, list_name, cells_name,
+					       cell_count);
 }
 
 static void of_alias_add(struct alias_prop *ap, struct device_node *np,
drivers/core/ofnode.c +48 -3

72 lines not on this page · raw message

include/dm/of_access.h +86 -0

92 lines not on this page · raw message

include/dm/ofnode.h +66 -0

72 lines not on this page · raw message

Signature · 1 line
2.45.2
Reviewed-by on v2 1/8
#2 lore raw

Re: [PATCH v2 1/8] dm: core: implement oftree variant of parse_phandle OPs

Quoted 31 lines · Christian Marangi

Implement oftree variant of parse_phandle OPs.

There is currently a very hidden and laten BUG with parse_phandle OPs that doesn't permit the support of multiple DTS in a system. One usage example if sandbox with the usage of other.dts

The BUG is only present on live scenario where of_... OPs are used and it's not present when fdt... OPs are used.

This is caused by an assumption made in __of_parse_phandle_with_args, with the of_find_node_by_phandle call that pass the first arg as NULL.

This makes of_find_node_by_phandle use the default root node of the system and doesn't permit the usage of alternative tree. This is correct for normal system and also for the linux kernel where it's assumed a single device tree.

It's problematic if other device tree needs to be used.

To fix this, introduce __of_root_parse_phandle_with_args to define a root device tree for of_find_node_by_phandle.

Introduce all the variant OPs for this and in ofnode, the oftree OPs following how it's done for other OPs with similar task.

For FDT scenario, ofnode_from_fdtdec_phandle_args is reworked to accept a new variable, node and noffset_to_ofnode is used instead of offset_to_ofnode. This is required to support multiple FDB blob to calculate the correct of_offset of the ofnode.

Quoted 8 lines
---
 drivers/core/of_access.c | 61 ++++++++++++++++++++--------
 drivers/core/ofnode.c    | 51 ++++++++++++++++++++++--
 include/dm/of_access.h   | 86 ++++++++++++++++++++++++++++++++++++++++
 include/dm/ofnode.h      | 66 ++++++++++++++++++++++++++++++
 4 files changed, 244 insertions(+), 20 deletions(-)
#3 lore raw

PATCH v2 2/8 test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot

In reply to Christian Marangi

Fix broken dm_test_ofnode_phandle_ot test. They never actually worked and were passing test by pure luck by having the same phandle index of test.dts that coincicentally had #gpio-cells in the same index node.

It was sufficient to add a phandle to test.dts to make the test fail.

To correctly test these feature, make use oif the new OPs oftree to parse phandle.

For consistency with the dm_test_ofnode_phandle, rework the test and other.dts to use the same property with the other- prefix to every node.

Also fix dm_test_ofnode_get_by_phandle_ot by making it more robust and renaming the phandle property to other-phandle.

---
 arch/sandbox/dts/other.dts | 24 ++++++++++-
 test/dm/ofnode.c           | 83 +++++++++++++++++++++++++++++++-------
 2 files changed, 91 insertions(+), 16 deletions(-)
arch/sandbox/dts/other.dts +22 -2
index 395a7923228..b32158c6569 100644
@@ -8,13 +8,15 @@
 
 /dts-v1/;
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	compatible = "sandbox-other";
 	#address-cells = <1>;
 	#size-cells = <1>;
 
 	node {
-		target = <&target 3 4>;
+		other-phandle = <&target>;
 
 		subnode {
 			compatible = "sandbox-other2";
@@ -25,9 +27,27 @@
 		};
 	};
 
+	other-a-test {
+		other-test-gpios = <&other_gpio_a 1>, <&other_gpio_a 4>,
+			<&other_gpio_b 5 GPIO_ACTIVE_HIGH 3 2 1>,
+			<0>, <&other_gpio_a 12>;
+		other-phandle-value = <&other_gpio_c 10>, <0xFFFFFFFF 20>, <&other_gpio_a 30>;
+	};
+
+	other_gpio_a: other-gpio-a {
+		#gpio-cells = <1>;
+	};
+
+	other_gpio_b: other-gpio-b {
+		#gpio-cells = <5>;
+	};
+
+	other_gpio_c: other-gpio-c {
+		#gpio-cells = <2>;
+	};
+
 	target: target {
 		compatible = "sandbox-other2";
-		#gpio-cells = <2>;
 		str-prop = "other";
 		reg = <0x8000 0x100>;
 		status = "disabled";
test/dm/ofnode.c +69 -14

108 lines not on this page · raw message

Signature · 1 line
2.45.2
Reviewed-by on v2 2/8
#4 lore raw

Re: [PATCH v2 2/8] test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot

Quoted 14 lines · Christian Marangi

Fix broken dm_test_ofnode_phandle_ot test. They never actually worked and were passing test by pure luck by having the same phandle index of test.dts that coincicentally had #gpio-cells in the same index node.

It was sufficient to add a phandle to test.dts to make the test fail.

To correctly test these feature, make use oif the new OPs oftree to parse phandle.

For consistency with the dm_test_ofnode_phandle, rework the test and other.dts to use the same property with the other- prefix to every node.

Quoted 9 lines

Also fix dm_test_ofnode_get_by_phandle_ot by making it more robust and renaming the phandle property to other-phandle.

---
 arch/sandbox/dts/other.dts | 24 ++++++++++-
 test/dm/ofnode.c           | 83 +++++++++++++++++++++++++++++++-------
 2 files changed, 91 insertions(+), 16 deletions(-)
#5 lore raw

PATCH v2 3/8 dm: core: implement ofnode/tree_parse_phandle() helper

In reply to Christian Marangi

Implement ofnode/tree_parse_phandle() helper as an equivalent of of_parse_phandle to handle simple single value phandle.

---
 drivers/core/ofnode.c | 58 +++++++++++++++++++++++++++++++++++++++++++
 include/dm/ofnode.h   | 26 +++++++++++++++++++
 2 files changed, 84 insertions(+)
drivers/core/ofnode.c +58 -0
index b9cc9419407..dc6ac069311 100644
@@ -879,6 +879,64 @@ int ofnode_read_string_list(ofnode node, const char *property,
 	return count;
 }
 
+ofnode ofnode_parse_phandle(ofnode node, const char *phandle_name,
+			    int index)
+{
+	ofnode phandle;
+
+	if (ofnode_is_np(node)) {
+		struct device_node *np;
+
+		np = of_parse_phandle(ofnode_to_np(node), phandle_name,
+				      index);
+		if (!np)
+			return ofnode_null();
+
+		phandle = np_to_ofnode(np);
+	} else {
+		struct fdtdec_phandle_args args;
+
+		if (fdtdec_parse_phandle_with_args(ofnode_to_fdt(node),
+						   ofnode_to_offset(node),
+						   phandle_name, NULL,
+						   0, index, &args))
+			return ofnode_null();
+
+		phandle = offset_to_ofnode(args.node);
+	}
+
+	return phandle;
+}
+
+ofnode oftree_parse_phandle(oftree tree, ofnode node, const char *phandle_name,
+			    int index)
+{
+	ofnode phandle;
+
+	if (ofnode_is_np(node)) {
+		struct device_node *np;
+
+		np = of_root_parse_phandle(tree.np, ofnode_to_np(node),
+					   phandle_name, index);
+		if (!np)
+			return ofnode_null();
+
+		phandle = np_to_ofnode(np);
+	} else {
+		struct fdtdec_phandle_args args;
+
+		if (fdtdec_parse_phandle_with_args(tree.fdt,
+						   ofnode_to_offset(node),
+						   phandle_name, NULL,
+						   0, index, &args))
+			return ofnode_null();
+
+		phandle = noffset_to_ofnode(node, args.node);
+	}
+
+	return phandle;
+}
+
 static void ofnode_from_fdtdec_phandle_args(ofnode node, struct fdtdec_phandle_args *in,
 					    struct ofnode_phandle_args *out)
 {
include/dm/ofnode.h +26 -0
index 7ece68874ae..eea6b13217c 100644
@@ -847,6 +847,18 @@ int ofnode_read_string_count(ofnode node, const char *property);
 int ofnode_read_string_list(ofnode node, const char *property,
 			    const char ***listp);
 
+/**
+ * ofnode_parse_phandle() - Resolve a phandle property to an ofnode
+ *
+ * @node: node to check
+ * @phandle_name: Name of property holding a phandle value
+ * @index: For properties holding a table of phandles, this is the index into
+ *         the table
+ * Return: ofnode that the phandle points to or ofnode_null() on error.
+ */
+ofnode ofnode_parse_phandle(ofnode node, const char *phandle_name,
+			    int index);
+
 /**
  * ofnode_parse_phandle_with_args() - Find a node pointed by phandle in a list
  *
@@ -909,6 +921,20 @@ int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,
 int ofnode_count_phandle_with_args(ofnode node, const char *list_name,
 				   const char *cells_name, int cell_count);
 
+/**
+ * oftree_parse_phandle() - Resolve a phandle property to an ofnode
+ *			    from a root node
+ *
+ * @tree: device tree to use
+ * @node: node to check
+ * @phandle_name: Name of property holding a phandle value
+ * @index: For properties holding a table of phandles, this is the index into
+ *         the table
+ * Return: ofnode that the phandle points to or ofnode_null() on error.
+ */
+ofnode oftree_parse_phandle(oftree tree, ofnode node, const char *phandle_name,
+			    int index);
+
 /**
  * oftree_parse_phandle_with_args() - Find a node pointed by phandle in a list
  *				      from a root node
Signature · 1 line
2.45.2
Reviewed-by on v2 3/8
#6 lore raw

Re: [PATCH v2 3/8] dm: core: implement ofnode/tree_parse_phandle() helper

Quoted 10 lines · Christian Marangi

Implement ofnode/tree_parse_phandle() helper as an equivalent of of_parse_phandle to handle simple single value phandle.

---
 drivers/core/ofnode.c | 58 +++++++++++++++++++++++++++++++++++++++++++
 include/dm/ofnode.h   | 26 +++++++++++++++++++
 2 files changed, 84 insertions(+)
#7 lore raw

PATCH v2 4/8 test: dm: Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle

In reply to Christian Marangi

Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle() op.

---
 arch/sandbox/dts/other.dts |  7 ++++++
 arch/sandbox/dts/test.dts  |  7 ++++++
 test/dm/ofnode.c           | 44 ++++++++++++++++++++++++++++++++++----
 3 files changed, 54 insertions(+), 4 deletions(-)
arch/sandbox/dts/other.dts +7 -0
index b32158c6569..515d6348b3f 100644
@@ -32,6 +32,7 @@
 			<&other_gpio_b 5 GPIO_ACTIVE_HIGH 3 2 1>,
 			<0>, <&other_gpio_a 12>;
 		other-phandle-value = <&other_gpio_c 10>, <0xFFFFFFFF 20>, <&other_gpio_a 30>;
+		other-phandle-nodes = <&other_phandle_node_1>, <&other_phandle_node_2>;
 	};
 
 	other_gpio_a: other-gpio-a {
@@ -46,6 +47,12 @@
 		#gpio-cells = <2>;
 	};
 
+	other_phandle_node_1: other-phandle-node-1 {
+	};
+
+	other_phandle_node_2: other-phandle-node-2 {
+	};
+
 	target: target {
 		compatible = "sandbox-other2";
 		str-prop = "other";
arch/sandbox/dts/test.dts +7 -0
index 3017b33d67b..b8a46463158 100644
@@ -296,6 +296,12 @@
 		compatible = "sandbox,dsi-host";
 	};
 
+	phandle_node_1: phandle-node-1 {
+	};
+
+	phandle_node_2: phandle-node-2 {
+	};
+
 	a-test {
 		reg = <0 1>;
 		compatible = "denx,u-boot-fdt-test";
@@ -334,6 +340,7 @@
 		interrupts-extended = <&irq 3 0>;
 		acpi,name = "GHIJ";
 		phandle-value = <&gpio_c 10>, <0xFFFFFFFF 20>, <&gpio_a 30>;
+		phandle-nodes = <&phandle_node_1>, <&phandle_node_2>;
 
 		mux-controls = <&muxcontroller0 0>, <&muxcontroller0 1>,
 			       <&muxcontroller0 2>, <&muxcontroller0 3>,
test/dm/ofnode.c +40 -4

81 lines not on this page · raw message

Signature · 1 line
2.45.2
Reviewed-by on v2 4/8
#8 lore raw

Re: [PATCH v2 4/8] test: dm: Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle

Quoted 10 lines · Christian Marangi

Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle() op.

---
 arch/sandbox/dts/other.dts |  7 ++++++
 arch/sandbox/dts/test.dts  |  7 ++++++
 test/dm/ofnode.c           | 44 ++++++++++++++++++++++++++++++++++----
 3 files changed, 54 insertions(+), 4 deletions(-)
#9 lore raw

PATCH v2 5/8 dm: core: implement phandle ofnode_options helper

In reply to Christian Marangi

Implement ofnode_options phandle helper to get an ofnode from a phandle option in /options/u-boot.

This helper can be useful since new DT yaml usually require to link a phandle of a node instead of referencing it by name or other indirect way.

---
 drivers/core/ofnode.c | 15 +++++++++++++++
 include/dm/ofnode.h   | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
drivers/core/ofnode.c +15 -0
index dc6ac069311..c8161827d1c 100644
@@ -1871,6 +1871,21 @@ const char *ofnode_options_read_str(const char *prop_name)
 	return ofnode_read_string(uboot, prop_name);
 }
 
+int ofnode_options_get_by_phandle(const char *prop_name, ofnode *nodep)
+{
+	ofnode uboot;
+
+	uboot = ofnode_path("/options/u-boot");
+	if (!ofnode_valid(uboot))
+		return -EINVAL;
+
+	*nodep = ofnode_parse_phandle(uboot, prop_name, 0);
+	if (!ofnode_valid(*nodep))
+		return -EINVAL;
+
+	return 0;
+}
+
 int ofnode_read_bootscript_address(u64 *bootscr_address, u64 *bootscr_offset)
 {
 	int ret;
include/dm/ofnode.h +15 -0
index eea6b13217c..890f0e6cf40 100644
@@ -1720,6 +1720,21 @@ int ofnode_options_read_int(const char *prop_name, int default_val);
  */
 const char *ofnode_options_read_str(const char *prop_name);
 
+/**
+ * ofnode_options_get_by_phandle() - Get a ofnode from phandle from the U-Boot options
+ *
+ * This reads a property from the /options/u-boot/ node of the devicetree.
+ *
+ * This only works with the control FDT.
+ *
+ * See dtschema/schemas/options/u-boot.yaml in dt-schema project for bindings
+ *
+ * @prop_name: property name to look up
+ * @nodep: pointer to ofnode where node is stored
+ * Return: 0, if found, or negative error if not
+ */
+int ofnode_options_get_by_phandle(const char *prop_name, ofnode *nodep);
+
 /**
  * ofnode_read_bootscript_address() - Read bootscr-address or bootscr-ram-offset
  *
Signature · 1 line
2.45.2
Reviewed-by on v2 5/8
#10 lore raw

Re: [PATCH v2 5/8] dm: core: implement phandle ofnode_options helper

Quoted 8 lines · Christian Marangi

Implement ofnode_options phandle helper to get an ofnode from a phandle option in /options/u-boot.

This helper can be useful since new DT yaml usually require to link a phandle of a node instead of referencing it by name or other indirect way.

Quoted 6 lines
---
 drivers/core/ofnode.c | 15 +++++++++++++++
 include/dm/ofnode.h   | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
#11 lore raw

PATCH v2 6/8 test: dm: Add test for ofnode options phandle helper

In reply to Christian Marangi

Add test for ofnode options phandle helper and add new property in the sandbox test dts.

---
 arch/sandbox/dts/test.dts |  1 +
 test/dm/ofnode.c          | 11 +++++++++++
 2 files changed, 12 insertions(+)
arch/sandbox/dts/test.dts +1 -0
index b8a46463158..1ffa64a43e2 100644
@@ -106,6 +106,7 @@
 			testing-bool;
 			testing-int = <123>;
 			testing-str = "testing";
+			testing-phandle = <&phandle_node_1>;
 		};
 	};
 
test/dm/ofnode.c +11 -0
index cf10e698d9e..f16b643fa3f 100644
@@ -704,6 +704,10 @@ static int dm_test_ofnode_options(struct unit_test_state *uts)
 {
 	u64 bootscr_address, bootscr_offset;
 	u64 bootscr_flash_offset, bootscr_flash_size;
+	ofnode node, phandle_node, target;
+
+	node = ofnode_path("/options/u-boot");
+	ut_assert(ofnode_valid(node));
 
 	ut_assert(!ofnode_options_read_bool("missing"));
 	ut_assert(ofnode_options_read_bool("testing-bool"));
@@ -714,6 +718,13 @@ static int dm_test_ofnode_options(struct unit_test_state *uts)
 	ut_assertnull(ofnode_options_read_str("missing"));
 	ut_asserteq_str("testing", ofnode_options_read_str("testing-str"));
 
+	ut_asserteq(-EINVAL, ofnode_options_get_by_phandle("missing", &phandle_node));
+
+	target = ofnode_path("/phandle-node-1");
+	ut_assert(ofnode_valid(target));
+	ut_assertok(ofnode_options_get_by_phandle("testing-phandle", &phandle_node));
+	ut_assert(ofnode_equal(target, phandle_node));
+
 	ut_assertok(ofnode_read_bootscript_address(&bootscr_address,
 						   &bootscr_offset));
 	ut_asserteq_64(0, bootscr_address);
Signature · 1 line
2.45.2
Reviewed-by on v2 6/8
#12 lore raw

Re: [PATCH v2 6/8] test: dm: Add test for ofnode options phandle helper

Quoted 9 lines · Christian Marangi

Add test for ofnode options phandle helper and add new property in the sandbox test dts.

---
 arch/sandbox/dts/test.dts |  1 +
 test/dm/ofnode.c          | 11 +++++++++++
 2 files changed, 12 insertions(+)
#13 lore raw

PATCH v2 7/8 led: update LED boot/activity to new property implementation

In reply to Christian Marangi

Update LED boot/activity to reference by phandle instead of label and add to period property the "-ms" suffix.
This is a followup request by dt-schema maintainers that required LED node to be referenced by a phandle to the node instead of indirectly by the LED label and for timevalue to have a suffix.

While at it generalize the LED node label parsing since the logic is common for generic LED bind and LED activity/boot.

---
 drivers/led/led-uclass.c | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)
drivers/led/led-uclass.c +22 -8
index 05e09909b7d..760750568c0 100644
@@ -232,16 +232,24 @@ int led_activity_blink(void)
 #endif
 #endif
 
+static const char *led_get_label(ofnode node)
+{
+	const char *label;
+
+	label = ofnode_read_string(node, "label");
+	if (!label && !ofnode_read_string(node, "compatible"))
+		label = ofnode_get_name(node);
+
+	return label;
+}
+
 static int led_post_bind(struct udevice *dev)
 {
 	struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev);
 	const char *default_state;
 
 	if (!uc_plat->label)
-		uc_plat->label = dev_read_string(dev, "label");
-
-	if (!uc_plat->label && !dev_read_string(dev, "compatible"))
-		uc_plat->label = ofnode_get_name(dev_ofnode(dev));
+		uc_plat->label = led_get_label(dev_ofnode(dev));
 
 	uc_plat->default_state = LEDST_COUNT;
 
@@ -300,15 +308,21 @@ static int led_post_probe(struct udevice *dev)
 static int led_init(struct uclass *uc)
 {
 	struct led_uc_priv *priv = uclass_get_priv(uc);
+	ofnode led_node;
+	int ret;
 
 #ifdef CONFIG_LED_BOOT
-	priv->boot_led_label = ofnode_options_read_str("boot-led");
-	priv->boot_led_period = ofnode_options_read_int("boot-led-period", 250);
+	ret = ofnode_options_get_by_phandle("boot-led", &led_node);
+	if (!ret)
+		priv->boot_led_label = led_get_label(led_node);
+	priv->boot_led_period = ofnode_options_read_int("boot-led-period-ms", 250);
 #endif
 
 #ifdef CONFIG_LED_ACTIVITY
-	priv->activity_led_label = ofnode_options_read_str("activity-led");
-	priv->activity_led_period = ofnode_options_read_int("activity-led-period",
+	ret = ofnode_options_get_by_phandle("activity-led", &led_node);
+	if (!ret)
+		priv->activity_led_label = led_get_label(led_node);
+	priv->activity_led_period = ofnode_options_read_int("activity-led-period-ms",
 							    250);
 #endif
 
Signature · 1 line
2.45.2
#14 lore raw

PATCH v2 8/8 test: dm: Update test for LED activity and boot

In reply to Christian Marangi

Update test for LED activity and boot to follow new implementation with property set to the LED node phandle.

Also update a copy-paste error in the function name for the activity tests and actually enable the test with the DM_TEST macro.

---
 arch/sandbox/dts/test.dts |  8 ++++----
 test/dm/led.c             | 18 +++++++++++-------
 2 files changed, 15 insertions(+), 11 deletions(-)
arch/sandbox/dts/test.dts +4 -4
index 1ffa64a43e2..e9b3b151e10 100644
@@ -101,8 +101,8 @@
 			bootscr-ram-offset = /bits/ 64 <0x12345678>;
 			bootscr-flash-offset = /bits/ 64 <0>;
 			bootscr-flash-size = /bits/ 64 <0x2000>;
-			boot-led = "sandbox:green";
-			activity-led = "sandbox:red";
+			boot-led = <&sandbox_led_green>;
+			activity-led = <&sandbox_led_red>;
 			testing-bool;
 			testing-int = <123>;
 			testing-str = "testing";
@@ -988,12 +988,12 @@
 	leds {
 		compatible = "gpio-leds";
 
-		iracibble {
+		sandbox_led_red: iracibble {
 			gpios = <&gpio_a 1 0>;
 			label = "sandbox:red";
 		};
 
-		martinet {
+		sandbox_led_green: martinet {
 			gpios = <&gpio_a 2 0>;
 			label = "sandbox:green";
 		};
test/dm/led.c +11 -7
index 884f6410b70..e5b86326c3a 100644
@@ -144,7 +144,7 @@ static int dm_test_led_boot(struct unit_test_state *uts)
 {
 	struct udevice *dev
 
-	/* options/u-boot/boot-led is set to "sandbox:green" */
+	/* options/u-boot/boot-led is set to phandle to "sandbox:green" */
 	ut_assertok(led_get_by_label("sandbox:green", &dev));
 	ut_asserteq(LEDST_OFF, led_get_state(dev));
 	ut_assertok(led_boot_on());
@@ -154,14 +154,15 @@ static int dm_test_led_boot(struct unit_test_state *uts)
 
 	return 0;
 }
+DM_TEST(dm_test_led_boot, UTF_SCAN_PDATA | UTF_SCAN_FDT);
 
 /* Test LED boot blink fallback */
 #ifndef CONFIG_LED_BLINK
-static int dm_test_led_boot(struct unit_test_state *uts)
+static int dm_test_led_boot_blink(struct unit_test_state *uts)
 {
 	struct udevice *dev
 
-	/* options/u-boot/boot-led is set to "sandbox:green" */
+	/* options/u-boot/boot-led is set to phandle to "sandbox:green" */
 	ut_assertok(led_get_by_label("sandbox:green", &dev));
 	ut_asserteq(LEDST_OFF, led_get_state(dev));
 	ut_assertok(led_boot_blink());
@@ -171,16 +172,17 @@ static int dm_test_led_boot(struct unit_test_state *uts)
 
 	return 0;
 }
+DM_TEST(dm_test_led_boot_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT);
 #endif
 #endif
 
 /* Test LED activity */
 #ifdef CONFIG_LED_ACTIVITY
-static int dm_test_led_boot(struct unit_test_state *uts)
+static int dm_test_led_activity(struct unit_test_state *uts)
 {
 	struct udevice *dev
 
-	/* options/u-boot/activity-led is set to "sandbox:red" */
+	/* options/u-boot/activity-led is set to phandle to "sandbox:red" */
 	ut_assertok(led_get_by_label("sandbox:red", &dev));
 	ut_asserteq(LEDST_OFF, led_get_state(dev));
 	ut_assertok(led_activity_on());
@@ -190,14 +192,15 @@ static int dm_test_led_boot(struct unit_test_state *uts)
 
 	return 0;
 }
+DM_TEST(dm_test_led_activity, UTF_SCAN_PDATA | UTF_SCAN_FDT);
 
 /* Test LED activity blink fallback */
 #ifndef CONFIG_LED_BLINK
-static int dm_test_led_boot(struct unit_test_state *uts)
+static int dm_test_led_activityt_blink(struct unit_test_state *uts)
 {
 	struct udevice *dev
 
-	/* options/u-boot/activity-led is set to "sandbox:red" */
+	/* options/u-boot/activity-led is set to phandle to "sandbox:red" */
 	ut_assertok(led_get_by_label("sandbox:red", &dev));
 	ut_asserteq(LEDST_OFF, led_get_state(dev));
 	ut_assertok(led_activity_blink());
@@ -207,5 +210,6 @@ static int dm_test_led_boot(struct unit_test_state *uts)
 
 	return 0;
 }
+DM_TEST(dm_test_led_activityt_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT);
 #endif
 #endif
Signature · 1 line
2.45.2
Reviewed-by on v2 8/8
#15 lore raw

Re: [PATCH v2 8/8] test: dm: Update test for LED activity and boot

Quoted 4 lines · Christian Marangi

Update test for LED activity and boot to follow new implementation with property set to the LED node phandle.

Quoted 9 lines

Also update a copy-paste error in the function name for the activity tests and actually enable the test with the DM_TEST macro.

---
 arch/sandbox/dts/test.dts |  8 ++++----
 test/dm/led.c             | 18 +++++++++++-------
 2 files changed, 15 insertions(+), 11 deletions(-)
#16 lore raw
In reply to Christian Marangi
Quoted 51 lines · Christian Marangi

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

This was triggered by adding a new phandle in the test.dts to introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test to correctly finish. Also moving the uboot node down after the first phandle (in test.dts the gpio one) also made the CI test to correctly finish.

A little bit of searching and debugging made me realize the parse phandle OPs didn't support other.dts at all and they were still referencing phandle index from test.dts. (more info in the related commit)

In short the test was broken all along and was working by pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for LED boot/activity.

Posting in a single series as changes are trivial and just to speedup review process. (and also because the second part depends on the first)

All CI tested with azure pipeline.

Changes v2:
- Fix handling of flat tree for phandle
- Fix test and other.dts changes

Christian Marangi (8):
dm: core: implement oftree variant of parse_phandle OPs
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
dm: core: implement ofnode/tree_parse_phandle() helper
test: dm: Expand dm_test_ofnode_phandle(_ot) with new
ofnode/tree_parse_phandle
dm: core: implement phandle ofnode_options helper
test: dm: Add test for ofnode options phandle helper
led: update LED boot/activity to new property implementation
test: dm: Update test for LED activity and boot

Quoted 10 lines
 arch/sandbox/dts/other.dts |  31 ++++++++-
 arch/sandbox/dts/test.dts  |  16 +++--
 drivers/core/of_access.c   |  61 ++++++++++++-----
 drivers/core/ofnode.c      | 124 ++++++++++++++++++++++++++++++++-
 drivers/led/led-uclass.c   |  30 +++++---
 include/dm/of_access.h     |  86 +++++++++++++++++++++++
 include/dm/ofnode.h        | 107 +++++++++++++++++++++++++++++
 test/dm/led.c              |  18 +++--
 test/dm/ofnode.c           | 136 ++++++++++++++++++++++++++++++++-----
 9 files changed, 551 insertions(+), 58 deletions(-)

My main issue with the series is a lack of documentation updates, as the biggest challenge thus far has been that for example Peter couldn't figure out how to make use of this on PinePhone. We generate documentation today based on include/led.h for this API, yes? Thanks.

Signature · 1 line
Tom
#17 lore raw
Quoted 64 lines · Tom Rini
Quoted 51 lines · Christian Marangi

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

This was triggered by adding a new phandle in the test.dts to introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test to correctly finish. Also moving the uboot node down after the first phandle (in test.dts the gpio one) also made the CI test to correctly finish.

A little bit of searching and debugging made me realize the parse phandle OPs didn't support other.dts at all and they were still referencing phandle index from test.dts. (more info in the related commit)

In short the test was broken all along and was working by pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for LED boot/activity.

Posting in a single series as changes are trivial and just to speedup review process. (and also because the second part depends on the first)

All CI tested with azure pipeline.

Changes v2:
- Fix handling of flat tree for phandle
- Fix test and other.dts changes

Christian Marangi (8):
dm: core: implement oftree variant of parse_phandle OPs
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
dm: core: implement ofnode/tree_parse_phandle() helper
test: dm: Expand dm_test_ofnode_phandle(_ot) with new
ofnode/tree_parse_phandle
dm: core: implement phandle ofnode_options helper
test: dm: Add test for ofnode options phandle helper
led: update LED boot/activity to new property implementation
test: dm: Update test for LED activity and boot

Quoted 10 lines
 arch/sandbox/dts/other.dts |  31 ++++++++-
 arch/sandbox/dts/test.dts  |  16 +++--
 drivers/core/of_access.c   |  61 ++++++++++++-----
 drivers/core/ofnode.c      | 124 ++++++++++++++++++++++++++++++++-
 drivers/led/led-uclass.c   |  30 +++++---
 include/dm/of_access.h     |  86 +++++++++++++++++++++++
 include/dm/ofnode.h        | 107 +++++++++++++++++++++++++++++
 test/dm/led.c              |  18 +++--
 test/dm/ofnode.c           | 136 ++++++++++++++++++++++++++++++++-----
 9 files changed, 551 insertions(+), 58 deletions(-)
Quoted 5 lines

My main issue with the series is a lack of documentation updates, as the biggest challenge thus far has been that for example Peter couldn't figure out how to make use of this on PinePhone. We generate documentation today based on include/led.h for this API, yes? Thanks.

Hi Tom,

actually quite the oppisite, led.h describe how these works and was instructed to first have the options property merged in dt-schema. [1]

Here we have all the option documented under a yaml.

I notice there is a series from Simon that is also pushing a .yaml here locally in U-Boot and I was waiting for that to be merged to also include the additional entry there.

Also led.h description and API have info on where to look about the handling of /options/u-boot/

I feel the main problem with documentation is currently the fact that we are migrating to a more robust schema and people are used to using Doc directory? Anyway happy to get any hint on how to improve this.

[1] https://github.com/devicetree-org/dt-schema

Signature · 1 line
	Ansuel
#18 lore raw
Quoted 82 lines · Christian Marangi
Quoted 64 lines · Tom Rini
Quoted 51 lines · Christian Marangi

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

This was triggered by adding a new phandle in the test.dts to introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test to correctly finish. Also moving the uboot node down after the first phandle (in test.dts the gpio one) also made the CI test to correctly finish.

A little bit of searching and debugging made me realize the parse phandle OPs didn't support other.dts at all and they were still referencing phandle index from test.dts. (more info in the related commit)

In short the test was broken all along and was working by pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for LED boot/activity.

Posting in a single series as changes are trivial and just to speedup review process. (and also because the second part depends on the first)

All CI tested with azure pipeline.

Changes v2:
- Fix handling of flat tree for phandle
- Fix test and other.dts changes

Christian Marangi (8):
dm: core: implement oftree variant of parse_phandle OPs
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
dm: core: implement ofnode/tree_parse_phandle() helper
test: dm: Expand dm_test_ofnode_phandle(_ot) with new
ofnode/tree_parse_phandle
dm: core: implement phandle ofnode_options helper
test: dm: Add test for ofnode options phandle helper
led: update LED boot/activity to new property implementation
test: dm: Update test for LED activity and boot

Quoted 10 lines
 arch/sandbox/dts/other.dts |  31 ++++++++-
 arch/sandbox/dts/test.dts  |  16 +++--
 drivers/core/of_access.c   |  61 ++++++++++++-----
 drivers/core/ofnode.c      | 124 ++++++++++++++++++++++++++++++++-
 drivers/led/led-uclass.c   |  30 +++++---
 include/dm/of_access.h     |  86 +++++++++++++++++++++++
 include/dm/ofnode.h        | 107 +++++++++++++++++++++++++++++
 test/dm/led.c              |  18 +++--
 test/dm/ofnode.c           | 136 ++++++++++++++++++++++++++++++++-----
 9 files changed, 551 insertions(+), 58 deletions(-)
Quoted 5 lines

My main issue with the series is a lack of documentation updates, as the biggest challenge thus far has been that for example Peter couldn't figure out how to make use of this on PinePhone. We generate documentation today based on include/led.h for this API, yes? Thanks.

Hi Tom,

actually quite the oppisite, led.h describe how these works and was instructed to first have the options property merged in dt-schema. [1]

Here we have all the option documented under a yaml.

I notice there is a series from Simon that is also pushing a .yaml here locally in U-Boot and I was waiting for that to be merged to also include the additional entry there.

Quoted 8 lines

Also led.h description and API have info on where to look about the handling of /options/u-boot/

I feel the main problem with documentation is currently the fact that we are migrating to a more robust schema and people are used to using Doc directory? Anyway happy to get any hint on how to improve this.

[1] https://github.com/devicetree-org/dt-schema

So Peter, does this bring you what you were asking for in terms of details, or can you explain what's still missing from your point of view? Thanks!

Signature · 1 line
Tom
#19 lore raw
Quoted 90 lines · Tom Rini
Quoted 89 lines · Christian Marangi
Quoted 64 lines · Tom Rini
Quoted 51 lines · Christian Marangi

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

This was triggered by adding a new phandle in the test.dts to introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test to correctly finish. Also moving the uboot node down after the first phandle (in test.dts the gpio one) also made the CI test to correctly finish.

A little bit of searching and debugging made me realize the parse phandle OPs didn't support other.dts at all and they were still referencing phandle index from test.dts. (more info in the related commit)

In short the test was broken all along and was working by pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for LED boot/activity.

Posting in a single series as changes are trivial and just to speedup review process. (and also because the second part depends on the first)

All CI tested with azure pipeline.

Changes v2:
- Fix handling of flat tree for phandle
- Fix test and other.dts changes

Christian Marangi (8):
dm: core: implement oftree variant of parse_phandle OPs
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
dm: core: implement ofnode/tree_parse_phandle() helper
test: dm: Expand dm_test_ofnode_phandle(_ot) with new
ofnode/tree_parse_phandle
dm: core: implement phandle ofnode_options helper
test: dm: Add test for ofnode options phandle helper
led: update LED boot/activity to new property implementation
test: dm: Update test for LED activity and boot

Quoted 10 lines
 arch/sandbox/dts/other.dts |  31 ++++++++-
 arch/sandbox/dts/test.dts  |  16 +++--
 drivers/core/of_access.c   |  61 ++++++++++++-----
 drivers/core/ofnode.c      | 124 ++++++++++++++++++++++++++++++++-
 drivers/led/led-uclass.c   |  30 +++++---
 include/dm/of_access.h     |  86 +++++++++++++++++++++++
 include/dm/ofnode.h        | 107 +++++++++++++++++++++++++++++
 test/dm/led.c              |  18 +++--
 test/dm/ofnode.c           | 136 ++++++++++++++++++++++++++++++++-----
 9 files changed, 551 insertions(+), 58 deletions(-)
Quoted 5 lines

My main issue with the series is a lack of documentation updates, as the biggest challenge thus far has been that for example Peter couldn't figure out how to make use of this on PinePhone. We generate documentation today based on include/led.h for this API, yes? Thanks.

Hi Tom,

actually quite the oppisite, led.h describe how these works and was instructed to first have the options property merged in dt-schema. [1]

Here we have all the option documented under a yaml.

I notice there is a series from Simon that is also pushing a .yaml here locally in U-Boot and I was waiting for that to be merged to also include the additional entry there.

Also led.h description and API have info on where to look about the handling of /options/u-boot/

I feel the main problem with documentation is currently the fact that we are migrating to a more robust schema and people are used to using Doc directory? Anyway happy to get any hint on how to improve this.

Quoted 6 lines
Quoted 1 line

[1] https://github.com/devicetree-org/dt-schema

So Peter, does this bring you what you were asking for in terms of details, or can you explain what's still missing from your point of view? Thanks!

Hi Tom,

any idea how to improve this and get it trought?

Signature · 1 line
	Ansuel
#20 lore raw
Quoted 93 lines · Christian Marangi
Quoted 92 lines · Tom Rini
Quoted 90 lines · Christian Marangi
Quoted 64 lines · Tom Rini
Quoted 51 lines · Christian Marangi

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

This was triggered by adding a new phandle in the test.dts to introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test to correctly finish. Also moving the uboot node down after the first phandle (in test.dts the gpio one) also made the CI test to correctly finish.

A little bit of searching and debugging made me realize the parse phandle OPs didn't support other.dts at all and they were still referencing phandle index from test.dts. (more info in the related commit)

In short the test was broken all along and was working by pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for LED boot/activity.

Posting in a single series as changes are trivial and just to speedup review process. (and also because the second part depends on the first)

All CI tested with azure pipeline.

Changes v2:
- Fix handling of flat tree for phandle
- Fix test and other.dts changes

Christian Marangi (8):
dm: core: implement oftree variant of parse_phandle OPs
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
dm: core: implement ofnode/tree_parse_phandle() helper
test: dm: Expand dm_test_ofnode_phandle(_ot) with new
ofnode/tree_parse_phandle
dm: core: implement phandle ofnode_options helper
test: dm: Add test for ofnode options phandle helper
led: update LED boot/activity to new property implementation
test: dm: Update test for LED activity and boot

Quoted 10 lines
 arch/sandbox/dts/other.dts |  31 ++++++++-
 arch/sandbox/dts/test.dts  |  16 +++--
 drivers/core/of_access.c   |  61 ++++++++++++-----
 drivers/core/ofnode.c      | 124 ++++++++++++++++++++++++++++++++-
 drivers/led/led-uclass.c   |  30 +++++---
 include/dm/of_access.h     |  86 +++++++++++++++++++++++
 include/dm/ofnode.h        | 107 +++++++++++++++++++++++++++++
 test/dm/led.c              |  18 +++--
 test/dm/ofnode.c           | 136 ++++++++++++++++++++++++++++++++-----
 9 files changed, 551 insertions(+), 58 deletions(-)
Quoted 5 lines

My main issue with the series is a lack of documentation updates, as the biggest challenge thus far has been that for example Peter couldn't figure out how to make use of this on PinePhone. We generate documentation today based on include/led.h for this API, yes? Thanks.

Hi Tom,

actually quite the oppisite, led.h describe how these works and was instructed to first have the options property merged in dt-schema. [1]

Here we have all the option documented under a yaml.

I notice there is a series from Simon that is also pushing a .yaml here locally in U-Boot and I was waiting for that to be merged to also include the additional entry there.

Also led.h description and API have info on where to look about the handling of /options/u-boot/

I feel the main problem with documentation is currently the fact that we are migrating to a more robust schema and people are used to using Doc directory? Anyway happy to get any hint on how to improve this.

[1] https://github.com/devicetree-org/dt-schema

Quoted 8 lines
Quoted 4 lines

So Peter, does this bring you what you were asking for in terms of details, or can you explain what's still missing from your point of view? Thanks!

Hi Tom,

any idea how to improve this and get it trought?

I'll pick this up for -next soon, thanks.

Signature · 1 line
Tom
#21 lore raw
In reply to Christian Marangi
Quoted 9 lines · Christian Marangi

This series is split in 2 part.

While adapting the LED boot and activity code to the new property accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it out.

[...]

Applied to u-boot/next, thanks!

Signature · 1 line
Tom