summaryrefslogtreecommitdiff
path: root/src/mainboard/google/rush_ryu/sdram_configs.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-08-04 12:35:32 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-03-25 22:31:37 +0100
commit8c6d34c1f87f7f48f351e9496ec45985208f5076 (patch)
tree65931af3fcfb4d7dca8bee8e670c468c0a166bfb /src/mainboard/google/rush_ryu/sdram_configs.c
parentdabf0ebec03772cac320dc950cac57a48e1bd3c9 (diff)
downloadcoreboot-8c6d34c1f87f7f48f351e9496ec45985208f5076.tar.xz
ryu: Add 4 LPDDR3 SDRAM BCTs
These are used by the LPDDR3 code in sdram.c. Based on the schematic and email, I've filled in 4 slots in sdram_configs.c. My A44 returns RAMCODE 0 (using only bits 1:0) for Samsung SDRAM. I haven't tested the other 2 types of RAM (Hynix and Micron). The 4th slot is a fallback slow Micron config. Previously existing configurations were dropped. BUG=chrome-os-partner:29921 BUG=chrome-os-partner:31031 BRANCH=None TEST=Built for rush and rush_ryu. Change-Id: I55a737db269fe5fac1565d58bd8f8afcbc5beecb Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 9a431466171a85a5c8151e7466eb5f77862e7b44 Original-Change-Id: If216096ffc9e9836b6d082ad0668640b3eec37b7 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Commit-Id: a45e7788dd78697ac5f48b6cc64108ca0e4912dd Original-Change-Id: Ib7e8b814eb6dadb9b366536721876a3eeba0d2c0 Original-Signed-off-by: Tom Warren <twarren@nvidia.com> Original-Reviewed-on: https://chromium-review.googlesource.com/216000 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8976 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/mainboard/google/rush_ryu/sdram_configs.c')
-rw-r--r--src/mainboard/google/rush_ryu/sdram_configs.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/mainboard/google/rush_ryu/sdram_configs.c b/src/mainboard/google/rush_ryu/sdram_configs.c
index 462fec2afe..66978d3df4 100644
--- a/src/mainboard/google/rush_ryu/sdram_configs.c
+++ b/src/mainboard/google/rush_ryu/sdram_configs.c
@@ -19,36 +19,28 @@
#include <console/console.h>
#include <soc/sdram_configs.h>
+#include <stdlib.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 */
+static const struct sdram_params sdram_configs[] = {
+#include "bct/sdram-samsung-4GB-924.inc" /* ram_code = 00 */
+#include "bct/sdram-hynix-4GB-924.inc" /* ram_code = 01 */
+#include "bct/sdram-micron-4GB-924.inc" /* ram_code = 10 */
+#include "bct/sdram-micron-4GB-528.inc" /* ram_code = 11 */
};
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.
*/
+ ramcode &= 0x3; /* Only bits 1:0 used on Ryu */
printk(BIOS_SPEW, "%s: RAMCODE=%d\n", __func__, ramcode);
- if (ramcode >= sizeof(sdram_configs) / sizeof(sdram_configs[0]) ||
+
+ if (ramcode >= ARRAY_SIZE(sdram_configs) ||
sdram_configs[ramcode].MemoryType == NvBootMemoryType_Unused) {
die("Invalid RAMCODE.");
}