| 1 |
|
| 2 |
|
| 3 |
#include <console/console.h> |
| 4 |
#include <gpio.h> |
| 5 |
#include <mainboard/google/cyan/spd/spd_util.h> |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
uint8_t get_ramid(void) |
| 19 |
{ |
| 20 |
gpio_t spd_gpios[] = { |
| 21 |
GP_SW_80, |
| 22 |
GP_SE_02, |
| 23 |
GP_SW_64, |
| 24 |
GP_SW_67, |
| 25 |
}; |
| 26 |
|
| 27 |
return gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)); |
| 28 |
} |
| 29 |
|
| 30 |
int get_variant_spd_index(int ram_id, int *dual) |
| 31 |
{ |
| 32 |
int spd_index = ram_id & 0x7; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
*dual = ((ram_id >> 3) & 0x1) ? 0 : 1; |
| 37 |
|
| 38 |
|
| 39 |
printk(BIOS_DEBUG, *dual ? "4GiB " : "2GiB "); |
| 40 |
switch (spd_index) { |
| 41 |
case 0: |
| 42 |
printk(BIOS_DEBUG, "Samsung K4E8E304EE-EGCE\n"); |
| 43 |
break; |
| 44 |
case 1: |
| 45 |
printk(BIOS_DEBUG, "Samsung K4E8E324EB-EGCF\n"); |
| 46 |
break; |
| 47 |
} |
| 48 |
|
| 49 |
return spd_index; |
| 50 |
} |