Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
Felix Held | dea4e0f | 2021-09-22 20:05:53 +0200 | [diff] [blame] | 3 | #include <amdblocks/gpio.h> |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 4 | #include <amdblocks/uart.h> |
| 5 | #include <commonlib/helpers.h> |
| 6 | #include <device/mmio.h> |
Elyes Haouas | 5e2602a | 2023-01-14 05:46:25 +0100 | [diff] [blame] | 7 | #include <gpio.h> |
Felix Held | 117823e | 2021-06-15 16:33:29 +0200 | [diff] [blame] | 8 | #include <soc/aoac_defs.h> |
Felix Held | c6e4cc8 | 2022-10-18 19:22:21 +0200 | [diff] [blame] | 9 | #include <soc/iomap.h> |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 10 | #include <soc/southbridge.h> |
| 11 | #include <soc/uart.h> |
| 12 | #include <types.h> |
| 13 | |
Felix Held | d2ebe16 | 2022-10-18 18:16:14 +0200 | [diff] [blame] | 14 | static const struct soc_uart_ctrlr_info uart_info[] = { |
Felix Held | d85f25f | 2022-10-18 18:23:28 +0200 | [diff] [blame] | 15 | [0] = { APU_UART0_BASE, FCH_AOAC_DEV_UART0, "FUR0", { |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 16 | PAD_NF(GPIO_143, UART0_TXD, PULL_NONE), |
| 17 | PAD_NF(GPIO_141, UART0_RXD, PULL_NONE), |
Felix Held | d85f25f | 2022-10-18 18:23:28 +0200 | [diff] [blame] | 18 | } }, |
| 19 | [1] = { APU_UART1_BASE, FCH_AOAC_DEV_UART1, "FUR1", { |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 20 | PAD_NF(GPIO_140, UART1_TXD, PULL_NONE), |
| 21 | PAD_NF(GPIO_142, UART1_RXD, PULL_NONE), |
Felix Held | d85f25f | 2022-10-18 18:23:28 +0200 | [diff] [blame] | 22 | } }, |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 23 | }; |
| 24 | |
Felix Held | 97e6125 | 2022-10-18 19:03:20 +0200 | [diff] [blame] | 25 | const struct soc_uart_ctrlr_info *soc_get_uart_ctrlr_info(size_t *num_ctrlrs) |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 26 | { |
Felix Held | 9fde889 | 2022-10-18 20:21:58 +0200 | [diff] [blame] | 27 | *num_ctrlrs = ARRAY_SIZE(uart_info); |
| 28 | return uart_info; |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | void clear_uart_legacy_config(void) |
| 32 | { |
Felix Held | 25866fe | 2022-09-29 16:06:45 +0200 | [diff] [blame] | 33 | write16p(FCH_LEGACY_UART_DECODE, 0); |
Felix Held | 8a3d4d5 | 2021-01-13 03:06:21 +0100 | [diff] [blame] | 34 | } |