This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM6442: Using MCU_UART1 in Linux

Part Number: AM6442
Other Parts Discussed in Thread: SYSCONFIG

Hi,

we are struggling to enable the MCU_UART1 as two-pin uart on pads C9 and D9 from Linux.

A similar thread for I2C conceptionally is here

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1006780/am6442-using-mcu_i2c-in-linux

The question is:

Can you explain the usage of &wkup_pmx0 (sysconfig tool, other platforms like J7 and AM65) vs &cbass_mcu (in the above e2e thread)? Is there a fundamental difference between the AM64xx and other platforms?

The sysconfig outputs the following for the MCU_UART1 for the pinmux:

&wkup_pmx0 {
	mymcu_uart1_pins_default: mymcu_uart1_pins_default {
		pinctrl-single,pins = <
			AM64X_WKUP_IOPAD(0x0038, PIN_INPUT, 0) /* (C9) MCU_UART1_RXD */
			AM64X_WKUP_IOPAD(0x003c, PIN_OUTPUT, 0) /* (D9) MCU_UART1_TXD */
		>;
	};
};

However the e2e thread shows something like this (here for an MCU_UART1)

&cbass_mcu {
   mcu_uart1_pins_default: mcu-uart1-pins-default {
       pinctrl-single,pins = <
           AM64X_MCU_IOPAD(0x0038, PIN_INPUT, 0) /* (C9) MCU_UART1_RXD */
           AM64X_MCU_IOPAD(0x003c, PIN_INPUT, 0) /* (D9) MCU_UART1_TXD */
       >;
   };
};

However we are not able to make the UART1 work with either &cbass_mcu or &wkup_pmx0.

When we check the particular PADCONFIG for the two pins we also see that the pads are still in MUXMODE=7, and not 0.

Is there anything we are missing?

Thanks!

--Gunter

  • Hi all,

    correction, TXD is an output.

    &cbass_mcu {
       mcu_uart1_pins_default: mcu-uart1-pins-default {
           pinctrl-single,pins = <
               AM64X_MCU_IOPAD(0x0038, PIN_INPUT, 0) /* (C9) MCU_UART1_RXD */
               AM64X_MCU_IOPAD(0x003c, PIN_OUTPUT, 0) /* (D9) MCU_UART1_TXD */
           >;
       };
    };

    Regards,

    --Gunter

  • Hi Gunter,

    wkup_pmx0 is the padconfig controller DT node within the MCU domain (cbass_mcu). So the mcu_uart pinmux should be defined within &wkup_pmx0. Please apply the following 3 kernel patches on Processor SDK v8.0 kernel to enable mcu_uart1. I have validated it works on AM64x GPEVM.


    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/7077.0001_2D00_arm64_2D00_dts_2D00_ti_2D00_k3_2D00_am64_2D00_mcu_2D00_Add_2D00_support_2D00_for_2D00_wkup_2D00_pinmux.patch

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0002_2D00_arm64_2D00_dts_2D00_ti_2D00_k3_2D00_am642_2D00_evm_2D00_enable_2D00_mcu_5F00_uart1_2D00_with_2D00_pinm.patch

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0003_2D00_arm64_2D00_dts_2D00_ti_2D00_k3_2D00_am64_2D00_mcu_2D00_remove_2D00_clock_2D00_frequency_2D00_from.patch

    Please ensure the MCU MMR regions are unlocked in U-Boot. You can either use the U-Boot mw.l command described in https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1023542/am6442-mcu-uart-outputs-junk-data, or apply the following U-Boot patch and rebuild U-Boot.

    diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
    index 3871fe0002..85ded2176b 100644
    --- a/arch/arm/mach-k3/am642_init.c
    +++ b/arch/arm/mach-k3/am642_init.c
    @@ -30,6 +30,9 @@ static void ctrl_mmr_unlock(void)
     	/* Unlock all PADCFG_MMR1 module registers */
     	mmr_unlock(PADCFG_MMR1_BASE, 1);
     
    +	/* Unlock MCU_PADCFG_MMR1 module registers */
    +	mmr_unlock(MCU_PADCFG_MMR1_BASE, 1);
    +
     	/* Unlock all CTRL_MMR0 module registers */
     	mmr_unlock(CTRL_MMR0_BASE, 0);
     	mmr_unlock(CTRL_MMR0_BASE, 1);
    diff --git a/arch/arm/mach-k3/include/mach/am64_hardware.h b/arch/arm/mach-k3/include/mach/am64_hardware.h
    index b261871d7b..315c9a8c8f 100644
    --- a/arch/arm/mach-k3/include/mach/am64_hardware.h
    +++ b/arch/arm/mach-k3/include/mach/am64_hardware.h
    @@ -12,6 +12,8 @@
     
     #define PADCFG_MMR1_BASE				0xf0000
     
    +#define MCU_PADCFG_MMR1_BASE				0x4080000
    +
     #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_MASK		0x00000078
     #define MAIN_DEVSTAT_PRIMARY_BOOTMODE_SHIFT		3

  • Thanks, Bin! We are checking all your patches right now and will get back soon.