| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, barebox ARM arch_remap_range() will hang in an infinite loop,
when called with a size that's not aligned to a page boundary.
Its Linux equivalent, ioremap(), will just rounds up to page size and
work correctly. Adopt the Linux behavior to make porting code easier,
e.g. when calling devm_ioremap().
The only other arch_remap_range() in barebox, is PowerPC's. That one
wouldn't loop indefinitely if the size isn't page aligned, so nothing to
do there.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231205081247.4148947-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Build complains about:
imx8mp-skov.dts:69.3-10: Warning (ranges_format): /reserved-memory:ranges:
empty "ranges" property but its #size-cells (1) differs from / (2)
(48 results) [482/38498]
Fix this by changing the cell size to what's in imx8mp.dtsi's /.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231204164938.1130386-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Large decimal numbers are not readable and useful, print memory sizes in
hexadecimal instead.
Link: https://lore.barebox.org/20231201151044.1648393-3-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
When running out of PTEs panic with an appropriate message instead of
continuing with NULL pointers.
Link: https://lore.barebox.org/20231201151044.1648393-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
get_ttb() returns an uint64_t * which means that with
get_ttb() + idx * GRANULE_SIZE
the distance between two PTEs is wrongly calculated as 0x8000 bytes
instead of 0x1000 bytes. With this we leave the space allocated for PTEs
quite fast and the available space check also doesn't work.
Fix this by explicitly casting to void *.
Link: https://lore.barebox.org/20231201151044.1648393-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The board boots fine with deep probe enabled, so enable it to eliminate
probe deferrals.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181319.706228-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
of_register_fixup can't actually fail, so drop the return value check
and propagation to make the code a bit more concise.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181116.591131-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
TF-A already reads the OTP and unconditionally prints at a higher log
level:
NOTICE: CPU: STM32MP157AAA Rev.B
barebox reads the OTP again via the secure monitor only to print:
stm32mp-init: detected STM32MP157AAA Rev.B
which doesn't add any extra information, so drop it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181116.591131-7-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
setup_cpu_type() was responsible for registering fixups for STM32MP15
and for initializing the values returned by stm32mp_silicon_revision(),
stm32mp_cputype() and stm32mp_package().
It has no support for STM32MP13 and the OTP on that SoC is accessed
differently from the STM32MP15, so let's just mark the function
STM32MP15-specific and delete all helpers that have no users instead of
having to duplicate them for STM32MP13.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181116.591131-6-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The use of the TAMP registers differs between STM32MP15 and STM32MP13,
so let's drop all register definitions that we don't use instead of
renaming them to be SoC-specific.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181116.591131-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| | |
STM32MP153 is another SoC. Fix the typo.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181116.591131-3-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The upstream device tree being included already has the same
/chosen/stdout-path, so drop it from the barebox DT.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122181116.591131-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The Linux <linux/word-at-a-time.h> interface is used to optimize
searching for bytes in strings by doing word-size comparisons. This will
be used in the implementation of strscpy in a follow-up commit, so
import the generic version here.
A good overview on the interface is available at LWN[1]. Note that
it discuss Linux v3.5. The asm-generic version imported here works
also on little-endian and not only big-endian[2].
[1]: https://lwn.net/Articles/501492/
[2]: Linux kernel commit a6e2f029ae34 ("Make asm/word-at-a-time.h
available on all architectures").
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122172951.376531-9-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We don't have the historic baggage of having to support different errno
definitions depending on architecture. We thus have only
asm-generic/errno.h and include that from errno.h and elsewhere
directly.
Kernel code however includes <linux/errno.h>, so let's provide that file
as well and define there the Linux-specific errno's and include
<asm-generic/errno.h> for all other errnos.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122172951.376531-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Link: https://lore.barebox.org/20231124060130.1205927-3-antonynpavlov@gmail.com
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
TLSF already populates errno on errors, so do likewise for the
allocators that don't.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231122170007.3849506-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's getting tight in the initial 64k SRAM space. Use compressed dtbs
to get some more free space.
Link: https://lore.barebox.org/20231120133930.3946286-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We should do away altogether with <asm/common.h>, so prepare for doing
that in the future by moing the only content it has on sandbox into
Kconfig.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231109124326.1499612-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The board is called STM32MP135 and there is currently no STM32MP137.
The typo was likely caused by copy-pasting from the STM32MP15x, which
has STM32MP157.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231109130253.1506400-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This enabled everything necessary for running barebox on K3 SoCs
Link: https://lore.barebox.org/20230803105003.4088205-23-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The upstream dts file configures the SD card detect pin as GPIO.
With this our SD driver currently doesn't work. Until the reasons
are found out let's configure the pin as native card detect for now.
Link: https://lore.barebox.org/20230803105003.4088205-20-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This adds basic 2nd stage support for the BeaglePlay board, see
https://docs.beagle.cc/latest/boards/beagleplay/index.html
The BeaglePlay is based on the Texas Instruments AM62x (K3) SoC.
1st stage support is out of scope for now, but current support is enough
to be started as a Kernel from running U-Boot using the booti command.
When encapsulated in a FIT image the resulting image can replace
u-boot.img to directly boot into barebox.
Link: https://lore.barebox.org/20230803105003.4088205-19-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This adds the Kconfig snippets for supporting the Texas Instruments K3
architecure. This also enables deep probe support on a SoC basis as all
new boards should work with deep probe enabled. Likewise we need PM
domain support for the initially supported AM62x SoC, so enable that
for this SoC as well.
Link: https://lore.barebox.org/20230803105003.4088205-18-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
TI K3 SoCs have ns16550 compatible UARTs. Add lowlevel debugging support
for the AM62x SoC from the K3 family.
Link: https://lore.barebox.org/20230803105003.4088205-5-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Link: https://lore.barebox.org/20231110125800.1901232-26-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Enable i.MX9 support and drivers useful on that SoC.
Link: https://lore.barebox.org/20231110125800.1901232-25-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The TQ MBA9XXXCA is a i.MX93 based board, see
https://www.tq-group.com/de/produkte/tq-embedded/arm-architektur/stka93xx/
Link: https://lore.barebox.org/20231110125800.1901232-17-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Link: https://lore.barebox.org/20231110125800.1901232-21-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We used to use the ROM API for USB loading only, now with i.MX93 we
fully rely on the ROM API also with SD/eMMC and other boot sources.
The ROM provides us information about the boot source. There are
generally two types of boot sources: seekable for storage devices
like SD/eMMC and streamable for USB. the load_image call must be
handled slightly different for both types of boot sources, so
we fist detect which type we have and call the right load_image
function accordingly.
Link: https://lore.barebox.org/20231110125800.1901232-20-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The file the romapi is implemented in is named romapi and that's also
the name the i.MX ROM API is normally referred to, so rename the
functions accordingly.
While at it, rename some internal functions from imx8m_* to imx_* as
they can and will also be used by upcoming i.MX9 support.
Link: https://lore.barebox.org/20231110125800.1901232-19-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Link: https://lore.barebox.org/20231110125800.1901232-18-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Current upstream i.MX93 dtsi lacks some nodes currently, add them
locally until merged upstream:
- add USB nodes
- add DDRC node
- add OCOTP ethernet MAC address nodes
Link: https://lore.barebox.org/20231110125800.1901232-14-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Link: https://lore.barebox.org/20231110125800.1901232-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add code to initialize the Trusted Resource Domain Controller (TRDC).
This is needed very early in PBL to reconfigure the OCRAM read/write.
Without this initialization OCRAM is readonly and
relocate_to_current_adr() won't work. The code is taken from U-Boot as
of 2023.10-rc4.
Link: https://lore.barebox.org/20231110125800.1901232-4-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We'll have to communicate to the EdgeLock Secure Enclave in a followup
patch. Add support for that. Code is taken from U-Boot as of
2023.10-rc4.
Link: https://lore.barebox.org/20231110125800.1901232-3-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The i.MX PBL USB gadget driver is currently selected by architecture
Kconfig options. When USB gadget support is disabled then the build
system doesn't descend into the directory where the driver is, leading
to undefined references. We could change that and descend into the
directory unconditionally, but as the driver doesn't have any
dependencies to the USB gadget framework we can also move the driver
to arch/arm/mach-imx/ to solve this problem.
Link: https://lore.barebox.org/20231110130246.2222936-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The phy address is hardcoded in several functions. Use the address
provided in struct dram_controller instead. Some functions are used
from legacy DDR setup in board code which only uses parts of the
DDR initialization code. The board code doesn't have any struct
dram_controller *, so provide some static inline wrappers for these
functions.
Link: https://lore.barebox.org/20231110130028.2123895-9-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The i.MX8M lowlevel code uses some macros which take SoC prefix names as
arguments which then expand to SoC specific function names. The result
is hard to follow. Detangle this by open coding the macros. At the
expense of a bit of code duplication we gain readability.
Link: https://lore.barebox.org/20231110094622.877614-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Most i.MX8M SoCs have a imx8m[nmp]_load_and_start_image_via_tfa()
function which does all the magic of loading and starting TF-A,
barebox proper and OP-TEE images. Only the i.MX8MQ boards have the
same open coded in the lowlevel code.
Implement a imx8mq_load_and_start_image_via_tfa() and switch the
i.MX8MQ boards over to it.
Link: https://lore.barebox.org/20231110094622.877614-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|\ \ \ \ \ |
|
| | |_|/ /
| |/| | |
| | | | |
| | | | | |
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |_|_|/
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We enter EL2 with MMU disabled even when it was enabled in EL3. Enable
MMU in EL2 again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
With dba1c26f70 we replaced request_sdram_region() for the PPA with
reserve_sdram_region(). The effect is that the region is marked as
reserved and mapped non executable. While this is desired for EL2, it
also has the effect that we can't start the PPA anymore from EL3.
Map the region cached/executable to start the PPA, then map it
uncached/non executable once we are in EL2.
Fixes: dba1c26f70 ("arm: layerscape: ppa: reserve SDRAM region for PPA")
Link: https://lore.barebox.org/20231120144453.1075740-2-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The TF-A is often started before the MMU is initialized. There are some
exceptions though. On Layerscape the TF-A (or: PPA in that case) is
started while the MMU is running. The PPA is then executed in EL3 and
returns in EL2. For this case setup the TTB for EL2 as well so that we
have a valid MMU setup when the PPA returns.
Link: https://lore.barebox.org/20231120144453.1075740-1-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The Intel documentation states that the FPGA configuration might fail.
This has been observed on the Enclustra AA1+ board where up to 4 retries
where required to configure the FPGA.
Debugging session showed that the data where correctly read from the
eMMC but yet the configuration failed.
This commit introduces a retry loop on the FPGA configuration.
Up to 10 retries (arbitrary) are attempted.
As the hardware can't be used anyway without the FPGA loaded, this
doesn't introduce any boot time problems. Taking longer is better than
just hang()ing.
Signed-off-by: Bruno Knittel <bruno.knittel@bruker.com>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Link: https://lore.barebox.org/20231115-arria10-fpga-reload-on-failure-v2-1-6a45f125c9c2@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|