* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
@ 2012-08-28 0:38 Kim Phillips
2012-08-28 0:39 ` [U-Boot] [PATCH 2/2] libfdt: Add helpers for 64-bit integer properties Kim Phillips
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Kim Phillips @ 2012-08-28 0:38 UTC (permalink / raw)
To: u-boot
From: Minghuan Lian <Minghuan.Lian@freescale.com>
Some properties may contain multiple values, these values may need
to be added to the property respectively. this patch provides this
functionality. The main purpose of fdt_append_prop() is to append
the values to a existing property, or create a new property if it
dose not exist.
Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
include/libfdt.h | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++
lib/libfdt/fdt_rw.c | 27 +++++++++++++++
2 files changed, 122 insertions(+)
diff --git a/include/libfdt.h b/include/libfdt.h
index de82ed5..78798e8 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -1134,6 +1134,101 @@ static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
/**
+ * fdt_appendprop - append to or create a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to append to
+ * @val: pointer to data to append to the property value
+ * @len: length of the data to append to the property value
+ *
+ * fdt_appendprop() appends the value to the named property in the
+ * given node, creating the property if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ * contain the new property value
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
+ const void *val, int len);
+
+/**
+ * fdt_appendprop_cell - append a single cell value to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value to append to the property (native endian)
+ *
+ * fdt_appendprop_cell() appends the given cell value (converting to
+ * big-endian if necessary) to the value of the named property in the
+ * given node, or creates a new property with that value if it does
+ * not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ * contain the new property value
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
+ const char *name, uint32_t val)
+{
+ val = cpu_to_fdt32(val);
+ return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_appendprop_string - append a string to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @str: string value to append to the property
+ *
+ * fdt_appendprop_string() appends the given string to the value of
+ * the named property in the given node, or creates a new property
+ * with that value if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ * contain the new property value
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+#define fdt_appendprop_string(fdt, nodeoffset, name, str) \
+ fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
+
+/**
* fdt_delprop - delete a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to nop
diff --git a/lib/libfdt/fdt_rw.c b/lib/libfdt/fdt_rw.c
index 5c27a67..5ed23d6 100644
--- a/lib/libfdt/fdt_rw.c
+++ b/lib/libfdt/fdt_rw.c
@@ -293,6 +293,33 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
return 0;
}
+int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
+ const void *val, int len)
+{
+ struct fdt_property *prop;
+ int err, oldlen, newlen;
+
+ FDT_RW_CHECK_HEADER(fdt);
+
+ prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
+ if (prop) {
+ newlen = len + oldlen;
+ err = _fdt_splice_struct(fdt, prop->data,
+ FDT_TAGALIGN(oldlen),
+ FDT_TAGALIGN(newlen));
+ if (err)
+ return err;
+ prop->len = cpu_to_fdt32(newlen);
+ memcpy(prop->data + oldlen, val, len);
+ } else {
+ err = _fdt_add_property(fdt, nodeoffset, name, len, &prop);
+ if (err)
+ return err;
+ memcpy(prop->data, val, len);
+ }
+ return 0;
+}
+
int fdt_delprop(void *fdt, int nodeoffset, const char *name)
{
struct fdt_property *prop;
--
1.7.12
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 2/2] libfdt: Add helpers for 64-bit integer properties
2012-08-28 0:38 [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property Kim Phillips
@ 2012-08-28 0:39 ` Kim Phillips
[not found] ` <20120912190843.fce4abe4031e3bf1c3f29c78@freescale.com>
2012-09-15 14:36 ` Jerry Van Baren
2 siblings, 0 replies; 10+ messages in thread
From: Kim Phillips @ 2012-08-28 0:39 UTC (permalink / raw)
To: u-boot
From: David Gibson <david@gibson.dropbear.id.au>
In device trees in the world, properties consisting of a single 64-bit
integer are not as common as those consisting of a single 32-bit, cell
sized integer, but they're common enough that they're worth including
convenience functions for.
This patch adds helper wrappers of fdt_setprop_inplace(), fdt_setprop() and
fdt_appendprop() for handling 64-bit integer quantities in properties. For
better consistency with the names of these new *_u64() functions we also
add *_u32() functions as alternative names for the existing *_cell()
functions handling 32-bit integers.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
include/libfdt.h | 193 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 170 insertions(+), 23 deletions(-)
diff --git a/include/libfdt.h b/include/libfdt.h
index 78798e8..4589c5f 100644
--- a/include/libfdt.h
+++ b/include/libfdt.h
@@ -852,17 +852,17 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
/**
- * fdt_setprop_inplace_cell - change the value of a single-cell property
+ * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
- * @val: cell (32-bit integer) value to replace the property with
+ * @val: 32-bit integer value to replace the property with
*
- * fdt_setprop_inplace_cell() replaces the value of a given property
- * with the 32-bit integer cell value in val, converting val to
- * big-endian if necessary. This function cannot change the size of a
- * property, and so will only work if the property already exists and
- * has length 4.
+ * fdt_setprop_inplace_u32() replaces the value of a given property
+ * with the 32-bit integer value in val, converting val to big-endian
+ * if necessary. This function cannot change the size of a property,
+ * and so will only work if the property already exists and has length
+ * 4.
*
* This function will alter only the bytes in the blob which contain
* the given property value, and will not alter or move any other part
@@ -871,7 +871,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
* returns:
* 0, on success
* -FDT_ERR_NOSPACE, if the property's length is not equal to 4
- * -FDT_ERR_NOTFOUND, node does not have the named property
+ * -FDT_ERR_NOTFOUND, node does not have the named property
* -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,
@@ -879,14 +879,60 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
* -FDT_ERR_BADSTRUCTURE,
* -FDT_ERR_TRUNCATED, standard meanings
*/
-static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
- const char *name, uint32_t val)
+static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
+ const char *name, uint32_t val)
{
val = cpu_to_fdt32(val);
return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
}
/**
+ * fdt_setprop_inplace_u64 - change the value of a 64-bit integer property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 64-bit integer value to replace the property with
+ *
+ * fdt_setprop_inplace_u64() replaces the value of a given property
+ * with the 64-bit integer value in val, converting val to big-endian
+ * if necessary. This function cannot change the size of a property,
+ * and so will only work if the property already exists and has length
+ * 8.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, if the property's length is not equal to 8
+ * -FDT_ERR_NOTFOUND, node does not have the named property
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
+ const char *name, uint64_t val)
+{
+ val = cpu_to_fdt64(val);
+ return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_setprop_inplace_cell - change the value of a single-cell property
+ *
+ * This is an alternative name for fdt_setprop_inplace_u32()
+ */
+static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
+ const char *name, uint32_t val)
+{
+ return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val);
+}
+
+/**
* fdt_nop_property - replace a property with nop tags
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to nop
@@ -945,11 +991,20 @@ int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
int fdt_finish_reservemap(void *fdt);
int fdt_begin_node(void *fdt, const char *name);
int fdt_property(void *fdt, const char *name, const void *val, int len);
-static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
{
val = cpu_to_fdt32(val);
return fdt_property(fdt, name, &val, sizeof(val));
}
+static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
+{
+ val = cpu_to_fdt64(val);
+ return fdt_property(fdt, name, &val, sizeof(val));
+}
+static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+{
+ return fdt_property_u32(fdt, name, val);
+}
#define fdt_property_string(fdt, name, str) \
fdt_property(fdt, name, str, strlen(str)+1)
int fdt_end_node(void *fdt);
@@ -1068,14 +1123,14 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
/**
- * fdt_setprop_cell - set a property to a single cell value
+ * fdt_setprop_u32 - set a property to a 32-bit integer
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 32-bit integer value for the property (native endian)
*
- * fdt_setprop_cell() sets the value of the named property in the
- * given node to the given cell value (converting to big-endian if
+ * fdt_setprop_u32() sets the value of the named property in the given
+ * node to the given 32-bit integer value (converting to big-endian if
* necessary), or creates a new property with that value if it does
* not already exist.
*
@@ -1095,14 +1150,60 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
-static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
- uint32_t val)
+static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
+ uint32_t val)
{
val = cpu_to_fdt32(val);
return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
}
/**
+ * fdt_setprop_u64 - set a property to a 64-bit integer
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 64-bit integer value for the property (native endian)
+ *
+ * fdt_setprop_u64() sets the value of the named property in the given
+ * node to the given 64-bit integer value (converting to big-endian if
+ * necessary), or creates a new property with that value if it does
+ * not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ * contain the new property value
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
+ uint64_t val)
+{
+ val = cpu_to_fdt64(val);
+ return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_setprop_cell - set a property to a single cell value
+ *
+ * This is an alternative name for fdt_setprop_u32()
+ */
+static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
+ uint32_t val)
+{
+ return fdt_setprop_u32(fdt, nodeoffset, name, val);
+}
+
+/**
* fdt_setprop_string - set a property to a string value
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
@@ -1164,16 +1265,16 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
const void *val, int len);
/**
- * fdt_appendprop_cell - append a single cell value to a property
+ * fdt_appendprop_u32 - append a 32-bit integer value to a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
* @name: name of the property to change
* @val: 32-bit integer value to append to the property (native endian)
*
- * fdt_appendprop_cell() appends the given cell value (converting to
- * big-endian if necessary) to the value of the named property in the
- * given node, or creates a new property with that value if it does
- * not already exist.
+ * fdt_appendprop_u32() appends the given 32-bit integer value
+ * (converting to big-endian if necessary) to the value of the named
+ * property in the given node, or creates a new property with that
+ * value if it does not already exist.
*
* This function may insert data into the blob, and will therefore
* change the offsets of some existing nodes.
@@ -1191,14 +1292,60 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
* -FDT_ERR_BADLAYOUT,
* -FDT_ERR_TRUNCATED, standard meanings
*/
-static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
- const char *name, uint32_t val)
+static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
+ const char *name, uint32_t val)
{
val = cpu_to_fdt32(val);
return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
}
/**
+ * fdt_appendprop_u64 - append a 64-bit integer value to a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 64-bit integer value to append to the property (native endian)
+ *
+ * fdt_appendprop_u64() appends the given 64-bit integer value
+ * (converting to big-endian if necessary) to the value of the named
+ * property in the given node, or creates a new property with that
+ * value if it does not already exist.
+ *
+ * This function may insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ * contain the new property value
+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
+ const char *name, uint64_t val)
+{
+ val = cpu_to_fdt64(val);
+ return fdt_appendprop(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_appendprop_cell - append a single cell value to a property
+ *
+ * This is an alternative name for fdt_appendprop_u32()
+ */
+static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
+ const char *name, uint32_t val)
+{
+ return fdt_appendprop_u32(fdt, nodeoffset, name, val);
+}
+
+/**
* fdt_appendprop_string - append a string to a property
* @fdt: pointer to the device tree blob
* @nodeoffset: offset of the node whose property to change
--
1.7.12
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
[not found] ` <20120912190843.fce4abe4031e3bf1c3f29c78@freescale.com>
@ 2012-09-13 1:43 ` Jerry Van Baren
0 siblings, 0 replies; 10+ messages in thread
From: Jerry Van Baren @ 2012-09-13 1:43 UTC (permalink / raw)
To: u-boot
Hi Kim, Minghuan,
On 09/12/2012 08:08 PM, Kim Phillips wrote:
> On Mon, 27 Aug 2012 19:38:59 -0500
> Kim Phillips <kim.phillips@freescale.com> wrote:
>
>> From: Minghuan Lian <Minghuan.Lian@freescale.com>
>>
>> Some properties may contain multiple values, these values may need
>> to be added to the property respectively. this patch provides this
>> functionality. The main purpose of fdt_append_prop() is to append
>> the values to a existing property, or create a new property if it
>> dose not exist.
>>
>> Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
>> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>> ---
>
> Jerry, can you take a look at applying these?
Yes, I'll queue them up this weekend.
I'll also queue Marek Vasut <marex@denx.de> patch "[U-Boot] [PATCH] fdt:
Check if the FDT address is configured"
The merge window for v2012.10 closed September 18. Unless there is an
overriding urgency, the patches will go into the following release.
> Thanks,
> Kim
Best regards,
gvb
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-08-28 0:38 [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property Kim Phillips
2012-08-28 0:39 ` [U-Boot] [PATCH 2/2] libfdt: Add helpers for 64-bit integer properties Kim Phillips
[not found] ` <20120912190843.fce4abe4031e3bf1c3f29c78@freescale.com>
@ 2012-09-15 14:36 ` Jerry Van Baren
2012-09-15 15:00 ` Tabi Timur-B04825
2012-11-09 1:41 ` Kim Phillips
2 siblings, 2 replies; 10+ messages in thread
From: Jerry Van Baren @ 2012-09-15 14:36 UTC (permalink / raw)
To: u-boot
On 08/27/2012 08:38 PM, Kim Phillips wrote:
> From: Minghuan Lian <Minghuan.Lian@freescale.com>
>
> Some properties may contain multiple values, these values may need
> to be added to the property respectively. this patch provides this
> functionality. The main purpose of fdt_append_prop() is to append
> the values to a existing property, or create a new property if it
> dose not exist.
>
> Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
pull request when the merge window opens.
Thanks,
gvb
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-09-15 14:36 ` Jerry Van Baren
@ 2012-09-15 15:00 ` Tabi Timur-B04825
2012-09-15 15:19 ` Jerry Van Baren
2012-11-09 1:41 ` Kim Phillips
1 sibling, 1 reply; 10+ messages in thread
From: Tabi Timur-B04825 @ 2012-09-15 15:00 UTC (permalink / raw)
To: u-boot
On Sat, Sep 15, 2012 at 9:36 AM, Jerry Van Baren <gvb.uboot@gmail.com> wrote:
> Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
> pull request when the merge window opens.
I thought libfdt patches were suppose to go to dtc.git?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-09-15 15:00 ` Tabi Timur-B04825
@ 2012-09-15 15:19 ` Jerry Van Baren
0 siblings, 0 replies; 10+ messages in thread
From: Jerry Van Baren @ 2012-09-15 15:19 UTC (permalink / raw)
To: u-boot
On 09/15/2012 11:00 AM, Tabi Timur-B04825 wrote:
> On Sat, Sep 15, 2012 at 9:36 AM, Jerry Van Baren <gvb.uboot@gmail.com> wrote:
>
>> Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
>> pull request when the merge window opens.
>
> I thought libfdt patches were suppose to go to dtc.git?
That is where they came from. Since the u-boot libfdt is a subset of
the whole dtc.git repository (just the libfdt part), I've been cherry
picking only the libfdt/* patches (with the help of others).
I see David has another patch for the libfdt library that I probably
should pick up so that we stay in sync (18 lines of code by counting
semicolons).
commit be6026838e45b67800ac803f4ad8cca3cde57d6d
Author: David Gibson <david@gibson.dropbear.id.au>
Date: Fri Jun 1 14:12:38 2012 +1000
libfdt: Add helper function to create a trivial, empty tree
The libfdt read/write functions are now usable enough that it's become a
moderately common pattern to use them to build and manipulate a device
tree from scratch. For example, we do so ourself in our rw_tree1
testcase,
and qemu is starting to use this model when building device trees
for some
targets such as e500.
However, the read/write functions require some sort of valid tree to
begin
with, so this necessitates either having a trivial canned dtb to
begin with
or, more commonly, creating an empty tree using the serial-write
functions
first.
This patch adds a helper function which uses the serial-write
functions to
create a trivial, empty but complete and valid tree in a supplied
buffer,
ready for manipulation with the read/write functions.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-09-15 14:36 ` Jerry Van Baren
2012-09-15 15:00 ` Tabi Timur-B04825
@ 2012-11-09 1:41 ` Kim Phillips
2012-11-09 1:48 ` Simon Glass
2012-11-13 2:41 ` Jerry Van Baren
1 sibling, 2 replies; 10+ messages in thread
From: Kim Phillips @ 2012-11-09 1:41 UTC (permalink / raw)
To: u-boot
On Sat, 15 Sep 2012 10:36:28 -0400
Jerry Van Baren <gvb.uboot@gmail.com> wrote:
> On 08/27/2012 08:38 PM, Kim Phillips wrote:
> > From: Minghuan Lian <Minghuan.Lian@freescale.com>
> >
> > Some properties may contain multiple values, these values may need
> > to be added to the property respectively. this patch provides this
> > functionality. The main purpose of fdt_append_prop() is to append
> > the values to a existing property, or create a new property if it
> > dose not exist.
> >
> > Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>
> Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
> pull request when the merge window opens.
the merge window closed five days ago, and these didn't make it in.
What's the deal?
Kim
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-11-09 1:41 ` Kim Phillips
@ 2012-11-09 1:48 ` Simon Glass
2012-11-13 2:41 ` Jerry Van Baren
1 sibling, 0 replies; 10+ messages in thread
From: Simon Glass @ 2012-11-09 1:48 UTC (permalink / raw)
To: u-boot
On Thu, Nov 8, 2012 at 5:41 PM, Kim Phillips <kim.phillips@freescale.com> wrote:
> On Sat, 15 Sep 2012 10:36:28 -0400
> Jerry Van Baren <gvb.uboot@gmail.com> wrote:
>
>> On 08/27/2012 08:38 PM, Kim Phillips wrote:
>> > From: Minghuan Lian <Minghuan.Lian@freescale.com>
>> >
>> > Some properties may contain multiple values, these values may need
>> > to be added to the property respectively. this patch provides this
>> > functionality. The main purpose of fdt_append_prop() is to append
>> > the values to a existing property, or create a new property if it
>> > dose not exist.
>> >
>> > Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
>> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>>
>> Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
>> pull request when the merge window opens.
>
> the merge window closed five days ago, and these didn't make it in.
> What's the deal?
Well it doesn't mean it won't be applied. Probably just need to wait a bit.
>
> Kim
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-11-09 1:41 ` Kim Phillips
2012-11-09 1:48 ` Simon Glass
@ 2012-11-13 2:41 ` Jerry Van Baren
2012-11-13 21:02 ` Kim Phillips
1 sibling, 1 reply; 10+ messages in thread
From: Jerry Van Baren @ 2012-11-13 2:41 UTC (permalink / raw)
To: u-boot
On 11/08/2012 08:41 PM, Kim Phillips wrote:
> On Sat, 15 Sep 2012 10:36:28 -0400
> Jerry Van Baren <gvb.uboot@gmail.com> wrote:
>
>> On 08/27/2012 08:38 PM, Kim Phillips wrote:
>>> From: Minghuan Lian <Minghuan.Lian@freescale.com>
>>>
>>> Some properties may contain multiple values, these values may need
>>> to be added to the property respectively. this patch provides this
>>> functionality. The main purpose of fdt_append_prop() is to append
>>> the values to a existing property, or create a new property if it
>>> dose not exist.
>>>
>>> Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
>>> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>>
>> Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
>> pull request when the merge window opens.
>
> the merge window closed five days ago, and these didn't make it in.
> What's the deal?
>
> Kim
It's in there:
<http://git.denx.de/?p=u-boot.git;a=commit;h=36ad18a6db0eec546b83e6500ceb7593be53a1ed>
I sent a pull request Mon, Oct 22, 2012 and Tom applied it on Oct 23:
-----------------------------------------------------------------
David Gibson (1):
libfdt: Add helpers for 64-bit integer properties
Gerald Van Baren (2):
libfdt: Add helper function to create a trivial, empty tree
Merge branch 'next'
Joe Hershberger (5):
fdt: Check error codes returned from fdtlib when loading ITB
fdt: Limit printed hex in fdt print and list commands
fdt: Add get commands to fdt
fdt: Identify scripts in ITBs as printable strings
fdt: Check for a token to skip auto-hash validation
Minghuan Lian (1):
libfdt: Add support for appending the values to a existing property
-----------------------------------------------------------------
Best regards,
gvb
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property
2012-11-13 2:41 ` Jerry Van Baren
@ 2012-11-13 21:02 ` Kim Phillips
0 siblings, 0 replies; 10+ messages in thread
From: Kim Phillips @ 2012-11-13 21:02 UTC (permalink / raw)
To: u-boot
On Mon, 12 Nov 2012 21:41:17 -0500
Jerry Van Baren <gvb.uboot@gmail.com> wrote:
> On 11/08/2012 08:41 PM, Kim Phillips wrote:
> > On Sat, 15 Sep 2012 10:36:28 -0400
> > Jerry Van Baren <gvb.uboot@gmail.com> wrote:
> >> Queued up 2 of 2 patches to the u-boot-fdt "next" branch. I'll issue a
> >> pull request when the merge window opens.
> >
> > the merge window closed five days ago, and these didn't make it in.
> > What's the deal?
>
> It's in there:
> <http://git.denx.de/?p=u-boot.git;a=commit;h=36ad18a6db0eec546b83e6500ceb7593be53a1ed>
>
> I sent a pull request Mon, Oct 22, 2012 and Tom applied it on Oct 23:
right you are - don't know what I was looking at - my apologies.
Kim
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-11-13 21:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-28 0:38 [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property Kim Phillips
2012-08-28 0:39 ` [U-Boot] [PATCH 2/2] libfdt: Add helpers for 64-bit integer properties Kim Phillips
[not found] ` <20120912190843.fce4abe4031e3bf1c3f29c78@freescale.com>
2012-09-13 1:43 ` [U-Boot] [PATCH 1/2] libfdt: Add support for appending the values to a existing property Jerry Van Baren
2012-09-15 14:36 ` Jerry Van Baren
2012-09-15 15:00 ` Tabi Timur-B04825
2012-09-15 15:19 ` Jerry Van Baren
2012-11-09 1:41 ` Kim Phillips
2012-11-09 1:48 ` Simon Glass
2012-11-13 2:41 ` Jerry Van Baren
2012-11-13 21:02 ` Kim Phillips
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox