global_data: Only include driver model fields when DM is enabled
PATCH 1/1 global_data: Only include driver model fields when DM is enabled
The struct list_head dmtag_list, struct udevice *dm_root, struct list_head uclass_root_s and struct list_head *uclass_root fields in struct global_data takes up 24/48 bytes of memory on ARMv7/AArch64. However, these fields are only used when $(PHASE_)DM is enabled.
Guard driver model related fields using CONFIG_IS_ENABLED(DM) to save memory space when U-Boot proper is built with DM=y and xPL is built without xPL_DM.
---
This change passed CI pipeline #924 [1]
[1] https://git.u-boot-project.org/u-boot/contributors/kwiboo/u-boot/-/pipelines/924
--- include/asm-generic/global_data.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/asm-generic/global_data.h +3 -1
@@ -174,10 +174,12 @@ struct global_data {* @arch: architecture-specific data */ struct arch_global_data arch; +#if CONFIG_IS_ENABLED (DM )/** * @dmtag_list: List of DM tags */ struct list_head dmtag_list; +#endif /** * @timebase_h: high 32 bits of timer */
@@ -228,7 +230,7 @@ struct global_data {*/ long precon_buf_idx;#endif -#ifdef CONFIG_DM +#if CONFIG_IS_ENABLED (DM )/** * @dm_root: root instance for Driver Model */
Signature · 1 line
2.54.0
Quoted 10 lines · Jonas Karlman
The struct
list_headdmtag_list, struct udevice*dm_root, structlist_headuclass_root_sand structlist_head*uclass_rootfields in structglobal_datatakes up 24/48 bytes of memory on ARMv7/AArch64. However, these fields are only used when $(PHASE_)DM is enabled.Guard driver model related fields using
CONFIG_IS_ENABLED(DM)to save memory space when U-Boot proper is built with DM=y and xPL is built withoutxPL_DM.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Quoted 11 lines · Jonas Karlman
global_data: Only include driver model fields when DM is enabledThe struct
list_headdmtag_list, struct udevice*dm_root, structlist_headuclass_root_sand structlist_head*uclass_rootfields in structglobal_datatakes up 24/48 bytes of memory on ARMv7/AArch64. However, these fields are only used when $(PHASE_)DM is enabled.Guard driver model related fields using
CONFIG_IS_ENABLED(DM)to save memory space when U-Boot proper is built with DM=y and xPL is built withoutxPL_DM.
Quoted 5 lines
Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
include/asm-generic/global_data.h| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 10 lines · Jonas Karlman
The struct
list_headdmtag_list, struct udevice*dm_root, structlist_headuclass_root_sand structlist_head*uclass_rootfields in structglobal_datatakes up 24/48 bytes of memory on ARMv7/AArch64. However, these fields are only used when $(PHASE_)DM is enabled.Guard driver model related fields using
CONFIG_IS_ENABLED(DM)to save memory space when U-Boot proper is built with DM=y and xPL is built withoutxPL_DM.[...]
Applied to u-boot/next, thanks!
[1/1] global_data: Only include driver model fields when DM is enabled
commit: 41541f47a3af93d76d63c2d6d1f1c859fa3dd61a
Signature · 1 line
Tom