Want to swap Debug LPUART0 to LPUART2 - IMX8QXP

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

Want to swap Debug LPUART0 to LPUART2 - IMX8QXP

Jump to solution
2,132 Views
darsh_dev
Contributor V

Hi,

We want to swap the debug LPUART0 to LPUART2 for i.MX8QXP board. We are using the Linux Release - L5.4.3._2.0.0.

Without changing any code, we are able to see SCFW expected logs and added LED on changes in the uboot and also able to LED is glow ON as expected. Means SCFW and Uboot is up and running.

To enable the U-boot UART logs - LPUART2, we did changes Debug-uart-swap-from-uart0-to-uart2.patch. After this changes, SCFW gets stops, after few logs as shown 

 

Hello from SCU (Build 4384, Commit ba76011e, Mar 13 2020 22:28:55)
board_init(1)
board_init(4)
board_init_ddr(0)
SCFW: DDR frequency = 1200000000
board_system_config(0, 1)
board_set_voltage(A35, 1100, 0)
Start PMIC init
Finished  PMIC init
board_set_power_mode(A35, 0, 0, 3)
board_init(5)
board_init(2)
  ROM boot time = 196885 usec
      Boot time = 54070 usec
         Banner = 9 usec
           Init = 10431 usec
         Config = 2811 usec
            DDR = 12950 usec
        SConfig = 5820 usec
           Prep = 15193 usec
*** Debug Monitor ***
>$

 

 

and LED doen't glow, Uboot is also getting stuck/notworking.

Q: Any changes required for LPUART0/2 in uboot or SCFW code?

Thanks,

Tags (3)
0 Kudos
1 Solution
2,018 Views
darsh_dev
Contributor V

After removing below function board_quiesce_devices from board/freescale/imx8qxp_mek/imx8qxp_mek.c, able to jump to Linux kernel. [refer the previously attached patch - 0001-MEK-SWAP-LPUART0-to-LPUART2.zip]

 

void board_quiesce_devices()
{
    const char *power_on_devices[] = { 
        "dma_lpuart2",
        /* HIFI DSP boot */
        "audio_sai0",
        "audio_ocram",
    };  
    power_off_pd_devices(power_on_devices, ARRAY_SIZE(power_on_devices));
}

View solution in original post

Tags (3)
0 Kudos
11 Replies
2,122 Views
igorpadykov
NXP Employee
NXP Employee

Hi darshak_patel

 

additionally one can try

 

-&pd_dma_lpuart0 {

- debug_console;

-};

+&pd_dma_lpuart2 {

+ debug_console;

+};

 

also when building image pay attention to chip revision.

 

Best regards
igor

 

 

0 Kudos
2,104 Views
darsh_dev
Contributor V

@igorpadykov 

your suggested changes not seen/ can't apply it in the u-boot (#imx_v2019.04_5.4.3_2.0.0).

0 Kudos
2,087 Views
igorpadykov
NXP Employee
NXP Employee
0 Kudos
2,083 Views
darsh_dev
Contributor V

@igorpadykov 

you have shared the kernel related reference. We are seeking help for uboot related dts and UART2 changes.

0 Kudos
2,072 Views
igorpadykov
NXP Employee
NXP Employee

this is internal verified patch, suggest to rebuild all image

from scratch and try to debug where issue happens using AN12631

Normal and Secure Debug for i.MX8/8X Family of Applications Processors

 

Best regards
igor

0 Kudos
2,061 Views
darsh_dev
Contributor V

@igorpadykov, Thanks for sharing the App note.

this is internal verified patch, suggest to rebuild all image

which patch you point it out? I think you missed to attach.

 

We found the root cause, we want to enable the debug LPUART2 instead of LPUART0. But After enabled the LPUART0 clock from imx8qxp_mek.c fileas shown below, able to see the debug log LPUART2 (Why need to enable the LPUART0 clock?)

int board_early_init_f(void)
@@ -60,21 +60,25 @@ int board_early_init_f(void)
    /* Set UART0 clock root to 80 MHz */
    sc_pm_clock_rate_t rate = 80000000;

+   err = sc_pm_set_clock_rate(-1, SC_R_UART_0, SC_PM_CLK_PER, &rate);
+   if (err != SC_ERR_NONE)
+           return 0;
+
    /* Power up UART0 */
-   ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_0, SC_PM_PW_MODE_ON);
+   ret = sc_pm_set_resource_power_mode(-1, SC_R_UART_2, SC_PM_PW_MODE_ON);
    if (ret)
        return ret;

