| 1 |
|
| 2 |
|
| 3 |
#include <bootstate.h> |
| 4 |
#include <console/console.h> |
| 5 |
#include <fw_config.h> |
| 6 |
#include <gpio.h> |
| 7 |
|
| 8 |
static const struct soc_amd_gpio fp_spi_gpio_table[] = { |
| 9 |
|
| 10 |
PAD_NF(GPIO_70, SPI2_CLK, PULL_NONE), |
| 11 |
|
| 12 |
PAD_NF(GPIO_75, SPI2_CS1_L, PULL_NONE), |
| 13 |
|
| 14 |
PAD_NF(GPIO_104, SPI2_DAT0, PULL_NONE), |
| 15 |
|
| 16 |
PAD_NF(GPIO_105, SPI2_DAT1, PULL_NONE), |
| 17 |
}; |
| 18 |
|
| 19 |
static const struct soc_amd_gpio fp_uart_gpio_table[] = { |
| 20 |
|
| 21 |
PAD_NF(GPIO_140, UART1_TXD, PULL_NONE), |
| 22 |
|
| 23 |
PAD_NF(GPIO_142, UART1_RXD, PULL_NONE), |
| 24 |
}; |
| 25 |
|
| 26 |
static void fw_config_handle(void *unused) |
| 27 |
{ |
| 28 |
if (!fw_config_is_provisioned() || fw_config_probe(FW_CONFIG(FP, DISABLED))) { |
| 29 |
return; |
| 30 |
} |
| 31 |
if (fw_config_probe(FW_CONFIG(FP, SPI))) { |
| 32 |
printk(BIOS_INFO, "Enabling SPI FP.\n"); |
| 33 |
gpio_configure_pads(fp_spi_gpio_table, ARRAY_SIZE(fp_spi_gpio_table)); |
| 34 |
} else if (fw_config_probe(FW_CONFIG(FP, UART))) { |
| 35 |
printk(BIOS_INFO, "Enabling UART FP.\n"); |
| 36 |
gpio_configure_pads(fp_uart_gpio_table, ARRAY_SIZE(fp_uart_gpio_table)); |
| 37 |
} else { |
| 38 |
printk(BIOS_INFO, "Invalid Fingerprint Setting, leaving FP disabled."); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); |