All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: dart6ul: fix ddr size macro
@ 2021-01-04 19:07 ferlandm at amotus.ca
  2021-01-23 15:50 ` sbabic at denx.de
  0 siblings, 1 reply; 2+ messages in thread
From: ferlandm at amotus.ca @ 2021-01-04 19:07 UTC (permalink / raw)
  To: u-boot

From: Marc Ferland <ferlandm@amotus.ca>

The previous macro was off by one bit and so we were getting a ddr
size which was twice the real size. This commit refactors the macro so
it returns the right size in _bytes_ and modifies the printf call so the
size is still printed in MiB.

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
---
 board/variscite/dart_6ul/dart_6ul.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/variscite/dart_6ul/dart_6ul.c b/board/variscite/dart_6ul/dart_6ul.c
index 360be758bb..12e222e96e 100644
--- a/board/variscite/dart_6ul/dart_6ul.c
+++ b/board/variscite/dart_6ul/dart_6ul.c
@@ -250,7 +250,7 @@ struct dart6ul_info {
 #define DART6UL_INFO_STORAGE_GET(n) ((n) & 0x3)
 #define DART6UL_INFO_WIFI_GET(n)    ((n) >> 2 & 0x1)
 #define DART6UL_INFO_REV_GET(n)     ((n) >> 3 & 0x3)
-#define DART6UL_DDRSIZE_IN_MIB(n)   ((n) << 8)
+#define DART6UL_DDRSIZE(n)          ((n) * SZ_128M)
 #define DART6UL_INFO_MAGIC          0x32524156
 
 static const char *som_info_storage_to_str(u8 som_info)
@@ -323,7 +323,7 @@ int checkboard(void)
 	       info->date,
 	       som_info_storage_to_str(info->som_info),
 	       DART6UL_INFO_WIFI_GET(info->som_info) ? "yes" : "no",
-	       DART6UL_DDRSIZE_IN_MIB(info->ddr_size),
+	       DART6UL_DDRSIZE(info->ddr_size) / SZ_1M,
 	       som_info_rev_to_str(info->som_info));
 
 	free(info);
-- 
2.25.1

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

* [PATCH] arm: dart6ul: fix ddr size macro
  2021-01-04 19:07 [PATCH] arm: dart6ul: fix ddr size macro ferlandm at amotus.ca
@ 2021-01-23 15:50 ` sbabic at denx.de
  0 siblings, 0 replies; 2+ messages in thread
From: sbabic at denx.de @ 2021-01-23 15:50 UTC (permalink / raw)
  To: u-boot

> From: Marc Ferland <ferlandm@amotus.ca>
> The previous macro was off by one bit and so we were getting a ddr
> size which was twice the real size. This commit refactors the macro so
> it returns the right size in _bytes_ and modifies the printf call so the
> size is still printed in MiB.
> Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2021-01-23 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 19:07 [PATCH] arm: dart6ul: fix ddr size macro ferlandm at amotus.ca
2021-01-23 15:50 ` sbabic at denx.de

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.