developer | 2fddd72 | 2022-05-20 11:22:21 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2022 MediaTek Inc. All rights reserved. |
| 4 | * |
| 5 | * Author: Weijie Gao <weijie.gao@mediatek.com> |
| 6 | */ |
| 7 | |
| 8 | #include <asm/io.h> |
| 9 | #include "../mt7621.h" |
| 10 | |
| 11 | void mtmips_spl_serial_init(void) |
| 12 | { |
| 13 | #ifdef CONFIG_SPL_SERIAL |
| 14 | void __iomem *base = ioremap_nocache(SYSCTL_BASE, SYSCTL_SIZE); |
| 15 | |
| 16 | #if CONFIG_CONS_INDEX == 1 |
| 17 | clrbits_32(base + SYSCTL_GPIOMODE_REG, UART1_MODE); |
| 18 | #elif CONFIG_CONS_INDEX == 2 |
| 19 | clrbits_32(base + SYSCTL_GPIOMODE_REG, UART2_MODE_M); |
| 20 | #elif CONFIG_CONS_INDEX == 3 |
| 21 | clrbits_32(base + SYSCTL_GPIOMODE_REG, UART3_MODE_M); |
| 22 | #endif /* CONFIG_CONS_INDEX */ |
| 23 | #endif /* CONFIG_SPL_SERIAL */ |
| 24 | } |