blob: a28abc00b8c3ab0d5ba16d13c75d262caaa3ade2 [file] [log] [blame]
Stefan Roeseb02f76a2018-08-16 15:27:30 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018 Stefan Roese <sr@denx.de>
4 */
5
6#include <common.h>
7#include <asm/io.h>
8
9#define MT76XX_GPIO1_MODE 0xb0000060
10
11void board_debug_uart_init(void)
12{
13 /* Select UART2 mode instead of GPIO mode (default) */
14 clrbits_le32((void __iomem *)MT76XX_GPIO1_MODE, GENMASK(27, 26));
15}
16
17int board_early_init_f(void)
18{
19 /*
20 * The pin muxing of UART2 also needs to be done, if debug uart
21 * is not enabled. So we need to call this function here as well.
22 */
23 board_debug_uart_init();
24
25 return 0;
26}