aboutsummaryrefslogtreecommitdiff
path: root/core/device.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-02-16 13:40:42 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-02-21 11:58:19 +1100
commit7f4c8e8ce0b78ca046643d7f4f63d81f4fd11746 (patch)
tree1083ea2e11490069aa0bba324cc48bb73a0f627b /core/device.c
parent08b1929052f8dfa1cc6b0ab3a9df77c9b5493914 (diff)
downloadskiboot-7f4c8e8ce0b78ca046643d7f4f63d81f4fd11746.zip
skiboot-7f4c8e8ce0b78ca046643d7f4f63d81f4fd11746.tar.gz
skiboot-7f4c8e8ce0b78ca046643d7f4f63d81f4fd11746.tar.bz2
dt: add /cpus/ibm, powerpc-cpu-features device tree bindings
This is a new CPU feature advertising interface that is fine-grained, extensible, aware of privilege levels, and gives control of features to all levels of the stack (firmware, hypervisor, and OS). The design and binding specification is described in detail in doc/. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix maybe-uninitialized warning from older GCC, doc cleanup] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/device.c')
-rw-r--r--core/device.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/device.c b/core/device.c
index 50fbb18..38dbdfc 100644
--- a/core/device.c
+++ b/core/device.c
@@ -598,6 +598,13 @@ u32 dt_property_get_cell(const struct dt_property *prop, u32 index)
return fdt32_to_cpu(((const u32 *)prop->prop)[index]);
}
+void dt_property_set_cell(struct dt_property *prop, u32 index, u32 val)
+{
+ assert(prop->len >= (index+1)*sizeof(u32));
+ /* Always aligned, so this works. */
+ ((u32 *)prop->prop)[index] = cpu_to_fdt32(val);
+}
+
/* First child of this node. */
struct dt_node *dt_first(const struct dt_node *root)
{