summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
Commit message (Collapse)AuthorAgeFilesLines
* ARM: i.MX8MQ: Streamline lowlevel startup codeSascha Hauer2023-11-131-25/+1
| | | | | | | | | | | | 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>
* treewide: remove no-longer needed IMD_USED_OFAhmad Fatoum2023-04-171-3/+0
| | | | | | | | | | | | | | | 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>
* ARM: i.MX: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+1
| | | | | | | | | | | | 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>
* ARM: i.MX: Move mach header files to include/mach/imxSascha Hauer2023-03-061-6/+6
| | | | | | | | | | | 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>
* ARM: i.MX8M: use compressed DTBsAhmad Fatoum2022-07-051-2/+2
| | | | | | | | | | | | | 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>
* ARM: i.MX8m: Add of_compatible imd tags for i.MX8 boardsSascha Hauer2021-10-021-0/+3
| | | | | | | | 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>
* ARM: i.MX8M boards: always set up UARTSascha Hauer2020-08-211-3/+5
| | | | | | | | | | | | | | | | | | | 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>
* ARM: i.MX8M: Add DDR controller supportSascha Hauer2020-02-191-1/+1
| | | | | | | | | | | | | | | 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>
* ARM: i.MX8MQ boards: Add missing includesSascha Hauer2020-02-191-0/+1
| | | | | | | | 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>
* ARM: i.MX8M: Add and use function for early UART clock setupSascha Hauer2020-02-191-8/+1
| | | | | | | | 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>
* ARM: i.MX8M: rename imx8-ccm-regs.h to imx8m-ccm-regs.hSascha Hauer2020-02-191-1/+1
| | | | | | | 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>
* ARM: i.MX: Add SoC namespace to imx7/8m CCM definesSascha Hauer2020-02-191-6/+6
| | | | | | | | | 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>
* ARM: i.MX8M: rename functions to be i.MX8M specificSascha Hauer2020-02-191-1/+1
| | | | | | | 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>
* ARM: i.MX8M: rename i.MX8M specific functionSascha Hauer2020-02-191-1/+1
| | | | | | | 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>
* ARM: i.MX8M: rename imx8_* bootsource functions to imx8mq_*Sascha Hauer2020-02-191-1/+1
| | | | | | | 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>
* ARM: i.MX8M: add and use imx8mq_setup_pad()Sascha Hauer2020-02-191-2/+1
| | | | | | | | | | 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>
* ARM: i.MX8: Move iomux header to make space for i.MX8MMSascha Hauer2020-02-191-1/+1
| | | | | | | | 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>
* ARM: nxp-imx8mq-evk: fix second stage bootingLucas Stach2020-01-091-19/+18
| | | | | | | | | | | | | | | 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>
* ARM: nxp-imx8mq-evk: fix bootflow commentLucas Stach2019-12-201-6/+5
| | | | | | | | | 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>
* ARM: nxp-imx8mq-evk: clean up nxp_imx8mq_evk_startLucas Stach2019-12-201-13/+11
| | | | | | | | | | | 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>
* ARM: nxp-imx8mq-evk: switch the PBL memcpy parameters to common variablesLucas Stach2019-12-201-1/+2
| | | | | | | | 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>
* ARM: nxp-imx8mq-evk: switch to SPDX license headerLucas Stach2019-12-201-10/+1
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: nxp-imx8mq-evk: Update commentsSascha Hauer2019-08-231-5/+4
| | | | | | | | 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>
* ARM: nxp-imx8mq-evk: Replace trampolineSascha Hauer2019-08-231-22/+5
| | | | | | | | | | | | | | 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>
* ARM: nxp-imx8mq-evk: Remove duplicate call to imx8mq_cpu_lowlevel_init()Sascha Hauer2019-08-231-2/+0
| | | | | | | 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>
* Merge branch 'for-next/imx8-hab'Sascha Hauer2019-08-151-47/+59
|\
| * boards: nxp-mx8-evk: rework to different boot flowRouven Czerwinski2019-08-071-36/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ARM: nxp-imx8mq-evk: Do setup_c() before accessing global variablesSascha Hauer2019-07-161-23/+31
|/ | | | | | | | 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>
* ARM: i.MX8MQ: Don't use cpu_is_mx8mq() at core_initcall levelAndrey Smirnov2019-03-181-1/+1
| | | | | | | | | | | | | | | | | 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>
* firmware: drop the imx subdirLucas Stach2019-02-011-1/+1
| | | | | | | | | | 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>
* ARM: nxp-imx8mq-evk: Make use of memory size detection codeAndrey Smirnov2018-09-241-2/+2
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: nxp-imx8mq-evk: Add bootflow commentsAndrey Smirnov2018-08-091-2/+39
| | | | | | | 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>
* ARM: nxp-imx8mq-evk: Add code to load ATF BL31 blobAndrey Smirnov2018-08-091-0/+9
| | | | | Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX8: Add i.MX8mq EVK supportSascha Hauer2018-06-151-0/+81
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>