aboutsummaryrefslogtreecommitdiff
path: root/arch/mips
Commit message (Collapse)AuthorAgeFilesLines
* mips: fix change_k0_cca()Daniel Schwierzeck2024-03-131-2/+2
| | | | | | | | | | | | | | | | | | | The intention of change_k0_cca() is to read the C0.Config register into register $t0, update $t0 with the new cache coherency mode passed in $a0 and write back $t0 to C0.Config. With MIPS32 R2 or later instruction sets, this can be achieved with a single instruction with INS. The source and destination register of the INS instruction is passed as first parameter. In case of change_k0_cca() it is register $t0. But for writing back the updated value to C0.Config, the incorrect $a0 register is used. This is only correct in the MIPS32 R1 code path. Fix the `mtc0` instruction to write back the value of the $t0 register. Fix the MIPS32 R1 code path to also store the updated value in $t0. Reported by user ddqxy138 on Github. https://github.com/u-boot/u-boot/commit/b838586086af3278bcaead3720c7a18813cf4619 Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* mips: implement __udivdi3Linus Walleij2024-03-132-1/+18
| | | | | | | | | | | Squashfs wasn't compiling because the lldiv() directives turn into __udivdi3 and we are using private libgcc. After this squashfs compiles for MIPS. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Bartel Eerdekens <barteleerdekens@gmail.com>
* treewide: Remove clk_freeSean Anderson2024-01-291-6/+1
| | | | | | | This function is a no-op. Remove it. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20231216193843.2463779-3-seanga2@gmail.com
* mtd: Make CONFIG_MTD be the gate symbol for the menuTom Rini2024-01-221-0/+2
| | | | | | | | | | | | | The help for CONFIG_MTD explains that it needs to be enabled for various things like NAND, etc to be available. It however then doesn't enforce this dependency and so if you have none of these systems present you still need to disable a number of options. Fix this by making places that select/imply one type of flash, but did not do the same, also do this for "MTD". Make boards which hadn't been enabling MTD already but need it now, do so. In a few places, disable CONFIG_CMD_MTDPARTS as it wasn't previously enabled but was now being implied. Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge patch series "Complete decoupling of bootm logic from commands"Tom Rini2023-12-212-4/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simon Glass <sjg@chromium.org> says: This series continues refactoring the bootm code to allow it to be used with CONFIG_COMMAND disabled. The OS-handling code is refactored and a new bootm_run() function is created to run through the bootm stages. This completes the work. A booti_go() function is created also, in case it proves useful, but at last for now standard boot does not use this. This is cmdd (part d of CMDLINE refactoring) It depends on dm/bootstda-working which depends on dm/cmdc-working
| * bootm: Rename do_bootm_states() to bootm_run_states()Simon Glass2023-12-211-1/+1
| | | | | | | | | | | | | | | | | | Rename the function to bootm_run_states() to better indicate ts purpose. The 'do_' prefix is used to indicate a command processor, which this is now not. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * bootm: Adjust arguments of boot_os_fnSimon Glass2023-12-211-2/+4
| | | | | | | | | | | | | | | | | | | | Adjust boot_os_fn to use struct bootm_info instead of the separate argc, argv and image parameters. Update the handlers accordingly. Few of the functions make use of the arguments, so this improves code size slightly. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * mips: Add a reset_cpu() functionSimon Glass2023-12-211-1/+7
| | | | | | | | | | | | | | The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Signed-off-by: Simon Glass <sjg@chromium.org>
* | global: Rework architecture global_data.h to include <linux/types.h>Tom Rini2023-12-211-1/+1
| | | | | | | | | | | | | | | | | | In most cases, the architecture global data currently makes use of assorted linux types, but does not include <linux/types.h> to provide them. Add <linux/types.h> instead of relying on indirect inclusion. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
* | clk: treewide: switch to clock dump from clk_opsIgor Prusov2023-12-151-23/+0
|/ | | | | | | | | | Switch to using new dump operation in clock provider drivers instead of overriding soc_clk_dump. Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru> Link: https://lore.kernel.org/r/20231109105516.24892-8-ivprusov@sberdevices.ru
* boot: Drop size parameter from image_setup_libfdt()Simon Glass2023-12-131-2/+2
| | | | | | | The of_size parameter is not used, so remove it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* mips: io.h: Add defines for read/write/in/out functionsIgor Prusov2023-11-281-0/+32
| | | | | | | Add defines for {read,write}{b,w,l,q}(), {read,write}s{b,w,l,q}() and {in,out}s{b,w,l,q}() functions to make asm-generic/io.h aware of them. Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
* mips: io.h: Add const to reads functions paramsIgor Prusov2023-11-281-1/+2
| | | | | | | | Currently reads{b,w,l}() functions don't have const qualifier for their address parameter. Since asm-generic/io.h in Linux has const for all read functions, add it here as well to keep signatures in sync. Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
* bmips: Add Inteno XG6846 boardLinus Walleij2023-11-063-0/+70
| | | | | | | | | | This adds support for the Inteno XG6846 board based on the Broadcom MIPS 6328 SoC. The default boot will read a uImage from flash and boot it. Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* mips: Remove common.h usageTom Rini2023-10-2446-47/+4
| | | | | | | We can remove common.h from most cases of the code here, and only a few places need an additional header instead. Signed-off-by: Tom Rini <trini@konsulko.com>
* spl: Use SYS_MALLOC_F instead of SYS_MALLOC_F_LENSimon Glass2023-10-062-4/+4
| | | | | | | | Use the new SPL/TPL/VPL_SYS_MALLOC_F symbols to determine whether the malloc pool exists. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
* event: Use an event to replace last_stage_init()Simon Glass2023-08-312-2/+8
| | | | | | | | | | | | | | Add a new event which handles this function. Convert existing use of the function to use the new event instead. Make sure that EVENT is enabled by affected boards, by selecting it from the LAST_STAGE_INIT option. For x86, enable it by default since all boards need it. For controlcenterdc, inline the get_tpm() function and make sure the event is not built in SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
* event: Convert existing spy records to simpleSimon Glass2023-08-311-8/+2
| | | | | | | | | Very few of the existing event-spy records use the arguments they are passed. Update them to use a simple spy instead, to simplify the code. Where an adaptor function is currently used, remove it where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge tag 'v2023.10-rc3' into nextTom Rini2023-08-212-2/+2
|\ | | | | | | | | | | Prepare v2023.10-rc3 Signed-off-by: Tom Rini <trini@konsulko.com>
| * common: return type board_get_usable_ram_topHeinrich Schuchardt2023-08-152-2/+2
| | | | | | | | | | | | | | | | board_get_usable_ram_top() returns a physical address that is stored in gd->ram_top. The return type of the function should be phys_addr_t like the current type of gd->ram_top. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* | treewide: unify the linker symbol reference formatShiji Yang2023-08-094-4/+4
|/ | | | | | | | | | | Now all linker symbols are declared as type char[]. Though we can reference the address via both the array name 'var' and its address '&var'. It's better to unify them to avoid confusing developers. This patch converts all '&var' linker symbol refrences to the most commonly used format 'var'. Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* mips: octeon: Correct types in cvmx-pko3-queueTom Rini2023-07-202-6/+9
| | | | | | | | | When building with gcc-13.1 we see that the prototype for cvmx_pko3_sq_config_children does not match the declaration. Make these match and correct a typo in the function's version of the docs that the prototype did not have, as part of keeping those in-sync. Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge tag 'v2023.07-rc6' into nextTom Rini2023-07-051-1/+1
|\ | | | | | | Prepare v2023.07-rc6
| * mips: cpu: Use plain puts() in restart handlerMarek Vasut2023-06-241-1/+1
| | | | | | | | | | | | | | This removes dependency on fprintf() , which is not available in SPL unless full printf support is enabled. Signed-off-by: Marek Vasut <marex@denx.de>
* | Merge tag v2023.07-rc4 into nextTom Rini2023-06-121-1/+1
|\| | | | | | | Signed-off-by: Tom Rini <trini@konsulko.com>
| * dm: Emit the arch_cpu_init_dm() even only before relocationSimon Glass2023-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The original function was only called once, before relocation. The new one is called again after relocation. This was not the intent of the original call. Fix this by renaming and updating the calling logic. With this, chromebook_link64 makes it through SPL. Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events") Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | mips: use asm-generic/unaligned.hJens Wiklander2023-05-311-22/+1
|/ | | | | | | | Mips essentially duplicates the content of asm-generic/unaligned.h, so use that file directly instead. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
* dm: dts: Convert driver model tags to use new schemaSimon Glass2023-02-1433-113/+113
| | | | | | | Now that Linux has accepted these tags, move the device tree files in U-Boot over to use them. Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL use of OCTEON_SERIAL_PCIE_CONSOLESimon Glass2023-02-101-1/+1
| | | | | | | This converts 1 usage of this option to the non-SPL form, since there is no SPL_OCTEON_SERIAL_PCIE_CONSOLE defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL use of OCTEON_SERIAL_BOOTCMDSimon Glass2023-02-101-1/+1
| | | | | | | This converts 1 usage of this option to the non-SPL form, since there is no SPL_OCTEON_SERIAL_BOOTCMD defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL use of MIPS_CMSimon Glass2023-02-101-1/+1
| | | | | | | This converts 1 usage of this option to the non-SPL form, since there is no SPL_MIPS_CM defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL uses of BOOTSTAGE_REPORTSimon Glass2023-02-091-1/+1
| | | | | | | This converts 2 usages of this option to the non-SPL form, since there is no SPL_BOOTSTAGE_REPORT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* Correct SPL use of BOOTSTAGE_FDTSimon Glass2023-02-091-1/+1
| | | | | | | This converts 1 usage of this option to the non-SPL form, since there is no SPL_BOOTSTAGE_FDT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
* gpio: Drop unused pca9698 driverSimon Glass2023-02-071-42/+1
| | | | | | This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
* global: Finish CONFIG -> CFG migrationTom Rini2023-01-201-4/+4
| | | | | | | | | | | | | At this point, the remaining places where we have a symbol that is defined as CONFIG_... are in fairly odd locations. While as much dead code has been removed as possible, some of these locations are simply less obvious at first. In other cases, this code is used, but was defined in such a way as to have been missed by earlier checks. Perform a rename of all such remaining symbols to be CFG_... rather than CONFIG_... Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* event: Correct dependencies on the EVENT frameworkTom Rini2023-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The event framework is just that, a framework. Enabling it by itself does nothing, so we shouldn't ask the user about it. Reword (and correct typos) around this the option and help text. This also applies to DM_EVENT and EVENT_DYNAMIC. Only EVENT_DEBUG and CMD_EVENT should be visible to the user to select, when EVENT is selected. With this, it's time to address the larger problems. When functionality uses events, typically via EVENT_SPY, the appropriate framework then must be select'd and NOT imply'd. As the functionality will cease to work (and so, platforms will fail to boot) this is non-optional and where select is appropriate. Audit the current users of EVENT_SPY to have a more fine-grained approach to select'ing the framework where used. Also ensure the current users of event_register and also select EVENT_DYNAMIC. Cc: AKASHI Takahiro <takahiro.akashi@linaro.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Reported-by: Oliver Graute <Oliver.Graute@kococonnector.com> Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com> Fixes: 7fe32b3442f0 ("event: Convert arch_cpu_init_dm() to use events") Fixes: 42fdcebf859f ("event: Convert misc_init_f() to use events") Fixes: c5ef2025579e ("dm: fix DM_EVENT dependencies") Signed-off-by: Tom Rini <trini@konsulko.com> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Fabio Estevam <festevam@denx.de>
* Convert CONFIG_STANDALONE_LOAD_ADDR to KconfigTom Rini2022-12-221-2/+0
| | | | | | | This converts the following to Kconfig: CONFIG_STANDALONE_LOAD_ADDR Signed-off-by: Tom Rini <trini@konsulko.com>
* global: Remove extraneous DM_ETH imply/selectTom Rini2022-12-071-4/+0
| | | | | | | | We only need to enable DM_ETH if we have a networking driver. All networking drivers depend on DM_ETH being enabled, and their selection ensures DM_ETH will be enabled. Signed-off-by: Tom Rini <trini@konsulko.com>
* global: Move remaining CONFIG_SYS_* to CFG_SYS_*Tom Rini2022-12-051-1/+1
| | | | | | | | | | The rest of the unmigrated CONFIG symbols in the CONFIG_SYS namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* global: Move remaining CONFIG_SYS_SDRAM_* to CFG_SYS_SDRAM_*Tom Rini2022-12-057-10/+10
| | | | | | | | | | The rest of the unmigrated CONFIG symbols in the CONFIG_SYS_SDRAM namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* MIPS: convert CONFIG_SYS_MIPS_TIMER_FREQ to KconfigDaniel Schwierzeck2022-11-021-0/+18
| | | | | | | | This converts the following to Kconfig: CONFIG_SYS_MIPS_TIMER_REQ Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
* MIPS: remove CONFIG_SYS_MHZDaniel Schwierzeck2022-11-022-6/+2
| | | | | | | | | Resolve all uses of CONFIG_SYS_MHZ with the currently defined value. Remove code which depends on CONFIG_SYS_MHZ but where no board configs actually use that code. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
* MIPS: remove deprecated TARGET_VCT optionDaniel Schwierzeck2022-11-021-8/+0
| | | | | | | This board has been removed a long time ago. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
* Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASESimon Glass2022-10-313-4/+4
| | | | | | | | | The current name is inconsistent with SPL which uses CONFIG_SPL_TEXT_BASE and this makes it imposible to use CONFIG_VAL(). Rename it to resolve this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
* treewide: Drop image_header_t typedefSimon Glass2022-09-293-7/+7
| | | | | | | This is not needed and we should avoid typedefs. Use the struct instead and rename it to indicate that it really is a legacy struct. Signed-off-by: Simon Glass <sjg@chromium.org>
* treewide: Drop bootm_headers_t typedefSimon Glass2022-09-291-8/+8
| | | | | | This is not needed and we should avoid typedefs. Use the struct instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* board_f: Fix types for board_get_usable_ram_top()Pali Rohár2022-09-232-2/+2
| | | | | | | | | | | | | | Commit 37dc958947ed ("global_data.h: Change ram_top type to phys_addr_t") changed type of ram_top member from ulong to phys_addr_t but did not changed types in board_get_usable_ram_top() function which returns value for ram_top. So change ulong to phys_addr_t type also in board_get_usable_ram_top() signature and implementations. Fixes: 37dc958947ed ("global_data.h: Change ram_top type to phys_addr_t") Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* mips: mtmips: add two reference boards for mt7621Weijie Gao2022-07-134-0/+171
| | | | | | | | | | | | | The mt7621_rfb board supports integrated giga PHYs plus one external giga PHYs. It also has up to 512MiB DDR3, 16MB SPI-NOR, 3 mini PCI-e x1 slots, SDXC and USB. The mt7621_nand_rfb board is almost the same as mt7621_rfb board, but it uses NAND flash and SDXC is not available. Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
* mips: mtmips: add support for MediaTek MT7621 SoCWeijie Gao2022-07-1325-6/+2643
| | | | | | | | | | | | | This patch adds support for MediaTek MT7621 SoC. All files are dedicated for u-boot. The default build target is u-boot-mt7621.bin. The specification of this chip: https://www.mediatek.com/products/homenetworking/mt7621 Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
* mips: add support for noncached_alloc()Weijie Gao2022-07-132-0/+63
| | | | | | | | | | | | | | This patch adds support for noncached_alloc() which was only supported by ARM platform. Unlike the ARM platform, MMU is not used in u-boot for MIPS. Instead, KSEG is provided to access uncached memory. So most code of this patch is copied from cache.c of ARM platform, with only two differences: 1. MMU is untouched in noncached_set_region() 2. Address returned by noncached_alloc() is converted using KSEG1ADDR() Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>