summaryrefslogtreecommitdiffstats
path: root/arch/mips/boards
diff options
context:
space:
mode:
authorOleksij Rempel <linux@rempel-privat.de>2017-08-09 17:51:31 +0200
committerLucas Stach <l.stach@pengutronix.de>2017-08-15 15:39:25 +0200
commit91435aa96af6dbc66c9e306d31eb3cfa7d835615 (patch)
tree8fa0b960d2f2b5cbcaa305ac51b0ebfdea0fc0e8 /arch/mips/boards
parent196aa5cd216ae804f0e8f6673fa1d9b3e5d80c7e (diff)
downloadbarebox-91435aa96af6dbc66c9e306d31eb3cfa7d835615.tar.gz
barebox-91435aa96af6dbc66c9e306d31eb3cfa7d835615.tar.xz
MIPS: ath79: add TP-Link WDR4300 board support
This provides low level initialization of pll and ddr2. Resulting binary should work from SRAM, DDR2 and SPI flash. If started from DDR2 RAM level initialization will skipped. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'arch/mips/boards')
-rw-r--r--arch/mips/boards/tplink-wdr4300/Makefile1
-rw-r--r--arch/mips/boards/tplink-wdr4300/board.c28
-rw-r--r--arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h62
3 files changed, 91 insertions, 0 deletions
diff --git a/arch/mips/boards/tplink-wdr4300/Makefile b/arch/mips/boards/tplink-wdr4300/Makefile
new file mode 100644
index 0000000000..dcfc2937d3
--- /dev/null
+++ b/arch/mips/boards/tplink-wdr4300/Makefile
@@ -0,0 +1 @@
+obj-y += board.o
diff --git a/arch/mips/boards/tplink-wdr4300/board.c b/arch/mips/boards/tplink-wdr4300/board.c
new file mode 100644
index 0000000000..d6126fcb6d
--- /dev/null
+++ b/arch/mips/boards/tplink-wdr4300/board.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2017 Oleksij Rempel <o.rempel@pengutronix.de>
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <common.h>
+#include <init.h>
+
+static int model_hostname_init(void)
+{
+ barebox_set_hostname("wdr4300");
+
+ return 0;
+}
+postcore_initcall(model_hostname_init);
diff --git a/arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h b/arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h
new file mode 100644
index 0000000000..7d4ee4baba
--- /dev/null
+++ b/arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2017 Oleksij Rempel <o.rempel@pengutronix.de>
+ *
+ * This file is part of barebox.
+ * See file CREDITS for list of people who contributed to this project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <mach/debug_ll_ar9344.h>
+#include <asm/pbl_macros.h>
+#include <mach/pbl_macros.h>
+#include <mach/pbl_ll_init_ar9344_1.1.h>
+#include <asm/pbl_nmon.h>
+
+ .macro board_pbl_start
+ .set push
+ .set noreorder
+
+ mips_barebox_10h
+
+ debug_ll_ar9344_init
+
+ debug_ll_outc '1'
+
+ hornet_mips24k_cp0_setup
+ debug_ll_outc '2'
+
+ /* test if we are in the SRAM */
+ pbl_blt 0xbd000000 1f t8
+ debug_ll_outc '3'
+ b skip_flash_test
+ nop
+1:
+ /* test if we are in the flash */
+ pbl_blt 0xbf000000 skip_pll_ram_config t8
+ debug_ll_outc '4'
+skip_flash_test:
+
+ pbl_ar9344_v11_pll_config
+ debug_ll_outc '5'
+
+ pbl_ar9344_v11_ddr2_config
+
+skip_pll_ram_config:
+ debug_ll_outc '6'
+ debug_ll_outnl
+
+ mips_nmon
+
+ copy_to_link_location pbl_start
+
+ .set pop
+ .endm