soc/mediatek/mt8196: Initialize SSPM
[coreboot2.git] / src / mainboard / google / cyan / variants / kefka / spd_util.c
blob487e4d6fd73ccedea6bea551e07e97b4465b8494
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <mainboard/google/cyan/spd/spd_util.h>
6 /*
7 * 0b0000 - 4GiB total - 2 x 2GiB Hynix H9CCNNN8GTMLAR-NUD 1600MHz
8 * 0b0001 - 2GiB total - 1 x 2GiB Hynix H9CCNNN8GTMLAR-NUD 1600MHz
9 * 0b0010 - 4GiB total - 2 x 2GiB Micron MT52L256M32D1PF-107
10 * 0b0011 - 2GiB total - 1 x 2GiB Micron MT52L256M32D1PF-107
11 * 0b0100 - 4GiB total - 2 x 2GiB Samsung K4E8E324EB-EGCF 1600MHz
12 * 0b0101 - 2GiB total - 1 x 2GiB Samsung K4E8E324EB-EGCF 1600MHz
13 * 0b0110 - 4GiB total - 2 x 2GiB Hynix H9CCNNN8GTALAR-NUD
14 * 0b0111 - 2GiB total - 1 x 2GiB Hynix H9CCNNN8GTALAR-NUD
18 static const uint32_t dual_channel_config =
19 (1 << 0) | (1 << 2) | (1 << 4) | (1 << 6);
21 int get_variant_spd_index(int ram_id, int *dual)
23 /* Determine if single or dual channel memory system */
24 *dual = (dual_channel_config & (1 << ram_id)) ? 1 : 0;
26 /* Display the RAM type */
27 switch (ram_id) {
28 case 0:
29 printk(BIOS_DEBUG, "4GiB Hynix H9CCNNN8GTMLAR-NUD\n");
30 break;
31 case 1:
32 printk(BIOS_DEBUG, "2GiB Hynix H9CCNNN8GTMLAR-NUD\n");
33 break;
34 case 2:
35 printk(BIOS_DEBUG, "4GiB Micron MT52L256M32D1PF-107\n");
36 break;
37 case 3:
38 printk(BIOS_DEBUG, "2GiB Micron MT52L256M32D1PF-107\n");
39 break;
40 case 4:
41 printk(BIOS_DEBUG, "4GiB Samsung K4E8E324EB-EGCF\n");
42 break;
43 case 5:
44 printk(BIOS_DEBUG, "2GiB Samsung K4E8E324EB-EGCF\n");
45 break;
46 case 6:
47 printk(BIOS_DEBUG, "4GiB Hynix H9CCNNN8GTALAR-NUD\n");
48 break;
49 case 7:
50 printk(BIOS_DEBUG, "2GiB Hynix H9CCNNN8GTALAR-NUD\n");
51 break;
54 /* 1:1 mapping between ram_id and spd_index for kefka */
55 return ram_id;