diff options
-rw-r--r-- | common/oftree.c | 14 | ||||
-rw-r--r-- | include/reset_source.h | 5 |
2 files changed, 19 insertions, 0 deletions
diff --git a/common/oftree.c b/common/oftree.c index 28a3b965ff..09cb660212 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -145,6 +145,7 @@ static int of_fixup_bootargs(struct device_node *root, void *unused) const char *str; int err; int instance = reset_source_get_instance(); + struct device_d *dev; str = linux_bootargs_get(); if (!str) @@ -164,6 +165,19 @@ static int of_fixup_bootargs(struct device_node *root, void *unused) if (instance >= 0) of_property_write_u32(node, "reset-source-instance", instance); + + dev = reset_source_get_device(); + if (dev && dev->device_node) { + phandle phandle; + + phandle = of_node_create_phandle(dev->device_node); + + err = of_property_write_u32(node, + "reset-source-device", phandle); + if (err) + return err; + } + return of_fixup_bootargs_bootsource(root, node); } diff --git a/include/reset_source.h b/include/reset_source.h index 27ee077cc6..3ccd529fdd 100644 --- a/include/reset_source.h +++ b/include/reset_source.h @@ -55,6 +55,11 @@ static inline int reset_source_get_instance(void) return -1; } +static inline struct device_d *reset_source_get_device(void) +{ + return NULL; +} + static inline void reset_source_set_prinst(enum reset_src_type type, unsigned int priority, int instance) { |