summaryrefslogtreecommitdiffstats
path: root/arch/mips
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * MIPS: remove useless board filesOleksij Rempel2018-12-1714-182/+0
| | | | | | | | | | | | | | | | | | In most cases we was executing only barebox_set_hostname(). Since we can extract host name from devicetree, we can drop all of this board files. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: remove HAS_NO_BOARD_HL_CODE supportOleksij Rempel2018-12-173-7/+0
| | | | | | | | | | | | | | | | With multiimage support it makes no more sense, every board should have Makefile and some lowlevel code. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: port all mach* to multiimageOleksij Rempel2018-12-1751-613/+219
| | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: put main_entry to __bare_init sectionOleksij Rempel2018-12-131-1/+2
| | | | | | | | | | | | | | | | | | To make disassambly easier to read. With this patch main_entry will be at the start of the text section and not in the middle. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: mutliimage: pass devicetree from PBL to the main_entryOleksij Rempel2018-12-134-12/+31
| | | | | | | | | | | | | | We need it for multiimage support. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: multiimage: add ENTRY_FUNCTION macrosOleksij Rempel2018-12-131-0/+29
| | | | | | | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: start: preserve DTB pointer for later useOleksij Rempel2018-12-131-0/+7
| | | | | | | | | | | | | | | | | | We will get DTB pointer in a0 register. Since a0 is used as argument by other functions, we need to preserve it and then pass as argument to the main_entry(). Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: add arch/mips/lib/pbl.lds.SOleksij Rempel2018-12-131-0/+53
| | | | | | | | | | | | | | we need it for multiimage support. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: remove blank textsMasahiro Yamada2019-01-031-1/+0
|/ | | | | | | | | | | These should be fixed before the Kconfig resync because Linux 4.16 or later warns it. Refer to Linux commit 1b9eda2e4892 ("kconfig: Warn if help text is blank"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-12-071-1/+1
|\
| * Make: Add -Wmissing-prototypesSascha Hauer2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wmissing-prototypes is a useful warning, so add it to the build. With this we can detect conflicting function prototypes. When a file implements a function but doesn't include the header file which provides the prototype for it then conflicting prototypes would go unnoticed without this warning. MIPS already had that warning, so we can remove it from the MIPS Makefile. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kconfig: include common Kconfig files from top-level KconfigAntony Pavlov2018-12-031-8/+0
|/ | | | | | | | | | | | | Based on this linux kernel commit: > commit 1572497cb0e6d2016078bc9d5a95786bb878389f > Author: Christoph Hellwig <hch@lst.de> > Date: Tue Jul 31 13:39:30 2018 +0200 > > kconfig: include common Kconfig files from top-level Kconfig Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: fix PCI quirk infrastructure buildAntony Pavlov2018-09-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | The commit fc2c618c2038 ("pci: add quirk infrastructure") adds necessary ld-script changes only for ARM architecture. As a result, qemu-malta build fails: LD barebox drivers/built-in.o: In function `pci_fixup_device': (.text.pci_fixup_device+0x30): undefined reference to `__end_pci_fixups_enable' (.text.pci_fixup_device+0x38): undefined reference to `__end_pci_fixups_enable' (.text.pci_fixup_device+0x34): undefined reference to `__start_pci_fixups_enable' (.text.pci_fixup_device+0x3c): undefined reference to `__start_pci_fixups_enable' (.text.pci_fixup_device+0x70): undefined reference to `__end_pci_fixups_header' (.text.pci_fixup_device+0x78): undefined reference to `__end_pci_fixups_header' (.text.pci_fixup_device+0x74): undefined reference to `__start_pci_fixups_header' (.text.pci_fixup_device+0x80): undefined reference to `__start_pci_fixups_header' (.text.pci_fixup_device+0x2c): undefined reference to `__end_pci_fixups_early' (.text.pci_fixup_device+0x88): undefined reference to `__end_pci_fixups_early' (.text.pci_fixup_device+0x84): undefined reference to `__start_pci_fixups_early' (.text.pci_fixup_device+0x90): undefined reference to `__start_pci_fixups_early' make: *** [Makefile:767: barebox] Error 1 Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/riscv'Sascha Hauer2018-07-096-120/+3
|\
| * MIPS: Use generic GCC library routines from lib/Antony Pavlov2018-06-296-120/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a port of Linux kernel commit | commit 740129b36faf049e6845819144542a0455e1e285 | Author: Antony Pavlov <antonynpavlov@gmail.com> | Date: Wed Apr 11 08:50:19 2018 +0100 | | MIPS: Use generic GCC library routines from lib/ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mips'Sascha Hauer2018-07-0914-31/+160
|\ \
| * | MIPS: don't include generated header files into MIPS asm filesAntony Pavlov2018-07-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch came out of discussions in the 'MIPS parallel build breakage' e-mail thread: http://lists.infradead.org/pipermail/barebox/2018-March/032251.html Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: dts: fix dtc unit_address_vs_reg warningAntony Pavlov2018-06-255-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unit number is added to the /memory nodes to fix this dtc warning: Warning (unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit name Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: dts: drop skeleton.dtsiAntony Pavlov2018-06-258-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on feedback from Sascha: http://lists.infradead.org/pipermail/barebox/2018-April/032694.html " skeleton.dtsi should no longer be used " Several reasons to remove skeleton.dtsi are explained in the linux commit 3ebee5a2e141 ("arm64: dts: kill skeleton.dtsi"). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: dts: dpt-module: add Atheros ART partitionOleksij Rempel2018-06-141-0/+11
| | | | | | | | | | | | | | | | | | | | | and define it as source of MAC address for ag71xx driver Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: dts: tl_wdr4300: add Atheros ART partitionOleksij Rempel2018-06-141-0/+11
| | | | | | | | | | | | | | | | | | | | | and define it as source of MAC address for ag71xx driver Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | MIPS: ath79: provide driver for Atheros ART partitionOleksij Rempel2018-06-142-0/+113
| |/ | | | | | | | | | | | | | | | | | | this partition contains calibration data for WiFi and some board specific data, like MAC address. For now we care only about MAC. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dts-warnings'Sascha Hauer2018-07-095-5/+5
|\ \
| * | ARM: dts: remove @0 from environment nodesSascha Hauer2018-06-195-5/+5
| |/ | | | | | | | | | | | | The environment nodes do not have a reg property and as such should not have a @0 suffix. Newer dtc warns about this, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/bootm'Sascha Hauer2018-07-092-0/+60
|\ \ | |/ |/|
| * MIPS: bootm: add ELF handlerOleksij Rempel2018-06-182-0/+60
| | | | | | | | | | | | | | | | With this handler barebox will be able to start linux kernel as is, without additional image conversion. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>