All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ddr: fsl: Reduce the size of interactive options
@ 2022-08-30 20:54 Sean Anderson
  2022-09-06  5:27 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Anderson @ 2022-08-30 20:54 UTC (permalink / raw)
  To: Priyanka Jain, Peng Fan, u-boot; +Cc: Wolfgang Denk, Sean Anderson

The interactive mode uses large several tables of options which can be
configured. However, much of the contents of these tables are
repetetive. For example, no struct is larger than half a kilobyte, so
the offset only takes up 9 bits. Similarly, the size is only ever 4 or
8, and printhex is a boolean. Reduce the size of these fields. This
reduces the size of the options tables by around 10 KiB. However, the
largest contributor to the size of the options tables is the use of a
pointer for the strings. A better approach would be to use a separate
array of strings, and store an integer index in the options tables.
However, this would require a large re-architecting of this file.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
---

 drivers/ddr/fsl/interactive.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ddr/fsl/interactive.c b/drivers/ddr/fsl/interactive.c
index 2f76beb2dbe..eb2f06e8300 100644
--- a/drivers/ddr/fsl/interactive.c
+++ b/drivers/ddr/fsl/interactive.c
@@ -27,9 +27,9 @@
 /* Option parameter Structures */
 struct options_string {
 	const char *option_name;
-	size_t offset;
-	unsigned int size;
-	const char printhex;
+	u32 offset : 9;
+	u32 size : 4;
+	u32 printhex : 1;
 };
 
 static unsigned int picos_to_mhz(unsigned int picos)
-- 
2.35.1.1320.gc452695387.dirty


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ddr: fsl: Reduce the size of interactive options
  2022-08-30 20:54 [PATCH] ddr: fsl: Reduce the size of interactive options Sean Anderson
@ 2022-09-06  5:27 ` Peng Fan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2022-09-06  5:27 UTC (permalink / raw)
  To: Sean Anderson, Priyanka Jain, u-boot; +Cc: Wolfgang Denk



On 8/31/2022 4:54 AM, Sean Anderson wrote:
> The interactive mode uses large several tables of options which can be
> configured. However, much of the contents of these tables are
> repetetive. For example, no struct is larger than half a kilobyte, so
> the offset only takes up 9 bits. Similarly, the size is only ever 4 or
> 8, and printhex is a boolean. Reduce the size of these fields. This
> reduces the size of the options tables by around 10 KiB. However, the
> largest contributor to the size of the options tables is the use of a
> pointer for the strings. A better approach would be to use a separate
> array of strings, and store an integer index in the options tables.
> However, this would require a large re-architecting of this file.
> 
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>

In tag:
https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq/-/tags/fsl-qoriq-2022-9-6

Waiting CI results.

Regards,
Peng.

> ---
> 
>   drivers/ddr/fsl/interactive.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/ddr/fsl/interactive.c b/drivers/ddr/fsl/interactive.c
> index 2f76beb2dbe..eb2f06e8300 100644
> --- a/drivers/ddr/fsl/interactive.c
> +++ b/drivers/ddr/fsl/interactive.c
> @@ -27,9 +27,9 @@
>   /* Option parameter Structures */
>   struct options_string {
>   	const char *option_name;
> -	size_t offset;
> -	unsigned int size;
> -	const char printhex;
> +	u32 offset : 9;
> +	u32 size : 4;
> +	u32 printhex : 1;
>   };
>   
>   static unsigned int picos_to_mhz(unsigned int picos)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-06  5:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 20:54 [PATCH] ddr: fsl: Reduce the size of interactive options Sean Anderson
2022-09-06  5:27 ` Peng Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.