Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 2 | |
Felix Held | 91ef925 | 2021-01-12 23:44:05 +0100 | [diff] [blame] | 3 | #include <amdblocks/uart.h> |
Marc Jones | dfeb1c4 | 2017-08-07 19:08:24 -0600 | [diff] [blame] | 4 | #include <soc/southbridge.h> |
Felix Held | 91ef925 | 2021-01-12 23:44:05 +0100 | [diff] [blame] | 5 | #include <types.h> |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 6 | |
Felix Held | 91ef925 | 2021-01-12 23:44:05 +0100 | [diff] [blame] | 7 | uintptr_t get_uart_base(unsigned int idx) |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 8 | { |
Marshall Dawson | a5f225f | 2017-08-18 10:07:07 -0600 | [diff] [blame] | 9 | if (CONFIG_UART_FOR_CONSOLE < 0 || CONFIG_UART_FOR_CONSOLE > 1) |
10 | return 0; | ||||
11 | |||||
Marshall Dawson | 4e101ad | 2017-06-15 12:17:38 -0600 | [diff] [blame] | 12 | return (uintptr_t)(APU_UART0_BASE + 0x2000 * (idx & 1)); |
Marc Jones | 2448484 | 2017-05-04 21:17:45 -0600 | [diff] [blame] | 13 | } |