summaryrefslogtreecommitdiffstats
path: root/arch/mips/boot/main_entry.c
Commit message (Collapse)AuthorAgeFilesLines
* MIPS: main_entry: remove exception vector arrayDenis Orlov2023-07-271-31/+8
| | | | | | | | | | | | | | | | | | | | This code must have been taken from Linux, where such a mechanism allows for an efficient exception vector replacement for board-specific code. We don't really need that. If some extensions for exception vector are to be required, this may be done inside the generic handler code anyway. As we are not using this code, it seems reasonable to just remove it. Also properly calculate the size of the handler that we are copying into the designated vectors. Originally, we just made a copy of a fixed size, copying more than actually needed. We could have just hardcoded this value there, as the code to copy now consists of just two instructions. However it feels more safe to calculate that in code instead, so that we don't have to update this value if some code is added there in the future. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230725050618.3451-17-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: main_entry: properly set XTLB handler for 64-bit modeDenis Orlov2023-07-271-3/+1
| | | | | | | | | | | | | | | The offset of the TLB Load exception is different when 64-bit addressing is enabled - 0x80 is used instead of 0x0. To simplify things, just copy the handler code twice, for each of the cases. While at it, also remove the incomprehensible cpu_has_4kex check. All of the supported CPUs have MIPS R4K compatible exception handling scheme (and we even hardcode that), so what are we trying to achieve there anyway? Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230725050618.3451-16-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: fix addresses of exception vectors in 64-bit modeDenis Orlov2023-06-091-1/+1
| | | | | | | | | | Do not (accidentally?) truncate addresses when setting them in the handler array. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605202634.42175-10-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: boot: main_entry: use malloc_end instead of _stextAhmad Fatoum2023-06-061-1/+1
| | | | | | | | | | GCC is not fond of subtracting from array base address. The code already defines and uses a malloc_end pointer, so let's use that instead to rid us of the warning. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605062939.242063-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: move r4k_cache_init in to cpu_probe functionOleksij Rempel2019-10-231-6/+0
| | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> 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: relocation: do not use configurable memory layoutOleksij Rempel2019-04-231-2/+15
| | | | | | | | | 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: migrate all files to SPDXOleksij Rempel2019-01-031-14/+1
| | | | | | 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: 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-131-2/+8
| | | | | | | 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: drop redundant start_barebox() declarationAntony Pavlov2016-11-081-1/+0
| | | | | | | The start_barebox() function is defined in the <common.h> header file. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mips: initialize malloc pool before start_barebox()Sascha Hauer2013-03-141-0/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: main_entry.c: fix typoAntony Pavlov2012-11-191-1/+0
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: add initial exceptions handlingAntony Pavlov2012-07-271-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | Checking exception handling: $ make qemu-malta_defconfig $ make ... $ qemu-system-mips -nodefaults -M malta -m 256 \ -nographic -serial stdio -bios ./barebox.bin ... barebox:/ md -l 0x03 Ooops, address error on load or ifetch! EPC = 0xa082783c CP0_STATUS = 0x00000006 CP0_CAUSE = 0x00000410 CP0_CONFIG = 0x80008482 ### ERROR ### Please RESET the board ### Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: import CPU and cache detection code from Linux 3.4Antony Pavlov2012-05-231-0/+9
| | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MIPS: introduce C architecture-specific low-level initAntony Pavlov2012-05-231-0/+43
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>