aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/rambi/romstage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/rambi/romstage.c')
-rw-r--r--src/mainboard/google/rambi/romstage.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mainboard/google/rambi/romstage.c b/src/mainboard/google/rambi/romstage.c
index 369ebad445..efe1343950 100644
--- a/src/mainboard/google/rambi/romstage.c
+++ b/src/mainboard/google/rambi/romstage.c
@@ -31,7 +31,12 @@
* 0b001 - 4GiB total - 2 x 2GiB Hynix H5TC4G63AFR-PBA 1600MHz
* 0b010 - 2GiB total - 2 x 1GiB Micron MT41K128M16JT-125:K 1600MHz
* 0b011 - 2GiB total - 2 x 1GiB Hynix H5TC2G63FFR-PBA 1600MHz
+ * 0b100 - 2GiB total - 1 x 2GiB Micron MT41K256M16HA-125:E 1600MHz
+ * 0b101 - 2GiB total - 1 x 2GiB Hynix H5TC4G63AFR-PBA 1600MHz
*/
+static const uint32_t dual_channel_config =
+ (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3);
+
#define SPD_SIZE 256
#define GPIO_SSUS_37_PAD 57
#define GPIO_SSUS_38_PAD 50
@@ -43,7 +48,7 @@ static inline void disable_internal_pull(int pad)
write32(ssus_pconf0(pad), read32(ssus_pconf0(pad)) & pull_mask);
}
-static void *get_spd_pointer(char *spd_file_content, int total_spds)
+static void *get_spd_pointer(char *spd_file_content, int total_spds, int *dual)
{
int ram_id = 0;
@@ -63,6 +68,10 @@ static void *get_spd_pointer(char *spd_file_content, int total_spds)
if (ram_id >= total_spds)
return NULL;
+ /* Single channel configs */
+ if (dual_channel_config & (1 << ram_id))
+ *dual = 1;
+
return &spd_file_content[SPD_SIZE * ram_id];
}
@@ -70,6 +79,7 @@ void mainboard_romstage_entry(struct romstage_params *rp)
{
struct cbfs_file *spd_file;
void *spd_content;
+ int dual_channel = 0;
struct mrc_params mp = {
.mainboard = {
@@ -84,9 +94,11 @@ void mainboard_romstage_entry(struct romstage_params *rp)
/* Both channels are always present. */
spd_content = get_spd_pointer(CBFS_SUBHEADER(spd_file),
- ntohl(spd_file->len) / SPD_SIZE);
+ ntohl(spd_file->len) / SPD_SIZE,
+ &dual_channel);
mp.mainboard.dram_data[0] = spd_content;
- mp.mainboard.dram_data[1] = spd_content;
+ if (dual_channel)
+ mp.mainboard.dram_data[1] = spd_content;
rp->mrc_params = &mp;
romstage_common(rp);