diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-19 10:40:17 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 12:24:41 -0700 |
commit | 8a715530bb1f9522030757379415b174f3109951 (patch) | |
tree | 91422fb39012c35377fe8a50c772fb79634aba07 /include | |
parent | 49bbe6eab5babbc353f1dc76e6275671c69dffb2 (diff) | |
download | u-boot-8a715530bb1f9522030757379415b174f3109951.tar.gz |
dm: core: Allow the uclass list to move
At present the uclass list head is in global_data. This is convenient
but with the new of-platdata we need the list head to be declared by
the generated code.
Change this over to be a pointer. Provide a 'static' version in
global_data to retain the current behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/global_data.h | 8 | ||||
-rw-r--r-- | include/dm/device-internal.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h index 87d827d0f4..b63575919f 100644 --- a/include/asm-generic/global_data.h +++ b/include/asm-generic/global_data.h @@ -194,7 +194,13 @@ struct global_data { /** * @uclass_root: head of core tree */ - struct list_head uclass_root; + struct list_head uclass_root_s; + /** + * @uclass_root: pointer to head of core tree, if uclasses are in + * read-only memory and cannot be adjusted to use @uclass_root as a + * list head. + */ + struct list_head *uclass_root; # if CONFIG_IS_ENABLED(OF_PLATDATA) /** Dynamic info about the driver */ struct driver_rt *dm_driver_rt; diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index 03b092bdf7..639bbd293d 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -288,6 +288,7 @@ fdt_addr_t simple_bus_translate(struct udevice *dev, fdt_addr_t addr); /* Cast away any volatile pointer */ #define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root) #define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root) +#define DM_UCLASS_ROOT_S_NON_CONST (((gd_t *)gd)->uclass_root_s) /* device resource management */ #ifdef CONFIG_DEVRES |