summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-02-13 20:31:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-02-13 20:31:47 +0100
commita5f75fe8175aefec5b7cefaadc5359096c8eb22c (patch)
treeb97a1d4ec52db336bb914aafcb03f8570fb42725
parent314ad8e28161be580af1271bdaf05a4c6e7f6bd1 (diff)
parenta1e0b63ac1bddb330c74cde950a0ed5a47cbd954 (diff)
downloadbarebox-a5f75fe8175aefec5b7cefaadc5359096c8eb22c.tar.gz
barebox-a5f75fe8175aefec5b7cefaadc5359096c8eb22c.tar.xz
Merge branch 'for-next/mips'
-rw-r--r--arch/mips/boards/black-swift/lowlevel.S29
-rw-r--r--arch/mips/boards/tplink-mr3020/lowlevel.S29
-rw-r--r--arch/mips/configs/ath79_defconfig1
-rw-r--r--arch/mips/configs/qemu-malta_defconfig1
-rw-r--r--arch/mips/include/asm/asm.h20
-rw-r--r--arch/mips/lib/Makefile1
-rw-r--r--arch/mips/lib/end.S16
-rw-r--r--arch/mips/mach-ath79/Makefile3
-rw-r--r--arch/mips/mach-ath79/include/mach/pbl_macros.h21
-rw-r--r--arch/mips/mach-ath79/lowlevel_ar9331_spi_trap.S18
-rw-r--r--arch/mips/mach-ath79/lowlevel_ar9331_sram.S18
-rw-r--r--arch/mips/mach-malta/Kconfig8
-rw-r--r--images/Makefile.ath798
13 files changed, 107 insertions, 66 deletions
diff --git a/arch/mips/boards/black-swift/lowlevel.S b/arch/mips/boards/black-swift/lowlevel.S
index 104dd26d1c..0ba77435f8 100644
--- a/arch/mips/boards/black-swift/lowlevel.S
+++ b/arch/mips/boards/black-swift/lowlevel.S
@@ -14,33 +14,6 @@
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
+ ar9331_pbl_generic_start
ENTRY_FUNCTION_END(BOARD_PBL_START, black_swift)
diff --git a/arch/mips/boards/tplink-mr3020/lowlevel.S b/arch/mips/boards/tplink-mr3020/lowlevel.S
index e3e6a61b78..0a1c193c1e 100644
--- a/arch/mips/boards/tplink-mr3020/lowlevel.S
+++ b/arch/mips/boards/tplink-mr3020/lowlevel.S
@@ -14,33 +14,6 @@
ENTRY_FUNCTION(BOARD_PBL_START)
- mips_barebox_10h
-
- pbl_blt 0xbf000000 skip_pll_ram_config t8
-
- hornet_mips24k_cp0_setup
-
- pbl_ar9331_wmac_enable
-
- hornet_1_1_war
-
- pbl_ar9331_pll
- pbl_ar9331_ddr1_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 GPIO26 for the "WPS" LED and GPIO27 for the "3G" LED.
- */
- pbl_ar9331_mdio_gpio_enable
+ ar9331_pbl_generic_start
ENTRY_FUNCTION_END(BOARD_PBL_START, tplink_mr3020)
diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig
index 781786bc52..8d7d5a1722 100644
--- a/arch/mips/configs/ath79_defconfig
+++ b/arch/mips/configs/ath79_defconfig
@@ -1,5 +1,4 @@
CONFIG_MACH_MIPS_ATH79=y
-CONFIG_MIPS_ATH79_MULTI_BOARDS=y
CONFIG_BOARD_8DEVICES_LIMA=y
CONFIG_BOARD_DPTECHNICS_DPT_MODULE=y
CONFIG_BOARD_TPLINK_MR3020=y
diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index 1314783e02..69c7b0b10a 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -1,4 +1,3 @@
-CONFIG_MIPS_MALTA_MULTI_BOARDS=y
CONFIG_BOARD_QEMU_MALTA=y
CONFIG_IMAGE_COMPRESSION_XZKERN=y
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x400000
diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h
index 7a23f4ed82..7d2b673bd9 100644
--- a/arch/mips/include/asm/asm.h
+++ b/arch/mips/include/asm/asm.h
@@ -106,6 +106,26 @@ __error: \
nop;
/*
+ * STOP_WITH_DEBUG_EVENT - Stop code execution by triggering
+ * Software Debug Breakpoint. It is needed stop CPU and
+ * notify debugger (for example OpenOCD) about break point event.
+ * It should allow to simplify bootstrapping a system over JTAG.
+ */
+#define STOP_WITH_DEBUG_EVENT \
+ /* trigger a soft breakpoint for OpenOCD */ \
+ SDBBP; \
+ /* position independent variant of dead loop */ \
+ __error: \
+ b __error; \
+ nop; \
+ /* Call some code from .text section. \
+ * It is needed to keep same linker script for \
+ * all images. */ \
+ la v0, mips_dead_end; \
+ jal v0; \
+ nop;
+
+/*
* FEXPORT - export definition of a function symbol
*/
#define FEXPORT(symbol) \
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 1a049c7914..7372e8dc27 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -1,6 +1,7 @@
extra-$(CONFIG_GENERIC_LINKER_SCRIPT) += barebox.lds
obj-$(CONFIG_CSRC_R4K_LIB) += csrc-r4k.o
obj-y += cpu-probe.o
+lwl-y += end.o
obj-y += traps.o
obj-y += genex.o
obj-y += shutdown.o
diff --git a/arch/mips/lib/end.S b/arch/mips/lib/end.S
new file mode 100644
index 0000000000..78bd15ec17
--- /dev/null
+++ b/arch/mips/lib/end.S
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2018 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#include <asm/asm.h>
+#include <asm/regdef.h>
+
+ .text
+ .set noreorder
+LEAF(mips_dead_end)
+__error:
+ b __error;
+ nop;
+
+ END(mips_dead_end)
diff --git a/arch/mips/mach-ath79/Makefile b/arch/mips/mach-ath79/Makefile
index b827b363cf..396df66bf1 100644
--- a/arch/mips/mach-ath79/Makefile
+++ b/arch/mips/mach-ath79/Makefile
@@ -1,3 +1,6 @@
+lwl-y += lowlevel_ar9331_spi_trap.o
+lwl-y += lowlevel_ar9331_sram.o
+
obj-y += reset.o
obj-y += bbu.o
obj-y += art.o
diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
index 70736b3680..c5f3d4150e 100644
--- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
+++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
@@ -400,4 +400,25 @@ skip_pll_ram_config:
.set pop
.endm
+ .macro ar9331_pbl_generic_sram_start
+ .set push
+ .set noreorder
+
+ mips_barebox_10h
+
+ hornet_mips24k_cp0_setup
+
+ hornet_1_1_war
+
+ pbl_ar9331_pll
+ pbl_ar9331_ram_generic_config
+
+ pbl_ar9331_uart_enable
+ debug_ll_ath79_init
+
+ pbl_ar9331_mdio_gpio_enable
+
+ .set pop
+ .endm
+
#endif /* __ASM_MACH_ATH79_PBL_MACROS_H */
diff --git a/arch/mips/mach-ath79/lowlevel_ar9331_spi_trap.S b/arch/mips/mach-ath79/lowlevel_ar9331_spi_trap.S
new file mode 100644
index 0000000000..82452c74ca
--- /dev/null
+++ b/arch/mips/mach-ath79/lowlevel_ar9331_spi_trap.S
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2018 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#define BOARD_PBL_START start_ar9331_spi_trap
+
+#include <mach/debug_ll.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)
+
+ /* nothing should be done here */
+
+STOP_WITH_DEBUG_EVENT
diff --git a/arch/mips/mach-ath79/lowlevel_ar9331_sram.S b/arch/mips/mach-ath79/lowlevel_ar9331_sram.S
new file mode 100644
index 0000000000..1ef40be905
--- /dev/null
+++ b/arch/mips/mach-ath79/lowlevel_ar9331_sram.S
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2018 Oleksij Rempel <linux@rempel-privat.de>
+ */
+
+#define BOARD_PBL_START start_ar9331_sram
+
+#include <mach/debug_ll.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_sram_start
+
+STOP_WITH_DEBUG_EVENT
diff --git a/arch/mips/mach-malta/Kconfig b/arch/mips/mach-malta/Kconfig
index dab0a7cd2f..70799808f9 100644
--- a/arch/mips/mach-malta/Kconfig
+++ b/arch/mips/mach-malta/Kconfig
@@ -4,18 +4,10 @@ config ARCH_TEXT_BASE
hex
default 0xa0800000
-config MIPS_MALTA_MULTI_BOARDS
- bool "Allow multiple boards to be selected"
- select HAVE_PBL_MULTI_IMAGES
-
-if MIPS_MALTA_MULTI_BOARDS
-
config BOARD_QEMU_MALTA
bool "qemu malta"
select HAVE_PBL_IMAGE
select HAVE_IMAGE_COMPRESSION
select HAS_NMON
-endif # MIPS_MALTA_MULTI_BOARDS
-
endif
diff --git a/images/Makefile.ath79 b/images/Makefile.ath79
index c7e97f0ac3..5dda411d8f 100644
--- a/images/Makefile.ath79
+++ b/images/Makefile.ath79
@@ -1,3 +1,11 @@
+pblb-$(CONFIG_SOC_QCA_AR9331) += start_ar9331_spi_trap
+FILE_barebox-ar9331-spi-trap.img = start_ar9331_spi_trap.pblb
+image-$(CONFIG_SOC_QCA_AR9331) += barebox-ar9331-spi-trap.img
+
+pblb-$(CONFIG_SOC_QCA_AR9331) += start_ar9331_sram
+FILE_barebox-ar9331-sram.img = start_ar9331_sram.pblb
+image-$(CONFIG_SOC_QCA_AR9331) += barebox-ar9331-sram.img
+
pblb-$(CONFIG_BOARD_8DEVICES_LIMA) += start_8devices_lima
FILE_barebox-8devices-lima.img = start_8devices_lima.pblb
image-$(CONFIG_BOARD_8DEVICES_LIMA) += barebox-8devices-lima.img