Angel Pons | 2712398 | 2020-04-05 13:22:30 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Seunghwan Kim | c76e53c | 2018-09-03 20:25:50 +0900 | [diff] [blame] | 2 | |
| 3 | #include <baseboard/variants.h> |
| 4 | #include <gpio.h> |
| 5 | #include <variant/sku.h> |
| 6 | |
| 7 | uint32_t variant_board_sku(void) |
| 8 | { |
Seunghwan Kim | c76e53c | 2018-09-03 20:25:50 +0900 | [diff] [blame] | 9 | static uint32_t sku_id = SKU_UNKNOWN; |
| 10 | |
| 11 | if (sku_id != SKU_UNKNOWN) |
| 12 | return sku_id; |
Seunghwan Kim | c76e53c | 2018-09-03 20:25:50 +0900 | [diff] [blame] | 13 | |
| 14 | /* |
| 15 | * Nautilus uses GPP_B20 to determine SKU |
| 16 | * 0 - Wifi SKU |
| 17 | * 1 - LTE SKU |
| 18 | */ |
| 19 | gpio_input_pulldown(GPP_B20); |
| 20 | if (!gpio_get(GPP_B20)) |
| 21 | sku_id = SKU_0_NAUTILUS; |
| 22 | else |
| 23 | sku_id = SKU_1_NAUTILUS_LTE; |
| 24 | |
| 25 | return sku_id; |
| 26 | } |