Kane Chen | bfd6521 | 2020-07-16 13:36:20 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
| 3 | #include <baseboard/variants.h> |
| 4 | #include <soc/gpio.h> |
| 5 | |
Kane Chen | 0a85952 | 2020-08-21 16:55:37 +0800 | [diff] [blame] | 6 | static const struct soc_amd_gpio woomax_bid0_gpio_set_stage_ram[] = { |
Kane Chen | bfd6521 | 2020-07-16 13:36:20 +0800 | [diff] [blame] | 7 | /* 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 Shaikh | 79dba4a | 2020-08-04 17:16:33 -0700 | [diff] [blame] | 21 | /* EN_DEV_BEEP_L */ |
| 22 | PAD_GPO(GPIO_89, HIGH), |
Furquan Shaikh | 5474f8e | 2020-08-05 14:54:39 -0700 | [diff] [blame] | 23 | /* TP */ |
| 24 | PAD_NC(GPIO_90), |
Furquan Shaikh | cc6c41f | 2020-08-04 20:16:55 -0700 | [diff] [blame] | 25 | /* USI_RESET */ |
| 26 | PAD_GPO(GPIO_140, HIGH), |
Kane Chen | bfd6521 | 2020-07-16 13:36:20 +0800 | [diff] [blame] | 27 | /* GPIO_141 NC */ |
| 28 | PAD_NC(GPIO_141), |
| 29 | /* GPIO_143 NC */ |
| 30 | PAD_NC(GPIO_143), |
| 31 | }; |
| 32 | |
Kane Chen | 0a85952 | 2020-08-21 16:55:37 +0800 | [diff] [blame] | 33 | static 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 Chen | bfd6521 | 2020-07-16 13:36:20 +0800 | [diff] [blame] | 58 | const struct soc_amd_gpio *variant_override_gpio_table(size_t *size) |
| 59 | { |
Kane Chen | 0a85952 | 2020-08-21 16:55:37 +0800 | [diff] [blame] | 60 | uint32_t board_version; |
| 61 | |
| 62 | /* If board version cannot be read, assume it is board_version 0. */ |
Eric Lai | f209b18 | 2020-10-20 02:44:53 +0800 | [diff] [blame^] | 63 | if (google_chromeec_cbi_get_board_version(&board_version) != 0) |
Kane Chen | 0a85952 | 2020-08-21 16:55:37 +0800 | [diff] [blame] | 64 | 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 Chen | bfd6521 | 2020-07-16 13:36:20 +0800 | [diff] [blame] | 70 | *size = ARRAY_SIZE(woomax_gpio_set_stage_ram); |
| 71 | return woomax_gpio_set_stage_ram; |
| 72 | } |