From cfb9c9b77c29f48ae2c71ff30ca294bdaf369d87 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 15 Mar 2021 17:25:40 +1300 Subject: 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 Signed-off-by: Simon Glass --- include/dm/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/dm/util.h') diff --git a/include/dm/util.h b/include/dm/util.h index 01a044992f..138893c935 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 -- cgit v1.2.3