summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2018-11-27 10:19:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-12-17 12:15:43 +0100
commit102676feb218ab590609d326af433913728d14ab (patch)
tree9689211ce0a64bbee975cf839816482f59832bae /arch
parente2ea356a696502f717689a57293e79e18cddb4f2 (diff)
downloadbarebox-102676feb218ab590609d326af433913728d14ab.tar.gz
barebox-102676feb218ab590609d326af433913728d14ab.tar.xz
MIPS: port all mach* to multiimage
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/Kconfig7
-rw-r--r--arch/mips/Makefile29
-rw-r--r--arch/mips/boards/8devices-lima/Makefile1
-rw-r--r--arch/mips/boards/8devices-lima/lowlevel.S (renamed from arch/mips/boards/8devices-lima/include/board/board_pbl_start.h)26
-rw-r--r--arch/mips/boards/Makefile11
-rw-r--r--arch/mips/boards/black-swift/Makefile1
-rw-r--r--arch/mips/boards/black-swift/lowlevel.S (renamed from arch/mips/boards/black-swift/include/board/board_pbl_start.h)16
-rw-r--r--arch/mips/boards/dlink-dir-320/Makefile1
-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/lowlevel.S (renamed from arch/mips/boards/dptechnics-dpt-module/include/board/board_pbl_start.h)13
-rw-r--r--arch/mips/boards/img-ci20/Makefile1
-rw-r--r--arch/mips/boards/img-ci20/include/board/debug_ll.h23
-rw-r--r--arch/mips/boards/img-ci20/lowlevel.S (renamed from arch/mips/boards/img-ci20/include/board/board_pbl_start.h)13
-rw-r--r--arch/mips/boards/loongson-ls1b/Makefile1
-rw-r--r--arch/mips/boards/loongson-ls1b/lowlevel.S (renamed from arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h)13
-rw-r--r--arch/mips/boards/netgear-wg102/Makefile1
-rw-r--r--arch/mips/boards/netgear-wg102/lowlevel.S (renamed from arch/mips/boards/netgear-wg102/include/board/board_pbl_start.h)20
-rw-r--r--arch/mips/boards/qemu-malta/Makefile1
-rw-r--r--arch/mips/boards/qemu-malta/lowlevel.S (renamed from arch/mips/boards/qemu-malta/include/board/board_pbl_start.h)15
-rw-r--r--arch/mips/boards/ritmix-rzx50/Makefile1
-rw-r--r--arch/mips/boards/ritmix-rzx50/include/board/debug_ll.h23
-rw-r--r--arch/mips/boards/ritmix-rzx50/lowlevel.S (renamed from arch/mips/boards/ritmix-rzx50/include/board/board_pbl_start.h)13
-rw-r--r--arch/mips/boards/tplink-mr3020/Makefile1
-rw-r--r--arch/mips/boards/tplink-mr3020/lowlevel.S (renamed from arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h)16
-rw-r--r--arch/mips/boards/tplink-wdr4300/Makefile1
-rw-r--r--arch/mips/boards/tplink-wdr4300/lowlevel.S (renamed from arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h)26
-rw-r--r--arch/mips/boot/Makefile2
-rw-r--r--arch/mips/boot/start-pbl.S44
-rw-r--r--arch/mips/configs/8devices-lima_defconfig83
-rw-r--r--arch/mips/configs/ath79_defconfig (renamed from arch/mips/configs/tplink-mr3020_defconfig)9
-rw-r--r--arch/mips/configs/bcm47xx_defconfig (renamed from arch/mips/configs/dlink-dir-320_defconfig)4
-rw-r--r--arch/mips/configs/black-swift_defconfig54
-rw-r--r--arch/mips/configs/dptechnics-dpt-module_defconfig89
-rw-r--r--arch/mips/configs/img-ci20_defconfig45
-rw-r--r--arch/mips/configs/qemu-malta_defconfig12
-rw-r--r--arch/mips/configs/tplink-wdr4300_defconfig82
-rw-r--r--arch/mips/configs/xburst_defconfig (renamed from arch/mips/configs/ritmix-rzx50_defconfig)8
-rw-r--r--arch/mips/dts/Makefile16
-rw-r--r--arch/mips/mach-ar231x/include/mach/debug_ll.h1
-rw-r--r--arch/mips/mach-ath79/Kconfig14
-rw-r--r--arch/mips/mach-ath79/include/mach/debug_ll.h12
-rw-r--r--arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h2
-rw-r--r--arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h4
-rw-r--r--arch/mips/mach-ath79/include/mach/pbl_macros.h5
-rw-r--r--arch/mips/mach-bcm47xx/include/mach/debug_ll.h1
-rw-r--r--arch/mips/mach-loongson/include/mach/debug_ll.h1
-rw-r--r--arch/mips/mach-malta/Kconfig9
-rw-r--r--arch/mips/mach-malta/include/mach/debug_ll.h10
-rw-r--r--arch/mips/mach-xburst/Kconfig14
-rw-r--r--arch/mips/mach-xburst/include/mach/debug_ll.h14
51 files changed, 219 insertions, 613 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 7c40991cab..72d84177d4 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -9,6 +9,7 @@ config MIPS
select HAS_KALLSYMS
select HAVE_CONFIGURABLE_MEMORY_LAYOUT
select HAVE_CONFIGURABLE_TEXT_BASE
+ select HAVE_PBL_MULTI_IMAGES
select HAS_DMA
select ELF
default y
@@ -58,6 +59,8 @@ config MACH_MIPS_MALTA
select HAS_DEBUG_LL
select GPIOLIB
select HW_HAS_PCI
+ select HAVE_PBL_IMAGE
+ select HAVE_IMAGE_COMPRESSION
config MACH_MIPS_AR231X
bool "Atheros ar231x-based boards"
@@ -67,6 +70,7 @@ config MACH_MIPS_AR231X
select CSRC_R4K_LIB
select DRIVER_SERIAL_NS16550
select HAS_DEBUG_LL
+ select HAVE_IMAGE_COMPRESSION
config MACH_MIPS_ATH79
bool "Atheros AR71XX/AR724X/AR913X/AR933X based boards"
@@ -89,6 +93,9 @@ config MACH_MIPS_BCM47XX
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_LITTLE_ENDIAN
select HAS_DEBUG_LL
+ select HAVE_IMAGE_COMPRESSION
+ select HAVE_PBL_IMAGE
+ select HAS_NMON
config MACH_MIPS_LOONGSON
bool "Loongson-based boards"
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 6338dc174d..80ce382cc9 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -41,6 +41,7 @@ ldflags-y += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL )
endif
LDFLAGS += $(ldflags-y) -m $(ld-emul)
+LDFLAGS_barebox += $(ldflags-y)
#
# CPU-dependent compiler/assembler options for optimization.
@@ -73,28 +74,11 @@ endif
LDFLAGS_barebox += -nostdlib
machine-$(CONFIG_MACH_MIPS_MALTA) := malta
-board-$(CONFIG_BOARD_QEMU_MALTA) := qemu-malta
-
machine-$(CONFIG_MACH_MIPS_AR231X) := ar231x
-board-$(CONFIG_BOARD_NETGEAR_WG102) := netgear-wg102
-
machine-$(CONFIG_MACH_MIPS_ATH79) := ath79
-board-$(CONFIG_BOARD_8DEVICES_LIMA) := 8devices-lima
-board-$(CONFIG_BOARD_DPTECHNICS_DPT_MODULE) := dptechnics-dpt-module
-board-$(CONFIG_BOARD_TPLINK_MR3020) := tplink-mr3020
-board-$(CONFIG_BOARD_TPLINK_WDR4300) := tplink-wdr4300
-board-$(CONFIG_BOARD_BLACK_SWIFT) := black-swift
-
machine-$(CONFIG_MACH_MIPS_BCM47XX) := bcm47xx
-board-$(CONFIG_BOARD_DLINK_DIR320) := dlink-dir-320
-
machine-$(CONFIG_MACH_MIPS_LOONGSON) := loongson
-board-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) := loongson-ls1b
-
machine-$(CONFIG_MACH_MIPS_XBURST) := xburst
-board-$(CONFIG_BOARD_RZX50) := ritmix-rzx50
-board-$(CONFIG_BOARD_CI20) := img-ci20
-
machdirs := $(patsubst %,arch/mips/mach-%/,$(machine-y))
ifeq ($(KBUILD_SRC),)
@@ -108,12 +92,6 @@ incdir-y := $(machine-y)
endif
INCDIR := arch-$(incdir-y)
-ifneq ($(board-y),)
-BOARD := arch/mips/boards/$(board-y)/
-else
-BOARD :=
-endif
-
ifeq ($(KBUILD_SRC),)
CPPFLAGS += -I$(BOARD)/include
else
@@ -133,8 +111,7 @@ endif
common-y += $(MACH)
common-y += arch/mips/lib/
common-y += arch/mips/boot/
-
-common-$(CONFIG_BUILTIN_DTB) += arch/mips/dts/
+common-y += arch/mips/boards/
CPPFLAGS += $(cflags-y)
CFLAGS += $(cflags-y)
@@ -155,4 +132,6 @@ dts := arch/mips/dts
%.dtb: scripts
$(Q)$(MAKE) $(build)=$(dts) $(dts)/$@
+common-$(CONFIG_OFTREE) += arch/mips/dts/
+
KBUILD_IMAGE ?= $(KBUILD_BINARY)
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/lowlevel.S
index e95aa49256..a619747f39 100644
--- a/arch/mips/boards/8devices-lima/include/board/board_pbl_start.h
+++ b/arch/mips/boards/8devices-lima/lowlevel.S
@@ -15,51 +15,39 @@
*
*/
-#include <mach/debug_ll_ar9344.h>
+#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>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_barebox_10h
- debug_ll_ar9344_init
-
- debug_ll_outc '1'
+ debug_ll_ath79_init
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
+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..092c31d6b2 100644
--- a/arch/mips/boards/black-swift/Makefile
+++ b/arch/mips/boards/black-swift/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += board.o
diff --git a/arch/mips/boards/black-swift/include/board/board_pbl_start.h b/arch/mips/boards/black-swift/lowlevel.S
index 4c2ab2ef0f..3a9e780db8 100644
--- a/arch/mips/boards/black-swift/include/board/board_pbl_start.h
+++ b/arch/mips/boards/black-swift/lowlevel.S
@@ -16,13 +16,15 @@
*
*/
+#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>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_barebox_10h
@@ -45,8 +47,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 +55,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, 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/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/lowlevel.S
index 9d6b1b86bc..6601427ba4 100644
--- a/arch/mips/boards/dptechnics-dpt-module/include/board/board_pbl_start.h
+++ b/arch/mips/boards/dptechnics-dpt-module/lowlevel.S
@@ -6,15 +6,18 @@
* as published by the Free Software Foundation.
*/
+#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>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
ar9331_pbl_generic_start
- .set pop
- .endm
+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..092c31d6b2 100644
--- a/arch/mips/boards/img-ci20/Makefile
+++ b/arch/mips/boards/img-ci20/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += board.o
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/include/board/board_pbl_start.h b/arch/mips/boards/img-ci20/lowlevel.S
index 42d23c82a9..ad3c851e05 100644
--- a/arch/mips/boards/img-ci20/include/board/board_pbl_start.h
+++ b/arch/mips/boards/img-ci20/lowlevel.S
@@ -17,13 +17,13 @@
*
*/
+#define BOARD_PBL_START start_img_ci20
+
#include <asm/pbl_macros.h>
#include <mach/debug_ll.h>
#include <asm/pbl_nmon.h>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_disable_interrupts
@@ -35,9 +35,4 @@
debug_ll_outc '.'
debug_ll_ns16550_outnl
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
+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..ded9867a8e 100644
--- a/arch/mips/boards/loongson-ls1b/Makefile
+++ b/arch/mips/boards/loongson-ls1b/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += serial.o
diff --git a/arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h b/arch/mips/boards/loongson-ls1b/lowlevel.S
index a3c585ecba..d17a0f79d4 100644
--- a/arch/mips/boards/loongson-ls1b/include/board/board_pbl_start.h
+++ b/arch/mips/boards/loongson-ls1b/lowlevel.S
@@ -15,14 +15,14 @@
*
*/
+#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>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_barebox_10h
@@ -33,9 +33,4 @@
debug_ll_outc '.'
debug_ll_ns16550_outnl
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
+ENTRY_FUNCTION_END(BOARD_PBL_START, loongson_ls1b)
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/board_pbl_start.h b/arch/mips/boards/netgear-wg102/lowlevel.S
index 9fb220519f..f449d4e051 100644
--- a/arch/mips/boards/netgear-wg102/include/board/board_pbl_start.h
+++ b/arch/mips/boards/netgear-wg102/lowlevel.S
@@ -16,15 +16,15 @@
*
*/
+#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 +71,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..237a6a5079 100644
--- a/arch/mips/boards/qemu-malta/Makefile
+++ b/arch/mips/boards/qemu-malta/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += init.o
diff --git a/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h b/arch/mips/boards/qemu-malta/lowlevel.S
index 5c1537262e..e6d57bcffa 100644
--- a/arch/mips/boards/qemu-malta/include/board/board_pbl_start.h
+++ b/arch/mips/boards/qemu-malta/lowlevel.S
@@ -17,6 +17,9 @@
*
*/
+#define BOARD_PBL_START start_qemu_malta
+
+#include <asm/asm.h>
#include <asm/pbl_macros.h>
#include <asm/pbl_nmon.h>
@@ -39,10 +42,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 +94,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..ded9867a8e 100644
--- a/arch/mips/boards/ritmix-rzx50/Makefile
+++ b/arch/mips/boards/ritmix-rzx50/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += serial.o
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/include/board/board_pbl_start.h b/arch/mips/boards/ritmix-rzx50/lowlevel.S
index 7c2fa0bedc..b669963ca6 100644
--- a/arch/mips/boards/ritmix-rzx50/include/board/board_pbl_start.h
+++ b/arch/mips/boards/ritmix-rzx50/lowlevel.S
@@ -17,13 +17,13 @@
*
*/
+#define BOARD_PBL_START start_ritmix_rzx50
+
#include <asm/pbl_macros.h>
#include <mach/debug_ll.h>
#include <asm/pbl_nmon.h>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_disable_interrupts
@@ -35,9 +35,4 @@
debug_ll_outc '.'
debug_ll_ns16550_outnl
- mips_nmon
-
- copy_to_link_location pbl_start
-
- .set pop
- .endm
+ENTRY_FUNCTION_END(BOARD_PBL_START, rzx50)
diff --git a/arch/mips/boards/tplink-mr3020/Makefile b/arch/mips/boards/tplink-mr3020/Makefile
index dcfc2937d3..092c31d6b2 100644
--- a/arch/mips/boards/tplink-mr3020/Makefile
+++ b/arch/mips/boards/tplink-mr3020/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += board.o
diff --git a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h b/arch/mips/boards/tplink-mr3020/lowlevel.S
index e70f55e873..1efcbaa69a 100644
--- a/arch/mips/boards/tplink-mr3020/include/board/board_pbl_start.h
+++ b/arch/mips/boards/tplink-mr3020/lowlevel.S
@@ -16,13 +16,15 @@
*
*/
+#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 +47,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 +55,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..092c31d6b2 100644
--- a/arch/mips/boards/tplink-wdr4300/Makefile
+++ b/arch/mips/boards/tplink-wdr4300/Makefile
@@ -1 +1,2 @@
+lwl-y += lowlevel.o
obj-y += board.o
diff --git a/arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h b/arch/mips/boards/tplink-wdr4300/lowlevel.S
index 7d4ee4baba..9c4e6b7fad 100644
--- a/arch/mips/boards/tplink-wdr4300/include/board/board_pbl_start.h
+++ b/arch/mips/boards/tplink-wdr4300/lowlevel.S
@@ -15,48 +15,36 @@
*
*/
-#include <mach/debug_ll_ar9344.h>
+#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>
- .macro board_pbl_start
- .set push
- .set noreorder
+ENTRY_FUNCTION(BOARD_PBL_START)
mips_barebox_10h
- debug_ll_ar9344_init
-
- debug_ll_outc '1'
+ debug_ll_ath79_init
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
+ENTRY_FUNCTION_END(BOARD_PBL_START, ar9344_tl_wdr4300_v1.7)
diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile
index d59b247910..3d46e836f7 100644
--- a/arch/mips/boot/Makefile
+++ b/arch/mips/boot/Makefile
@@ -3,4 +3,4 @@ obj-y += main_entry.o
obj-$(CONFIG_OFDEVICE) += dtb.o
-pbl-y += start-pbl.o main_entry-pbl.o
+pbl-y += main_entry-pbl.o
diff --git a/arch/mips/boot/start-pbl.S b/arch/mips/boot/start-pbl.S
deleted file mode 100644
index d6e8231a73..0000000000
--- a/arch/mips/boot/start-pbl.S
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Startup Code for MIPS CPU
- *
- * Copyright (C) 2011, 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 <asm/regdef.h>
-#include <asm/mipsregs.h>
-#include <asm/asm.h>
-
-#include <asm/pbl_macros.h>
-#include <board/board_pbl_start.h>
-
- .set noreorder
- .section ".text_head_entry"
- .align 4
-
-EXPORT(pbl_start)
-
- board_pbl_start
-
- stack_setup
-
- la v0, pbl_main_entry
- jal v0
- nop
-
- /* No return */
-__error:
- b __error
- nop
diff --git a/arch/mips/configs/8devices-lima_defconfig b/arch/mips/configs/8devices-lima_defconfig
deleted file mode 100644
index 446369a544..0000000000
--- a/arch/mips/configs/8devices-lima_defconfig
+++ /dev/null
@@ -1,83 +0,0 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="qca4531-8devices-lima"
-CONFIG_MACH_MIPS_ATH79=y
-CONFIG_PBL_IMAGE=y
-CONFIG_IMAGE_COMPRESSION_XZKERN=y
-CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x81000000
-CONFIG_MALLOC_TLSF=y
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_CONSOLE_RATP=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_CMD_DMESG=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_IOMEM=y
-CONFIG_CMD_IMD=y
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_LOADY=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_DEFAULTENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_MAGICVAR=y
-CONFIG_CMD_MAGICVAR_HELP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_LET=y
-CONFIG_CMD_MSLEEP=y
-CONFIG_CMD_READF=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_HOST=y
-CONFIG_CMD_MIITOOL=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_MEMTEST=y
-CONFIG_CMD_MM=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_DETECT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_POWEROFF=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_BAREBOX_UPDATE=y
-CONFIG_CMD_OF_NODE=y
-CONFIG_CMD_OF_PROPERTY=y
-CONFIG_CMD_OFTREE=y
-CONFIG_CMD_TIME=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_SNTP=y
-CONFIG_OFDEVICE=y
-CONFIG_OF_BAREBOX_DRIVERS=y
-CONFIG_OF_BAREBOX_ENV_IN_FS=y
-CONFIG_DRIVER_SERIAL_NS16550=y
-CONFIG_DRIVER_NET_AG71XX=y
-CONFIG_AR8327N_PHY=y
-CONFIG_MDIO_BITBANG=y
-CONFIG_MDIO_GPIO=y
-CONFIG_DRIVER_SPI_ATH79=y
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_MTD_M25P80=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_GPIO_OF=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
-CONFIG_FS_NFS=y
-CONFIG_FS_RATP=y
-CONFIG_DIGEST_SHA224_GENERIC=y
-CONFIG_DIGEST_SHA256_GENERIC=y
diff --git a/arch/mips/configs/tplink-mr3020_defconfig b/arch/mips/configs/ath79_defconfig
index 4193bd628f..781786bc52 100644
--- a/arch/mips/configs/tplink-mr3020_defconfig
+++ b/arch/mips/configs/ath79_defconfig
@@ -1,7 +1,10 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="tplink-mr3020"
CONFIG_MACH_MIPS_ATH79=y
-CONFIG_PBL_IMAGE=y
+CONFIG_MIPS_ATH79_MULTI_BOARDS=y
+CONFIG_BOARD_8DEVICES_LIMA=y
+CONFIG_BOARD_DPTECHNICS_DPT_MODULE=y
+CONFIG_BOARD_TPLINK_MR3020=y
+CONFIG_BOARD_TPLINK_WDR4300=y
+CONFIG_BOARD_BLACK_SWIFT=y
CONFIG_IMAGE_COMPRESSION_XZKERN=y
CONFIG_MMU=y
CONFIG_TEXT_BASE=0x81000000
diff --git a/arch/mips/configs/dlink-dir-320_defconfig b/arch/mips/configs/bcm47xx_defconfig
index ff0638a8c6..04833ef2e0 100644
--- a/arch/mips/configs/dlink-dir-320_defconfig
+++ b/arch/mips/configs/bcm47xx_defconfig
@@ -1,6 +1,5 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="dlink-dir-320"
CONFIG_MACH_MIPS_BCM47XX=y
+CONFIG_IMAGE_COMPRESSION_XZKERN=y
CONFIG_STACK_SIZE=0x7000
CONFIG_EXPERIMENTAL=y
CONFIG_HUSH_FANCY_PROMPT=y
@@ -10,6 +9,7 @@ CONFIG_MENU=y
CONFIG_BOOTM_SHOW_TYPE=y
CONFIG_PARTITION=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
CONFIG_POLLER=y
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
diff --git a/arch/mips/configs/black-swift_defconfig b/arch/mips/configs/black-swift_defconfig
deleted file mode 100644
index 1a72cfbd77..0000000000
--- a/arch/mips/configs/black-swift_defconfig
+++ /dev/null
@@ -1,54 +0,0 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="black-swift"
-CONFIG_MACH_MIPS_ATH79=y
-CONFIG_BOARD_BLACK_SWIFT=y
-CONFIG_NMON=y
-CONFIG_NMON_USER_START=y
-CONFIG_NMON_1S_DELAY=0x100000
-CONFIG_NMON_USER_START_DELAY=0x5
-CONFIG_NMON_HELP=y
-CONFIG_PBL_IMAGE=y
-CONFIG_IMAGE_COMPRESSION_XZKERN=y
-CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x82000000
-CONFIG_MALLOC_TLSF=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_IMD=y
-CONFIG_PARTITION=y
-CONFIG_DEBUG_LL=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_IOMEM=y
-CONFIG_CMD_MEMINFO=y
-# CONFIG_CMD_BOOTM is not set
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_LOADY=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_PARTITION=y
-CONFIG_CMD_GLOBAL=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_LET=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_MM=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_OF_NODE=y
-CONFIG_CMD_OF_PROPERTY=y
-CONFIG_CMD_OFTREE=y
-CONFIG_OFDEVICE=y
-CONFIG_DRIVER_SERIAL_AR933X=y
-CONFIG_DRIVER_SPI_ATH79=y
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_MTD_M25P80=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_GPIO_OF=y
-CONFIG_KEYBOARD_GPIO=y
-CONFIG_DIGEST_SHA224_GENERIC=y
-CONFIG_DIGEST_SHA256_GENERIC=y
diff --git a/arch/mips/configs/dptechnics-dpt-module_defconfig b/arch/mips/configs/dptechnics-dpt-module_defconfig
deleted file mode 100644
index c01b22b987..0000000000
--- a/arch/mips/configs/dptechnics-dpt-module_defconfig
+++ /dev/null
@@ -1,89 +0,0 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="ar9331-dptechnics-dpt-module"
-CONFIG_MACH_MIPS_ATH79=y
-CONFIG_BOARD_DPTECHNICS_DPT_MODULE=y
-CONFIG_PBL_IMAGE=y
-CONFIG_IMAGE_COMPRESSION_XZKERN=y
-CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x82000000
-CONFIG_MALLOC_TLSF=y
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_CONSOLE_RATP=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_RESET_SOURCE=y
-CONFIG_CMD_DMESG=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_IOMEM=y
-CONFIG_CMD_IMD=y
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_LOADY=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_DEFAULTENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_MAGICVAR=y
-CONFIG_CMD_MAGICVAR_HELP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_LET=y
-CONFIG_CMD_MSLEEP=y
-CONFIG_CMD_READF=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_HOST=y
-CONFIG_CMD_MIITOOL=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_MEMTEST=y
-CONFIG_CMD_MM=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_DETECT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_POWEROFF=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_WD=y
-CONFIG_CMD_BAREBOX_UPDATE=y
-CONFIG_CMD_OF_NODE=y
-CONFIG_CMD_OF_PROPERTY=y
-CONFIG_CMD_OFTREE=y
-CONFIG_CMD_TIME=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_SNTP=y
-CONFIG_OFDEVICE=y
-CONFIG_OF_BAREBOX_DRIVERS=y
-CONFIG_OF_BAREBOX_ENV_IN_FS=y
-CONFIG_DRIVER_SERIAL_AR933X=y
-CONFIG_DRIVER_NET_AG71XX=y
-CONFIG_AR8327N_PHY=y
-CONFIG_AT803X_PHY=y
-CONFIG_MDIO_BITBANG=y
-CONFIG_MDIO_GPIO=y
-CONFIG_DRIVER_SPI_ATH79=y
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_MTD_M25P80=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_GPIO_OF=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_WATCHDOG=y
-CONFIG_WATCHDOG_AR9344=y
-CONFIG_FS_TFTP=y
-CONFIG_FS_NFS=y
-CONFIG_FS_RATP=y
-CONFIG_DIGEST_SHA224_GENERIC=y
-CONFIG_DIGEST_SHA256_GENERIC=y
diff --git a/arch/mips/configs/img-ci20_defconfig b/arch/mips/configs/img-ci20_defconfig
deleted file mode 100644
index ada82c6431..0000000000
--- a/arch/mips/configs/img-ci20_defconfig
+++ /dev/null
@@ -1,45 +0,0 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="img-ci20"
-CONFIG_MACH_MIPS_XBURST=y
-CONFIG_BOARD_CI20=y
-CONFIG_PBL_IMAGE=y
-CONFIG_GLOB=y
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_BOOTM_SHOW_TYPE=y
-CONFIG_BOOTM_VERBOSE=y
-CONFIG_BOOTM_INITRD=y
-CONFIG_BOOTM_OFTREE=y
-CONFIG_BOOTM_OFTREE_UIMAGE=y
-# CONFIG_DEFAULT_ENVIRONMENT is not set
-CONFIG_POLLER=y
-CONFIG_DEBUG_LL=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_IOMEM=y
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_LOADS=y
-CONFIG_CMD_LOADY=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_SAVES=y
-CONFIG_CMD_UIMAGE=y
-CONFIG_CMD_MD5SUM=y
-CONFIG_CMD_GETOPT=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_MIITOOL=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_TFTP=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_OF_NODE=y
-CONFIG_CMD_OF_PROPERTY=y
-CONFIG_CMD_OFTREE=y
-CONFIG_NET=y
-CONFIG_OFDEVICE=y
-CONFIG_DRIVER_NET_DM9K=y
-# CONFIG_SPI is not set
-CONFIG_CLOCKSOURCE_DUMMY_RATE=3500
-CONFIG_FS_TFTP=y
diff --git a/arch/mips/configs/qemu-malta_defconfig b/arch/mips/configs/qemu-malta_defconfig
index 9671e93dc0..1314783e02 100644
--- a/arch/mips/configs/qemu-malta_defconfig
+++ b/arch/mips/configs/qemu-malta_defconfig
@@ -1,6 +1,6 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="qemu-malta"
-CONFIG_PBL_IMAGE=y
+CONFIG_MIPS_MALTA_MULTI_BOARDS=y
+CONFIG_BOARD_QEMU_MALTA=y
+CONFIG_IMAGE_COMPRESSION_XZKERN=y
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x400000
CONFIG_STACK_SIZE=0x7000
CONFIG_EXPERIMENTAL=y
@@ -10,10 +10,12 @@ CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
CONFIG_MENU=y
CONFIG_BOOTM_SHOW_TYPE=y
+CONFIG_CONSOLE_ALLOW_COLOR=y
CONFIG_PARTITION=y
-# CONFIG_DEFAULT_ENVIRONMENT is not set
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
CONFIG_POLLER=y
CONFIG_DEBUG_INFO=y
+CONFIG_CMD_DMESG=y
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
CONFIG_CMD_IMD=y
@@ -24,6 +26,7 @@ CONFIG_CMD_LOADY=y
CONFIG_CMD_RESET=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_EXPORT=y
+CONFIG_CMD_DEFAULTENV=y
CONFIG_CMD_LOADENV=y
CONFIG_CMD_PRINTENV=y
CONFIG_CMD_SAVEENV=y
@@ -31,7 +34,6 @@ CONFIG_CMD_MD5SUM=y
CONFIG_CMD_SHA1SUM=y
CONFIG_CMD_SHA256SUM=y
CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_GETOPT=y
CONFIG_CMD_SLEEP=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_MIITOOL=y
diff --git a/arch/mips/configs/tplink-wdr4300_defconfig b/arch/mips/configs/tplink-wdr4300_defconfig
deleted file mode 100644
index 46093d243b..0000000000
--- a/arch/mips/configs/tplink-wdr4300_defconfig
+++ /dev/null
@@ -1,82 +0,0 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="ar9344-tl-wdr4300-v1.7"
-CONFIG_MACH_MIPS_ATH79=y
-CONFIG_BOARD_TPLINK_WDR4300=y
-CONFIG_PBL_IMAGE=y
-CONFIG_IMAGE_COMPRESSION_XZKERN=y
-CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x81000000
-CONFIG_MALLOC_TLSF=y
-CONFIG_HUSH_FANCY_PROMPT=y
-CONFIG_CMDLINE_EDITING=y
-CONFIG_AUTO_COMPLETE=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
-CONFIG_CMD_DMESG=y
-CONFIG_LONGHELP=y
-CONFIG_CMD_IOMEM=y
-CONFIG_CMD_IMD=y
-CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_GO=y
-CONFIG_CMD_LOADB=y
-CONFIG_CMD_LOADY=y
-CONFIG_CMD_RESET=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_DEFAULTENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_MAGICVAR=y
-CONFIG_CMD_MAGICVAR_HELP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_SHA1SUM=y
-CONFIG_CMD_UNCOMPRESS=y
-CONFIG_CMD_LET=y
-CONFIG_CMD_MSLEEP=y
-CONFIG_CMD_READF=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_DHCP=y
-CONFIG_CMD_HOST=y
-CONFIG_CMD_MIITOOL=y
-CONFIG_CMD_PING=y
-CONFIG_CMD_ECHO_E=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_READLINE=y
-CONFIG_CMD_TIMEOUT=y
-CONFIG_CMD_CRC=y
-CONFIG_CMD_MEMTEST=y
-CONFIG_CMD_MM=y
-CONFIG_CMD_CLK=y
-CONFIG_CMD_DETECT=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_GPIO=y
-CONFIG_CMD_LED=y
-CONFIG_CMD_POWEROFF=y
-CONFIG_CMD_SPI=y
-CONFIG_CMD_LED_TRIGGER=y
-CONFIG_CMD_BAREBOX_UPDATE=y
-CONFIG_CMD_OF_NODE=y
-CONFIG_CMD_OF_PROPERTY=y
-CONFIG_CMD_OFTREE=y
-CONFIG_CMD_TIME=y
-CONFIG_NET=y
-CONFIG_NET_NFS=y
-CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_SNTP=y
-CONFIG_OFDEVICE=y
-CONFIG_OF_BAREBOX_DRIVERS=y
-CONFIG_OF_BAREBOX_ENV_IN_FS=y
-CONFIG_DRIVER_SERIAL_NS16550=y
-CONFIG_DRIVER_NET_AG71XX=y
-CONFIG_AR8327N_PHY=y
-CONFIG_MDIO_BITBANG=y
-CONFIG_MDIO_GPIO=y
-CONFIG_DRIVER_SPI_ATH79=y
-CONFIG_MTD=y
-# CONFIG_MTD_OOB_DEVICE is not set
-CONFIG_MTD_M25P80=y
-CONFIG_LED=y
-CONFIG_LED_GPIO=y
-CONFIG_LED_GPIO_OF=y
-CONFIG_LED_TRIGGERS=y
-CONFIG_FS_TFTP=y
-CONFIG_FS_NFS=y
-CONFIG_DIGEST_SHA224_GENERIC=y
-CONFIG_DIGEST_SHA256_GENERIC=y
diff --git a/arch/mips/configs/ritmix-rzx50_defconfig b/arch/mips/configs/xburst_defconfig
index 3fb978a813..4305afc586 100644
--- a/arch/mips/configs/ritmix-rzx50_defconfig
+++ b/arch/mips/configs/xburst_defconfig
@@ -1,8 +1,7 @@
-CONFIG_BUILTIN_DTB=y
-CONFIG_BUILTIN_DTB_NAME="rzx50"
CONFIG_MACH_MIPS_XBURST=y
-CONFIG_JZ47XX_DEBUG_LL_UART1=y
-CONFIG_PBL_IMAGE=y
+CONFIG_BOARD_RZX50=y
+CONFIG_BOARD_CI20=y
+CONFIG_CPU_MIPS32_R1=y
CONFIG_BAUDRATE=57600
CONFIG_GLOB=y
CONFIG_HUSH_FANCY_PROMPT=y
@@ -14,7 +13,6 @@ CONFIG_BOOTM_INITRD=y
CONFIG_BOOTM_OFTREE=y
CONFIG_BOOTM_OFTREE_UIMAGE=y
# CONFIG_DEFAULT_ENVIRONMENT is not set
-CONFIG_DEBUG_LL=y
CONFIG_LONGHELP=y
CONFIG_CMD_IOMEM=y
CONFIG_CMD_IMD=y
diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile
index ddd9039985..7485f85a14 100644
--- a/arch/mips/dts/Makefile
+++ b/arch/mips/dts/Makefile
@@ -1,5 +1,17 @@
-
BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_NAME))
-obj-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o
+ifneq ($(BUILTIN_DTB),)
+obj-dtb-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o
+endif
+
+pbl-dtb-$(CONFIG_BOARD_8DEVICES_LIMA) += qca4531-8devices-lima.dtb.o
+pbl-dtb-$(CONFIG_BOARD_BLACK_SWIFT) += black-swift.dtb.o
+pbl-dtb-$(CONFIG_BOARD_CI20) += img-ci20.dtb.o
+pbl-dtb-$(CONFIG_BOARD_DLINK_DIR320) += dlink-dir-320.dtb.o
+pbl-dtb-$(CONFIG_BOARD_DPTECHNICS_DPT_MODULE) += ar9331-dptechnics-dpt-module.dtb.o
+pbl-dtb-$(CONFIG_BOARD_LOONGSON_TECH_LS1B) += loongson-ls1b.dtb.o
+pbl-dtb-$(CONFIG_BOARD_QEMU_MALTA) += qemu-malta.dtb.o
+pbl-dtb-$(CONFIG_BOARD_RZX50) += rzx50.dtb.o
+pbl-dtb-$(CONFIG_BOARD_TPLINK_MR3020) += tplink-mr3020.dtb.o
+pbl-dtb-$(CONFIG_BOARD_TPLINK_WDR4300) += ar9344-tl-wdr4300-v1.7.dtb.o
clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.lzo
diff --git a/arch/mips/mach-ar231x/include/mach/debug_ll.h b/arch/mips/mach-ar231x/include/mach/debug_ll.h
index 5ab7f9a26a..ecec159169 100644
--- a/arch/mips/mach-ar231x/include/mach/debug_ll.h
+++ b/arch/mips/mach-ar231x/include/mach/debug_ll.h
@@ -21,7 +21,6 @@
/** @file
* This File contains declaration for early output support
*/
-#include <board/debug_ll.h>
#include <asm/debug_ll_ns16550.h>
#endif /* __MACH_AR231X_DEBUG_LL__ */
diff --git a/arch/mips/mach-ath79/Kconfig b/arch/mips/mach-ath79/Kconfig
index e4e10a2f65..3ea78b074a 100644
--- a/arch/mips/mach-ath79/Kconfig
+++ b/arch/mips/mach-ath79/Kconfig
@@ -10,8 +10,18 @@ config SOC_QCA_AR9331
config SOC_QCA_AR9344
bool
+if DEBUG_LL
choice
- prompt "Board type"
+ prompt "DEBUG_LL driver"
+
+config DEBUG_AR9331_UART
+ bool "AR9331 Debug UART"
+
+config DEBUG_AR9344_UART
+ bool "AR9344 Debug UART"
+
+endchoice
+endif # DEBUG_LL
config BOARD_8DEVICES_LIMA
bool "8devices LIMA"
@@ -50,6 +60,4 @@ config BOARD_BLACK_SWIFT
select HAVE_IMAGE_COMPRESSION
select HAS_NMON
-endchoice
-
endif
diff --git a/arch/mips/mach-ath79/include/mach/debug_ll.h b/arch/mips/mach-ath79/include/mach/debug_ll.h
index 73d064a3a0..a49b6cf4ab 100644
--- a/arch/mips/mach-ath79/include/mach/debug_ll.h
+++ b/arch/mips/mach-ath79/include/mach/debug_ll.h
@@ -18,10 +18,18 @@
#ifndef __MACH_ATH79_DEBUG_LL__
#define __MACH_ATH79_DEBUG_LL__
-#if defined(CONFIG_SOC_QCA_AR9331)
+#ifdef CONFIG_DEBUG_LL
+
+#ifdef CONFIG_DEBUG_AR9331_UART
#include <mach/debug_ll_ar9331.h>
-#elif defined(CONFIG_SOC_QCA_AR9344)
+#elif defined CONFIG_DEBUG_AR9344_UART
#include <mach/debug_ll_ar9344.h>
+#else
+#error "unknown ath79 debug uart soc type"
#endif
+#else
+#define debug_ll_ath79_init
+#endif /* CONFIG_DEBUG_LL */
+
#endif /* __MACH_AR9344_DEBUG_LL_H__ */
diff --git a/arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h b/arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h
index 04bd3ea72b..11088490d1 100644
--- a/arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h
+++ b/arch/mips/mach-ath79/include/mach/debug_ll_ar9331.h
@@ -81,7 +81,7 @@ static inline void PUTC_LL(int ch)
#define AR933X_UART_CLOCK_REG 0x08
#define CLOCK_REG ((KSEG1 | AR933X_UART_BASE) | AR933X_UART_CLOCK_REG)
-.macro debug_ll_ar9331_init
+.macro debug_ll_ath79_init
#ifdef CONFIG_DEBUG_LL
pbl_reg_writel ((AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S) \
diff --git a/arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h b/arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h
index d156ce9f39..359cf0d42b 100644
--- a/arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h
+++ b/arch/mips/mach-ath79/include/mach/debug_ll_ar9344.h
@@ -19,8 +19,10 @@
#ifndef __AR9344_DEBUG_LL__
#define __AR9344_DEBUG_LL__
+#include <asm/asm.h>
#include <asm/addrspace.h>
#include <mach/ar71xx_regs.h>
+#include <asm/regdef.h>
#define DEBUG_LL_UART_ADDR KSEG1ADDR(AR934X_UART0_BASE)
#define DEBUG_LL_UART_SHIFT AR934X_UART0_SHIFT
@@ -66,7 +68,7 @@ static inline void PUTC_LL(char ch)
* Macros for use in assembly language code
*/
-.macro debug_ll_ar9344_init
+.macro debug_ll_ath79_init
#ifdef CONFIG_DEBUG_LL
/* find out the ref clock */
diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
index 906d73e8c7..70736b3680 100644
--- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
+++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
@@ -393,13 +393,10 @@ skip_pll_ram_config:
dcache_enable
pbl_ar9331_uart_enable
- debug_ll_ar9331_init
- mips_nmon
+ debug_ll_ath79_init
pbl_ar9331_mdio_gpio_enable
- copy_to_link_location pbl_start
-
.set pop
.endm
diff --git a/arch/mips/mach-bcm47xx/include/mach/debug_ll.h b/arch/mips/mach-bcm47xx/include/mach/debug_ll.h
index 3e74e0f670..1e474e2d3b 100644
--- a/arch/mips/mach-bcm47xx/include/mach/debug_ll.h
+++ b/arch/mips/mach-bcm47xx/include/mach/debug_ll.h
@@ -21,7 +21,6 @@
#ifndef __INCLUDE_ARCH_DEBUG_LL_H__
#define __INCLUDE_ARCH_DEBUG_LL_H__
-#include <io.h>
#include <mach/hardware.h>
#define DEBUG_LL_UART_SHIFT 0
diff --git a/arch/mips/mach-loongson/include/mach/debug_ll.h b/arch/mips/mach-loongson/include/mach/debug_ll.h
index b999f5e019..1904fb940a 100644
--- a/arch/mips/mach-loongson/include/mach/debug_ll.h
+++ b/arch/mips/mach-loongson/include/mach/debug_ll.h
@@ -21,7 +21,6 @@
/** @file
* This File contains declaration for early output support
*/
-#include <board/debug_ll.h>
#include <asm/debug_ll_ns16550.h>
#endif /* __MACH_LOONGSON_DEBUG_LL__ */
diff --git a/arch/mips/mach-malta/Kconfig b/arch/mips/mach-malta/Kconfig
index 1bf2b0e68a..ceea937e30 100644
--- a/arch/mips/mach-malta/Kconfig
+++ b/arch/mips/mach-malta/Kconfig
@@ -4,8 +4,11 @@ config ARCH_TEXT_BASE
hex
default 0xa0800000
-choice
- prompt "Board type"
+config MIPS_MALTA_MULTI_BOARDS
+ bool "Allow multiple boards to be selected"
+ select HAVE_PBL_MULTI_IMAGE
+
+if MIPS_MALTA_MULTI_BOARDS
config BOARD_QEMU_MALTA
bool "qemu malta"
@@ -13,6 +16,6 @@ config BOARD_QEMU_MALTA
select HAVE_IMAGE_COMPRESSION
select HAS_NMON
-endchoice
+endif # MIPS_MALTA_MULTI_BOARDS
endif
diff --git a/arch/mips/mach-malta/include/mach/debug_ll.h b/arch/mips/mach-malta/include/mach/debug_ll.h
index c9e89bcc9d..a9cf8b3c19 100644
--- a/arch/mips/mach-malta/include/mach/debug_ll.h
+++ b/arch/mips/mach-malta/include/mach/debug_ll.h
@@ -21,7 +21,15 @@
#ifndef __MACH_MALTA_DEBUG_LL_H__
#define __MACH_MALTA_DEBUG_LL_H__
-#include <board/debug_ll.h>
+#include <mach/hardware.h>
+
+#define DEBUG_LL_UART_ADDR MALTA_PIIX4_UART0
+#define DEBUG_LL_UART_SHIFT 0
+
+#define DEBUG_LL_UART_CLK 1843200
+#define DEBUG_LL_UART_BPS CONFIG_BAUDRATE
+#define DEBUG_LL_UART_DIVISOR (DEBUG_LL_UART_CLK / DEBUG_LL_UART_BPS)
+
#include <asm/debug_ll_ns16550.h>
#endif /* __MACH_MALTA_DEBUG_LL_H__ */
diff --git a/arch/mips/mach-xburst/Kconfig b/arch/mips/mach-xburst/Kconfig
index ee79ff6167..b3790210dd 100644
--- a/arch/mips/mach-xburst/Kconfig
+++ b/arch/mips/mach-xburst/Kconfig
@@ -16,9 +16,6 @@ config CPU_JZ4780
select WATCHDOG
select WATCHDOG_JZ4740
-choice
- prompt "Board type"
-
config BOARD_RZX50
bool "Ritmix RZX-50"
select CPU_JZ4755
@@ -28,9 +25,18 @@ config BOARD_CI20
select CPU_JZ4780
select HAS_DM9000
+if DEBUG_LL
+choice
+ prompt "DEBUG_LL driver"
+
+config DEBUG_JZ4750D_UART
+ bool "JZ4750D Debug UART"
+
+config DEBUG_JZ4780_UART
+ bool "JZ4780 Debug UART"
+
endchoice
-if DEBUG_LL
choice
prompt "DEBUG_LL port"
diff --git a/arch/mips/mach-xburst/include/mach/debug_ll.h b/arch/mips/mach-xburst/include/mach/debug_ll.h
index 6c3c9804b5..a1ce17efdf 100644
--- a/arch/mips/mach-xburst/include/mach/debug_ll.h
+++ b/arch/mips/mach-xburst/include/mach/debug_ll.h
@@ -21,7 +21,19 @@
/** @file
* This File contains declaration for early output support
*/
-#include <board/debug_ll.h>
+
+#ifdef CONFIG_DEBUG_LL
+
+#ifdef CONFIG_DEBUG_JZ4750D_UART
+#include <mach/debug_ll_jz4750d.h>
+#elif defined CONFIG_DEBUG_JZ4780_UART
+#include <mach/debug_ll_jz4780.h>
+#else
+#error "unknown xburst debug uart soc type"
+#endif
+
+#endif /* CONFIG_DEBUG_LL */
+
#include <asm/debug_ll_ns16550.h>
#endif /* __MACH_XBURST_DEBUG_LL__ */