-   ret = sc_pm_set_clock_rate(-1, SC_R_UART_0, 2, &rate);
+   ret = sc_pm_set_clock_rate(-1, SC_R_UART_2, 2, &rate);
    if (ret)
        return ret;

    /* Enable UART0 clock root */
-   ret = sc_pm_clock_enable(-1, SC_R_UART_0, 2, true, false);
+   ret = sc_pm_clock_enable(-1, SC_R_UART_2, 2, true, false);
    if (ret)
        return ret;

-   lpcg_all_clock_on(LPUART_0_LPCG);
+   lpcg_all_clock_on(LPUART_2_LPCG);

    setup_iomux_uart();

 

0 Kudos
2,044 Views
igorpadykov
NXP Employee
NXP Employee

Hi darshak_patel

 

>which patch you point it out? I think you missed to attach.

 

patches were sent you separately in mail, with first answer.

 

Best regards
igor

0 Kudos
1,610 Views
vmuthusu
Contributor III

@igorpadykov can you share the linux patches. i am also facing a similar issue.

0 Kudos
2,036 Views
darsh_dev
Contributor V

Further Update, @igorpadykov 

After applying the attached patch for swap LPUART2 from LPUART0. We are able to see the uboot debug log as shown and stuck here.

 

 

U-Boot SPL 2019.04-5.4.3-2.0.0+gf7db37c (Oct 12 2020 - 14:58:48 +0000)
Normal Boot
Trying to boot from MMC2_2
Load image from MMC/SD 0x6b000
U-Boot 2019.04-5.4.3-2.0.0+gf7db37c (Oct 12 2020 - 14:58:48 +0000)
CPU:   NXP i.MX8QXP RevB A35 at 1200 MHz at 34C
Model: Einfochips i.MX8QXP AIML
Board: iMX8QXP MEK
Boot:  SD1
DRAM:  1.8 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... Run CMD11 1.8V switch
*** Warning - bad CRC, using default environment
In:    serial
Out:   serial
Err:   serial
 BuildInfo: 
  - SCFW ba76011e, SECO-FW dd989819, IMX-MKIMAGE 0fcc8296, ATF f1a195b
  - U-Boot 2019.04-5.4.3-2.0.0+gf7db37c 
Run CMD11 1.8V switch
switch to partitions #0, OK
mmc1 is current device
flash target is MMC:1
Run CMD11 1.8V switch
Net:   
Warning: ethernet@5b040000 (eth0) using random MAC address - fe:06:e9:7d:aa:99
eth0: ethernet@5b040000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
Run CMD11 1.8V switch
switch to partitions #0, OK
mmc1 is current device
Run CMD11 1.8V switch
27662848 bytes read in 324 ms (81.4 MiB/s)
Booting from mmc ...
89194 bytes read in 7 ms (12.2 MiB/s)
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 0000000083000000, end 0000000083018c69
Disable mu@31580000, resource id 505 not owned
Disable clock-controller@5a4d0000, resource id 62 not owned
Disable clock-controller@5ac90000, resource id 102 not owned

 

 

Not display the "Starting kernel ..." log here.

 

[FYI - No applied any other patches/changes in uboot/kernel.]

Any further logs expected on U-boot? or need to jump Kenel?

 

0 Kudos
2,019 Views
darsh_dev
Contributor V

After removing below function board_quiesce_devices from board/freescale/imx8qxp_mek/imx8qxp_mek.c, able to jump to Linux kernel. [refer the previously attached patch - 0001-MEK-SWAP-LPUART0-to-LPUART2.zip]

 

void board_quiesce_devices()
{
    const char *power_on_devices[] = { 
        "dma_lpuart2",
        /* HIFI DSP boot */
        "audio_sai0",
        "audio_ocram",
    };  
    power_off_pd_devices(power_on_devices, ARRAY_SIZE(power_on_devices));
}
Tags (3)
0 Kudos
1,628 Views
vmuthusu
Contributor III

Hi

I am also facing a similar issue. We have ported the U-BOOT 2020.04 and Linux 5.10.9 onto our custom board based on IMX8QXP.

We have LPUART1 for the Linux Console debug. 

When we run it we could see the U-BOOT logs on the debug console and finally Starting kernel message after that nothing on the console.

Could you please help me with the required changes.

Is there any changes needed from the Kernel DTS file side?

 

Thanks

V.Muthusubramanian

0 Kudos