1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <drivers/intel/gma/opregion.h>
5 #include <ec/google/chromeec/ec.h>
6 #include "baseboard/variants.h"
8 #include <soc/intel/apollolake/chip.h>
20 SKU_13_EPAULETTE
= 13,
21 SKU_14_EPAULETTE
= 14,
22 SKU_15_EPAULETTE
= 15,
23 SKU_16_EPAULETTE
= 16,
24 SKU_28_RABBID_RUGGED
= 28,
25 SKU_30_BABYTIGER
= 30,
28 SKU_33_BABYTIGER
= 33,
31 SKU_61_ASTRONAUT
= 61,
32 SKU_62_ASTRONAUT
= 62,
36 SKU_163_NASHER360
= 163,
37 SKU_164_NASHER360
= 164,
38 SKU_165_NASHER360
= 165,
39 SKU_166_NASHER360
= 166,
42 uint8_t variant_board_sku(void)
47 sku
= google_chromeec_get_sku_id();
52 void variant_nhlt_oem_overrides(const char **oem_id
,
53 const char **oem_table_id
,
54 uint32_t *oem_revision
)
57 *oem_table_id
= CONFIG_VARIANT_DIR
;
58 *oem_revision
= variant_board_sku();
61 #define DW_I2C_SPEED_CONFIG(speedval, lcnt, hcnt, hold) \
63 .speed = I2C_SPEED_ ## speedval, \
69 static const struct dw_i2c_speed_config
70 rabbid_i2c_speed_config
= DW_I2C_SPEED_CONFIG(FAST
, 210, 107, 47);
72 static const struct dw_i2c_speed_config
73 babymega_i2c_speed_config
= DW_I2C_SPEED_CONFIG(FAST
, 210, 107, 47);
75 static const struct dw_i2c_speed_config
76 babytiger_i2c_speed_config
= DW_I2C_SPEED_CONFIG(FAST
, 210, 107, 47);
78 void mainboard_devtree_update(struct device
*dev
)
80 /* Override dev tree settings per board */
81 struct soc_intel_apollolake_config
*cfg
= dev
->chip_info
;
84 sku_id
= variant_board_sku();
89 cfg
->usb2eye
[1].Usb20PerPortPeTxiSet
= 7;
90 cfg
->usb2eye
[1].Usb20PerPortTxiSet
= 2;
94 cfg
->usb2eye
[1].Usb20PerPortPeTxiSet
= 7;
95 cfg
->usb2eye
[1].Usb20PerPortTxiSet
= 2;
101 cfg
->usb2eye
[1].Usb20PerPortPeTxiSet
= 7;
102 cfg
->usb2eye
[1].Usb20PerPortTxiSet
= 2;
104 case SKU_28_RABBID_RUGGED
:
107 cfg
->common_soc_config
.i2c
[3].speed_config
[0] = rabbid_i2c_speed_config
;
108 cfg
->common_soc_config
.i2c
[4].speed_config
[0] = rabbid_i2c_speed_config
;
110 case SKU_30_BABYTIGER
:
111 case SKU_33_BABYTIGER
:
112 cfg
->common_soc_config
.i2c
[3].speed_config
[0] = babytiger_i2c_speed_config
;
113 cfg
->common_soc_config
.i2c
[4].speed_config
[0] = babytiger_i2c_speed_config
;
115 case SKU_52_BABYMEGA
:
116 case SKU_53_BABYMEGA
:
117 cfg
->common_soc_config
.i2c
[4].speed_config
[0] = babymega_i2c_speed_config
;
119 case SKU_61_ASTRONAUT
:
120 case SKU_62_ASTRONAUT
:
121 cfg
->usb2eye
[1].Usb20PerPortPeTxiSet
= 7;
122 cfg
->usb2eye
[1].Usb20PerPortTxiSet
= 5;
128 const char *mainboard_vbt_filename(void)
130 int sku_id
= variant_board_sku();
132 case SKU_0_ASTRONAUT
:
133 case SKU_1_ASTRONAUT
:
134 return "vbt-astronaut.bin";
137 return "vbt-santa.bin";
138 case SKU_13_EPAULETTE
:
139 case SKU_14_EPAULETTE
:
140 case SKU_15_EPAULETTE
:
141 case SKU_16_EPAULETTE
:
142 return "vbt-epaulette.bin";
143 case SKU_28_RABBID_RUGGED
:
144 return "vbt-rabbid_rugged.bin";
145 case SKU_30_BABYTIGER
:
146 case SKU_33_BABYTIGER
:
147 return "vbt-babytiger.bin";
148 case SKU_52_BABYMEGA
:
149 case SKU_53_BABYMEGA
:
150 return "vbt-babymega.bin";
154 case SKU_163_NASHER360
:
155 case SKU_164_NASHER360
:
156 case SKU_165_NASHER360
:
157 case SKU_166_NASHER360
:
158 return "vbt-nasher.bin";
164 static const struct pad_config nasher_gpio_tables
[] = {
165 /* AVS_DMIC_CLK_A1 */
166 PAD_CFG_NF_IOSSTATE(GPIO_79
, NATIVE
, DEEP
, NF1
, Tx1RxDCRx0
),
167 /* AVS_DMIC_CLK_B1 */
168 PAD_CFG_NF_IOSSTATE(GPIO_80
, NATIVE
, DEEP
, NF1
, Tx1RxDCRx0
),
171 const struct pad_config
*variant_sku_gpio_table(size_t *num
)
173 int sku_id
= variant_board_sku();
174 const struct pad_config
*board_gpio_tables
;
180 case SKU_163_NASHER360
:
181 case SKU_164_NASHER360
:
182 case SKU_165_NASHER360
:
183 case SKU_166_NASHER360
:
184 *num
= ARRAY_SIZE(nasher_gpio_tables
);
185 board_gpio_tables
= nasher_gpio_tables
;
189 board_gpio_tables
= NULL
;
192 return board_gpio_tables
;