summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-07-12 07:10:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-07-12 07:10:18 +0200
commit05f49fa0edb6166f80b8a37a172d6b83db2d92d1 (patch)
treed1ed7e547de510bed565132484ba465662a350d0
parente4b6fc41713549a214081f8a0c3a5dbf787a4ac4 (diff)
parent79dc78d3d4edeb5a0aae0edbe214e99811e28a64 (diff)
downloadbarebox-05f49fa0edb6166f80b8a37a172d6b83db2d92d1.tar.gz
barebox-05f49fa0edb6166f80b8a37a172d6b83db2d92d1.tar.xz
Merge branch 'for-next/mips'
-rw-r--r--Documentation/user/barebox.rst7
-rw-r--r--arch/mips/Kconfig4
-rw-r--r--arch/mips/boot/main_entry.c2
-rw-r--r--arch/mips/dts/tplink-mr3020.dts2
-rw-r--r--arch/mips/lib/Makefile4
-rw-r--r--arch/mips/lib/reloc.c22
-rw-r--r--arch/mips/mach-ar231x/Kconfig4
-rw-r--r--arch/mips/mach-ath79/Kconfig4
-rw-r--r--arch/mips/mach-bcm47xx/Kconfig4
-rw-r--r--arch/mips/mach-loongson/Kconfig4
-rw-r--r--arch/mips/mach-malta/Kconfig4
-rw-r--r--arch/mips/mach-xburst/Kconfig4
-rw-r--r--drivers/serial/serial_ar933x.c1
-rw-r--r--scripts/.gitignore1
14 files changed, 20 insertions, 47 deletions
diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst
index d82163a886..c021a4c743 100644
--- a/Documentation/user/barebox.rst
+++ b/Documentation/user/barebox.rst
@@ -112,11 +112,12 @@ targets, followed by the MIPS-specific ones:
Architecture specific targets (mips):
No architecture specific help defined for mips
+ ath79_defconfig - Build for ath79
+ bcm47xx_defconfig - Build for bcm47xx
+ gxemul-malta_defconfig - Build for gxemul-malta
loongson-ls1b_defconfig - Build for loongson-ls1b
- ritmix-rzx50_defconfig - Build for ritmix-rzx50
- tplink-mr3020_defconfig - Build for tplink-mr3020
- dlink-dir-320_defconfig - Build for dlink-dir-320
qemu-malta_defconfig - Build for qemu-malta
+ xburst_defconfig - Build for xburst
barebox supports building for multiple boards with a single config. If you
can't find your board in the list, it may be supported by one of the multi-board
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 936e56fa27..728295d486 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -29,6 +29,10 @@ config GENERIC_LINKER_SCRIPT
config PHYS_ADDR_T_64BIT
bool
+config ARCH_TEXT_BASE
+ hex
+ default 0xa0800000
+
menu "Machine selection"
config MIPS_RELOCATION_TABLE_SIZE
diff --git a/arch/mips/boot/main_entry.c b/arch/mips/boot/main_entry.c
index 5b88730b07..4ae4457e7e 100644
--- a/arch/mips/boot/main_entry.c
+++ b/arch/mips/boot/main_entry.c
@@ -85,7 +85,7 @@ void __bare_init main_entry(void *fdt, u32 fdt_size)
trap_init();
- malloc_end = _stext;
+ malloc_end = (unsigned long)_stext;
if (MALLOC_SIZE > 0)
malloc_start = malloc_end - MALLOC_SIZE;
diff --git a/arch/mips/dts/tplink-mr3020.dts b/arch/mips/dts/tplink-mr3020.dts
index 982cffc250..e30eae1578 100644
--- a/arch/mips/dts/tplink-mr3020.dts
+++ b/arch/mips/dts/tplink-mr3020.dts
@@ -7,6 +7,8 @@
};
chosen {
+ stdout-path = &uart;
+
environment {
compatible = "barebox,environment";
device-path = &spiflash, "partname:barebox-environment";
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index 4ba42e526e..0761588ae8 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -4,8 +4,8 @@ obj-y += cpu-probe.o
lwl-y += end.o
obj-y += traps.o
obj-y += genex.o
-obj-y += reloc.o
-obj-y += sections.o
+obj-y += reloc.o
+obj-y += sections.o
obj-y += shutdown.o
obj-y += dma-default.o
diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c
index 9756d61666..9a9e404f7e 100644
--- a/arch/mips/lib/reloc.c
+++ b/arch/mips/lib/reloc.c
@@ -40,8 +40,6 @@
#include <linux/sizes.h>
#include <asm-generic/memory_layout.h>
-#define MAX_BSS_SIZE SZ_1M
-
void main_entry(void *fdt, u32 fdt_size);
void relocate_code(void *fdt, u32 fdt_size, u32 relocaddr);
@@ -108,17 +106,6 @@ static void apply_reloc(unsigned int type, void *addr, long off)
}
}
-/**
- * relocate_code() - Relocate Barebox, generally from flash to DDR
- * @start_addr_sp: new stack pointer
- * @new_gd: pointer to relocated global data
- * @relocaddr: the address to relocate to
- *
- * Relocate Barebox from its current location (generally in flash) to a new one
- * (generally in DDR). This function will copy the Barebox binary & apply
- * relocations as necessary, then jump to board_init_r in the new build of
- * Barebox. As such, this function does not return.
- */
void relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
{
unsigned long addr, length, bss_len;
@@ -127,8 +114,10 @@ void relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
unsigned int type;
long off;
- length = barebox_image_size + MAX_BSS_SIZE;
- relocaddr = ALIGN_DOWN(ram_size - barebox_image_size, SZ_64K);
+ bss_len = (unsigned long)&__bss_stop - (unsigned long)__bss_start;
+
+ length = barebox_image_size + bss_len;
+ relocaddr = ALIGN_DOWN(ram_size - length, SZ_64K);
relocaddr = KSEG0ADDR(relocaddr);
new_stack = relocaddr - MALLOC_SIZE - 16;
@@ -143,7 +132,7 @@ void relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
panic("Mis-aligned relocation\n");
/* Copy Barebox to RAM */
- memcpy((void *)relocaddr, __image_start, length);
+ memcpy((void *)relocaddr, __image_start, barebox_image_size);
/* Now apply relocations to the copy in RAM */
buf = __rel_start;
@@ -162,7 +151,6 @@ void relocate_code(void *fdt, u32 fdt_size, u32 ram_size)
/* Clear the .bss section */
bss_start = (uint8_t *)((unsigned long)__bss_start + off);
- bss_len = (unsigned long)&__bss_stop - (unsigned long)__bss_start;
memset(bss_start, 0, bss_len);
__asm__ __volatile__ (
diff --git a/arch/mips/mach-ar231x/Kconfig b/arch/mips/mach-ar231x/Kconfig
index 5f9e24377f..f920f300bd 100644
--- a/arch/mips/mach-ar231x/Kconfig
+++ b/arch/mips/mach-ar231x/Kconfig
@@ -1,9 +1,5 @@
if MACH_MIPS_AR231X
-config ARCH_TEXT_BASE
- hex
- default 0xa0800000
-
choice
prompt "Board type"
diff --git a/arch/mips/mach-ath79/Kconfig b/arch/mips/mach-ath79/Kconfig
index 4bc1d88b4e..b1b49b0005 100644
--- a/arch/mips/mach-ath79/Kconfig
+++ b/arch/mips/mach-ath79/Kconfig
@@ -1,9 +1,5 @@
if MACH_MIPS_ATH79
-config ARCH_TEXT_BASE
- hex
- default 0xa0800000
-
config SOC_QCA_AR9331
bool
diff --git a/arch/mips/mach-bcm47xx/Kconfig b/arch/mips/mach-bcm47xx/Kconfig
index f7522b79d6..c4791901af 100644
--- a/arch/mips/mach-bcm47xx/Kconfig
+++ b/arch/mips/mach-bcm47xx/Kconfig
@@ -1,9 +1,5 @@
if MACH_MIPS_BCM47XX
-config ARCH_TEXT_BASE
- hex
- default 0xa0800000
-
choice
prompt "Board type"
diff --git a/arch/mips/mach-loongson/Kconfig b/arch/mips/mach-loongson/Kconfig
index c9f19025eb..ab7ccd0cb5 100644
--- a/arch/mips/mach-loongson/Kconfig
+++ b/arch/mips/mach-loongson/Kconfig
@@ -1,9 +1,5 @@
if MACH_MIPS_LOONGSON
-config ARCH_TEXT_BASE
- hex
- default 0xa0800000
-
choice
prompt "Board type"
diff --git a/arch/mips/mach-malta/Kconfig b/arch/mips/mach-malta/Kconfig
index 70799808f9..4671075140 100644
--- a/arch/mips/mach-malta/Kconfig
+++ b/arch/mips/mach-malta/Kconfig
@@ -1,9 +1,5 @@
if MACH_MIPS_MALTA
-config ARCH_TEXT_BASE
- hex
- default 0xa0800000
-
config BOARD_QEMU_MALTA
bool "qemu malta"
select HAVE_PBL_IMAGE
diff --git a/arch/mips/mach-xburst/Kconfig b/arch/mips/mach-xburst/Kconfig
index b3790210dd..ae8093d1a3 100644
--- a/arch/mips/mach-xburst/Kconfig
+++ b/arch/mips/mach-xburst/Kconfig
@@ -1,9 +1,5 @@
if MACH_MIPS_XBURST
-config ARCH_TEXT_BASE
- hex
- default 0xa0800000
-
config CPU_JZ4755
bool
select SYS_HAS_CPU_MIPS32_R1
diff --git a/drivers/serial/serial_ar933x.c b/drivers/serial/serial_ar933x.c
index 676b9fadf8..dda604652b 100644
--- a/drivers/serial/serial_ar933x.c
+++ b/drivers/serial/serial_ar933x.c
@@ -175,6 +175,7 @@ static int ar933x_serial_probe(struct device_d *dev)
cdev->putc = ar933x_serial_putc;
cdev->getc = ar933x_serial_getc;
cdev->setbrg = ar933x_serial_setbaudrate;
+ cdev->linux_console_name = "ttyATH";
priv->clk = clk_get(dev, NULL);
if (IS_ERR(priv->clk)) {
diff --git a/scripts/.gitignore b/scripts/.gitignore
index 11ac77eb37..45c81bf8f4 100644
--- a/scripts/.gitignore
+++ b/scripts/.gitignore
@@ -28,3 +28,4 @@ mxs-usb-loader
/omap3-usb-loader
omap4_usbboot
omap3-usb-loader
+mips-relocs