aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/board/tplink
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/tplink
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/board/tplink')
-rw-r--r--roms/u-boot/board/tplink/wdr4300/Kconfig30
-rw-r--r--roms/u-boot/board/tplink/wdr4300/MAINTAINERS6
-rw-r--r--roms/u-boot/board/tplink/wdr4300/Makefile3
-rw-r--r--roms/u-boot/board/tplink/wdr4300/wdr4300.c84
4 files changed, 123 insertions, 0 deletions
diff --git a/roms/u-boot/board/tplink/wdr4300/Kconfig b/roms/u-boot/board/tplink/wdr4300/Kconfig
new file mode 100644
index 000000000..67a022877
--- /dev/null
+++ b/roms/u-boot/board/tplink/wdr4300/Kconfig
@@ -0,0 +1,30 @@
+if BOARD_TPLINK_WDR4300
+
+config SYS_VENDOR
+ default "tplink"
+
+config SYS_SOC
+ default "ath79"
+
+config SYS_BOARD
+ default "wdr4300"
+
+config SYS_CONFIG_NAME
+ default "tplink_wdr4300"
+
+config SYS_TEXT_BASE
+ default 0xa1000000
+
+config SYS_DCACHE_SIZE
+ default 32768
+
+config SYS_DCACHE_LINE_SIZE
+ default 32
+
+config SYS_ICACHE_SIZE
+ default 65536
+
+config SYS_ICACHE_LINE_SIZE
+ default 32
+
+endif
diff --git a/roms/u-boot/board/tplink/wdr4300/MAINTAINERS b/roms/u-boot/board/tplink/wdr4300/MAINTAINERS
new file mode 100644
index 000000000..db239c291
--- /dev/null
+++ b/roms/u-boot/board/tplink/wdr4300/MAINTAINERS
@@ -0,0 +1,6 @@
+TPLINK_WDR4300 BOARD
+M: Marek Vasut <marex@denx.de>
+S: Maintained
+F: board/tplink/wdr4300/
+F: include/configs/tplink_wdr4300.h
+F: configs/tplink_wdr4300_defconfig
diff --git a/roms/u-boot/board/tplink/wdr4300/Makefile b/roms/u-boot/board/tplink/wdr4300/Makefile
new file mode 100644
index 000000000..323a104bf
--- /dev/null
+++ b/roms/u-boot/board/tplink/wdr4300/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y = wdr4300.o
diff --git a/roms/u-boot/board/tplink/wdr4300/wdr4300.c b/roms/u-boot/board/tplink/wdr4300/wdr4300.c
new file mode 100644
index 000000000..9134d6bf6
--- /dev/null
+++ b/roms/u-boot/board/tplink/wdr4300/wdr4300.c
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 Marek Vasut <marex@denx.de>
+ */
+
+#include <common.h>
+#include <init.h>
+#include <asm/io.h>
+#include <asm/addrspace.h>
+#include <asm/types.h>
+#include <linux/bitops.h>
+#include <linux/delay.h>
+#include <mach/ath79.h>
+#include <mach/ar71xx_regs.h>
+#include <mach/ddr.h>
+#include <debug_uart.h>
+
+#ifdef CONFIG_USB
+static void wdr4300_usb_start(void)
+{
+ void __iomem *gpio_regs = map_physmem(AR71XX_GPIO_BASE,
+ AR71XX_GPIO_SIZE, MAP_NOCACHE);
+ if (!gpio_regs)
+ return;
+
+ /* Power up the USB HUB. */
+ clrbits_be32(gpio_regs + AR71XX_GPIO_REG_OE, BIT(21) | BIT(22));
+ writel(BIT(21) | BIT(22), gpio_regs + AR71XX_GPIO_REG_SET);
+ mdelay(1);
+
+ ath79_usb_reset();
+}
+#else
+static inline void wdr4300_usb_start(void) {}
+#endif
+
+void wdr4300_pinmux_config(void)
+{
+ void __iomem *regs;
+
+ regs = map_physmem(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE,
+ MAP_NOCACHE);
+
+ /* Assure JTAG is not disconnected. */
+ writel(0x40, regs + AR934X_GPIO_REG_FUNC);
+
+ /* Configure default GPIO input/output regs. */
+ writel(0x3031b, regs + AR71XX_GPIO_REG_OE);
+ writel(0x0f804, regs + AR71XX_GPIO_REG_OUT);
+
+ /* Configure pin multiplexing. */
+ writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC0);
+ writel(0x0b0a0980, regs + AR934X_GPIO_REG_OUT_FUNC1);
+ writel(0x00180000, regs + AR934X_GPIO_REG_OUT_FUNC2);
+ writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC3);
+ writel(0x0000004d, regs + AR934X_GPIO_REG_OUT_FUNC4);
+ writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC5);
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+ wdr4300_pinmux_config();
+}
+#endif
+
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifndef CONFIG_DEBUG_UART_BOARD_INIT
+ wdr4300_pinmux_config();
+#endif
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+ ar934x_pll_init(560, 480, 240);
+ ar934x_ddr_init(560, 480, 240);
+#endif
+
+ wdr4300_usb_start();
+ ath79_eth_reset();
+
+ return 0;
+}
+#endif