aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/board/seeed/linkit-smart-7688/board.c
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/board/seeed/linkit-smart-7688/board.c
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/board/seeed/linkit-smart-7688/board.c')
-rw-r--r--roms/u-boot/board/seeed/linkit-smart-7688/board.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/roms/u-boot/board/seeed/linkit-smart-7688/board.c b/roms/u-boot/board/seeed/linkit-smart-7688/board.c
new file mode 100644
index 000000000..bf7c69ea8
--- /dev/null
+++ b/roms/u-boot/board/seeed/linkit-smart-7688/board.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 Stefan Roese <sr@denx.de>
+ */
+
+#include <common.h>
+#include <init.h>
+#include <asm/io.h>
+#include <linux/bitops.h>
+
+#define MT76XX_GPIO1_MODE 0x10000060
+
+void board_debug_uart_init(void)
+{
+ void __iomem *gpio_mode;
+
+ /* Select UART2 mode instead of GPIO mode (default) */
+ gpio_mode = ioremap_nocache(MT76XX_GPIO1_MODE, 0x100);
+ clrbits_le32(gpio_mode, GENMASK(27, 26));
+}
+
+int board_early_init_f(void)
+{
+ /*
+ * The pin muxing of UART2 also needs to be done, if debug uart
+ * is not enabled. So we need to call this function here as well.
+ */
+ board_debug_uart_init();
+
+ return 0;
+}