Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libplatsupport: Add support for imx8mp-evk #182

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use #ifdef CONFIG_PLAT_IMX8MP_EVK below and avoid this, that would be more in line with the existing code. If it gets messy in the future we can always add defines, also for serial. But if you prefer it this way then that's fine with me too.

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