summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2021-03-15 17:25:38 +1300
committerSimon Glass <[email protected]>2021-03-26 17:03:09 +1300
commitbaf0371883b243fa793ba3f984704b027705d6a9 (patch)
tree28a07a8f9336d9b5b8aa202e271ae00e1f311949 /include
parent6f644efdd803e0718d39266f75c0535a534cc601 (diff)
dm: core: Allow storing priv/plat data separately
At present the device priv/data data allocated by dtoc is stored in the data section along with other variables. On some platforms it is better to allocate space for it separately, e.g. if SPL is running from read-only memory. Create a new space with the same size as that allocated by dtoc, ready for use. Signed-off-by: Simon Glass <[email protected]> Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/global_data.h10
-rw-r--r--include/asm-generic/sections.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index f6189eff4eb..e1a5f4b1d18 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -222,6 +222,12 @@ struct global_data {
#if CONFIG_IS_ENABLED(OF_PLATDATA_RT)
/** @dm_udevice_rt: Dynamic info about the udevice */
struct udevice_rt *dm_udevice_rt;
+ /**
+ * @dm_priv_base: Base address of the priv/plat region used when
+ * udevices and uclasses are in read-only memory. This is NULL if not
+ * used
+ */
+ void *dm_priv_base;
# endif
#endif
#ifdef CONFIG_TIMER
@@ -498,9 +504,13 @@ struct global_data {
#if CONFIG_IS_ENABLED(OF_PLATDATA_RT)
#define gd_set_dm_udevice_rt(dyn) gd->dm_udevice_rt = dyn
#define gd_dm_udevice_rt() gd->dm_udevice_rt
+#define gd_set_dm_priv_base(dyn) gd->dm_priv_base = dyn
+#define gd_dm_priv_base() gd->dm_priv_base
#else
#define gd_set_dm_udevice_rt(dyn)
#define gd_dm_udevice_rt() NULL
+#define gd_set_dm_priv_base(dyn)
+#define gd_dm_priv_base() NULL
#endif
#ifdef CONFIG_GENERATE_ACPI_TABLE
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 0577238d60b..267f1db73f2 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -28,6 +28,9 @@ extern char __efi_helloworld_end[];
extern char __efi_var_file_begin[];
extern char __efi_var_file_end[];
+/* Private data used by of-platdata devices/uclasses */
+extern char __priv_data_start[], __priv_data_end[];
+
/* Start and end of .ctors section - used for constructor calls. */
extern char __ctors_start[], __ctors_end[];