Using UART via Grove Sensor Mezzanine on iMX7-96

Has anyone been using the Grove Sensor Mezzanine board with an iMX7-96? If so, do you happen to know what devicetree tweaks I need to make to direct a UART channel through to the USB-UART on the mezzanine? This port is connected to the UART1 lines which come in through the low speed header pins 11 and 13 which are connected (from what I can see on the iMX7 board schematic).

Thanks in advance.

Hi @sg4036,

Below diffs should get console on UART1:

U-Boot:
First apply following patches to mainline u-boot:
http://patchwork.ozlabs.org/patch/1128654/
http://patchwork.ozlabs.org/patch/1128655/

Then apply below diff for UART1 console:

diff --git a/board/novtech/meerkat96/meerkat96.c b/board/novtech/meerkat96/meerkat96.c
index 5fb4d43997..9bd5447597 100644
--- a/board/novtech/meerkat96/meerkat96.c
+++ b/board/novtech/meerkat96/meerkat96.c
@@ -19,9 +19,9 @@ DECLARE_GLOBAL_DATA_PTR;
                        PAD_CTL_PUS_PU100KOHM | PAD_CTL_HYS)
 
 static iomux_v3_cfg_t const meerkat96_pads[] = {
-       /* UART6 as debug serial */
-       MX7D_PAD_SD1_CD_B__UART6_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       MX7D_PAD_SD1_WP__UART6_DCE_TX   | MUX_PAD_CTRL(UART_PAD_CTRL),
+       /* UART1 as debug serial */
+       MX7D_PAD_UART1_RX_DATA__UART1_DCE_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
+       MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX   | MUX_PAD_CTRL(UART_PAD_CTRL),
        /* WDOG1 for reset */
        MX7D_PAD_GPIO1_IO00__WDOG1_WDOG_B | MUX_PAD_CTRL(NO_PAD_CTRL),
 };

Linux kernel:

First apply following patches to mainline kernel:

https://lkml.org/lkml/2019/6/13/151

Then apply below diff for UART1 console:

diff --git a/arch/arm/boot/dts/imx7d-meerkat96.dts b/arch/arm/boot/dts/imx7d-meerkat96.dts
index 2b610a5148d7..b33c93df672a 100644
--- a/arch/arm/boot/dts/imx7d-meerkat96.dts
+++ b/arch/arm/boot/dts/imx7d-meerkat96.dts
@@ -12,7 +12,7 @@
        compatible = "novtech,imx7d-meerkat96", "fsl,imx7d";
 
        chosen {
-               stdout-path = &uart6;
+               stdout-path = &uart1;
        };
 
        memory@80000000 {

Additionally, you might want to change the earlycon console to UART1 if you want to see full boot log.

Hope this helps!

Thanks,
Mani

That’s brilliant, thank you. I was very happy to see the mainline support for the board was coming soon, so thanks as well for that!

Hi

I had some time to test this today but I see the following issue when starting the new U-Boot. MMC support seems to no longer work:

MMC:
Loading Environment from MMC… MMC Device 0 not found
*** Warning - No MMC card found, using default environment

In: serial@30a80000
Out: serial@30a80000
Err: serial@30a80000
Net: CPU Net Initialization Failed
No ethernet found.
=>

Have you seen this before? The patches all seem to apply OK and the configuration and build succeed.

Note that this output is from the Meerkat UART pins - even with the changes to meerkat.c advised above I get nothing from the Grove Sensor USB Uart port.

Any ideas? Thanks in advance…
Simon

Hi @sg4036,

This looks wierd. Can you please share the .config and board dts via pastebin?

I haven’t tested this UART change yet. Will do it in couple of days.

Thanks,
Mani

Here are the files requested:

.config:
https://pastebin.com/s6ZP0vYx

devicetree source:
https://pastebin.com/EBTPBdxE

Thanks
Simon

Looks like something got changed in upstream u-boot for IMX7 MMC. You need to make below changes in meerkat96_defconfig

diff --git a/configs/meerkat96_defconfig b/configs/meerkat96_defconfig
index a2b5194679..f41c553278 100644
--- a/configs/meerkat96_defconfig
+++ b/configs/meerkat96_defconfig
@@ -33,7 +33,7 @@ CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM_GPIO=y
 CONFIG_MMC_BROKEN_CD=y
 CONFIG_DM_MMC=y
-CONFIG_FSL_ESDHC=y
+CONFIG_FSL_ESDHC_IMX=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX7=y
 CONFIG_DM_PMIC=y

Then, uSD will work