IMX8MP EVK/Change u-boot debug console UART2->UART1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MP EVK/Change u-boot debug console UART2->UART1

Jump to solution
4,502 Views
tetsuro-okuyama
Contributor V

Hi all,

I want to change u-boot debug console from UART2 to UART1.
Environment is as follows.

root@imx8mpevk:~# uname -a
Linux imx8mpevk 5.4.70-2.3.0+g4f2631b022d8 #1 SMP PREEMPT Thu Mar 18 06:07:11 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

With reference to this page, I changed uboot-imx and imx-atf(See attached patch:diff_uboot.patch and diff_atf.patch) and build them.
#1.common/log.c diff is tentative for SPL debug logging.

#2.uboot build command

# source ${YOCTO_SDK_PATH}/environment-setup-aarch64-poky-linux
# make distclean
# make imx8mp_evk_defconfig
# make

#3.atf build command

# unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
# make PLAT=imx8mp bl31

Next, I built "flash.bin" using imx-mkimage and firmware-imx-8.11.bin by following the steps.

# cp uboot-imx/spl/u-boot-spl.bin imx-mkimage/iMX8M/
# cp uboot-imx/u-boot-nodtb.bin imx-mkimage/iMX8M/
# cp uboot-imx/arch/arm/dts/imx8mp-evk.dtb imx-mkimage/iMX8M/
# cp uboot-imx/tools/mkimage imx-mkimage/iMX8M/mkimage_uboot

# cp imx-atf/build/imx8mp/release/bl31.bin imx-mkimage/iMX8M/

# cp firmware-imx-8.11/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin imx-mkimage/iMX8M/
# cp firmware-imx-8.11/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin imx-mkimage/iMX8M/
# cp firmware-imx-8.11/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin imx-mkimage/iMX8M/
# cp firmware-imx-8.11/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin imx-mkimage/iMX8M/

# cd imx-mkimage
# make SOC=iMX8MP flash_evk

But the log at startup is only up to uboot SPL endpoint(See normal.log and stop.log).
When I raise the loglevel(See stop_loglevel7.log), it looks like ATF isn't loaded correctly.
 
Please tell me how to change the debug console of U-boot correctly.


Best regards,

0 Kudos
1 Solution
4,484 Views
jimmychan
NXP TechSupport
NXP TechSupport

Please try this :

 

---
plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 2 +-
plat/imx/imx8m/imx8mp/include/platform_def.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
index 1e5d64da3..e5a629b91 100644
--- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
@@ -59,7 +59,7 @@ static const struct imx_rdc_cfg rdc[] = {
RDC_MDAn(RDC_MDA_M7, DID1),

/* peripherals domain permission */
- RDC_PDAPn(RDC_PDAP_UART2, D0R | D0W),
+ RDC_PDAPn(RDC_PDAP_UART1, D0R | D0W),

/* memory region */

diff --git a/plat/imx/imx8m/imx8mp/include/platform_def.h b/plat/imx/imx8m/imx8mp/include/platform_def.h
index ce279a567..56a0740ff 100644
--- a/plat/imx/imx8m/imx8mp/include/platform_def.h
+++ b/plat/imx/imx8m/imx8mp/include/platform_def.h
@@ -51,7 +51,7 @@

#define HAB_RVT_BASE U(0x00000900) /* HAB_RVT for i.MX8MM */

-#define IMX_BOOT_UART_BASE U(0x30890000)
+#define IMX_BOOT_UART_BASE U(0x30860000)
#define IMX_BOOT_UART_CLK_IN_HZ 24000000 /* Select 24MHz oscillator */

#define PLAT_CRASH_UART_BASE IMX_BOOT_UART_BASE
--
2.17.1

 

View solution in original post

0 Kudos
5 Replies
4,500 Views
tetsuro-okuyama
Contributor V
 
0 Kudos
4,485 Views
jimmychan
NXP TechSupport
NXP TechSupport

Please try this :

 

---
plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 2 +-
plat/imx/imx8m/imx8mp/include/platform_def.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
index 1e5d64da3..e5a629b91 100644
--- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
@@ -59,7 +59,7 @@ static const struct imx_rdc_cfg rdc[] = {
RDC_MDAn(RDC_MDA_M7, DID1),

/* peripherals domain permission */
- RDC_PDAPn(RDC_PDAP_UART2, D0R | D0W),
+ RDC_PDAPn(RDC_PDAP_UART1, D0R | D0W),

/* memory region */

diff --git a/plat/imx/imx8m/imx8mp/include/platform_def.h b/plat/imx/imx8m/imx8mp/include/platform_def.h
index ce279a567..56a0740ff 100644
--- a/plat/imx/imx8m/imx8mp/include/platform_def.h
+++ b/plat/imx/imx8m/imx8mp/include/platform_def.h
@@ -51,7 +51,7 @@

#define HAB_RVT_BASE U(0x00000900) /* HAB_RVT for i.MX8MM */

-#define IMX_BOOT_UART_BASE U(0x30890000)
+#define IMX_BOOT_UART_BASE U(0x30860000)
#define IMX_BOOT_UART_CLK_IN_HZ 24000000 /* Select 24MHz oscillator */

#define PLAT_CRASH_UART_BASE IMX_BOOT_UART_BASE
--
2.17.1

 

0 Kudos
4,480 Views
tetsuro-okuyama
Contributor V

Hi, @jimmychan 

Thank you for your reply!
I've already done what you told as attached(See diff_atf.patch).
#I'll build it again just in case.

Are there any other changes in imx-atf?


Best regards,

0 Kudos
4,465 Views
jimmychan
NXP TechSupport
NXP TechSupport

Basically, the uart setting in device tree file, the patch I mentioned above and the bootargs setting in u-boot.

4,443 Views
tetsuro-okuyama
Contributor V

Hi, @jimmychan 

I undo the "common/log.c" changes and it worked!
Thanks!

Best regards,

0 Kudos