summaryrefslogtreecommitdiffstats
path: root/arch/mips
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/rsa'Sascha Hauer2019-10-171-41/+4
|\
| * lds: Add and use RO_DATA_SECTION macroSascha Hauer2019-10-141-12/+4
| | | | | | | | | | | | | | | | | | We have many different pointer arrays which we put into linker sections and each time there's one added we have to adjust all linker scripts. This adds a common RO_DATA_SECTION define and uses it for all architectures. This makes it easier to add a new linker array. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lds: create and use BAREBOX_PCI_FIXUP macroSascha Hauer2019-10-141-13/+1
| | | | | | | | | | | | | | No need to repeat the pci fixup sections in each linker script. Add a define for it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * lds: Move start/end address variables into definesSascha Hauer2019-10-141-19/+2
| | | | | | | | | | | | | | | | | | | | | | For the older section defines we specify the start and end addresses outside the macro which means we have to repeat them in each linker script. Make the start/end addresses part of the define to simplify things. While at it, add a BAREBOX_ prefix to the INITCALLS and EXITCALLS macros for consistency to the other defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sam Ravnborg <sam@ravnborg.org>
| * barebox.lds: Remove unnecessary bracesSascha Hauer2019-10-141-2/+2
| | | | | | | | | | | | | | The BAREBOX_CLK_TABLE and BAREBOX_DTB macros are defines that do not take a parameter, so we can remove the braces. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: net: ag71xx/ar9331: partially sync network support with upstreamOleksij Rempel2019-10-143-15/+8
|/ | | | | | | | | | | | | Ethernet support for ar9331 is upstream now. So, drop every thing what is provided by upstream devicetree and rename compatible in the driver. barebox network driver will need more work to be upstream compliant. For example we should not request or touch the gmac register directly. Since currently it is not clear how this should be implemented, patch the upstream dts with reg-names = "ge0", "gmac". Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-09-121-1/+1
|\
| * mips: bootm: Cast elf entry into unsigned longClement Leger2019-09-061-1/+1
| | | | | | | | | | | | | | | | | | Since elf entry type is now a u64 to accomodate both type of elf files (64 and 32 bits), we need to cast it to the pointer length before casting it to the pointer type. Signed-off-by: Clement Leger <cleger@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2019-09-122-0/+11
|\ \
| * | MIPS: ath79: enable gpio key support.Oleksij Rempel2019-08-281-0/+1
| | | | | | | | | | | | | | | | | | | | | Most of ath79 devices have at least one gpio key. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: dts: dpt-module: fix gpio buttonOleksij Rempel2019-08-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | GPIO11 is set to 0 by default and there is no internal pull ups to set a different configuration. To fix the system with gpio-key activated we need to fix devicetree first. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: ath79: enable watchdog supportOleksij Rempel2019-08-281-0/+4
| |/ | | | | | | | | | | | | all ath79 based SoCs have watchdog. Make sure, it can be used. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Kconfig: retire empty <asm/barebox.h>Ahmad Fatoum2019-08-301-6/+0
| | | | | | | | | | | | | | With the latest changes, this file is empty on all archs. Drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Kconfig: create Kconfig symbol for ARCH_HAS_DATA_ABORT_MASKAhmad Fatoum2019-08-302-2/+1
|/ | | | | | | | Other arch-specific features are exposed in Kconfig too, so do here likewise. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mips: use generic bitsperlong.hMasahiro Yamada2019-08-121-6/+1
| | | | | | | | | | | | | | | | | | | Linux highly depends on the fact that the 'long' and the pointer have the same width, and so does barebox. So, we can always use include/asm-generic/bitsperlong.h, which determines BITS_PER_LONG depending on CONFIG_64BIT. This is what Linux does (at least in the kernel-space), and barebox can follow it. It is true that MIPS Linux references _MIPS_SZLONG (arch/mips/include/uaspi/asm/bitsperlong.h), but this is bacause the user-space cannot reference CONFIG options. For the kernel-space, it uses the generic definition from include/asm-generic/bitsperlong.h. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-07-125-7/+0
|\
| * Regenerate defconfig filesSascha Hauer2019-06-265-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update defconfig files with the following script. for a in arch/*; do arch=$(basename $a) for c in $a/configs/*; do config=$(basename $c) export ARCH=$arch make $config && make savedefconfig && mv defconfig $c done done Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | mips: reloc: remove outdated commentOleksij Rempel2019-07-021-11/+0
| | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: dts: tplink-mr3020: add missing stdout-path propertyAntony Pavlov2019-06-261-0/+2
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: Kconfig: move ARCH_TEXT_BASE to top mips Kconfig fileAntony Pavlov2019-06-267-24/+4
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: relocate_code: fix barebox image memcpy() sizeAntony Pavlov2019-06-201-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this relocate_code() piece 'length' is greater than 'barebox_image_size': #define MAX_BSS_SIZE SZ_1M ... length = barebox_image_size + MAX_BSS_SIZE; relocaddr = ALIGN_DOWN(ram_size - barebox_image_size, SZ_64K); ... memcpy((void *)relocaddr, __image_start, length); so 'ram_size' overflow occurs during memcpy(). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Tested-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: lib/Makefile: fix whitespacesAntony Pavlov2019-06-201-2/+2
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: fix 'assignment makes integer from pointer without a cast' warningAntony Pavlov2019-06-171-1/+1
|/ | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: use anonymous labels in ENTRY_FUNCTION_END and STOP_WITH_DEBUG_EVENT ↵Peter Mamonov2019-06-071-4/+4
| | | | | | | | | | | | macros Use of global labels of the same name inside ENTRY_FUNCTION_END and STOP_WITH_DEBUG_EVENT prevents simultaneous use of both macros. It also prevents multiple use of one of them. Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: replace '---help---' with 'help' in Kconfig filesMasahiro Yamada2019-05-171-1/+1
| | | | | | | | | | | | | | | | In Linux, '---help---' was deprecated in favor of 'help', and this is checked by the recent checkpatch.pl See Linux commit 84af7a6194e493fae312a2b7fa5a3b51f76d9282 The number of '---help---' is gradually decreasing in Linux, but there are still lots. However, '---help---' will be completely killed when the time comes. Fortunately, there are only some in Barebox. Replacing them is not hard. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add KBUILD_DEFCONFIG to allow "make defconfig"Masahiro Yamada2019-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | Currently, "make defconfig" is only supported for sandbox and x86. I set KBUILD_DEFCONFIG to support "make defconfig" where I was able to find a suitable one. nios2 and openrisc have a single generic_defconfig, so it is definitely good for KBUILD_DEFCONFIG. For arm, mips, I assume qemu is a preferred choice over a real board. blackfin has only one defconfig. Since it is inactive (it is gone in Linux), so no more defconfig will come in. I am not sure about ppc and riscv, so I did not touch them. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: remove request_sdram_region "fdt"Oleksij Rempel2019-04-231-4/+0
| | | | | | | It is actually not needed at barebox runtime Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: relocation: do not use configurable memory layoutOleksij Rempel2019-04-236-12/+41
| | | | | | | | | The relocator is not able to patch properly new location of the stack. To make it work properly it is better to disable HAVE_CONFIGURABLE_MEMORY_LAYOUT. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: relocation: add relocation supportOleksij Rempel2019-04-2310-7/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch i a port of following patch from u-boot with some additional integration changes and fixes of original code: | Subject: [PATCH] MIPS: Stop building position independent code | | U-Boot has up until now built with -fpic for the MIPS architecture, | producing position independent code which uses indirection through a | global offset table, making relocation fairly straightforward as it | simply involves patching up GOT entries. | | Using -fpic does however have some downsides. The biggest of these is | that generated code is bloated in various ways. For example, function | calls are indirected through the GOT & the t9 register: | | 8f998064 lw t9,-32668(gp) | 0320f809 jalr t9 | | Without -fpic the call is simply: | | 0f803f01 jal be00fc04 <puts> | | This is more compact & faster (due to the lack of the load & the | dependency the jump has on its result). It is also easier to read & | debug because the disassembly shows what function is being called, | rather than just an offset from gp which would then have to be looked up | in the ELF to discover the target function. | | Another disadvantage of -fpic is that each function begins with a | sequence to calculate the value of the gp register, for example: | | 3c1c0004 lui gp,0x4 | 279c3384 addiu gp,gp,13188 | 0399e021 addu gp,gp,t9 | | Without using -fpic this sequence no longer appears at the start of each | function, reducing code size considerably. | | This patch switches U-Boot from building with -fpic to building with | -fno-pic, in order to gain the benefits described above. The cost of | this is an extra step during the build process to extract relocation | data from the ELF & write it into a new .rel section in a compact | format, plus the added complexity of dealing with multiple types of | relocation rather than the single type that applied to the GOT. The | benefit is smaller, cleaner, more debuggable code. The relocate_code() | function is reimplemented in C to handle the new relocation scheme, | which also makes it easier to read & debug. | | Taking maltael_defconfig as an example the size of u-boot.bin built | using the Codescape MIPS 2016.05-06 toolchain (gcc 4.9.2, binutils | 2.24.90) shrinks from 254KiB to 224KiB. | | Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: relocation: pass ram size to pbl_main_entryOleksij Rempel2019-04-2312-13/+25
| | | | | | | | To make barebox dynamically relocatable it should know the RAM size to be able to calculate proper new location. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-04-091-6/+6
|\
| * treewide: surround Kconfig file paths with double quotesMasahiro Yamada2019-03-211-6/+6
| | | | | | | | | | | | | | | | | | Based on Linux commit 8636a1f9677db4f883f29a072f401303acfc2edd This will be needed when you sync Kconfig with Linux 5.0 or later. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/lseek'Sascha Hauer2019-04-081-2/+2
|\ \
| * | MIPS: ath79: Use errno to get error code from open_and_lseek()Andrey Smirnov2019-03-111-2/+2
| |/ | | | | | | | | | | | | | | Open_and_lseek() return actual error code via errno, so change the code to use it instead of return value. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / pbl multiimage: Allow to check image sizesSascha Hauer2019-03-131-0/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PBL images are often constrained in size by limitations exposed by the SoCs SRAM size or partition sizes on the boot device. So far we tried to configure these limits in Kconfig, but with PBL multi images and thus different limitations for the different supported images this no longer works. This patch has another approach for it: During build time make variables containing the relevant sizes for each image are created. These are: PBL_CODE_SIZE_$(symbol) PBL_MEMORY_SIZE_$(symbol) PBL_IMAGE_SIZE_$(symbol) PBL_CODE_SIZE_$(symbol) contains the pure code size of the PBL, it should be smaller than the available SRAM during boot. Normally the PBL's bss segment also needs to be in the initial SRAM, for this case PBL_MEMORY_SIZE_$(symbol) is the relevant variable. PBL_IMAGE_SIZE_$(symbol) contains the full size of the PBL image including the compressed payload (but without any image headers created later by SoC specific image tools). $(symbol) is a placeholder for the start symbol used for this PBL image, thus for the i.MX53 QSB with entry start_imx53_loco PBL_CODE_SIZE_start_imx53_loco will be created. The images/Makefile.* can use these variables directly to check sizes or specify the same variables with a "MAX_" prefix. So when images/Makefile.imx specifies MAX_PBL_CODE_SIZE_start_imx53_loco = 0x10000 then the build system will make sure that the PBL code for the QSB will not get bigger than 64KiB. Also included in this patch are the size restrictions for the i.MX8MQ images as an example how to use this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: ath79: increase malloc size to 8 MiBOleksij Rempel2019-02-271-0/+1
| | | | | | | with 4 MiB we are not able even to start latest kernel. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/pci'Sascha Hauer2019-02-131-1/+2
|\
| * PCI: Convert ->res_start() to return resource_size_tAndrey Smirnov2019-01-161-1/+2
| | | | | | | | | | | | | | | | | | | | On 64-bit machines int doesn't cover full address space, so convert .res_start to both accept resource_size_t as a parameter and return it as result. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-02-131-35/+0
|\ \
| * | move umode_t typedef from asm/types.h to linux/types.hAntony Pavlov2019-01-181-6/+0
| | | | | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: asm/types.h: drop unused stuffAntony Pavlov2019-01-181-29/+0
| |/ | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: ath79: add spi and sram bootstrap helpersOleksij Rempel2019-01-247-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least some ath79 SoC have build in 32K RAM. It allow us to use lowlevel portion of barebox to bootstrap the system by using JTAG debugger (For example OpenOCD). Since ath79 has no reliable way to stop the CPU execution before reading SPI Flash, this can cause different issues. To avoid it, we need to flash a execution trap with software debug breakpoint to the flash. The workflow should be as follow: - After power on or reset the CPU will start execution of SPI flash. As soon as software debug breakpoint is executed, CPU will halt and notify OpenOCD about breakpoint event. - OpenOCD will load reduced barebox to SRAM and execute it. This part will do all needed low level initialization - PLL, RAM and trigger second breakpoint event. - OpenOCD will load full barebox version to the main RAM and start execution. It can be used for bring-up, so no regular flashing is needed. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: black-swift: use ar9331_pbl_generic_startOleksij Rempel2019-01-241-28/+1
| | | | | | | | | | | | | | | | most ar9331 boards are almost identical. Remove as much duplicate code as possible. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: tplink-mr3020: use ar9331_pbl_generic_startOleksij Rempel2019-01-241-28/+1
| | | | | | | | | | | | | | | | most ar9331 boards are almost identical. Remove as much duplicate code as possible. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: drop *_MULTI_BOARDS atavismsAntony Pavlov2019-01-223-10/+0
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: malta: Typo fixAlexander Shiyan2019-01-211-1/+1
|/ | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mips'Sascha Hauer2019-01-15131-1781/+596
|\
| * MIPS: update to GPL-2.0-or-later for files copyrighted by meOleksij Rempel2019-01-035-5/+5
| | | | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: convert files with not precise GNU version to SPDXOleksij Rempel2019-01-0319-78/+19
| | | | | | | | | | | | | | | | | | Default barebox license is GPL-2.0-only. Set it to the files with the missing one. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: migrate all files to SPDXOleksij Rempel2019-01-0365-717/+65
| | | | | | | | | | | | Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Reviewed-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>