| 1 |
|
| 2 |
|
| 3 |
#include <baseboard/variants.h> |
| 4 |
#include <baseboard/gpio.h> |
| 5 |
#include <boardid.h> |
| 6 |
#include <gpio.h> |
| 7 |
#include <soc/cnl_memcfg_init.h> |
| 8 |
#include <string.h> |
| 9 |
#include <variant/gpio.h> |
| 10 |
|
| 11 |
static const struct cnl_mb_cfg baseboard_memcfg = { |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
.dqs_map[DDR_CH0] = {4, 7, 5, 6, 0, 3, 2, 1}, |
| 23 |
.dqs_map[DDR_CH1] = {0, 3, 2, 1, 4, 7, 6, 5}, |
| 24 |
|
| 25 |
.dq_map[DDR_CH0] = { |
| 26 |
{0xf0, 0xf}, |
| 27 |
{0x0, 0xf}, |
| 28 |
{0xf0, 0xf}, |
| 29 |
{0xf0, 0x0}, |
| 30 |
{0xff, 0x0}, |
| 31 |
{0xff, 0x0} |
| 32 |
}, |
| 33 |
.dq_map[DDR_CH1] = { |
| 34 |
{0xf, 0xf0}, |
| 35 |
{0x0, 0xf0}, |
| 36 |
{0xf, 0xf0}, |
| 37 |
{0xf, 0x0}, |
| 38 |
{0xff, 0x0}, |
| 39 |
{0xff, 0x0} |
| 40 |
}, |
| 41 |
|
| 42 |
|
| 43 |
.rcomp_resistor = {200, 81, 162}, |
| 44 |
|
| 45 |
|
| 46 |
.rcomp_targets = {100, 40, 40, 23, 40}, |
| 47 |
|
| 48 |
|
| 49 |
.vref_ca_config = 0, |
| 50 |
|
| 51 |
|
| 52 |
.ect = 0, |
| 53 |
}; |
| 54 |
|
| 55 |
void variant_memory_params(struct cnl_mb_cfg *bcfg) |
| 56 |
{ |
| 57 |
memcpy(bcfg, &baseboard_memcfg, sizeof(baseboard_memcfg)); |
| 58 |
} |
| 59 |
|
| 60 |
int variant_memory_sku(void) |
| 61 |
{ |
| 62 |
const gpio_t spd_gpios[] = { |
| 63 |
GPIO_MEM_CONFIG_0, |
| 64 |
GPIO_MEM_CONFIG_1, |
| 65 |
GPIO_MEM_CONFIG_2, |
| 66 |
GPIO_MEM_CONFIG_3, |
| 67 |
}; |
| 68 |
|
| 69 |
int val = gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios)); |
| 70 |
|
| 71 |
if ((board_id() != 0) && (board_id() != BOARD_ID_UNKNOWN)) |
| 72 |
return val; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
switch (val) { |
| 80 |
case 3: |
| 81 |
val = 0; |
| 82 |
break; |
| 83 |
case 4: |
| 84 |
val = 1; |
| 85 |
break; |
| 86 |
} |
| 87 |
|
| 88 |
return val; |
| 89 |
} |