Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KED ARM trusted-firmware Fork
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KED Software Projects
Miscellaneous
KED ARM trusted-firmware Fork
Commits
0edfd377
Commit
0edfd377
authored
4 years ago
by
Mark Dykes
Committed by
TrustedFirmware Code Review
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge "plat: imx: imx8qx: provide debug uart num as build param" into integration
parents
e0ca555e
30617cca
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plat/imx/imx8qx/imx8qx_bl31_setup.c
+39
-6
39 additions, 6 deletions
plat/imx/imx8qx/imx8qx_bl31_setup.c
plat/imx/imx8qx/include/platform_def.h
+9
-3
9 additions, 3 deletions
plat/imx/imx8qx/include/platform_def.h
plat/imx/imx8qx/platform.mk
+6
-0
6 additions, 0 deletions
plat/imx/imx8qx/platform.mk
with
54 additions
and
9 deletions
plat/imx/imx8qx/imx8qx_bl31_setup.c
+
39
−
6
View file @
0edfd377
...
...
@@ -38,11 +38,43 @@ IMPORT_SYM(unsigned long, __RW_START__, BL31_RW_START);
static
entry_point_info_t
bl32_image_ep_info
;
static
entry_point_info_t
bl33_image_ep_info
;
/* Default configuration for i.MX8QM/QXP MEK */
#if defined(IMX_USE_UART0)
#define UART_PAD_CTRL (PADRING_IFMUX_EN_MASK | PADRING_GP_EN_MASK | \
(SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
(SC_PAD_28FDSOI_DSE_DV_LOW << PADRING_DSE_SHIFT) | \
(SC_PAD_28FDSOI_PS_PD << PADRING_PULL_SHIFT))
#define IMX_RES_UART SC_R_UART_0
#define IMX_PAD_UART_RX SC_P_UART0_RX
#define IMX_PAD_UART_TX SC_P_UART0_TX
/*
* On Toradex Colibri i.MX8QXP UART3 on the FLEXCAN2.
* Use custom pad control for this
*/
#elif defined(IMX_USE_UART3)
/*
* FLEXCAN2_RX/TX pads are muxed to ADMA_UART3_RX/TX,
* For ref:
* 000b - ADMA_FLEXCAN2_RX
* 001b - ADMA_SAI3_RXD
* 010b - ADMA_UART3_RX
* 011b - ADMA_SAI1_RXFS
* 100b - LSIO_GPIO1_IO19
*/
#define UART_PAD_CTRL (PADRING_IFMUX_EN_MASK | PADRING_GP_EN_MASK | \
(SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
(2U << PADRING_IFMUX_SHIFT) | \
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
(SC_PAD_28FDSOI_DSE_DV_LOW << PADRING_DSE_SHIFT) | \
(SC_PAD_28FDSOI_PS_PD << PADRING_PULL_SHIFT))
#define IMX_RES_UART SC_R_UART_3
#define IMX_PAD_UART_RX SC_P_FLEXCAN2_RX
#define IMX_PAD_UART_TX SC_P_FLEXCAN2_TX
#else
#error "Provide proper UART configuration in IMX_DEBUG_UART"
#endif
static
const
mmap_region_t
imx_mmap
[]
=
{
MAP_REGION_FLAT
(
IMX_REG_BASE
,
IMX_REG_SIZE
,
MT_DEVICE
|
MT_RW
),
...
...
@@ -74,7 +106,7 @@ static void lpuart32_serial_setbrg(unsigned int base, int baudrate)
if
(
baudrate
==
0
)
panic
();
sc_pm_get_clock_rate
(
ipc_handle
,
SC_R
_UART
_0
,
2
,
&
rate
);
sc_pm_get_clock_rate
(
ipc_handle
,
IMX_RES
_UART
,
2
,
&
rate
);
baud_diff
=
baudrate
;
osr
=
0
;
...
...
@@ -261,14 +293,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
panic
();
#if DEBUG_CONSOLE_A35
sc_pm_set_resource_power_mode
(
ipc_handle
,
SC_R_UART_0
,
SC_PM_PW_MODE_ON
);
sc_pm_set_resource_power_mode
(
ipc_handle
,
IMX_RES_UART
,
SC_PM_PW_MODE_ON
);
sc_pm_clock_rate_t
rate
=
80000000
;
sc_pm_set_clock_rate
(
ipc_handle
,
SC_R
_UART
_0
,
2
,
&
rate
);
sc_pm_clock_enable
(
ipc_handle
,
SC_R
_UART
_0
,
2
,
true
,
false
);
sc_pm_set_clock_rate
(
ipc_handle
,
IMX_RES
_UART
,
2
,
&
rate
);
sc_pm_clock_enable
(
ipc_handle
,
IMX_RES
_UART
,
2
,
true
,
false
);
/* Configure UART pads */
sc_pad_set
(
ipc_handle
,
SC_P
_UART
0
_RX
,
UART_PAD_CTRL
);
sc_pad_set
(
ipc_handle
,
SC_P
_UART
0
_TX
,
UART_PAD_CTRL
);
sc_pad_set
(
ipc_handle
,
IMX_PAD
_UART_RX
,
UART_PAD_CTRL
);
sc_pad_set
(
ipc_handle
,
IMX_PAD
_UART_TX
,
UART_PAD_CTRL
);
lpuart32_serial_init
(
IMX_BOOT_UART_BASE
);
#endif
...
...
This diff is collapsed.
Click to expand it.
plat/imx/imx8qx/include/platform_def.h
+
9
−
3
View file @
0edfd377
...
...
@@ -38,7 +38,15 @@
#define PLAT_GICD_BASE 0x51a00000
#define PLAT_GICR_BASE 0x51b00000
#if defined(IMX_USE_UART0)
#define IMX_BOOT_UART_BASE 0x5a060000
#elif defined(IMX_USE_UART3)
#define IMX_BOOT_UART_BASE 0x5a090000
#else
#error "Provide proper UART configuration in IMX_DEBUG_UART"
#endif
#define IMX_BOOT_UART_BAUDRATE 115200
#define IMX_BOOT_UART_CLK_IN_HZ 24000000
#define PLAT_CRASH_UART_BASE IMX_BOOT_UART_BASE
...
...
@@ -55,8 +63,6 @@
/* non-secure u-boot base */
#define PLAT_NS_IMAGE_OFFSET 0x80020000
#define DEBUG_CONSOLE 0
#define DEBUG_CONSOLE_A35 0
#define DEBUG_CONSOLE_A35 DEBUG_CONSOLE
#endif
/* PLATFORM_DEF_H */
This diff is collapsed.
Click to expand it.
plat/imx/imx8qx/platform.mk
+
6
−
0
View file @
0edfd377
...
...
@@ -32,3 +32,9 @@ include plat/imx/common/sci/sci_api.mk
USE_COHERENT_MEM
:=
1
RESET_TO_BL31
:=
1
IMX_DEBUG_UART
?=
0
$(
eval
$(
call add_define,IMX_USE_UART
${
IMX_DEBUG_UART
}))
DEBUG_CONSOLE
?=
0
$(
eval
$(
call add_define,DEBUG_CONSOLE
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment