diff options
author | Simon Glass | 2021-03-15 17:25:40 +1300 |
---|---|---|
committer | Simon Glass | 2021-03-26 17:03:09 +1300 |
commit | cfb9c9b77c29f48ae2c71ff30ca294bdaf369d87 (patch) | |
tree | 9852a1cb811d66aef1cb045cc28679efe4b90105 /include/dm/util.h | |
parent | d5cc19288e00cd287a13717f495d5f1a517feffd (diff) |
dm: core: Use separate priv/plat data region
Make use of the new priv/plat data region if enabled. This is implemented
as a simple offset from the position set up by dtoc to the new position.
So long as all access goes through dm_priv_to_rw() this is safe.
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/util.h')
-rw-r--r-- | include/dm/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/dm/util.h b/include/dm/util.h index 01a044992f2..138893c9354 100644 --- a/include/dm/util.h +++ b/include/dm/util.h @@ -49,3 +49,12 @@ void dm_dump_driver_compat(void); void dm_dump_static_driver_info(void); #endif + +#if CONFIG_IS_ENABLED(OF_PLATDATA_INST) && CONFIG_IS_ENABLED(READ_ONLY) +void *dm_priv_to_rw(void *priv); +#else +static inline void *dm_priv_to_rw(void *priv) +{ + return priv; +} +#endif |