<p>Philipp Hug has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27438">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sifive/fu540: add empty sdram init and size functions<br><br>Change-Id: I65f900a3277bc8a4a83ebc8883d4a325bd690bf8<br>---<br>M src/soc/sifive/fu540/Makefile.inc<br>A src/soc/sifive/fu540/include/soc/sdram.h<br>A src/soc/sifive/fu540/sdram.c<br>3 files changed, 59 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/27438/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/sifive/fu540/Makefile.inc b/src/soc/sifive/fu540/Makefile.inc</span><br><span>index 8a2f3a6..9e7f584 100644</span><br><span>--- a/src/soc/sifive/fu540/Makefile.inc</span><br><span>+++ b/src/soc/sifive/fu540/Makefile.inc</span><br><span>@@ -19,9 +19,11 @@</span><br><span> </span><br><span> romstage-y += uart.c</span><br><span> romstage-y += media.c</span><br><span style="color: hsl(120, 100%, 40%);">+romstage-y += sdram.c</span><br><span> </span><br><span> ramstage-y += uart.c</span><br><span> ramstage-y += media.c</span><br><span style="color: hsl(120, 100%, 40%);">+ramstage-y += sdram.c</span><br><span> ramstage-y += cbmem.c</span><br><span> </span><br><span> CPPFLAGS_common += -Isrc/soc/sifive/fu540/include</span><br><span>diff --git a/src/soc/sifive/fu540/include/soc/sdram.h b/src/soc/sifive/fu540/include/soc/sdram.h</span><br><span>new file mode 100644</span><br><span>index 0000000..8610a7e</span><br><span>--- /dev/null</span><br><span>+++ b/src/soc/sifive/fu540/include/soc/sdram.h</span><br><span>@@ -0,0 +1,24 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2018 Philipp Hug <philipp@hug.cx></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef __SOC_SIFIVE_FU540_SDRAM_H__</span><br><span style="color: hsl(120, 100%, 40%);">+#define __SOC_SIFIVE_FU540_SDRAM_H__</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <types.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void sdram_init(void);</span><br><span style="color: hsl(120, 100%, 40%);">+size_t sdram_size_mb(void);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span>diff --git a/src/soc/sifive/fu540/sdram.c b/src/soc/sifive/fu540/sdram.c</span><br><span>new file mode 100644</span><br><span>index 0000000..1ad36da</span><br><span>--- /dev/null</span><br><span>+++ b/src/soc/sifive/fu540/sdram.c</span><br><span>@@ -0,0 +1,33 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2016 Philipp Hug <philipp@hug.cx></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <soc/sdram.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+void sdram_init(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+       // TODO: implement</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+size_t sdram_size_mb(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+        static size_t size_mb = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  if (!size_mb) {</span><br><span style="color: hsl(120, 100%, 40%);">+               // TODO: implement</span><br><span style="color: hsl(120, 100%, 40%);">+            size_mb = 8 * 1024;</span><br><span style="color: hsl(120, 100%, 40%);">+   }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return size_mb;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27438">change 27438</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27438"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I65f900a3277bc8a4a83ebc8883d4a325bd690bf8 </div>
<div style="display:none"> Gerrit-Change-Number: 27438 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Philipp Hug <philipp@hug.cx> </div>