| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that a __dtb* reference automatically pulls in the IMD tag if
support is compiled in, we can drop all IMD_USED_OF and turn the macro
into a no-op until we remove it completely.
Theoretically, an out-of-tree board could reference a DT via IMD_USED_OF
and not actually reference it via __dtb_*_start. So instead of makign
IMD_USED_OF a no-top, let's print a warning for a few releases until
we remove it completely.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230404101706.2237453-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
With multi-arch support we must make sure we provide exactly one
PUTC_LL() function as indicated by the "Kernel low-level debugging port"
Kconfig choice. Make sure that the i.MX specific debug_ll.h only
provides PUTC_LL() when specified.
The i.MX specific debug_ll.h also provides other functions needed
by board code regardless if the i.MX debug_ll port is enabled or
not, so include it explicitly where needed.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Currently arch specific headers can be included with #include <mach/xxx.h>.
With upcoming multi-arch support this is no longer possible as there
won't be a single mach anymore.
Move all i.MX specific header files to include/mach/imx/ to prepare for
multi-arch support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Multi-image build with i.MX8MN-EVK increases size for other board,
because DDR4 firmware will be included for LPDDR4 only PBLs too.
We should fix that with LTO, but until that's done, we can reduce
size a good bit by compressing DTBs. This saves e.g. 27K for the
i.MX8M-EVK (8MQuad).
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220704092409.124836-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The build process has to be manually told which image is compatible to
which device tree. Add the IMD_USED_OF() calls to the i.MX8m based
boards.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quoting Lucas on b96cc34f91 ("ARM: nxp-imx8mm-evk: always set up UART"):
| When the TF-A is configured to have some output on the UART it does not
| set up the UART on its own, but just expects a pre-existing configuration.
| If Barebox did not set up the UART in the !DEBUG_LL case, TF-A will just
| hang without any user accessible debug output, which is a very non-obvious
| failure, so better be safe and always set up the UART in case TF-A wants
| to use it.
This patch adopts this for all i.MX8M boards and makes the early UART
setup consistent across all of them. We also add pbl_set_putc() to
enable regular PBL console messages. For the i.MX8MM-EVK the unnecessary
call to imx8m_uart_setup_ll() is dropped; we already configured the
UART in imx8m_uart_setup(), no need to do that again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the DDR driver for the i.MX8MQ/i.MX8MM. It's taken from
U-Boot v2020.04-rc1 with slight modifications for barebox
The i.MX8MQ boards in the tree currently use the output of an earlier
version of the NXP i.MX8M DDR Tool which doesn't use a controller driver
but instead does most stuff in board code. It seems this can coexist
with the new driver, only a few helper functions that previously lived
in arch/arm/mach-imx/imx8-ddrc.c are now provided by the new driver.
Tested on an i.MX8MM EVK
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The i.MX8MQ board files all use get_builtin_firmware(), thus need
include/firmware.h. This is currently only indirectly included, include
it directly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The i.MX8M boards all have the same code for setting up the UART clock.
Add a common helper for it. In the helper just setup the clocks for all
UARTs as it's not worth it to have separate functions for each UART.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
i.MX8 is something different than the i.MX8M and both will not share
this header file, so rename it to imx8m-ccm-regs.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
The CCM defines used on i.MX7 and i.MX8M do not have any SoC namespace.
Add it to make clear where they are supposed to be used. Since it looks
confusing to call i.MX7 specific defines on i.MX8M and vice versa,
duplicate them for both SoCs.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
imx8_esdhc_load_image() and friends can't be used on the big variants of
the i.MX8, so rename to imx8m_esdhc_load_image()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
The big i.MX8 variants have completely other UARTs than the i.MX8M
variants, so rename imx8_uart_setup_ll() to imx8m_uart_setup_ll().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Those will differ between i.MX8MQ and i.MX8MM, so give them the
appropriate prefix before introducing i.MX8MM support.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
We already have a mx8_setup_pad() function for early iomux setup, but it
is unused. Add a i.MX8MQ specific wrapper for the function which passes
the correct base address to mx8_setup_pad(). Let the boards use this
function. While at it rename mx8_setup_pad() to imx8_setup_pad() which
is more consistent to other i.MX specific functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Parts of iomux-mx8.h are for i.MX8M and others for i.MX8MQ only, but
never for i.MX8 in general. Split this up into different file and
avoid the imx8_ prefix.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the whole image already resides in DRAM, e.g. by starting the
image via the bootm handler we try to load the piggydata from storage,
which may well be different from our expected piggydata, already
present in DRAM.
Fix this by avoiding the special piggydata load function, but instead
load the whole image after DRAM is up and just replace the PBL part to
ensure we are still running the HAB validated code after TF-A hands
back control to our code in DRAM.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
| |
The comment above nxp_imx8mq_evk_start is no longer accurate, as there
is no trampoline in DRAM anymore. Change the comment to reflect the current
boot flow.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Mostly cosmetic changes:
- reduce scope of local variabes
- wrap comment to fir 80 char limit
- check return value from imx8_esdhc_load_piggy
- drop intermediate function that only wraps a single other function
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
Use the variables defined in sections.h, instead of hand rolling the
same computation.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
| |
The comments mention contents of register r0, this is outdated. We
base our decisions on the current EL. Update the comments.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the TF-A finishes it jumps to a hardcoded address in DRAM. We used
to put a trampoline there which brings us back to our image in SRAM.
Instead of putting a trampoline into DRAM just copy the image there
which simplifies things a bit.
Note that currently imx8_esdhc_load_piggy() uses that very same address
as a temporary buffer. This is changed in the next patch. Currently the
board is broken anyway, so we don't break bisectability.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|
|
|
|
|
|
| |
imx8mq_cpu_lowlevel_init() is called twice. Remove the second call.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rework the evk boot flow to use the new piggydata load function and
install a trampoline for the TF-A setup. This allows the PBL boot
process to stay in SRAM up until the verification of the piggydata is
done and main barebox can be loaded.
The trampoline loads 4 bytes right after the trampoline, we copy the
runtime offset there so the trampoline jumps back into the SRAM PBL.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|/
|
|
|
|
|
|
| |
The lowlevel board code accesses global variables, so call
relocate_to_current_adr() / setup_c() to make sure we have a valid C
environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since __imx_cpu_type won't be initialized until
imx_init()@postcore_initcall is executed cpu_is_mx8mq() will only work
correctly at core_initcall level so long as imx_cpu_type does not
resolve into __imx_cpu_type. This is currently the case and
imx8mq_init_syscnt_frequency() works as expected, but it probably
won't be in the future.
To avoid this problem introduce imx8mq_cpu_lowlevel_init() and do
system counter frequency initialization there. Also convert all of the
i.MX8MQ boards to use this new function.
Fixes: 5691aed9a ("ARM: i.MX8MQ: Check CPU type in imx8mq_init_syscnt_frequency()")
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
| |
We don't intend to ship any files in this directory, so there is no
risk of the directory getting too crowded over time. Drop the subdir
as this makes it easier for a outer build system to drop all the
needed firmwares into the correct directory.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
|
|
| |
Add some notes on how the boot-flow goes while I still remember it.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
|
| |
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|