mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
dt: add helper for phandle allocation
Phandle references work by having 2 pieces: - a "phandle" 1-cell property in the device tree node - a reference to the same value in a property we want to point to the other node To generate the 1-cell property, we need an allocation mechanism that gives us a unique number space. This patch adds an allocator for these properties. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
ce36252cc1
commit
3601b57282
2 changed files with 8 additions and 0 deletions
|
@ -191,6 +191,13 @@ int qemu_devtree_setprop_phandle(void *fdt, const char *node_path,
|
|||
return qemu_devtree_setprop_cell(fdt, node_path, property, phandle);
|
||||
}
|
||||
|
||||
uint32_t qemu_devtree_alloc_phandle(void *fdt)
|
||||
{
|
||||
static int phandle = 0x8000;
|
||||
|
||||
return phandle++;
|
||||
}
|
||||
|
||||
int qemu_devtree_nop_node(void *fdt, const char *node_path)
|
||||
{
|
||||
int r;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue