[coreboot-gerrit] Change in coreboot[master]: sifive/fu540: correct cbmem support

Philipp Hug (Code Review) gerrit at coreboot.org
Fri Oct 19 18:56:22 CEST 2018


Philipp Hug has uploaded this change for review. ( https://review.coreboot.org/29197


Change subject: sifive/fu540: correct cbmem support
......................................................................

sifive/fu540: correct cbmem support

Return correct memory location for cbmem instead of incorrectly returning memory size.

Change-Id: If7f490a46edebb04c2280bf317d1adacef08f30d
Signed-off-by: Philipp Hug <philipp at hug.cx>
---
M src/soc/sifive/fu540/cbmem.c
M src/soc/sifive/fu540/include/soc/addressmap.h
2 files changed, 7 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/29197/1

diff --git a/src/soc/sifive/fu540/cbmem.c b/src/soc/sifive/fu540/cbmem.c
index 8648370..61bff89 100644
--- a/src/soc/sifive/fu540/cbmem.c
+++ b/src/soc/sifive/fu540/cbmem.c
@@ -14,9 +14,13 @@
  */
 
 #include <cbmem.h>
+#include <soc/addressmap.h>
+#include <soc/sdram.h>
+#include <stdlib.h>
+#include <symbols.h>
 
 void *cbmem_top(void)
 {
-	/* dummy value */
-	return (void *)(4ULL * GiB);
+	return (void *)min((uintptr_t)_dram + sdram_size_mb() * MiB,
+	                   FU540_MAXDRAM);
 }
diff --git a/src/soc/sifive/fu540/include/soc/addressmap.h b/src/soc/sifive/fu540/include/soc/addressmap.h
index 21709b5..7493630 100644
--- a/src/soc/sifive/fu540/include/soc/addressmap.h
+++ b/src/soc/sifive/fu540/include/soc/addressmap.h
@@ -34,3 +34,4 @@
 #define FU540_QSPI0FLASH	0x20000000
 #define FU540_QSPI1FLASH	0x30000000
 #define FU540_DRAM		0x80000000
+#define FU540_MAXDRAM		0x2000000000

-- 
To view, visit https://review.coreboot.org/29197
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7f490a46edebb04c2280bf317d1adacef08f30d
Gerrit-Change-Number: 29197
Gerrit-PatchSet: 1
Gerrit-Owner: Philipp Hug <philipp at hug.cx>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181019/739e581e/attachment.html>


More information about the coreboot-gerrit mailing list