blob: cb98df7d41c28f72836e143e7e196928cd42b26a [file] [log] [blame]
Kane Chenbfd65212020-07-16 13:36:20 +08001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <baseboard/variants.h>
4#include <soc/gpio.h>
5
Kane Chen0a859522020-08-21 16:55:37 +08006static const struct soc_amd_gpio woomax_bid0_gpio_set_stage_ram[] = {
Kane Chenbfd65212020-07-16 13:36:20 +08007 /* GPIO_4 NC */
8 PAD_NC(GPIO_4),
9 /* GPIO_5 NC */
10 PAD_NC(GPIO_5),
11 /* GPIO_6 NC */
12 PAD_NC(GPIO_6),
13 /* GPIO_11 NC */
14 PAD_NC(GPIO_11),
15 /* GPIO_32 NC */
16 PAD_NC(GPIO_32),
17 /* GPIO_69 NC */
18 PAD_NC(GPIO_69),
19 /* RAM_ID_4 */
20 PAD_NC(GPIO_84),
Furquan Shaikh79dba4a2020-08-04 17:16:33 -070021 /* EN_DEV_BEEP_L */
22 PAD_GPO(GPIO_89, HIGH),
Furquan Shaikh5474f8e2020-08-05 14:54:39 -070023 /* TP */
24 PAD_NC(GPIO_90),
Furquan Shaikhcc6c41f2020-08-04 20:16:55 -070025 /* USI_RESET */
26 PAD_GPO(GPIO_140, HIGH),
Kane Chenbfd65212020-07-16 13:36:20 +080027 /* GPIO_141 NC */
28 PAD_NC(GPIO_141),
29 /* GPIO_143 NC */
30 PAD_NC(GPIO_143),
31};
32
Kane Chen0a859522020-08-21 16:55:37 +080033static const struct soc_amd_gpio woomax_gpio_set_stage_ram[] = {
34 /* GPIO_4 NC */
35 PAD_NC(GPIO_4),
36 /* GPIO_5 NC */
37 PAD_NC(GPIO_5),
38 /* GPIO_6 NC */
39 PAD_NC(GPIO_6),
40 /* GPIO_11 NC */
41 PAD_NC(GPIO_11),
42 /* GPIO_32 NC */
43 PAD_NC(GPIO_32),
44 /* GPIO_69 NC */
45 PAD_NC(GPIO_69),
46 /* RAM_ID_4 */
47 PAD_NC(GPIO_84),
48 /* EN_DEV_BEEP_L */
49 PAD_GPO(GPIO_89, HIGH),
50 /* USI_RESET */
51 PAD_GPO(GPIO_140, HIGH),
52 /* GPIO_141 NC */
53 PAD_NC(GPIO_141),
54 /* GPIO_143 NC */
55 PAD_NC(GPIO_143),
56};
57
Kane Chenbfd65212020-07-16 13:36:20 +080058const struct soc_amd_gpio *variant_override_gpio_table(size_t *size)
59{
Kane Chen0a859522020-08-21 16:55:37 +080060 uint32_t board_version;
61
62 /* If board version cannot be read, assume it is board_version 0. */
Eric Laif209b182020-10-20 02:44:53 +080063 if (google_chromeec_cbi_get_board_version(&board_version) != 0)
Kane Chen0a859522020-08-21 16:55:37 +080064 board_version = 0;
65
66 if (board_version == 0) {
67 *size = ARRAY_SIZE(woomax_bid0_gpio_set_stage_ram);
68 return woomax_bid0_gpio_set_stage_ram;
69 }
Kane Chenbfd65212020-07-16 13:36:20 +080070 *size = ARRAY_SIZE(woomax_gpio_set_stage_ram);
71 return woomax_gpio_set_stage_ram;
72}