summaryrefslogtreecommitdiffstats
path: root/arch/mips
Commit message (Collapse)AuthorAgeFilesLines
...
* | MIPS: qemu-malta: use generic syscon reset driverAntony Pavlov2021-05-034-32/+15
|/ | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20210425063517.120260-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-03-231-2/+1
|\
| * MIPS: qemu-malta: make barebox Malta images detectableAhmad Fatoum2021-03-011-2/+1
| | | | | | | | | | | | | | | | | | | | is_barebox_mips_head checks whether 0x10-0x16 is "barebox". Have the Malta images provide this signature like other MIPS boards already do. This makes bootm work. Cc: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mips: Implement setjmp/longjmp/initjmp for 32BITSascha Hauer2021-03-174-0/+84
| | | | | | | | | | | | | | | | | | The header has been taken from glibc, the implementation itself is based on the newlib implementation. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mips: Add linkage.hSascha Hauer2021-03-171-0/+9
|/ | | | | | | | Taken from Linux Kernel with unnecessary bits removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/video'Sascha Hauer2021-01-191-0/+4
|\
| * MIPS: qemu-malta_defconfig: enable VGA outputAhmad Fatoum2021-01-051-0/+4
| | | | | | | | | | | | | | | | Now that we have a driver for the Qemu's default -device VGA, enable it in defconfig, along with fbtest for testing it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: dts: ar9331: add stdout-path propertiesOleksij Rempel2021-01-133-0/+6
|/ | | | | | | | | With the kernel v5.11-rc2 the console will be automatically redirected to null if no default console is configured. Make sure the barebox is doing it to make kernel happy. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clk: ls1b200: add clk driver for loongson 1bDu Huanpeng2020-11-133-4/+22
| | | | | | | add "pll" and "oscillator" node to devicetree. Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: dtb: remove unused variable ``root''Du Huanpeng2020-10-221-1/+0
| | | | | | | the ``root'' is not used and cause a warning. Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ls1b: enable pbl support for ls1bdev boardDu Huanpeng2020-10-213-0/+222
| | | | | Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sandbox' into masterSascha Hauer2020-10-141-7/+1
|\
| * of: Add common device tree register functionSascha Hauer2020-10-121-7/+1
| | | | | | | | | | | | | | | | The different architectures duplicate some code around unflattening and registering the device tree. Add common functions to reduce this duplication. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc' into masterSascha Hauer2020-10-141-2/+2
|\ \
| * | asm/debug_ll_ns16550.h: add divisor parameterduhuanpeng2020-09-291-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | add a parameter for the assembly version for passing divisor, and set the default value to DEBUG_LL_UART_ADDR when no parameter is given. Now it is possible to recalculate divisor in runtime to keep the baudrate unchanged. when pll settings changed outside of barebox. e.g. jtag. Signed-off-by: duhuanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / treewide: Use driver macroSascha Hauer2020-09-291-7/+1
|/ | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Regenerate defconfig filesUwe Kleine-König2020-09-232-2/+0
| | | | | | | | Done with the same script used to generate commit d952a0eeba37 ("Regenerate defconfig files"). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: give all restart handlers a descriptive nameAhmad Fatoum2020-09-155-5/+5
| | | | | | | | | | | | | With incoming changes to choose a specific reset method, give all currently unnamed "default" reset handlers a name: - soc reset via SoC-specific means - soc-wdt reset via SoC watchdog timer - vector reset via jump to reset vector - efi reset via EFI firmware Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mips'Sascha Hauer2020-07-278-0/+196
|\
| * MIPS: AR9331: OKUD Max9331Du Huanpeng2020-06-188-0/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oleksij and Kevin's Useless Devices. O&KUD Max9331 AR9331 400MHz MIPS 64M DRAM 16M SPI Flash 4G USB Nand Flash 3 User LEDs 3 Ports(1Wan/2Lan) 1 TTL Debug Uart Signed-off-by: Du Huanpeng <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/elf'Sascha Hauer2020-07-271-16/+9
|\ \
| * | mips: lib: bootm: use bootm elf loading capabilitiesClement Leger2020-06-151-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the elf file is loaded by the bootm core, there is no need for elf pointer anymore. Thus all elf related fields can be removed and bootm_load_os can be used. Signed-off-by: Clement Leger <cleger@kalray.eu> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: elf: add elf_open, elf_close and elf_loadClement Leger2020-06-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to integrate elf loading into bootm command, split elf opening from elf loading. Signed-off-by: Clement Leger <cleger@kalray.eu> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: elf: load elf directly from fileClement Leger2020-06-151-7/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, elf file must be loaded into a buffer and then passed to elf_load_image. This requires to copy the whole elf file before booting it. This commit allows to pass the filename directly and will allocate data only for the elf header (elf header + program headers). This will then be used to load the elf data from the file without copying it in an intermediate buffer. Elf segments are first parsed into a list and are then loaded from the file in a second time. Signed-off-by: Clement Leger <cleger@kalray.eu> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / kbuild: fix typo in --no-whole-archive flagClement Leger2020-06-241-1/+1
|/ | | | | | | | | "whole" was replaced with "while" during a previous patch. Fix this flag to allow building correctly. Fixes 0a78b33954 ("kbuild: switch over to thin archive") Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-06-112-2/+10
|\
| * MIPS: correctly work with disabled CONFIG_MMUAntony Pavlov2020-06-082-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some issues with CONFIG_MMU=n in MIPS configuration (e.g. qemu-malta_defconfig): * "Cannot request SDRAM region for stack" error message on start; * empty kseg1_ram0 region in the iomem command output. The patch fixes the problems by forcing KSEG1 memory region usage for CONFIG_MMU=n MIPS configurations. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: switch over to thin archiveMasahiro Yamada2020-05-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting v4.13, Linux always uses thin archive instead of relocatable ELF to combine builtin objects. The thin archive is basically a text file that only contains paths to object files. As Linux commit 98ced886dd79 mentioned, this has a lot of benefits: - save disk space for builds - speed-up building a little - fix some issues when liking a giant executable (for example, allyesconfig on ARM Linux) - work better with dead code elimination The last one is important for barebox because pbl highly relies on the dead code elimination (-f{function,data}-sections and --gc-sections) dropping symbols that are unreachable from the linker's entry point. The dead code elimination does not work if the same symbol names are used in the pevious incremental link mechanism because the same name symbols all go into the same section. Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when multiple boards are selected") worked around it by giving a dedicate section to each of the same name symbols. This workaround can go away. built-in.o was renamed to built-in.a since it is now an archive. built-in-pbl.o was renamed to built-in.pbl.a for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: remove obj-dtb-y, pbl-dtb-y, lwl-dtb-y syntaxMasahiro Yamada2020-05-201-12/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The embedded DTBs are compiled by the chain of pattern rules as follows: %.dts -> %.dtb -> %.dtb.S -> %.dtb.o for barebox proper %.dts -> %.dtb -> %.dtb.S -> %.dtb.pbl.o for pbl Barebox introduced {obj,pbl,lwl}-dtb-y syntax to put the intermediate files into extra-y. The purposes of doing so were: [1] prevent GNU Make from deleting the intermediate files [2] include .*.cmd files In contrast, Linux does not use a special syntax for embedding DTBs into the kernel. For example, as you see in arch/sh/boot/dts/Makefile of Linux 5.6, obj-y += <basename>.dtb.o ... just works. This is because scripts/Kbuild.include specifies .SECONDARY to cater to [1], and scripts/Makefile.build adds the intermediates to 'targets' to deal with [2]. Barebox had already imported the same code from Linux, so you can use obj-y instead of obj-dtb-y, like Linux. pbl-dtb-y and lwl-dtb-y are barebox-specific cases, so I added the %.dtb.pbl.o pattern to intermediate_targets. Going forward, please use obj-y, pbl-y, or lwl-y. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-05-142-16/+0
|\
| * MIPS: dlink-dir-320: remove useless board fileAntony Pavlov2020-05-072-16/+0
| | | | | | | | | | | | | | | | | | The board file calls only barebox_set_hostname(). Since we can extract host name from devicetree, we can drop board file. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kconfig'Sascha Hauer2020-05-141-0/+3
|\ \
| * | MIPS: ath79: define used, but undefined, Kconfig optionAhmad Fatoum2020-04-291-0/+3
| |/ | | | | | | | | | | | | | | SOC_QCA_QCA4531 is selected, but defined no where. fix this. Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | arch: remove KBUILD_SRC checks from arch MakefileMasahiro Yamada2020-05-121-4/+0
| | | | | | | | | | | | | | You can always add $(srctree)/ to the mach include path. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mips: remove unused board/debug_ll.hMasahiro Yamada2020-05-043-61/+0
| | | | | | | | | | | | | | | | There is no way to include <board/debug_ll.h>. These three files are dead code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mips: remove unused INCDIR and BOARD variables in MakefileMasahiro Yamada2020-05-041-13/+0
| | | | | | | | | | | | | | | | | | The variable INCDIR is not used by anyone. The variable BOARD is not set by anyone, so $(BOARD) is always empty. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: prefix compiler flag variables with KBUILD_Masahiro Yamada2020-04-272-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In old days, Linux also used to use well-known variables such CFLAGS, CPPFLAGS, etc. They were prefixed with KBUILD_ presumably for preventing users from overriding them accidentally. Rename as follows: CFLAGS -> KBUILD_CFLAGS AFLAGS -> KBUILD_AFLAGS CPPFLAGS -> KBUILD_CPPFLAGS LDFLAGS -> KBUILD_LDFLAGS HOSTCFLAGS -> KBUILD_HOSTCFLAGS HOSTCXXFLAGS -> KBUILD_HOSTCXXFLAGS HOSTLDFLAGS -> KBUILD_HOSTLDFLAGS HOST_LOADLIBES -> KBUILD_HOSTLDLIBS HOSTCFLAGS, HOSTCXXFLAGS, HOSTLDFLAGS, HOSTLDLIBS are re-used to allow users to pass-in additional flags to the host compiler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mips: rename ldflags-y to mips-ldflags-yMasahiro Yamada2020-04-271-5/+5
|/ | | | | | | | | | | | The next commit will add ldflags-y to scripts/Makefile.lib like Linux, but barebox includes scripts/Makefile.lib from the top Makefile. arch/mips/Makefile uses ldflags-y for a different meaning. To avoid unpleasant side-effect, this commit rename it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-03-182-4/+4
|\
| * kbuild: rename barebox-{common, lds} to BAREBOX_{OBJS, LDS}Masahiro Yamada2020-03-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit renamed barebox-pbl-common because you cannot export a variable that contain hyphens. These variables are not exported for now. I am just renaming them for consistency. barebox-common -> BAREBOX_OBJS barebox-lds -> BAREBOX_LDS If barebox moves the link rules into scripts/link-barebox.sh like Linux did, these two must be exported anyway. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: rename barebox-pbl-common to BAREBOX_PBL_OBJSMasahiro Yamada2020-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'export barebox-pbl-common' does not work reliably because hyphens are disallowed in shell variables. This caused a problem in Linux in the past. See Linux commit 2bfbe7881ee0 ("kbuild: Do not use hyphen in exported variable name"). The same problem occurs when you build barebox with O= and the directory path to the source tree contains a shell special character like '~'. The maintainer of GNU Make stated that there is no consistent way to export variables that do not meet the shell's naming criteria. (https://savannah.gnu.org/bugs/?55719) Consequently, you cannot use hyphens in exported variables. Rename barebox-pbl-common to BAREBOX_PBL_OBJS. I named it after KBUILD_VMLINUX_OBJS in the Linux top Makefile. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: ath79: add support for OpenEmbed SOM9331 boardOleksij Rempel2020-02-257-0/+147
|/ | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-02-181-0/+1
|\
| * images: Use separate LDFLAGS for PBLChristian Eggers2020-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting CONFIG_PBL_RELOCATABLE=y (selected by PBL_MULTI_IMAGES) and CONFIG_RELOCATABLE=n (trying to reduce image size), the PBL is also linked with "-static" instead of "-pie". The result is a non-working PBL. As a side effect, also get rid of erroneous "-Map barebox.map" when linking the PBL. Only changed for ARM, are any other platforms affected? Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: don't overlay relocation data with BSSOleksij Rempel2020-02-032-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .bss __rel_start (OVERLAY) was used to optimize RAM size used by barebox. Since .bss and __rel_start overlap, we should clear bss only after __rel_start was used. Following patch changed initialization sequence to clear .bss before __rel_start: 1e5aef61fc6a444 ("MIPS: reloc: init bss and cpu") This make relocation buffer unusable and broke relocation with different symptoms reported by Antony Pavlov <antonynpavlov@gmail.com>: * iomem output has no information on sdram regions, so memtest is unusable; * pc = 0xa081232c, relocation does not work, barebox is located with 8M offset from start of RAM. The board has 256M and relocation routine should move barebox code much higher; * pc = 0xa081232c, so barebox code works from KSEG1 not from KSEG0 as MMU=y option implies. There is a choice of moving .bss clear sequence after __rel_start or remove this optimization. Since the use of this optimization is minimal and danger to trap in to similar issue is still high, i prefer to remove this optimization. As result of this change, we need to fix calculation of relocation are size: relocate_code() calculates relocation area size as a sum (barebox_image_size + bss_len). barebox_image_size and bss_len are calculated as (__image_end - __image_start) and (__bss_stop - __bss_start) respectively. This doesn't take into account relocation data placed between __image_end and __bss_start. However relocation preserves BSS position relative to image start, as if relocation data is still there. This causes RAM overflow during BSS initialization in main_entry(). This problem may be hidden due to the alignment of the `relocaddr`. Reported-by: Antony Pavlov <antonynpavlov@gmail.com> Fixes: 1e5aef61fc6a444 ("MIPS: reloc: init bss and cpu") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: actually use CONFIG_MIPS_RELOCATION_TABLE_SIZEAntony Pavlov2020-01-161-1/+1
| | | | | | | | | The commit 28ed10d6a67c9 ("MIPS: relocation: add relocation support") introduce the Kconfig CONFIG_MIPS_RELOCATION_TABLE_SIZE parameter but it is never used. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: dts: rename tplink-mr3020.dts -> ar9331_tl_mr3020.dtsAntony Pavlov2020-01-143-2/+2
| | | | | | | | Linux MIPS uses <soc-name>_<board-name>.dts board dts-file naming scheme so use it in barebox too. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: loongson: rename CPU_LOONGSON1 to CPU_GS232Du Huanpeng2020-01-064-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CPU in the loongson 1b SoC is called GS232. Here is some active chips and it's core: NAME CPU Core(s) The loongson 3 series/server & desktop 3A3000/3B3000 GS464E 64bit x4 3A2000/3B2000 GS464E 64bit x4 3B1500 GS464 64bit x8 3A1000 GS464 64bit x4 The loongson 2 series/low power 2K1000 GS264 64bit x2 2F GS464 64bit x1 2H GS464 64bit x1 The loongson 1 series/embeded 1C101 GS132R 32bit ? 1D GS132 32bit ? 1C GS232 32bit x1 1B GS232 32bit x1 1A GS232 32bit x1 see: [1] http://www.loongson.cn/product/ Signed-off-by: Du Huanpeng <duhuanpeng@loongson.cn> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: Makefile: minor codingstyle fixDu Huanpeng2019-11-271-3/+1
| | | | | | | | it exceeds 80 chararacters per line, but is more readable and agrees agrees with the previous lines. Signed-off-by: Du Huanpeng <duhuanpeng@loongson.cn> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: art: fix typo in SPDX-License-IdentifierOleksij Rempel2019-11-191-1/+1
| | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>