Skip to content

Commit

Permalink
libplatsupport: Add support for imx8mp-evk
Browse files Browse the repository at this point in the history
The i.MX 8M Plus Evaluation Kit is similar to the other platforms in the
i.MX 8M family and shares the same serial and timer peripherals.

Signed-off-by: Damon Lee <damon@kry10.com>
  • Loading branch information
nomadeel authored and kent-mcleod committed Jun 12, 2024
1 parent 60d4518 commit f98dad1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
11 changes: 9 additions & 2 deletions libplatsupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ if(
OR KernelPlatformImx7Sabre
OR KernelPlatformImx8mq-evk
OR KernelPlatformImx8mm-evk
OR KernelPlatformImx8mp-evk
OR KernelPlatformMaaxboard
)
list(APPEND deps src/mach/${LibPlatSupportMach}/serial/serial.c)
endif()

if(KernelPlatImx8mq OR KernelPlatformImx8mm-evk)
if(KernelPlatImx8mq OR KernelPlatformImx8mm-evk OR KernelPlatformImx8mp-evk)
list(APPEND deps src/plat/imx8m/chardev.c)
# There's no clock driver at the moment, but this is to allow the
# libethdrivers to build for imx8mq
Expand All @@ -132,7 +133,13 @@ add_config_library(platsupport "${configure_string}")

add_library(platsupport EXCLUDE_FROM_ALL ${deps})

if(KernelPlatImx8mq OR KernelPlatformImx8mm-evk)
if(KernelPlatImx8mq OR KernelPlatformImx8mm-evk OR KernelPlatformImx8mp-evk)
if(KernelPlatformImx8mp-evk)
# For the imx8mp, the DTS is in a different format compared to those of
# the imx8mm and imx8mq, there are some constants in the headers that
# point to the proper path
target_compile_definitions(platsupport PRIVATE USE_IMX8MP_GPT_PATH)
endif()
target_include_directories(platsupport PUBLIC plat_include/imx8m)
endif()

Expand Down
2 changes: 1 addition & 1 deletion libplatsupport/mach_include/imx/platsupport/mach/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum chardev_id {
PS_SERIAL3 = IMX_UART4,
PS_SERIAL4 = IMX_UART5,

#if defined(CONFIG_PLAT_SABRE) || defined(CONFIG_PLAT_IMX8MM_EVK)
#if defined(CONFIG_PLAT_SABRE) || defined(CONFIG_PLAT_IMX8MM_EVK) || defined(CONFIG_PLAT_IMX8MP_EVK)

PS_SERIAL_DEFAULT = IMX_UART2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@

#pragma once

#ifdef USE_IMX8MP_GPT_PATH
#define GPT1_PATH "/soc@0/bus@30000000/timer@302d0000"
#define GPT2_PATH "/soc@0/bus@30000000/timer@302e0000"
#else
#define GPT1_PATH "/gpt@302d0000"
#define GPT2_PATH "/gpt@302e0000"
#endif

#define GPT_PRESCALER (0)

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#define UART_REF_CLK 12096000

#if defined(CONFIG_PLAT_IMX8MM_EVK)
#if defined(CONFIG_PLAT_IMX8MM_EVK) || defined(CONFIG_PLAT_IMX8MP_EVK)
#define DEFAULT_SERIAL_PADDR UART2_PADDR
#define DEFAULT_SERIAL_INTERRUPT UART2_IRQ
#elif defined(CONFIG_PLAT_IMX8MQ_EVK) || defined(CONFIG_PLAT_MAAXBOARD)
Expand Down

0 comments on commit f98dad1

Please sign in to comment.