summaryrefslogtreecommitdiffstats
path: root/arch/mips/boards
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/boards')
-rw-r--r--arch/mips/boards/8devices-lima/Makefile1
-rw-r--r--arch/mips/boards/8devices-lima/include/board/board_pbl_start.h65
-rw-r--r--arch/mips/boards/8devices-lima/lowlevel.S41
-rw-r--r--arch/mips/boards/Makefile11
-rw-r--r--arch/mips/boards/black-swift/Makefile2
-rw-r--r--arch/mips/boards/black-swift/board.c27
-rw-r--r--arch/mips/boards/black-swift/include/board/board_pbl_start.h60
-rw-r--r--arch/mips/boards/black-swift/lowlevel.S46
-rw-r--r--arch/mips/boards/dlink-dir-320/Makefile1
-rw-r--r--arch/mips/boards/dlink-dir-320/board.c14
-rw-r--r--arch/mips/boards/dlink-dir-320/lowlevel.S22
-rw-r--r--arch/mips/boards/dptechnics-dpt-module/Makefile1
-rw-r--r--arch/mips/boards/dptechnics-dpt-module/include/board/board_pbl_start.h20
-rw-r--r--arch/mips/boards/dptechnics-dpt-module/lowlevel.S20
-rw-r--r--arch/mips/boards/img-ci20/Makefile2
-rw-r--r--arch/mips/boards/img-ci20/board.c27
-rw-r--r--arch/mips/boards/img-ci20/include/board/board_pbl_start.h43
-rw-r--r--arch/mips/boards/img-ci20/include/board/debug_ll.h23
-rw-r--r--arch/mips/boards/img-ci20/lowlevel.S26
-rw-r--r--arch/mips/boards/loongson-ls1b/Makefile2
-rw-r--r--arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h41
-rw-r--r--arch/mips/boards/loongson-ls1b/include/board/debug_ll.h14
-rw-r--r--arch/mips/boards/loongson-ls1b/lowlevel.S24
-rw-r--r--arch/mips/boards/loongson-ls1b/serial.c10
-rw-r--r--arch/mips/boards/netgear-wg102/Makefile1
-rw-r--r--arch/mips/boards/netgear-wg102/include/board/debug_ll.h14
-rw-r--r--arch/mips/boards/netgear-wg102/lowlevel.S (renamed from arch/mips/boards/netgear-wg102/include/board/board_pbl_start.h)34
-rw-r--r--arch/mips/boards/qemu-malta/Makefile2
-rw-r--r--arch/mips/boards/qemu-malta/include/board/debug_ll.h14
-rw-r--r--arch/mips/boards/qemu-malta/init.c29
-rw-r--r--arch/mips/boards/qemu-malta/lowlevel.S (renamed from arch/mips/boards/qemu-malta/include/board/board_pbl_start.h)29
-rw-r--r--arch/mips/boards/ritmix-rzx50/Makefile2
-rw-r--r--arch/mips/boards/ritmix-rzx50/include/board/board_pbl_start.h43
-rw-r--r--arch/mips/boards/ritmix-rzx50/include/board/debug_ll.h23
-rw-r--r--arch/mips/boards/ritmix-rzx50/lowlevel.S26
-rw-r--r--arch/mips/boards/ritmix-rzx50/serial.c27
-rw-r--r--arch/mips/boards/tplink-mr3020/Makefile2
-rw-r--r--arch/mips/boards/tplink-mr3020/board.c27
-rw-r--r--arch/mips/boards/tplink-mr3020/lowlevel.S (renamed from arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h)30
-rw-r--r--arch/mips/boards/tplink-wdr4300/Makefile2
-rw-r--r--arch/mips/boards/tplink-wdr4300/board.c28
-rw-r--r--arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h62
-rw-r--r--arch/mips/boards/tplink-wdr4300/lowlevel.S38
43 files changed, 298 insertions, 678 deletions
diff --git a/arch/mips/boards/8devices-lima/Makefile b/arch/mips/boards/8devices-lima/Makefile
new file mode 100644
index 0000000000..b08c4a93ca
--- /dev/null
+++ b/arch/mips/boards/8devices-lima/Makefile
@@ -0,0 +1 @@
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/8devices-lima/include/board/board_pbl_start.h b/arch/mips/boards/8devices-lima/include/board/board_pbl_start.h
deleted file mode 100644
index e95aa49256..0000000000
--- a/arch/mips/boards/8devices-lima/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2018 Oleksij Rempel <linux@rempel-privat.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_qca4531.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_qca4531_ddr2_550_550_init
-
- debug_ll_outc '5'
- /* Initialize caches... */
- mips_cache_reset
-
- /* ... and enable them */
- dcache_enable
-skip_pll_ram_config:
- debug_ll_outc '6'
- debug_ll_outnl
-
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
diff --git a/arch/mips/boards/8devices-lima/lowlevel.S b/arch/mips/boards/8devices-lima/lowlevel.S
new file mode 100644
index 0000000000..b53b23b42a
--- /dev/null
+++ b/arch/mips/boards/8devices-lima/lowlevel.S
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2018 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#define BOARD_PBL_START start_8devices_lima
+
+#include <mach/debug_ll.h>
+#include <asm/asm.h>
+#include <asm/pbl_macros.h>
+#include <mach/pbl_macros.h>
+#include <mach/pbl_ll_init_qca4531.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_barebox_10h
+
+ debug_ll_ath79_init
+
+ hornet_mips24k_cp0_setup
+
+ /* test if we are in the SRAM */
+ pbl_blt 0xbd000000 1f t8
+ b skip_flash_test
+ nop
+1:
+ /* test if we are in the flash */
+ pbl_blt 0xbf000000 skip_pll_ram_config t8
+skip_flash_test:
+
+ pbl_qca4531_ddr2_550_550_init
+
+ /* Initialize caches... */
+ mips_cache_reset
+
+ /* ... and enable them */
+ dcache_enable
+skip_pll_ram_config:
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, qca4531_8devices_lima)
diff --git a/arch/mips/boards/Makefile b/arch/mips/boards/Makefile
new file mode 100644
index 0000000000..50652f9841
--- /dev/null
+++ b/arch/mips/boards/Makefile
@@ -0,0 +1,11 @@
+obj-$(CONFIG_BOARD_8DEVICES_LIMA) += 8devices-lima/
+obj-$(CONFIG_BOARD_BLACK_SWIFT) += black-swift/
+obj-$(CONFIG_BOARD_CI20) += img-ci20/
+obj-$(CONFIG_BOARD_DLINK_DIR320) += dlink-dir-320/
+obj-$(CONFIG_BOARD_DPTECHNICS_DPT_MODULE) += dptechnics-dpt-module/
+obj-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) += loongson-ls1b/
+obj-$(CONFIG_BOARD_NETGEAR_WG102) += netgear-wg102/
+obj-$(CONFIG_BOARD_QEMU_MALTA) += qemu-malta/
+obj-$(CONFIG_BOARD_RZX50) += ritmix-rzx50/
+obj-$(CONFIG_BOARD_TPLINK_MR3020) += tplink-mr3020/
+obj-$(CONFIG_BOARD_TPLINK_WDR4300) += tplink-wdr4300/
diff --git a/arch/mips/boards/black-swift/Makefile b/arch/mips/boards/black-swift/Makefile
index dcfc2937d3..b08c4a93ca 100644
--- a/arch/mips/boards/black-swift/Makefile
+++ b/arch/mips/boards/black-swift/Makefile
@@ -1 +1 @@
-obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/black-swift/board.c b/arch/mips/boards/black-swift/board.c
deleted file mode 100644
index 2e2ed2075b..0000000000
--- a/arch/mips/boards/black-swift/board.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2015 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("black-swift");
-
- return 0;
-}
-postcore_initcall(model_hostname_init);
diff --git a/arch/mips/boards/black-swift/include/board/board_pbl_start.h b/arch/mips/boards/black-swift/include/board/board_pbl_start.h
deleted file mode 100644
index 4c2ab2ef0f..0000000000
--- a/arch/mips/boards/black-swift/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2013, 2015 Antony Pavlov <antonynpavlov@gmail.com>
- * Copyright (C) 2013 Oleksij Rempel <linux@rempel-privat.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 <asm/pbl_macros.h>
-#include <mach/pbl_macros.h>
-#include <asm/pbl_nmon.h>
-
- .macro board_pbl_start
- .set push
- .set noreorder
-
- mips_barebox_10h
-
- pbl_ar9331_wmac_enable
-
- hornet_mips24k_cp0_setup
-
- pbl_blt 0xbf000000 skip_pll_ram_config t8
-
- hornet_1_1_war
-
- pbl_ar9331_pll
- pbl_ar9331_ddr2_config
-
- /* Initialize caches... */
- mips_cache_reset
-
- /* ... and enable them */
- dcache_enable
-
-skip_pll_ram_config:
- pbl_ar9331_uart_enable
- debug_ll_ar9331_init
- mips_nmon
-
- /*
- * It is amazing but we have to enable MDIO on GPIO
- * to use GPIO27 for LED1.
- */
- pbl_ar9331_mdio_gpio_enable
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
diff --git a/arch/mips/boards/black-swift/lowlevel.S b/arch/mips/boards/black-swift/lowlevel.S
new file mode 100644
index 0000000000..104dd26d1c
--- /dev/null
+++ b/arch/mips/boards/black-swift/lowlevel.S
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2013, 2015 Antony Pavlov <antonynpavlov@gmail.com>
+ * Copyright (C) 2013 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#define BOARD_PBL_START start_black_swift
+
+#include <mach/debug_ll.h>
+#include <asm/pbl_macros.h>
+#include <asm/asm.h>
+#include <mach/pbl_macros.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_barebox_10h
+
+ pbl_ar9331_wmac_enable
+
+ hornet_mips24k_cp0_setup
+
+ pbl_blt 0xbf000000 skip_pll_ram_config t8
+
+ hornet_1_1_war
+
+ pbl_ar9331_pll
+ pbl_ar9331_ddr2_config
+
+ /* Initialize caches... */
+ mips_cache_reset
+
+ /* ... and enable them */
+ dcache_enable
+
+skip_pll_ram_config:
+ pbl_ar9331_uart_enable
+ debug_ll_ath79_init
+
+ /*
+ * It is amazing but we have to enable MDIO on GPIO
+ * to use GPIO27 for LED1.
+ */
+ pbl_ar9331_mdio_gpio_enable
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, black_swift)
diff --git a/arch/mips/boards/dlink-dir-320/Makefile b/arch/mips/boards/dlink-dir-320/Makefile
index dcfc2937d3..01c7a259e9 100644
--- a/arch/mips/boards/dlink-dir-320/Makefile
+++ b/arch/mips/boards/dlink-dir-320/Makefile
@@ -1 +1,2 @@
obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/dlink-dir-320/board.c b/arch/mips/boards/dlink-dir-320/board.c
index d00e4fab4b..b75812cefe 100644
--- a/arch/mips/boards/dlink-dir-320/board.c
+++ b/arch/mips/boards/dlink-dir-320/board.c
@@ -1,18 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2011, 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>
diff --git a/arch/mips/boards/dlink-dir-320/lowlevel.S b/arch/mips/boards/dlink-dir-320/lowlevel.S
new file mode 100644
index 0000000000..9f3bd5dead
--- /dev/null
+++ b/arch/mips/boards/dlink-dir-320/lowlevel.S
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright 2018 Oleksij Rempel <o.rempel@pengutronix.de>, Pengutronix
+ */
+
+#define BOARD_PBL_START start_dlink_dir_320
+
+#include <asm/asm.h>
+#include <asm/pbl_macros.h>
+#include <mach/debug_ll.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_barebox_10h
+
+ mips_disable_interrupts
+
+ /* CPU/SoC specific setup ... */
+ /* ... absent */
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, dlink_dir_320)
diff --git a/arch/mips/boards/dptechnics-dpt-module/Makefile b/arch/mips/boards/dptechnics-dpt-module/Makefile
new file mode 100644
index 0000000000..b08c4a93ca
--- /dev/null
+++ b/arch/mips/boards/dptechnics-dpt-module/Makefile
@@ -0,0 +1 @@
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/dptechnics-dpt-module/include/board/board_pbl_start.h b/arch/mips/boards/dptechnics-dpt-module/include/board/board_pbl_start.h
deleted file mode 100644
index 9d6b1b86bc..0000000000
--- a/arch/mips/boards/dptechnics-dpt-module/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2017 Oleksij Rempel <linux@rempel-privat.de>
- *
- * 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.
- */
-
-#include <asm/pbl_macros.h>
-#include <mach/pbl_macros.h>
-#include <asm/pbl_nmon.h>
-
- .macro board_pbl_start
- .set push
- .set noreorder
-
- ar9331_pbl_generic_start
-
- .set pop
- .endm
diff --git a/arch/mips/boards/dptechnics-dpt-module/lowlevel.S b/arch/mips/boards/dptechnics-dpt-module/lowlevel.S
new file mode 100644
index 0000000000..28b8f4fac7
--- /dev/null
+++ b/arch/mips/boards/dptechnics-dpt-module/lowlevel.S
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2017 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#define BOARD_PBL_START start_dptechnics_dpt_module
+
+#include <mach/debug_ll.h>
+#include <asm/regdef.h>
+#include <asm/mipsregs.h>
+#include <asm/asm.h>
+#include <asm/pbl_macros.h>
+#include <mach/pbl_macros.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ ar9331_pbl_generic_start
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, ar9331_dptechnics_dpt_module)
diff --git a/arch/mips/boards/img-ci20/Makefile b/arch/mips/boards/img-ci20/Makefile
index dcfc2937d3..b08c4a93ca 100644
--- a/arch/mips/boards/img-ci20/Makefile
+++ b/arch/mips/boards/img-ci20/Makefile
@@ -1 +1 @@
-obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/img-ci20/board.c b/arch/mips/boards/img-ci20/board.c
deleted file mode 100644
index 515ebaece6..0000000000
--- a/arch/mips/boards/img-ci20/board.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2012 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 ci20_hostname_init(void)
-{
- barebox_set_hostname("ci20");
-
- return 0;
-}
-console_initcall(ci20_hostname_init);
diff --git a/arch/mips/boards/img-ci20/include/board/board_pbl_start.h b/arch/mips/boards/img-ci20/include/board/board_pbl_start.h
deleted file mode 100644
index 42d23c82a9..0000000000
--- a/arch/mips/boards/img-ci20/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Startup Code for Imagination Creator CI20 board
- *
- * 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 <asm/pbl_macros.h>
-#include <mach/debug_ll.h>
-#include <asm/pbl_nmon.h>
-
- .macro board_pbl_start
- .set push
- .set noreorder
-
- mips_disable_interrupts
-
- /* CPU/SoC specific setup ... */
- /* ... absent */
-
- debug_ll_ns16550_init
-
- debug_ll_outc '.'
- debug_ll_ns16550_outnl
-
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
diff --git a/arch/mips/boards/img-ci20/include/board/debug_ll.h b/arch/mips/boards/img-ci20/include/board/debug_ll.h
deleted file mode 100644
index 72612cff2b..0000000000
--- a/arch/mips/boards/img-ci20/include/board/debug_ll.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.
- *
- */
-
-#ifndef __INCLUDE_CI20_BOARD_DEBUG_LL_H__
-#define __INCLUDE_CI20_BOARD_DEBUG_LL_H__
-
-#include <mach/debug_ll_jz4780.h>
-
-#endif /* __INCLUDE_CI20_BOARD_DEBUG_LL_H__ */
diff --git a/arch/mips/boards/img-ci20/lowlevel.S b/arch/mips/boards/img-ci20/lowlevel.S
new file mode 100644
index 0000000000..056df17bf8
--- /dev/null
+++ b/arch/mips/boards/img-ci20/lowlevel.S
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Startup Code for Imagination Creator CI20 board
+ *
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ */
+
+#define BOARD_PBL_START start_img_ci20
+
+#include <asm/pbl_macros.h>
+#include <mach/debug_ll.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_disable_interrupts
+
+ /* CPU/SoC specific setup ... */
+ /* ... absent */
+
+ debug_ll_ns16550_init
+
+ debug_ll_outc '.'
+ debug_ll_ns16550_outnl
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, img_ci20)
diff --git a/arch/mips/boards/loongson-ls1b/Makefile b/arch/mips/boards/loongson-ls1b/Makefile
index 31c062987f..b08c4a93ca 100644
--- a/arch/mips/boards/loongson-ls1b/Makefile
+++ b/arch/mips/boards/loongson-ls1b/Makefile
@@ -1 +1 @@
-obj-y += serial.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h b/arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h
deleted file mode 100644
index a3c585ecba..0000000000
--- a/arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 <asm/pbl_macros.h>
-#include <mach/loongson1.h>
-#include <mach/debug_ll.h>
-#include <asm/pbl_nmon.h>
-
- .macro board_pbl_start
- .set push
- .set noreorder
-
- mips_barebox_10h
-
- mips_disable_interrupts
-
- debug_ll_ns16550_init
-
- debug_ll_outc '.'
- debug_ll_ns16550_outnl
-
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
diff --git a/arch/mips/boards/loongson-ls1b/include/board/debug_ll.h b/arch/mips/boards/loongson-ls1b/include/board/debug_ll.h
index e60ce4cecd..05420f73a1 100644
--- a/arch/mips/boards/loongson-ls1b/include/board/debug_ll.h
+++ b/arch/mips/boards/loongson-ls1b/include/board/debug_ll.h
@@ -1,18 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* 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.
- *
*/
/** @file
diff --git a/arch/mips/boards/loongson-ls1b/lowlevel.S b/arch/mips/boards/loongson-ls1b/lowlevel.S
new file mode 100644
index 0000000000..37744e9fac
--- /dev/null
+++ b/arch/mips/boards/loongson-ls1b/lowlevel.S
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2014 Antony Pavlov <antonynpavlov@gmail.com>
+ */
+
+#define BOARD_PBL_START start_loongson_ls1b
+
+#include <asm/pbl_macros.h>
+#include <mach/loongson1.h>
+#include <mach/debug_ll.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_barebox_10h
+
+ mips_disable_interrupts
+
+ debug_ll_ns16550_init
+
+ debug_ll_outc '.'
+ debug_ll_ns16550_outnl
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, loongson_ls1b)
diff --git a/arch/mips/boards/loongson-ls1b/serial.c b/arch/mips/boards/loongson-ls1b/serial.c
deleted file mode 100644
index a9453ede28..0000000000
--- a/arch/mips/boards/loongson-ls1b/serial.c
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <common.h>
-#include <init.h>
-
-static int console_init(void)
-{
- barebox_set_hostname("ls1b");
-
- return 0;
-}
-console_initcall(console_init);
diff --git a/arch/mips/boards/netgear-wg102/Makefile b/arch/mips/boards/netgear-wg102/Makefile
index 0899b66c5f..344a6711b2 100644
--- a/arch/mips/boards/netgear-wg102/Makefile
+++ b/arch/mips/boards/netgear-wg102/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += ram.o
diff --git a/arch/mips/boards/netgear-wg102/include/board/debug_ll.h b/arch/mips/boards/netgear-wg102/include/board/debug_ll.h
index 2725032ba3..cc3b1d74b0 100644
--- a/arch/mips/boards/netgear-wg102/include/board/debug_ll.h
+++ b/arch/mips/boards/netgear-wg102/include/board/debug_ll.h
@@ -1,18 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2013 Oleksij Rempel <linux@rempel-privat.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.
- *
*/
/** @file
diff --git a/arch/mips/boards/netgear-wg102/include/board/board_pbl_start.h b/arch/mips/boards/netgear-wg102/lowlevel.S
index 9fb220519f..e48dded269 100644
--- a/arch/mips/boards/netgear-wg102/include/board/board_pbl_start.h
+++ b/arch/mips/boards/netgear-wg102/lowlevel.S
@@ -1,30 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2013 Antony Pavlov <antonynpavlov@gmail.com>
* Copyright (C) 2013 Oleksij Rempel <linux@rempel-privat.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.
- *
*/
+#define BOARD_PBL_START start_netgear_wg102
+
#include <asm/pbl_macros.h>
#include <mach/pbl_macros.h>
#include <mach/ar2312_regs.h>
#include <mach/debug_ll.h>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_barebox_10h
@@ -71,7 +59,15 @@ sdram_configured:
debug_ll_outc 'b'
debug_ll_ns16550_outnl
- copy_to_link_location pbl_start
+ copy_to_link_location BOARD_PBL_START;
+ stack_setup;
+
+ lw a0, 0;
+ la v0, pbl_main_entry;
+ jal v0;
+ nop;
- .set pop
- .endm
+ /* No return */
+__error:
+ b __error;
+ nop;
diff --git a/arch/mips/boards/qemu-malta/Makefile b/arch/mips/boards/qemu-malta/Makefile
index eb072c0161..b08c4a93ca 100644
--- a/arch/mips/boards/qemu-malta/Makefile
+++ b/arch/mips/boards/qemu-malta/Makefile
@@ -1 +1 @@
-obj-y += init.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/qemu-malta/include/board/debug_ll.h b/arch/mips/boards/qemu-malta/include/board/debug_ll.h
index abeee5345a..5b112b8ae2 100644
--- a/arch/mips/boards/qemu-malta/include/board/debug_ll.h
+++ b/arch/mips/boards/qemu-malta/include/board/debug_ll.h
@@ -1,18 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2013 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.
- *
*/
#ifndef __INCLUDE_BOARD_DEBUG_LL_QEMU_MALTA_H__
diff --git a/arch/mips/boards/qemu-malta/init.c b/arch/mips/boards/qemu-malta/init.c
deleted file mode 100644
index 24bfdc03ee..0000000000
--- a/arch/mips/boards/qemu-malta/init.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2011 Antony Pavlov <antonynpavlov@gmail.com>
- * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.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>
-#include <linux/sizes.h>
-
-static int malta_core_init(void)
-{
- barebox_set_hostname("malta");
-
- return 0;
-}
-core_initcall(malta_core_init);
diff --git a/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h b/arch/mips/boards/qemu-malta/lowlevel.S
index 5c1537262e..3861ae9e46 100644
--- a/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h
+++ b/arch/mips/boards/qemu-malta/lowlevel.S
@@ -1,22 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Startup Code for MIPS CPU
*
* Copyright (C) 2012 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.
- *
*/
+#define BOARD_PBL_START start_qemu_malta
+
+#include <asm/asm.h>
#include <asm/pbl_macros.h>
#include <asm/pbl_nmon.h>
@@ -39,10 +30,7 @@
#define GT_LD(x) (GT_CPU_TO_LE32(((x) >> 21) & 0x7fff))
#define GT_HD(x) (GT_CPU_TO_LE32(((x) >> 21) & 0x7f))
- .macro board_pbl_start
- .set push
- .set noreorder
-
+ENTRY_FUNCTION(BOARD_PBL_START)
b __start
nop
@@ -94,9 +82,4 @@ __start:
li t0, GT_LD(0x1bdfffff)
sw t0, GT_PCI0M1HD_OFS(t1)
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
+ENTRY_FUNCTION_END(BOARD_PBL_START, qemu_malta)
diff --git a/arch/mips/boards/ritmix-rzx50/Makefile b/arch/mips/boards/ritmix-rzx50/Makefile
index 31c062987f..b08c4a93ca 100644
--- a/arch/mips/boards/ritmix-rzx50/Makefile
+++ b/arch/mips/boards/ritmix-rzx50/Makefile
@@ -1 +1 @@
-obj-y += serial.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/ritmix-rzx50/include/board/board_pbl_start.h b/arch/mips/boards/ritmix-rzx50/include/board/board_pbl_start.h
deleted file mode 100644
index 7c2fa0bedc..0000000000
--- a/arch/mips/boards/ritmix-rzx50/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Startup Code for Ritmix RZX-50 board
- *
- * Copyright (C) 2013 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 <asm/pbl_macros.h>
-#include <mach/debug_ll.h>
-#include <asm/pbl_nmon.h>
-
- .macro board_pbl_start
- .set push
- .set noreorder
-
- mips_disable_interrupts
-
- /* CPU/SoC specific setup ... */
- /* ... absent */
-
- debug_ll_ns16550_init
-
- debug_ll_outc '.'
- debug_ll_ns16550_outnl
-
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
diff --git a/arch/mips/boards/ritmix-rzx50/include/board/debug_ll.h b/arch/mips/boards/ritmix-rzx50/include/board/debug_ll.h
deleted file mode 100644
index 7ae0e2a4fd..0000000000
--- a/arch/mips/boards/ritmix-rzx50/include/board/debug_ll.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- *
- */
-
-#ifndef __INCLUDE_RZX50_BOARD_DEBUG_LL_H__
-#define __INCLUDE_RZX50_BOARD_DEBUG_LL_H__
-
-#include <mach/debug_ll_jz4750d.h>
-
-#endif /* __INCLUDE_RZX50_BOARD_DEBUG_LL_H__ */
diff --git a/arch/mips/boards/ritmix-rzx50/lowlevel.S b/arch/mips/boards/ritmix-rzx50/lowlevel.S
new file mode 100644
index 0000000000..7a9743835e
--- /dev/null
+++ b/arch/mips/boards/ritmix-rzx50/lowlevel.S
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Startup Code for Ritmix RZX-50 board
+ *
+ * Copyright (C) 2013 Antony Pavlov <antonynpavlov@gmail.com>
+ */
+
+#define BOARD_PBL_START start_ritmix_rzx50
+
+#include <asm/pbl_macros.h>
+#include <mach/debug_ll.h>
+#include <asm/pbl_nmon.h>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_disable_interrupts
+
+ /* CPU/SoC specific setup ... */
+ /* ... absent */
+
+ debug_ll_ns16550_init
+
+ debug_ll_outc '.'
+ debug_ll_ns16550_outnl
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, rzx50)
diff --git a/arch/mips/boards/ritmix-rzx50/serial.c b/arch/mips/boards/ritmix-rzx50/serial.c
deleted file mode 100644
index f1e8da0072..0000000000
--- a/arch/mips/boards/ritmix-rzx50/serial.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2012 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 rzx50_hostname_init(void)
-{
- barebox_set_hostname("rzx50");
-
- return 0;
-}
-console_initcall(rzx50_hostname_init);
diff --git a/arch/mips/boards/tplink-mr3020/Makefile b/arch/mips/boards/tplink-mr3020/Makefile
index dcfc2937d3..b08c4a93ca 100644
--- a/arch/mips/boards/tplink-mr3020/Makefile
+++ b/arch/mips/boards/tplink-mr3020/Makefile
@@ -1 +1 @@
-obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/tplink-mr3020/board.c b/arch/mips/boards/tplink-mr3020/board.c
deleted file mode 100644
index 318998cc49..0000000000
--- a/arch/mips/boards/tplink-mr3020/board.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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("mr3020");
-
- return 0;
-}
-postcore_initcall(model_hostname_init);
diff --git a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h b/arch/mips/boards/tplink-mr3020/lowlevel.S
index e70f55e873..e3e6a61b78 100644
--- a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
+++ b/arch/mips/boards/tplink-mr3020/lowlevel.S
@@ -1,28 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2013, 2015 Antony Pavlov <antonynpavlov@gmail.com>
* Copyright (C) 2013 Oleksij Rempel <linux@rempel-privat.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.
- *
*/
+#define BOARD_PBL_START start_tplink_mr3020
+
+#include <mach/debug_ll.h>
#include <asm/pbl_macros.h>
+#include <asm/asm.h>
#include <mach/pbl_macros.h>
#include <asm/pbl_nmon.h>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_barebox_10h
@@ -45,8 +35,7 @@
skip_pll_ram_config:
pbl_ar9331_uart_enable
- debug_ll_ar9331_init
- mips_nmon
+ debug_ll_ath79_init
/*
* It is amazing but we have to enable MDIO on GPIO
@@ -54,7 +43,4 @@ skip_pll_ram_config:
*/
pbl_ar9331_mdio_gpio_enable
- copy_to_link_location pbl_start
-
- .set pop
- .endm
+ENTRY_FUNCTION_END(BOARD_PBL_START, tplink_mr3020)
diff --git a/arch/mips/boards/tplink-wdr4300/Makefile b/arch/mips/boards/tplink-wdr4300/Makefile
index dcfc2937d3..b08c4a93ca 100644
--- a/arch/mips/boards/tplink-wdr4300/Makefile
+++ b/arch/mips/boards/tplink-wdr4300/Makefile
@@ -1 +1 @@
-obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/mips/boards/tplink-wdr4300/board.c b/arch/mips/boards/tplink-wdr4300/board.c
deleted file mode 100644
index d6126fcb6d..0000000000
--- a/arch/mips/boards/tplink-wdr4300/board.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 7d4ee4baba..0000000000
--- a/arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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
diff --git a/arch/mips/boards/tplink-wdr4300/lowlevel.S b/arch/mips/boards/tplink-wdr4300/lowlevel.S
new file mode 100644
index 0000000000..461b257f41
--- /dev/null
+++ b/arch/mips/boards/tplink-wdr4300/lowlevel.S
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2017 Oleksij Rempel <o.rempel@pengutronix.de>
+ */
+
+#define BOARD_PBL_START start_tplink_wdr4300
+
+#include <mach/debug_ll.h>
+#include <asm/asm.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>
+
+ENTRY_FUNCTION(BOARD_PBL_START)
+
+ mips_barebox_10h
+
+ debug_ll_ath79_init
+
+ hornet_mips24k_cp0_setup
+
+ /* test if we are in the SRAM */
+ pbl_blt 0xbd000000 1f t8
+ b skip_flash_test
+ nop
+1:
+ /* test if we are in the flash */
+ pbl_blt 0xbf000000 skip_pll_ram_config t8
+skip_flash_test:
+
+ pbl_ar9344_v11_pll_config
+
+ pbl_ar9344_v11_ddr2_config
+
+skip_pll_ram_config:
+
+ENTRY_FUNCTION_END(BOARD_PBL_START, ar9344_tl_wdr4300_v1.7)