blk_dwrite/blk_derase returns the number of blocks
written/erased. The existing check allowed partial
writes or partial erase to be considered successful.
Fix error handling of blk_dwrite/blk_derase by checking
that return value corresponds to the number of blocks
written/erased.
Signed-off-by: Francois Berder <fberder@outlook.fr>
iMX8MP added 4 new variant parts for low cost industrial and HMI.
The parts disabled HIFI DSP and ISP while other functions are enabled.
Part number:
- MIMX8ML2DVNLZAB and MIMX8ML2CVNKZAB (2-core)
- MIMX8ML5DVNLZAB and MIMX8ML5CVNKZAB (4-core)
Signed-off-by: Ye Li <ye.li@nxp.com>
The variable `pend_tab_total_sz` is calculated using the macro
`LPI_PENDBASE_SZ`, which depends on the global variable `lpi_id_bits`.
However, `lpi_id_bits` is initialized later in the function based on
the GICD_TYPER register. This results in `pend_tab_total_sz` being
calculated with an uninitialized `lpi_id_bits` value (0), This leads
to the LPI pending tables being mapped with an incorrect size.
Fixes: 60b9b47d29 ("Revert "arch: arm: use dt and UCLASS_SYSCON to get gic lpi details"")
Signed-off-by: Lyrix liu <lyrix.liu@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
The TQMa6UL[L]x is a family of SoMs based on the i.MX6UL[L] SoCs.
They are available either with board connectors or as LGA packages
with solder balls. Add Support for the SoM and its combination with
our MBa6ULx carrier board. For use with the MBa6ULx carrier board,
the LGA variant is soldered onto an adapter board.
Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>
Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
Add boot phase properties from U-Boot device tree.
Patches are integrated into Linux v7.1-rc1.
Revert this commit once the upstream linux device trees are
synchronized.
Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
The watchdog base addresses are now obtained from the devicetree via
ofnode_* functions. Remove the hardcoded macro definitions as they are
no longer needed.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Replace hardcoded WDOG_BASE_ADDR with driver model based dynamic address
lookup from device tree, allowing reset_cpu() to dynamically locate
watchdog devices from device tree.
This change also enables CONFIG_WDT for relevant boards and ensures the
watchdog nodes are available for driver model usage.
- Remove hardcoded WDOG_BASE_ADDR from hw_watchdog_* functions
- Reimplement reset_cpu() using UCLASS_WDT device iteration
- Add ulp_wdt_expire_now() callback for standard WDT interface
- Pass wdog register pointer to hw_watchdog_set_timeout()
- Enable CONFIG_WDT for boards using ULP watchdog
- Remove wdog3 status = "disabled" overrides from U-Boot device tree
overlays, as the watchdog device needs to be accessible for driver
model based reset functionality.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com> # Toradex boards
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Replace hardcoded watchdog base addresses with dynamic address lookup
from device tree for i.MX7ULP, i.MX8ULP, i.MX91, i.MX93, i.MX943, i.MX95
and i.MX952.
Move i.MX7ULP watchdog initialization from s_init() to
arch_cpu_init() because ofnode_* APIs depend on FDT, which is not
available during s_init().
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Update watchdog device tree nodes to enable dynamic base address
retrieval for i.MX7ULP, i.MX8ULP, i.MX91, i.MX93, i.MX943, i.MX95 and
i.MX952. This allows the bootloader to obtain watchdog base addresses
from the device tree instead of using hardcoded values.
- imx7ulp: Add wdog2 node
- imx8ulp: Mark wdog3 available
- imx91/imx93: Add wdog4 and wdog5 nodes
Mark wdog3/wdog4/wdog5 available
- imx943: Add wdog4 node and mark wdog3/wdog4 available
- imx95/imx952: Add wdog4 node and mark wdog3/wdog4 available
Watchdog nodes are marked with "bootph-all" to ensure availability
during early boot stages when init_wdog() occurs.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Enable OF_UPSTREAM and remove local device tree files in favor of
upstream device trees from Linux kernel.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Switch the i.MX93 FRDM board to use the upstream device tree instead of
maintaining a local copy.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Migrate i.MX91 boards to use OF_UPSTREAM feature, which allows U-Boot
to directly use device trees from the Linux kernel upstream.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Migrate i.MX7ULP boards to use OF_UPSTREAM feature, which allows U-Boot
to directly use device trees from the Linux kernel upstream.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
In Upstream Linux, the board dts is imx8mp-msc-sm2s-ep1.dts which is
also showed in msc_sm2s_imx8mp_defconfig:CONFIG_DEFAULT_FDT_FILE.
Upstream file imx8mp-msc-sm2s.dtsi is almost same as U-Boot
imx8mp-msc-sm2s.dts, so directly use imx8mp-msc-sm2s-ep1.dts as U-Boot
device tree and rename the u-boot.dtsi to
imx8mp-msc-sm2s-ep1-u-boot.dtsi.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
The U-Boot copy of the board device trees for this board is almost same as
the ones in dts/upstream except some differences in display which not
impact U-Boot as of now, so switch to the board to OF_UPSTREAM, by dropping
the U-Boot copies and selecting OF_UPSTREAM.
There are some changes in imx8mm-tqma8mqml.dtsi regarding sdhc2 supply,
select DM_PMIC_PCA9450, DM_REGULATOR_PCA9450 and SPL_DM_REGULATOR_PCA9450
to avoid breaking sd.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
The U-Boot copy of the board device trees for this board is same as the
ones in dts/upstream, so switch to the board to OF_UPSTREAM, by dropping
the U-Boot copies and selecting OF_UPSTREAM.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/dts/imx8mm-icore-mx8mm[ctouch2.dts,edimm2.2.dts] are same as
the one in dts/upstream, so drop the copy and switch to OF_UPSTREAM by
updating config and selecting OF_UPSTREAM.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Caleb Ethridge <caleb.ethridge@analog.com> says:
This series performs a general cleanup of the default U-boot environment
for sc5xx boards, stemming from the decision to no longer store the
environment in the SPI flash. The environments for each board have been
edited to contain the minimum number of commands needed for all supported
boot modes to avoid confusion, and the default boot command synced to spi
for all boards that support it. The filesystem for the SPI flash has also
been changed from jffs2 to ubifs.
A bug with the Ethernet reset line on the sc594 has been fixed, and the
sc573 has been renamed from the EZKIT to the EZLITE to match the name of the
publically available board. EZKIT was only used internally before release.
Preliminary binman support for sc5xx boards has been removed as it was unused
and full support never added.
Link: https://lore.kernel.org/r/cover.1779370141.git.caleb.ethridge@analog.com
On hardware architectures, we need to treat start.o (generated from
start.S) very special due to the constraints of being a program running
on hardware in an unknown state. These objects are treated a little
different than the rest by the linker and linker scripts on various
architectures.
Sandbox is different, and doesn't need to do that. In fact, it can lead
to hard to diagnose problems because of just how subtly different the
treatment is. For example, the comment about LTO in include/event.h
introduced with commit 87a5d1b5d0 ("event: Add basic support for
events") was only a sandbox issue because of the event in start.c and
in turn linking start.o isn't treated the same way as an archive with
all its sections considered.
Correct all of this by removing the "head-" lines for cpu.o and sdl.o
from arch/sandbox/Makefile (and unused cmd_cc_sdl.o lines) and change
arch/sandbox/cpu/Makefile to treating them both with "obj-" and not
"extra-".
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Remove SC5XX_UBOOT_SPL_OFFSET, SC5XX_UBOOT_OFFSET, SC5XX_FITIMAGE_OFFSET
and SC5XX_ROOTFS_OFFSET as they are no longer needed in the Kconfig.
Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Remove the SC5XX_LOADADDR Kconfig option, replace its users with
CONFIG_SYS_LOAD_ADDR, and update the ADI boot environment to use
`loadaddr`.
SC5XX_LOADADDR was an ADI-specific duplicate of standard U-Boot
load address handling. U-Boot already uses CONFIG_SYS_LOAD_ADDR
for the default load address and `loadaddr` for boot commands,
so keeping separate SC5XX-specific names is redundant.
Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
Rename the SC573 EZKIT board to EZLITE across the device tree,
defconfig, board file, and related Kconfig/Makefile entries to
match with release naming. EZKIT was used internally before the
official product release.
Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
The gige-reset line on the EZKIT was updated for the
sc598 but not the sc594. This commit aligns the two .dts
files since they are describing the same hardware, the
EZKIT carrier board.
Fixes: be7937847b ("board: adi: Add support for SC594")
Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Remove preliminary binman support from all sc5xx ADSP boards.
Full support was never added because it was unused.
Signed-off-by: Caleb Ethridge <caleb.ethridge@analog.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
tsec_private should, as its name suggests, be private. In the next
commit, it'll be moved from a publicly available header file to the C
file that requires it. ls102xa currently does not allow us to do that
because it uses the structure.
The flag is actually set if the Ethernet PHY interface is SGMII in
drivers/net/tsec.c, so simply replace the current check with the same
check made in drivers/net/tsec.c to set the flag.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Add rcfg_yaml_tifs node override to use tifs-rm-cfg.yaml instead of
the default rm-cfg.yaml for the phyCORE-AM62x SoM.
This enables binman to include the tifs-rm-cfg.yaml configuration
when building tiboot3 images, bringing the phyCORE-AM62x SoM in line
with other K3 devices that already use tifs-rm-cfg.yaml.
This builds on the tifs-rm-cfg file added earlier in this series.
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Ernest Van Hoecke <ernestvanhoecke@gmail.com> says:
This series updates the Resource Management configuration for Toradex
K3-based boards and makes sure the TIFS-specific RM configuration is
used where applicable.
For Verdin AM62P, the tifs-rm-cfg.yaml file is refreshed with
k3-resource-partition V12.00.00 so that it stays in sync with the
existing rm-cfg.yaml update for the v11.02.09 and v12.00.00 TIFS
firmware resource reservation.
For Verdin AM62, the missing tifs-rm-cfg.yaml file is added. The file
matches the TI AM62x configuration, and rm-cfg.yaml was verified to
remain unchanged when regenerated with the same tool version.
For Aquila AM69, both rm-cfg.yaml and tifs-rm-cfg.yaml are updated to
match the resource allocation changes already present in the TI J784S4
configuration files.
Finally, the Verdin AM62 and Verdin AM62P binman descriptions are
updated to use tifs-rm-cfg.yaml for the TIFS RM fragment when building
tiboot3 images, following the same pattern used by the corresponding TI
AM62x/AM62Px platforms.
The generated/updated files were compared against the matching TI board
configuration files where applicable.
Link: https://lore.kernel.org/r/20260508-v1-update-rm-cfg-v1-0-ec9d033f8ec1@toradex.com
Add rcfg_yaml_tifs node overrides to use tifs-rm-cfg.yaml instead of
the default rm-cfg.yaml for Verdin AM62 and Verdin AM62P platforms.
This enables binman to include the tifs-rm-cfg.yaml configuration when
building tiboot3 images in line with other K3 devices that already use
tifs-rm-cfg.yaml.
This follows the changes done by TI to their am62x/am62px platforms. [1]
[1] commit 41814276f0 ("arm: dts: k3: am62x/am62px: Enable tifs-rm-cfg in binman")
Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Boot on am33xx without CONFIG_USB will currently fail, as we error-out
of arch_misc_init() if no UCLASS_MISC device is found. This requirement
was introduced in commit 3aec264869 ("am33xx: board: probe misc
drivers to register musb devices").
Instead, only attempt the UCLASS_MISC init if we would expect the MUSB
TI device to be present. Add a comment to explain why we're doing the
device lookup (which we immediately discard).
Fixes: 3aec264869 ("am33xx: board: probe misc drivers to register musb devices")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Tom Rini <trini@konsulko.com>
Sync include/ec_commands.h from upstream commit 4f3d17aa34
("skywalker: set SLEEP_TIMEOUT_MS to 50 seconds"). The new file makes
two build assumptions that do not hold for U-Boot.
It hides '<stdint.h>' from __KERNEL__ builds, leaving UINT16_MAX
(used by EC_RES_MAX) undefined for U-Boot; widen the gate to
'!defined(__KERNEL__) || defined(__UBOOT__)'
It gates '<linux/limits.h>' on '#ifdef __KERNEL__'; the matching
'#else' branch defines BIT()/BIT_ULL()/GENMASK()/GENMASK_ULL()
locally, assuming kernel headers provide those macros otherwise.
U-Boot defines __KERNEL__ too but has no <linux/limits.h>. Nest a
'!defined(__UBOOT__)' check around the include so the __UBOOT__ path
stays in the __KERNEL__ branch (no local BIT/GENMASK defines), which
avoids redefinition warnings against U-Boot's linux/bitops.h. Pull
in linux/bitops.h up front for U-Boot so the file's own BIT() and
GENMASK() uses still resolve.
Adapt callers to two interface changes. The 'ec_current_image' enum
tag is now 'ec_image' (EC_IMAGE_* constants unchanged); rename it in
affected files to match. The VBNV-context interface was dropped
upstream, but it still used in lab Chromebooks; keep those constants and
structs in cros_ec.h
Likewise, MEC_EMI_BASE and MEC_EMI_SIZE are a U-Boot-local addition to
ec_commands.h that the upstream sync removes; preserve them in cros_ec.h
next to the VBNV block, and switch the only consumer
(arch/x86/cpu/apollolake/cpu_spl.c) to include cros_ec.h
Signed-off-by: Simon Glass <sjg@chromium.org>
Currently the sequence to enable caches for the A53/A72 core on K3
devices looks as follows:
1. Map entire DDR banks
2. Setup page tables (done by mmu_setup)
3. Enable MMU
4. Unmap reserved-memory regions
5. Enable caches
However there is a brief period of execution between #3 and #4 where the
core can issue speculative accesses to the entire DDR space (including
the reserved-memory regions) despite the caches being disabled.
A firewall exception is triggered whenever such speculative access is
made to secure DDR region of TFA or OP-TEE. This patch fixes the issue
by re-ordering the sequence as follows:
1. Map entire DDR banks
2. Setup page tables
3. Unmap reserved-memory regions
4. Enable MMU
5. Enable caches
Fixes: f1c694b8fd ("mach-k3: map all banks using mem_map_from_dram_banks")
Reported-by: Suhaas Joshi <s-joshi@ti.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Currently mmu_setup for ARMv8 performs two functions, first it sets up
the page tables based the memory map provided by the board and then it
enables the MMU.
However for some platforms runtime fixes to the generated page tables
are required before the MMU can be enabled, such as K3 family of SoCs.
Therefore this patch moves the enablement of the MMU out of mmu_setup
and to a standalone mmu_enable function to give more granular control to
the platforms.
Note that no functional changes are intended from this patch.
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
So that you can use virtio network, block etc create the virtio mmio
instances. There are 128 of these even if they are not all used, a
single mmio base value is passed via bootinfo.
Reviewed-by: Angelo Dureghello <angelo@kernel-space.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Tested-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
In Linux these are meant to read a little-endian value and swap
to the CPU endian.
In u-boot for m68k this is currently broken and prevents
virtio-mmio from functioning.
This change is only for classic m68k. Coldfire has read big-endian,
no swap for these in u-boot and Linux and existing drivers probably
depend on this.
Tested-by: Angelo Dureghello <angelo@kernel-space.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Acked-by: Angelo Dureghello <angelo@kernel-space.org>
Signed-off-by: Daniel Palmer <daniel@thingy.jp>
Add support for building U-Boot for Cortex-M33 RSIP core in Renesas
R-Car Gen5 R8A78000 X5H SoC. The main goal is to start U-Boot on the
Cortex-M33 RSIP core, which initializes the hardware and then starts
the Cortex-M33 SCP and Cortex-A720 cores which run the SCP firmware
and applications software respectively. The SCP is responsible for
platform resource management, and is used to start other CPU cores.
The Cortex-M33 build contains its own r8a78000_ironhide_cm33_defconfig
which configures the build for aarch32 instruction set compatible with
the ARMv8M core. The build also uses -cm33 DT and -u-boot.dtsi which
are derived from their non-CM33 counterparts, and add CM33 specifics.
The arch/arm/mach-renesas/u-boot-rsip.lds is derived from generic
arch/arm/cpu/u-boot.lds with adjustments to cater to the RSIP core,
those are entrypoint before vectors, __data_start/__data_end symbols
for data-only relocation, and placement of BSS into read-write SRAM
area.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Add target to generate u-boot-elf.shdr for R-Car Gen5 Cortex-M33
RSIP core. The resulting .shdr SREC file can be written into the
HF at offset 0.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Add target to generate u-boot-elf.scif for R-Car Gen5 Cortex-M33
RSIP core. The resulting .scif SREC file can be loaded using the
SCIF loader to start U-Boot on the RSIP core.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Point every direct user of SCMI clock protocol at CPG node instead
of SCMI clock protocol node. Point every direct user of SCMI reset
and power domain protocol at a matching newly introduced MDLC node
instead of the SCMI reset and power domain protocol nodes.
This allows the CPG and MDLC remap drivers bound to CPG node and MDLC
nodes to remap between DT clock, reset and power domain IDs and SCMI
clock, reset and power domain IDs. This makes U-Boot on R-Car X5H
compatible with multiple SCP firmware versions. Currently supported
versions of SCP firmware are 4.28, 4.31 and 4.32.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Select the R8A78000 power domain and reset driver on R-Car Gen5 X5H
SoC by default. The power domain and reset driver is used to remap
DT power domain and reset IDs to SCMI power domain and reset IDs,
which is necessary to support multiple SCP firmware versions with
varying SCMI clock IDs across versions.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Select the R8A78000 clock driver on R-Car Gen5 X5H SoC by default.
The clock driver is used to remap DT clock IDs to SCMI clock IDs,
which is necessary to support multiple SCP firmware versions with
varying SCMI clock IDs across versions.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Use macro SCP_CLOCK_ID_CLK_S0D6_PERE_MAIN for SCMI clock 1691
instead of hardcoding the number in DT. No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Enable OF_UPSTREAM to use upstream Linux kernel DT source as a base
for U-Boot control DT. Retain currently present parts of the DT which
are not yet part of upstream Linux kernel DT in -u-boot.dtsi files
until they get replaced by upstream equivalents. Add renesas/ prefix
to the DEFAULT_DEVICE_TREE as part of the switch.
Unused i2c2..i2c8 nodes have been removed, and will become available
once upstream Linux kernel DT adds those nodes.
The DRAM_RSV_SIZE has been updated to cover first 518 MiB of DRAM,
which are reserved for firmware and other use.
Note that all DT parts in -u-boot.dtsi are not considered stable DT
bindings and may change before they land in Linux kernel and become
stable DT ABI.
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
- SM6125 gains initial support
- The qcom clock drivers get better support for configuring UFS clocks
- ufetch gets some aesthetic improvements
- A minor bug in the qcm2290 clock driver is fixed
- A few qcom drivers get static/constified
- The GENI serial driver has the RX watermark register properly set
Change to not use NXP_RECOG fuse, but detect part number according
to feature disable fuses and SPEED fuse.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>