summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/rush/Makefile.inc1
-rw-r--r--src/mainboard/google/rush/romstage.c7
-rw-r--r--src/mainboard/google/rush/sdram_configs.c57
-rw-r--r--src/mainboard/google/rush/sdram_configs.h28
4 files changed, 93 insertions, 0 deletions
diff --git a/src/mainboard/google/rush/Makefile.inc b/src/mainboard/google/rush/Makefile.inc
index 4c6273f99f..746af11392 100644
--- a/src/mainboard/google/rush/Makefile.inc
+++ b/src/mainboard/google/rush/Makefile.inc
@@ -34,5 +34,6 @@ bootblock-y += reset.c
romstage-y += romstage.c
romstage-y += reset.c
+romstage-y += sdram_configs.c
ramstage-y += mainboard.c \ No newline at end of file
diff --git a/src/mainboard/google/rush/romstage.c b/src/mainboard/google/rush/romstage.c
index f0de9c0dfb..9db52989f7 100644
--- a/src/mainboard/google/rush/romstage.c
+++ b/src/mainboard/google/rush/romstage.c
@@ -22,6 +22,9 @@
#include <console/console.h>
#include <arch/exception.h>
+#include "sdram_configs.h"
+#include <soc/nvidia/tegra132/sdram.h>
+
void main(void)
{
void *entry;
@@ -31,6 +34,10 @@ void main(void)
printk(BIOS_INFO, "T132: romstage here\n");
+ sdram_init(get_sdram_config());
+
+ printk(BIOS_INFO, "T132 romstage: sdram_init done\n");
+
while (1);
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/ramstage");
diff --git a/src/mainboard/google/rush/sdram_configs.c b/src/mainboard/google/rush/sdram_configs.c
new file mode 100644
index 0000000000..18386ac53e
--- /dev/null
+++ b/src/mainboard/google/rush/sdram_configs.c
@@ -0,0 +1,57 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2014 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <console/console.h>
+#include <soc/nvidia/tegra132/sdram.h>
+#include "sdram_configs.h"
+
+static struct sdram_params sdram_configs[] = {
+#include "bct/sdram-hynix-2GB-924.inc" /* ram_code = 0000 */
+#include "bct/sdram-hynix-4GB-792.inc" /* ram_code = 0001 */
+#include "bct/sdram-unused.inc" /* ram_code = 0010 */
+#include "bct/sdram-unused.inc" /* ram_code = 0011 */
+#include "bct/sdram-unused.inc" /* ram_code = 0100 */
+#include "bct/sdram-unused.inc" /* ram_code = 0101 */
+#include "bct/sdram-unused.inc" /* ram_code = 0110 */
+#include "bct/sdram-unused.inc" /* ram_code = 0111 */
+#include "bct/sdram-unused.inc" /* ram_code = 1000 */
+#include "bct/sdram-unused.inc" /* ram_code = 1001 */
+#include "bct/sdram-unused.inc" /* ram_code = 1010 */
+#include "bct/sdram-unused.inc" /* ram_code = 1011 */
+#include "bct/sdram-unused.inc" /* ram_code = 1100 */
+#include "bct/sdram-unused.inc" /* ram_code = 1101 */
+#include "bct/sdram-unused.inc" /* ram_code = 1110 */
+#include "bct/sdram-unused.inc" /* ram_code = 1111 */
+};
+
+const struct sdram_params *get_sdram_config()
+{
+ uint32_t ramcode = sdram_get_ram_code();
+ /*
+ * If we need to apply some special hacks to RAMCODE mapping (ex, by
+ * board_id), do that now.
+ */
+
+ printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
+ if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+ sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused)
+ die("Invalid RAMCODE.");
+
+ return &sdram_configs[ramcode];
+}
diff --git a/src/mainboard/google/rush/sdram_configs.h b/src/mainboard/google/rush/sdram_configs.h
new file mode 100644
index 0000000000..e00e9ca04c
--- /dev/null
+++ b/src/mainboard/google/rush/sdram_configs.h
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2014 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __MAINBOARD_GOOGLE_RUSH_SDRAM_CONFIG_H__
+#define __MAINBOARD_GOOGLE_RUSH_SDRAM_CONFIG_H__
+
+#include <soc/nvidia/tegra132/sdram_param.h>
+
+/* Loads SDRAM configurations for current system. */
+const struct sdram_params *get_sdram_config(void);
+
+#endif /* __MAINBOARD_GOOGLE_RUSH_SDRAM_CONFIG_H__ */