1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
/*
* This file is part of the coreboot project.
*
* Copyright 2016, 2017 Google Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <stdint.h>
#include <ec/google/chromeec/ec.h>
#include "baseboard/variants.h"
#include <soc/cpu.h>
#include <soc/intel/apollolake/chip.h>
#include <soc/intel/common/vbt.h>
enum {
SKU_0_ASTRONAUT = 0,
SKU_1_ASTRONAUT = 1,
SKU_2_SANTA = 2,
SKU_3_SANTA = 3,
SKU_61_ASTRONAUT = 61,
SKU_62_ASTRONAUT = 62,
SKU_160_NASHER = 160,
SKU_161_NASHER = 161,
SKU_162_NASHER = 162,
SKU_163_NASHER360 = 163,
SKU_164_NASHER360 = 164,
SKU_165_NASHER360 = 165,
SKU_166_NASHER360 = 166,
};
uint8_t variant_board_sku(void)
{
static int sku = -1;
if (sku == -1)
sku = google_chromeec_get_sku_id();
return sku;
}
void variant_nhlt_oem_overrides(const char **oem_id,
const char **oem_table_id,
uint32_t *oem_revision)
{
*oem_id = "coral";
*oem_table_id = CONFIG_VARIANT_DIR;
*oem_revision = variant_board_sku();
}
void mainboard_devtree_update(struct device *dev)
{
/* Override dev tree settings per board */
struct soc_intel_apollolake_config *cfg = dev->chip_info;
uint8_t sku_id;
sku_id = variant_board_sku();
switch (sku_id) {
case SKU_0_ASTRONAUT:
case SKU_1_ASTRONAUT:
cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7;
cfg->usb2eye[1].Usb20PerPortTxiSet = 2;
break;
case SKU_2_SANTA:
case SKU_3_SANTA:
cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7;
cfg->usb2eye[1].Usb20PerPortTxiSet = 2;
break;
case SKU_61_ASTRONAUT:
case SKU_62_ASTRONAUT:
cfg->usb2eye[1].Usb20PerPortPeTxiSet = 7;
cfg->usb2eye[1].Usb20PerPortTxiSet = 5;
break;
default:
break;
}
}
const char *mainboard_vbt_filename(void)
{
int sku_id = variant_board_sku();
switch (sku_id) {
case SKU_2_SANTA:
case SKU_3_SANTA:
return "vbt-santa.bin";
break;
case SKU_160_NASHER:
case SKU_161_NASHER:
case SKU_162_NASHER:
case SKU_163_NASHER360:
case SKU_164_NASHER360:
case SKU_165_NASHER360:
case SKU_166_NASHER360:
return "vbt-nasher.bin";
break;
default:
return "vbt.bin";
break;
}
}
|