Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
0edfd377
Commit
0edfd377
authored
Mar 31, 2020
by
Mark Dykes
Committed by
TrustedFirmware Code Review
Mar 31, 2020
Browse files
Merge "plat: imx: imx8qx: provide debug uart num as build param" into integration
parents
e0ca555e
30617cca
Changes
3
Hide whitespace changes
Inline
Side-by-side
plat/imx/imx8qx/imx8qx_bl31_setup.c
View file @
0edfd377
...
@@ -38,11 +38,43 @@ IMPORT_SYM(unsigned long, __RW_START__, BL31_RW_START);
...
@@ -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
bl32_image_ep_info
;
static
entry_point_info_t
bl33_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 | \
#define UART_PAD_CTRL (PADRING_IFMUX_EN_MASK | PADRING_GP_EN_MASK | \
(SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
(SC_PAD_CONFIG_OUT_IN << PADRING_CONFIG_SHIFT) | \
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
(SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
(SC_PAD_28FDSOI_DSE_DV_LOW << PADRING_DSE_SHIFT) | \
(SC_PAD_28FDSOI_DSE_DV_LOW << PADRING_DSE_SHIFT) | \
(SC_PAD_28FDSOI_PS_PD << PADRING_PULL_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
[]
=
{
static
const
mmap_region_t
imx_mmap
[]
=
{
MAP_REGION_FLAT
(
IMX_REG_BASE
,
IMX_REG_SIZE
,
MT_DEVICE
|
MT_RW
),
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)
...
@@ -74,7 +106,7 @@ static void lpuart32_serial_setbrg(unsigned int base, int baudrate)
if
(
baudrate
==
0
)
if
(
baudrate
==
0
)
panic
();
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
;
baud_diff
=
baudrate
;
osr
=
0
;
osr
=
0
;
...
@@ -261,14 +293,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
...
@@ -261,14 +293,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
panic
();
panic
();
#if DEBUG_CONSOLE_A35
#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_clock_rate_t
rate
=
80000000
;
sc_pm_set_clock_rate
(
ipc_handle
,
SC_R
_UART
_0
,
2
,
&
rate
);
sc_pm_set_clock_rate
(
ipc_handle
,
IMX_RES
_UART
,
2
,
&
rate
);
sc_pm_clock_enable
(
ipc_handle
,
SC_R
_UART
_0
,
2
,
true
,
false
);
sc_pm_clock_enable
(
ipc_handle
,
IMX_RES
_UART
,
2
,
true
,
false
);
/* Configure UART pads */
/* Configure UART pads */
sc_pad_set
(
ipc_handle
,
SC_P
_UART
0
_RX
,
UART_PAD_CTRL
);
sc_pad_set
(
ipc_handle
,
IMX_PAD
_UART_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_TX
,
UART_PAD_CTRL
);
lpuart32_serial_init
(
IMX_BOOT_UART_BASE
);
lpuart32_serial_init
(
IMX_BOOT_UART_BASE
);
#endif
#endif
...
...
plat/imx/imx8qx/include/platform_def.h
View file @
0edfd377
...
@@ -38,7 +38,15 @@
...
@@ -38,7 +38,15 @@
#define PLAT_GICD_BASE 0x51a00000
#define PLAT_GICD_BASE 0x51a00000
#define PLAT_GICR_BASE 0x51b00000
#define PLAT_GICR_BASE 0x51b00000
#if defined(IMX_USE_UART0)
#define IMX_BOOT_UART_BASE 0x5a060000
#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_BAUDRATE 115200
#define IMX_BOOT_UART_CLK_IN_HZ 24000000
#define IMX_BOOT_UART_CLK_IN_HZ 24000000
#define PLAT_CRASH_UART_BASE IMX_BOOT_UART_BASE
#define PLAT_CRASH_UART_BASE IMX_BOOT_UART_BASE
...
@@ -55,8 +63,6 @@
...
@@ -55,8 +63,6 @@
/* non-secure u-boot base */
/* non-secure u-boot base */
#define PLAT_NS_IMAGE_OFFSET 0x80020000
#define PLAT_NS_IMAGE_OFFSET 0x80020000
#define DEBUG_CONSOLE_A35 DEBUG_CONSOLE
#define DEBUG_CONSOLE 0
#define DEBUG_CONSOLE_A35 0
#endif
/* PLATFORM_DEF_H */
#endif
/* PLATFORM_DEF_H */
plat/imx/imx8qx/platform.mk
View file @
0edfd377
...
@@ -32,3 +32,9 @@ include plat/imx/common/sci/sci_api.mk
...
@@ -32,3 +32,9 @@ include plat/imx/common/sci/sci_api.mk
USE_COHERENT_MEM
:=
1
USE_COHERENT_MEM
:=
1
RESET_TO_BL31
:=
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))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment