diff --git a/Documentation/user/barebox.rst b/Documentation/user/barebox.rst index d82163a..c021a4c 100644 --- a/Documentation/user/barebox.rst +++ b/Documentation/user/barebox.rst @@ -112,11 +112,12 @@ 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 936e56f..728295d 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -29,6 +29,10 @@ 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 5b88730..4ae4457 100644 --- a/arch/mips/boot/main_entry.c +++ b/arch/mips/boot/main_entry.c @@ -85,7 +85,7 @@ 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 982cffc..e30eae1 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 4ba42e5..0761588 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -4,8 +4,8 @@ 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 9756d61..9a9e404 100644 --- a/arch/mips/lib/reloc.c +++ b/arch/mips/lib/reloc.c @@ -40,8 +40,6 @@ #include #include -#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 @@ } } -/** - * 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 @@ 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 @@ 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 @@ /* 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 5f9e243..f920f30 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 4bc1d88..b1b49b0 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 f7522b7..c479190 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 c9f1902..ab7ccd0 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 7079980..4671075 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 b379021..ae8093d 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 676b9fa..dda6046 100644 --- a/drivers/serial/serial_ar933x.c +++ b/drivers/serial/serial_ar933x.c @@ -175,6 +175,7 @@ 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 11ac77e..45c81bf 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -28,3 +28,4 @@ /omap3-usb-loader omap4_usbboot omap3-usb-loader +mips-relocs